ReactOS  0.4.13-dev-79-gcd489d8
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
13 extern "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 typedef struct _SDB {
30 } SDB, *HSDB;
31 
32 typedef struct tagATTRINFO {
35  union {
39  };
41 
42 #define SDB_MAX_SDBS 16
43 #define SDB_MAX_EXES 16
44 #define SDB_MAX_LAYERS 8
45 
46 /* Flags for adwExeFlags */
47 #define SHIMREG_DISABLE_SHIM (0x00000001)
48 #define SHIMREG_DISABLE_APPHELP (0x00000002)
49 #define SHIMREG_APPHELP_NOUI (0x00000004)
50 #define SHIMREG_APPHELP_CANCEL (0x10000000)
51 #define SHIMREG_DISABLE_SXS (0x00000010)
52 #define SHIMREG_DISABLE_LAYER (0x00000020)
53 #define SHIMREG_DISABLE_DRIVER (0x00000040)
54 
55 /* Flags for dwFlags */
56 #define SHIMREG_HAS_ENVIRONMENT (0x1)
57 
58 /* Flags for SdbGetMatchingExe */
59 #define SDBGMEF_IGNORE_ENVIRONMENT (0x1)
60 
61 typedef struct tagSDBQUERYRESULT {
74 
75 
76 #define DB_INFO_FLAGS_VALID_GUID 1
77 
78 typedef struct _DB_INFORMATION
79 {
85  /* Win10+ has an extra field here */
87 
88 
89 #ifndef APPHELP_NOSDBPAPI
90 #include "sdbpapi.h"
91 #endif
92 
93 /* sdbapi.c */
94 PWSTR SdbpStrDup(LPCWSTR string);
95 DWORD SdbpStrsize(PCWSTR string);
100 
110 
111 
112 /* sdbread.c */
124 
125 
126 /* sdbfileattr.c*/
127 BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count);
129 
130 /* layer.c */
134 
135 /* hsdb.c */
141 
142 #define ATTRIBUTE_AVAILABLE 0x1
143 #define ATTRIBUTE_FAILED 0x2
144 
145 #include <appcompat/sdbtagid.h>
146 
147 #ifdef __cplusplus
148 } // extern "C"
149 #endif
150 
151 #endif // APPHELP_H
DWORD TAGREF
static TAGREF PDB * ppdb
Definition: db.cpp:169
static PWSTR GuidString
Definition: apphelp.c:91
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define SDB_MAX_EXES
Definition: apphelp.h:43
struct tagSDBQUERYRESULT SDBQUERYRESULT
static PDB pdb
Definition: db.cpp:170
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
INT PATH_TYPE
BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable)
Definition: layer.c:467
LPCWSTR pszImageName
Definition: env.c:55
static LPCWSTR LPCWSTR module_name
Definition: db.cpp:168
struct _SDB SDB
BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count)
Definition: sdbfileattr.c:239
DWORD flags
Definition: apphelp.h:34
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD WINAPI SdbQueryData(HSDB hsdb, TAGREF trWhich, LPCWSTR lpszDataName, LPDWORD lpdwDataType, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
Definition: hsdb.c:831
WCHAR * lpattr
Definition: apphelp.h:38
DWORD WINAPI SdbReadDWORDTag(PDB pdb, TAGID tagid, DWORD ret)
Definition: sdbread.c:305
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR)
Definition: hsdb.c:369
TAGREF atrLayers[SDB_MAX_LAYERS]
Definition: apphelp.h:64
GLintptr offset
Definition: glext.h:5920
HRESULT WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size)
Definition: hsdb.c:579
static PDB TAGID tiWhich
Definition: db.cpp:170
LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid)
Definition: sdbread.c:375
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LPCWSTR Description
Definition: apphelp.h:83
Definition: ecma_167.h:138
DWORD dwLayerFlags
Definition: apphelp.h:65
BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result)
Definition: hsdb.c:439
BOOL WINAPI SdbpReadData(PDB pdb, PVOID dest, DWORD offset, DWORD num)
Definition: sdbread.c:14
BOOL WINAPI AllowPermLayer(PCWSTR path)
Definition: layer.c:320
DWORD dwLayerCount
Definition: apphelp.h:68
TAGREF trApphelp
Definition: apphelp.h:66
DWORD dwMajor
Definition: apphelp.h:81
LPCWSTR LPCWSTR LPCWSTR DWORD PSDBQUERYRESULT_VISTA pQueryResult
Definition: env.c:35
DWORD SdbpStrsize(PCWSTR string)
Definition: sdbapi.c:157
VOID WINAPI SdbFreeDatabaseInformation(PDB_INFORMATION information)
Definition: sdbapi.c:527
Definition: apphelp.h:27
DWORD WINAPI SdbGetTagDataSize(PDB pdb, TAGID tagid)
Definition: sdbread.c:109
static TAGID TAGID TAGID nametag
Definition: db.cpp:153
static TAGREF PDB TAGID * ptiWhich
Definition: db.cpp:169
static PCWSTR wszLayer
Definition: layerapi.c:35
static PDB TAGID TAGREF * ptrWhich
Definition: db.cpp:170
static TAGREF trWhich
Definition: db.cpp:169
unsigned int BOOL
Definition: ntddk_ex.h:94
struct tagATTRINFO ATTRINFO
QWORD WINAPI SdbReadQWORDTag(PDB pdb, TAGID tagid, QWORD ret)
Definition: sdbread.c:321
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
struct tagATTRINFO * PATTRINFO
BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length)
Definition: sdbapi.c:412
static GUID * Guid
Definition: apphelp.c:93
LPCWSTR WINAPI SdbTagToString(TAG tag)
Definition: sdbapi.c:752
QWORD qwattr
Definition: apphelp.h:36
static PWSTR pwszLayers
Definition: layerapi.c:34
DWORD WINAPI SdbQueryDataExTagID(PDB pdb, TAGID tiExe, LPCWSTR lpszDataName, LPDWORD lpdwDataType, LPVOID lpBuffer, LPDWORD lpcbBufferSize, TAGID *ptiData)
Definition: sdbapi.c:614
TAG type
Definition: apphelp.h:33
TAGID WINAPI SdbFindNextTag(PDB pdb, TAGID parent, TAGID prev_child)
Definition: sdbread.c:231
#define SDB_MAX_SDBS
Definition: apphelp.h:42
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags)
Definition: layer.c:364
struct tagSDBQUERYRESULT * PSDBQUERYRESULT
GLsizeiptr size
Definition: glext.h:5919
TAGID WINAPI SdbGetNextChild(PDB pdb, TAGID parent, TAGID prev_child)
Definition: sdbread.c:171
static TAGID TAGID TAGID LPCWSTR find_name
Definition: db.cpp:153
r parent
Definition: btrfs.c:2659
BOOL WINAPI SdbGetDatabaseID(PDB pdb, GUID *Guid)
Definition: sdbread.c:388
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid)
Definition: sdbapi.c:431
UINT64 QWORD
Definition: shimdbg.c:104
static TAGREF LPCWSTR lpszDataName
Definition: db.cpp:173
DWORD dwFlags
Definition: apphelp.h:80
#define WINAPI
Definition: msvc.h:8
static TAGREF LPCWSTR LPDWORD LPVOID LPDWORD lpcbBufferSize
Definition: db.cpp:173
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:34
GLbitfield flags
Definition: glext.h:7161
TAGID WINAPI SdbFindFirstTag(PDB pdb, TAGID parent, TAG tag)
Definition: sdbread.c:208
void WINAPI SdbCloseDatabase(PDB)
Definition: sdbapi.c:373
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
void WINAPI SdbReleaseDatabase(HSDB)
Definition: hsdb.c:417
DWORD dwExeCount
Definition: apphelp.h:67
DWORD dwCustomSDBMap
Definition: apphelp.h:71
BOOL WINAPI SdbGetDatabaseInformation(PDB pdb, PDB_INFORMATION information)
Definition: sdbapi.c:502
BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF *ptrWhich)
Definition: hsdb.c:669
DWORD dwattr
Definition: apphelp.h:37
PWSTR SdbpStrDup(LPCWSTR string)
Definition: sdbapi.c:162
TAGREF atrExes[SDB_MAX_EXES]
Definition: apphelp.h:62
static TAGID tiExe
Definition: db.cpp:175
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_In_ BOOL bEnable
Definition: winddi.h:3426
GUID rgGuidDB[SDB_MAX_SDBS]
Definition: apphelp.h:72
static TAGREF LPCWSTR LPDWORD lpdwDataType
Definition: db.cpp:173
struct _DB_INFORMATION * PDB_INFORMATION
DWORD dwMinor
Definition: apphelp.h:82
Definition: services.c:325
BOOL WINAPI SdbFreeFileAttributes(PATTRINFO attr_info)
Definition: sdbfileattr.c:214
TAGID WINAPI SdbFindFirstNamedTag(PDB pdb, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name)
Definition: sdbapi.c:544
TAGID WINAPI SdbGetFirstChild(PDB pdb, TAGID parent)
Definition: sdbread.c:142
Definition: fs_rec.h:142
DWORD * PDWORD
Definition: pedump.c:68
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:168
BOOL auto_loaded
Definition: apphelp.h:29
static TAGID TAGID find
Definition: db.cpp:153
DWORD adwExeFlags[SDB_MAX_EXES]
Definition: apphelp.h:63
uint32_t * LPDWORD
Definition: typedefs.h:57
static PDB_INFORMATION information
Definition: db.cpp:176
static TAGID LPCWSTR LPDWORD LPVOID LPDWORD TAGID * ptiData
Definition: db.cpp:175
PDB pdb
Definition: apphelp.h:28
static char * dest
Definition: rtl.c:135
DWORD TAGID
WCHAR * LPWSTR
Definition: xmlstorage.h:184
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
TAG WINAPI SdbGetTagFromTagID(PDB pdb, TAGID tagid)
Definition: sdbread.c:93
BOOL WINAPI SdbUnpackAppCompatData(HSDB hsdb, LPCWSTR pszImageName, PVOID pData, PSDBQUERYRESULT pQueryResult)
Definition: hsdb.c:760
#define SDB_MAX_LAYERS
Definition: apphelp.h:44
BOOL WINAPI SdbTagRefToTagID(HSDB hsdb, TAGREF trWhich, PDB *ppdb, TAGID *ptiWhich)
Definition: hsdb.c:638
GLuint64EXT * result
Definition: glext.h:11304
LPWSTR WINAPI SdbpGetString(PDB pdb, TAGID tagid, PDWORD size)
Definition: sdbread.c:47
static PCWSTR BOOL bMachine
Definition: layerapi.c:33
#define CONST
Definition: pedump.c:81
struct _DB_INFORMATION DB_INFORMATION
struct _SDB * HSDB
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
Definition: sdbapi.c:329