ReactOS 0.4.16-dev-319-g6cf4263
apphelp.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Application compatibility module
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: common structures / functions
5 * COPYRIGHT: Copyright 2013 Mislav Blažević
6 * Copyright 2017-2019 Mark Jansen (mark.jansen@reactos.org)
7 */
8
9#ifndef APPHELP_H
10#define APPHELP_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include <appcompat/sdbtypes.h>
17
18/* Flags for SdbInitDatabase */
19#define HID_DOS_PATHS 0x1
20#define HID_DATABASE_FULLPATH 0x2
21#define HID_NO_DATABASE 0x4
22#define HID_DATABASE_TYPE_MASK 0xF00F0000
23#define SDB_DATABASE_MAIN_MSI 0x80020000
24#define SDB_DATABASE_MAIN_SHIM 0x80030000
25#define SDB_DATABASE_MAIN_DRIVERS 0x80040000
26
27// Shim database types
28#define SDB_DATABASE_SHIM 0x00010000
29
30typedef struct _SDB {
34
35typedef struct tagATTRINFO {
38 union {
42 };
44
45#define SDB_MAX_SDBS 16
46#define SDB_MAX_EXES 16
47#define SDB_MAX_LAYERS 8
48
49/* Flags for adwExeFlags */
50#define SHIMREG_DISABLE_SHIM (0x00000001)
51#define SHIMREG_DISABLE_APPHELP (0x00000002)
52#define SHIMREG_APPHELP_NOUI (0x00000004)
53#define SHIMREG_APPHELP_CANCEL (0x10000000)
54#define SHIMREG_DISABLE_SXS (0x00000010)
55#define SHIMREG_DISABLE_LAYER (0x00000020)
56#define SHIMREG_DISABLE_DRIVER (0x00000040)
57
58/* Flags for dwFlags */
59#define SHIMREG_HAS_ENVIRONMENT (0x1)
60
61/* Flags for SdbGetMatchingExe */
62#define SDBGMEF_IGNORE_ENVIRONMENT (0x1)
63
64typedef struct tagSDBQUERYRESULT {
77
78
79#define DB_INFO_FLAGS_VALID_GUID 1
80
81typedef struct _DB_INFORMATION
82{
88 /* Win10+ has an extra field here */
90
91
92#ifndef APPHELP_NOSDBPAPI
93#include "sdbpapi.h"
94#endif
95
96/* sdbapi.c */
103
115
116/* sdbread.c */
129
130/* sdbfileattr.c*/
131BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count);
133
134/* layer.c */
138
139/* hsdb.c */
145
146#define ATTRIBUTE_AVAILABLE 0x1
147#define ATTRIBUTE_FAILED 0x2
148
149#include <appcompat/sdbtagid.h>
150
151#ifdef __cplusplus
152} // extern "C"
153#endif
154
155#endif // APPHELP_H
BOOL WINAPI SdbFreeFileAttributes(PATTRINFO attr_info)
Definition: sdbfileattr.c:214
DWORD SdbpStrsize(PCWSTR string)
Definition: sdbapi.c:157
#define SDB_MAX_LAYERS
Definition: apphelp.h:47
DWORD WINAPI SdbGetTagDataSize(PDB pdb, TAGID tagid)
Definition: sdbread.c:109
struct _DB_INFORMATION DB_INFORMATION
BOOL WINAPI SdbGetDatabaseID(PDB pdb, GUID *Guid)
Definition: sdbread.c:388
BOOL WINAPI SdbGetDatabaseInformation(PDB pdb, PDB_INFORMATION information)
Definition: sdbapi.c:502
struct tagSDBQUERYRESULT * PSDBQUERYRESULT
TAG WINAPI SdbGetTagFromTagID(PDB pdb, TAGID tagid)
Definition: sdbread.c:93
TAGID WINAPI SdbFindFirstTag(PDB pdb, TAGID parent, TAG tag)
Definition: sdbread.c:208
BOOL WINAPI SdbTagRefToTagID(HSDB hsdb, TAGREF trWhich, PDB *ppdb, TAGID *ptiWhich)
Definition: hsdb.c:638
LPCWSTR WINAPI SdbTagToString(TAG tag)
Definition: sdbapi.c:752
BOOL WINAPI SdbUnregisterDatabase(_In_ const GUID *pguidDB)
Definition: apphelp.c:407
TAGID WINAPI SdbGetFirstChild(PDB pdb, TAGID parent)
Definition: sdbread.c:142
DWORD WINAPI SdbQueryDataExTagID(PDB pdb, TAGID tiExe, LPCWSTR lpszDataName, LPDWORD lpdwDataType, LPVOID lpBuffer, LPDWORD lpcbBufferSize, TAGID *ptiData)
Definition: sdbapi.c:614
LPWSTR WINAPI SdbpGetString(PDB pdb, TAGID tagid, PDWORD size)
Definition: sdbread.c:47
BOOL WINAPI SdbpReadData(PDB pdb, PVOID dest, DWORD offset, DWORD num)
Definition: sdbread.c:14
struct tagATTRINFO ATTRINFO
TAGID WINAPI SdbGetNextChild(PDB pdb, TAGID parent, TAGID prev_child)
Definition: sdbread.c:171
struct tagATTRINFO * PATTRINFO
BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result)
Definition: hsdb.c:439
TAGID WINAPI SdbFindFirstNamedTag(PDB pdb, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name)
Definition: sdbapi.c:544
void WINAPI SdbReleaseDatabase(HSDB)
Definition: hsdb.c:417
PWSTR SdbpStrDup(LPCWSTR string)
Definition: sdbapi.c:162
struct tagSDBQUERYRESULT SDBQUERYRESULT
BOOL WINAPI SdbReadBinaryTag(PDB pdb, TAGID tagid, PBYTE buffer, DWORD size)
Definition: sdbread.c:338
BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length)
Definition: sdbapi.c:412
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
Definition: sdbapi.c:329
#define SDB_MAX_SDBS
Definition: apphelp.h:45
HRESULT WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
Definition: hsdb.c:579
BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF *ptrWhich)
Definition: hsdb.c:669
BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable)
Definition: layer.c:467
BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid)
Definition: sdbapi.c:431
BOOL WINAPI SdbRegisterDatabaseEx(_In_ LPCWSTR pszDatabasePath, _In_ DWORD dwDatabaseType, _In_opt_ const PULONGLONG pTimeStamp)
Definition: apphelp.c:262
#define SDB_MAX_EXES
Definition: apphelp.h:46
VOID WINAPI SdbFreeDatabaseInformation(PDB_INFORMATION information)
Definition: sdbapi.c:527
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR)
Definition: hsdb.c:369
void WINAPI SdbCloseDatabase(PDB)
Definition: sdbapi.c:373
struct _DB_INFORMATION * PDB_INFORMATION
QWORD WINAPI SdbReadQWORDTag(PDB pdb, TAGID tagid, QWORD ret)
Definition: sdbread.c:321
BOOL WINAPI AllowPermLayer(PCWSTR path)
Definition: layer.c:320
BOOL WINAPI SdbUnpackAppCompatData(HSDB hsdb, LPCWSTR pszImageName, PVOID pData, PSDBQUERYRESULT pQueryResult)
Definition: hsdb.c:761
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags)
Definition: layer.c:364
TAGID WINAPI SdbFindNextTag(PDB pdb, TAGID parent, TAGID prev_child)
Definition: sdbread.c:231
DWORD WINAPI SdbQueryData(HSDB hsdb, TAGREF trWhich, LPCWSTR lpszDataName, LPDWORD lpdwDataType, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
Definition: hsdb.c:832
BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count)
Definition: sdbfileattr.c:239
DWORD WINAPI SdbReadDWORDTag(PDB pdb, TAGID tagid, DWORD ret)
Definition: sdbread.c:305
struct _SDB SDB
struct _SDB * HSDB
LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid)
Definition: sdbread.c:375
DWORD TAGREF
DWORD TAGID
INT PATH_TYPE
static PDB pdb
Definition: db.cpp:172
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
static TAGREF LPCWSTR lpszDataName
Definition: db.cpp:175
static PDB_INFORMATION information
Definition: db.cpp:178
static TAGREF trWhich
Definition: db.cpp:171
static PDB TAGID tiWhich
Definition: db.cpp:172
static TAGREF PDB TAGID * ptiWhich
Definition: db.cpp:171
static TAGREF PDB * ppdb
Definition: db.cpp:171
static TAGID TAGID TAGID LPCWSTR find_name
Definition: db.cpp:155
static TAGID tiExe
Definition: db.cpp:177
static TAGREF LPCWSTR LPDWORD lpdwDataType
Definition: db.cpp:175
static TAGID TAGID find
Definition: db.cpp:155
static TAGID LPCWSTR LPDWORD LPVOID LPDWORD TAGID * ptiData
Definition: db.cpp:177
static PDB TAGID TAGREF * ptrWhich
Definition: db.cpp:172
static LPCWSTR LPCWSTR module_name
Definition: db.cpp:170
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:170
static TAGID TAGID TAGID nametag
Definition: db.cpp:155
static TAGREF LPCWSTR LPDWORD LPVOID LPDWORD lpcbBufferSize
Definition: db.cpp:175
r parent
Definition: btrfs.c:3010
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
GLuint GLuint num
Definition: glext.h:9618
GLuint64EXT * result
Definition: glext.h:11304
GLintptr offset
Definition: glext.h:5920
static PCWSTR BOOL bMachine
Definition: layerapi.c:34
static PCWSTR wszLayer
Definition: layerapi.c:36
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:35
static PWSTR pwszLayers
Definition: layerapi.c:35
static PWSTR GuidString
Definition: apphelp.c:93
LPCWSTR LPCWSTR LPCWSTR DWORD PSDBQUERYRESULT_VISTA pQueryResult
Definition: env.c:37
LPCWSTR pszImageName
Definition: env.c:57
LPCWSTR pszDatabasePath
Definition: env.c:38
static char * dest
Definition: rtl.c:135
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:391
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define CONST
Definition: pedump.c:81
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
DWORD dwDatabaseType
Definition: register.cpp:75
DWORD const PULONGLONG pTimeStamp
Definition: register.cpp:76
UINT64 QWORD
Definition: shimdbg.c:104
DWORD dwFlags
Definition: apphelp.h:83
DWORD dwMajor
Definition: apphelp.h:84
LPCWSTR Description
Definition: apphelp.h:86
DWORD dwMinor
Definition: apphelp.h:85
Definition: apphelp.h:30
BOOL auto_loaded
Definition: apphelp.h:32
PDB pdb
Definition: apphelp.h:31
Definition: fs_rec.h:143
QWORD qwattr
Definition: apphelp.h:39
WCHAR * lpattr
Definition: apphelp.h:41
DWORD dwattr
Definition: apphelp.h:40
DWORD flags
Definition: apphelp.h:37
TAG type
Definition: apphelp.h:36
DWORD dwLayerCount
Definition: apphelp.h:71
GUID rgGuidDB[SDB_MAX_SDBS]
Definition: apphelp.h:75
TAGREF atrLayers[SDB_MAX_LAYERS]
Definition: apphelp.h:67
DWORD dwExeCount
Definition: apphelp.h:70
DWORD dwCustomSDBMap
Definition: apphelp.h:74
DWORD adwExeFlags[SDB_MAX_EXES]
Definition: apphelp.h:66
TAGREF atrExes[SDB_MAX_EXES]
Definition: apphelp.h:65
DWORD dwLayerFlags
Definition: apphelp.h:68
TAGREF trApphelp
Definition: apphelp.h:69
Definition: ecma_167.h:138
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int ret
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ BOOL bEnable
Definition: winddi.h:3426
#define WINAPI
Definition: msvc.h:6
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185