ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
12 participants
287 discussions
Start a n
N
ew thread
[ekohl] 57832: [LSASRV] Implement LsarSetServerRole, LsarSetModification and LsarSetAuditFull.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Dec 8 23:12:30 2012 New Revision: 57832 URL:
http://svn.reactos.org/svn/reactos?rev=57832&view=rev
Log: [LSASRV] Implement LsarSetServerRole, LsarSetModification and LsarSetAuditFull. Modified: trunk/reactos/dll/win32/lsasrv/policy.c Modified: trunk/reactos/dll/win32/lsasrv/policy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/lsasrv/policy.c?…
============================================================================== --- trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/lsasrv/policy.c [iso-8859-1] Sat Dec 8 23:12:30 2012 @@ -238,7 +238,7 @@ Done: if (!NT_SUCCESS(Status)) { - if (p) + if (p != NULL) { if (p->Name.Buffer) MIDL_user_free(p->Name.Buffer); @@ -886,8 +886,12 @@ LsarSetServerRole(PLSA_DB_OBJECT PolicyObject, PPOLICY_LSA_SERVER_ROLE_INFO Info) { - FIXME("\n"); - return STATUS_NOT_IMPLEMENTED; + TRACE("(%p %p)\n", PolicyObject, Info); + + return LsapSetObjectAttribute(PolicyObject, + L"PolSrvRo", + Info, + sizeof(POLICY_LSA_SERVER_ROLE_INFO)); } @@ -917,14 +921,64 @@ LsarSetModification(PLSA_DB_OBJECT PolicyObject, PPOLICY_MODIFICATION_INFO Info) { + TRACE("(%p %p)\n", PolicyObject, Info); + + return LsapSetObjectAttribute(PolicyObject, + L"PolMod", + Info, + sizeof(POLICY_MODIFICATION_INFO)); +} + + +NTSTATUS +LsarSetAuditFull(PLSA_DB_OBJECT PolicyObject, + PPOLICY_AUDIT_FULL_QUERY_INFO Info) +{ + PPOLICY_AUDIT_FULL_QUERY_INFO AuditFullInfo = NULL; + ULONG AttributeSize; + NTSTATUS Status; + + TRACE("(%p %p)\n", PolicyObject, Info); + + AttributeSize = sizeof(POLICY_AUDIT_FULL_QUERY_INFO); + AuditFullInfo = MIDL_user_allocate(AttributeSize); + if (AuditFullInfo == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + Status = LsapGetObjectAttribute(PolicyObject, + L"PolAdtFl", + AuditFullInfo, + &AttributeSize); + if (!NT_SUCCESS(Status)) + goto done; + + AuditFullInfo->ShutDownOnFull = Info->ShutDownOnFull; + + Status = LsapSetObjectAttribute(PolicyObject, + L"PolAdtFl", + AuditFullInfo, + AttributeSize); + +done: + if (AuditFullInfo != NULL) + MIDL_user_free(AuditFullInfo); + + return Status; +} + + +NTSTATUS +LsarSetDnsDomain(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_DNS_DOMAIN_INFO Info) +{ FIXME("\n"); return STATUS_NOT_IMPLEMENTED; } NTSTATUS -LsarSetAuditFull(PLSA_DB_OBJECT PolicyObject, - PPOLICY_AUDIT_FULL_QUERY_INFO Info) +LsarSetDnsDomainInt(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_DNS_DOMAIN_INFO Info) { FIXME("\n"); return STATUS_NOT_IMPLEMENTED; @@ -932,29 +986,11 @@ NTSTATUS -LsarSetDnsDomain(PLSA_DB_OBJECT PolicyObject, - PLSAPR_POLICY_DNS_DOMAIN_INFO Info) +LsarSetLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, + PLSAPR_POLICY_ACCOUNT_DOM_INFO Info) { FIXME("\n"); return STATUS_NOT_IMPLEMENTED; } - -NTSTATUS -LsarSetDnsDomainInt(PLSA_DB_OBJECT PolicyObject, - PLSAPR_POLICY_DNS_DOMAIN_INFO Info) -{ - FIXME("\n"); - return STATUS_NOT_IMPLEMENTED; -} - - -NTSTATUS -LsarSetLocalAccountDomain(PLSA_DB_OBJECT PolicyObject, - PLSAPR_POLICY_ACCOUNT_DOM_INFO Info) -{ - FIXME("\n"); - return STATUS_NOT_IMPLEMENTED; -} - /* EOF */
12 years
1
0
0
0
[jgardou] 57831: [KERNEL32] - Formatting, no code change
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 22:24:56 2012 New Revision: 57831 URL:
http://svn.reactos.org/svn/reactos?rev=57831&view=rev
Log: [KERNEL32] - Formatting, no code change Modified: trunk/reactos/dll/win32/kernel32/client/file/copy.c Modified: trunk/reactos/dll/win32/kernel32/client/file/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/copy.c [iso-8859-1] Sat Dec 8 22:24:56 2012 @@ -25,171 +25,171 @@ static NTSTATUS CopyLoop ( - HANDLE FileHandleSource, - HANDLE FileHandleDest, - LARGE_INTEGER SourceFileSize, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - BOOL *KeepDest - ) -{ - NTSTATUS errCode; - IO_STATUS_BLOCK IoStatusBlock; - UCHAR *lpBuffer = NULL; - SIZE_T RegionSize = 0x10000; - LARGE_INTEGER BytesCopied; - DWORD CallbackReason; - DWORD ProgressResult; - BOOL EndOfFileFound; - - *KeepDest = FALSE; - errCode = NtAllocateVirtualMemory(NtCurrentProcess(), - (PVOID *)&lpBuffer, - 0, - &RegionSize, - MEM_RESERVE | MEM_COMMIT, - PAGE_READWRITE); - - if (NT_SUCCESS(errCode)) - { - BytesCopied.QuadPart = 0; - EndOfFileFound = FALSE; - CallbackReason = CALLBACK_STREAM_SWITCH; - while (! EndOfFileFound && - NT_SUCCESS(errCode) && - (NULL == pbCancel || ! *pbCancel)) - { - if (NULL != lpProgressRoutine) - { - ProgressResult = (*lpProgressRoutine)(SourceFileSize, - BytesCopied, - SourceFileSize, - BytesCopied, - 0, - CallbackReason, - FileHandleSource, - FileHandleDest, - lpData); - switch (ProgressResult) - { - case PROGRESS_CANCEL: - TRACE("Progress callback requested cancel\n"); - errCode = STATUS_REQUEST_ABORTED; - break; - case PROGRESS_STOP: - TRACE("Progress callback requested stop\n"); - errCode = STATUS_REQUEST_ABORTED; - *KeepDest = TRUE; - break; - case PROGRESS_QUIET: - lpProgressRoutine = NULL; - break; - case PROGRESS_CONTINUE: - default: - break; - } - CallbackReason = CALLBACK_CHUNK_FINISHED; - } - if (NT_SUCCESS(errCode)) - { - errCode = NtReadFile(FileHandleSource, - NULL, - NULL, - NULL, - (PIO_STATUS_BLOCK)&IoStatusBlock, - lpBuffer, - RegionSize, - NULL, - NULL); - if (NT_SUCCESS(errCode) && (NULL == pbCancel || ! *pbCancel)) - { - errCode = NtWriteFile(FileHandleDest, - NULL, - NULL, - NULL, - (PIO_STATUS_BLOCK)&IoStatusBlock, - lpBuffer, - IoStatusBlock.Information, - NULL, - NULL); - if (NT_SUCCESS(errCode)) - { - BytesCopied.QuadPart += IoStatusBlock.Information; - } - else - { - WARN("Error 0x%08x reading writing to dest\n", errCode); - } - } - else if (!NT_SUCCESS(errCode)) - { - if (STATUS_END_OF_FILE == errCode) - { - EndOfFileFound = TRUE; - errCode = STATUS_SUCCESS; - } - else - { - WARN("Error 0x%08x reading from source\n", errCode); - } - } - } - } - - if (! EndOfFileFound && (NULL != pbCancel && *pbCancel)) - { - TRACE("User requested cancel\n"); - errCode = STATUS_REQUEST_ABORTED; - } - - NtFreeVirtualMemory(NtCurrentProcess(), - (PVOID *)&lpBuffer, - &RegionSize, - MEM_RELEASE); - } - else - { - TRACE("Error 0x%08x allocating buffer of %d bytes\n", errCode, RegionSize); - } - - return errCode; + HANDLE FileHandleSource, + HANDLE FileHandleDest, + LARGE_INTEGER SourceFileSize, + LPPROGRESS_ROUTINE lpProgressRoutine, + LPVOID lpData, + BOOL *pbCancel, + BOOL *KeepDest +) +{ + NTSTATUS errCode; + IO_STATUS_BLOCK IoStatusBlock; + UCHAR *lpBuffer = NULL; + SIZE_T RegionSize = 0x10000; + LARGE_INTEGER BytesCopied; + DWORD CallbackReason; + DWORD ProgressResult; + BOOL EndOfFileFound; + + *KeepDest = FALSE; + errCode = NtAllocateVirtualMemory(NtCurrentProcess(), + (PVOID *)&lpBuffer, + 0, + &RegionSize, + MEM_RESERVE | MEM_COMMIT, + PAGE_READWRITE); + + if (NT_SUCCESS(errCode)) + { + BytesCopied.QuadPart = 0; + EndOfFileFound = FALSE; + CallbackReason = CALLBACK_STREAM_SWITCH; + while (! EndOfFileFound && + NT_SUCCESS(errCode) && + (NULL == pbCancel || ! *pbCancel)) + { + if (NULL != lpProgressRoutine) + { + ProgressResult = (*lpProgressRoutine)(SourceFileSize, + BytesCopied, + SourceFileSize, + BytesCopied, + 0, + CallbackReason, + FileHandleSource, + FileHandleDest, + lpData); + switch (ProgressResult) + { + case PROGRESS_CANCEL: + TRACE("Progress callback requested cancel\n"); + errCode = STATUS_REQUEST_ABORTED; + break; + case PROGRESS_STOP: + TRACE("Progress callback requested stop\n"); + errCode = STATUS_REQUEST_ABORTED; + *KeepDest = TRUE; + break; + case PROGRESS_QUIET: + lpProgressRoutine = NULL; + break; + case PROGRESS_CONTINUE: + default: + break; + } + CallbackReason = CALLBACK_CHUNK_FINISHED; + } + if (NT_SUCCESS(errCode)) + { + errCode = NtReadFile(FileHandleSource, + NULL, + NULL, + NULL, + (PIO_STATUS_BLOCK)&IoStatusBlock, + lpBuffer, + RegionSize, + NULL, + NULL); + if (NT_SUCCESS(errCode) && (NULL == pbCancel || ! *pbCancel)) + { + errCode = NtWriteFile(FileHandleDest, + NULL, + NULL, + NULL, + (PIO_STATUS_BLOCK)&IoStatusBlock, + lpBuffer, + IoStatusBlock.Information, + NULL, + NULL); + if (NT_SUCCESS(errCode)) + { + BytesCopied.QuadPart += IoStatusBlock.Information; + } + else + { + WARN("Error 0x%08x reading writing to dest\n", errCode); + } + } + else if (!NT_SUCCESS(errCode)) + { + if (STATUS_END_OF_FILE == errCode) + { + EndOfFileFound = TRUE; + errCode = STATUS_SUCCESS; + } + else + { + WARN("Error 0x%08x reading from source\n", errCode); + } + } + } + } + + if (! EndOfFileFound && (NULL != pbCancel && *pbCancel)) + { + TRACE("User requested cancel\n"); + errCode = STATUS_REQUEST_ABORTED; + } + + NtFreeVirtualMemory(NtCurrentProcess(), + (PVOID *)&lpBuffer, + &RegionSize, + MEM_RELEASE); + } + else + { + TRACE("Error 0x%08x allocating buffer of %d bytes\n", errCode, RegionSize); + } + + return errCode; } static NTSTATUS SetLastWriteTime( - HANDLE FileHandle, - LARGE_INTEGER LastWriteTime - ) -{ - NTSTATUS errCode = STATUS_SUCCESS; - IO_STATUS_BLOCK IoStatusBlock; - FILE_BASIC_INFORMATION FileBasic; - - errCode = NtQueryInformationFile (FileHandle, - &IoStatusBlock, - &FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(errCode)) - { - WARN("Error 0x%08x obtaining FileBasicInformation\n", errCode); - } - else - { - FileBasic.LastWriteTime.QuadPart = LastWriteTime.QuadPart; - errCode = NtSetInformationFile (FileHandle, - &IoStatusBlock, - &FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(errCode)) - { - WARN("Error 0x%0x setting LastWriteTime\n", errCode); - } - } - - return errCode; + HANDLE FileHandle, + LARGE_INTEGER LastWriteTime +) +{ + NTSTATUS errCode = STATUS_SUCCESS; + IO_STATUS_BLOCK IoStatusBlock; + FILE_BASIC_INFORMATION FileBasic; + + errCode = NtQueryInformationFile (FileHandle, + &IoStatusBlock, + &FileBasic, + sizeof(FILE_BASIC_INFORMATION), + FileBasicInformation); + if (!NT_SUCCESS(errCode)) + { + WARN("Error 0x%08x obtaining FileBasicInformation\n", errCode); + } + else + { + FileBasic.LastWriteTime.QuadPart = LastWriteTime.QuadPart; + errCode = NtSetInformationFile (FileHandle, + &IoStatusBlock, + &FileBasic, + sizeof(FILE_BASIC_INFORMATION), + FileBasicInformation); + if (!NT_SUCCESS(errCode)) + { + WARN("Error 0x%0x setting LastWriteTime\n", errCode); + } + } + + return errCode; } @@ -199,113 +199,113 @@ BOOL WINAPI CopyFileExW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - DWORD dwCopyFlags - ) -{ - NTSTATUS errCode; - HANDLE FileHandleSource, FileHandleDest; - IO_STATUS_BLOCK IoStatusBlock; - FILE_STANDARD_INFORMATION FileStandard; - FILE_BASIC_INFORMATION FileBasic; - BOOL RC = FALSE; - BOOL KeepDestOnError = FALSE; - DWORD SystemError; - - FileHandleSource = CreateFileW(lpExistingFileName, - GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL|FILE_FLAG_NO_BUFFERING, - NULL); - if (INVALID_HANDLE_VALUE != FileHandleSource) - { - errCode = NtQueryInformationFile(FileHandleSource, - &IoStatusBlock, - &FileStandard, - sizeof(FILE_STANDARD_INFORMATION), - FileStandardInformation); - if (!NT_SUCCESS(errCode)) - { - TRACE("Status 0x%08x obtaining FileStandardInformation for source\n", errCode); - BaseSetLastNTError(errCode); - } - else - { - errCode = NtQueryInformationFile(FileHandleSource, - &IoStatusBlock,&FileBasic, - sizeof(FILE_BASIC_INFORMATION), - FileBasicInformation); - if (!NT_SUCCESS(errCode)) - { - TRACE("Status 0x%08x obtaining FileBasicInformation for source\n", errCode); - BaseSetLastNTError(errCode); - } - else - { - FileHandleDest = CreateFileW(lpNewFileName, - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - dwCopyFlags ? CREATE_NEW : CREATE_ALWAYS, - FileBasic.FileAttributes, - NULL); - if (INVALID_HANDLE_VALUE != FileHandleDest) - { - errCode = CopyLoop(FileHandleSource, - FileHandleDest, - FileStandard.EndOfFile, - lpProgressRoutine, - lpData, - pbCancel, - &KeepDestOnError); - if (!NT_SUCCESS(errCode)) - { - BaseSetLastNTError(errCode); - } - else - { - LARGE_INTEGER t; - - t.QuadPart = FileBasic.LastWriteTime.QuadPart; - errCode = SetLastWriteTime(FileHandleDest, t); - if (!NT_SUCCESS(errCode)) - { - BaseSetLastNTError(errCode); - } - else - { - RC = TRUE; - } - } - NtClose(FileHandleDest); - if (! RC && ! KeepDestOnError) - { - SystemError = GetLastError(); - SetFileAttributesW(lpNewFileName, FILE_ATTRIBUTE_NORMAL); - DeleteFileW(lpNewFileName); - SetLastError(SystemError); - } - } - else - { - WARN("Error %d during opening of dest file\n", GetLastError()); - } - } - } - NtClose(FileHandleSource); - } - else - { - WARN("Error %d during opening of source file\n", GetLastError()); - } - - return RC; + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName, + LPPROGRESS_ROUTINE lpProgressRoutine, + LPVOID lpData, + BOOL *pbCancel, + DWORD dwCopyFlags +) +{ + NTSTATUS errCode; + HANDLE FileHandleSource, FileHandleDest; + IO_STATUS_BLOCK IoStatusBlock; + FILE_STANDARD_INFORMATION FileStandard; + FILE_BASIC_INFORMATION FileBasic; + BOOL RC = FALSE; + BOOL KeepDestOnError = FALSE; + DWORD SystemError; + + FileHandleSource = CreateFileW(lpExistingFileName, + GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL|FILE_FLAG_NO_BUFFERING, + NULL); + if (INVALID_HANDLE_VALUE != FileHandleSource) + { + errCode = NtQueryInformationFile(FileHandleSource, + &IoStatusBlock, + &FileStandard, + sizeof(FILE_STANDARD_INFORMATION), + FileStandardInformation); + if (!NT_SUCCESS(errCode)) + { + TRACE("Status 0x%08x obtaining FileStandardInformation for source\n", errCode); + BaseSetLastNTError(errCode); + } + else + { + errCode = NtQueryInformationFile(FileHandleSource, + &IoStatusBlock,&FileBasic, + sizeof(FILE_BASIC_INFORMATION), + FileBasicInformation); + if (!NT_SUCCESS(errCode)) + { + TRACE("Status 0x%08x obtaining FileBasicInformation for source\n", errCode); + BaseSetLastNTError(errCode); + } + else + { + FileHandleDest = CreateFileW(lpNewFileName, + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + dwCopyFlags ? CREATE_NEW : CREATE_ALWAYS, + FileBasic.FileAttributes, + NULL); + if (INVALID_HANDLE_VALUE != FileHandleDest) + { + errCode = CopyLoop(FileHandleSource, + FileHandleDest, + FileStandard.EndOfFile, + lpProgressRoutine, + lpData, + pbCancel, + &KeepDestOnError); + if (!NT_SUCCESS(errCode)) + { + BaseSetLastNTError(errCode); + } + else + { + LARGE_INTEGER t; + + t.QuadPart = FileBasic.LastWriteTime.QuadPart; + errCode = SetLastWriteTime(FileHandleDest, t); + if (!NT_SUCCESS(errCode)) + { + BaseSetLastNTError(errCode); + } + else + { + RC = TRUE; + } + } + NtClose(FileHandleDest); + if (! RC && ! KeepDestOnError) + { + SystemError = GetLastError(); + SetFileAttributesW(lpNewFileName, FILE_ATTRIBUTE_NORMAL); + DeleteFileW(lpNewFileName); + SetLastError(SystemError); + } + } + else + { + WARN("Error %d during opening of dest file\n", GetLastError()); + } + } + } + NtClose(FileHandleSource); + } + else + { + WARN("Error %d during opening of source file\n", GetLastError()); + } + + return RC; } @@ -353,17 +353,17 @@ BOOL WINAPI CopyFileA ( - LPCSTR lpExistingFileName, - LPCSTR lpNewFileName, - BOOL bFailIfExists - ) -{ - return CopyFileExA (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); + LPCSTR lpExistingFileName, + LPCSTR lpNewFileName, + BOOL bFailIfExists +) +{ + return CopyFileExA (lpExistingFileName, + lpNewFileName, + NULL, + NULL, + NULL, + bFailIfExists); } @@ -373,17 +373,17 @@ BOOL WINAPI CopyFileW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - BOOL bFailIfExists - ) -{ - return CopyFileExW (lpExistingFileName, - lpNewFileName, - NULL, - NULL, - NULL, - bFailIfExists); + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName, + BOOL bFailIfExists +) +{ + return CopyFileExW (lpExistingFileName, + lpNewFileName, + NULL, + NULL, + NULL, + bFailIfExists); } @@ -393,13 +393,13 @@ BOOL WINAPI PrivCopyFileExW ( - LPCWSTR lpExistingFileName, - LPCWSTR lpNewFileName, - LPPROGRESS_ROUTINE lpProgressRoutine, - LPVOID lpData, - BOOL *pbCancel, - DWORD dwCopyFlags - ) + LPCWSTR lpExistingFileName, + LPCWSTR lpNewFileName, + LPPROGRESS_ROUTINE lpProgressRoutine, + LPVOID lpData, + BOOL *pbCancel, + DWORD dwCopyFlags +) { UNIMPLEMENTED; return FALSE;
12 years
1
0
0
0
[jgardou] 57830: [USERENV] - Formatting, no code change
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 22:11:41 2012 New Revision: 57830 URL:
http://svn.reactos.org/svn/reactos?rev=57830&view=rev
Log: [USERENV] - Formatting, no code change Modified: trunk/reactos/dll/win32/userenv/directory.c Modified: trunk/reactos/dll/win32/userenv/directory.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/director…
============================================================================== --- trunk/reactos/dll/win32/userenv/directory.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/userenv/directory.c [iso-8859-1] Sat Dec 8 22:11:41 2012 @@ -35,301 +35,301 @@ BOOL WINAPI CopyProfileDirectoryA(LPCSTR lpSourcePath, - LPCSTR lpDestinationPath, - DWORD dwFlags) -{ - UNICODE_STRING SrcPath; - UNICODE_STRING DstPath; - NTSTATUS Status; - BOOL bResult; - - Status = RtlCreateUnicodeStringFromAsciiz(&SrcPath, - (LPSTR)lpSourcePath); - if (!NT_SUCCESS(Status)) - { - SetLastError (RtlNtStatusToDosError (Status)); - return FALSE; - } - - Status = RtlCreateUnicodeStringFromAsciiz(&DstPath, - (LPSTR)lpDestinationPath); - if (!NT_SUCCESS(Status)) - { - RtlFreeUnicodeString(&SrcPath); - SetLastError (RtlNtStatusToDosError (Status)); - return FALSE; - } - - bResult = CopyProfileDirectoryW(SrcPath.Buffer, - DstPath.Buffer, - dwFlags); - - RtlFreeUnicodeString(&DstPath); - RtlFreeUnicodeString(&SrcPath); - - return bResult; + LPCSTR lpDestinationPath, + DWORD dwFlags) +{ + UNICODE_STRING SrcPath; + UNICODE_STRING DstPath; + NTSTATUS Status; + BOOL bResult; + + Status = RtlCreateUnicodeStringFromAsciiz(&SrcPath, + (LPSTR)lpSourcePath); + if (!NT_SUCCESS(Status)) + { + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + Status = RtlCreateUnicodeStringFromAsciiz(&DstPath, + (LPSTR)lpDestinationPath); + if (!NT_SUCCESS(Status)) + { + RtlFreeUnicodeString(&SrcPath); + SetLastError (RtlNtStatusToDosError (Status)); + return FALSE; + } + + bResult = CopyProfileDirectoryW(SrcPath.Buffer, + DstPath.Buffer, + dwFlags); + + RtlFreeUnicodeString(&DstPath); + RtlFreeUnicodeString(&SrcPath); + + return bResult; } BOOL WINAPI CopyProfileDirectoryW(LPCWSTR lpSourcePath, - LPCWSTR lpDestinationPath, - DWORD dwFlags) -{ - /* FIXME: dwFlags are ignored! */ - return CopyDirectory(lpDestinationPath, lpSourcePath); + LPCWSTR lpDestinationPath, + DWORD dwFlags) +{ + /* FIXME: dwFlags are ignored! */ + return CopyDirectory(lpDestinationPath, lpSourcePath); } BOOL CopyDirectory (LPCWSTR lpDestinationPath, - LPCWSTR lpSourcePath) -{ - WCHAR szFileName[MAX_PATH]; - WCHAR szFullSrcName[MAX_PATH]; - WCHAR szFullDstName[MAX_PATH]; - WIN32_FIND_DATAW FindFileData; - LPWSTR lpSrcPtr; - LPWSTR lpDstPtr; - HANDLE hFind; - - DPRINT ("CopyDirectory (%S, %S) called\n", - lpDestinationPath, lpSourcePath); - - wcscpy (szFileName, lpSourcePath); - wcscat (szFileName, L"\\*.*"); - - hFind = FindFirstFileW (szFileName, - &FindFileData); - if (hFind == INVALID_HANDLE_VALUE) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - return FALSE; - } - - wcscpy (szFullSrcName, lpSourcePath); - lpSrcPtr = AppendBackslash (szFullSrcName); - - wcscpy (szFullDstName, lpDestinationPath); - lpDstPtr = AppendBackslash (szFullDstName); - - for (;;) - { - if (wcscmp (FindFileData.cFileName, L".") && - wcscmp (FindFileData.cFileName, L"..")) - { - wcscpy (lpSrcPtr, FindFileData.cFileName); - wcscpy (lpDstPtr, FindFileData.cFileName); - - if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - DPRINT ("Create directory: %S\n", szFullDstName); - if (!CreateDirectoryExW (szFullSrcName, szFullDstName, NULL)) - { - if (GetLastError () != ERROR_ALREADY_EXISTS) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - - FindClose (hFind); - return FALSE; - } - } - - if (!CopyDirectory (szFullDstName, szFullSrcName)) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - - FindClose (hFind); - return FALSE; - } - } - else - { - DPRINT ("Copy file: %S -> %S\n", szFullSrcName, szFullDstName); - if (!CopyFileW (szFullSrcName, szFullDstName, FALSE)) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - - FindClose (hFind); - return FALSE; - } - } - } - - if (!FindNextFileW (hFind, &FindFileData)) - { - if (GetLastError () != ERROR_NO_MORE_FILES) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - } - - break; - } - } - - FindClose (hFind); - - DPRINT ("CopyDirectory() done\n"); - - return TRUE; + LPCWSTR lpSourcePath) +{ + WCHAR szFileName[MAX_PATH]; + WCHAR szFullSrcName[MAX_PATH]; + WCHAR szFullDstName[MAX_PATH]; + WIN32_FIND_DATAW FindFileData; + LPWSTR lpSrcPtr; + LPWSTR lpDstPtr; + HANDLE hFind; + + DPRINT ("CopyDirectory (%S, %S) called\n", + lpDestinationPath, lpSourcePath); + + wcscpy (szFileName, lpSourcePath); + wcscat (szFileName, L"\\*.*"); + + hFind = FindFirstFileW (szFileName, + &FindFileData); + if (hFind == INVALID_HANDLE_VALUE) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + return FALSE; + } + + wcscpy (szFullSrcName, lpSourcePath); + lpSrcPtr = AppendBackslash (szFullSrcName); + + wcscpy (szFullDstName, lpDestinationPath); + lpDstPtr = AppendBackslash (szFullDstName); + + for (;;) + { + if (wcscmp (FindFileData.cFileName, L".") && + wcscmp (FindFileData.cFileName, L"..")) + { + wcscpy (lpSrcPtr, FindFileData.cFileName); + wcscpy (lpDstPtr, FindFileData.cFileName); + + if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + DPRINT ("Create directory: %S\n", szFullDstName); + if (!CreateDirectoryExW (szFullSrcName, szFullDstName, NULL)) + { + if (GetLastError () != ERROR_ALREADY_EXISTS) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + + FindClose (hFind); + return FALSE; + } + } + + if (!CopyDirectory (szFullDstName, szFullSrcName)) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + + FindClose (hFind); + return FALSE; + } + } + else + { + DPRINT ("Copy file: %S -> %S\n", szFullSrcName, szFullDstName); + if (!CopyFileW (szFullSrcName, szFullDstName, FALSE)) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + + FindClose (hFind); + return FALSE; + } + } + } + + if (!FindNextFileW (hFind, &FindFileData)) + { + if (GetLastError () != ERROR_NO_MORE_FILES) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + } + + break; + } + } + + FindClose (hFind); + + DPRINT ("CopyDirectory() done\n"); + + return TRUE; } BOOL CreateDirectoryPath (LPCWSTR lpPathName, - LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ - WCHAR szPath[MAX_PATH]; - LPWSTR Ptr; - DWORD dwError; - - DPRINT ("CreateDirectoryPath() called\n"); - - if (lpPathName == NULL || *lpPathName == 0) + LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ + WCHAR szPath[MAX_PATH]; + LPWSTR Ptr; + DWORD dwError; + + DPRINT ("CreateDirectoryPath() called\n"); + + if (lpPathName == NULL || *lpPathName == 0) + return TRUE; + + if (CreateDirectoryW (lpPathName, + lpSecurityAttributes)) + return TRUE; + + dwError = GetLastError (); + if (dwError == ERROR_ALREADY_EXISTS) + return TRUE; + + wcscpy (szPath, lpPathName); + + if (wcslen(szPath) > 3 && szPath[1] == ':' && szPath[2] == '\\') + { + Ptr = &szPath[3]; + } + else + { + Ptr = szPath; + } + + while (Ptr != NULL) + { + Ptr = wcschr (Ptr, L'\\'); + if (Ptr != NULL) + *Ptr = 0; + + DPRINT ("CreateDirectory(%S)\n", szPath); + if (!CreateDirectoryW (szPath, + lpSecurityAttributes)) + { + dwError = GetLastError (); + if (dwError != ERROR_ALREADY_EXISTS) + return FALSE; + } + + if (Ptr != NULL) + { + *Ptr = L'\\'; + Ptr++; + } + } + + DPRINT ("CreateDirectoryPath() done\n"); + return TRUE; - - if (CreateDirectoryW (lpPathName, - lpSecurityAttributes)) - return TRUE; - - dwError = GetLastError (); - if (dwError == ERROR_ALREADY_EXISTS) - return TRUE; - - wcscpy (szPath, lpPathName); - - if (wcslen(szPath) > 3 && szPath[1] == ':' && szPath[2] == '\\') - { - Ptr = &szPath[3]; - } - else - { - Ptr = szPath; - } - - while (Ptr != NULL) - { - Ptr = wcschr (Ptr, L'\\'); - if (Ptr != NULL) - *Ptr = 0; - - DPRINT ("CreateDirectory(%S)\n", szPath); - if (!CreateDirectoryW (szPath, - lpSecurityAttributes)) - { - dwError = GetLastError (); - if (dwError != ERROR_ALREADY_EXISTS) - return FALSE; - } - - if (Ptr != NULL) - { - *Ptr = L'\\'; - Ptr++; - } - } - - DPRINT ("CreateDirectoryPath() done\n"); - - return TRUE; } static BOOL RecursiveRemoveDir (LPCWSTR lpPath) { - WCHAR szPath[MAX_PATH]; - WIN32_FIND_DATAW FindData; - HANDLE hFind; - BOOL bResult; - - wcscpy (szPath, lpPath); - wcscat (szPath, L"\\*.*"); - DPRINT ("Search path: '%S'\n", szPath); - - hFind = FindFirstFileW (szPath, - &FindData); - if (hFind == INVALID_HANDLE_VALUE) - return FALSE; - - bResult = TRUE; - while (TRUE) - { - if (wcscmp (FindData.cFileName, L".") && - wcscmp (FindData.cFileName, L"..")) - { - wcscpy (szPath, lpPath); - wcscat (szPath, L"\\"); - wcscat (szPath, FindData.cFileName); - DPRINT ("File name: '%S'\n", szPath); - - if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - DPRINT ("Delete directory: '%S'\n", szPath); - - if (!RecursiveRemoveDir (szPath)) - { - bResult = FALSE; - break; - } - - if (FindData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) - { - SetFileAttributesW (szPath, - FindData.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY); - } - - if (!RemoveDirectoryW (szPath)) - { - bResult = FALSE; - break; - } - } - else - { - DPRINT ("Delete file: '%S'\n", szPath); - - if (FindData.dwFileAttributes & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)) - { - SetFileAttributesW (szPath, - FILE_ATTRIBUTE_NORMAL); - } - - if (!DeleteFileW (szPath)) - { - bResult = FALSE; - break; - } - } - } - - if (!FindNextFileW (hFind, &FindData)) - { - if (GetLastError () != ERROR_NO_MORE_FILES) - { - DPRINT1 ("Error: %lu\n", GetLastError()); - bResult = FALSE; - break; - } - - break; - } - } - - FindClose (hFind); - - return bResult; + WCHAR szPath[MAX_PATH]; + WIN32_FIND_DATAW FindData; + HANDLE hFind; + BOOL bResult; + + wcscpy (szPath, lpPath); + wcscat (szPath, L"\\*.*"); + DPRINT ("Search path: '%S'\n", szPath); + + hFind = FindFirstFileW (szPath, + &FindData); + if (hFind == INVALID_HANDLE_VALUE) + return FALSE; + + bResult = TRUE; + while (TRUE) + { + if (wcscmp (FindData.cFileName, L".") && + wcscmp (FindData.cFileName, L"..")) + { + wcscpy (szPath, lpPath); + wcscat (szPath, L"\\"); + wcscat (szPath, FindData.cFileName); + DPRINT ("File name: '%S'\n", szPath); + + if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + DPRINT ("Delete directory: '%S'\n", szPath); + + if (!RecursiveRemoveDir (szPath)) + { + bResult = FALSE; + break; + } + + if (FindData.dwFileAttributes & FILE_ATTRIBUTE_READONLY) + { + SetFileAttributesW (szPath, + FindData.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY); + } + + if (!RemoveDirectoryW (szPath)) + { + bResult = FALSE; + break; + } + } + else + { + DPRINT ("Delete file: '%S'\n", szPath); + + if (FindData.dwFileAttributes & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM)) + { + SetFileAttributesW (szPath, + FILE_ATTRIBUTE_NORMAL); + } + + if (!DeleteFileW (szPath)) + { + bResult = FALSE; + break; + } + } + } + + if (!FindNextFileW (hFind, &FindData)) + { + if (GetLastError () != ERROR_NO_MORE_FILES) + { + DPRINT1 ("Error: %lu\n", GetLastError()); + bResult = FALSE; + break; + } + + break; + } + } + + FindClose (hFind); + + return bResult; } BOOL RemoveDirectoryPath (LPCWSTR lpPathName) { - if (!RecursiveRemoveDir (lpPathName)) - return FALSE; - - DPRINT ("Delete directory: '%S'\n", lpPathName); - return RemoveDirectoryW (lpPathName); + if (!RecursiveRemoveDir (lpPathName)) + return FALSE; + + DPRINT ("Delete directory: '%S'\n", lpPathName); + return RemoveDirectoryW (lpPathName); } /* EOF */
12 years
1
0
0
0
[jgardou] 57829: [MSVCRT_WINETEST] - sync with wine 1.5.19
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 22:02:22 2012 New Revision: 57829 URL:
http://svn.reactos.org/svn/reactos?rev=57829&view=rev
Log: [MSVCRT_WINETEST] - sync with wine 1.5.19 Modified: trunk/rostests/winetests/msvcrt/locale.c trunk/rostests/winetests/msvcrt/scanf.c trunk/rostests/winetests/msvcrt/string.c Modified: trunk/rostests/winetests/msvcrt/locale.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/locale.c…
============================================================================== --- trunk/rostests/winetests/msvcrt/locale.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/locale.c [iso-8859-1] Sat Dec 8 22:02:22 2012 @@ -25,6 +25,8 @@ static BOOL (__cdecl *p__crtGetStringTypeW)(DWORD, DWORD, const wchar_t*, int, WORD*); static int (__cdecl *pmemcpy_s)(void *, size_t, void*, size_t); +static int (__cdecl *p___mb_cur_max_func)(void); +static int *(__cdecl *p__p___mb_cur_max)(void); void* __cdecl _Gettnames(void); static void init(void) @@ -33,6 +35,8 @@ p__crtGetStringTypeW = (void*)GetProcAddress(hmod, "__crtGetStringTypeW"); pmemcpy_s = (void*)GetProcAddress(hmod, "memcpy_s"); + p___mb_cur_max_func = (void*)GetProcAddress(hmod, "___mb_cur_max_func"); + p__p___mb_cur_max = (void*)GetProcAddress(hmod, "__p___mb_cur_max"); } static void test_setlocale(void) @@ -738,7 +742,56 @@ setlocale(LC_ALL, "C"); } -#endif /* ROSTESTS_91_IS_FIXED */ +#endif + +static void test___mb_cur_max_func(void) +{ + int mb_cur_max; + CPINFO cp; + + setlocale(LC_ALL, "C"); + GetCPInfo(CP_ACP, &cp); + + /* for newer Windows */ + if(!p___mb_cur_max_func) + win_skip("Skipping ___mb_cur_max_func tests\n"); + else { + mb_cur_max = p___mb_cur_max_func(); + ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); + + /* some old Windows don't set chinese */ + if (!setlocale(LC_ALL, "chinese")) + win_skip("Skipping test with chinese locale\n"); + else { + mb_cur_max = p___mb_cur_max_func(); + ok(mb_cur_max == 2, "mb_cur_max = %d, expected 2\n", mb_cur_max); + setlocale(LC_ALL, "C"); + } + } + + /* for older Windows */ + if (!p__p___mb_cur_max) + win_skip("Skipping __p___mb_cur_max tests\n"); + else { + mb_cur_max = *p__p___mb_cur_max(); + if (cp.MaxCharSize != 1) { + todo_wine ok(mb_cur_max == cp.MaxCharSize, "mb_cur_max = %d, expected %d\n", + mb_cur_max, cp.MaxCharSize); + } + else { + ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); + } + + /* some old Windows don't set chinese */ + if (!setlocale(LC_ALL, "chinese")) + win_skip("Skipping test with chinese locale\n"); + else { + mb_cur_max = *p__p___mb_cur_max(); + ok(mb_cur_max == 2, "mb_cur_max = %d, expected 2\n", mb_cur_max); + setlocale(LC_ALL, "C"); + } + } +} START_TEST(locale) { @@ -749,4 +802,5 @@ #if ROSTESTS_91_IS_FIXED test__Gettnames(); #endif + test___mb_cur_max_func(); } Modified: trunk/rostests/winetests/msvcrt/scanf.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/scanf.c?…
============================================================================== --- trunk/rostests/winetests/msvcrt/scanf.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/scanf.c [iso-8859-1] Sat Dec 8 22:02:22 2012 @@ -31,6 +31,7 @@ char c; void *ptr; float res1= -82.6267f, res2= 27.76f, res11, res12; + double double_res; static const char pname[]=" St. Petersburg, Florida\n"; int hour=21,min=59,sec=20; int number,number_so_far; @@ -98,6 +99,22 @@ ret = sscanf(buffer,"%f%f",&res11, &res12); ok( ret == 2, "expected 2, got %u\n", ret); ok( (res11 == res1) && (res12 == res2), "Error reading floats\n"); + + /* Check double */ + ret = sprintf(buffer, "%lf", 32.715); + ok(ret == 9, "expected 9, got %u\n", ret); + ret = sscanf(buffer, "%lf", &double_res); + ok(ret == 1, "expected 1, got %u\n", ret); + ok(double_res == 32.715, "Got %lf, expected %lf\n", double_res, 32.715); + ret = sscanf(buffer, "%Lf", &double_res); + ok(ret == 1, "expected 1, got %u\n", ret); + ok(double_res == 32.715, "Got %lf, expected %lf\n", double_res, 32.715); + + strcpy(buffer, "1.1e-30"); + ret = sscanf(buffer, "%lf", &double_res); + ok(ret == 1, "expected 1, got %u\n", ret); + ok(double_res >= 1.1e-30-1e-45 && double_res <= 1.1e-30+1e-45, + "Got %.18le, expected %.18le\n", double_res, 1.1e-30); /* check strings */ ret = sprintf(buffer," %s", pname); Modified: trunk/rostests/winetests/msvcrt/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/msvcrt/string.c…
============================================================================== --- trunk/rostests/winetests/msvcrt/string.c [iso-8859-1] (original) +++ trunk/rostests/winetests/msvcrt/string.c [iso-8859-1] Sat Dec 8 22:02:22 2012 @@ -23,15 +23,13 @@ #include "winnls.h" #include <string.h> #include <mbstring.h> +#include <wchar.h> #include <stdlib.h> #include <stdio.h> #include <mbctype.h> #include <locale.h> #include <errno.h> #include <limits.h> - -/* ReactOS */ -typedef unsigned int __msvcrt_ulong; static char *buf_to_string(const unsigned char *bin, int len, int nr) { @@ -74,6 +72,7 @@ static unsigned __int64 (__cdecl *p_strtoui64)(const char *, char **, int); static int (__cdecl *pwcstombs_s)(size_t*,char*,size_t,const wchar_t*,size_t); static int (__cdecl *pmbstowcs_s)(size_t*,wchar_t*,size_t,const char*,size_t); +static size_t (__cdecl *p_mbsrtowcs)(wchar_t*, const char**, size_t, mbstate_t*); static size_t (__cdecl *pwcsrtombs)(char*, const wchar_t**, size_t, int*); static errno_t (__cdecl *p_gcvt_s)(char*,size_t,double,int); static errno_t (__cdecl *p_itoa_s)(int,char*,size_t,int); @@ -86,7 +85,10 @@ static errno_t (__cdecl *p_mbsupr_s)(unsigned char *str, size_t numberOfElements); static errno_t (__cdecl *p_mbslwr_s)(unsigned char *str, size_t numberOfElements); static int (__cdecl *p_wctob)(wint_t); +static size_t (__cdecl *p_wcrtomb)(char*, wchar_t, mbstate_t*); static int (__cdecl *p_tolower)(int); +static size_t (__cdecl *p_mbrlen)(const char*, size_t, mbstate_t*); +static size_t (__cdecl *p_mbrtowc)(wchar_t*, const char*, size_t, mbstate_t*); #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y) #define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y) @@ -306,6 +308,43 @@ expect_eq(_mbslen(mbstring2), 4, int, "%d"); expect_eq(_mbslen(mbsonlylead), 0, int, "%d"); /* lead + NUL not counted as character */ expect_eq(_mbslen(mbstring), 4, int, "%d"); /* lead + invalid trail counted */ + + /* mbrlen */ + if(!setlocale(LC_ALL, ".936") || !p_mbrlen) { + win_skip("mbrlen tests\n"); + }else { + mbstate_t state = 0; + expect_eq(p_mbrlen((const char*)mbstring, 2, NULL), 2, int, "%d"); + expect_eq(p_mbrlen((const char*)&mbstring[2], 2, NULL), 2, int, "%d"); + expect_eq(p_mbrlen((const char*)&mbstring[3], 2, NULL), 1, int, "%d"); + expect_eq(p_mbrlen((const char*)mbstring, 1, NULL), -2, int, "%d"); + expect_eq(p_mbrlen((const char*)mbstring, 1, &state), -2, int, "%d"); + ok(state == mbstring[0], "incorrect state value (%x)\n", state); + expect_eq(p_mbrlen((const char*)&mbstring[1], 1, &state), 2, int, "%d"); + } + + /* mbrtowc */ + if(!setlocale(LC_ALL, ".936") || !p_mbrtowc) { + win_skip("mbrtowc tests\n"); + }else { + mbstate_t state = 0; + wchar_t dst; + expect_eq(p_mbrtowc(&dst, (const char*)mbstring, 2, NULL), 2, int, "%d"); + ok(dst == 0x6c28, "dst = %x, expected 0x6c28\n", dst); + expect_eq(p_mbrtowc(&dst, (const char*)mbstring+2, 2, NULL), 2, int, "%d"); + ok(dst == 0x3f, "dst = %x, expected 0x3f\n", dst); + expect_eq(p_mbrtowc(&dst, (const char*)mbstring+3, 2, NULL), 1, int, "%d"); + ok(dst == 0x20, "dst = %x, expected 0x20\n", dst); + expect_eq(p_mbrtowc(&dst, (const char*)mbstring, 1, NULL), -2, int, "%d"); + ok(dst == 0, "dst = %x, expected 0\n", dst); + expect_eq(p_mbrtowc(&dst, (const char*)mbstring, 1, &state), -2, int, "%d"); + ok(dst == 0, "dst = %x, expected 0\n", dst); + ok(state == mbstring[0], "incorrect state value (%x)\n", state); + expect_eq(p_mbrtowc(&dst, (const char*)mbstring+1, 1, &state), 2, int, "%d"); + ok(dst == 0x6c28, "dst = %x, expected 0x6c28\n", dst); + ok(state == 0, "incorrect state value (%x)\n", state); + } + setlocale(LC_ALL, "C"); /* _mbccpy/_mbsncpy */ memset(buf, 0xff, sizeof(buf)); @@ -1545,6 +1584,8 @@ char mOut[6]; size_t ret; int err; + const char *pmbstr; + mbstate_t state; wOut[4] = '!'; wOut[5] = '\0'; mOut[4] = '!'; mOut[5] = '\0'; @@ -1634,6 +1675,38 @@ ok(ret == 4, "wcsrtombs did not return 4\n"); ok(pwstr == NULL, "pwstr != NULL\n"); ok(!memcmp(mOut, mSimple, sizeof(mSimple)), "mOut = %s\n", mOut); + + if(!p_mbsrtowcs) { + setlocale(LC_ALL, "C"); + win_skip("mbsrtowcs not available\n"); + return; + } + + pmbstr = mHiragana; + ret = p_mbsrtowcs(wOut, &pmbstr, 6, NULL); + ok(ret == 2, "mbsrtowcs did not return 2\n"); + ok(!memcmp(wOut, wHiragana, sizeof(wHiragana)), "wOut = %s\n", wine_dbgstr_w(wOut)); + ok(!pmbstr, "pmbstr != NULL\n"); + + state = mHiragana[0]; + pmbstr = mHiragana+1; + ret = p_mbsrtowcs(wOut, &pmbstr, 6, &state); + ok(ret == 2, "mbsrtowcs did not return 2\n"); + ok(wOut[0] == 0x3042, "wOut[0] = %x\n", wOut[0]); + ok(wOut[1] == 0xff61, "wOut[1] = %x\n", wOut[1]); + ok(wOut[2] == 0, "wOut[2] = %x\n", wOut[2]); + ok(!pmbstr, "pmbstr != NULL\n"); + + if (p_set_invalid_parameter_handler) + ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, + "Invalid parameter handler was already set\n"); + errno = EBADF; + ret = p_mbsrtowcs(wOut, NULL, 6, &state); + ok(ret == -1, "mbsrtowcs did not return -1\n"); + ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); + if (p_set_invalid_parameter_handler) + ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, + "Cannot reset invalid parameter handler\n"); setlocale(LC_ALL, "C"); } @@ -2228,6 +2301,44 @@ ret = p_wctob(0xe0); ok(ret == (int)(char)0xe0, "ret = %x\n", ret); +} +static void test_wctomb(void) +{ + mbstate_t state; + unsigned char dst[10]; + size_t ret; + + if(!p_wcrtomb || !setlocale(LC_ALL, "Japanese_Japan.932")) { + win_skip("wcrtomb tests\n"); + return; + } + + ret = p_wcrtomb(NULL, 0x3042, NULL); + ok(ret == 2, "wcrtomb did not return 2\n"); + + state = 1; + dst[2] = 'a'; + ret = p_wcrtomb((char*)dst, 0x3042, &state); + ok(ret == 2, "wcrtomb did not return 2\n"); + ok(state == 0, "state != 0\n"); + ok(dst[0] == 0x82, "dst[0] = %x, expected 0x82\n", dst[0]); + ok(dst[1] == 0xa0, "dst[1] = %x, expected 0xa0\n", dst[1]); + ok(dst[2] == 'a', "dst[2] != 'a'\n"); + + ret = p_wcrtomb((char*)dst, 0x3043, NULL); + ok(ret == 2, "wcrtomb did not return 2\n"); + ok(dst[0] == 0x82, "dst[0] = %x, expected 0x82\n", dst[0]); + ok(dst[1] == 0xa1, "dst[1] = %x, expected 0xa1\n", dst[1]); + + ret = p_wcrtomb((char*)dst, 0x20, NULL); + ok(ret == 1, "wcrtomb did not return 1\n"); + ok(dst[0] == 0x20, "dst[0] = %x, expected 0x20\n", dst[0]); + + ret = p_wcrtomb((char*)dst, 0xffff, NULL); + ok(ret == -1, "wcrtomb did not return -1\n"); + ok(dst[0] == 0x3f, "dst[0] = %x, expected 0x20\n", dst[0]); + + setlocale(LC_ALL, "C"); } static void test_tolower(void) @@ -2304,7 +2415,11 @@ p_mbsupr_s = (void*)GetProcAddress(hMsvcrt, "_mbsupr_s"); p_mbslwr_s = (void*)GetProcAddress(hMsvcrt, "_mbslwr_s"); p_wctob = (void*)GetProcAddress(hMsvcrt, "wctob"); + p_wcrtomb = (void*)GetProcAddress(hMsvcrt, "wcrtomb"); p_tolower = (void*)GetProcAddress(hMsvcrt, "tolower"); + p_mbrlen = (void*)GetProcAddress(hMsvcrt, "mbrlen"); + p_mbrtowc = (void*)GetProcAddress(hMsvcrt, "mbrtowc"); + p_mbsrtowcs = (void*)GetProcAddress(hMsvcrt, "mbsrtowcs"); /* MSVCRT memcpy behaves like memmove for overlapping moves, MFC42 CString::Insert seems to rely on that behaviour */ @@ -2352,5 +2467,6 @@ test__mbsupr_s(); test__mbslwr_s(); test_wctob(); + test_wctomb(); test_tolower(); }
12 years
1
0
0
0
[jgardou] 57828: [INCLUDE/CRT] - Add yet an other __ROS_LONG64__ hack to get newest wine tests to compile
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 21:46:08 2012 New Revision: 57828 URL:
http://svn.reactos.org/svn/reactos?rev=57828&view=rev
Log: [INCLUDE/CRT] - Add yet an other __ROS_LONG64__ hack to get newest wine tests to compile Modified: trunk/reactos/include/crt/crtdefs.h Modified: trunk/reactos/include/crt/crtdefs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=…
============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Sat Dec 8 21:46:08 2012 @@ -341,6 +341,14 @@ #if _INTEGRAL_MAX_BITS >= 64 __MINGW_EXTENSION typedef __int64 __time64_t; #endif +#endif + +/* For wine code... */ +#if !defined(_MSVCRT_LONG_DEFINED) && defined(__ROS_LONG64__) +#define _MSVCRT_LONG_DEFINED +/* we need 32-bit longs even on 64-bit */ +typedef int __msvcrt_long; +typedef unsigned int __msvcrt_ulong; #endif #ifndef _TIME_T_DEFINED
12 years
1
0
0
0
[hbelusca] 57827: [USETUP] Finish to translate "ReactOS xxxxx Setup".
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Dec 8 21:09:57 2012 New Revision: 57827 URL:
http://svn.reactos.org/svn/reactos?rev=57827&view=rev
Log: [USETUP] Finish to translate "ReactOS xxxxx Setup". Modified: trunk/reactos/base/setup/usetup/lang/fr-FR.h trunk/reactos/base/setup/usetup/lang/it-IT.h Modified: trunk/reactos/base/setup/usetup/lang/fr-FR.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/fr-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/fr-FR.h [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/lang/fr-FR.h [iso-8859-1] Sat Dec 8 21:09:57 2012 @@ -1265,7 +1265,7 @@ { 4, 3, - " ReactOS " KERNEL_VERSION_STR " Setup ", + " Installation de ReactOS " KERNEL_VERSION_STR " ", TEXT_STYLE_UNDERLINE }, { Modified: trunk/reactos/base/setup/usetup/lang/it-IT.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/it-…
============================================================================== --- trunk/reactos/base/setup/usetup/lang/it-IT.h [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/lang/it-IT.h [iso-8859-1] Sat Dec 8 21:09:57 2012 @@ -1253,7 +1253,7 @@ { 4, 3, - " ReactOS " KERNEL_VERSION_STR " Setup ", + " Installazione di ReactOS " KERNEL_VERSION_STR " ", TEXT_STYLE_UNDERLINE }, {
12 years
1
0
0
0
[janderwald] 57826: [USBCCGP] - Add debugging function to analyze configuration descriptor - Remove assert CORE-6574
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Dec 8 19:52:10 2012 New Revision: 57826 URL:
http://svn.reactos.org/svn/reactos?rev=57826&view=rev
Log: [USBCCGP] - Add debugging function to analyze configuration descriptor - Remove assert CORE-6574 Modified: trunk/reactos/drivers/usb/usbccgp/descriptor.c Modified: trunk/reactos/drivers/usb/usbccgp/descriptor.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbccgp/descri…
============================================================================== --- trunk/reactos/drivers/usb/usbccgp/descriptor.c [iso-8859-1] (original) +++ trunk/reactos/drivers/usb/usbccgp/descriptor.c [iso-8859-1] Sat Dec 8 19:52:10 2012 @@ -268,6 +268,41 @@ return STATUS_SUCCESS; } +VOID +DumpFullConfigurationDescriptor( + IN PFDO_DEVICE_EXTENSION FDODeviceExtension, + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor) +{ + PUSB_COMMON_DESCRIPTOR Descriptor; + + Descriptor = (PUSB_COMMON_DESCRIPTOR)ConfigurationDescriptor; + + DbgPrint("Bogus ConfigurationDescriptor Found\n"); + DbgPrint("InterfaceCount %x\n", ConfigurationDescriptor->bNumInterfaces); + + do + { + if (((ULONG_PTR)Descriptor + Descriptor->bLength) <= ((ULONG_PTR)ConfigurationDescriptor + ConfigurationDescriptor->wTotalLength)) + break; + + DbgPrint("Descriptor Type %x Length %lu Offset %lu\n", Descriptor->bDescriptorType, Descriptor->bLength, ((ULONG_PTR)Descriptor - (ULONG_PTR)ConfigurationDescriptor)); + + // check for invalid descriptors + if (!Descriptor->bLength) + { + DbgPrint("Bogus Descriptor!!!\n"); + break; + } + + // advance to next descriptor + Descriptor = (PUSB_COMMON_DESCRIPTOR)((ULONG_PTR)Descriptor + Descriptor->bLength); + + }while(TRUE); + + +} + + NTSTATUS NTAPI USBCCGP_ScanConfigurationDescriptor( @@ -309,7 +344,6 @@ // parse configuration descriptor // InterfaceDescriptor = USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor, ConfigurationDescriptor, InterfaceIndex, -1, -1, -1, -1); - ASSERT(InterfaceDescriptor); if (InterfaceDescriptor) { // @@ -319,6 +353,17 @@ FDODeviceExtension->InterfaceListCount++; CurrentPosition = (PVOID)((ULONG_PTR)InterfaceDescriptor + InterfaceDescriptor->bLength); } + else + { + DumpFullConfigurationDescriptor(FDODeviceExtension, ConfigurationDescriptor); + + // + // see issue + // CORE-6574 Test 3 (USB Web Cam) + // + if (FDODeviceExtension->DeviceDescriptor && FDODeviceExtension->DeviceDescriptor->idVendor == 0x0458 && FDODeviceExtension->DeviceDescriptor->idProduct == 0x705f) + ASSERT(FALSE); + } // // move to next interface
12 years
1
0
0
0
[janderwald] 57825: [HIDCLASS] - Handle device initialization errors CORE-6575
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Dec 8 19:17:35 2012 New Revision: 57825 URL:
http://svn.reactos.org/svn/reactos?rev=57825&view=rev
Log: [HIDCLASS] - Handle device initialization errors CORE-6575 Modified: trunk/reactos/drivers/hid/hidclass/fdo.c Modified: trunk/reactos/drivers/hid/hidclass/fdo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/fdo.c…
============================================================================== --- trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] Sat Dec 8 19:17:35 2012 @@ -350,7 +350,13 @@ // query capabilities // Status = HidClassFDO_QueryCapabilities(DeviceObject, &FDODeviceExtension->Capabilities); - ASSERT(Status == STATUS_SUCCESS); + if (!NT_SUCCESS(Status)) + { + DPRINT1("[HIDCLASS] Failed to retrieve capabilities %x\n", Status); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } // // lets start the lower device too @@ -369,13 +375,25 @@ // lets get the descriptors // Status = HidClassFDO_GetDescriptors(DeviceObject); - ASSERT(Status == STATUS_SUCCESS); + if (!NT_SUCCESS(Status)) + { + DPRINT1("[HIDCLASS] Failed to retrieve the descriptors %x\n", Status); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } // // now get the the collection description // Status = HidP_GetCollectionDescription(FDODeviceExtension->ReportDescriptor, FDODeviceExtension->HidDescriptor.DescriptorList[0].wReportLength, NonPagedPool, &FDODeviceExtension->Common.DeviceDescription); - ASSERT(Status == STATUS_SUCCESS); + if (!NT_SUCCESS(Status)) + { + DPRINT1("[HIDCLASS] Failed to retrieve the collection description %x\n", Status); + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } // // complete request
12 years
1
0
0
0
[jgardou] 57824: [CRT] - Fix build
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 17:46:27 2012 New Revision: 57824 URL:
http://svn.reactos.org/svn/reactos?rev=57824&view=rev
Log: [CRT] - Fix build Modified: trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c Modified: trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/cnt…
============================================================================== --- trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] Sat Dec 8 17:46:27 2012 @@ -125,7 +125,7 @@ if (!MSVCRT_CHECK_PMT( !(newval & mask & ~(_MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC | _MCW_DN)))) { if (cur) *cur = _controlfp( 0, 0 ); /* retrieve it anyway */ - return MSVCRT_EINVAL; + return EINVAL; } val = _controlfp( newval, mask ); if (cur) *cur = val;
12 years
1
0
0
0
[jgardou] 57823: [MSVCRT] - Properly implement and export _fpcontrol_s
by jgardou@svn.reactos.org
Author: jgardou Date: Sat Dec 8 17:44:38 2012 New Revision: 57823 URL:
http://svn.reactos.org/svn/reactos?rev=57823&view=rev
Log: [MSVCRT] - Properly implement and export _fpcontrol_s Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c Modified: trunk/reactos/dll/win32/msvcrt/msvcrt.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msvcrt/msvcrt.sp…
============================================================================== --- trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msvcrt/msvcrt.spec [iso-8859-1] Sat Dec 8 17:44:38 2012 @@ -302,7 +302,7 @@ @ extern _commode @ cdecl _control87(long long) @ cdecl _controlfp(long long) -# @ cdecl _controlfp_s(ptr long long) +@ cdecl _controlfp_s(ptr long long) @ cdecl _copysign( double double ) @ varargs _cprintf(str) # stub _cprintf_l Modified: trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/float/i386/cnt…
============================================================================== --- trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/float/i386/cntrlfp.c [iso-8859-1] Sat Dec 8 17:44:38 2012 @@ -120,15 +120,15 @@ int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask) { #ifdef __i386__ - unsigned int flags; + unsigned int val; - FIXME("(%p %u %u) semi-stub\n", cur, newval, mask); - - flags = _control87( newval, mask & ~_EM_DENORMAL ); - - if(cur) - *cur = flags; - + if (!MSVCRT_CHECK_PMT( !(newval & mask & ~(_MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC | _MCW_DN)))) + { + if (cur) *cur = _controlfp( 0, 0 ); /* retrieve it anyway */ + return MSVCRT_EINVAL; + } + val = _controlfp( newval, mask ); + if (cur) *cur = val; return 0; #else FIXME(":Not Implemented!\n");
12 years
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
29
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Results per page:
10
25
50
100
200