mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[APPHELP][APPHELP_APITEST] Add more db tests and implement SdbGetDatabaseVersion. CORE-10367
svn path=/trunk/; revision=71381
This commit is contained in:
parent
a6879a9948
commit
f03661d8e1
4 changed files with 791 additions and 31 deletions
|
@ -58,7 +58,7 @@
|
|||
@ stub SdbGetDatabaseInformation
|
||||
@ stub SdbGetDatabaseInformationByName
|
||||
@ stub SdbGetDatabaseMatch
|
||||
@ stub SdbGetDatabaseVersion
|
||||
@ stdcall SdbGetDatabaseVersion(wstr ptr ptr)
|
||||
@ stub SdbGetDllPath
|
||||
@ stub SdbGetEntryFlags
|
||||
@ stdcall SdbGetFileAttributes(wstr ptr ptr)
|
||||
|
|
|
@ -313,23 +313,14 @@ BOOL WINAPI SdbpCheckTagIDType(PDB db, TAGID tagid, WORD type)
|
|||
return SdbpCheckTagType(tag, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens specified shim database file.
|
||||
*
|
||||
* @param [in] path Path to the shim database.
|
||||
* @param [in] type Type of path. Either DOS_PATH or NT_PATH.
|
||||
*
|
||||
* @return Success: Handle to the shim database, NULL otherwise.
|
||||
*/
|
||||
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
|
||||
PDB SdbpOpenDatabase(LPCWSTR path, PATH_TYPE type, PDWORD major, PDWORD minor)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
IO_STATUS_BLOCK io;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
UNICODE_STRING str;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
IO_STATUS_BLOCK io;
|
||||
PDB db;
|
||||
NTSTATUS Status;
|
||||
BYTE header[12];
|
||||
DWORD dwRead = 0;
|
||||
|
||||
if (type == DOS_PATH)
|
||||
{
|
||||
|
@ -364,7 +355,14 @@ PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
|
|||
|
||||
db->size = GetFileSize(db->file, NULL);
|
||||
db->data = SdbAlloc(db->size);
|
||||
ReadFile(db->file, db->data, db->size, &dwRead, NULL);
|
||||
Status = NtReadFile(db->file, NULL, NULL, NULL, &io, db->data, db->size, NULL, NULL);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SdbCloseDatabase(db);
|
||||
SHIM_ERR("Failed to open shim database file: 0x%lx\n", Status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!SdbpReadData(db, &header, 0, 12))
|
||||
{
|
||||
|
@ -380,7 +378,31 @@ PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (*(DWORD*)&header[0] != (DWORD)2)
|
||||
*major = *(DWORD*)&header[0];
|
||||
*minor = *(DWORD*)&header[4];
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Opens specified shim database file.
|
||||
*
|
||||
* @param [in] path Path to the shim database.
|
||||
* @param [in] type Type of path. Either DOS_PATH or NT_PATH.
|
||||
*
|
||||
* @return Success: Handle to the shim database, NULL otherwise.
|
||||
*/
|
||||
PDB WINAPI SdbOpenDatabase(LPCWSTR path, PATH_TYPE type)
|
||||
{
|
||||
PDB db;
|
||||
DWORD major, minor;
|
||||
|
||||
db = SdbpOpenDatabase(path, type, &major, &minor);
|
||||
if (!db)
|
||||
return NULL;
|
||||
|
||||
if (major != 2)
|
||||
{
|
||||
SdbCloseDatabase(db);
|
||||
SHIM_ERR("Invalid shim database version\n");
|
||||
|
@ -493,6 +515,26 @@ BOOL WINAPI SdbGetStandardDatabaseGUID(DWORD Flags, GUID* Guid)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the database version from the specified database.
|
||||
*
|
||||
* @param [in] database The database.
|
||||
* @param [out] VersionHi The first part of the version number.
|
||||
* @param [out] VersionLo The second part of the version number.
|
||||
*
|
||||
* @return TRUE if it succeeds or fails, FALSE if ???
|
||||
*/
|
||||
BOOL WINAPI SdbGetDatabaseVersion(LPCWSTR database, PDWORD VersionHi, PDWORD VersionLo)
|
||||
{
|
||||
PDB db;
|
||||
|
||||
db = SdbpOpenDatabase(database, DOS_PATH, VersionHi, VersionLo);
|
||||
if (db)
|
||||
SdbCloseDatabase(db);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts specified tag into a string.
|
||||
*
|
||||
|
|
|
@ -571,3 +571,215 @@ void test_create_file_imp(const char* name, const char* contents, size_t len)
|
|||
}
|
||||
}
|
||||
|
||||
static unsigned char rawData[2356] = {
|
||||
0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x73, 0x64, 0x62, 0x66,
|
||||
0x02, 0x78, 0x3E, 0x01, 0x00, 0x00, 0x03, 0x78, 0x44, 0x00, 0x00, 0x00,
|
||||
0x02, 0x38, 0x07, 0x70, 0x03, 0x38, 0x01, 0x60, 0x16, 0x40, 0x01, 0x00,
|
||||
0x00, 0x00, 0x01, 0x98, 0x30, 0x00, 0x00, 0x00, 0x4C, 0x4C, 0x41, 0x5F,
|
||||
0x54, 0x53, 0x45, 0x54, 0xC6, 0x01, 0x00, 0x00, 0x53, 0x49, 0x44, 0x5F,
|
||||
0x54, 0x53, 0x45, 0x54, 0x56, 0x02, 0x00, 0x00, 0x57, 0x45, 0x4E, 0x5F,
|
||||
0x54, 0x53, 0x45, 0x54, 0xEC, 0x02, 0x00, 0x00, 0x4B, 0x32, 0x57, 0x5F,
|
||||
0x54, 0x53, 0x45, 0x54, 0x7C, 0x03, 0x00, 0x00, 0x03, 0x78, 0x0E, 0x00,
|
||||
0x00, 0x00, 0x02, 0x38, 0x07, 0x70, 0x03, 0x38, 0x0B, 0x60, 0x01, 0x98,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x02, 0x38,
|
||||
0x07, 0x70, 0x03, 0x38, 0x20, 0x60, 0x01, 0x98, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x02, 0x38, 0x04, 0x70, 0x03, 0x38,
|
||||
0x01, 0x60, 0x01, 0x98, 0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x26, 0x00,
|
||||
0x00, 0x00, 0x02, 0x38, 0x0D, 0x70, 0x03, 0x38, 0x15, 0x40, 0x01, 0x98,
|
||||
0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x74, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x50, 0x04, 0x00, 0x00, 0x03, 0x78, 0x14, 0x00, 0x00, 0x00, 0x02, 0x38,
|
||||
0x10, 0x70, 0x03, 0x38, 0x01, 0x60, 0x16, 0x40, 0x01, 0x00, 0x00, 0x00,
|
||||
0x01, 0x98, 0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x02, 0x38, 0x12, 0x70, 0x03, 0x38, 0x06, 0x90, 0x01, 0x98, 0x00, 0x00,
|
||||
0x00, 0x00, 0x03, 0x78, 0x14, 0x00, 0x00, 0x00, 0x02, 0x38, 0x12, 0x70,
|
||||
0x03, 0x38, 0x04, 0x90, 0x16, 0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x98,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x78, 0x3E, 0x00, 0x00, 0x00, 0x02, 0x38,
|
||||
0x07, 0x70, 0x03, 0x38, 0x04, 0x90, 0x01, 0x98, 0x30, 0x00, 0x00, 0x00,
|
||||
0xB5, 0x16, 0xDD, 0x96, 0xC9, 0x6B, 0xC5, 0x04, 0x7C, 0x03, 0x00, 0x00,
|
||||
0xCA, 0xA0, 0x3C, 0x5A, 0xDD, 0xFC, 0x99, 0x19, 0xC6, 0x01, 0x00, 0x00,
|
||||
0x72, 0xC6, 0xBB, 0xB9, 0x20, 0x71, 0xE3, 0x27, 0xEC, 0x02, 0x00, 0x00,
|
||||
0xBF, 0x27, 0xFB, 0xFF, 0x09, 0xB0, 0x4D, 0x8E, 0x56, 0x02, 0x00, 0x00,
|
||||
0x01, 0x70, 0x42, 0x03, 0x00, 0x00, 0x01, 0x50, 0x3E, 0x96, 0x3F, 0x00,
|
||||
0xE6, 0xF3, 0xD0, 0x01, 0x22, 0x60, 0x06, 0x00, 0x00, 0x00, 0x01, 0x60,
|
||||
0x1C, 0x00, 0x00, 0x00, 0x23, 0x40, 0x01, 0x00, 0x00, 0x00, 0x07, 0x90,
|
||||
0x10, 0x00, 0x00, 0x00, 0xB7, 0x9A, 0x98, 0x6E, 0x4D, 0x86, 0x75, 0x45,
|
||||
0x87, 0x34, 0x90, 0x36, 0x4A, 0xC6, 0x4F, 0xBD, 0x02, 0x70, 0x00, 0x00,
|
||||
0x00, 0x00, 0x0B, 0x70, 0x32, 0x00, 0x00, 0x00, 0x01, 0x60, 0x3E, 0x00,
|
||||
0x00, 0x00, 0x09, 0x70, 0x26, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x00,
|
||||
0x00, 0x00, 0x08, 0x60, 0x82, 0x00, 0x00, 0x00, 0x03, 0x70, 0x08, 0x00,
|
||||
0x00, 0x00, 0x01, 0x10, 0x03, 0x60, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x70,
|
||||
0x06, 0x00, 0x00, 0x00, 0x03, 0x60, 0xBE, 0x00, 0x00, 0x00, 0x07, 0x70,
|
||||
0x8A, 0x00, 0x00, 0x00, 0x01, 0x60, 0xDC, 0x00, 0x00, 0x00, 0x06, 0x60,
|
||||
0x00, 0x01, 0x00, 0x00, 0x05, 0x60, 0x2C, 0x01, 0x00, 0x00, 0x04, 0x90,
|
||||
0x10, 0x00, 0x00, 0x00, 0x52, 0x35, 0x26, 0x1A, 0x04, 0xE9, 0xB2, 0x41,
|
||||
0x98, 0x95, 0x1A, 0x40, 0xD9, 0x15, 0x2B, 0x58, 0x0D, 0x70, 0x24, 0x00,
|
||||
0x00, 0x00, 0x17, 0x40, 0x01, 0x00, 0x00, 0x00, 0x10, 0x40, 0x01, 0x00,
|
||||
0x00, 0x00, 0x15, 0x40, 0x04, 0x00, 0x00, 0x00, 0x24, 0x40, 0x78, 0x00,
|
||||
0x30, 0x00, 0x25, 0x40, 0x22, 0x00, 0x20, 0x00, 0x26, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0x70, 0x32, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x01,
|
||||
0x00, 0x00, 0x09, 0x60, 0x66, 0x01, 0x00, 0x00, 0x10, 0x60, 0x84, 0x01,
|
||||
0x00, 0x00, 0x11, 0x60, 0xA2, 0x01, 0x00, 0x00, 0x13, 0x60, 0xB8, 0x01,
|
||||
0x00, 0x00, 0x06, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x0D, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x70,
|
||||
0x90, 0x00, 0x00, 0x00, 0x01, 0x60, 0xCE, 0x01, 0x00, 0x00, 0x06, 0x60,
|
||||
0xF8, 0x01, 0x00, 0x00, 0x05, 0x60, 0x2A, 0x02, 0x00, 0x00, 0x04, 0x90,
|
||||
0x10, 0x00, 0x00, 0x00, 0x2D, 0xE0, 0x94, 0xAE, 0x00, 0x63, 0xE3, 0x4E,
|
||||
0x92, 0xC7, 0x6F, 0x51, 0x09, 0xD3, 0xAE, 0xC0, 0x0D, 0x70, 0x24, 0x00,
|
||||
0x00, 0x00, 0x17, 0x40, 0x01, 0x00, 0x00, 0x00, 0x10, 0x40, 0x02, 0x00,
|
||||
0x00, 0x00, 0x15, 0x40, 0x03, 0x00, 0x00, 0x00, 0x24, 0x40, 0x65, 0x00,
|
||||
0x20, 0x00, 0x25, 0x40, 0x00, 0x00, 0x00, 0x00, 0x26, 0x40, 0x00, 0x00,
|
||||
0x00, 0x00, 0x08, 0x70, 0x38, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x01,
|
||||
0x00, 0x00, 0x09, 0x60, 0x66, 0x01, 0x00, 0x00, 0x10, 0x60, 0x84, 0x01,
|
||||
0x00, 0x00, 0x11, 0x60, 0xA2, 0x01, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x50, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x0B, 0x40, 0x48, 0x18, 0x00, 0x00, 0x13, 0x60,
|
||||
0xB8, 0x01, 0x00, 0x00, 0x07, 0x70, 0x8A, 0x00, 0x00, 0x00, 0x01, 0x60,
|
||||
0x60, 0x02, 0x00, 0x00, 0x06, 0x60, 0x80, 0x02, 0x00, 0x00, 0x05, 0x60,
|
||||
0x9E, 0x02, 0x00, 0x00, 0x04, 0x90, 0x10, 0x00, 0x00, 0x00, 0xC0, 0x58,
|
||||
0x69, 0x5B, 0x84, 0x60, 0x7B, 0x4F, 0xB2, 0x9E, 0xD2, 0xE2, 0xA4, 0x11,
|
||||
0x98, 0x68, 0x08, 0x70, 0x32, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x01,
|
||||
0x00, 0x00, 0x09, 0x60, 0x66, 0x01, 0x00, 0x00, 0x10, 0x60, 0x84, 0x01,
|
||||
0x00, 0x00, 0x11, 0x60, 0xA2, 0x01, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x50, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x00, 0x13, 0x60, 0xB8, 0x01, 0x00, 0x00, 0x08, 0x70,
|
||||
0x12, 0x00, 0x00, 0x00, 0x01, 0x60, 0xC0, 0x02, 0x00, 0x00, 0x01, 0x40,
|
||||
0x04, 0x00, 0x00, 0x00, 0x03, 0x40, 0xB0, 0xB0, 0xB0, 0xB0, 0x0B, 0x70,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x01, 0x60, 0x3E, 0x00, 0x00, 0x00, 0x1A, 0x40,
|
||||
0x8E, 0x01, 0x00, 0x00, 0x07, 0x70, 0xCE, 0x00, 0x00, 0x00, 0x01, 0x60,
|
||||
0xEC, 0x02, 0x00, 0x00, 0x06, 0x60, 0x0E, 0x03, 0x00, 0x00, 0x05, 0x60,
|
||||
0x26, 0x03, 0x00, 0x00, 0x04, 0x90, 0x10, 0x00, 0x00, 0x00, 0x36, 0x9B,
|
||||
0x3E, 0x8A, 0xD0, 0xAF, 0xD0, 0x42, 0x83, 0x8D, 0xE3, 0x1C, 0x19, 0xC4,
|
||||
0x15, 0x46, 0x08, 0x70, 0x94, 0x00, 0x00, 0x00, 0x01, 0x60, 0x5C, 0x01,
|
||||
0x00, 0x00, 0x01, 0x40, 0x00, 0x08, 0x00, 0x00, 0x03, 0x40, 0xFE, 0x26,
|
||||
0x08, 0x55, 0x09, 0x60, 0x66, 0x01, 0x00, 0x00, 0x10, 0x60, 0x84, 0x01,
|
||||
0x00, 0x00, 0x11, 0x60, 0xA2, 0x01, 0x00, 0x00, 0x12, 0x60, 0x42, 0x03,
|
||||
0x00, 0x00, 0x02, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x03, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x40,
|
||||
0x03, 0x00, 0x00, 0x00, 0x09, 0x40, 0x04, 0x00, 0x00, 0x00, 0x0A, 0x40,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0B, 0x40, 0x48, 0x18, 0x00, 0x00, 0x1C, 0x40,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x60, 0xB8, 0x01, 0x00, 0x00, 0x14, 0x60,
|
||||
0x68, 0x03, 0x00, 0x00, 0x15, 0x60, 0x90, 0x03, 0x00, 0x00, 0x16, 0x60,
|
||||
0xB0, 0x03, 0x00, 0x00, 0x06, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x0D, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x1D, 0x40, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x40, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0B, 0x70, 0x06, 0x00, 0x00, 0x00, 0x01, 0x60, 0xD4, 0x03, 0x00, 0x00,
|
||||
0x0D, 0x70, 0x1E, 0x00, 0x00, 0x00, 0x15, 0x40, 0x04, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x70, 0x06, 0x00, 0x00, 0x00, 0x19, 0x60, 0xEC, 0x03, 0x00, 0x00,
|
||||
0x1B, 0x60, 0x00, 0x01, 0x00, 0x00, 0x18, 0x60, 0x24, 0x04, 0x00, 0x00,
|
||||
0x0D, 0x70, 0x1E, 0x00, 0x00, 0x00, 0x15, 0x40, 0x03, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x70, 0x06, 0x00, 0x00, 0x00, 0x19, 0x60, 0x3E, 0x04, 0x00, 0x00,
|
||||
0x1B, 0x60, 0xF8, 0x01, 0x00, 0x00, 0x18, 0x60, 0x7C, 0x04, 0x00, 0x00,
|
||||
0x01, 0x78, 0x96, 0x04, 0x00, 0x00, 0x01, 0x88, 0x10, 0x00, 0x00, 0x00,
|
||||
0x32, 0x00, 0x2E, 0x00, 0x31, 0x00, 0x2E, 0x00, 0x30, 0x00, 0x2E, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1C, 0x00, 0x00, 0x00, 0x61, 0x00,
|
||||
0x70, 0x00, 0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x70, 0x00,
|
||||
0x5F, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x31, 0x00,
|
||||
0x00, 0x00, 0x01, 0x88, 0x18, 0x00, 0x00, 0x00, 0x54, 0x00, 0x65, 0x00,
|
||||
0x73, 0x00, 0x74, 0x00, 0x4E, 0x00, 0x65, 0x00, 0x77, 0x00, 0x4D, 0x00,
|
||||
0x6F, 0x00, 0x64, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x20, 0x00,
|
||||
0x00, 0x00, 0x56, 0x00, 0x69, 0x00, 0x72, 0x00, 0x74, 0x00, 0x75, 0x00,
|
||||
0x61, 0x00, 0x6C, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x69, 0x00,
|
||||
0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x79, 0x00, 0x00, 0x00, 0x01, 0x88,
|
||||
0x18, 0x00, 0x00, 0x00, 0x54, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6D, 0x00,
|
||||
0x65, 0x00, 0x41, 0x00, 0x63, 0x00, 0x74, 0x00, 0x69, 0x00, 0x76, 0x00,
|
||||
0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x18, 0x00, 0x00, 0x00, 0x69, 0x00,
|
||||
0x6E, 0x00, 0x63, 0x00, 0x6C, 0x00, 0x75, 0x00, 0x64, 0x00, 0x65, 0x00,
|
||||
0x2E, 0x00, 0x64, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x01, 0x88,
|
||||
0x18, 0x00, 0x00, 0x00, 0x65, 0x00, 0x78, 0x00, 0x63, 0x00, 0x6C, 0x00,
|
||||
0x75, 0x00, 0x64, 0x00, 0x65, 0x00, 0x2E, 0x00, 0x64, 0x00, 0x6C, 0x00,
|
||||
0x6C, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1E, 0x00, 0x00, 0x00, 0x74, 0x00,
|
||||
0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x5F, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00,
|
||||
0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x26, 0x00, 0x00, 0x00, 0x61, 0x00,
|
||||
0x70, 0x00, 0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x70, 0x00,
|
||||
0x5F, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x5F, 0x00,
|
||||
0x61, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x00, 0x00,
|
||||
0x01, 0x88, 0x2A, 0x00, 0x00, 0x00, 0x61, 0x00, 0x70, 0x00, 0x70, 0x00,
|
||||
0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x70, 0x00, 0x5F, 0x00, 0x76, 0x00,
|
||||
0x65, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x5F, 0x00,
|
||||
0x61, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x00, 0x00,
|
||||
0x01, 0x88, 0x04, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x01, 0x88,
|
||||
0x18, 0x00, 0x00, 0x00, 0x43, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x70, 0x00,
|
||||
0x61, 0x00, 0x6E, 0x00, 0x79, 0x00, 0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00,
|
||||
0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x18, 0x00, 0x00, 0x00, 0x50, 0x00,
|
||||
0x72, 0x00, 0x6F, 0x00, 0x64, 0x00, 0x75, 0x00, 0x63, 0x00, 0x74, 0x00,
|
||||
0x4E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x88,
|
||||
0x10, 0x00, 0x00, 0x00, 0x31, 0x00, 0x2E, 0x00, 0x30, 0x00, 0x2E, 0x00,
|
||||
0x30, 0x00, 0x2E, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x88, 0x10, 0x00,
|
||||
0x00, 0x00, 0x31, 0x00, 0x2E, 0x00, 0x30, 0x00, 0x2E, 0x00, 0x30, 0x00,
|
||||
0x2E, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x88, 0x24, 0x00, 0x00, 0x00,
|
||||
0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x5F, 0x00, 0x64, 0x00,
|
||||
0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00,
|
||||
0x77, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00,
|
||||
0x01, 0x88, 0x2C, 0x00, 0x00, 0x00, 0x61, 0x00, 0x70, 0x00, 0x70, 0x00,
|
||||
0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x70, 0x00, 0x5F, 0x00, 0x6E, 0x00,
|
||||
0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x5F, 0x00, 0x64, 0x00, 0x69, 0x00,
|
||||
0x73, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00,
|
||||
0x00, 0x00, 0x01, 0x88, 0x30, 0x00, 0x00, 0x00, 0x61, 0x00, 0x70, 0x00,
|
||||
0x70, 0x00, 0x68, 0x00, 0x65, 0x00, 0x6C, 0x00, 0x70, 0x00, 0x5F, 0x00,
|
||||
0x76, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x6F, 0x00, 0x72, 0x00,
|
||||
0x5F, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1A, 0x00,
|
||||
0x00, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x5F, 0x00,
|
||||
0x6E, 0x00, 0x65, 0x00, 0x77, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00,
|
||||
0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x18, 0x00, 0x00, 0x00, 0x66, 0x00,
|
||||
0x69, 0x00, 0x78, 0x00, 0x6E, 0x00, 0x65, 0x00, 0x77, 0x00, 0x5F, 0x00,
|
||||
0x6E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x88,
|
||||
0x1C, 0x00, 0x00, 0x00, 0x66, 0x00, 0x69, 0x00, 0x78, 0x00, 0x6E, 0x00,
|
||||
0x65, 0x00, 0x77, 0x00, 0x5F, 0x00, 0x76, 0x00, 0x65, 0x00, 0x6E, 0x00,
|
||||
0x64, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x00, 0x00, 0x01, 0x88, 0x26, 0x00,
|
||||
0x00, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x5F, 0x00,
|
||||
0x63, 0x00, 0x68, 0x00, 0x65, 0x00, 0x63, 0x00, 0x6B, 0x00, 0x66, 0x00,
|
||||
0x69, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x2E, 0x00, 0x74, 0x00, 0x78, 0x00,
|
||||
0x74, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1C, 0x00, 0x00, 0x00, 0x74, 0x00,
|
||||
0x65, 0x00, 0x73, 0x00, 0x74, 0x00, 0x5F, 0x00, 0x77, 0x00, 0x32, 0x00,
|
||||
0x6B, 0x00, 0x33, 0x00, 0x2E, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00,
|
||||
0x00, 0x00, 0x01, 0x88, 0x12, 0x00, 0x00, 0x00, 0x66, 0x00, 0x69, 0x00,
|
||||
0x78, 0x00, 0x5F, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00,
|
||||
0x00, 0x00, 0x01, 0x88, 0x16, 0x00, 0x00, 0x00, 0x66, 0x00, 0x69, 0x00,
|
||||
0x78, 0x00, 0x5F, 0x00, 0x76, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x64, 0x00,
|
||||
0x6F, 0x00, 0x72, 0x00, 0x00, 0x00, 0x01, 0x88, 0x20, 0x00, 0x00, 0x00,
|
||||
0x46, 0x00, 0x69, 0x00, 0x6C, 0x00, 0x65, 0x00, 0x44, 0x00, 0x65, 0x00,
|
||||
0x73, 0x00, 0x63, 0x00, 0x72, 0x00, 0x69, 0x00, 0x70, 0x00, 0x74, 0x00,
|
||||
0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x00, 0x00, 0x01, 0x88, 0x22, 0x00,
|
||||
0x00, 0x00, 0x4F, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00,
|
||||
0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x46, 0x00, 0x69, 0x00, 0x6C, 0x00,
|
||||
0x65, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x00, 0x00,
|
||||
0x01, 0x88, 0x1A, 0x00, 0x00, 0x00, 0x49, 0x00, 0x6E, 0x00, 0x74, 0x00,
|
||||
0x65, 0x00, 0x72, 0x00, 0x6E, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x4E, 0x00,
|
||||
0x61, 0x00, 0x6D, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1E, 0x00,
|
||||
0x00, 0x00, 0x4C, 0x00, 0x65, 0x00, 0x67, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x43, 0x00, 0x6F, 0x00, 0x70, 0x00, 0x79, 0x00, 0x72, 0x00, 0x69, 0x00,
|
||||
0x67, 0x00, 0x68, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x88, 0x12, 0x00,
|
||||
0x00, 0x00, 0x57, 0x00, 0x69, 0x00, 0x6E, 0x00, 0x53, 0x00, 0x72, 0x00,
|
||||
0x76, 0x00, 0x30, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x88, 0x32, 0x00,
|
||||
0x00, 0x00, 0x68, 0x00, 0x74, 0x00, 0x74, 0x00, 0x70, 0x00, 0x3A, 0x00,
|
||||
0x2F, 0x00, 0x2F, 0x00, 0x72, 0x00, 0x65, 0x00, 0x61, 0x00, 0x63, 0x00,
|
||||
0x74, 0x00, 0x6F, 0x00, 0x73, 0x00, 0x2E, 0x00, 0x6F, 0x00, 0x72, 0x00,
|
||||
0x67, 0x00, 0x2F, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00,
|
||||
0x77, 0x00, 0x00, 0x00, 0x01, 0x88, 0x14, 0x00, 0x00, 0x00, 0x41, 0x00,
|
||||
0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x20, 0x00, 0x69, 0x00,
|
||||
0x74, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x88, 0x38, 0x00, 0x00, 0x00,
|
||||
0x68, 0x00, 0x74, 0x00, 0x74, 0x00, 0x70, 0x00, 0x3A, 0x00, 0x2F, 0x00,
|
||||
0x2F, 0x00, 0x72, 0x00, 0x65, 0x00, 0x61, 0x00, 0x63, 0x00, 0x74, 0x00,
|
||||
0x6F, 0x00, 0x73, 0x00, 0x2E, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x67, 0x00,
|
||||
0x2F, 0x00, 0x64, 0x00, 0x69, 0x00, 0x73, 0x00, 0x61, 0x00, 0x6C, 0x00,
|
||||
0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x00, 0x00, 0x01, 0x88, 0x1A, 0x00,
|
||||
0x00, 0x00, 0x4E, 0x00, 0x6F, 0x00, 0x74, 0x00, 0x20, 0x00, 0x61, 0x00,
|
||||
0x6C, 0x00, 0x6C, 0x00, 0x6F, 0x00, 0x77, 0x00, 0x65, 0x00, 0x64, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
void test_create_db(const char* name)
|
||||
{
|
||||
HANDLE file = CreateFileA(name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
ok(file != INVALID_HANDLE_VALUE, "can't create file\n");
|
||||
if(file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD size;
|
||||
WriteFile(file, rawData, sizeof(rawData), &size, NULL);
|
||||
CloseHandle(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
/* data.c */
|
||||
void test_create_db(const char* name);
|
||||
|
||||
typedef WORD TAG;
|
||||
typedef DWORD TAGID;
|
||||
typedef DWORD TAGREF;
|
||||
|
@ -61,21 +64,72 @@ typedef INT PATH_TYPE;
|
|||
#define TAG_TYPE_STRING 0x8000
|
||||
#define TAG_TYPE_BINARY 0x9000
|
||||
#define TAG_NULL 0x0
|
||||
#define TAG_SIZE (0x1 | TAG_TYPE_DWORD)
|
||||
|
||||
#define TAG_INCLUDE (0x1 | TAG_TYPE_NULL)
|
||||
|
||||
#define TAG_MATCH_MODE (0x1 | TAG_TYPE_WORD)
|
||||
|
||||
#define TAG_SIZE (0x1 | TAG_TYPE_DWORD)
|
||||
#define TAG_CHECKSUM (0x3 | TAG_TYPE_DWORD)
|
||||
#define TAG_MODULE_TYPE (0x6 | TAG_TYPE_DWORD)
|
||||
#define TAG_VERFILEOS (0x9 | TAG_TYPE_DWORD)
|
||||
#define TAG_VERFILETYPE (0xA | TAG_TYPE_DWORD)
|
||||
#define TAG_PE_CHECKSUM (0xB | TAG_TYPE_DWORD)
|
||||
#define TAG_PROBLEMSEVERITY (0x10 | TAG_TYPE_DWORD)
|
||||
#define TAG_HTMLHELPID (0x15 | TAG_TYPE_DWORD)
|
||||
#define TAG_FLAGS (0x17 | TAG_TYPE_DWORD)
|
||||
#define TAG_LAYER_TAGID (0x1A | TAG_TYPE_DWORD)
|
||||
#define TAG_LINKER_VERSION (0x1C | TAG_TYPE_DWORD)
|
||||
#define TAG_LINK_DATE (0x1D | TAG_TYPE_DWORD)
|
||||
#define TAG_UPTO_LINK_DATE (0x1E | TAG_TYPE_DWORD)
|
||||
#define TAG_APP_NAME_RC_ID (0x24 | TAG_TYPE_DWORD)
|
||||
#define TAG_VENDOR_NAME_RC_ID (0x25 | TAG_TYPE_DWORD)
|
||||
#define TAG_SUMMARY_MSG_RC_ID (0x26 | TAG_TYPE_DWORD)
|
||||
#define TAG_OS_PLATFORM (0x23 | TAG_TYPE_DWORD)
|
||||
|
||||
#define TAG_TIME (0x1 | TAG_TYPE_QWORD)
|
||||
#define TAG_BIN_FILE_VERSION (0x2 | TAG_TYPE_QWORD)
|
||||
#define TAG_BIN_PRODUCT_VERSION (0x3 | TAG_TYPE_QWORD)
|
||||
#define TAG_UPTO_BIN_PRODUCT_VERSION (0x6 | TAG_TYPE_QWORD)
|
||||
#define TAG_UPTO_BIN_FILE_VERSION (0xD | TAG_TYPE_QWORD)
|
||||
#define TAG_FLAG_LUA (0x10 | TAG_TYPE_QWORD)
|
||||
|
||||
#define TAG_DATABASE (0x1 | TAG_TYPE_LIST)
|
||||
#define TAG_INEXCLUD (0x3 | TAG_TYPE_LIST)
|
||||
#define TAG_EXE (0x7 | TAG_TYPE_LIST)
|
||||
#define TAG_MATCHING_FILE (0x8 | TAG_TYPE_LIST)
|
||||
#define TAG_SHIM_REF (0x9| TAG_TYPE_LIST)
|
||||
#define TAG_LAYER (0xB | TAG_TYPE_LIST)
|
||||
#define TAG_APPHELP (0xD | TAG_TYPE_LIST)
|
||||
#define TAG_LINK (0xE | TAG_TYPE_LIST)
|
||||
#define TAG_STRINGTABLE (0x801 | TAG_TYPE_LIST)
|
||||
|
||||
#define TAG_NAME (0x1 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_STRINGTABLE_ITEM (0x801 | TAG_TYPE_STRING)
|
||||
|
||||
#define TAG_NAME (0x1 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_MODULE (0x3 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_VENDOR (0x5 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_APP_NAME (0x6 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_COMMAND_LINE (0x8 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_COMPANY_NAME (0x9 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_PRODUCT_NAME (0x10 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_PRODUCT_VERSION (0x11 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_FILE_DESCRIPTION (0x12 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_FILE_VERSION (0x13 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_ORIGINAL_FILENAME (0x14 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_INTERNAL_NAME (0x15 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_LEGAL_COPYRIGHT (0x16 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_APPHELP_DETAILS (0x18 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_LINK_URL (0x19 | TAG_TYPE_STRINGREF)
|
||||
#define TAG_APPHELP_TITLE (0x1B | TAG_TYPE_STRINGREF)
|
||||
|
||||
#define TAG_COMPILER_VERSION (0x22 | TAG_TYPE_STRINGREF)
|
||||
|
||||
#define TAG_GENERAL (0x2 | TAG_TYPE_NULL)
|
||||
|
||||
#define TAG_EXE_ID (0x4 | TAG_TYPE_BINARY)
|
||||
#define TAG_DATA_BITS (0x5 | TAG_TYPE_BINARY)
|
||||
#define TAG_DATABASE_ID (0x7 | TAG_TYPE_BINARY)
|
||||
|
||||
|
||||
|
||||
|
@ -83,6 +137,7 @@ static HMODULE hdll;
|
|||
static LPCWSTR (WINAPI *pSdbTagToString)(TAG);
|
||||
static PDB (WINAPI *pSdbOpenDatabase)(LPCWSTR, PATH_TYPE);
|
||||
static PDB (WINAPI *pSdbCreateDatabase)(LPCWSTR, PATH_TYPE);
|
||||
static BOOL (WINAPI *pSdbGetDatabaseVersion)(LPCWSTR, PDWORD, PDWORD);
|
||||
static void (WINAPI *pSdbCloseDatabase)(PDB);
|
||||
static void (WINAPI *pSdbCloseDatabaseWrite)(PDB);
|
||||
static TAG (WINAPI *pSdbGetTagFromTagID)(PDB, TAGID);
|
||||
|
@ -95,6 +150,8 @@ static BOOL (WINAPI *pSdbWriteStringTag)(PDB, TAG, LPCWSTR);
|
|||
static BOOL (WINAPI *pSdbWriteStringRefTag)(PDB, TAG, TAGID);
|
||||
static TAGID (WINAPI *pSdbBeginWriteListTag)(PDB, TAG);
|
||||
static BOOL (WINAPI *pSdbEndWriteListTag)(PDB, TAGID);
|
||||
static TAGID (WINAPI *pSdbFindFirstTag)(PDB, TAGID, TAG);
|
||||
static TAGID (WINAPI *pSdbFindNextTag)(PDB, TAGID, TAGID);
|
||||
static WORD (WINAPI *pSdbReadWORDTag)(PDB, TAGID, WORD);
|
||||
static DWORD (WINAPI *pSdbReadDWORDTag)(PDB, TAGID, DWORD);
|
||||
static QWORD (WINAPI *pSdbReadQWORDTag)(PDB, TAGID, QWORD);
|
||||
|
@ -105,6 +162,8 @@ static PVOID (WINAPI *pSdbGetBinaryTagData)(PDB, TAGID);
|
|||
static LPWSTR (WINAPI *pSdbGetStringTagPtr)(PDB, TAGID);
|
||||
static TAGID (WINAPI *pSdbGetFirstChild)(PDB, TAGID);
|
||||
static TAGID (WINAPI *pSdbGetNextChild)(PDB, TAGID, TAGID);
|
||||
static BOOL (WINAPI *pSdbGetDatabaseID)(PDB, GUID*);
|
||||
static BOOL (WINAPI *pSdbGUIDToString)(CONST GUID *, PCWSTR, SIZE_T);
|
||||
|
||||
static void Write(HANDLE file, LPCVOID buffer, DWORD size)
|
||||
{
|
||||
|
@ -114,8 +173,9 @@ static void Write(HANDLE file, LPCVOID buffer, DWORD size)
|
|||
|
||||
static void test_Sdb(void)
|
||||
{
|
||||
static const WCHAR path[] = {'t','e','m','p',0};
|
||||
static const WCHAR path2[] = {'t','e','m','p','2',0};
|
||||
static const WCHAR temp[] = {'t','e','m','p',0};
|
||||
static const WCHAR path1[] = {'t','e','m','p','.','s','d','b',0};
|
||||
static const WCHAR path2[] = {'t','e','m','p','2','.','b','i','n',0};
|
||||
static const WCHAR tag_size_string[] = {'S','I','Z','E',0};
|
||||
static const WCHAR tag_flag_lua_string[] = {'F','L','A','G','_','L','U','A',0};
|
||||
static const TAG tags[5] = {
|
||||
|
@ -134,7 +194,7 @@ static void test_Sdb(void)
|
|||
LPCWSTR string;
|
||||
PBYTE binary;
|
||||
|
||||
pdb = pSdbCreateDatabase(path, DOS_PATH);
|
||||
pdb = pSdbCreateDatabase(path1, DOS_PATH);
|
||||
ok (pdb != NULL, "failed to create database\n");
|
||||
if(pdb != NULL)
|
||||
{
|
||||
|
@ -146,7 +206,7 @@ static void test_Sdb(void)
|
|||
ok (ret, "failed to write stringref tag\n");
|
||||
tagid = pSdbBeginWriteListTag(pdb, tags[3]);
|
||||
ok (tagid != TAGID_NULL, "unexpected NULL tagid\n");
|
||||
ret = pSdbWriteStringTag(pdb, tags[4], path);
|
||||
ret = pSdbWriteStringTag(pdb, tags[4], temp);
|
||||
ok (ret, "failed to write string tag\n");
|
||||
ret = pSdbWriteNULLTag(pdb, TAG_GENERAL);
|
||||
ok (ret, "failed to write NULL tag\n");
|
||||
|
@ -159,7 +219,7 @@ static void test_Sdb(void)
|
|||
}
|
||||
|
||||
/* [Err ][SdbGetDatabaseID ] Failed to get root tag */
|
||||
pdb = pSdbOpenDatabase(path, DOS_PATH);
|
||||
pdb = pSdbOpenDatabase(path1, DOS_PATH);
|
||||
ok(pdb != NULL, "unexpected NULL handle\n");
|
||||
|
||||
if(pdb)
|
||||
|
@ -193,15 +253,15 @@ static void test_Sdb(void)
|
|||
|
||||
tagid = pSdbGetNextChild(pdb, TAGID_ROOT, tagid);
|
||||
string = pSdbGetStringTagPtr(pdb, tagid);
|
||||
ok (string && (lstrcmpW(string, path) == 0), "unexpected string %s, expected %s\n",
|
||||
wine_dbgstr_w(string), wine_dbgstr_w(path));
|
||||
ok (string && (lstrcmpW(string, temp) == 0), "unexpected string %s, expected %s\n",
|
||||
wine_dbgstr_w(string), wine_dbgstr_w(temp));
|
||||
|
||||
ptagid = pSdbGetNextChild(pdb, TAGID_ROOT, tagid);
|
||||
tagid = pSdbGetFirstChild(pdb, ptagid);
|
||||
|
||||
string = pSdbGetStringTagPtr(pdb, tagid);
|
||||
ok (string && (lstrcmpW(string, path) == 0), "unexpected string %s, expected %s\n",
|
||||
wine_dbgstr_w(string), wine_dbgstr_w(path));
|
||||
ok (string && (lstrcmpW(string, temp) == 0), "unexpected string %s, expected %s\n",
|
||||
wine_dbgstr_w(string), wine_dbgstr_w(temp));
|
||||
|
||||
ok (pSdbReadStringTag(pdb, tagid, buffer, 6), "failed to write string to buffer\n");
|
||||
/* [Err ][SdbpReadTagData ] Buffer too small. Avail: 6, Need: 10. */
|
||||
|
@ -219,14 +279,14 @@ static void test_Sdb(void)
|
|||
|
||||
pSdbCloseDatabase(pdb);
|
||||
}
|
||||
DeleteFileW(path);
|
||||
DeleteFileW(path1);
|
||||
|
||||
file = CreateFileW(path2, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
ok (file != INVALID_HANDLE_VALUE, "failed to open file\n");
|
||||
Write(file, &qword, 8);
|
||||
CloseHandle(file);
|
||||
|
||||
pdb = pSdbCreateDatabase(path, DOS_PATH);
|
||||
pdb = pSdbCreateDatabase(path1, DOS_PATH);
|
||||
ok(pdb != NULL, "unexpected NULL handle\n");
|
||||
|
||||
if(pdb)
|
||||
|
@ -236,7 +296,7 @@ static void test_Sdb(void)
|
|||
pSdbCloseDatabaseWrite(pdb); /* [Err ][SdbCloseDatabase ] Failed to close the file. */
|
||||
DeleteFileW(path2);
|
||||
|
||||
pdb = pSdbOpenDatabase(path, DOS_PATH);
|
||||
pdb = pSdbOpenDatabase(path1, DOS_PATH);
|
||||
ok(pdb != NULL, "unexpected NULL handle\n");
|
||||
binary = pSdbGetBinaryTagData(pdb, _TAGID_ROOT);
|
||||
ok(memcmp(binary, &qword, 8) == 0, "binary data is corrupt\n");
|
||||
|
@ -245,7 +305,447 @@ static void test_Sdb(void)
|
|||
ok(memcmp(buffer, &qword, 8) == 0, "binary data is corrupt\n");
|
||||
pSdbCloseDatabase(pdb);
|
||||
}
|
||||
DeleteFileW(path);
|
||||
DeleteFileW(path1);
|
||||
}
|
||||
|
||||
static void match_str_attr_imp(PDB pdb, TAGID parent, TAG find, const char* compare)
|
||||
{
|
||||
TAGID attr = pSdbFindFirstTag(pdb, parent, find);
|
||||
winetest_ok(attr != TAG_NULL, "Could not find: %x\n", find);
|
||||
if (attr != TAG_NULL)
|
||||
{
|
||||
LPWSTR name = pSdbGetStringTagPtr(pdb, attr);
|
||||
winetest_ok(name != NULL, "Could not convert attr to str.\n");
|
||||
if (name)
|
||||
{
|
||||
char name_a[100];
|
||||
WideCharToMultiByte(CP_ACP, 0, name, -1, name_a, sizeof(name_a), NULL, NULL);
|
||||
winetest_ok(strcmp(name_a, compare) == 0, "Expected tagid %x to be %s, was %s\n", attr, compare, name_a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void match_dw_attr_imp(PDB pdb, TAGID parent, TAG find, DWORD compare)
|
||||
{
|
||||
TAGID attr = pSdbFindFirstTag(pdb, parent, find);
|
||||
winetest_ok(attr != TAG_NULL, "Could not find: %x\n", find);
|
||||
if (attr != TAG_NULL)
|
||||
{
|
||||
DWORD val = pSdbReadDWORDTag(pdb, attr, 0x1234567);
|
||||
winetest_ok(val == compare, "Expected tagid %x to be 0x%x, was 0x%x\n", attr, compare, val);
|
||||
}
|
||||
}
|
||||
|
||||
static void match_qw_attr_imp(PDB pdb, TAGID parent, TAG find, QWORD compare)
|
||||
{
|
||||
TAGID attr = pSdbFindFirstTag(pdb, parent, find);
|
||||
winetest_ok(attr != TAG_NULL, "Could not find: %x\n", find);
|
||||
if (attr != TAG_NULL)
|
||||
{
|
||||
QWORD val = pSdbReadQWORDTag(pdb, attr, 0x123456789abcdef);
|
||||
winetest_ok(val == compare, "Expected tagid %x to be 0x%I64x, was 0x%I64x\n", attr, compare, val);
|
||||
}
|
||||
}
|
||||
|
||||
static void match_guid_attr_imp(PDB pdb, TAGID parent, TAG find, const GUID* compare)
|
||||
{
|
||||
TAGID attr = pSdbFindFirstTag(pdb, parent, find);
|
||||
winetest_ok(attr != TAG_NULL, "Could not find: %x\n", find);
|
||||
if (attr != TAG_NULL)
|
||||
{
|
||||
GUID guid = {0};
|
||||
BOOL result = pSdbReadBinaryTag(pdb, attr, (PBYTE)&guid, sizeof(guid));
|
||||
winetest_ok(result, "expected pSdbReadBinaryTag not to fail.\n");
|
||||
winetest_ok(IsEqualGUID(&guid, compare), "expected guids to be equal(%s:%s)\n", wine_dbgstr_guid(&guid), wine_dbgstr_guid(compare));
|
||||
}
|
||||
}
|
||||
|
||||
#define match_str_attr (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : match_str_attr_imp
|
||||
#define match_dw_attr (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : match_dw_attr_imp
|
||||
#define match_qw_attr (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : match_qw_attr_imp
|
||||
#define match_guid_attr (winetest_set_location(__FILE__, __LINE__), 0) ? (void)0 : match_guid_attr_imp
|
||||
|
||||
|
||||
//The application name cannot contain any of the following characters:
|
||||
// \ / < > : * ? | "
|
||||
|
||||
static void check_db_properties(PDB pdb, TAGID root)
|
||||
{
|
||||
TAGID iter = pSdbFindFirstTag(pdb, root, TAG_DATABASE_ID);
|
||||
ok(iter != TAGID_NULL, "expected a result, got TAGID_NULL\n");
|
||||
if(iter != TAGID_NULL)
|
||||
{
|
||||
GUID guid = {0}, guid2 = {0};
|
||||
BOOL result = pSdbReadBinaryTag(pdb, iter, (PBYTE)&guid, sizeof(guid));
|
||||
ok(result, "expected SdbReadBinaryTag not to fail.\n");
|
||||
if(result)
|
||||
{
|
||||
WCHAR guid_wstr[50];
|
||||
result = pSdbGUIDToString(&guid, guid_wstr, 50);
|
||||
ok(result, "expected SdbGUIDToString not to fail.\n");
|
||||
if(result)
|
||||
{
|
||||
char guid_str[50];
|
||||
WideCharToMultiByte( CP_ACP, 0, guid_wstr, -1, guid_str, sizeof(guid_str), NULL, NULL );
|
||||
ok_str(guid_str, "{6e989ab7-864d-4575-8734-90364ac64fbd}");
|
||||
}
|
||||
ok(pSdbGetDatabaseID(pdb, &guid2),"expected SdbGetDatabaseID not to fail.\n");
|
||||
ok(IsEqualGUID(&guid, &guid2), "expected guids to be equal(%s:%s)\n", wine_dbgstr_guid(&guid), wine_dbgstr_guid(&guid2));
|
||||
}
|
||||
}
|
||||
match_qw_attr(pdb, root, TAG_TIME, 0x1d0f3e6003f963e);
|
||||
match_str_attr(pdb, root, TAG_COMPILER_VERSION, "2.1.0.3");
|
||||
match_str_attr(pdb, root, TAG_NAME, "apphelp_test1");
|
||||
match_dw_attr(pdb, root, TAG_OS_PLATFORM, 1);
|
||||
}
|
||||
|
||||
static void check_db_layer(PDB pdb, TAGID layer)
|
||||
{
|
||||
TAGID shimref, inexclude, is_include;
|
||||
ok(layer != TAGID_NULL, "Expected a valid layer, got NULL\n");
|
||||
if(!layer)
|
||||
return;
|
||||
|
||||
match_str_attr(pdb, layer, TAG_NAME, "TestNewMode");
|
||||
shimref = pSdbFindFirstTag(pdb, layer, TAG_SHIM_REF);
|
||||
ok(shimref != TAGID_NULL, "Expected a valid shim ref, got NULL\n");
|
||||
if(!shimref)
|
||||
return;
|
||||
|
||||
match_str_attr(pdb, shimref, TAG_NAME, "VirtualRegistry");
|
||||
match_str_attr(pdb, shimref, TAG_COMMAND_LINE, "ThemeActive");
|
||||
inexclude = pSdbFindFirstTag(pdb, shimref, TAG_INEXCLUD);
|
||||
ok(inexclude != TAGID_NULL, "Expected a valid in/exclude ref, got NULL\n");
|
||||
if(!inexclude)
|
||||
return;
|
||||
|
||||
is_include = pSdbFindFirstTag(pdb, inexclude, TAG_INCLUDE);
|
||||
ok(is_include != TAGID_NULL, "Expected a valid include ref, got NULL\n");
|
||||
match_str_attr(pdb, inexclude, TAG_MODULE, "include.dll");
|
||||
|
||||
inexclude = pSdbFindNextTag(pdb, shimref, inexclude);
|
||||
ok(inexclude != TAGID_NULL, "Expected a valid in/exclude ref, got NULL\n");
|
||||
if(!inexclude)
|
||||
return;
|
||||
|
||||
is_include = pSdbFindFirstTag(pdb, inexclude, TAG_INCLUDE);
|
||||
ok(is_include == TAGID_NULL, "Expected a NULL include ref, but got one anyway.\n");
|
||||
match_str_attr(pdb, inexclude, TAG_MODULE, "exclude.dll");
|
||||
}
|
||||
|
||||
static void check_matching_file(PDB pdb, TAGID exe, TAGID matching_file, int num)
|
||||
{
|
||||
ok(matching_file != TAGID_NULL, "Expected to find atleast 1 matching file.\n");
|
||||
if(matching_file == TAGID_NULL)
|
||||
return;
|
||||
|
||||
ok(num < 4, "Too many matches, expected only 4!\n");
|
||||
if (num >= 4)
|
||||
return;
|
||||
|
||||
|
||||
match_str_attr(pdb, matching_file, TAG_NAME, "*");
|
||||
match_str_attr(pdb, matching_file, TAG_COMPANY_NAME, "CompanyName");
|
||||
match_str_attr(pdb, matching_file, TAG_PRODUCT_NAME, "ProductName");
|
||||
match_str_attr(pdb, matching_file, TAG_PRODUCT_VERSION, "1.0.0.1");
|
||||
match_str_attr(pdb, matching_file, TAG_FILE_VERSION, "1.0.0.0");
|
||||
|
||||
if( num == 0 || num == 3)
|
||||
{
|
||||
match_qw_attr(pdb, matching_file, TAG_UPTO_BIN_PRODUCT_VERSION, 0x1000000000001);
|
||||
match_qw_attr(pdb, matching_file, TAG_UPTO_BIN_FILE_VERSION, 0x1000000000000);
|
||||
}
|
||||
if(num == 1 || num == 3)
|
||||
{
|
||||
match_dw_attr(pdb, matching_file, TAG_PE_CHECKSUM, 0x1848);
|
||||
}
|
||||
if(num != 0)
|
||||
{
|
||||
match_qw_attr(pdb, matching_file, TAG_BIN_PRODUCT_VERSION, 0x1000000000001);
|
||||
match_qw_attr(pdb, matching_file, TAG_BIN_FILE_VERSION, 0x1000000000000);
|
||||
}
|
||||
if(num == 3)
|
||||
{
|
||||
match_dw_attr(pdb, matching_file, TAG_SIZE, 0x800);
|
||||
match_dw_attr(pdb, matching_file, TAG_CHECKSUM, 0x550826fe);
|
||||
match_str_attr(pdb, matching_file, TAG_FILE_DESCRIPTION, "FileDescription");
|
||||
match_dw_attr(pdb, matching_file, TAG_MODULE_TYPE, 3);
|
||||
match_dw_attr(pdb, matching_file, TAG_VERFILEOS, 4);
|
||||
match_dw_attr(pdb, matching_file, TAG_VERFILETYPE, 1);
|
||||
match_dw_attr(pdb, matching_file, TAG_LINKER_VERSION, 0);
|
||||
match_str_attr(pdb, matching_file, TAG_ORIGINAL_FILENAME, "OriginalFilename");
|
||||
match_str_attr(pdb, matching_file, TAG_INTERNAL_NAME, "InternalName");
|
||||
match_str_attr(pdb, matching_file, TAG_LEGAL_COPYRIGHT, "LegalCopyright");
|
||||
match_dw_attr(pdb, matching_file, TAG_LINK_DATE, 0);
|
||||
match_dw_attr(pdb, matching_file, TAG_UPTO_LINK_DATE, 0);
|
||||
}
|
||||
if(num > 3)
|
||||
{
|
||||
ok(0, "unknown case: %d\n", num);
|
||||
}
|
||||
matching_file = pSdbFindNextTag(pdb, exe, matching_file);
|
||||
if(num == 2)
|
||||
{
|
||||
ok(matching_file != TAGID_NULL, "Did expect a secondary match on %d\n", num);
|
||||
match_str_attr(pdb, matching_file, TAG_NAME, "test_checkfile.txt");
|
||||
match_dw_attr(pdb, matching_file, TAG_SIZE, 0x4);
|
||||
match_dw_attr(pdb, matching_file, TAG_CHECKSUM, 0xb0b0b0b0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(matching_file == TAGID_NULL, "Did not expect a secondary match on %d\n", num);
|
||||
}
|
||||
}
|
||||
|
||||
static void check_matching_apphelp(PDB pdb, TAGID apphelp, int num)
|
||||
{
|
||||
if(num == 0)
|
||||
{
|
||||
/*
|
||||
[Window Title]
|
||||
Program Compatibility Assistant
|
||||
|
||||
[Main Instruction]
|
||||
This program has known compatibility issues
|
||||
|
||||
[Expanded Information]
|
||||
Allow it!
|
||||
|
||||
[^] Hide details [ ] Don't show this message again [Check for solutions online] [Run program] [Cancel]
|
||||
*/
|
||||
match_dw_attr(pdb, apphelp, TAG_FLAGS, 1);
|
||||
match_dw_attr(pdb, apphelp, TAG_PROBLEMSEVERITY, 1);
|
||||
match_dw_attr(pdb, apphelp, TAG_HTMLHELPID, 4);
|
||||
match_dw_attr(pdb, apphelp, TAG_APP_NAME_RC_ID, 0x300078);
|
||||
match_dw_attr(pdb, apphelp, TAG_VENDOR_NAME_RC_ID, 0x200022);
|
||||
match_dw_attr(pdb, apphelp, TAG_SUMMARY_MSG_RC_ID, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
[Window Title]
|
||||
Program Compatibility Assistant
|
||||
|
||||
[Main Instruction]
|
||||
This program is blocked due to compatibility issues
|
||||
|
||||
[Expanded Information]
|
||||
Not allowed!
|
||||
|
||||
[^] Hide details [Check for solutions online] [Cancel]
|
||||
*/
|
||||
match_dw_attr(pdb, apphelp, TAG_FLAGS, 1);
|
||||
match_dw_attr(pdb, apphelp, TAG_PROBLEMSEVERITY, 2);
|
||||
match_dw_attr(pdb, apphelp, TAG_HTMLHELPID, 3);
|
||||
match_dw_attr(pdb, apphelp, TAG_APP_NAME_RC_ID, 0x200065);
|
||||
match_dw_attr(pdb, apphelp, TAG_VENDOR_NAME_RC_ID, 0);
|
||||
match_dw_attr(pdb, apphelp, TAG_SUMMARY_MSG_RC_ID, 0);
|
||||
}
|
||||
apphelp = pSdbFindNextTag(pdb, apphelp, apphelp);
|
||||
ok(apphelp == TAGID_NULL, "Did not expect a secondary match on %d\n", num);
|
||||
}
|
||||
|
||||
static void check_matching_layer(PDB pdb, TAGID layer, int num)
|
||||
{
|
||||
if(num == 2)
|
||||
{
|
||||
match_dw_attr(pdb, layer, TAG_LAYER_TAGID, 0x18e);
|
||||
match_str_attr(pdb, layer, TAG_NAME, "TestNewMode");
|
||||
}
|
||||
else
|
||||
{
|
||||
TAGID layer_tagid = pSdbFindFirstTag(pdb, layer, TAG_LAYER_TAGID);
|
||||
ok(layer_tagid == TAGID_NULL, "expected not to find a layer tagid, got %x\n", layer_tagid);
|
||||
match_str_attr(pdb, layer, TAG_NAME, "WinSrv03");
|
||||
}
|
||||
}
|
||||
|
||||
static struct
|
||||
{
|
||||
const char* name;
|
||||
const char* app_name;
|
||||
const char* vendor;
|
||||
GUID exe_id;
|
||||
const char* extra_file;
|
||||
DWORD dwLayerCount;
|
||||
TAGREF atrExes_0;
|
||||
TAGREF atrLayers_0;
|
||||
} test_exedata[4] = {
|
||||
{
|
||||
"test_allow.exe",
|
||||
"apphelp_name_allow",
|
||||
"apphelp_vendor_allow",
|
||||
{0x1a263552,0xe904,0x41b2,{0x98,0x95,0x1a,0x40,0xd9,0x15,0x2b,0x58}},
|
||||
NULL,
|
||||
0,
|
||||
0x1c6,
|
||||
0,
|
||||
},
|
||||
{
|
||||
"test_disallow.exe",
|
||||
"apphelp_name_disallow",
|
||||
"apphelp_vendor_disallow",
|
||||
{0xae94e02d,0x6300,0x4ee3,{0x92,0xc7,0x6f,0x51,0x09,0xd3,0xae,0xc0}},
|
||||
NULL,
|
||||
0,
|
||||
0x256,
|
||||
0,
|
||||
},
|
||||
{
|
||||
"test_new.exe",
|
||||
"fixnew_name",
|
||||
"fixnew_vendor",
|
||||
{0x5b6958c0,0x6084,0x4f7b,{0xb2,0x9e,0xd2,0xe2,0xa4,0x11,0x98,0x68}},
|
||||
"test_checkfile.txt",
|
||||
1,
|
||||
0x2ec,
|
||||
0x18e,
|
||||
},
|
||||
{
|
||||
"test_w2k3.exe",
|
||||
"fix_name",
|
||||
"fix_vendor",
|
||||
{0x8a3e9b36,0xafd0,0x42d0,{0x83,0x8d,0xe3,0x1c,0x19,0xc4,0x15,0x46}},
|
||||
NULL,
|
||||
0,
|
||||
0x37c,
|
||||
0,
|
||||
},
|
||||
};
|
||||
|
||||
static void check_db_exes(PDB pdb, TAGID root)
|
||||
{
|
||||
int num = 0;
|
||||
TAGID exe = pSdbFindFirstTag(pdb, root, TAG_EXE);
|
||||
while (exe != TAGID_NULL)
|
||||
{
|
||||
TAGID apphelp, layer;
|
||||
ok(num < 4, "Too many matches, expected only 4!\n");
|
||||
if(num >= 4)
|
||||
break;
|
||||
match_str_attr(pdb, exe, TAG_NAME, test_exedata[num].name);
|
||||
match_str_attr(pdb, exe, TAG_APP_NAME, test_exedata[num].app_name);
|
||||
match_str_attr(pdb, exe, TAG_VENDOR, test_exedata[num].vendor);
|
||||
match_guid_attr(pdb, exe, TAG_EXE_ID, &test_exedata[num].exe_id);
|
||||
check_matching_file(pdb, exe, pSdbFindFirstTag(pdb, exe, TAG_MATCHING_FILE), num);
|
||||
apphelp = pSdbFindFirstTag(pdb, exe, TAG_APPHELP);
|
||||
if(num == 0 || num == 1)
|
||||
{
|
||||
ok(apphelp != TAGID_NULL, "Expected to find a valid apphelp match on %d.\n", num);
|
||||
if(apphelp)
|
||||
check_matching_apphelp(pdb, apphelp, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(apphelp == TAGID_NULL, "Did not expect an apphelp match on %d\n", num);
|
||||
}
|
||||
layer = pSdbFindFirstTag(pdb, exe, TAG_LAYER);
|
||||
if(num == 2 || num == 3)
|
||||
{
|
||||
ok(layer != TAGID_NULL, "Expected to find a valid layer match on %d.\n", num);
|
||||
if(layer)
|
||||
check_matching_layer(pdb, layer, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
ok(layer == TAGID_NULL, "Did not expect a layer match on %d\n", num);
|
||||
}
|
||||
++num;
|
||||
exe = pSdbFindNextTag(pdb, root, exe);
|
||||
}
|
||||
ok(num == 4, "Expected to find 4 exe tags, found: %d\n", num);
|
||||
}
|
||||
|
||||
static struct
|
||||
{
|
||||
DWORD htmlhelpid;
|
||||
const char* link;
|
||||
const char* apphelp_title;
|
||||
const char* apphelp_details;
|
||||
} test_layerdata[2] = {
|
||||
{
|
||||
4,
|
||||
"http://reactos.org/allow",
|
||||
"apphelp_name_allow",
|
||||
"Allow it!",
|
||||
},
|
||||
{
|
||||
3,
|
||||
"http://reactos.org/disallow",
|
||||
"apphelp_name_disallow",
|
||||
"Not allowed!",
|
||||
},
|
||||
};
|
||||
|
||||
static void check_db_apphelp(PDB pdb, TAGID root)
|
||||
{
|
||||
int num = 0;
|
||||
TAGID apphelp = pSdbFindFirstTag(pdb, root, TAG_APPHELP);
|
||||
while (apphelp != TAGID_NULL)
|
||||
{
|
||||
TAGID link;
|
||||
ok(num < 2, "Too many matches, expected only 4!\n");
|
||||
if(num >= 2)
|
||||
break;
|
||||
match_dw_attr(pdb, apphelp, TAG_HTMLHELPID, test_layerdata[num].htmlhelpid);
|
||||
link = pSdbFindFirstTag(pdb, apphelp, TAG_LINK);
|
||||
ok(link != TAGID_NULL, "expected to find a link tag\n");
|
||||
if (link != TAGID_NULL)
|
||||
{
|
||||
match_str_attr(pdb, link, TAG_LINK_URL, test_layerdata[num].link);
|
||||
}
|
||||
match_str_attr(pdb, apphelp, TAG_APPHELP_TITLE, test_layerdata[num].apphelp_title);
|
||||
match_str_attr(pdb, apphelp, TAG_APPHELP_DETAILS, test_layerdata[num].apphelp_details);
|
||||
apphelp = pSdbFindNextTag(pdb, root, apphelp);
|
||||
num++;
|
||||
}
|
||||
ok(num == 2, "Expected to find 2 layer tags, found: %d\n", num);
|
||||
}
|
||||
|
||||
static void test_CheckDatabaseManually(void)
|
||||
{
|
||||
static const WCHAR path[] = {'t','e','s','t','_','d','b','.','s','d','b',0};
|
||||
TAGID root;
|
||||
PDB pdb;
|
||||
BOOL ret;
|
||||
DWORD ver_hi, ver_lo;
|
||||
|
||||
test_create_db("test_db.sdb");
|
||||
|
||||
/* both ver_hi and ver_lo cannot be null, it'll crash. */
|
||||
ver_hi = ver_lo = 0x12345678;
|
||||
ret = pSdbGetDatabaseVersion(path, &ver_hi, &ver_lo);
|
||||
ok(ret,"Expected SdbGetDatabaseVersion to succeed\n");
|
||||
ok(ver_hi == 2,"Expected ver_hi to be 2, was: %d\n", ver_hi);
|
||||
ok(ver_lo == 1,"Expected ver_lo to be 1, was: %d\n", ver_lo);
|
||||
|
||||
ver_hi = ver_lo = 0x12345678;
|
||||
ret = pSdbGetDatabaseVersion(NULL, &ver_hi, &ver_lo);
|
||||
ok(ret,"Expected SdbGetDatabaseVersion to succeed\n");
|
||||
ok(ver_hi == 0x12345678,"Expected ver_hi to be 0x12345678, was: 0x%x\n", ver_hi);
|
||||
ok(ver_lo == 0x12345678,"Expected ver_lo to be 0x12345678, was: 0x%x\n", ver_lo);
|
||||
|
||||
ver_hi = ver_lo = 0x12345678;
|
||||
ret = pSdbGetDatabaseVersion(path + 1, &ver_hi, &ver_lo);
|
||||
ok(ret,"Expected SdbGetDatabaseVersion to succeed\n");
|
||||
ok(ver_hi == 0x12345678,"Expected ver_hi to be 0x12345678, was: 0x%x\n", ver_hi);
|
||||
ok(ver_lo == 0x12345678,"Expected ver_lo to be 0x12345678, was: 0x%x\n", ver_lo);
|
||||
|
||||
pdb = pSdbOpenDatabase(path, DOS_PATH);
|
||||
ok(pdb != NULL, "unexpected NULL handle\n");
|
||||
|
||||
root = pSdbFindFirstTag(pdb, TAGID_ROOT, TAG_DATABASE);
|
||||
ok(root != TAGID_NULL, "expected to find a root tag\n");
|
||||
if (root != TAGID_NULL)
|
||||
{
|
||||
check_db_properties(pdb, root);
|
||||
check_db_layer(pdb, pSdbFindFirstTag(pdb, root, TAG_LAYER));
|
||||
check_db_exes(pdb, root);
|
||||
check_db_apphelp(pdb, root);
|
||||
}
|
||||
|
||||
pSdbCloseDatabase(pdb);
|
||||
DeleteFileA("test_db.sdb");
|
||||
}
|
||||
|
||||
START_TEST(db)
|
||||
|
@ -256,6 +756,7 @@ START_TEST(db)
|
|||
pSdbTagToString = (void *) GetProcAddress(hdll, "SdbTagToString");
|
||||
pSdbOpenDatabase = (void *) GetProcAddress(hdll, "SdbOpenDatabase");
|
||||
pSdbCreateDatabase = (void *) GetProcAddress(hdll, "SdbCreateDatabase");
|
||||
pSdbGetDatabaseVersion = (void *) GetProcAddress(hdll, "SdbGetDatabaseVersion");
|
||||
pSdbCloseDatabase = (void *) GetProcAddress(hdll, "SdbCloseDatabase");
|
||||
pSdbCloseDatabaseWrite = (void *) GetProcAddress(hdll, "SdbCloseDatabaseWrite");
|
||||
pSdbGetTagFromTagID = (void *) GetProcAddress(hdll, "SdbGetTagFromTagID");
|
||||
|
@ -268,6 +769,8 @@ START_TEST(db)
|
|||
pSdbWriteStringRefTag = (void *) GetProcAddress(hdll, "SdbWriteStringRefTag");
|
||||
pSdbBeginWriteListTag = (void *)GetProcAddress(hdll, "SdbBeginWriteListTag");
|
||||
pSdbEndWriteListTag = (void *) GetProcAddress(hdll, "SdbEndWriteListTag");
|
||||
pSdbFindFirstTag = (void *) GetProcAddress(hdll, "SdbFindFirstTag");
|
||||
pSdbFindNextTag = (void *) GetProcAddress(hdll, "SdbFindNextTag");
|
||||
pSdbReadWORDTag = (void *) GetProcAddress(hdll, "SdbReadWORDTag");
|
||||
pSdbReadDWORDTag = (void *) GetProcAddress(hdll, "SdbReadDWORDTag");
|
||||
pSdbReadQWORDTag = (void *) GetProcAddress(hdll, "SdbReadQWORDTag");
|
||||
|
@ -278,6 +781,9 @@ START_TEST(db)
|
|||
pSdbGetStringTagPtr = (void *) GetProcAddress(hdll, "SdbGetStringTagPtr");
|
||||
pSdbGetFirstChild = (void *) GetProcAddress(hdll, "SdbGetFirstChild");
|
||||
pSdbGetNextChild = (void *) GetProcAddress(hdll, "SdbGetNextChild");
|
||||
pSdbGetDatabaseID = (void *) GetProcAddress(hdll, "SdbGetDatabaseID");
|
||||
pSdbGUIDToString = (void *) GetProcAddress(hdll, "SdbGUIDToString");
|
||||
|
||||
test_Sdb();
|
||||
test_CheckDatabaseManually();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue