[SHIMENG] Filter shims based on the include/exclude node specified, as well as their...
[reactos.git] / reactos / dll / appcompat / apphelp / apphelp.h
1 /*
2 * Copyright 2013 Mislav Blažević
3 * Copyright 2015-2017 Mark Jansen (mark.jansen@reactos.org)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #ifndef APPHELP_H
21 #define APPHELP_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include "sdbtypes.h"
28
29 /* Flags for SdbInitDatabase */
30 #define HID_DOS_PATHS 0x1
31 #define HID_DATABASE_FULLPATH 0x2
32 #define HID_NO_DATABASE 0x4
33 #define HID_DATABASE_TYPE_MASK 0xF00F0000
34 #define SDB_DATABASE_MAIN_MSI 0x80020000
35 #define SDB_DATABASE_MAIN_SHIM 0x80030000
36 #define SDB_DATABASE_MAIN_DRIVERS 0x80040000
37
38 typedef struct _SDB {
39 PDB pdb;
40 BOOL auto_loaded;
41 } SDB, *HSDB;
42
43 typedef struct tagATTRINFO {
44 TAG type;
45 DWORD flags;
46 union {
47 QWORD qwattr;
48 DWORD dwattr;
49 WCHAR *lpattr;
50 };
51 } ATTRINFO, *PATTRINFO;
52
53 #define SDB_MAX_SDBS 16
54 #define SDB_MAX_EXES 16
55 #define SDB_MAX_LAYERS 8
56
57 /* Flags for adwExeFlags */
58 #define SHIMREG_DISABLE_SHIM (0x00000001)
59 #define SHIMREG_DISABLE_APPHELP (0x00000002)
60 #define SHIMREG_APPHELP_NOUI (0x00000004)
61 #define SHIMREG_APPHELP_CANCEL (0x10000000)
62 #define SHIMREG_DISABLE_SXS (0x00000010)
63 #define SHIMREG_DISABLE_LAYER (0x00000020)
64 #define SHIMREG_DISABLE_DRIVER (0x00000040)
65
66 /* Flags for dwFlags */
67 #define SHIMREG_HAS_ENVIRONMENT (0x1)
68
69 /* Flags for SdbGetMatchingExe */
70 #define SDBGMEF_IGNORE_ENVIRONMENT (0x1)
71
72 typedef struct tagSDBQUERYRESULT {
73 TAGREF atrExes[SDB_MAX_EXES];
74 DWORD adwExeFlags[SDB_MAX_EXES];
75 TAGREF atrLayers[SDB_MAX_LAYERS];
76 DWORD dwLayerFlags;
77 TAGREF trApphelp;
78 DWORD dwExeCount;
79 DWORD dwLayerCount;
80 GUID guidID;
81 DWORD dwFlags;
82 DWORD dwCustomSDBMap;
83 GUID rgGuidDB[SDB_MAX_SDBS];
84 } SDBQUERYRESULT, *PSDBQUERYRESULT;
85
86 #ifndef APPHELP_NOSDBPAPI
87 #include "sdbpapi.h"
88 #endif
89
90 /* sdbapi.c */
91 PWSTR SdbpStrDup(LPCWSTR string);
92 DWORD SdbpStrsize(PCWSTR string);
93 HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR);
94 void WINAPI SdbReleaseDatabase(HSDB);
95 BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length);
96 LPCWSTR WINAPI SdbTagToString(TAG tag);
97
98 PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
99 void WINAPI SdbCloseDatabase(PDB);
100 BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid);
101 BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size);
102 LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid);
103 TAGID WINAPI SdbFindFirstNamedTag(PDB pdb, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name);
104
105 /* sdbread.c */
106 BOOL WINAPI SdbpReadData(PDB pdb, PVOID dest, DWORD offset, DWORD num);
107 TAG WINAPI SdbGetTagFromTagID(PDB pdb, TAGID tagid);
108 TAGID WINAPI SdbFindFirstTag(PDB pdb, TAGID parent, TAG tag);
109 TAGID WINAPI SdbFindNextTag(PDB pdb, TAGID parent, TAGID prev_child);
110 BOOL WINAPI SdbGetDatabaseID(PDB pdb, GUID* Guid);
111 DWORD WINAPI SdbReadDWORDTag(PDB pdb, TAGID tagid, DWORD ret);
112 QWORD WINAPI SdbReadQWORDTag(PDB pdb, TAGID tagid, QWORD ret);
113 TAGID WINAPI SdbGetFirstChild(PDB pdb, TAGID parent);
114 TAGID WINAPI SdbGetNextChild(PDB pdb, TAGID parent, TAGID prev_child);
115
116 /* sdbfileattr.c*/
117 BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count);
118 BOOL WINAPI SdbFreeFileAttributes(PATTRINFO attr_info);
119
120 /* layer.c */
121 BOOL WINAPI AllowPermLayer(PCWSTR path);
122 BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags);
123 BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable);
124
125 /* hsdb.c */
126 BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result);
127 BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF* ptrWhich);
128 BOOL WINAPI SdbTagRefToTagID(HSDB hsdb, TAGREF trWhich, PDB* ppdb, TAGID* ptiWhich);
129 BOOL WINAPI SdbUnpackAppCompatData(HSDB hsdb, LPCWSTR pszImageName, PVOID pData, PSDBQUERYRESULT pQueryResult);
130
131 #define ATTRIBUTE_AVAILABLE 0x1
132 #define ATTRIBUTE_FAILED 0x2
133
134 #include "sdbtagid.h"
135
136 #ifdef __cplusplus
137 } // extern "C"
138 #endif
139
140 #endif // APPHELP_H