From 6360a0bc02955cf89204952e1ae03f3bc19839ee Mon Sep 17 00:00:00 2001 From: Josh <36625023+JoshuaBrest@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:14:27 -0800 Subject: [PATCH] fix: Add stubs to fix steam. --- configure | 4 ++ configure.ac | 2 + dlls/kernel32/kernel32.spec | 2 + dlls/kernel32/process.c | 12 ++++++ dlls/kernelbase/kernelbase.spec | 1 + dlls/kernelbase/process.c | 18 ++++++++ dlls/userenv/userenv.spec | 2 + dlls/userenv/userenv_main.c | 17 ++++++++ include/ddk/wdm.h | 2 +- include/winbase.h | 16 ++++++++ include/winnt.h | 7 ++++ include/winternl.h | 73 ++++++++++++++++++++++++++++++++- 12 files changed, 153 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 475f1229ffab..abc3f23b986f 100755 --- a/configure +++ b/configure @@ -965,6 +965,7 @@ enable_avicap32 enable_avifil32 enable_avrt enable_bcrypt +enable_bcryptprimitives enable_bluetoothapis enable_browseui enable_bthprops_cpl @@ -1218,6 +1219,7 @@ enable_msimtf enable_msisip enable_msisys_ocx enable_msls31 +enable_msmpeg2vdec enable_msnet32 enable_mspatcha enable_msports @@ -21837,6 +21839,7 @@ wine_fn_config_makefile dlls/avifile.dll16 enable_win16 wine_fn_config_makefile dlls/avrt enable_avrt wine_fn_config_makefile dlls/bcrypt enable_bcrypt wine_fn_config_makefile dlls/bcrypt/tests enable_tests +wine_fn_config_makefile dlls/bcryptprimitives enable_bcryptprimitives wine_fn_config_makefile dlls/bluetoothapis enable_bluetoothapis wine_fn_config_makefile dlls/browseui enable_browseui wine_fn_config_makefile dlls/browseui/tests enable_tests @@ -22225,6 +22228,7 @@ wine_fn_config_makefile dlls/msimtf enable_msimtf wine_fn_config_makefile dlls/msisip enable_msisip wine_fn_config_makefile dlls/msisys.ocx enable_msisys_ocx wine_fn_config_makefile dlls/msls31 enable_msls31 +wine_fn_config_makefile dlls/msmpeg2vdec enable_msmpeg2vdec wine_fn_config_makefile dlls/msnet32 enable_msnet32 wine_fn_config_makefile dlls/mspatcha enable_mspatcha wine_fn_config_makefile dlls/mspatcha/tests enable_tests diff --git a/configure.ac b/configure.ac index c576648576b5..4ff64396658b 100644 --- a/configure.ac +++ b/configure.ac @@ -2455,6 +2455,7 @@ WINE_CONFIG_MAKEFILE(dlls/avifile.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/avrt) WINE_CONFIG_MAKEFILE(dlls/bcrypt) WINE_CONFIG_MAKEFILE(dlls/bcrypt/tests) +WINE_CONFIG_MAKEFILE(dlls/bcryptprimitives) WINE_CONFIG_MAKEFILE(dlls/bluetoothapis) WINE_CONFIG_MAKEFILE(dlls/browseui) WINE_CONFIG_MAKEFILE(dlls/browseui/tests) @@ -2843,6 +2844,7 @@ WINE_CONFIG_MAKEFILE(dlls/msimtf) WINE_CONFIG_MAKEFILE(dlls/msisip) WINE_CONFIG_MAKEFILE(dlls/msisys.ocx) WINE_CONFIG_MAKEFILE(dlls/msls31) +WINE_CONFIG_MAKEFILE(dlls/msmpeg2vdec) WINE_CONFIG_MAKEFILE(dlls/msnet32) WINE_CONFIG_MAKEFILE(dlls/mspatcha) WINE_CONFIG_MAKEFILE(dlls/mspatcha/tests) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 341eadef19f2..c25a22a0cfe0 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -694,6 +694,7 @@ @ stdcall -import GetFinalPathNameByHandleW(long ptr long long) @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) +@ stdcall GetFirmwareType(ptr) @ stdcall -import GetFullPathNameA(str long ptr ptr) # @ stub GetFullPathNameTransactedA # @ stub GetFullPathNameTransactedW @@ -1448,6 +1449,7 @@ @ stdcall SetProcessAffinityMask(long long) @ stdcall -import SetProcessAffinityUpdateMode(long long) @ stdcall SetProcessDEPPolicy(long) +@ stdcall -import SetProcessInformation(long long ptr long) @ stdcall -import SetProcessMitigationPolicy(long ptr long) @ stdcall -import SetProcessPreferredUILanguages(long ptr ptr) @ stdcall -import SetProcessPriorityBoost(long long) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 4630043645cc..e9e18925911f 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -740,6 +740,18 @@ BOOL WINAPI SetFirmwareEnvironmentVariableW(const WCHAR *name, const WCHAR *guid return FALSE; } +/*********************************************************************** + * GetFirmwareType (KERNEL32.@) + */ +BOOL WINAPI GetFirmwareType(FIRMWARE_TYPE *type) +{ + if (!type) + return FALSE; + + *type = FirmwareTypeUnknown; + return TRUE; +} + /********************************************************************** * GetNumaNodeProcessorMask (KERNEL32.@) */ diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index ae6bc842f7b3..22d902d1716e 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -1491,6 +1491,7 @@ @ stdcall SetProcessAffinityUpdateMode(long long) # @ stub SetProcessDefaultCpuSets @ stdcall SetProcessGroupAffinity(long ptr ptr) +@ stdcall SetProcessInformation(long long ptr long) # @ stub SetProcessInformation @ stdcall SetProcessMitigationPolicy(long ptr long) @ stdcall SetProcessPreferredUILanguages(long ptr ptr) diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index aebc647b1751..a1e08d0a6f22 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -860,6 +860,24 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( const WCHAR *app_name, WCHAR *cmd_ inherit, flags, env, cur_dir, startup_info, info, NULL ); } +/********************************************************************** + * SetProcessInformation (kernelbase.@) + */ +BOOL WINAPI SetProcessInformation( HANDLE process, PROCESS_INFORMATION_CLASS info_class, void *info, DWORD size ) +{ + switch (info_class) + { + case ProcessMemoryPriority: + return set_ntstatus( NtSetInformationProcess( process, ProcessPagePriority, info, size )); + case ProcessPowerThrottling: + return set_ntstatus( NtSetInformationProcess( process, ProcessPowerThrottlingState, info, size )); + case ProcessLeapSecondInfo: + return set_ntstatus( NtSetInformationProcess( process, ProcessLeapSecondInformation, info, size )); + default: + FIXME("Unrecognized information class %d.\n", info_class); + return FALSE; + } +} /********************************************************************* * DuplicateHandle (kernelbase.@) diff --git a/dlls/userenv/userenv.spec b/dlls/userenv/userenv.spec index 4d8bc4ec407d..a09e45a4069a 100644 --- a/dlls/userenv/userenv.spec +++ b/dlls/userenv/userenv.spec @@ -1,6 +1,8 @@ 138 stdcall @(long str str str str long str long long str str long) USERENV_138 +@ stdcall CreateAppContainerProfile(wstr wstr wstr ptr long ptr) @ stdcall CreateEnvironmentBlock(ptr ptr long) +@ stdcall DeriveAppContainerSidFromAppContainerName(wstr ptr) @ stdcall DestroyEnvironmentBlock(ptr) @ stdcall EnterCriticalPolicySection(long) @ stdcall ExpandEnvironmentStringsForUserA(ptr str ptr long) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 2b5171254dc9..beb4989f74b2 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -688,3 +688,20 @@ BOOL WINAPI USERENV_138( int csidl, LPCSTR lnk_dir, LPCSTR lnk_filename, return FALSE; } + +HRESULT WINAPI CreateAppContainerProfile(PCWSTR container_name, PCWSTR display_name, PCWSTR description, + SID_AND_ATTRIBUTES *capabilities, DWORD capability_count, + SID **container_sid) +{ + FIXME("(%s, %s, %s, %p, %ld, %p): stub\n", debugstr_w(container_name), debugstr_w(display_name), + debugstr_w(description), capabilities, capability_count, container_sid); + + return E_NOTIMPL; +} + +HRESULT WINAPI DeriveAppContainerSidFromAppContainerName(PCWSTR container_name, PSID sid) +{ + FIXME("(%s, %p): stub\n", debugstr_w(container_name), sid); + + return E_NOTIMPL; +} \ No newline at end of file diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 212c4caf20dc..8189b9b5db8a 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -1929,7 +1929,7 @@ NTSTATUS WINAPI ZwSetEvent(HANDLE,PULONG); NTSTATUS WINAPI ZwSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FILE_INFORMATION_CLASS); NTSTATUS WINAPI ZwSetInformationKey(HANDLE,const int,PVOID,ULONG); NTSTATUS WINAPI ZwSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG); -NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG); +NTSTATUS WINAPI ZwSetInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG); NTSTATUS WINAPI ZwSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSTATUS WINAPI ZwSetIoCompletion(HANDLE,ULONG,ULONG,NTSTATUS,ULONG); NTSTATUS WINAPI ZwSetLdtEntries(ULONG,ULONG,ULONG,ULONG,ULONG,ULONG); diff --git a/include/winbase.h b/include/winbase.h index 55a5c59c3642..29475aa4f6c9 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1763,6 +1763,21 @@ typedef struct _WIN32_FIND_STREAM_DATA { WCHAR cStreamName[MAX_PATH + 36]; } WIN32_FIND_STREAM_DATA,*PWIN32_FIND_STREAM_DATA; +typedef enum _PROCESS_INFORMATION_CLASS +{ + ProcessMemoryPriority, + ProcessMemoryExhaustionInfo, + ProcessAppMemoryInfo, + ProcessInPrivateInfo, + ProcessPowerThrottling, + ProcessReservedValue1, + ProcessTelemetryCoverageInfo, + ProcessProtectionLevelInfo, + ProcessLeapSecondInfo, + ProcessMachineTypeInfo, + ProcessInformationClassMax +} PROCESS_INFORMATION_CLASS; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); @@ -2675,6 +2690,7 @@ WINBASEAPI BOOL WINAPI SetPriorityClass(HANDLE,DWORD); WINADVAPI BOOL WINAPI SetPrivateObjectSecurity(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,PGENERIC_MAPPING,HANDLE); WINADVAPI BOOL WINAPI SetPrivateObjectSecurityEx(SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,ULONG,PGENERIC_MAPPING,HANDLE); WINBASEAPI BOOL WINAPI SetProcessAffinityMask(HANDLE,DWORD_PTR); +WINBASEAPI BOOL WINAPI SetProcessInformation(HANDLE,PROCESS_INFORMATION_CLASS,LPVOID,DWORD); WINBASEAPI BOOL WINAPI SetProcessPriorityBoost(HANDLE,BOOL); WINBASEAPI BOOL WINAPI SetProcessShutdownParameters(DWORD,DWORD); WINBASEAPI BOOL WINAPI SetProcessWorkingSetSize(HANDLE,SIZE_T,SIZE_T); diff --git a/include/winnt.h b/include/winnt.h index 781f430d91ac..a0b5aceee6a1 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6265,6 +6265,13 @@ typedef enum _PROCESS_MITIGATION_POLICY MaxProcessMitigationPolicy } PROCESS_MITIGATION_POLICY, *PPROCESS_MITIGATION_POLICY; +typedef enum _FIRMWARE_TYPE +{ + FirmwareTypeUnknown, + FirmwareTypeBios, + FirmwareTypeUefi, + FirmwareTypeMax +} FIRMWARE_TYPE, *PFIRMWARE_TYPE; /* Intrinsic functions */ diff --git a/include/winternl.h b/include/winternl.h index 8b0a4839b818..a2d50cc722fe 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -1568,11 +1568,80 @@ typedef enum _PROCESSINFOCLASS { ProcessThreadStackAllocation = 41, ProcessWorkingSetWatchEx = 42, ProcessImageFileNameWin32 = 43, + ProcessImageFileMapping = 44, + ProcessAffinityUpdateMode = 45, + ProcessMemoryAllocationMode = 46, + ProcessGroupInformation = 47, + ProcessTokenVirtualizationEnabled = 48, + ProcessConsoleHostProcess = 49, + ProcessWindowInformation = 50, + ProcessHandleInformation = 51, + ProcessMitigationPolicy = 52, + ProcessDynamicFunctionTableInformation = 53, + ProcessHandleCheckingMode = 54, + ProcessKeepAliveCount = 55, + ProcessRevokeFileHandles = 56, + ProcessWorkingSetControl = 57, + ProcessHandleTable = 58, + ProcessCheckStackExtentsMode = 59, + ProcessCommandLineInformation = 60, + ProcessProtectionInformation = 61, + ProcessMemoryExhaustion = 62, + ProcessFaultInformation = 63, + ProcessTelemetryIdInformation = 64, + ProcessCommitReleaseInformation = 65, + ProcessDefaultCpuSetsInformation = 66, + ProcessAllowedCpuSetsInformation = 67, + ProcessSubsystemProcess = 68, + ProcessJobMemoryInformation = 69, + ProcessInPrivate = 70, + ProcessRaiseUMExceptionOnInvalidHandleClose = 71, + ProcessIumChallengeResponse = 72, + ProcessChildProcessInformation = 73, + ProcessHighGraphicsPriorityInformation = 74, + ProcessSubsystemInformation = 75, + ProcessEnergyValues = 76, + ProcessPowerThrottlingState = 77, + ProcessReserved3Information = 78, + ProcessWin32kSyscallFilterInformation = 79, + ProcessDisableSystemAllowedCpuSets = 80, + ProcessWakeInformation = 81, + ProcessEnergyTrackingState = 82, + ProcessManageWritesToExecutableMemory = 83, + ProcessCaptureTrustletLiveDump = 84, + ProcessTelemetryCoverage = 85, + ProcessEnclaveInformation = 86, + ProcessEnableReadWriteVmLogging = 87, + ProcessUptimeInformation = 88, + ProcessImageSection = 89, + ProcessDebugAuthInformation = 90, + ProcessSystemResourceManagement = 91, + ProcessSequenceNumber = 92, + ProcessLoaderDetour = 93, + ProcessSecurityDomainInformation = 94, + ProcessCombineSecurityDomainsInformation = 95, + ProcessEnableLogging = 96, + ProcessLeapSecondInformation = 97, + ProcessFiberShadowStackAllocation = 98, + ProcessFreeFiberShadowStackAllocation = 99, + ProcessAltSystemCallInformation = 100, + ProcessDynamicEHContinuationTargets = 101, + ProcessDynamicEnforcedCetCompatibleRanges = 102, + ProcessCreateStateChange = 103, + ProcessApplyStateChange = 104, + ProcessEnableOptionalXStateFeatures = 105, + ProcessAltPrefetchParam = 106, + ProcessAssignCpuPartitions = 107, + ProcessPriorityClassEx = 108, + ProcessMembershipInformation = 109, + ProcessEffectiveIoPriority = 110, + ProcessEffectivePagePriority = 111, MaxProcessInfoClass, #ifdef __WINESRC__ ProcessWineMakeProcessSystem = 1000, + ProcessWineLdtCopy, #endif -} PROCESSINFOCLASS, PROCESS_INFORMATION_CLASS; +} PROCESSINFOCLASS; #define MEM_EXECUTE_OPTION_DISABLE 0x01 #define MEM_EXECUTE_OPTION_ENABLE 0x02 @@ -4124,7 +4193,7 @@ NTSYSAPI NTSTATUS WINAPI NtSetInformationFile(HANDLE,PIO_STATUS_BLOCK,PVOID,ULO NTSYSAPI NTSTATUS WINAPI NtSetInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationKey(HANDLE,const int,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG); -NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESS_INFORMATION_CLASS,PVOID,ULONG); +NTSYSAPI NTSTATUS WINAPI NtSetInformationProcess(HANDLE,PROCESSINFOCLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationThread(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetInformationToken(HANDLE,TOKEN_INFORMATION_CLASS,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtSetIntervalProfile(ULONG,KPROFILE_SOURCE);