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
September 2005
----- 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
22 participants
582 discussions
Start a n
N
ew thread
[ion] 18101: Export and implement NlsGetCacheUpdateCount. Almost every WinXP DLL can now import kernel32
by ion@svn.reactos.com
Export and implement NlsGetCacheUpdateCount. Almost every WinXP DLL can now import kernel32 Modified: trunk/reactos/lib/kernel32/kernel32.def Modified: trunk/reactos/lib/kernel32/misc/nls.c _____ Modified: trunk/reactos/lib/kernel32/kernel32.def --- trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:59:04 UTC (rev 18100) +++ trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 19:09:32 UTC (rev 18101) @@ -649,7 +649,7 @@ NeedCurrentDirectoryForExePathA@4 NeedCurrentDirectoryForExePathW@4 NlsConvertIntegerToString@20 -;NlsGetCacheUpdateCount +NlsGetCacheUpdateCount@0 ;NlsResetProcessLocale ;NumaVirtualQueryNode OpenConsoleW@16 _____ Modified: trunk/reactos/lib/kernel32/misc/nls.c --- trunk/reactos/lib/kernel32/misc/nls.c 2005-09-26 18:59:04 UTC (rev 18100) +++ trunk/reactos/lib/kernel32/misc/nls.c 2005-09-26 19:09:32 UTC (rev 18101) @@ -987,4 +987,13 @@ return IntIsLeadByte(&AnsiCodePage.CodePageTable, TestByte); } +ULONG +WINAPI +NlsGetCacheUpdateCount(VOID) +{ + /* FIXME: */ + UNIMPLEMENTED; + return 0; +} + /* EOF */
19 years, 2 months
1
0
0
0
[ion] 18100: Stub and export EnumCalanderInfoExW and QueryWin31IniFilesMappedToRegistry
by ion@svn.reactos.com
Stub and export EnumCalanderInfoExW and QueryWin31IniFilesMappedToRegistry Modified: trunk/reactos/lib/kernel32/kernel32.def Modified: trunk/reactos/lib/kernel32/misc/lang.c Modified: trunk/reactos/lib/kernel32/misc/profile.c _____ Modified: trunk/reactos/lib/kernel32/kernel32.def --- trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:46:30 UTC (rev 18099) +++ trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:59:04 UTC (rev 18100) @@ -181,7 +181,7 @@ EnumCalendarInfoA@16 EnumCalendarInfoExA@16 EnumCalendarInfoExW@16 -;EnumCalendarInfoW@16 +EnumCalendarInfoW@16 EnumDateFormatsA@12 EnumDateFormatsExA@12 EnumDateFormatsExW@12 @@ -696,7 +696,7 @@ QueryPerformanceFrequency@4 QueueUserAPC@12 QueueUserWorkItem@12 -;QueryWin31IniFilesMappedToRegistry@16 +QueryWin31IniFilesMappedToRegistry@16 RaiseException@16 ReadConsoleA@20 ReadConsoleInputA@16 _____ Modified: trunk/reactos/lib/kernel32/misc/lang.c --- trunk/reactos/lib/kernel32/misc/lang.c 2005-09-26 18:46:30 UTC (rev 18099) +++ trunk/reactos/lib/kernel32/misc/lang.c 2005-09-26 18:59:04 UTC (rev 18100) @@ -104,9 +104,21 @@ return 0; } +/* + * @unimplemented + */ +BOOL +STDCALL +EnumCalendarInfoW( + CALINFO_ENUMPROCW lpCalInfoEnumProcEx, + LCID Locale, + CALID Calendar, + CALTYPE CalType) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} - - /* * @unimplemented */ _____ Modified: trunk/reactos/lib/kernel32/misc/profile.c --- trunk/reactos/lib/kernel32/misc/profile.c 2005-09-26 18:46:30 UTC (rev 18099) +++ trunk/reactos/lib/kernel32/misc/profile.c 2005-09-26 18:59:04 UTC (rev 18100) @@ -1872,3 +1872,18 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/* + * @unimplemented + */ +BOOL +STDCALL +QueryWin31IniFilesMappedToRegistry(DWORD Unknown0, + DWORD Unknown1, + DWORD Unknown2, + DWORD Unknown3) +{ + DPRINT1("QueryWin31IniFilesMappedToRegistry not implemented\n"); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +}
19 years, 2 months
1
0
0
0
[ion] 18099: Export and implement CreateProcessInternalA and CreateProcessInternalW (really just shuffling/stubbing, no actual code was written.
by ion@svn.reactos.com
Export and implement CreateProcessInternalA and CreateProcessInternalW (really just shuffling/stubbing, no actual code was written. Modified: trunk/reactos/lib/kernel32/kernel32.def Modified: trunk/reactos/lib/kernel32/process/create.c _____ Modified: trunk/reactos/lib/kernel32/kernel32.def --- trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:05:57 UTC (rev 18098) +++ trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:46:30 UTC (rev 18099) @@ -129,8 +129,8 @@ CreateNlsSecurityDescriptor@12 CreatePipe@16 CreateProcessA@40 -;CreateProcessInternalA -;CreateProcessInternalW +CreateProcessInternalA@48 +CreateProcessInternalW@48 CreateProcessW@40 CreateRemoteThread@28 CreateSemaphoreA@16 _____ Modified: trunk/reactos/lib/kernel32/process/create.c --- trunk/reactos/lib/kernel32/process/create.c 2005-09-26 18:05:57 UTC (rev 18098) +++ trunk/reactos/lib/kernel32/process/create.c 2005-09-26 18:46:30 UTC (rev 18099) @@ -613,153 +613,22 @@ /* FUNCTIONS ****************************************************************/ /* - * FUNCTION: The CreateProcess function creates a new process and its - * primary thread. The new process executes the specified executable file - * ARGUMENTS: - * - * lpApplicationName = Pointer to name of executable module - * lpCommandLine = Pointer to command line string - * lpProcessAttributes = Process security attributes - * lpThreadAttributes = Thread security attributes - * bInheritHandles = Handle inheritance flag - * dwCreationFlags = Creation flags - * lpEnvironment = Pointer to new environment block - * lpCurrentDirectory = Pointer to current directory name - * lpStartupInfo = Pointer to startup info - * lpProcessInformation = Pointer to process information - * * @implemented */ BOOL STDCALL -CreateProcessA(LPCSTR lpApplicationName, - LPSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCSTR lpCurrentDirectory, - LPSTARTUPINFOA lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) -{ - PUNICODE_STRING CommandLine = NULL; - UNICODE_STRING DummyString; - UNICODE_STRING LiveCommandLine; - UNICODE_STRING ApplicationName; - UNICODE_STRING CurrentDirectory; - BOOL bRetVal; - STARTUPINFOW StartupInfo; - - DPRINT("dwCreationFlags %x, lpEnvironment %x, lpCurrentDirectory %x, " - "lpStartupInfo %x, lpProcessInformation %x\n", - dwCreationFlags, lpEnvironment, lpCurrentDirectory, - lpStartupInfo, lpProcessInformation); - - /* Copy Startup Info */ - RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo)); - - /* Initialize all strings to nothing */ - LiveCommandLine.Buffer = NULL; - DummyString.Buffer = NULL; - ApplicationName.Buffer = NULL; - CurrentDirectory.Buffer = NULL; - StartupInfo.lpDesktop = NULL; - StartupInfo.lpReserved = NULL; - StartupInfo.lpTitle = NULL; - - /* Convert the Command line */ - if (lpCommandLine) - { - /* If it's too long, then we'll have a problem */ - if ((strlen(lpCommandLine) + 1) * sizeof(WCHAR) < - NtCurrentTeb()->StaticUnicodeString.MaximumLength) - { - /* Cache it in the TEB */ - CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine); - } - else - { - /* Use a dynamic version */ - Basep8BitStringToHeapUnicodeString(&LiveCommandLine, - lpCommandLine); - } - } - else - { - /* The logic below will use CommandLine, so we must make it valid */ - CommandLine = &DummyString; - } - - /* Convert the Name and Directory */ - if (lpApplicationName) - { - Basep8BitStringToHeapUnicodeString(&ApplicationName, - lpApplicationName); - } - if (lpCurrentDirectory) - { - Basep8BitStringToHeapUnicodeString(&CurrentDirectory, - lpCurrentDirectory); - } - - /* Now convert Startup Strings */ - if (lpStartupInfo->lpReserved) - { - BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpReserved, - &StartupInfo.lpReserved); - } - if (lpStartupInfo->lpDesktop) - { - BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpDesktop, - &StartupInfo.lpDesktop); - } - if (lpStartupInfo->lpTitle) - { - BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpTitle, - &StartupInfo.lpTitle); - } - - /* Call the Unicode function */ - bRetVal = CreateProcessW(ApplicationName.Buffer, - LiveCommandLine.Buffer ? - LiveCommandLine.Buffer : CommandLine->Buffer, - lpProcessAttributes, - lpThreadAttributes, - bInheritHandles, - dwCreationFlags, - lpEnvironment, - CurrentDirectory.Buffer, - &StartupInfo, - lpProcessInformation); - - /* Clean up */ - RtlFreeUnicodeString(&ApplicationName); - RtlFreeUnicodeString(&LiveCommandLine); - RtlFreeUnicodeString(&CurrentDirectory); - RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpDesktop); - RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpReserved); - RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpTitle); - - /* Return what Unicode did */ - return bRetVal; -} - -/* - * @implemented - */ -BOOL -STDCALL -CreateProcessW(LPCWSTR lpApplicationName, - LPWSTR lpCommandLine, - LPSECURITY_ATTRIBUTES lpProcessAttributes, - LPSECURITY_ATTRIBUTES lpThreadAttributes, - BOOL bInheritHandles, - DWORD dwCreationFlags, - LPVOID lpEnvironment, - LPCWSTR lpCurrentDirectory, - LPSTARTUPINFOW lpStartupInfo, - LPPROCESS_INFORMATION lpProcessInformation) +CreateProcessInternalW(HANDLE hToken, + LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation, + PHANDLE hNewToken) { NTSTATUS Status; PROCESS_PRIORITY_CLASS PriorityClass; @@ -1447,4 +1316,203 @@ return TRUE; } +/* + * @implemented + */ +BOOL +STDCALL +CreateProcessW(LPCWSTR lpApplicationName, + LPWSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCWSTR lpCurrentDirectory, + LPSTARTUPINFOW lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) +{ + /* Call the internal (but exported) version */ + return CreateProcessInternalW(0, + lpApplicationName, + lpCommandLine, + lpProcessAttributes, + lpThreadAttributes, + bInheritHandles, + dwCreationFlags, + lpEnvironment, + lpCurrentDirectory, + lpStartupInfo, + lpProcessInformation, + NULL); +} + +/* + * @implemented + */ +BOOL +STDCALL +CreateProcessInternalA(HANDLE hToken, + LPCSTR lpApplicationName, + LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation, + PHANDLE hNewToken) +{ + PUNICODE_STRING CommandLine = NULL; + UNICODE_STRING DummyString; + UNICODE_STRING LiveCommandLine; + UNICODE_STRING ApplicationName; + UNICODE_STRING CurrentDirectory; + BOOL bRetVal; + STARTUPINFOW StartupInfo; + + DPRINT("dwCreationFlags %x, lpEnvironment %x, lpCurrentDirectory %x, " + "lpStartupInfo %x, lpProcessInformation %x\n", + dwCreationFlags, lpEnvironment, lpCurrentDirectory, + lpStartupInfo, lpProcessInformation); + + /* Copy Startup Info */ + RtlMoveMemory(&StartupInfo, lpStartupInfo, sizeof(*lpStartupInfo)); + + /* Initialize all strings to nothing */ + LiveCommandLine.Buffer = NULL; + DummyString.Buffer = NULL; + ApplicationName.Buffer = NULL; + CurrentDirectory.Buffer = NULL; + StartupInfo.lpDesktop = NULL; + StartupInfo.lpReserved = NULL; + StartupInfo.lpTitle = NULL; + + /* Convert the Command line */ + if (lpCommandLine) + { + /* If it's too long, then we'll have a problem */ + if ((strlen(lpCommandLine) + 1) * sizeof(WCHAR) < + NtCurrentTeb()->StaticUnicodeString.MaximumLength) + { + /* Cache it in the TEB */ + CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine); + } + else + { + /* Use a dynamic version */ + Basep8BitStringToHeapUnicodeString(&LiveCommandLine, + lpCommandLine); + } + } + else + { + /* The logic below will use CommandLine, so we must make it valid */ + CommandLine = &DummyString; + } + + /* Convert the Name and Directory */ + if (lpApplicationName) + { + Basep8BitStringToHeapUnicodeString(&ApplicationName, + lpApplicationName); + } + if (lpCurrentDirectory) + { + Basep8BitStringToHeapUnicodeString(&CurrentDirectory, + lpCurrentDirectory); + } + + /* Now convert Startup Strings */ + if (lpStartupInfo->lpReserved) + { + BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpReserved, + &StartupInfo.lpReserved); + } + if (lpStartupInfo->lpDesktop) + { + BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpDesktop, + &StartupInfo.lpDesktop); + } + if (lpStartupInfo->lpTitle) + { + BasepAnsiStringToHeapUnicodeString(lpStartupInfo->lpTitle, + &StartupInfo.lpTitle); + } + + /* Call the Unicode function */ + bRetVal = CreateProcessInternalW(hToken, + ApplicationName.Buffer, + LiveCommandLine.Buffer ? + LiveCommandLine.Buffer : CommandLine->Buffer, + lpProcessAttributes, + lpThreadAttributes, + bInheritHandles, + dwCreationFlags, + lpEnvironment, + CurrentDirectory.Buffer, + &StartupInfo, + lpProcessInformation, + hNewToken); + + /* Clean up */ + RtlFreeUnicodeString(&ApplicationName); + RtlFreeUnicodeString(&LiveCommandLine); + RtlFreeUnicodeString(&CurrentDirectory); + RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpDesktop); + RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpReserved); + RtlFreeHeap(GetProcessHeap(), 0, StartupInfo.lpTitle); + + /* Return what Unicode did */ + return bRetVal; +} + +/* + * FUNCTION: The CreateProcess function creates a new process and its + * primary thread. The new process executes the specified executable file + * ARGUMENTS: + * + * lpApplicationName = Pointer to name of executable module + * lpCommandLine = Pointer to command line string + * lpProcessAttributes = Process security attributes + * lpThreadAttributes = Thread security attributes + * bInheritHandles = Handle inheritance flag + * dwCreationFlags = Creation flags + * lpEnvironment = Pointer to new environment block + * lpCurrentDirectory = Pointer to current directory name + * lpStartupInfo = Pointer to startup info + * lpProcessInformation = Pointer to process information + * + * @implemented + */ +BOOL +STDCALL +CreateProcessA(LPCSTR lpApplicationName, + LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, + DWORD dwCreationFlags, + LPVOID lpEnvironment, + LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) +{ + /* Call the internal (but exported) version */ + return CreateProcessInternalA(0, + lpApplicationName, + lpCommandLine, + lpProcessAttributes, + lpThreadAttributes, + bInheritHandles, + dwCreationFlags, + lpEnvironment, + lpCurrentDirectory, + lpStartupInfo, + lpProcessInformation, + NULL); +} + /* EOF */
19 years, 2 months
1
0
0
0
[weiden] 18098: RegOverridePredefKey does not (as opposed to the PSDK documentation) accept predefined handles for the hNewHKey parameter
by weiden@svn.reactos.com
RegOverridePredefKey does not (as opposed to the PSDK documentation) accept predefined handles for the hNewHKey parameter Modified: trunk/reactos/lib/advapi32/reg/reg.c _____ Modified: trunk/reactos/lib/advapi32/reg/reg.c --- trunk/reactos/lib/advapi32/reg/reg.c 2005-09-26 18:03:17 UTC (rev 18097) +++ trunk/reactos/lib/advapi32/reg/reg.c 2005-09-26 18:05:57 UTC (rev 18098) @@ -38,10 +38,14 @@ static NTSTATUS MapDefaultKey (PHANDLE ParentKey, HKEY Key); static VOID CloseDefaultKeys(VOID); -#define CloseDefaultKey(Handle) \ +#define ClosePredefKey(Handle) \ if ((ULONG_PTR)Handle & 0x1) { \ NtClose(Handle); \ } +#define IsPredefKey(HKey) \ + (((ULONG)(HKey) & 0xF0000000) == 0x80000000) +#define GetPredefKeyIndex(HKey) \ + ((ULONG)(HKey) & 0x0FFFFFFF) static NTSTATUS OpenClassesRootKey(PHANDLE KeyHandle); static NTSTATUS OpenLocalMachineKey (PHANDLE KeyHandle); @@ -147,14 +151,14 @@ TRACE("MapDefaultKey (Key %x)\n", Key); - if (((ULONG)Key & 0xF0000000) != 0x80000000) + if (!IsPredefKey(Key)) { *RealKey = (HANDLE)((ULONG_PTR)Key & ~0x1); return STATUS_SUCCESS; } /* Handle special cases here */ - Index = (ULONG)Key & 0x0FFFFFFF; + Index = GetPredefKeyIndex(Key); if (Index >= MAX_DEFAULT_HANDLES) { return STATUS_INVALID_PARAMETER; @@ -319,17 +323,18 @@ { LONG ErrorCode = ERROR_SUCCESS; - if (hKey == HKEY_CLASSES_ROOT || - hKey == HKEY_CURRENT_CONFIG || - hKey == HKEY_CURRENT_USER || - hKey == HKEY_LOCAL_MACHINE || - hKey == HKEY_PERFORMANCE_DATA || - hKey == HKEY_USERS) + if ((hKey == HKEY_CLASSES_ROOT || + hKey == HKEY_CURRENT_CONFIG || + hKey == HKEY_CURRENT_USER || + hKey == HKEY_LOCAL_MACHINE || + hKey == HKEY_PERFORMANCE_DATA || + hKey == HKEY_USERS) && + !IsPredefKey(hNewHKey)) { PHANDLE Handle; ULONG Index; - Index = (ULONG)hKey & 0x0FFFFFFF; + Index = GetPredefKeyIndex(hKey); Handle = &DefaultHandleTable[Index]; if (hNewHKey == NULL) @@ -736,9 +741,9 @@ } Cleanup: - CloseDefaultKey(DestKeyHandle); + ClosePredefKey(DestKeyHandle); Cleanup2: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -991,7 +996,7 @@ RtlFreeUnicodeString (&ClassString); } - CloseDefaultKey(ParentKey); + ClosePredefKey(ParentKey); TRACE("Status %x\n", Status); if (!NT_SUCCESS(Status)) @@ -1052,7 +1057,7 @@ samDesired, lpdwDisposition); - CloseDefaultKey(ParentKey); + ClosePredefKey(ParentKey); TRACE("Status %x\n", Status); if (!NT_SUCCESS(Status)) @@ -1151,7 +1156,7 @@ NtClose (TargetKey); Cleanup: - CloseDefaultKey(ParentKey); + ClosePredefKey(ParentKey); if (!NT_SUCCESS(Status)) { @@ -1203,7 +1208,7 @@ NtClose (TargetKey); Cleanup: - CloseDefaultKey(ParentKey); + ClosePredefKey(ParentKey); if (!NT_SUCCESS(Status)) { @@ -1274,7 +1279,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -1565,7 +1570,7 @@ subkey, because the handle would be invalid already! */ if (CurKey != KeyHandle) { - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); } return ERROR_SUCCESS; @@ -1579,7 +1584,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return RtlNtStatusToDosError(Status); } @@ -1679,7 +1684,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return Ret; } @@ -1757,7 +1762,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return Ret; } @@ -1789,7 +1794,7 @@ &ValueName); RtlFreeUnicodeString (&ValueName); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -1826,7 +1831,7 @@ Status = NtDeleteValueKey (KeyHandle, &ValueName); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -2051,7 +2056,7 @@ KeyInfo); Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -2199,7 +2204,7 @@ KeyInfo); Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -2314,7 +2319,7 @@ done: if (buf_ptr != buffer) HeapFree( GetProcessHeap(), 0, buf_ptr ); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return RtlNtStatusToDosError(status); } @@ -2422,7 +2427,7 @@ done: if (buf_ptr != buffer) HeapFree( GetProcessHeap(), 0, buf_ptr ); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return RtlNtStatusToDosError(status); } @@ -2451,7 +2456,7 @@ Status = NtFlushKey (KeyHandle); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -2495,7 +2500,7 @@ *lpcbSecurityDescriptor, lpcbSecurityDescriptor); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -2603,7 +2608,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -2660,7 +2665,7 @@ ErrorCode = RtlNtStatusToDosError (Status); } - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -2779,7 +2784,7 @@ ErrorCode = RtlNtStatusToDosError (Status); } - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -2830,7 +2835,7 @@ ErrorCode = RtlNtStatusToDosError (Status); } - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -3216,7 +3221,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -3466,7 +3471,7 @@ ValueInfo); Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -3735,7 +3740,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -3897,7 +3902,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -3991,7 +3996,7 @@ NtClose (FileHandle); Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -4092,7 +4097,7 @@ NtClose (FileHandle); Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -4132,7 +4137,7 @@ SecurityInformation, pSecurityDescriptor); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -4282,7 +4287,7 @@ (PVOID)lpData, (ULONG)cbData); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -4407,7 +4412,7 @@ } Cleanup: - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); return ErrorCode; } @@ -4473,7 +4478,7 @@ Status = NtUnloadKey (&ObjectAttributes); - CloseDefaultKey(KeyHandle); + ClosePredefKey(KeyHandle); if (!NT_SUCCESS(Status)) {
19 years, 2 months
1
0
0
0
[ros-diffs] [ion] 18097: Open BNO directory with correct privileges, open CSR connection with correct path. Add InWindows boolean to use the right CSR ServerID in windows and add a hack to get kernel32 to be loadable if used with .local to force an application to use our kernel and not the system one. The result of this is that our kernel32 can now load in Windows XP (not 2000).
by ion@svn.reactos.com
Open BNO directory with correct privileges, open CSR connection with correct path. Add InWindows boolean to use the right CSR ServerID in windows and add a hack to get kernel32 to be loadable if used with .local to force an application to use our kernel and not the system one. The result of this is that our kernel32 can now load in Windows XP (not 2000). Modified: trunk/reactos/include/ndk/obtypes.h Modified: trunk/reactos/lib/kernel32/kernel32.def Modified: trunk/reactos/lib/kernel32/misc/dllmain.c _____ Modified: trunk/reactos/include/ndk/obtypes.h --- trunk/reactos/include/ndk/obtypes.h 2005-09-26 16:13:50 UTC (rev 18096) +++ trunk/reactos/include/ndk/obtypes.h 2005-09-26 18:03:17 UTC (rev 18097) @@ -36,7 +36,7 @@ #define DIRECTORY_TRAVERSE 0x0002 #define DIRECTORY_CREATE_OBJECT 0x0004 #define DIRECTORY_CREATE_SUBDIRECTORY 0x0008 -#define DIRECTORY_ALL_ACCESS STANDARD_RIGHTS_REQUIRED | 0xF +#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) #endif /* Duplication Flags */ _____ Modified: trunk/reactos/lib/kernel32/kernel32.def --- trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 16:13:50 UTC (rev 18096) +++ trunk/reactos/lib/kernel32/kernel32.def 2005-09-26 18:03:17 UTC (rev 18097) @@ -55,7 +55,8 @@ BaseFlushAppcompatCache@0 ;BaseInitAppcompatCache ;BaseInitAppcompatCacheSupport -;BaseProcessInitPostImport +BaseProcessInitPostImport@0 +BaseQueryModuleData@20 BaseUpdateAppcompatCache@12 Beep@8 BeginUpdateResourceA@8 _____ Modified: trunk/reactos/lib/kernel32/misc/dllmain.c --- trunk/reactos/lib/kernel32/misc/dllmain.c 2005-09-26 16:13:50 UTC (rev 18096) +++ trunk/reactos/lib/kernel32/misc/dllmain.c 2005-09-26 18:03:17 UTC (rev 18097) @@ -13,11 +13,9 @@ #include <k32.h> -#define NDEBUG +//#define NDEBUG #include "../include/debug.h" -#define CSR_BASE_DLL 0 // <- This should be 1 when CSR gets committed - /* GLOBALS *******************************************************************/ extern UNICODE_STRING SystemDirectory; @@ -26,6 +24,8 @@ HANDLE hProcessHeap = NULL; HMODULE hCurrentModule = NULL; HANDLE hBaseDir = NULL; +PPEB Peb; +ULONG SessionId; static BOOL DllInitialized = FALSE; static BOOL ConsoleInitialized = FALSE; @@ -44,6 +44,7 @@ extern BOOL FASTCALL NlsInit(); extern VOID FASTCALL NlsUninit(); +BOOLEAN InWindows = FALSE; HANDLE STDCALL @@ -52,41 +53,77 @@ BOOL bInheritHandle, DWORD dwOptions); +#define WIN_OBJ_DIR L"\\Windows" +#define SESSION_DIR L"\\Sessions" + /* FUNCTIONS *****************************************************************/ -static NTSTATUS +NTSTATUS +WINAPI OpenBaseDirectory(PHANDLE DirHandle) { - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\BaseNamedObjects"); - NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING Name = RTL_CONSTANT_STRING(L"\\BaseNamedObjects"); + NTSTATUS Status; - InitializeObjectAttributes(&ObjectAttributes, - &Name, - OBJ_CASE_INSENSITIVE|OBJ_PERMANENT, - NULL, - NULL); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); - Status = NtOpenDirectoryObject(DirHandle, - DIRECTORY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) + Status = NtOpenDirectoryObject(DirHandle, + DIRECTORY_ALL_ACCESS & + ~(DELETE | WRITE_DAC | WRITE_OWNER), + &ObjectAttributes); + if (!NT_SUCCESS(Status)) { - Status = NtCreateDirectoryObject(DirHandle, - DIRECTORY_ALL_ACCESS, - &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DbgPrint("NtCreateDirectoryObject() failed\n"); - } - - return Status; + /* FIXME: It's not our job to create the BNO directory, csr does it */ + Status = NtCreateDirectoryObject(DirHandle, + DIRECTORY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtCreateDirectoryObject() failed\n"); + } } - return STATUS_SUCCESS; + DPRINT("Opened BNO: %lx\n", *DirHandle); + return Status; } +/* + * @unimplemented + */ BOOL +WINAPI +BaseQueryModuleData(IN LPSTR ModuleName, + IN LPSTR Unknown, + IN PVOID Unknown2, + IN PVOID Unknown3, + IN PVOID Unknown4) +{ + DPRINT1("BaseQueryModuleData called: %s %s %x %x %x\n", + ModuleName, + Unknown, + Unknown2, + Unknown3, + Unknown4); + return FALSE; +} + +/* + * @unimplemented + */ +NTSTATUS +WINAPI +BaseProcessInitPostImport(VOID) +{ + /* FIXME: Initialize TS pointers */ + return STATUS_SUCCESS; +} + +BOOL STDCALL BasepInitConsole(VOID) { @@ -210,20 +247,75 @@ BOOLEAN IsServer; ULONG Dummy; ULONG DummySize = sizeof(Dummy); + WCHAR SessionDir[256]; DPRINT("DllMain(hInst %lx, dwReason %lu)\n", hDll, dwReason); + /* Cache the PEB and Session ID */ + Peb = NtCurrentPeb(); + SessionId = Peb->SessionId; + switch (dwReason) { case DLL_PROCESS_ATTACH: + /* OK, yes, this is really retarded but it works for now */ + InWindows = NtCurrentPeb()->BeingDebugged; + + /* + * CreateProcess will run in the real kernel32 and it will write + * its own BaseProcessStartThunk EIP in the CONTEXT that ZwContinue + * will get. We'll be first called by Ldr while initializing, and we'll + * be wrapped in 3 layers of SEH, followed by two frames, finally + * followed by our CONTEXT on the stack. We'll modify the EIP in it + * to match the correct one (our own) and then everything works. + * Tested on XP and 2K3, probably doesn't work in 2K. + */ + if (InWindows) + { + /* + * Due to yet another bug in how Windows handles .local, LDR will + * actually end up loading us twice. The second time will be the + * "official" load, at a totally different address. It will be, + * it will be at -that- address that all the APIs will be called. + * However, that address is dynamic while this one will be static, + * so we'll do initilization with this one. Plus, at this one, + * we know exactly that we're within 3 SEH layers. + */ + if (hDll == (HANDLE)0x7c800000) + { + PULONG Eip; + Eip = (PULONG)*(PULONG)*(PULONG)NtCurrentTeb()->Tib.ExceptionList + + 0x9 + + FIELD_OFFSET(CONTEXT, Eip) / sizeof(ULONG); + *Eip = (ULONG)BaseProcessStartThunk; + } + } + /* Don't bother us for each thread */ LdrDisableThreadCalloutsForDll((PVOID)hDll); + /* Setup the right Object Directory path */ + if (!SessionId) + { + /* Use the raw path */ + wcscpy(SessionDir, WIN_OBJ_DIR); + } + else + { + /* Use the session path */ + swprintf(SessionDir, + L"%ws\\%ld%ws", + SESSION_DIR, + SessionId, + WIN_OBJ_DIR); + } + /* Connect to the base server */ - Status = CsrClientConnectToServer(L"\\Windows", // <- FIXME: SessionDir - CSR_BASE_DLL, + DPRINT("Connecting to CSR...\n"); + Status = CsrClientConnectToServer(SessionDir, + InWindows ? 1 : 0, &Dummy, &DummySize, &IsServer); @@ -238,85 +330,85 @@ if (!IsServer) { /* Set the termination port for the thread */ + DPRINT("Creating new thread for CSR\n"); CsrNewThread(); } - hProcessHeap = RtlGetProcessHeap(); - hCurrentModule = hDll; + hProcessHeap = RtlGetProcessHeap(); + hCurrentModule = hDll; + DPRINT("Heap: %p\n", hProcessHeap); - /* - * Initialize WindowsDirectory and SystemDirectory - */ - DPRINT("NtSystemRoot: %S\n", - SharedUserData->NtSystemRoot); - RtlCreateUnicodeString (&WindowsDirectory, - SharedUserData->NtSystemRoot); - SystemDirectory.MaximumLength = WindowsDirectory.MaximumLength + 18; - SystemDirectory.Length = WindowsDirectory.Length + 18; - SystemDirectory.Buffer = RtlAllocateHeap (hProcessHeap, - 0, - SystemDirectory.MaximumLength); - wcscpy (SystemDirectory.Buffer, WindowsDirectory.Buffer); - wcscat (SystemDirectory.Buffer, L"\\System32"); + /* + * Initialize WindowsDirectory and SystemDirectory + */ + DPRINT("NtSystemRoot: %S\n", SharedUserData->NtSystemRoot); + RtlCreateUnicodeString (&WindowsDirectory, SharedUserData->NtSystemRoot); + SystemDirectory.MaximumLength = WindowsDirectory.MaximumLength + 18; + SystemDirectory.Length = WindowsDirectory.Length + 18; + SystemDirectory.Buffer = RtlAllocateHeap(hProcessHeap, + 0, + SystemDirectory.MaximumLength); + wcscpy(SystemDirectory.Buffer, WindowsDirectory.Buffer); + wcscat(SystemDirectory.Buffer, L"\\System32"); - /* Open object base directory */ - Status = OpenBaseDirectory(&hBaseDir); - if (!NT_SUCCESS(Status)) - { - DbgPrint("Failed to open object base directory (Status %lx)\n", - Status); - return FALSE; - } + /* Open object base directory */ + Status = OpenBaseDirectory(&hBaseDir); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open object base directory (Status %lx)\n", Status); + return FALSE; + } - /* Initialize the DLL critical section */ - RtlInitializeCriticalSection(&DllLock); + /* Initialize the DLL critical section */ + RtlInitializeCriticalSection(&DllLock); - /* Initialize the National Language Support routines */ - if (! NlsInit()) - { + /* Initialize the National Language Support routines */ + if (!NlsInit()) + { + DPRINT1("NLS Init failed\n"); return FALSE; - } + } - /* Initialize Console Support */ - if (!BasepInitConsole()) - { - DPRINT1("Failure to set up console\n"); - return FALSE; - } + /* Initialize Console Support */ + if (!BasepInitConsole()) + { + DPRINT1("Failure to set up console\n"); + return FALSE; + } - /* Insert more dll attach stuff here! */ + /* Insert more dll attach stuff here! */ + DllInitialized = TRUE; + DPRINT1("Initialization complete\n"); + break; - DllInitialized = TRUE; - break; + case DLL_PROCESS_DETACH: - case DLL_PROCESS_DETACH: - DPRINT("DLL_PROCESS_DETACH\n"); - if (DllInitialized == TRUE) - { - /* Insert more dll detach stuff here! */ + DPRINT("DLL_PROCESS_DETACH\n"); + if (DllInitialized == TRUE) + { + /* Insert more dll detach stuff here! */ + NlsUninit(); - NlsUninit(); + /* Delete DLL critical section */ + if (ConsoleInitialized == TRUE) + { + RtlDeleteCriticalSection (&ConsoleLock); + } + RtlDeleteCriticalSection (&DllLock); - /* Delete DLL critical section */ - if (ConsoleInitialized == TRUE) - { - RtlDeleteCriticalSection (&ConsoleLock); - } - RtlDeleteCriticalSection (&DllLock); + /* Close object base directory */ + NtClose(hBaseDir); - /* Close object base directory */ - NtClose(hBaseDir); + RtlFreeUnicodeString (&SystemDirectory); + RtlFreeUnicodeString (&WindowsDirectory); + } + break; - RtlFreeUnicodeString (&SystemDirectory); - RtlFreeUnicodeString (&WindowsDirectory); - } - break; - - default: - break; + default: + break; } - return TRUE; + return TRUE; } /* EOF */
19 years, 2 months
1
0
0
0
[fireball] 18096: Christoph von Wittich: fix for bug 824 ("memory leak in welcome").
by fireball@svn.reactos.com
Christoph von Wittich: fix for bug 824 ("memory leak in welcome"). -LoadBitmap without DeleteObject -SelectObject is used with wrong DC Modified: trunk/reactos/subsys/system/welcome/welcome.c _____ Modified: trunk/reactos/subsys/system/welcome/welcome.c --- trunk/reactos/subsys/system/welcome/welcome.c 2005-09-26 16:07:23 UTC (rev 18095) +++ trunk/reactos/subsys/system/welcome/welcome.c 2005-09-26 16:13:50 UTC (rev 18096) @@ -143,6 +143,7 @@ ulInnerWidth = BitmapInfo.bmWidth; ulInnerHeight = (ulInnerWidth * 3) / 4; ulTitleHeight = BitmapInfo.bmHeight + 3; + DeleteObject(hTitleBitmap); } ulInnerHeight -= GetSystemMetrics(SM_CYCAPTION); @@ -485,7 +486,7 @@ rcPanel->right - rcPanel->left, rcPanel->bottom - 3, hdcMem, 0, 0, SRCCOPY); - SelectObject(hdc, hOldBitmap); + SelectObject(hdcMem, hOldBitmap); /* Dark blue line */ hOldBrush = SelectObject(hdc, hbrDarkBlue);
19 years, 3 months
1
0
0
0
[fireball] 18095: Christoph von Wittich: fix for bug 823 ("Resource leak in regedit").
by fireball@svn.reactos.com
Christoph von Wittich: fix for bug 823 ("Resource leak in regedit"). Modified: trunk/reactos/subsys/system/regedit/main.c _____ Modified: trunk/reactos/subsys/system/regedit/main.c --- trunk/reactos/subsys/system/regedit/main.c 2005-09-26 15:50:37 UTC (rev 18094) +++ trunk/reactos/subsys/system/regedit/main.c 2005-09-26 16:07:23 UTC (rev 18095) @@ -165,6 +165,7 @@ { UnregisterHexEditorClass(hInstance); DestroyMenu(hMenuFrame); + DestroyMenu(hPopupMenus); UnloadAclUiDll(); }
19 years, 3 months
1
0
0
0
[fireball] 18094: Christoph von Wittich: fix for bug 822 ("Resource leak in calc").
by fireball@svn.reactos.com
Christoph von Wittich: fix for bug 822 ("Resource leak in calc"). Modified: trunk/reactos/subsys/system/calc/winecalc.c _____ Modified: trunk/reactos/subsys/system/calc/winecalc.c --- trunk/reactos/subsys/system/calc/winecalc.c 2005-09-26 13:02:01 UTC (rev 18093) +++ trunk/reactos/subsys/system/calc/winecalc.c 2005-09-26 15:50:37 UTC (rev 18094) @@ -2847,6 +2847,15 @@ { int i; + if (menus[MENU_STD] != 0) + DestroyMenu(menus[MENU_STD]); + + if (menus[MENU_SCIMS] != 0) + DestroyMenu(menus[MENU_SCIMS]); + + if (menus[MENU_SCIWS] != 0) + DestroyMenu(menus[MENU_SCIWS]); + for (i=0;i<calc->numButtons;i++) DestroyWindow(calc->cb[i].hBtn); }
19 years, 3 months
1
0
0
0
[weiden] 18093: export RegOverridePredefKey, forgot to commit this change
by weiden@svn.reactos.com
export RegOverridePredefKey, forgot to commit this change Modified: trunk/reactos/lib/advapi32/advapi32.def _____ Modified: trunk/reactos/lib/advapi32/advapi32.def --- trunk/reactos/lib/advapi32/advapi32.def 2005-09-26 12:44:03 UTC (rev 18092) +++ trunk/reactos/lib/advapi32/advapi32.def 2005-09-26 13:02:01 UTC (rev 18093) @@ -503,7 +503,7 @@ RegOpenKeyExW@20 RegOpenKeyW@12 RegOpenUserClassesRoot@16 -;RegOverridePredefKey +RegOverridePredefKey@8 RegQueryInfoKeyA@48 RegQueryInfoKeyW@48 RegQueryMultipleValuesA@20
19 years, 3 months
1
0
0
0
[weiden] 18092: implemented RegOverridePredefKey()
by weiden@svn.reactos.com
implemented RegOverridePredefKey() Modified: trunk/reactos/lib/advapi32/reg/reg.c _____ Modified: trunk/reactos/lib/advapi32/reg/reg.c --- trunk/reactos/lib/advapi32/reg/reg.c 2005-09-26 12:05:27 UTC (rev 18091) +++ trunk/reactos/lib/advapi32/reg/reg.c 2005-09-26 12:44:03 UTC (rev 18092) @@ -5,6 +5,7 @@ * FILE: lib/advapi32/reg/reg.c * PURPOSE: Registry functions * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) + * Thomas Weidenmueller <w3seek(a)reactos.com> * UPDATE HISTORY: * Created 01/11/98 * 19990309 EA Stubs @@ -88,6 +89,54 @@ static NTSTATUS +OpenPredefinedKey(IN ULONG Index, + OUT HANDLE Handle) +{ + NTSTATUS Status; + + switch (Index) + { + case 0: /* HKEY_CLASSES_ROOT */ + Status = OpenClassesRootKey (Handle); + break; + + case 1: /* HKEY_CURRENT_USER */ + Status = RtlOpenCurrentUser (MAXIMUM_ALLOWED, + Handle); + break; + + case 2: /* HKEY_LOCAL_MACHINE */ + Status = OpenLocalMachineKey (Handle); + break; + + case 3: /* HKEY_USERS */ + Status = OpenUsersKey (Handle); + break; +#if 0 + case 4: /* HKEY_PERFORMANCE_DATA */ + Status = OpenPerformanceDataKey (Handle); + break; +#endif + + case 5: /* HKEY_CURRENT_CONFIG */ + Status = OpenCurrentConfigKey (Handle); + break; + + case 6: /* HKEY_DYN_DATA */ + Status = STATUS_NOT_IMPLEMENTED; + break; + + default: + WARN("MapDefaultHandle() no handle creator\n"); + Status = STATUS_INVALID_PARAMETER; + break; + } + + return Status; +} + + +static NTSTATUS MapDefaultKey (OUT PHANDLE RealKey, IN HKEY Key) { @@ -127,42 +176,8 @@ if (DoOpen) { /* create/open the default handle */ - switch (Index) - { - case 0: /* HKEY_CLASSES_ROOT */ - Status = OpenClassesRootKey (Handle); - break; - - case 1: /* HKEY_CURRENT_USER */ - Status = RtlOpenCurrentUser (MAXIMUM_ALLOWED, - Handle); - break; - - case 2: /* HKEY_LOCAL_MACHINE */ - Status = OpenLocalMachineKey (Handle); - break; - - case 3: /* HKEY_USERS */ - Status = OpenUsersKey (Handle); - break; -#if 0 - case 4: /* HKEY_PERFORMANCE_DATA */ - Status = OpenPerformanceDataKey (Handle); - break; -#endif - case 5: /* HKEY_CURRENT_CONFIG */ - Status = OpenCurrentConfigKey (Handle); - break; - - case 6: /* HKEY_DYN_DATA */ - Status = STATUS_NOT_IMPLEMENTED; - break; - - default: - WARN("MapDefaultHandle() no handle creator\n"); - Status = STATUS_INVALID_PARAMETER; - break; - } + Status = OpenPredefinedKey(Index, + Handle); } if (NT_SUCCESS(Status)) @@ -294,6 +309,63 @@ /*********************************************************************** * + * RegOverridePredefKey + * + * @implemented + */ +LONG STDCALL +RegOverridePredefKey(IN HKEY hKey, + IN HKEY hNewHKey OPTIONAL) +{ + LONG ErrorCode = ERROR_SUCCESS; + + if (hKey == HKEY_CLASSES_ROOT || + hKey == HKEY_CURRENT_CONFIG || + hKey == HKEY_CURRENT_USER || + hKey == HKEY_LOCAL_MACHINE || + hKey == HKEY_PERFORMANCE_DATA || + hKey == HKEY_USERS) + { + PHANDLE Handle; + ULONG Index; + + Index = (ULONG)hKey & 0x0FFFFFFF; + Handle = &DefaultHandleTable[Index]; + + if (hNewHKey == NULL) + { + /* restore the default mapping */ + NTSTATUS Status = OpenPredefinedKey(Index, + &hNewHKey); + if (!NT_SUCCESS(Status)) + { + return RtlNtStatusToDosError(Status); + } + + ASSERT(hNewHKey != NULL); + } + + RtlEnterCriticalSection (&HandleTableCS); + + /* close the currently mapped handle if existing */ + if (*Handle != NULL) + { + NtClose(*Handle); + } + + /* update the mapping */ + *Handle = hNewHKey; + + RtlLeaveCriticalSection (&HandleTableCS); + } + else + ErrorCode = ERROR_INVALID_HANDLE; + + return ErrorCode; +} + + +/********************************************************************** ** * RegCloseKey * * @implemented
19 years, 3 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
59
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
52
53
54
55
56
57
58
59
Results per page:
10
25
50
100
200