[APPHELP][APPHELP_APITEST] Update db apitests to succeed from 2k3 to 10, paving the...
[reactos.git] / reactos / dll / appcompat / apphelp / apphelp.h
1 /*
2 * Copyright 2013 Mislav Blažević
3 * Copyright 2015,2016 Mark Jansen
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 db;
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 #define SDBGMEF_IGNORE_ENVIRONMENT (0x1)
67
68 typedef struct tagSDBQUERYRESULT {
69 TAGREF atrExes[SDB_MAX_EXES];
70 DWORD adwExeFlags[SDB_MAX_EXES];
71 TAGREF atrLayers[SDB_MAX_LAYERS];
72 DWORD dwLayerFlags;
73 TAGREF trApphelp;
74 DWORD dwExeCount;
75 DWORD dwLayerCount;
76 GUID guidID;
77 DWORD dwFlags;
78 DWORD dwCustomSDBMap;
79 GUID rgGuidDB[SDB_MAX_SDBS];
80 } SDBQUERYRESULT, *PSDBQUERYRESULT;
81
82 #include "sdbpapi.h"
83
84 /* sdbapi.c */
85 PWSTR SdbpStrDup(LPCWSTR string);
86 HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR);
87 void WINAPI SdbReleaseDatabase(HSDB);
88
89 PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
90 void WINAPI SdbCloseDatabase(PDB);
91 BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid);
92 BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size);
93 LPWSTR WINAPI SdbGetStringTagPtr(PDB db, TAGID tagid);
94 TAGID WINAPI SdbFindFirstNamedTag(PDB db, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name);
95
96 /* sdbread.c */
97 BOOL WINAPI SdbpReadData(PDB db, PVOID dest, DWORD offset, DWORD num);
98 TAG WINAPI SdbGetTagFromTagID(PDB db, TAGID tagid);
99 TAGID WINAPI SdbFindFirstTag(PDB db, TAGID parent, TAG tag);
100 TAGID WINAPI SdbFindNextTag(PDB db, TAGID parent, TAGID prev_child);
101 BOOL WINAPI SdbGetDatabaseID(PDB db, GUID* Guid);
102
103 /* sdbfileattr.c*/
104 BOOL WINAPI SdbFreeFileAttributes(PATTRINFO attr_info);
105
106 /* layer.c */
107 BOOL WINAPI AllowPermLayer(PCWSTR path);
108 BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags);
109 BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable);
110
111 /* hsdb.c */
112 BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF* ptrWhich);
113
114
115 #define ATTRIBUTE_AVAILABLE 0x1
116 #define ATTRIBUTE_FAILED 0x2
117
118 #include "sdbtagid.h"
119
120 #ifdef __cplusplus
121 } // extern "C"
122 #endif
123
124 #endif // APPHELP_H