Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add stubs to fix steam. #20

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ enable_avicap32
enable_avifil32
enable_avrt
enable_bcrypt
enable_bcryptprimitives
enable_bluetoothapis
enable_browseui
enable_bthprops_cpl
Expand Down Expand Up @@ -1218,6 +1219,7 @@ enable_msimtf
enable_msisip
enable_msisys_ocx
enable_msls31
enable_msmpeg2vdec
enable_msnet32
enable_mspatcha
enable_msports
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions dlls/bcryptprimitives/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MODULE = bcryptprimitives.dll
IMPORTS = advapi32

SOURCES = \
main.c
1 change: 1 addition & 0 deletions dlls/bcryptprimitives/bcryptprimitives.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ stdcall ProcessPrng(ptr long)
27 changes: 27 additions & 0 deletions dlls/bcryptprimitives/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2023 Christopher S. Denton
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ntsecapi.h"

BOOL WINAPI ProcessPrng(BYTE *data, SIZE_T size)
{
return RtlGenRandom(data, size);
}
1 change: 1 addition & 0 deletions dlls/dwmapi/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MODULE = dwmapi.dll
IMPORTS = user32
IMPORTLIB = dwmapi

EXTRADLLFLAGS = -Wb,--prefer-native
Expand Down
42 changes: 39 additions & 3 deletions dlls/dwmapi/dwmapi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,45 @@ BOOL WINAPI DwmDefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam,
*/
HRESULT WINAPI DwmGetWindowAttribute(HWND hwnd, DWORD attribute, PVOID pv_attribute, DWORD size)
{
FIXME("(%p %ld %p %ld) stub\n", hwnd, attribute, pv_attribute, size);

return E_NOTIMPL;
BOOL enabled = FALSE;
HRESULT hr;

TRACE("(%p, %d, %p, %d)\n", hwnd, attribute, pv_attribute, size);

if (DwmIsCompositionEnabled(&enabled) == S_OK && !enabled)
return E_HANDLE;
if (!IsWindow(hwnd))
return E_HANDLE;

switch (attribute) {
case DWMWA_EXTENDED_FRAME_BOUNDS:
{
RECT *rect = (RECT *)pv_attribute;
DPI_AWARENESS_CONTEXT context;

if (!rect)
return E_INVALIDARG;
if (size < sizeof(*rect))
return E_NOT_SUFFICIENT_BUFFER;
if (GetWindowLongW(hwnd, GWL_STYLE) & WS_CHILD)
return E_HANDLE;

context = SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
if (GetWindowRect(hwnd, rect))
hr = S_OK;
else
hr = E_FAIL;

SetThreadDpiAwarenessContext(context);
break;
}
default:
FIXME("attribute %ld not implemented\n", attribute);
hr = E_NOTIMPL;
break;
}

return hr;
}

/**********************************************************************
Expand Down
2 changes: 2 additions & 0 deletions dlls/kernel32/kernel32.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 12 additions & 0 deletions dlls/kernel32/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.@)
*/
Expand Down
1 change: 1 addition & 0 deletions dlls/kernelbase/kernelbase.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
51 changes: 43 additions & 8 deletions dlls/kernelbase/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ struct _PROC_THREAD_ATTRIBUTE_LIST
static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUTES *psa,
SECURITY_ATTRIBUTES *tsa, DWORD process_flags,
RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info, HANDLE parent,
RTL_USER_PROCESS_INFORMATION *info,
HANDLE parent, USHORT machine,
const struct proc_thread_attr *handle_list,
const struct proc_thread_attr *job_list)
{
Expand Down Expand Up @@ -331,6 +332,14 @@ static NTSTATUS create_nt_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBUT
attr->Attributes[pos].ReturnLength = NULL;
pos++;
}
if (machine)
{
attr->Attributes[pos].Attribute = PS_ATTRIBUTE_MACHINE_TYPE;
attr->Attributes[pos].Size = sizeof(machine);
attr->Attributes[pos].ValuePtr = ULongToPtr(machine);
attr->Attributes[pos].ReturnLength = NULL;
pos++;
}
attr->TotalLength = offsetof( PS_ATTRIBUTE_LIST, Attributes[pos] );

InitializeObjectAttributes( &process_attr, NULL, 0, NULL, psa ? psa->lpSecurityDescriptor : NULL );
Expand Down Expand Up @@ -372,7 +381,7 @@ static NTSTATUS create_vdm_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, winevdm );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, 0, NULL, NULL );
HeapFree( GetProcessHeap(), 0, newcmdline );
return status;
}
Expand Down Expand Up @@ -401,7 +410,7 @@ static NTSTATUS create_cmd_process( HANDLE token, HANDLE debug, SECURITY_ATTRIBU
swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, comspec );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, NULL, NULL );
status = create_nt_process( token, debug, psa, tsa, flags, params, info, NULL, 0, NULL, NULL );
RtlFreeHeap( GetProcessHeap(), 0, newcmdline );
return status;
}
Expand Down Expand Up @@ -563,6 +572,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
RTL_USER_PROCESS_INFORMATION rtl_info;
HANDLE parent = 0, debug = 0;
ULONG nt_flags = 0;
USHORT machine = 0;
NTSTATUS status;

/* Process the AppName and/or CmdLine to get module name and path */
Expand Down Expand Up @@ -772,6 +782,10 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
TRACE( "PROC_THREAD_ATTRIBUTE_JOB_LIST handle count %Iu.\n",
attrs->attrs[i].size / sizeof(HANDLE) );
break;
case PROC_THREAD_ATTRIBUTE_MACHINE_TYPE:
machine = *(USHORT *)attrs->attrs[i].value;
TRACE( "PROC_THREAD_ATTRIBUTE_MACHINE %x.\n", machine );
break;
default:
FIXME("Unsupported attribute %#Ix.\n", attrs->attrs[i].attr);
break;
Expand All @@ -786,7 +800,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if (flags & CREATE_SUSPENDED) nt_flags |= PROCESS_CREATE_FLAGS_SUSPENDED;

status = create_nt_process( token, debug, process_attr, thread_attr,
nt_flags, params, &rtl_info, parent, handle_list, job_list );
nt_flags, params, &rtl_info, parent, machine, handle_list, job_list );
switch (status)
{
case STATUS_SUCCESS:
Expand Down Expand Up @@ -860,6 +874,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.@)
Expand Down Expand Up @@ -1248,10 +1280,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH ProcessIdToSessionId( DWORD pid, DWORD *id )
*/
BOOL WINAPI DECLSPEC_HOTPATCH QueryProcessCycleTime( HANDLE process, ULONG64 *cycle )
{
static int once;
if (!once++) FIXME( "(%p,%p): stub!\n", process, cycle );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
PROCESS_CYCLE_TIME_INFORMATION time;

if (!set_ntstatus( NtQueryInformationProcess( process, ProcessCycleTime, &time, sizeof(time), NULL )))
return FALSE;

*cycle = time.AccumulatedCycles;
return TRUE;
}


Expand Down
4 changes: 4 additions & 0 deletions dlls/msmpeg2vdec/Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MODULE = msmpeg2vdec.dll

SOURCES = \
main.c
27 changes: 27 additions & 0 deletions dlls/msmpeg2vdec/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2023 Mohamad Al-Jaf
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(msmpeg2vdec);

HRESULT WINAPI DllGetClassObject( REFCLSID clsid, REFIID riid, void **out )
{
FIXME( "clsid %s, riid %s, out %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), out );
return CLASS_E_CLASSNOTAVAILABLE;
}
8 changes: 8 additions & 0 deletions dlls/msmpeg2vdec/msmpeg2vdec.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@ stub GetH264DecoderFunctionTable
@ stub ?GetSurface@CVIDEOfilter@@QEAAJHPEAEJ@Z
@ stub ?GetSurfaceSize@CVIDEOfilter@@QEAAJHPEAJ@Z
@ stub ?LoadSurface@CVIDEOfilter@@QEAAJHPEAEK@Z
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()
Loading