[ros-bugs] [Bug 1455] New: The Reg* functions always zero the
handle returned
ReactOS.Bugzilla at reactos.org
ReactOS.Bugzilla at reactos.org
Sun May 7 14:43:24 CEST 2006
http://www.reactos.org/bugzilla/show_bug.cgi?id=1455
Summary: The Reg* functions always zero the handle returned
Product: ReactOS
Version: TRUNK
Platform: x86 Hardware
OS/Version: ReactOS
Status: NEW
Severity: normal
Priority: P3
Component: Patches
AssignedTo: ros-bugs at reactos.org
ReportedBy: w3seek at reactos.com
QAContact: ros-bugs at reactos.org
The attached patch fixes NtCreateKey and NtOpenKey which always overwrite the
handle value to NULL in case of error. Fixes wrong assumptions heavily used in
setupapi and other places. The following code should display a messagebox with
"hk == NULL" with this patch:
HANDLE hk = INVALID_HANDLE_VALUE;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"xxx", 0, KEY_ALL_ACCESS,
(PHKEY)&hk) != ERROR_SUCCESS)
{
if (hk == INVALID_HANDLE_VALUE)
MessageBoxW(NULL, L"hk == INVALID_HANDLE_VALUE", NULL, 0);
else if (hk == NULL)
MessageBoxW(NULL, L"hk == NULL", NULL, 0);
else
MessageBoxW(NULL, L"hk is valid?!", NULL, 0);
}
The attached patch should fix this behavior in ReactOS.
--
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
You are the assignee for the bug, or are watching the assignee.
More information about the Ros-bugs
mailing list