10#define WIN32_NO_STATUS
27#define DPFLTR_APPCOMPAT_ID 123
29#define MAX_GUID_STRING_LEN RTL_NUMBER_OF("{12345678-1234-1234-0123-456789abcdef}")
33#define NT_SUCCESS(StatCode) ((NTSTATUS)(StatCode) >= 0)
47 RtlInitEmptyUnicodeString(&DebugValue,
Buffer,
sizeof(
Buffer));
88 SHIM_WARN(
"stub: ObjectCLSID='%S', bShimIfNecessary=%d, pullFlags=%p)\n",
GuidString, bShimIfNecessary, pullFlags);
112 const char* LevelStr;
146#if defined(APPCOMPAT_USE_DBGPRINTEX) && APPCOMPAT_USE_DBGPRINTEX
155#define APPHELP_DONTWRITE_REASON 2
156#define APPHELP_CLEARBITS 0x100
157#define APPHELP_IGNORE_ENVIRONMENT 0x400
159#define APPHELP_VALID_RESULT 0x10000
160#define APPHELP_RESULT_NOTFOUND 0x20000
161#define APPHELP_RESULT_FOUND 0x40000
229 DWORD MatchingExeFlags = 0;
286 SHIM_ERR(
"Unable to retrieve DB info\n");
293 SHIM_ERR(
"Unable to Convert GUID to string\n");
320 SHIM_ERR(
"Unable to write %wZ\n", &DatabasePathKey);
337 &ulTimeStamp.
QuadPart,
sizeof(ulTimeStamp));
339 SHIM_ERR(
"Unable to write %wZ\n", &DatabaseInstallTimeStampKey);
347 SHIM_ERR(
"Unable to write %wZ\n", &DatabaseTypeKey);
355 SHIM_ERR(
"Unable to write %wZ\n", &DatabaseDescriptionKey);
418 SHIM_ERR(
"Unable to Convert GUID to string\n");
422 RtlInitEmptyUnicodeString(&
KeyName, KeyBuffer,
sizeof(KeyBuffer));
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
#define SDB_DATABASE_MAIN_SHIM
#define DB_INFO_FLAGS_VALID_GUID
BOOL WINAPI SdbGetDatabaseInformation(PDB pdb, PDB_INFORMATION information)
BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result)
void WINAPI SdbReleaseDatabase(HSDB)
BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length)
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
#define SDBGMEF_IGNORE_ENVIRONMENT
VOID WINAPI SdbFreeDatabaseInformation(PDB_INFORMATION information)
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR)
void WINAPI SdbCloseDatabase(PDB)
#define DPFLTR_ERROR_LEVEL
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOL WINAPIV ShimDbgPrint(SHIM_LOG_LEVEL Level, PCSTR FunctionName, PCSTR Format,...)
#define APPHELP_IGNORE_ENVIRONMENT
const UNICODE_STRING InstalledSDBKeyName
BOOL WINAPI SdbUnregisterDatabase(_In_ const GUID *pguidDB)
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
BOOL WINAPI ApphelpCheckShellObject(REFCLSID ObjectCLSID, BOOL bShimIfNecessary, ULONGLONG *pullFlags)
#define APPHELP_VALID_RESULT
#define DPFLTR_APPCOMPAT_ID
#define NT_SUCCESS(StatCode)
BOOL WINAPI ApphelpCheckRunAppEx(_In_ HANDLE FileHandle, _In_opt_ PVOID Unk1, _In_opt_ PVOID Unk2, _In_opt_z_ PCWSTR ApplicationName, _In_opt_ PVOID Environment, _In_opt_ USHORT ExeType, _Inout_opt_ PULONG Reason, _Out_opt_ PVOID *SdbQueryAppCompatData, _Out_opt_ PULONG SdbQueryAppCompatDataSize, _Out_opt_ PVOID *SxsData, _Out_opt_ PULONG SxsDataSize, _Out_opt_ PULONG FusionFlags, _Out_opt_ PULONG64 SomeFlag1, _Out_opt_ PULONG SomeFlag2)
#define APPHELP_RESULT_NOTFOUND
BOOL WINAPI SdbRegisterDatabase(_In_ LPCWSTR pszDatabasePath, _In_ DWORD dwDatabaseType)
BOOL WINAPI BaseDumpAppcompatCache(VOID)
BOOL WINAPI SdbRegisterDatabaseEx(_In_ LPCWSTR pszDatabasePath, _In_ DWORD dwDatabaseType, _In_opt_ const PULONGLONG pTimeStamp)
#define APPHELP_DONTWRITE_REASON
#define MAX_GUID_STRING_LEN
BOOL WINAPI ShimDumpCache(HWND hwnd, HINSTANCE hInstance, LPCSTR lpszCmdLine, int nCmdShow)
void ApphelppInitDebugLevel(void)
BOOL WINAPI ShimFlushCache(HWND hwnd, HINSTANCE hInstance, LPCSTR lpszCmdLine, int nCmdShow)
BOOL WINAPI ApphelpCheckInstallShieldPackage(void *ptr, LPCWSTR path)
#define APPHELP_RESULT_FOUND
BOOL WINAPI BaseFlushAppcompatCache(VOID)
ACCESS_MASK Wow64QueryFlag(void)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define INVALID_HANDLE_VALUE
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
static IN LPSTR IN PVOID Unk2
unsigned __int64 * PULONG64
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 PULONG SomeFlag2
PVOID PVOID PWCHAR PVOID USHORT ExeType
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID * SdbQueryAppCompatData
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG SxsDataSize
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG PULONG64 SomeFlag1
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID * SxsData
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG PVOID PULONG PULONG FusionFlags
PVOID PVOID PWCHAR PVOID Environment
PVOID PVOID PWCHAR PVOID USHORT PULONG PVOID PULONG SdbQueryAppCompatDataSize
PVOID PVOID PWCHAR ApplicationName
#define DPFLTR_WARNING_LEVEL
#define DPFLTR_INFO_LEVEL
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
NTSYSAPI NTSTATUS NTAPI RtlQueryEnvironmentVariable_U(_In_opt_ PWSTR Environment, _In_ PCUNICODE_STRING Name, _Out_ PUNICODE_STRING Value)
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
#define KEY_ENUMERATE_SUB_KEYS
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtDeleteKey(IN HANDLE KeyHandle)
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a)
#define STRSAFE_NULL_ON_FAILURE
DWORD const PULONGLONG pTimeStamp
void SdbpHeapDeinit(void)
enum _SHIM_LOG_LEVEL SHIM_LOG_LEVEL
#define SHIM_INFO(fmt,...)
#define SHIM_WARN(fmt,...)
#define SHIM_ERR(fmt,...)
STRSAFEAPI StringCchVPrintfExA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCSTR pszFormat, va_list argList)
STRSAFEAPI StringCchPrintfExA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCSTR pszFormat,...)
#define RTL_CONSTANT_STRING(s)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level