-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
calling convention fixes for better consistency #2050
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,7 +229,7 @@ typedef VOID (WINAPI* _UnsubscribeServiceChangeNotifications)( | |
_In_ PSC_NOTIFICATION_REGISTRATION pSubscription | ||
); | ||
|
||
#define PH_DECLARE_IMPORT(Name) _##Name Name##_Import(VOID) | ||
#define PH_DECLARE_IMPORT(Name) _##Name NTAPI Name##_Import(VOID) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These types don't have calling conventions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well my VS2022 begs to differ without that fix i can not build a x86 version of Task Explorer |
||
|
||
PH_DECLARE_IMPORT(NtQueryInformationEnlistment); | ||
PH_DECLARE_IMPORT(NtQueryInformationResourceManager); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,23 +14,23 @@ | |
|
||
EXTERN_C_START | ||
|
||
HRESULT PhAppResolverGetAppIdForProcess( | ||
HRESULT NTAPI PhAppResolverGetAppIdForProcess( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The AppResolver functions are not external or exported. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3rd party projects which use the kphlib may link against un exported functions, and if they by default use a different calling convention then __stdcall a fix like this is required. |
||
_In_ HANDLE ProcessId, | ||
_Out_ PPH_STRING *ApplicationUserModelId | ||
); | ||
|
||
HRESULT PhAppResolverGetAppIdForWindow( | ||
HRESULT NTAPI PhAppResolverGetAppIdForWindow( | ||
_In_ HWND WindowHandle, | ||
_Out_ PPH_STRING *ApplicationUserModelId | ||
); | ||
|
||
HRESULT PhAppResolverActivateAppId( | ||
HRESULT NTAPI PhAppResolverActivateAppId( | ||
_In_ PPH_STRING ApplicationUserModelId, | ||
_In_opt_ PWSTR CommandLine, | ||
_Out_opt_ HANDLE *ProcessId | ||
); | ||
|
||
HRESULT PhAppResolverPackageTerminateProcess( | ||
HRESULT NTAPI PhAppResolverPackageTerminateProcess( | ||
_In_ PPH_STRING PackageFullName | ||
); | ||
|
||
|
@@ -40,36 +40,36 @@ typedef struct _PH_PACKAGE_TASK_ENTRY | |
GUID TaskGuid; | ||
} PH_PACKAGE_TASK_ENTRY, *PPH_PACKAGE_TASK_ENTRY; | ||
|
||
PPH_LIST PhAppResolverEnumeratePackageBackgroundTasks( | ||
PPH_LIST NTAPI PhAppResolverEnumeratePackageBackgroundTasks( | ||
_In_ PPH_STRING PackageFullName | ||
); | ||
|
||
HRESULT PhAppResolverPackageStopSessionRedirection( | ||
HRESULT NTAPI PhAppResolverPackageStopSessionRedirection( | ||
_In_ PPH_STRING PackageFullName | ||
); | ||
|
||
PPH_STRING PhGetAppContainerName( | ||
PPH_STRING NTAPI PhGetAppContainerName( | ||
_In_ PSID AppContainerSid | ||
); | ||
|
||
PPH_STRING PhGetAppContainerSidFromName( | ||
PPH_STRING NTAPI PhGetAppContainerSidFromName( | ||
_In_ PWSTR AppContainerName | ||
); | ||
|
||
PPH_STRING PhGetAppContainerPackageName( | ||
PPH_STRING NTAPI PhGetAppContainerPackageName( | ||
_In_ PSID Sid | ||
); | ||
|
||
BOOLEAN PhIsPackageCapabilitySid( | ||
BOOLEAN NTAPI PhIsPackageCapabilitySid( | ||
_In_ PSID AppContainerSid, | ||
_In_ PSID Sid | ||
); | ||
|
||
PPH_STRING PhGetPackagePath( | ||
PPH_STRING NTAPI PhGetPackagePath( | ||
_In_ PPH_STRING PackageFullName | ||
); | ||
|
||
PPH_LIST PhGetPackageAssetsFromResourceFile( | ||
PPH_LIST NTAPI PhGetPackageAssetsFromResourceFile( | ||
_In_ PWSTR FilePath | ||
); | ||
|
||
|
@@ -85,18 +85,18 @@ typedef struct _PH_APPUSERMODELID_ENUM_ENTRY | |
PPH_STRING SmallLogoPath; | ||
} PH_APPUSERMODELID_ENUM_ENTRY, *PPH_APPUSERMODELID_ENUM_ENTRY; | ||
|
||
PPH_LIST PhEnumApplicationUserModelIds( | ||
PPH_LIST NTAPI PhEnumApplicationUserModelIds( | ||
VOID | ||
); | ||
|
||
HRESULT PhAppResolverGetPackageResourceFilePath( | ||
HRESULT NTAPI PhAppResolverGetPackageResourceFilePath( | ||
_In_ PCWSTR PackageFullName, | ||
_In_ PCWSTR Key, | ||
_Out_ PWSTR* FilePath | ||
); | ||
|
||
_Success_(return) | ||
BOOLEAN PhAppResolverGetPackageIcon( | ||
BOOLEAN NTAPI PhAppResolverGetPackageIcon( | ||
_In_ HANDLE ProcessId, | ||
_In_ PPH_STRING PackageFullName, | ||
_Out_opt_ HICON* IconLarge, | ||
|
@@ -106,23 +106,23 @@ BOOLEAN PhAppResolverGetPackageIcon( | |
|
||
// Immersive PLM task support | ||
|
||
HRESULT PhAppResolverBeginCrashDumpTask( | ||
HRESULT NTAPI PhAppResolverBeginCrashDumpTask( | ||
_In_ HANDLE ProcessId, | ||
_Out_ HANDLE* TaskHandle | ||
); | ||
|
||
HRESULT PhAppResolverBeginCrashDumpTaskByHandle( | ||
HRESULT NTAPI PhAppResolverBeginCrashDumpTaskByHandle( | ||
_In_ HANDLE ProcessHandle, | ||
_Out_ HANDLE* TaskHandle | ||
); | ||
|
||
HRESULT PhAppResolverEndCrashDumpTask( | ||
HRESULT NTAPI PhAppResolverEndCrashDumpTask( | ||
_In_ HANDLE TaskHandle | ||
); | ||
|
||
// Desktop Bridge | ||
|
||
HRESULT PhCreateProcessDesktopPackage( | ||
HRESULT NTAPI PhCreateProcessDesktopPackage( | ||
_In_ PWSTR ApplicationUserModelId, | ||
_In_ PWSTR Executable, | ||
_In_ PWSTR Arguments, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
|
||
#include <kphmsg.h> | ||
|
||
NTSTATUS KphFilterLoadUnload( | ||
NTSTATUS NTAPI KphFilterLoadUnload( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These functions are not exported or external. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3rd party projects which use the kphlib may link against un exported functions, and if they by default use a different calling convention then __stdcall a fix like this is required. |
||
_In_ PPH_STRINGREF ServiceName, | ||
_In_ BOOLEAN LoadDriver | ||
); | ||
|
@@ -40,26 +40,26 @@ BOOLEAN (NTAPI *PKPH_COMMS_CALLBACK)( | |
); | ||
|
||
_Must_inspect_result_ | ||
NTSTATUS KphCommsStart( | ||
NTSTATUS NTAPI KphCommsStart( | ||
_In_ PPH_STRINGREF PortName, | ||
_In_opt_ PKPH_COMMS_CALLBACK Callback | ||
); | ||
|
||
VOID KphCommsStop( | ||
VOID NTAPI KphCommsStop( | ||
VOID | ||
); | ||
|
||
BOOLEAN KphCommsIsConnected( | ||
BOOLEAN NTAPI KphCommsIsConnected( | ||
VOID | ||
); | ||
|
||
NTSTATUS KphCommsReplyMessage( | ||
NTSTATUS NTAPI KphCommsReplyMessage( | ||
_In_ ULONG_PTR ReplyToken, | ||
_In_ PKPH_MESSAGE Message | ||
); | ||
|
||
_Must_inspect_result_ | ||
NTSTATUS KphCommsSendMessage( | ||
NTSTATUS NTAPI KphCommsSendMessage( | ||
_Inout_ PKPH_MESSAGE Message | ||
); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1853,6 +1853,7 @@ PhHungWindowFromGhostWindow( | |
|
||
PHLIBAPI | ||
NTSTATUS | ||
NTAPI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✔️ |
||
PhGetFileData( | ||
_In_ HANDLE FileHandle, | ||
_Out_ PVOID* Buffer, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ typedef struct _PH_SETTING | |
|
||
PHLIBAPI | ||
VOID | ||
NTAPI | ||
PhSettingsInitialization( | ||
VOID | ||
); | ||
|
@@ -376,7 +377,9 @@ VOID PhResetSettings( | |
// begin_phapppub | ||
// High-level settings creation | ||
|
||
VOID PhAddSetting( | ||
VOID | ||
NTAPI | ||
PhAddSetting( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✔️ |
||
_In_ PH_SETTING_TYPE Type, | ||
_In_ PPH_STRINGREF Name, | ||
_In_ PPH_STRINGREF DefaultValue | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the Kph functions are exported or external.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, should not be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3rd party projects which use the kphlib may link against un exported functions, and if they by default use a different calling convention then __stdcall a fix like this is required.