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
May 2009
----- 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
27 participants
504 discussions
Start a n
N
ew thread
[tkreuzer] 41098: usermgr: fix 2 POINTER<->DWORD casts
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 24 15:32:59 2009 New Revision: 41098 URL:
http://svn.reactos.org/svn/reactos?rev=41098&view=rev
Log: usermgr: fix 2 POINTER<->DWORD casts Modified: branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/groups.c branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/userprops.c Modified: branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/groups.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/c…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] Sun May 24 15:32:59 2009 @@ -51,7 +51,7 @@ PLOCALGROUP_INFO_1 pBuffer; DWORD entriesread; DWORD totalentries; - DWORD resume_handle = 0; + DWORD_PTR resume_handle = 0; DWORD i; LV_ITEM lvi; INT iItem; Modified: branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/userprops.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/dll/c…
============================================================================== --- branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] Sun May 24 15:32:59 2009 @@ -377,7 +377,7 @@ PLOCALGROUP_INFO_1 pBuffer; DWORD entriesread; DWORD totalentries; - DWORD resume_handle = 0; + DWORD_PTR resume_handle = 0; DWORD i; LV_ITEM lvi; INT iItem;
15 years, 7 months
1
0
0
0
[tkreuzer] 41097: Fix pointer to DWORD cast. I also sent it to tftp on sourceforge.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 24 14:43:30 2009 New Revision: 41097 URL:
http://svn.reactos.org/svn/reactos?rev=41097&view=rev
Log: Fix pointer to DWORD cast. I also sent it to tftp on sourceforge. Modified: branches/ros-amd64-bringup/reactos/base/services/tftpd/tftpd.cpp Modified: branches/ros-amd64-bringup/reactos/base/services/tftpd/tftpd.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/base/…
============================================================================== --- branches/ros-amd64-bringup/reactos/base/services/tftpd/tftpd.cpp [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/base/services/tftpd/tftpd.cpp [iso-8859-1] Sun May 24 14:43:30 2009 @@ -938,7 +938,7 @@ continue; errno = 0; - req.bytesReady = (DWORD)outPtr - (DWORD)&req.mesout; + req.bytesReady = (DWORD_PTR)outPtr - (DWORD_PTR)&req.mesout; //printf("Bytes Ready=%u\n", req.bytesReady); send(req.sock, (const char*)&req.mesout, req.bytesReady, 0); errno = WSAGetLastError();
15 years, 7 months
1
0
0
0
[cwittich] 41096: fix secur32 main winetest crash by returning 0 packages in EmumSecurityPackagesA/W
by cwittich@svn.reactos.org
Author: cwittich Date: Sun May 24 13:40:15 2009 New Revision: 41096 URL:
http://svn.reactos.org/svn/reactos?rev=41096&view=rev
Log: fix secur32 main winetest crash by returning 0 packages in EmumSecurityPackagesA/W Modified: trunk/reactos/dll/win32/secur32/sspi.c Modified: trunk/reactos/dll/win32/secur32/sspi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/secur32/sspi.c?r…
============================================================================== --- trunk/reactos/dll/win32/secur32/sspi.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/secur32/sspi.c [iso-8859-1] Sun May 24 13:40:15 2009 @@ -73,23 +73,50 @@ SECURITY_STATUS WINAPI EnumerateSecurityPackagesW ( - PULONG pulong, - PSecPkgInfoW* psecpkginfow + PULONG pcPackages, + PSecPkgInfoW* ppPackageInfo ) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + SECURITY_STATUS ret = SEC_E_OK; + + *pcPackages = 0; + + /* + if (packageTable) + { + + } + */ + + UNIMPLEMENTED; + return ret; } SECURITY_STATUS WINAPI EnumerateSecurityPackagesA( - PULONG pulong, - PSecPkgInfoA* psecpkginfoa + PULONG pcPackages, + PSecPkgInfoA* ppPackageInfo ) { - UNIMPLEMENTED; - return ERROR_CALL_NOT_IMPLEMENTED; + SECURITY_STATUS ret; + PSecPkgInfoW info; + + ret = EnumerateSecurityPackagesW(pcPackages, &info); + if (ret == SEC_E_OK && *pcPackages && info) + { + /* *ppPackageInfo = thunk_PSecPkgInfoWToA(*pcPackages, info); + if (*pcPackages && !*ppPackageInfo) + { + *pcPackages = 0; + ret = SEC_E_INSUFFICIENT_MEMORY; + } */ + FreeContextBuffer(info); + } + + UNIMPLEMENTED; + + return ret; } SECURITY_STATUS
15 years, 7 months
1
0
0
0
[fireball] 41095: - Add missing pool allocation failure branch in NtSetInformationFile, and a missing PAGED_CODE check. Spotted by Dmitry Chapyshev.
by fireball@svn.reactos.org
Author: fireball Date: Sun May 24 13:08:51 2009 New Revision: 41095 URL:
http://svn.reactos.org/svn/reactos?rev=41095&view=rev
Log: - Add missing pool allocation failure branch in NtSetInformationFile, and a missing PAGED_CODE check. Spotted by Dmitry Chapyshev. Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Sun May 24 13:08:51 2009 @@ -2243,6 +2243,7 @@ PVOID Queue; PFILE_COMPLETION_INFORMATION CompletionInfo = FileInformation; PIO_COMPLETION_CONTEXT Context; + PAGED_CODE(); IOTRACE(IO_API_DEBUG, "FileHandle: %p\n", FileHandle); /* Check if we're called from user mode */ @@ -2363,6 +2364,12 @@ { /* Use local event */ Event = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), TAG_IO); + if (!Event) + { + ObDereferenceObject(FileObject); + return STATUS_INSUFFICIENT_RESOURCES; + } + KeInitializeEvent(Event, SynchronizationEvent, FALSE); LocalEvent = TRUE; }
15 years, 7 months
1
0
0
0
[cwittich] 41094: sync wintrust_winetest with wine 1.1.22
by cwittich@svn.reactos.org
Author: cwittich Date: Sun May 24 13:07:56 2009 New Revision: 41094 URL:
http://svn.reactos.org/svn/reactos?rev=41094&view=rev
Log: sync wintrust_winetest with wine 1.1.22 Modified: trunk/rostests/winetests/wintrust/crypt.c Modified: trunk/rostests/winetests/wintrust/crypt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wintrust/crypt.…
============================================================================== --- trunk/rostests/winetests/wintrust/crypt.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wintrust/crypt.c [iso-8859-1] Sun May 24 13:07:56 2009 @@ -373,6 +373,37 @@ DeleteFileA(temp); } +static void test_CryptCATOpen(void) +{ + HANDLE hcat; + char empty[MAX_PATH]; + WCHAR emptyW[MAX_PATH]; + HANDLE file; + BOOL ret; + + SetLastError(0xdeadbeef); + hcat = pCryptCATOpen(NULL, 0, 0, 0, 0); + ok(hcat == INVALID_HANDLE_VALUE, "CryptCATOpen succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %08x\n", GetLastError()); + + if (!GetTempFileNameA(CURR_DIR, "cat", 0, empty)) return; + + file = CreateFileA(empty, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError()); + CloseHandle(file); + MultiByteToWideChar(CP_ACP, 0, empty, -1, emptyW, MAX_PATH); + + hcat = pCryptCATOpen(emptyW, 0, 0, 0, 0); + todo_wine + ok(hcat != INVALID_HANDLE_VALUE, "Expected a correct handle\n"); + + ret = pCryptCATClose(hcat); + todo_wine + ok(ret, "CryptCATClose failed\n"); + DeleteFileA(empty); +} + static DWORD error_area; static DWORD local_error; @@ -615,9 +646,6 @@ catalog[0] = 0; } - hcat = pCryptCATOpen(NULL, 0, 0, 0, 0); - ok(hcat == INVALID_HANDLE_VALUE, "CryptCATOpen succeeded\n"); - hcat = pCryptCATOpen(catalogW, 0, 0, 0, 0); if (hcat == INVALID_HANDLE_VALUE && members == 0) { @@ -1106,6 +1134,7 @@ test_context(); test_calchash(); + test_CryptCATOpen(); /* Parameter checking only */ test_CryptCATCDF_params(); /* Test the parsing of a cdf file */
15 years, 7 months
1
0
0
0
[cwittich] 41093: sync RegQueryValueExA, RegQueryValueA, RegQueryValueW and RegSetValueExA to wine patch by Giannis Adamopoulos <johnyadams at hotmail dot com> See issue #4528 for more details.
by cwittich@svn.reactos.org
Author: cwittich Date: Sun May 24 12:45:05 2009 New Revision: 41093 URL:
http://svn.reactos.org/svn/reactos?rev=41093&view=rev
Log: sync RegQueryValueExA, RegQueryValueA, RegQueryValueW and RegSetValueExA to wine patch by Giannis Adamopoulos <johnyadams at hotmail dot com> See issue #4528 for more details. Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
============================================================================== --- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Sun May 24 12:45:05 2009 @@ -3964,110 +3964,96 @@ * * @implemented */ -LONG WINAPI -RegQueryValueExA(HKEY hKey, - LPCSTR lpValueName, - LPDWORD lpReserved, - LPDWORD lpType, - LPBYTE lpData, - LPDWORD lpcbData) -{ - UNICODE_STRING ValueName; - UNICODE_STRING ValueData; - ANSI_STRING AnsiString; - LONG ErrorCode; - DWORD Length; - DWORD Type; - - TRACE("hKey 0x%X lpValueName %s lpData 0x%X lpcbData %d\n", - hKey, lpValueName, lpData, lpcbData ? *lpcbData : 0); - - if (lpData != NULL && lpcbData == NULL) - { - return ERROR_INVALID_PARAMETER; - } - - if (lpData) - { - ValueData.Length = 0; - ValueData.MaximumLength = (*lpcbData + 1) * sizeof(WCHAR); - ValueData.Buffer = RtlAllocateHeap(ProcessHeap, - 0, - ValueData.MaximumLength); - if (!ValueData.Buffer) - { - return ERROR_OUTOFMEMORY; - } - } - else - { - ValueData.Buffer = NULL; - ValueData.Length = 0; - ValueData.MaximumLength = 0; - - if (lpcbData) - *lpcbData = 0; - } - - RtlCreateUnicodeStringFromAsciiz(&ValueName, - (LPSTR)lpValueName); - - Length = (lpcbData == NULL) ? 0 : *lpcbData * sizeof(WCHAR); - ErrorCode = RegQueryValueExW(hKey, - ValueName.Buffer, - lpReserved, - &Type, - (lpData == NULL) ? NULL : (LPBYTE)ValueData.Buffer, - &Length); - TRACE("ErrorCode %lu\n", ErrorCode); - RtlFreeUnicodeString(&ValueName); - - if (ErrorCode == ERROR_SUCCESS || - ErrorCode == ERROR_MORE_DATA) - { - if (lpType != NULL) - { - *lpType = Type; - } - - if ((Type == REG_SZ) || (Type == REG_MULTI_SZ) || (Type == REG_EXPAND_SZ)) - { - if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL) +LSTATUS WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type, + LPBYTE data, LPDWORD count ) +{ + NTSTATUS status; + ANSI_STRING nameA; + DWORD total_size, datalen = 0; + char buffer[256], *buf_ptr = buffer; + KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; + static const int info_size = offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data ); + + TRACE("(%p,%s,%p,%p,%p,%p=%d)\n", + hkey, debugstr_a(name), reserved, type, data, count, count ? *count : 0 ); + + if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER; + + status = MapDefaultKey( (PHANDLE)&hkey, hkey); + if (!NT_SUCCESS(status)) + { + return RtlNtStatusToDosError(status); + } + + if (count) datalen = *count; + if (!data && count) *count = 0; + + /* this matches Win9x behaviour - NT sets *type to a random value */ + if (type) *type = REG_NONE; + + RtlInitAnsiString( &nameA, name ); + if ((status = RtlAnsiStringToUnicodeString( &NtCurrentTeb()->StaticUnicodeString, + &nameA, FALSE ))) + return RtlNtStatusToDosError(status); + + status = NtQueryValueKey( hkey, &NtCurrentTeb()->StaticUnicodeString, + KeyValuePartialInformation, buffer, sizeof(buffer), &total_size ); + if (status && status != STATUS_BUFFER_OVERFLOW) goto done; + + /* we need to fetch the contents for a string type even if not requested, + * because we need to compute the length of the ASCII string. */ + if (data || is_string(info->Type)) + { + /* retry with a dynamically allocated buffer */ + while (status == STATUS_BUFFER_OVERFLOW) + { + if (buf_ptr != buffer) HeapFree( GetProcessHeap(), 0, buf_ptr ); + if (!(buf_ptr = HeapAlloc( GetProcessHeap(), 0, total_size ))) { - RtlInitAnsiString(&AnsiString, NULL); - AnsiString.Buffer = (LPSTR)lpData; - AnsiString.MaximumLength = *lpcbData; - ValueData.Length = Length; - ValueData.MaximumLength = ValueData.Length + sizeof(WCHAR); - RtlUnicodeStringToAnsiString(&AnsiString, &ValueData, FALSE); + status = STATUS_NO_MEMORY; + goto done; } - - Length = Length / sizeof(WCHAR); - } - else if (ErrorCode == ERROR_SUCCESS && ValueData.Buffer != NULL) - { - if (*lpcbData < Length) + info = (KEY_VALUE_PARTIAL_INFORMATION *)buf_ptr; + status = NtQueryValueKey( hkey, &NtCurrentTeb()->StaticUnicodeString, + KeyValuePartialInformation, buf_ptr, total_size, &total_size ); + } + + if (status) goto done; + + if (is_string(info->Type)) + { + DWORD len; + + RtlUnicodeToMultiByteSize( &len, (WCHAR *)(buf_ptr + info_size), + total_size - info_size ); + if (data && len) { - ErrorCode = ERROR_MORE_DATA; + if (len > datalen) status = STATUS_BUFFER_OVERFLOW; + else + { + RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info_size), + total_size - info_size ); + /* if the type is REG_SZ and data is not 0-terminated + * and there is enough space in the buffer NT appends a \0 */ + if (len < datalen && data[len-1]) data[len] = 0; + } } - else - { - RtlMoveMemory(lpData, ValueData.Buffer, Length); - } - } - - if (lpcbData != NULL) - { - *lpcbData = Length; - } - } - - if (ValueData.Buffer != NULL) - { - RtlFreeHeap(ProcessHeap, 0, ValueData.Buffer); - } - - return ErrorCode; + total_size = len + info_size; + } + else if (data) + { + if (total_size - info_size > datalen) status = STATUS_BUFFER_OVERFLOW; + else memcpy( data, buf_ptr + info_size, total_size - info_size ); + } + } + else status = STATUS_SUCCESS; + + if (type) *type = info->Type; + if (count) *count = total_size - info_size; + + done: + if (buf_ptr != buffer) HeapFree( GetProcessHeap(), 0, buf_ptr ); + return RtlNtStatusToDosError(status); } @@ -4098,7 +4084,6 @@ (count && data) ? *count : 0 ); if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER; - //if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE; status = MapDefaultKey(&hkey, hkeyorg); if (!NT_SUCCESS(status)) @@ -4162,93 +4147,27 @@ * * @implemented */ -LONG WINAPI -RegQueryValueA(HKEY hKey, - LPCSTR lpSubKey, - LPSTR lpValue, - PLONG lpcbValue) -{ - WCHAR SubKeyNameBuffer[MAX_PATH+1]; - UNICODE_STRING SubKeyName; - UNICODE_STRING Value; - ANSI_STRING AnsiString; - LONG ValueSize; - LONG ErrorCode; - - TRACE("hKey 0x%X lpSubKey %s lpValue %p lpcbValue %d\n", - hKey, lpSubKey, lpValue, lpcbValue ? *lpcbValue : 0); - - if (lpValue != NULL && - lpcbValue == NULL) - { - return ERROR_INVALID_PARAMETER; - } - - RtlInitUnicodeString(&SubKeyName, - NULL); - RtlInitUnicodeString(&Value, - NULL); - if (lpSubKey != NULL && - strlen(lpSubKey) != 0) - { - RtlInitAnsiString(&AnsiString, - (LPSTR)lpSubKey); - SubKeyName.Buffer = &SubKeyNameBuffer[0]; - SubKeyName.MaximumLength = sizeof(SubKeyNameBuffer); - RtlAnsiStringToUnicodeString(&SubKeyName, - &AnsiString, - FALSE); - } - - if (lpValue != NULL) - { - ValueSize = *lpcbValue * sizeof(WCHAR); - Value.MaximumLength = ValueSize; - Value.Buffer = RtlAllocateHeap(ProcessHeap, - 0, - ValueSize); - if (Value.Buffer == NULL) - { - return ERROR_OUTOFMEMORY; - } - } - else - { - ValueSize = 0; - } - - ErrorCode = RegQueryValueW(hKey, - (LPCWSTR)SubKeyName.Buffer, - Value.Buffer, - &ValueSize); - if (ErrorCode == ERROR_SUCCESS) - { - if (lpValue != NULL) - { - Value.Length = ValueSize; - RtlInitAnsiString(&AnsiString, - NULL); - AnsiString.Buffer = lpValue; - AnsiString.MaximumLength = *lpcbValue; - RtlUnicodeStringToAnsiString(&AnsiString, - &Value, - FALSE); - *lpcbValue = ValueSize; - } - else if (lpcbValue != NULL) - { - *lpcbValue = ValueSize; - } - } - - if (Value.Buffer != NULL) - { - RtlFreeHeap(ProcessHeap, - 0, - Value.Buffer); - } - - return ErrorCode; +LSTATUS WINAPI RegQueryValueA( HKEY hkey, LPCSTR name, LPSTR data, LPLONG count ) +{ + DWORD ret; + HKEY subkey = hkey; + + TRACE("(%p,%s,%p,%d)\n", hkey, debugstr_a(name), data, count ? *count : 0 ); + + if (name && name[0]) + { + if ((ret = RegOpenKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; + } + ret = RegQueryValueExA( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count ); + if (subkey != hkey) RegCloseKey( subkey ); + if (ret == ERROR_FILE_NOT_FOUND) + { + /* return empty string if default value not found */ + if (data) *data = 0; + if (count) *count = 1; + ret = ERROR_SUCCESS; + } + return ret; } @@ -4257,75 +4176,42 @@ * * @implemented */ -LONG WINAPI -RegQueryValueW(HKEY hKey, - LPCWSTR lpSubKey, - LPWSTR lpValue, - PLONG lpcbValue) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING SubKeyString; - HANDLE KeyHandle; - HANDLE RealKey; - LONG ErrorCode; - BOOL CloseRealKey; - NTSTATUS Status; - - TRACE("hKey 0x%X lpSubKey %S lpValue %p lpcbValue %d\n", - hKey, lpSubKey, lpValue, lpcbValue ? *lpcbValue : 0); - if (hKey == NULL) +LSTATUS WINAPI RegQueryValueW( HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count ) +{ + DWORD ret; + HKEY subkey = hkey; + + TRACE("(%p,%s,%p,%d)\n", hkey, debugstr_w(name), data, count ? *count : 0 ); + if (hkey == NULL) { return ERROR_INVALID_HANDLE; } - Status = MapDefaultKey(&KeyHandle, - hKey); - if (!NT_SUCCESS(Status)) - { - return RtlNtStatusToDosError(Status); - } - - if (lpSubKey != NULL && - wcslen(lpSubKey) != 0) - { - RtlInitUnicodeString(&SubKeyString, - (LPWSTR)lpSubKey); - InitializeObjectAttributes(&ObjectAttributes, - &SubKeyString, - OBJ_CASE_INSENSITIVE, - KeyHandle, - NULL); - Status = NtOpenKey(&RealKey, - KEY_QUERY_VALUE, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - ErrorCode = RtlNtStatusToDosError(Status); - goto Cleanup; - } - - CloseRealKey = TRUE; - } - else - { - RealKey = hKey; - CloseRealKey = FALSE; - } - - ErrorCode = RegQueryValueExW(RealKey, - NULL, - NULL, - NULL, - (LPBYTE)lpValue, - (LPDWORD)lpcbValue); - if (CloseRealKey) - { - NtClose(RealKey); - } - -Cleanup: - ClosePredefKey(KeyHandle); - - return ErrorCode; + if (name && name[0]) + { + ret = RegOpenKeyW( hkey, name, &subkey); + if (ret != ERROR_SUCCESS) + { + return ret; + } + } + + ret = RegQueryValueExW( subkey, NULL, NULL, NULL, (LPBYTE)data, (LPDWORD)count ); + + if (subkey != hkey) + { + RegCloseKey( subkey ); + } + + if (ret == ERROR_FILE_NOT_FOUND) + { + /* return empty string if default value not found */ + if (data) + *data = 0; + if (count) + *count = sizeof(WCHAR); + ret = ERROR_SUCCESS; + } + return ret; } @@ -4806,86 +4692,43 @@ * * @implemented */ -LONG WINAPI -RegSetValueExA(HKEY hKey, - LPCSTR lpValueName, - DWORD Reserved, - DWORD dwType, - CONST BYTE* lpData, - DWORD cbData) -{ - UNICODE_STRING ValueName; - LPWSTR pValueName; - ANSI_STRING AnsiString; - UNICODE_STRING Data; - LONG ErrorCode; - LPBYTE pData; - DWORD DataSize; - - if (lpValueName != NULL && - strlen(lpValueName) != 0) - { - RtlCreateUnicodeStringFromAsciiz(&ValueName, - (PSTR)lpValueName); - } - else - { - ValueName.Buffer = NULL; - } - - pValueName = (LPWSTR)ValueName.Buffer; - - if (((dwType == REG_SZ) || - (dwType == REG_MULTI_SZ) || - (dwType == REG_EXPAND_SZ)) && - (cbData != 0)) - { - /* NT adds one if the caller forgot the NULL-termination character */ - if (lpData[cbData - 1] != '\0') - { - cbData++; - } - - RtlInitAnsiString(&AnsiString, - NULL); - AnsiString.Buffer = (PSTR)lpData; - AnsiString.Length = cbData - 1; - AnsiString.MaximumLength = cbData; - RtlAnsiStringToUnicodeString(&Data, - &AnsiString, - TRUE); - pData = (LPBYTE)Data.Buffer; - DataSize = cbData * sizeof(WCHAR); - } - else - { - RtlInitUnicodeString(&Data, - NULL); - pData = (LPBYTE)lpData; - DataSize = cbData; - } - - ErrorCode = RegSetValueExW(hKey, - pValueName, - Reserved, - dwType, - pData, - DataSize); - if (pValueName != NULL) - { - RtlFreeHeap(ProcessHeap, - 0, - ValueName.Buffer); - } - - if (Data.Buffer != NULL) - { - RtlFreeHeap(ProcessHeap, - 0, - Data.Buffer); - } - - return ErrorCode; +LSTATUS WINAPI RegSetValueExA( HKEY hkey, LPCSTR name, DWORD reserved, DWORD type, + CONST BYTE *data, DWORD count ) +{ + ANSI_STRING nameA; + WCHAR *dataW = NULL; + NTSTATUS status; + + if (count && is_string(type)) + { + /* if user forgot to count terminating null, add it (yes NT does this) */ + if (data[count-1] && !data[count]) count++; + } + + status = MapDefaultKey( (PHANDLE)&hkey, hkey); + if (!NT_SUCCESS(status)) + { + return RtlNtStatusToDosError(status); + } + + if (is_string( type )) /* need to convert to Unicode */ + { + DWORD lenW; + RtlMultiByteToUnicodeSize( &lenW, (const char *)data, count ); + if (!(dataW = HeapAlloc( GetProcessHeap(), 0, lenW ))) return ERROR_OUTOFMEMORY; + RtlMultiByteToUnicodeN( dataW, lenW, NULL, (const char *)data, count ); + count = lenW; + data = (BYTE *)dataW; + } + + RtlInitAnsiString( &nameA, name ); + if (!(status = RtlAnsiStringToUnicodeString( &NtCurrentTeb()->StaticUnicodeString, + &nameA, FALSE ))) + { + status = NtSetValueKey( hkey, &NtCurrentTeb()->StaticUnicodeString, 0, type, (PVOID)data, count ); + } + HeapFree( GetProcessHeap(), 0, dataW ); + return RtlNtStatusToDosError( status ); }
15 years, 7 months
1
0
0
0
[jimtabor] 41092: - Fix typo: AbortProc returns TRUE to continue the print job or FALSE to cancel the print job.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun May 24 08:14:48 2009 New Revision: 41092 URL:
http://svn.reactos.org/svn/reactos?rev=41092&view=rev
Log: - Fix typo: AbortProc returns TRUE to continue the print job or FALSE to cancel the print job. Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] Sun May 24 08:14:48 2009 @@ -174,7 +174,7 @@ pldc->CallBackTick = NewTime; - if ( pldc->pAbortProc(pldc->hDC, 0) ) + if ( !pldc->pAbortProc(pldc->hDC, 0) ) { CancelDC(pldc->hDC); AbortDoc(pldc->hDC);
15 years, 7 months
1
0
0
0
[jimtabor] 41091: - Implement GdiConvertAndCheckDC and Abort callback support routine.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun May 24 08:07:47 2009 New Revision: 41091 URL:
http://svn.reactos.org/svn/reactos?rev=41091&view=rev
Log: - Implement GdiConvertAndCheckDC and Abort callback support routine. Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h trunk/reactos/dll/win32/gdi32/misc/misc.c trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/include/reactos/win32k/ntgdihdl.h Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
============================================================================== --- trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Sun May 24 08:07:47 2009 @@ -30,6 +30,8 @@ #define METAFILE_MEMORY 1 #define METAFILE_DISK 2 + +#define SAPCALLBACKDELAY 244 /* MACRO ********************************************************************/ @@ -238,4 +240,6 @@ WINAPI GdiGetBitmapBitsSize(BITMAPINFO *lpbmi); +VOID GdiSAPCallback(PLDC pldc); + /* EOF */ Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] Sun May 24 08:07:47 2009 @@ -164,6 +164,23 @@ return Dc_Attr->pvLDC; } +VOID GdiSAPCallback(PLDC pldc) +{ + DWORD Time, NewTime = GetTickCount(); + + Time = NewTime - pldc->CallBackTick; + + if ( Time < SAPCALLBACKDELAY) return; + + pldc->CallBackTick = NewTime; + + if ( pldc->pAbortProc(pldc->hDC, 0) ) + { + CancelDC(pldc->hDC); + AbortDoc(pldc->hDC); + } +} + /* * @implemented */ Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Sun May 24 08:07:47 2009 @@ -1142,15 +1142,26 @@ } /* - * @unimplemented + * @implemented */ HDC WINAPI GdiConvertAndCheckDC(HDC hdc) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + PLDC pldc; + ULONG hType = GDI_HANDLE_GET_TYPE(hdc); + if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE) + return hdc; + pldc = GdiGetLDC(hdc); + if (pldc) + { + if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc); + if (pldc->Flags & LDC_KILL_DOCUMENT) return NULL; + if (pldc->Flags & LDC_STARTPAGE) StartPage(hdc); + return hdc; + } + SetLastError(ERROR_INVALID_HANDLE); + return NULL; } /* Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Sun May 24 08:07:47 2009 @@ -178,6 +178,7 @@ #define LDC_SAPCALLBACK 0x00000020 #define LDC_INIT_DOCUMENT 0x00000040 #define LDC_INIT_PAGE 0x00000080 +#define LDC_STARTPAGE 0x00000100 #define LDC_PLAY_MFDC 0x00000800 #define LDC_CLOCKWISE 0x00002000 #define LDC_KILL_DOCUMENT 0x00010000
15 years, 7 months
1
0
0
0
[cgutman] 41089: - We also shouldn't use our Shutdown handler
by cgutman@svn.reactos.org
Author: cgutman Date: Sun May 24 04:38:10 2009 New Revision: 41089 URL:
http://svn.reactos.org/svn/reactos?rev=41089&view=rev
Log: - We also shouldn't use our Shutdown handler Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sun May 24 04:38:10 2009 @@ -2792,7 +2792,6 @@ DriverBlock->DriverObject->MajorFunction[i] = MajorFunctions[i]; DriverBlock->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp; - DriverBlock->DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = NdisIShutdown; DeviceBlock->DeviceObject = DeviceObject; DeviceBlock->SymbolicName = SymbolicName;
15 years, 7 months
1
0
0
0
[cgutman] 41088: - Don't use NDIS's ioctl handler for devices registered from NdisMRegisterDevice
by cgutman@svn.reactos.org
Author: cgutman Date: Sun May 24 04:32:38 2009 New Revision: 41088 URL:
http://svn.reactos.org/svn/reactos?rev=41088&view=rev
Log: - Don't use NDIS's ioctl handler for devices registered from NdisMRegisterDevice Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c Modified: trunk/reactos/drivers/network/ndis/ndis/miniport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
============================================================================== --- trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/ndis/ndis/miniport.c [iso-8859-1] Sun May 24 04:32:38 2009 @@ -2793,7 +2793,6 @@ DriverBlock->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp; DriverBlock->DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = NdisIShutdown; - DriverBlock->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NdisIDeviceIoControl; DeviceBlock->DeviceObject = DeviceObject; DeviceBlock->SymbolicName = SymbolicName;
15 years, 7 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
51
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Results per page:
10
25
50
100
200