Needed for Minecraft Legends.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/Makefile.in | 1 + include/appnotify.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 include/appnotify.h
diff --git a/include/Makefile.in b/include/Makefile.in index 7a6e5d62763..c957fed884c 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -19,6 +19,7 @@ SOURCES = \ appcompatapi.h \ appmgmt.h \ appmodel.h \ + appnotify.h \ asferr.h \ asptlb.idl \ asyncinfo.idl \ diff --git a/include/appnotify.h b/include/appnotify.h new file mode 100644 index 00000000000..522cee429e5 --- /dev/null +++ b/include/appnotify.h @@ -0,0 +1,47 @@ +/* + * 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 + */ + +#ifndef _WINE_APISET_PSMAPPNOTIFY_H_ +#define _WINE_APISET_PSMAPPNOTIFY_H_ + +#include <windows.h> + +#define PSM_APP_API_HOST + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(PSM_APP_API_HOST) +#define APICONTRACT +#else +#define APICONTRACT DECLSPEC_IMPORT +#endif + +typedef void (*PAPPSTATE_CHANGE_ROUTINE)(BOOLEAN quiesced, void *context); + +typedef struct _APPSTATE_REGISTRATION *PAPPSTATE_REGISTRATION; + +APICONTRACT ULONG NTAPI RegisterAppStateChangeNotification(PAPPSTATE_CHANGE_ROUTINE,void *,PAPPSTATE_REGISTRATION *); +APICONTRACT void NTAPI UnregisterAppStateChangeNotification(PAPPSTATE_REGISTRATION); + +#ifdef __cplusplus +} +#endif + +#endif // _WINE_APISET_PSMAPPNOTIFY_H_
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for Minecraft Legends. --- configure.ac | 1 + dlls/twinapi.appcore/Makefile.in | 1 + dlls/twinapi.appcore/twinapi.appcore.spec | 127 ++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 dlls/twinapi.appcore/Makefile.in create mode 100644 dlls/twinapi.appcore/twinapi.appcore.spec
diff --git a/configure.ac b/configure.ac index fde3f29c770..479bf5d06af 100644 --- a/configure.ac +++ b/configure.ac @@ -3038,6 +3038,7 @@ WINE_CONFIG_MAKEFILE(dlls/traffic) WINE_CONFIG_MAKEFILE(dlls/twain.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/twain_32) WINE_CONFIG_MAKEFILE(dlls/twain_32/tests) +WINE_CONFIG_MAKEFILE(dlls/twinapi.appcore) WINE_CONFIG_MAKEFILE(dlls/typelib.dll16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/tzres) WINE_CONFIG_MAKEFILE(dlls/ucrtbase) diff --git a/dlls/twinapi.appcore/Makefile.in b/dlls/twinapi.appcore/Makefile.in new file mode 100644 index 00000000000..b6e31708d9d --- /dev/null +++ b/dlls/twinapi.appcore/Makefile.in @@ -0,0 +1 @@ +MODULE = twinapi.appcore.dll diff --git a/dlls/twinapi.appcore/twinapi.appcore.spec b/dlls/twinapi.appcore/twinapi.appcore.spec new file mode 100644 index 00000000000..cda1c38103f --- /dev/null +++ b/dlls/twinapi.appcore/twinapi.appcore.spec @@ -0,0 +1,127 @@ +@ stub ValidateSystemShutdown +@ stub BiActivateWorkItemForUser +@ stub BiChangeApplicationStateForPackageName +@ stub BiChangeApplicationStateForPackageNameForUser +@ stub BiChangeApplicationStateForPsmKey +@ stub BiChangeApplicationStateForPsmKeyForUser +@ stub BiChangeSessionState +@ stub BiChangeUserState +@ stub BiEnumerateWorkItemsForPackageNameAndUser +@ stub BiGetActiveBackgroundTasksEvent +@ stub BiGetActiveBackgroundTasksEventForUser +@ stub BiGetCancellationTimeoutInMs +@ stub BiIsApplicationTerminateSensitive +@ stub BiIsApplicationTerminateSensitiveForUser +@ stub BiNotifyNewSession +@ stub BiNotifyNewSessionComplete +@ stub BiNotifyNewUser +@ stub BiPlmFreeMemory +@ stub BiPtActivateDeferredWorkItem +@ stub BiPtActivateInBackground +@ stub BiPtActivateInBackgroundEx +@ stub BiPtActivateWorkItem +@ stub BiPtAssociateActivationProxy +@ stub BiPtAssociateApplicationEntryPoint +@ stub BiPtAssociateApplicationExtensionClass +@ stub BiPtCancelWorkItem +@ stub BiPtCancelWorkItemEx +@ stub BiPtCreateEvent +@ stub BiPtCreateEventForApp +@ stub BiPtCreateEventForPackageName +@ stub BiPtDeleteEvent +@ stub BiPtDisableWorkItem +@ stub BiPtDisassociateWorkItem +@ stub BiPtDisassociateWorkItemEx +@ stub BiPtEnableWorkItem +@ stub BiPtEnumerateBrokeredEvents +@ stub BiPtEnumerateBrokeredEventsEx +@ stub BiPtEnumerateWorkItemsForPackageName +@ stub BiPtEnumerateWorkItemsForPackageNameEx +@ stub BiPtFreeMemory +@ stub BiPtGetStatusStateNameFromBrokerEventId +@ stub BiPtQueryBrokerEventId +@ stub BiPtQueryBrokeredEvent +@ stub BiPtQuerySystemStateBroadcastChannels +@ stub BiPtQueryWorkItem +@ stub BiPtQueryWorkItemEx +@ stub BiPtQueryWorkItemStatusStateName +@ stub BiPtSignalEvent +@ stub BiPtSignalEventEx +@ stub BiPtSignalMultipleEvents +@ stub BiPtSignalTriggerEvent +@ stub BiPtSignalTriggerEventEx +@ stub BiQueryWorkItemForUser +@ stub BiResetActiveSessionForPackage +@ stub BiResetActiveUserForPackage +@ stub BiSetActiveSessionForPackage +@ stub BiSetActiveUserForPackage +@ stub BiTerminateApplicationHost +@ stub BiTerminateApplicationHost2 +@ stub BiTerminateApplicationHostForUser +@ stub BiUpdateBackgroundAccessApplicationsForUser +@ stub BiUpdateLockScreenApplications +@ stdcall -private DllCanUnloadNow() +@ stub DllGetActivationFactory +@ stub DllGetClassObject +@ stub PsmApplyTaskCompletion +@ stub PsmBlockAppStateChangeCompletion +@ stub PsmDisconnect +@ stub PsmGetSessionInfo +@ stub PsmInitializeExtension +@ stub PsmIsProcessInApplication +@ stub PsmIsProcessInApplication2 +@ stub PsmQueryApplicationInformation +@ stub PsmQueryApplicationInformation2 +@ stub PsmQueryApplicationInterferenceCount +@ stub PsmQueryApplicationInterferenceCount2 +@ stub PsmQueryApplicationList +@ stub PsmQueryApplicationList2 +@ stub PsmQueryApplicationProperties +@ stub PsmQueryApplicationProperties2 +@ stub PsmQueryApplicationProperties3 +@ stub PsmQueryApplicationPropertiesByUser +@ stub PsmQueryApplicationResourceUsage +@ stub PsmQueryApplicationResourceUsage2 +@ stub PsmQueryApplicationResourceUsageForTimer +@ stub PsmQueryCurrentAppState +@ stub PsmQueryMaxMemoryUsage +@ stub PsmQueryMaxMemoryUsage2 +@ stub PsmQueryMemoryUsage +@ stub PsmQueryMemoryUsage2 +@ stub PsmQueryMemoryUsageByUser +@ stub PsmQueryProcessList +@ stub PsmQueryProcessList2 +@ stub PsmQuerySharedCommitByUser +@ stub PsmQueryTaskCompletionInformation +@ stub PsmQueryTaskCompletionInformation2 +@ stub PsmRegisterAppPriorityNotification +@ stub PsmRegisterAppStateChangeNotification +@ stub PsmRegisterApplicationNotification +@ stub PsmRegisterApplicationNotification2 +@ stub PsmRegisterDynamicProcess +@ stub PsmRegisterKeyNotification +@ stub PsmRegisterManagerType +@ stub PsmResetMaxMemoryUsage +@ stub PsmResetMaxMemoryUsage2 +@ stub PsmResetMaxMemoryUsageByUser +@ stub PsmSetApplicationPriority +@ stub PsmSetApplicationPriority2 +@ stub PsmSetApplicationProperties +@ stub PsmSetApplicationProperties2 +@ stub PsmSetApplicationProperties3 +@ stub PsmSetApplicationPropertiesByUser +@ stub PsmSetApplicationState +@ stub PsmSetApplicationState2 +@ stub PsmShutdownApplication +@ stub PsmTimerCleanup +@ stub PsmTimerElapsedResourceTimeGet +@ stub PsmTimerInitialize +@ stub PsmTimerRemainingResourceTimeGet +@ stub PsmTimerStart +@ stub PsmUnblockAppStateChangeCompletion +@ stub PsmUnregisterAppStateChangeNotification +@ stub PsmWaitForAppResume +@ stub RegisterAppConstrainedChangeNotification +@ stub RegisterAppStateChangeNotification +@ stub UnregisterAppConstrainedChangeNotification +@ stub UnregisterAppStateChangeNotification
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for Minecraft Legends. --- dlls/twinapi.appcore/Makefile.in | 3 +++ dlls/twinapi.appcore/main.c | 31 +++++++++++++++++++++++ dlls/twinapi.appcore/twinapi.appcore.spec | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 dlls/twinapi.appcore/main.c
diff --git a/dlls/twinapi.appcore/Makefile.in b/dlls/twinapi.appcore/Makefile.in index b6e31708d9d..12c1f38f053 100644 --- a/dlls/twinapi.appcore/Makefile.in +++ b/dlls/twinapi.appcore/Makefile.in @@ -1 +1,4 @@ MODULE = twinapi.appcore.dll + +C_SRCS = \ + main.c diff --git a/dlls/twinapi.appcore/main.c b/dlls/twinapi.appcore/main.c new file mode 100644 index 00000000000..05717f0f03c --- /dev/null +++ b/dlls/twinapi.appcore/main.c @@ -0,0 +1,31 @@ +/* + * 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 "appnotify.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(twinapi); + +/*********************************************************************** + * RegisterAppStateChangeNotification (twinapi.appcore.@) + */ +ULONG WINAPI RegisterAppStateChangeNotification( PAPPSTATE_CHANGE_ROUTINE routine, void *context, PAPPSTATE_REGISTRATION *reg ) +{ + FIXME( "(%p, %p, %p) - stub.\n", routine, context, reg ); + return ERROR_CALL_NOT_IMPLEMENTED; +} diff --git a/dlls/twinapi.appcore/twinapi.appcore.spec b/dlls/twinapi.appcore/twinapi.appcore.spec index cda1c38103f..9052c4e7cf5 100644 --- a/dlls/twinapi.appcore/twinapi.appcore.spec +++ b/dlls/twinapi.appcore/twinapi.appcore.spec @@ -122,6 +122,6 @@ @ stub PsmUnregisterAppStateChangeNotification @ stub PsmWaitForAppResume @ stub RegisterAppConstrainedChangeNotification -@ stub RegisterAppStateChangeNotification +@ stdcall RegisterAppStateChangeNotification(ptr ptr ptr) @ stub UnregisterAppConstrainedChangeNotification @ stub UnregisterAppStateChangeNotification
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/twinapi.appcore/main.c | 8 ++++++++ dlls/twinapi.appcore/twinapi.appcore.spec | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/twinapi.appcore/main.c b/dlls/twinapi.appcore/main.c index 05717f0f03c..4a94c56bee9 100644 --- a/dlls/twinapi.appcore/main.c +++ b/dlls/twinapi.appcore/main.c @@ -29,3 +29,11 @@ ULONG WINAPI RegisterAppStateChangeNotification( PAPPSTATE_CHANGE_ROUTINE routin FIXME( "(%p, %p, %p) - stub.\n", routine, context, reg ); return ERROR_CALL_NOT_IMPLEMENTED; } + +/*********************************************************************** + * UnregisterAppStateChangeNotification (twinapi.appcore.@) + */ +void WINAPI UnregisterAppStateChangeNotification( PAPPSTATE_REGISTRATION reg ) +{ + FIXME( "(%p) - stub.\n", reg ); +} diff --git a/dlls/twinapi.appcore/twinapi.appcore.spec b/dlls/twinapi.appcore/twinapi.appcore.spec index 9052c4e7cf5..0b2d8d2055e 100644 --- a/dlls/twinapi.appcore/twinapi.appcore.spec +++ b/dlls/twinapi.appcore/twinapi.appcore.spec @@ -124,4 +124,4 @@ @ stub RegisterAppConstrainedChangeNotification @ stdcall RegisterAppStateChangeNotification(ptr ptr ptr) @ stub UnregisterAppConstrainedChangeNotification -@ stub UnregisterAppStateChangeNotification +@ stdcall UnregisterAppStateChangeNotification(ptr)
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for Minecraft Legends. --- dlls/apisetschema/apisetschema.spec | 1 + dlls/twinapi.appcore/Makefile.in | 1 + 2 files changed, 2 insertions(+)
diff --git a/dlls/apisetschema/apisetschema.spec b/dlls/apisetschema/apisetschema.spec index 981b80c6976..122cd1209ba 100644 --- a/dlls/apisetschema/apisetschema.spec +++ b/dlls/apisetschema/apisetschema.spec @@ -99,6 +99,7 @@ apiset api-ms-win-core-psapi-ansi-l1-1-0 = kernelbase.dll apiset api-ms-win-core-psapi-l1-1-0 = kernelbase.dll apiset api-ms-win-core-psapi-obsolete-l1-1-0 = kernelbase.dll apiset api-ms-win-core-psapiansi-l1-1-0 = kernelbase.dll +apiset api-ms-win-core-psm-appnotify-l1-1-0 = twinapi.appcore.dll apiset api-ms-win-core-psm-key-l1-1-1 = kernelbase.dll apiset api-ms-win-core-quirks-l1-1-0 = kernelbase.dll apiset api-ms-win-core-realtime-l1-1-0 = kernelbase.dll diff --git a/dlls/twinapi.appcore/Makefile.in b/dlls/twinapi.appcore/Makefile.in index 12c1f38f053..fda9e359783 100644 --- a/dlls/twinapi.appcore/Makefile.in +++ b/dlls/twinapi.appcore/Makefile.in @@ -1,4 +1,5 @@ MODULE = twinapi.appcore.dll +IMPORTLIB = twinapi
C_SRCS = \ main.c
Rémi Bernon (@rbernon) commented about include/appnotify.h:
+#else +#define APICONTRACT DECLSPEC_IMPORT +#endif
+typedef void (*PAPPSTATE_CHANGE_ROUTINE)(BOOLEAN quiesced, void *context);
+typedef struct _APPSTATE_REGISTRATION *PAPPSTATE_REGISTRATION;
+APICONTRACT ULONG NTAPI RegisterAppStateChangeNotification(PAPPSTATE_CHANGE_ROUTINE,void *,PAPPSTATE_REGISTRATION *); +APICONTRACT void NTAPI UnregisterAppStateChangeNotification(PAPPSTATE_REGISTRATION);
+#ifdef __cplusplus +} +#endif
+#endif // _WINE_APISET_PSMAPPNOTIFY_H_
```suggestion:-0+0 #endif /* _WINE_APISET_PSMAPPNOTIFY_H_ */ ```
PAPPSTATE_CHANGE_ROUTINE needs a calling convention.
We also probably want to guard out PSM_APP_API_HOST as it's done in the Microsoft headers, so that the DECLSPEC_IMPORT logic actually works.
Patch 5/5 adds an import library which isn't used.