Reactos

[SDK] Introduce winbase_undoc.h for undocumented exported kernel32 definitions (#8019)

This header is based on the following files from the official
Windows 10.0.10240.0 PSDK, a copy of which can be found at:
- https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/winbasep.h
- https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/wbasek.h

+65 -25
+2
CODEOWNERS
··· 432 432 # M: 433 433 # R: HBelusca, Hermès Bélusca-Maïto 434 434 # S: Maintained 435 + /sdk/include/reactos/winbase_undoc.h @HBelusca 436 + /subsystems/win/basesrv/ 435 437 /win32ss/user/winsrv/ 436 438 /win32ss/user/winsrv/usersrv/harderror.c @HBelusca 437 439
+1
base/services/schedsvc/job.c
··· 9 9 /* INCLUDES *****************************************************************/ 10 10 11 11 #include "precomp.h" 12 + #include <winbase_undoc.h> 12 13 13 14 WINE_DEFAULT_DEBUG_CHANNEL(schedsvc); 14 15
-1
base/services/schedsvc/precomp.h
··· 12 12 #include <winreg.h> 13 13 #include <winsvc.h> 14 14 #include <winuser.h> 15 - #include <undocuser.h> 16 15 17 16 #include <ndk/rtlfuncs.h> 18 17
+1 -2
base/system/services/database.c
··· 14 14 15 15 #include "services.h" 16 16 17 + #include <winbase_undoc.h> 17 18 #include <userenv.h> 18 19 #include <strsafe.h> 19 - 20 - #include <reactos/undocuser.h> 21 20 22 21 #define NDEBUG 23 22 #include <debug.h>
+1
base/system/winlogon/screensaver.c
··· 9 9 /* INCLUDES *****************************************************************/ 10 10 11 11 #include "winlogon.h" 12 + #include <winbase_undoc.h> 12 13 13 14 /* FUNCTIONS ****************************************************************/ 14 15
+2 -2
base/system/winlogon/winlogon.h
··· 47 47 /* PSEH for SEH Support */ 48 48 #include <pseh/pseh2.h> 49 49 50 - #include <reactos/undocuser.h> 51 - #include <reactos/undocmpr.h> 50 + #include <undocuser.h> 51 + #include <undocmpr.h> 52 52 53 53 BOOL 54 54 WINAPI
-3
dll/win32/kernel32/include/kernel32.h
··· 56 56 #define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION) 57 57 #define __ENDTRY _SEH2_END 58 58 59 - /* Undocumented CreateProcess flag */ 60 - #define STARTF_SHELLPRIVATE 0x400 61 - 62 59 typedef struct _CODEPAGE_ENTRY 63 60 { 64 61 LIST_ENTRY Entry;
+1
dll/win32/kernel32/k32.h
··· 17 17 #define WIN32_NO_STATUS 18 18 #include <windef.h> 19 19 #include <winbase.h> 20 + #include <winbase_undoc.h> 20 21 #include <wingdi.h> 21 22 #include <winreg.h> 22 23 #include <wincon.h>
-1
dll/win32/shell32/shelldesktop/shelldesktop.h
··· 26 26 #include <atlcom.h> 27 27 #include <atlwin.h> 28 28 #include <undocshell.h> 29 - #include <undocuser.h> 30 29 31 30 #include <shellutils.h> 32 31 #include "CChangeNotifyServer.h"
-1
dll/win32/shell32/shellmenu/shellmenu.h
··· 49 49 #include <atlcom.h> 50 50 #include <atlwin.h> 51 51 #include <undocshell.h> 52 - #include <undocuser.h> 53 52 54 53 #include <shellutils.h> 55 54 #include <ui/rosctrls.h>
+1 -3
dll/win32/shell32/shlexec.cpp
··· 21 21 */ 22 22 23 23 #include "precomp.h" 24 + #include <winbase_undoc.h> 24 25 #include <undocshell.h> 25 26 26 27 WINE_DEFAULT_DEBUG_CHANNEL(exec); 27 28 28 29 EXTERN_C BOOL PathIsExeW(LPCWSTR lpszPath); 29 30 30 - #ifndef STARTF_SHELLPRIVATE 31 - #define STARTF_SHELLPRIVATE 0x400 // From kernel32.h 32 - #endif 33 31 #define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY) 34 32 35 33 typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
+3
sdk/include/psdk/winbase.h
··· 536 536 #define STARTF_TITLEISAPPID 0x00001000 537 537 #define STARTF_PREVENTPINNING 0x00002000 538 538 #endif /* (WINVER >= 0x400) */ 539 + #if (WINVER >= 0x0600) 540 + #define STARTF_UNTRUSTEDSOURCE 0x00008000 541 + #endif /* (WINVER >= 0x0600) */ 539 542 540 543 #define TC_NORMAL 0 541 544 #define TC_HARDERR 1
+7 -2
sdk/include/reactos/undocuser.h
··· 1 1 #ifndef _UNDOCUSER_H 2 2 #define _UNDOCUSER_H 3 3 4 + #pragma once 5 + 4 6 #ifdef __cplusplus 5 7 extern "C" { 6 8 #endif /* defined(__cplusplus) */ ··· 159 161 #define DFCS_MENUARROWDOWN 0x0010 160 162 161 163 // 162 - // Undocumented flags for CreateProcess 164 + // Win32-user-specific undocumented flags for CreateProcess 163 165 // 166 + #ifndef STARTF_INHERITDESKTOP 164 167 #define STARTF_INHERITDESKTOP 0x40000000 165 168 #define STARTF_SCREENSAVER 0x80000000 169 + #endif 170 + 166 171 167 172 #define MOD_WINLOGON_SAS 0x8000 168 173 ··· 414 419 } /* extern "C" */ 415 420 #endif /* defined(__cplusplus) */ 416 421 417 - #endif 422 + #endif /* _UNDOCUSER_H */
+41
sdk/include/reactos/winbase_undoc.h
··· 1 + /* 2 + * PROJECT: ReactOS SDK 3 + * LICENSE: Dual-licensed: 4 + * LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later) 5 + * MIT (https://spdx.org/licenses/MIT) 6 + * PURPOSE: Undocumented Base API definitions, absent from winbase.h 7 + * COPYRIGHT: Copyright 2025 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> 8 + * 9 + * REMARK: This header is based on the following files from the official 10 + * Windows 10.0.10240.0 PSDK, a copy of which can be found at: 11 + * - https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/winbasep.h 12 + * - https://github.com/tpn/winsdk-10/blob/master/Include/10.0.10240.0/um/minwin/wbasek.h 13 + */ 14 + 15 + #ifndef _WINBASE_UNDOC_H 16 + #define _WINBASE_UNDOC_H 17 + 18 + #pragma once 19 + 20 + #ifdef __cplusplus 21 + extern "C" { 22 + #endif 23 + 24 + /* 25 + * Undocumented flags for CreateProcess 26 + */ 27 + #if (WINVER >= 0x400) 28 + #define STARTF_HASSHELLDATA 0x00000400 // As seen in um/minwin/winbasep.h 29 + #define STARTF_SHELLPRIVATE STARTF_HASSHELLDATA // ReactOS-specific name 30 + #endif /* (WINVER >= 0x400) */ 31 + #if (WINVER >= 0x0A00) 32 + #define STARTF_TITLEISLOCALALLOCED 0x00004000 33 + #endif /* (WINVER >= 0x0A00) */ 34 + #define STARTF_INHERITDESKTOP 0x40000000 35 + #define STARTF_SCREENSAVER 0x80000000 36 + 37 + #ifdef __cplusplus 38 + } 39 + #endif 40 + 41 + #endif /* _WINBASE_UNDOC_H */
+4 -3
win32ss/pch.h
··· 35 35 typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; 36 36 #define MAKEINTATOM(i) (LPWSTR)((ULONG_PTR)((WORD)(i))) 37 37 #define WINBASEAPI 38 - #define STARTF_USESHOWWINDOW 1 39 - #define STARTF_USESIZE 2 40 - #define STARTF_USEPOSITION 4 38 + #define STARTF_USESHOWWINDOW 0x00000001 39 + #define STARTF_USESIZE 0x00000002 40 + #define STARTF_USEPOSITION 0x00000004 41 + #define STARTF_USEHOTKEY 0x00000200 41 42 #include <windef.h> 42 43 43 44 // Needed because windef.h messes up CDECL for whatever
+1 -7
win32ss/user/ntuser/main.c
··· 8 8 9 9 #include <win32k.h> 10 10 #include <napi.h> 11 + #include <winbase_undoc.h> 11 12 12 13 #define NDEBUG 13 14 #include <debug.h> 14 15 #include <kdros.h> 15 - 16 - #ifndef STARTF_USEHOTKEY 17 - #define STARTF_USEHOTKEY 0x0200 18 - #endif 19 - #ifndef STARTF_SHELLPRIVATE 20 - #define STARTF_SHELLPRIVATE 0x0400 21 - #endif 22 16 23 17 HANDLE hModuleWin; 24 18