2016-03-31 12:54:05 +00:00
|
|
|
/*
|
2017-09-08 20:19:51 +00:00
|
|
|
* PROJECT: ReactOS Application compatibility module
|
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
|
|
|
* PURPOSE: common structures / functions
|
|
|
|
* COPYRIGHT: Copyright 2013 Mislav Blažević
|
|
|
|
* Copyright 2017 Mark Jansen (mark.jansen@reactos.org)
|
2016-03-31 12:54:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APPHELP_H
|
|
|
|
#define APPHELP_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-06-01 19:10:19 +00:00
|
|
|
#include "sdbtypes.h"
|
2016-05-22 20:27:02 +00:00
|
|
|
|
|
|
|
/* Flags for SdbInitDatabase */
|
|
|
|
#define HID_DOS_PATHS 0x1
|
|
|
|
#define HID_DATABASE_FULLPATH 0x2
|
|
|
|
#define HID_NO_DATABASE 0x4
|
2016-05-01 21:43:30 +00:00
|
|
|
#define HID_DATABASE_TYPE_MASK 0xF00F0000
|
|
|
|
#define SDB_DATABASE_MAIN_MSI 0x80020000
|
|
|
|
#define SDB_DATABASE_MAIN_SHIM 0x80030000
|
|
|
|
#define SDB_DATABASE_MAIN_DRIVERS 0x80040000
|
|
|
|
|
2016-05-28 16:47:39 +00:00
|
|
|
typedef struct _SDB {
|
2017-08-05 12:05:06 +00:00
|
|
|
PDB pdb;
|
2016-05-28 16:47:39 +00:00
|
|
|
BOOL auto_loaded;
|
|
|
|
} SDB, *HSDB;
|
|
|
|
|
2016-05-01 19:12:06 +00:00
|
|
|
typedef struct tagATTRINFO {
|
2016-06-01 19:10:19 +00:00
|
|
|
TAG type;
|
|
|
|
DWORD flags;
|
|
|
|
union {
|
|
|
|
QWORD qwattr;
|
|
|
|
DWORD dwattr;
|
|
|
|
WCHAR *lpattr;
|
|
|
|
};
|
2016-05-01 19:12:06 +00:00
|
|
|
} ATTRINFO, *PATTRINFO;
|
|
|
|
|
2016-09-03 16:20:52 +00:00
|
|
|
#define SDB_MAX_SDBS 16
|
|
|
|
#define SDB_MAX_EXES 16
|
|
|
|
#define SDB_MAX_LAYERS 8
|
|
|
|
|
|
|
|
/* Flags for adwExeFlags */
|
|
|
|
#define SHIMREG_DISABLE_SHIM (0x00000001)
|
|
|
|
#define SHIMREG_DISABLE_APPHELP (0x00000002)
|
|
|
|
#define SHIMREG_APPHELP_NOUI (0x00000004)
|
|
|
|
#define SHIMREG_APPHELP_CANCEL (0x10000000)
|
|
|
|
#define SHIMREG_DISABLE_SXS (0x00000010)
|
|
|
|
#define SHIMREG_DISABLE_LAYER (0x00000020)
|
|
|
|
#define SHIMREG_DISABLE_DRIVER (0x00000040)
|
|
|
|
|
2017-05-19 20:13:08 +00:00
|
|
|
/* Flags for dwFlags */
|
|
|
|
#define SHIMREG_HAS_ENVIRONMENT (0x1)
|
|
|
|
|
|
|
|
/* Flags for SdbGetMatchingExe */
|
2016-09-03 16:20:52 +00:00
|
|
|
#define SDBGMEF_IGNORE_ENVIRONMENT (0x1)
|
|
|
|
|
|
|
|
typedef struct tagSDBQUERYRESULT {
|
|
|
|
TAGREF atrExes[SDB_MAX_EXES];
|
|
|
|
DWORD adwExeFlags[SDB_MAX_EXES];
|
|
|
|
TAGREF atrLayers[SDB_MAX_LAYERS];
|
|
|
|
DWORD dwLayerFlags;
|
|
|
|
TAGREF trApphelp;
|
|
|
|
DWORD dwExeCount;
|
|
|
|
DWORD dwLayerCount;
|
|
|
|
GUID guidID;
|
|
|
|
DWORD dwFlags;
|
|
|
|
DWORD dwCustomSDBMap;
|
|
|
|
GUID rgGuidDB[SDB_MAX_SDBS];
|
|
|
|
} SDBQUERYRESULT, *PSDBQUERYRESULT;
|
|
|
|
|
2017-07-01 20:06:30 +00:00
|
|
|
#ifndef APPHELP_NOSDBPAPI
|
2016-06-01 19:10:19 +00:00
|
|
|
#include "sdbpapi.h"
|
2017-07-01 20:06:30 +00:00
|
|
|
#endif
|
2016-03-31 12:54:05 +00:00
|
|
|
|
2016-10-30 19:39:43 +00:00
|
|
|
/* sdbapi.c */
|
2016-05-01 19:12:06 +00:00
|
|
|
PWSTR SdbpStrDup(LPCWSTR string);
|
2017-08-14 16:34:56 +00:00
|
|
|
DWORD SdbpStrsize(PCWSTR string);
|
2016-09-03 16:20:52 +00:00
|
|
|
HSDB WINAPI SdbInitDatabase(DWORD, LPCWSTR);
|
|
|
|
void WINAPI SdbReleaseDatabase(HSDB);
|
2016-11-27 18:33:21 +00:00
|
|
|
BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length);
|
2017-06-29 17:32:03 +00:00
|
|
|
LPCWSTR WINAPI SdbTagToString(TAG tag);
|
2016-06-01 19:10:19 +00:00
|
|
|
|
2016-05-22 20:27:02 +00:00
|
|
|
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type);
|
|
|
|
void WINAPI SdbCloseDatabase(PDB);
|
|
|
|
BOOL WINAPI SdbIsNullGUID(CONST GUID *Guid);
|
2016-09-03 16:20:52 +00:00
|
|
|
BOOL WINAPI SdbGetAppPatchDir(HSDB db, LPWSTR path, DWORD size);
|
2017-08-05 12:05:06 +00:00
|
|
|
LPWSTR WINAPI SdbGetStringTagPtr(PDB pdb, TAGID tagid);
|
|
|
|
TAGID WINAPI SdbFindFirstNamedTag(PDB pdb, TAGID root, TAGID find, TAGID nametag, LPCWSTR find_name);
|
2016-05-22 20:27:02 +00:00
|
|
|
|
|
|
|
/* sdbread.c */
|
2017-08-05 12:05:06 +00:00
|
|
|
BOOL WINAPI SdbpReadData(PDB pdb, PVOID dest, DWORD offset, DWORD num);
|
|
|
|
TAG WINAPI SdbGetTagFromTagID(PDB pdb, TAGID tagid);
|
|
|
|
TAGID WINAPI SdbFindFirstTag(PDB pdb, TAGID parent, TAG tag);
|
|
|
|
TAGID WINAPI SdbFindNextTag(PDB pdb, TAGID parent, TAGID prev_child);
|
|
|
|
BOOL WINAPI SdbGetDatabaseID(PDB pdb, GUID* Guid);
|
|
|
|
DWORD WINAPI SdbReadDWORDTag(PDB pdb, TAGID tagid, DWORD ret);
|
|
|
|
QWORD WINAPI SdbReadQWORDTag(PDB pdb, TAGID tagid, QWORD ret);
|
|
|
|
TAGID WINAPI SdbGetFirstChild(PDB pdb, TAGID parent);
|
|
|
|
TAGID WINAPI SdbGetNextChild(PDB pdb, TAGID parent, TAGID prev_child);
|
2016-05-01 19:12:06 +00:00
|
|
|
|
2016-09-03 16:20:52 +00:00
|
|
|
/* sdbfileattr.c*/
|
2017-06-29 17:32:03 +00:00
|
|
|
BOOL WINAPI SdbGetFileAttributes(LPCWSTR path, PATTRINFO *attr_info_ret, LPDWORD attr_count);
|
2016-09-03 16:20:52 +00:00
|
|
|
BOOL WINAPI SdbFreeFileAttributes(PATTRINFO attr_info);
|
2016-04-09 21:40:32 +00:00
|
|
|
|
|
|
|
/* layer.c */
|
|
|
|
BOOL WINAPI AllowPermLayer(PCWSTR path);
|
|
|
|
BOOL WINAPI SdbGetPermLayerKeys(PCWSTR wszPath, PWSTR pwszLayers, PDWORD pdwBytes, DWORD dwFlags);
|
|
|
|
BOOL WINAPI SetPermLayerState(PCWSTR wszPath, PCWSTR wszLayer, DWORD dwFlags, BOOL bMachine, BOOL bEnable);
|
|
|
|
|
2016-10-30 19:39:43 +00:00
|
|
|
/* hsdb.c */
|
2017-05-19 20:13:08 +00:00
|
|
|
BOOL WINAPI SdbGetMatchingExe(HSDB hsdb, LPCWSTR path, LPCWSTR module_name, LPCWSTR env, DWORD flags, PSDBQUERYRESULT result);
|
2016-10-30 19:39:43 +00:00
|
|
|
BOOL WINAPI SdbTagIDToTagRef(HSDB hsdb, PDB pdb, TAGID tiWhich, TAGREF* ptrWhich);
|
2017-07-01 20:06:30 +00:00
|
|
|
BOOL WINAPI SdbTagRefToTagID(HSDB hsdb, TAGREF trWhich, PDB* ppdb, TAGID* ptiWhich);
|
|
|
|
BOOL WINAPI SdbUnpackAppCompatData(HSDB hsdb, LPCWSTR pszImageName, PVOID pData, PSDBQUERYRESULT pQueryResult);
|
2016-04-09 21:40:32 +00:00
|
|
|
|
2016-05-01 19:12:06 +00:00
|
|
|
#define ATTRIBUTE_AVAILABLE 0x1
|
|
|
|
#define ATTRIBUTE_FAILED 0x2
|
|
|
|
|
2016-06-01 19:10:19 +00:00
|
|
|
#include "sdbtagid.h"
|
2016-04-24 13:05:00 +00:00
|
|
|
|
2016-03-31 12:54:05 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // extern "C"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // APPHELP_H
|