Skip to content

Commit 3368adc

Browse files
authored
[POWRPROF] Sync Powrprof to WINE-10.0 - Add some functions too (reactos#7681)
Co-authored-by: Hermès BÉLUSCA - MAÏTO <[email protected]> "Sync" to WINE-10.0, plus add some functions we need. Required for various apps going forward.
1 parent 28b802b commit 3368adc

File tree

4 files changed

+277
-80
lines changed

4 files changed

+277
-80
lines changed

dll/win32/powrprof/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ add_library(powrprof MODULE
66
powrprof.rc
77
${CMAKE_CURRENT_BINARY_DIR}/powrprof.def)
88

9+
if(MSVC)
10+
# Disable warning C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size
11+
target_compile_options(powrprof PRIVATE /wd4312)
12+
endif()
13+
914
set_module_type(powrprof win32dll UNICODE)
1015
target_link_libraries(powrprof wine)
1116
add_importlibs(powrprof advapi32 user32 comctl32 msvcrt kernel32 ntdll)

dll/win32/powrprof/powrprof.c

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,13 +510,124 @@ PowerGetActiveScheme(HKEY UserRootPowerKey, GUID **polguid)
510510
return ERROR_CALL_NOT_IMPLEMENTED;
511511
}
512512

513+
DWORD WINAPI PowerSetActiveScheme(HKEY UserRootPowerKey, GUID *polguid)
514+
{
515+
FIXME("(%p,%s) stub!\n", UserRootPowerKey, wine_dbgstr_guid(polguid));
516+
return ERROR_SUCCESS;
517+
}
518+
513519
DWORD WINAPI
514520
PowerReadDCValue(HKEY RootPowerKey, const GUID *Scheme, const GUID *SubGroup, const GUID *PowerSettings, PULONG Type, PUCHAR Buffer, DWORD *BufferSize)
515521
{
516522
FIXME("(%p,%s,%s,%s,%p,%p,%p) stub!\n", RootPowerKey, debugstr_guid(Scheme), debugstr_guid(SubGroup), debugstr_guid(PowerSettings), Type, Buffer, BufferSize);
517523
return ERROR_CALL_NOT_IMPLEMENTED;
518524
}
519525

526+
DWORD WINAPI PowerReadFriendlyName(HKEY RootPowerKey, const GUID *Scheme,
527+
const GUID *SubGroup, const GUID *PowerSettings, UCHAR *Buffer,
528+
DWORD *BufferSize)
529+
{
530+
FIXME("(%p,%s,%s,%s,%p,%p) stub!\n", RootPowerKey, debugstr_guid(Scheme), debugstr_guid(SubGroup), debugstr_guid(PowerSettings), Buffer, BufferSize);
531+
return ERROR_CALL_NOT_IMPLEMENTED;
532+
}
533+
534+
POWER_PLATFORM_ROLE WINAPI PowerDeterminePlatformRole(void)
535+
{
536+
FIXME("stub\n");
537+
return PlatformRoleDesktop;
538+
}
539+
540+
POWER_PLATFORM_ROLE WINAPI PowerDeterminePlatformRoleEx(ULONG version)
541+
{
542+
FIXME("%lu stub.\n", version);
543+
return PlatformRoleDesktop;
544+
}
545+
546+
DWORD WINAPI PowerEnumerate(HKEY key, const GUID *scheme, const GUID *subgroup, POWER_DATA_ACCESSOR flags,
547+
ULONG index, UCHAR *buffer, DWORD *buffer_size)
548+
{
549+
FIXME("(%p,%s,%s,%d,%ld,%p,%p) stub!\n", key, debugstr_guid(scheme), debugstr_guid(subgroup),
550+
flags, index, buffer, buffer_size);
551+
return ERROR_CALL_NOT_IMPLEMENTED;
552+
}
553+
554+
DWORD WINAPI PowerRegisterSuspendResumeNotification(DWORD flags, HANDLE recipient, PHPOWERNOTIFY handle)
555+
{
556+
FIXME("(0x%08lx,%p,%p) stub!\n", flags, recipient, handle);
557+
*handle = (HPOWERNOTIFY)0xdeadbeef;
558+
return ERROR_SUCCESS;
559+
}
560+
561+
DWORD WINAPI PowerUnregisterSuspendResumeNotification(HPOWERNOTIFY handle)
562+
{
563+
FIXME("(%p) stub!\n", handle);
564+
return ERROR_SUCCESS;
565+
}
566+
567+
DWORD WINAPI PowerSettingRegisterNotification(const GUID *setting, DWORD flags, HANDLE recipient, PHPOWERNOTIFY handle)
568+
{
569+
FIXME("(%s,0x%08lx,%p,%p) stub!\n", debugstr_guid(setting), flags, recipient, handle);
570+
*handle = (PHPOWERNOTIFY)0xdeadbeef;
571+
return ERROR_SUCCESS;
572+
}
573+
574+
DWORD WINAPI PowerSettingUnregisterNotification(HPOWERNOTIFY handle)
575+
{
576+
FIXME("(%p) stub!\n", handle);
577+
return ERROR_SUCCESS;
578+
}
579+
580+
DWORD WINAPI PowerWriteACValueIndex(HKEY key, const GUID *scheme, const GUID *subgroup, const GUID *setting, DWORD index)
581+
{
582+
FIXME("(%p,%s,%s,%s,0x%08lx) stub!\n", key, debugstr_guid(scheme), debugstr_guid(subgroup), debugstr_guid(setting), index);
583+
return ERROR_SUCCESS;
584+
}
585+
586+
#ifdef __REACTOS__
587+
DWORD WINAPI PowerWriteDCValueIndex(
588+
HKEY key,
589+
const GUID *scheme,
590+
const GUID *subgroup,
591+
const GUID *setting,
592+
DWORD index
593+
)
594+
{
595+
FIXME("(%p,%s,%s,%s,0x%08lx) stub!\n", key, debugstr_guid(scheme), debugstr_guid(subgroup), debugstr_guid(setting), index);
596+
return ERROR_SUCCESS;
597+
}
598+
599+
DWORD WINAPI PowerReadACValueIndex(
600+
HKEY key,
601+
const GUID *scheme,
602+
const GUID *subgroup,
603+
const GUID *setting,
604+
LPDWORD AcValueIndex
605+
)
606+
{
607+
FIXME("(%p,%s,%s,%s,0x%08lx) stub!\n", key, debugstr_guid(scheme), debugstr_guid(subgroup), debugstr_guid(setting));
608+
return ERROR_SUCCESS;
609+
}
610+
611+
DWORD WINAPI PowerReadDCValueIndex(
612+
HKEY key,
613+
const GUID *scheme,
614+
const GUID *subgroup,
615+
const GUID *setting,
616+
LPDWORD DcValuetIndex
617+
)
618+
{
619+
FIXME("(%p,%s,%s,%s,0x%08lx) stub!\n", key, debugstr_guid(scheme), debugstr_guid(subgroup), debugstr_guid(setting));
620+
return ERROR_SUCCESS;
621+
}
622+
623+
DWORD WINAPI
624+
PowerReadACValue(HKEY RootPowerKey, const GUID *Scheme, const GUID *SubGroup, const GUID *PowerSettings, PULONG Type, PUCHAR Buffer, DWORD *BufferSize)
625+
{
626+
FIXME("(%p,%s,%s,%s,%p,%p,%p) stub!\n", RootPowerKey, debugstr_guid(Scheme), debugstr_guid(SubGroup), debugstr_guid(PowerSettings), Type, Buffer, BufferSize);
627+
return ERROR_CALL_NOT_IMPLEMENTED;
628+
}
629+
#endif
630+
520631
BOOLEAN WINAPI
521632
ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY pGlobalPowerPolicy)
522633
{

dll/win32/powrprof/powrprof.spec

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,22 @@
1010
@ stdcall IsPwrHibernateAllowed ()
1111
@ stdcall IsPwrShutdownAllowed ()
1212
@ stdcall IsPwrSuspendAllowed ()
13+
@ stdcall PowerDeterminePlatformRole ()
14+
@ stdcall PowerDeterminePlatformRoleEx(long)
15+
@ stdcall PowerEnumerate(long ptr ptr long long ptr ptr)
1316
@ stdcall PowerGetActiveScheme (ptr ptr)
14-
@ stdcall PowerReadDCValue (ptr ptr ptr ptr ptr ptr ptr)
17+
@ stdcall PowerSetActiveScheme (ptr ptr)
18+
@ stdcall PowerReadACValue(ptr ptr ptr ptr ptr ptr ptr)
19+
@ stdcall PowerReadACValueIndex(ptr ptr ptr ptr ptr)
20+
@ stdcall PowerReadDCValue(ptr ptr ptr ptr ptr ptr ptr)
21+
@ stdcall PowerReadDCValueIndex(ptr ptr ptr ptr ptr)
22+
@ stdcall PowerReadFriendlyName (ptr ptr ptr ptr ptr ptr)
23+
@ stdcall PowerRegisterSuspendResumeNotification(long ptr ptr)
24+
@ stdcall PowerUnregisterSuspendResumeNotification(ptr)
25+
@ stdcall PowerSettingRegisterNotification(ptr long ptr ptr)
26+
@ stdcall PowerSettingUnregisterNotification(ptr)
27+
@ stdcall PowerWriteACValueIndex(ptr ptr ptr ptr long)
28+
@ stdcall PowerWriteDCValueIndex(ptr ptr ptr ptr long)
1529
@ stdcall ReadGlobalPwrPolicy (ptr)
1630
@ stdcall ReadProcessorPwrScheme (long ptr)
1731
@ stdcall ReadPwrScheme (long ptr)
@@ -20,4 +34,4 @@
2034
@ stdcall WriteGlobalPwrPolicy (ptr)
2135
@ stdcall WriteProcessorPwrScheme (long ptr)
2236
@ stdcall WritePwrScheme (ptr str str ptr)
23-
@ stdcall ValidatePowerPolicies (ptr ptr)
37+
@ stdcall ValidatePowerPolicies (ptr ptr)

0 commit comments

Comments
 (0)