Files
systeminformer/phlib/include/apiimport.h
dmex 66e276b763 Improve phlib API compatibility and utilities
This change updates phlib with broader native API compatibility shims, new CRC32/CRC32C tables, and safer utility helpers. It also fixes a number of synchronization, formatting, environment, and process-creation edge cases, adds correlation-vector support, hardens SID conversion and image-resource loading, and cleans up several Windows compatibility fixes across the library.
2026-09-30 00:45:00 +10:00

125 lines
3.4 KiB
C

/*
* Copyright (c) 2022 Winsider Seminars & Solutions, Inc. All rights reserved.
*
* This file is part of System Informer.
*
* Authors:
*
* wj32 2015-2016
* dmex 2017-2026
*
*/
#ifndef _PH_APIIMPORT_H
#define _PH_APIIMPORT_H
#include <devquery.h>
#include <sddl.h>
#include <shlwapi.h>
#include <userenv.h>
#include <ntuser.h>
#include <xmllite.h>
EXTERN_C_START
#ifdef __cplusplus
#define PH_DECLARE_IMPORT(Name) decltype(&(Name)) Name##_Import(VOID)
#else
#define PH_DECLARE_IMPORT(Name) typeof(&(Name)) Name##_Import(VOID)
#endif
// Ntdll
PH_DECLARE_IMPORT(NtQueryInformationEnlistment);
PH_DECLARE_IMPORT(NtQueryInformationResourceManager);
PH_DECLARE_IMPORT(NtQueryInformationTransaction);
PH_DECLARE_IMPORT(NtQueryInformationTransactionManager);
PH_DECLARE_IMPORT(NtAllocateVirtualMemoryEx);
PH_DECLARE_IMPORT(NtCreateProcessStateChange);
PH_DECLARE_IMPORT(NtChangeProcessState);
PH_DECLARE_IMPORT(NtCreateThreadStateChange);
PH_DECLARE_IMPORT(NtChangeThreadState);
PH_DECLARE_IMPORT(NtCreateSectionEx);
PH_DECLARE_IMPORT(NtCopyFileChunk);
PH_DECLARE_IMPORT(NtCompareObjects);
PH_DECLARE_IMPORT(NtCreateTimer2);
PH_DECLARE_IMPORT(NtMapViewOfSectionEx);
PH_DECLARE_IMPORT(NtSetTimer2);
PH_DECLARE_IMPORT(NtAlpcConnectPortEx);
PH_DECLARE_IMPORT(NtSetInformationVirtualMemory);
PH_DECLARE_IMPORT(LdrSystemDllInitBlock);
PH_DECLARE_IMPORT(LdrResFindResource);
PH_DECLARE_IMPORT(LdrResSearchResource);
PH_DECLARE_IMPORT(RtlDefaultNpAcl);
PH_DECLARE_IMPORT(RtlDelayExecution);
PH_DECLARE_IMPORT(RtlDeriveCapabilitySidsFromName);
PH_DECLARE_IMPORT(RtlDosLongPathNameToNtPathName_U_WithStatus);
PH_DECLARE_IMPORT(RtlGetTokenNamedObjectPath);
PH_DECLARE_IMPORT(RtlGetAppContainerNamedObjectPath);
PH_DECLARE_IMPORT(RtlGetAppContainerSidType);
PH_DECLARE_IMPORT(RtlGetAppContainerParent);
PH_DECLARE_IMPORT(RtlLoadString);
PH_DECLARE_IMPORT(RtlStringFromGUIDEx);
PH_DECLARE_IMPORT(RtlInitializeCorrelationVector);
PH_DECLARE_IMPORT(RtlIncrementCorrelationVector);
PH_DECLARE_IMPORT(RtlExtendCorrelationVector);
PH_DECLARE_IMPORT(RtlValidateCorrelationVector);
PH_DECLARE_IMPORT(PssNtCaptureSnapshot);
PH_DECLARE_IMPORT(PssNtQuerySnapshot);
PH_DECLARE_IMPORT(PssNtFreeSnapshot);
PH_DECLARE_IMPORT(PssNtFreeRemoteSnapshot);
PH_DECLARE_IMPORT(PssNtValidateDescriptor);
PH_DECLARE_IMPORT(NtPssCaptureVaSpaceBulk);
PH_DECLARE_IMPORT(TpSetPoolThreadBasePriority);
// Advapi32
PH_DECLARE_IMPORT(ConvertSecurityDescriptorToStringSecurityDescriptorW);
PH_DECLARE_IMPORT(ConvertStringSecurityDescriptorToSecurityDescriptorW);
// Cfgmgr32
PH_DECLARE_IMPORT(DevGetObjects);
PH_DECLARE_IMPORT(DevFreeObjects);
PH_DECLARE_IMPORT(DevGetObjectProperties);
PH_DECLARE_IMPORT(DevFreeObjectProperties);
PH_DECLARE_IMPORT(DevCreateObjectQuery);
PH_DECLARE_IMPORT(DevCloseObjectQuery);
// Shlwapi
PH_DECLARE_IMPORT(SHAutoComplete);
PH_DECLARE_IMPORT(SHCreateStreamOnFileEx);
// Userenv
PH_DECLARE_IMPORT(CreateEnvironmentBlock);
PH_DECLARE_IMPORT(DestroyEnvironmentBlock);
PH_DECLARE_IMPORT(GetAppContainerRegistryLocation);
PH_DECLARE_IMPORT(GetAppContainerFolderPath);
// User32
PH_DECLARE_IMPORT(ConsoleControl);
PH_DECLARE_IMPORT(GetCurrentInputMessageSource);
PH_DECLARE_IMPORT(GetCIMSSM);
PH_DECLARE_IMPORT(SetCoalescableTimer);
// Win32u
PH_DECLARE_IMPORT(NtGdiGetEntry);
PH_DECLARE_IMPORT(NtUserBuildHwndList);
// Xmllite
PH_DECLARE_IMPORT(CreateXmlReader);
PH_DECLARE_IMPORT(CreateXmlWriter);
EXTERN_C_END
#endif