ReactOS 0.4.16-dev-122-g325d74c
custom.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <winsvc.h>
#include <odbcinst.h>
#include <shlobj.h>
#include <msxml.h>
#include <msi.h>
#include <msiquery.h>
#include <msidefs.h>
Include dependency graph for custom.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define __WINE_PRINTF_ATTR(fmt, args)
 
#define ok(hinst, condition, ...)   ok_(hinst, todo_level, __FILE__, __LINE__, condition, __VA_ARGS__)
 
#define todo_wine_if(is_todo)
 
#define todo_wine   todo_wine_if(1)
 

Functions

static void WINAPIV __WINE_PRINTF_ATTR (6, 7)
 
static void winetest_start_todo (int is_todo)
 
static int winetest_loop_todo (void)
 
static void winetest_end_todo (void)
 
static const chardbgstr_w (WCHAR *str)
 
static void check_prop (MSIHANDLE hinst, const char *prop, const char *expect)
 
static void test_props (MSIHANDLE hinst)
 
static void test_db (MSIHANDLE hinst)
 
static void test_doaction (MSIHANDLE hinst)
 
UINT WINAPI nested (MSIHANDLE hinst)
 
static void test_targetpath (MSIHANDLE hinst)
 
static void test_misc (MSIHANDLE hinst)
 
static void test_feature_states (MSIHANDLE hinst)
 
static void test_format_record (MSIHANDLE hinst)
 
static void test_costs (MSIHANDLE hinst)
 
static void test_invalid_functions (MSIHANDLE hinst)
 
static void test_view_get_error (MSIHANDLE hinst)
 
UINT WINAPI main_test (MSIHANDLE hinst)
 
UINT WINAPI test_retval (MSIHANDLE hinst)
 
static void append_file (MSIHANDLE hinst, const char *filename, const char *text)
 
UINT WINAPI da_immediate (MSIHANDLE hinst)
 
UINT WINAPI da_deferred (MSIHANDLE hinst)
 
UINT WINAPI process1 (MSIHANDLE hinst)
 
UINT WINAPI process2 (MSIHANDLE hinst)
 
UINT WINAPI async1 (MSIHANDLE hinst)
 
UINT WINAPI async2 (MSIHANDLE hinst)
 
static BOOL pf_exists (const char *file)
 
UINT WINAPI cf_present (MSIHANDLE hinst)
 
UINT WINAPI cf_absent (MSIHANDLE hinst)
 
UINT WINAPI file_present (MSIHANDLE hinst)
 
UINT WINAPI file_absent (MSIHANDLE hinst)
 
UINT WINAPI crs_present (MSIHANDLE hinst)
 
UINT WINAPI crs_absent (MSIHANDLE hinst)
 
UINT WINAPI sds_present (MSIHANDLE hinst)
 
UINT WINAPI sds_absent (MSIHANDLE hinst)
 
UINT WINAPI sis_present (MSIHANDLE hinst)
 
UINT WINAPI sis_absent (MSIHANDLE hinst)
 
UINT WINAPI sss_started (MSIHANDLE hinst)
 
UINT WINAPI sss_stopped (MSIHANDLE hinst)
 
UINT WINAPI rd_present (MSIHANDLE hinst)
 
UINT WINAPI rd_absent (MSIHANDLE hinst)
 
UINT WINAPI odbc_present (MSIHANDLE hinst)
 
UINT WINAPI odbc_absent (MSIHANDLE hinst)
 
UINT WINAPI mov_present (MSIHANDLE hinst)
 
UINT WINAPI mov_absent (MSIHANDLE hinst)
 
static void check_reg_str (MSIHANDLE hinst, HKEY key, const char *name, const char *expect)
 
UINT WINAPI pa_present (MSIHANDLE hinst)
 
UINT WINAPI pa_absent (MSIHANDLE hinst)
 
UINT WINAPI ppc_present (MSIHANDLE hinst)
 
UINT WINAPI ppc_absent (MSIHANDLE hinst)
 
UINT WINAPI pub_present (MSIHANDLE hinst)
 
UINT WINAPI pub_absent (MSIHANDLE hinst)
 
UINT WINAPI pf_present (MSIHANDLE hinst)
 
UINT WINAPI pf_absent (MSIHANDLE hinst)
 
UINT WINAPI pp_present (MSIHANDLE hinst)
 
UINT WINAPI pp_absent (MSIHANDLE hinst)
 
UINT WINAPI rci_present (MSIHANDLE hinst)
 
UINT WINAPI rci_absent (MSIHANDLE hinst)
 
UINT WINAPI rei_present (MSIHANDLE hinst)
 
UINT WINAPI rei_absent (MSIHANDLE hinst)
 
UINT WINAPI font_present (MSIHANDLE hinst)
 
UINT WINAPI font_absent (MSIHANDLE hinst)
 
UINT WINAPI rmi_present (MSIHANDLE hinst)
 
UINT WINAPI rmi_absent (MSIHANDLE hinst)
 
UINT WINAPI rp_present (MSIHANDLE hinst)
 
UINT WINAPI rp_absent (MSIHANDLE hinst)
 
UINT WINAPI rpi_present (MSIHANDLE hinst)
 
UINT WINAPI rpi_absent (MSIHANDLE hinst)
 
UINT WINAPI ru_present (MSIHANDLE hinst)
 
UINT WINAPI ru_absent (MSIHANDLE hinst)
 
UINT WINAPI tl_present (MSIHANDLE hinst)
 
UINT WINAPI tl_absent (MSIHANDLE hinst)
 
UINT WINAPI sr_present (MSIHANDLE hinst)
 
UINT WINAPI sr_absent (MSIHANDLE hinst)
 
UINT WINAPI env_present (MSIHANDLE hinst)
 
UINT WINAPI env_absent (MSIHANDLE hinst)
 
UINT WINAPI ini_present (MSIHANDLE hinst)
 
UINT WINAPI ini_absent (MSIHANDLE hinst)
 
UINT WINAPI wrv_present (MSIHANDLE hinst)
 
UINT WINAPI wrv_absent (MSIHANDLE hinst)
 

Variables

static int todo_level
 
static int todo_do_loop
 
static int global_state
 
static const char path_dotnet [] = "Software\\Microsoft\\Installer\\Assemblies\\Global"
 
static const char name_dotnet []
 
static const char ppc_key []
 
static const char pub_key [] = "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA"
 
static const char pf_classkey [] = "Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB"
 
static const char pf_userkey []
 
static const char pp_prodkey [] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB"
 
static const char font_key [] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
 
static const char rp_key []
 
static const CHAR ru_key []
 
static const GUID LIBID_register_test
 

Macro Definition Documentation

◆ __WINE_PRINTF_ATTR

#define __WINE_PRINTF_ATTR (   fmt,
  args 
)

Definition at line 42 of file custom.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 32 of file custom.c.

◆ ok

#define ok (   hinst,
  condition,
  ... 
)    ok_(hinst, todo_level, __FILE__, __LINE__, condition, __VA_ARGS__)

Definition at line 85 of file custom.c.

◆ todo_wine

#define todo_wine   todo_wine_if(1)

Definition at line 89 of file custom.c.

◆ todo_wine_if

#define todo_wine_if (   is_todo)
Value:
for (winetest_start_todo(is_todo); \
winetest_loop_todo(); \
winetest_end_todo())
static void winetest_start_todo(int is_todo)
Definition: custom.c:67

Definition at line 86 of file custom.c.

Function Documentation

◆ __WINE_PRINTF_ATTR()

static void WINAPIV __WINE_PRINTF_ATTR ( ,
 
)
static

Definition at line 47 of file custom.c.

48{
49 static char buffer[2000];
52
56
65}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define msg(x)
Definition: auth_time.c:54
UINT WINAPI MsiCloseHandle(MSIHANDLE handle)
Definition: handle.c:269
INT WINAPI MsiProcessMessage(MSIHANDLE hInstall, INSTALLMESSAGE eMessageType, MSIHANDLE hRecord)
Definition: package.c:2017
MSIHANDLE WINAPI MsiCreateRecord(UINT cParams)
Definition: record.c:92
UINT WINAPI MsiRecordSetInteger(MSIHANDLE handle, UINT iField, int iVal)
Definition: record.c:303
UINT WINAPI MsiRecordSetStringA(MSIHANDLE handle, UINT iField, const char *szValue)
Definition: record.c:549
GLuint buffer
Definition: glext.h:5915
GLenum condition
Definition: glext.h:9255
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
static HINSTANCE hinst
Definition: edit.c:551
BOOL todo
Definition: filedlg.c:313
static __ms_va_list valist
Definition: printf.c:66
@ INSTALLMESSAGE_USER
Definition: msi.h:97
Definition: fci.c:127
Definition: parser.c:49
unsigned long MSIHANDLE
Definition: winemsi.idl:27

◆ append_file()

static void append_file ( MSIHANDLE  hinst,
const char filename,
const char text 
)
static

Definition at line 1305 of file custom.c.

1306{
1307 DWORD size;
1309 ok(hinst, file != INVALID_HANDLE_VALUE, "CreateFile failed, error %lu\n", GetLastError());
1310
1314}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define SetFilePointer
Definition: compat.h:743
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
const WCHAR * text
Definition: package.c:1794
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
const char * filename
Definition: ioapi.h:137
#define ok(hinst, condition,...)
Definition: custom.c:85
#define GENERIC_WRITE
Definition: nt_native.h:90
#define FILE_END
Definition: winbase.h:114
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by da_deferred(), and da_immediate().

◆ async1()

UINT WINAPI async1 ( MSIHANDLE  hinst)

Definition at line 1393 of file custom.c.

1394{
1395 HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test");
1396 HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2");
1397 DWORD r = WaitForSingleObject(event, 10000);
1398 ok(hinst, !r, "wait timed out\n");
1399 SetEvent(event2);
1400 return ERROR_SUCCESS;
1401}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
struct _cl_event * event
Definition: glext.h:7739
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733

◆ async2()

UINT WINAPI async2 ( MSIHANDLE  hinst)

Definition at line 1403 of file custom.c.

1404{
1405 HANDLE event = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test");
1406 HANDLE event2 = CreateEventA(NULL, TRUE, FALSE, "wine_msi_async_test2");
1407 DWORD r;
1408 SetEvent(event);
1409 r = WaitForSingleObject(event2, 10000);
1410 ok(hinst, !r, "wait timed out\n");
1411 return ERROR_SUCCESS;
1412}

◆ cf_absent()

UINT WINAPI cf_absent ( MSIHANDLE  hinst)

Definition at line 1433 of file custom.c.

1434{
1435 ok(hinst, !pf_exists("msitest\\first"), "folder present\n");
1436 ok(hinst, !pf_exists("msitest\\second"), "folder present\n");
1437 ok(hinst, !pf_exists("msitest\\third"), "folder present\n");
1438 return ERROR_SUCCESS;
1439}
static BOOL pf_exists(const char *file)
Definition: custom.c:1414

◆ cf_present()

UINT WINAPI cf_present ( MSIHANDLE  hinst)

Definition at line 1425 of file custom.c.

1426{
1427 ok(hinst, pf_exists("msitest\\first"), "folder absent\n");
1428 ok(hinst, pf_exists("msitest\\second"), "folder absent\n");
1429 ok(hinst, pf_exists("msitest\\third"), "folder absent\n");
1430 return ERROR_SUCCESS;
1431}

◆ check_prop()

static void check_prop ( MSIHANDLE  hinst,
const char prop,
const char expect 
)
static

Definition at line 107 of file custom.c.

108{
109 char buffer[10] = "x";
110 DWORD sz = sizeof(buffer);
111 UINT r = MsiGetPropertyA(hinst, prop, buffer, &sz);
112 ok(hinst, !r, "'%s': got %u\n", prop, r);
113 ok(hinst, sz == strlen(buffer), "'%s': expected %Iu, got %lu\n", prop, strlen(buffer), sz);
114 ok(hinst, !strcmp(buffer, expect), "expected '%s', got '%s'\n", expect, buffer);
115}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD *sz)
Definition: package.c:2313
unsigned int UINT
Definition: ndis.h:50

Referenced by test_doaction(), test_misc(), and test_props().

◆ check_reg_str()

static void check_reg_str ( MSIHANDLE  hinst,
HKEY  key,
const char name,
const char expect 
)
static

Definition at line 1623 of file custom.c.

1624{
1625 char value[300];
1626 DWORD sz;
1627 LONG res;
1628
1629 sz = sizeof(value);
1630 res = RegQueryValueExA(key, name, NULL, NULL, (BYTE *)value, &sz);
1631 if (expect)
1632 {
1633 ok(hinst, !res, "failed to get value \"%s\": %ld\n", name, res);
1634 ok(hinst, !strcmp(value, expect), "\"%s\": expected \"%s\", got \"%s\"\n",
1635 name, expect, value);
1636 }
1637 else
1638 ok(hinst, res == ERROR_FILE_NOT_FOUND, "\"%s\": expected missing, got %ld\n",
1639 name, res);
1640}
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
GLuint res
Definition: glext.h:9613
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
long LONG
Definition: pedump.c:60
Definition: copy.c:22
Definition: name.c:39
Definition: pdh_main.c:94
unsigned char BYTE
Definition: xxhash.c:193

Referenced by env_absent(), env_present(), font_absent(), pa_absent(), pa_present(), pf_present(), pp_present(), ppc_present(), rp_present(), ru_present(), wrv_absent(), and wrv_present().

◆ crs_absent()

UINT WINAPI crs_absent ( MSIHANDLE  hinst)

Definition at line 1461 of file custom.c.

1462{
1463 ok(hinst, !pf_exists("msitest\\shortcut.lnk"), "shortcut present\n");
1464 return ERROR_SUCCESS;
1465}

◆ crs_present()

UINT WINAPI crs_present ( MSIHANDLE  hinst)

Definition at line 1455 of file custom.c.

1456{
1457 ok(hinst, pf_exists("msitest\\shortcut.lnk"), "shortcut absent\n");
1458 return ERROR_SUCCESS;
1459}

◆ da_deferred()

UINT WINAPI da_deferred ( MSIHANDLE  hinst)

Definition at line 1332 of file custom.c.

1333{
1334 char prop[300];
1335 DWORD len = sizeof(prop);
1336 LANGID lang;
1337 UINT r;
1338
1339 /* Test that we were in fact deferred */
1340 r = MsiGetPropertyA(hinst, "CustomActionData", prop, &len);
1341 ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
1342 ok(hinst, prop[0], "CustomActionData was empty\n");
1343
1344 append_file(hinst, prop, "two");
1345
1346 /* Test available properties */
1347 len = sizeof(prop);
1348 r = MsiGetPropertyA(hinst, "ProductCode", prop, &len);
1349 ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
1350 ok(hinst, prop[0], "got %s\n", prop);
1351
1352 len = sizeof(prop);
1353 r = MsiGetPropertyA(hinst, "UserSID", prop, &len);
1354 ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
1355 ok(hinst, prop[0], "got %s\n", prop);
1356
1357 len = sizeof(prop);
1358 r = MsiGetPropertyA(hinst, "TESTPATH", prop, &len);
1359 ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
1360 todo_wine
1361 ok(hinst, !prop[0], "got %s\n", prop);
1362
1363 /* Test modes */
1364 ok(hinst, MsiGetMode(hinst, MSIRUNMODE_SCHEDULED), "should be scheduled\n");
1365 ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_ROLLBACK), "shouldn't be rollback\n");
1366 ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_COMMIT), "shouldn't be commit\n");
1367
1369 ok(hinst, lang != ERROR_INVALID_HANDLE, "MsiGetLanguage failed\n");
1370
1371 return ERROR_SUCCESS;
1372}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
Definition: install.c:1540
BOOL WINAPI MsiGetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode)
Definition: install.c:670
GLenum GLsizei len
Definition: glext.h:6722
USHORT LANGID
Definition: mui.h:9
static void append_file(MSIHANDLE hinst, const char *filename, const char *text)
Definition: custom.c:1305
#define todo_wine
Definition: custom.c:89
@ MSIRUNMODE_SCHEDULED
Definition: msiquery.h:99
@ MSIRUNMODE_ROLLBACK
Definition: msiquery.h:100
@ MSIRUNMODE_COMMIT
Definition: msiquery.h:101
static const WCHAR lang[]
Definition: wbemdisp.c:287

◆ da_immediate()

UINT WINAPI da_immediate ( MSIHANDLE  hinst)

Definition at line 1316 of file custom.c.

1317{
1318 char prop[300];
1319 DWORD len = sizeof(prop);
1320
1321 MsiGetPropertyA(hinst, "TESTPATH", prop, &len);
1322
1323 append_file(hinst, prop, "one");
1324
1325 ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_SCHEDULED), "shouldn't be scheduled\n");
1326 ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_ROLLBACK), "shouldn't be rollback\n");
1327 ok(hinst, !MsiGetMode(hinst, MSIRUNMODE_COMMIT), "shouldn't be commit\n");
1328
1329 return ERROR_SUCCESS;
1330}

◆ dbgstr_w()

static const char * dbgstr_w ( WCHAR str)
static

Definition at line 91 of file custom.c.

92{
93 static char buffer[300], *p;
94
95 if (!str) return "(null)";
96
97 p = buffer;
98 *p++ = 'L';
99 *p++ = '"';
100 while ((*p++ = *str++));
101 *p++ = '"';
102 *p++ = 0;
103
104 return buffer;
105}
GLfloat GLfloat p
Definition: glext.h:8902
const WCHAR * str

Referenced by test_costs(), test_format_record(), test_props(), and test_targetpath().

◆ env_absent()

UINT WINAPI env_absent ( MSIHANDLE  hinst)

Definition at line 2079 of file custom.c.

2080{
2081 HKEY key;
2082 LONG res;
2083
2084 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
2085 ok(hinst, !res, "got %ld\n", res);
2086 check_reg_str(hinst, key, "MSITESTVAR3", NULL);
2087 check_reg_str(hinst, key, "MSITESTVAR4", NULL);
2089
2090 return ERROR_SUCCESS;
2091}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3234
static void check_reg_str(MSIHANDLE hinst, HKEY key, const char *name, const char *expect)
Definition: custom.c:1623
#define HKEY_CURRENT_USER
Definition: winreg.h:11

◆ env_present()

UINT WINAPI env_present ( MSIHANDLE  hinst)

Definition at line 2065 of file custom.c.

2066{
2067 HKEY key;
2068 LONG res;
2069
2070 res = RegOpenKeyA(HKEY_CURRENT_USER, "Environment", &key);
2071 ok(hinst, !res, "got %ld\n", res);
2072 check_reg_str(hinst, key, "MSITESTVAR3", "1");
2073 check_reg_str(hinst, key, "MSITESTVAR4", "1");
2075
2076 return ERROR_SUCCESS;
2077}

◆ file_absent()

UINT WINAPI file_absent ( MSIHANDLE  hinst)

Definition at line 1448 of file custom.c.

1449{
1450 ok(hinst, !pf_exists("msitest\\first\\one.txt"), "file present\n");
1451 ok(hinst, !pf_exists("msitest\\second\\two.txt"), "file present\n");
1452 return ERROR_SUCCESS;
1453}

◆ file_present()

UINT WINAPI file_present ( MSIHANDLE  hinst)

Definition at line 1441 of file custom.c.

1442{
1443 ok(hinst, pf_exists("msitest\\first\\one.txt"), "file absent\n");
1444 ok(hinst, pf_exists("msitest\\second\\two.txt"), "file absent\n");
1445 return ERROR_SUCCESS;
1446}

◆ font_absent()

UINT WINAPI font_absent ( MSIHANDLE  hinst)

Definition at line 1881 of file custom.c.

1882{
1883 HKEY key;
1884 LONG res;
1885
1887 ok(hinst, !res, "got %ld\n", res);
1888 check_reg_str(hinst, key, "msi test font", NULL);
1890
1891 return ERROR_SUCCESS;
1892}
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
static const char font_key[]
Definition: custom.c:1865
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

◆ font_present()

UINT WINAPI font_present ( MSIHANDLE  hinst)

Definition at line 1867 of file custom.c.

1868{
1869 HKEY key;
1870 LONG res;
1871
1873 ok(hinst, !res, "got %ld\n", res);
1874 res = RegQueryValueExA(key, "msi test font", NULL, NULL, NULL, NULL);
1875 ok(hinst, !res, "got %ld\n", res);
1877
1878 return ERROR_SUCCESS;
1879}

◆ ini_absent()

UINT WINAPI ini_absent ( MSIHANDLE  hinst)

Definition at line 2108 of file custom.c.

2109{
2110 char path[MAX_PATH], buf[10];
2111 DWORD len;
2112
2115 strcat(path, "\\msitest\\test.ini");
2116
2117 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
2118 ok(hinst, !len, "got %lu\n", len);
2119
2120 return ERROR_SUCCESS;
2121}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define MAX_PATH
Definition: compat.h:34
INT WINAPI GetPrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len, LPCSTR filename)
Definition: profile.c:1204
HRESULT WINAPI SHGetFolderPathA(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPSTR pszPath)
Definition: shellpath.c:2836
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FAILED(hr)
Definition: intsafe.h:51
#define CSIDL_PROGRAM_FILES
Definition: shlobj.h:2210
#define CSIDL_PROGRAM_FILESX86
Definition: shlobj.h:2214

◆ ini_present()

UINT WINAPI ini_present ( MSIHANDLE  hinst)

Definition at line 2093 of file custom.c.

2094{
2095 char path[MAX_PATH], buf[10];
2096 DWORD len;
2097
2100 strcat(path, "\\msitest\\test.ini");
2101
2102 len = GetPrivateProfileStringA("section1", "key1", NULL, buf, sizeof(buf), path);
2103 ok(hinst, len == 6, "got %lu\n", len);
2104
2105 return ERROR_SUCCESS;
2106}

◆ main_test()

UINT WINAPI main_test ( MSIHANDLE  hinst)

Definition at line 1264 of file custom.c.

1265{
1266 IUnknown *unk = NULL;
1267 HRESULT hr;
1268
1269 /* Test for an MTA apartment */
1270 hr = CoCreateInstance(&CLSID_XMLDocument, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk);
1271 ok(hinst, hr == S_OK, "CoCreateInstance failed with %08lx\n", hr);
1272
1273 if (unk) IUnknown_Release(unk);
1274
1275 /* but ours is uninitialized */
1277 ok(hinst, hr == S_OK, "got %#lx\n", hr);
1279
1281 test_db(hinst);
1290
1291 return ERROR_SUCCESS;
1292}
static void test_misc()
const GUID IID_IUnknown
static void test_view_get_error(void)
Definition: db.c:9171
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define S_OK
Definition: intsafe.h:52
static void test_invalid_functions(MSIHANDLE hinst)
Definition: custom.c:1112
static void test_targetpath(MSIHANDLE hinst)
Definition: custom.c:572
static void test_format_record(MSIHANDLE hinst)
Definition: custom.c:873
static void test_db(MSIHANDLE hinst)
Definition: custom.c:285
static void test_feature_states(MSIHANDLE hinst)
Definition: custom.c:783
static void test_doaction(void)
Definition: package.c:962
static void test_props(void)
Definition: package.c:2006
static void test_costs(void)
Definition: package.c:8308
const struct _GUID CLSID_XMLDocument
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
HRESULT hr
Definition: shlfolder.c:183

◆ mov_absent()

UINT WINAPI mov_absent ( MSIHANDLE  hinst)

Definition at line 1616 of file custom.c.

1617{
1618 ok(hinst, !pf_exists("msitest\\canada"), "file present\n");
1619 ok(hinst, !pf_exists("msitest\\dominica"), "file present\n");
1620 return ERROR_SUCCESS;
1621}

◆ mov_present()

UINT WINAPI mov_present ( MSIHANDLE  hinst)

Definition at line 1609 of file custom.c.

1610{
1611 ok(hinst, pf_exists("msitest\\canada"), "file absent\n");
1612 ok(hinst, pf_exists("msitest\\dominica"), "file absent\n");
1613 return ERROR_SUCCESS;
1614}

◆ nested()

UINT WINAPI nested ( MSIHANDLE  hinst)

Definition at line 565 of file custom.c.

566{
567 MsiSetPropertyA(hinst, "nested", "2");
568
569 return ERROR_SUCCESS;
570}
UINT WINAPI MsiSetPropertyA(MSIHANDLE hInstall, LPCSTR szName, LPCSTR szValue)
Definition: package.c:2067

◆ odbc_absent()

UINT WINAPI odbc_absent ( MSIHANDLE  hinst)

Definition at line 1586 of file custom.c.

1587{
1588 int gotdriver = 0, gotdriver2 = 0;
1589 char buffer[1000], *p;
1590 WORD len;
1591 BOOL r;
1592
1593 buffer[0] = 0;
1594 len = sizeof(buffer);
1596 if (r) ok(hinst, len < sizeof(buffer), "buffer too small\n");
1597 for (p = buffer; *p; p += strlen(p) + 1)
1598 {
1599 if (!strcmp(p, "ODBC test driver"))
1600 gotdriver = 1;
1601 if (!strcmp(p, "ODBC test driver2"))
1602 gotdriver2 = 1;
1603 }
1604 ok(hinst, !gotdriver, "driver present\n");
1605 ok(hinst, !gotdriver2, "driver 2 present\n");
1606 return ERROR_SUCCESS;
1607}
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
BOOL WINAPI SQLGetInstalledDrivers(char *buf, WORD size, WORD *sizeout)
Definition: odbccp32.c:561

◆ odbc_present()

UINT WINAPI odbc_present ( MSIHANDLE  hinst)

Definition at line 1563 of file custom.c.

1564{
1565 int gotdriver = 0, gotdriver2 = 0;
1566 char buffer[1000], *p;
1567 WORD len;
1568 BOOL r;
1569
1570 buffer[0] = 0;
1571 len = sizeof(buffer);
1573 if (r) ok(hinst, len < sizeof(buffer), "buffer too small\n");
1574 for (p = buffer; *p; p += strlen(p) + 1)
1575 {
1576 if (!strcmp(p, "ODBC test driver"))
1577 gotdriver = 1;
1578 if (!strcmp(p, "ODBC test driver2"))
1579 gotdriver2 = 1;
1580 }
1581 ok(hinst, gotdriver, "driver absent\n");
1582 ok(hinst, gotdriver2, "driver 2 absent\n");
1583 return ERROR_SUCCESS;
1584}

◆ pa_absent()

UINT WINAPI pa_absent ( MSIHANDLE  hinst)

Definition at line 1659 of file custom.c.

1660{
1661 HKEY key;
1662 LONG res;
1663
1665 ok(hinst, !res || res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1666 if (!res)
1667 {
1670 }
1671 return ERROR_SUCCESS;
1672}
static const char name_dotnet[]
Definition: custom.c:1643
static const char path_dotnet[]
Definition: custom.c:1642

◆ pa_present()

UINT WINAPI pa_present ( MSIHANDLE  hinst)

Definition at line 1646 of file custom.c.

1647{
1648 HKEY key;
1649 LONG res;
1650
1652 ok(hinst, !res, "got %ld\n", res);
1653 check_reg_str(hinst, key, name_dotnet, "rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~]");
1655
1656 return ERROR_SUCCESS;
1657}

◆ pf_absent()

UINT WINAPI pf_absent ( MSIHANDLE  hinst)

Definition at line 1754 of file custom.c.

1755{
1756 HKEY key;
1757 LONG res;
1758
1760 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1761
1763 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1764
1765 return ERROR_SUCCESS;
1766}
static const char pf_classkey[]
Definition: custom.c:1730
static const char pf_userkey[]
Definition: custom.c:1731
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

◆ pf_exists()

◆ pf_present()

UINT WINAPI pf_present ( MSIHANDLE  hinst)

Definition at line 1734 of file custom.c.

1735{
1736 HKEY key;
1737 LONG res;
1738
1740 ok(hinst, !res, "got %ld\n", res);
1741 check_reg_str(hinst, key, "feature", "");
1742 check_reg_str(hinst, key, "montecristo", "");
1744
1746 ok(hinst, !res, "got %ld\n", res);
1747 check_reg_str(hinst, key, "feature", "VGtfp^p+,?82@JU1j_KE");
1748 check_reg_str(hinst, key, "montecristo", "VGtfp^p+,?82@JU1j_KE");
1750
1751 return ERROR_SUCCESS;
1752}

◆ pp_absent()

UINT WINAPI pp_absent ( MSIHANDLE  hinst)

Definition at line 1785 of file custom.c.

1786{
1787 HKEY key;
1788 LONG res;
1789
1791 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1792
1793 return ERROR_SUCCESS;
1794}
static const char pp_prodkey[]
Definition: custom.c:1768

◆ pp_present()

UINT WINAPI pp_present ( MSIHANDLE  hinst)

Definition at line 1770 of file custom.c.

1771{
1772 HKEY key;
1773 LONG res;
1774
1776 ok(hinst, !res, "got %ld\n", res);
1777 check_reg_str(hinst, key, "ProductName", "MSITEST");
1778 check_reg_str(hinst, key, "PackageCode", "AC75740029052C94DA02821EECD05F2F");
1779 check_reg_str(hinst, key, "Clients", ":");
1780
1782 return ERROR_SUCCESS;
1783}

◆ ppc_absent()

UINT WINAPI ppc_absent ( MSIHANDLE  hinst)

Definition at line 1695 of file custom.c.

1696{
1697 HKEY key;
1698 UINT r;
1699
1701 ok(hinst, r == ERROR_FILE_NOT_FOUND, "got %u\n", r);
1702 return ERROR_SUCCESS;
1703}
static const char ppc_key[]
Definition: custom.c:1674

◆ ppc_present()

UINT WINAPI ppc_present ( MSIHANDLE  hinst)

Definition at line 1677 of file custom.c.

1678{
1679 char expect[MAX_PATH];
1680 HKEY key;
1681 UINT r;
1682
1684 ok(hinst, !r, "got %u\n", r);
1685
1688 strcat(expect, "\\msitest\\maximus");
1689 check_reg_str(hinst, key, "84A88FD7F6998CE40A22FB59F6B9C2BB", expect);
1690
1692 return ERROR_SUCCESS;
1693}

◆ process1()

UINT WINAPI process1 ( MSIHANDLE  hinst)

Definition at line 1376 of file custom.c.

1377{
1378 SetEnvironmentVariableA("MSI_PROCESS_TEST","1");
1379 global_state++;
1380 return ERROR_SUCCESS;
1381}
BOOL WINAPI DECLSPEC_HOTPATCH SetEnvironmentVariableA(IN LPCSTR lpName, IN LPCSTR lpValue)
Definition: environ.c:218
static int global_state
Definition: custom.c:1374

◆ process2()

UINT WINAPI process2 ( MSIHANDLE  hinst)

Definition at line 1383 of file custom.c.

1384{
1385 char env[2] = {0};
1386 DWORD r = GetEnvironmentVariableA("MSI_PROCESS_TEST", env, sizeof(env));
1387 ok(hinst, r == 1, "got %lu, error %lu\n", r, GetLastError());
1388 ok(hinst, !strcmp(env, "1"), "got %s\n", env);
1389 ok(hinst, !global_state, "got global_state %d\n", global_state);
1390 return ERROR_SUCCESS;
1391}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:170
#define GetEnvironmentVariableA(x, y, z)
Definition: compat.h:754

◆ pub_absent()

UINT WINAPI pub_absent ( MSIHANDLE  hinst)

Definition at line 1720 of file custom.c.

1721{
1722 HKEY key;
1723 LONG res;
1724
1726 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1727 return ERROR_SUCCESS;
1728}
static const char pub_key[]
Definition: custom.c:1705

◆ pub_present()

UINT WINAPI pub_present ( MSIHANDLE  hinst)

Definition at line 1707 of file custom.c.

1708{
1709 HKEY key;
1710 LONG res;
1711
1713 ok(hinst, !res, "got %ld\n", res);
1714 res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL);
1715 ok(hinst, !res, "got %ld\n", res);
1717 return ERROR_SUCCESS;
1718}

◆ rci_absent()

UINT WINAPI rci_absent ( MSIHANDLE  hinst)

Definition at line 1817 of file custom.c.

1818{
1819 HKEY key;
1820 LONG res;
1821
1822 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
1824 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1825
1826 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &key);
1827 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1828
1829 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key);
1830 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1831
1832 return ERROR_SUCCESS;
1833}
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45

◆ rci_present()

UINT WINAPI rci_present ( MSIHANDLE  hinst)

Definition at line 1796 of file custom.c.

1797{
1798 HKEY key;
1799 LONG res;
1800
1801 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
1803 ok(hinst, !res, "got %ld\n", res);
1805
1806 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "FileType\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}", &key);
1807 ok(hinst, !res, "got %ld\n", res);
1809
1810 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "AppID\\{CFCC3B38-E683-497D-9AB4-CB40AAFE307F}", &key);
1811 ok(hinst, !res, "got %ld\n", res);
1813
1814 return ERROR_SUCCESS;
1815}

◆ rd_absent()

UINT WINAPI rd_absent ( MSIHANDLE  hinst)

Definition at line 1554 of file custom.c.

1555{
1556 ok(hinst, !pf_exists("msitest\\original2.txt"), "file present\n");
1557 ok(hinst, !pf_exists("msitest\\duplicate.txt"), "file present\n");
1558 ok(hinst, !pf_exists("msitest\\original3.txt"), "file present\n");
1559 ok(hinst, !pf_exists("msitest\\duplicate2.txt"), "file present\n");
1560 return ERROR_SUCCESS;
1561}

◆ rd_present()

UINT WINAPI rd_present ( MSIHANDLE  hinst)

Definition at line 1545 of file custom.c.

1546{
1547 ok(hinst, pf_exists("msitest\\original2.txt"), "file absent\n");
1548 ok(hinst, pf_exists("msitest\\duplicate.txt"), "file absent\n");
1549 ok(hinst, !pf_exists("msitest\\original3.txt"), "file present\n");
1550 ok(hinst, !pf_exists("msitest\\duplicate2.txt"), "file present\n");
1551 return ERROR_SUCCESS;
1552}

◆ rei_absent()

UINT WINAPI rei_absent ( MSIHANDLE  hinst)

Definition at line 1851 of file custom.c.

1852{
1853 HKEY key;
1854 LONG res;
1855
1856 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key);
1857 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1858
1859 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key);
1860 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1861
1862 return ERROR_SUCCESS;
1863}

◆ rei_present()

UINT WINAPI rei_present ( MSIHANDLE  hinst)

Definition at line 1835 of file custom.c.

1836{
1837 HKEY key;
1838 LONG res;
1839
1840 res = RegOpenKeyA(HKEY_CLASSES_ROOT, ".extension", &key);
1841 ok(hinst, !res, "got %ld\n", res);
1843
1844 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Prog.Id.1\\shell\\Open\\command", &key);
1845 ok(hinst, !res, "got %ld\n", res);
1847
1848 return ERROR_SUCCESS;
1849}

◆ rmi_absent()

UINT WINAPI rmi_absent ( MSIHANDLE  hinst)

Definition at line 1905 of file custom.c.

1906{
1907 HKEY key;
1908 LONG res;
1909
1910 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key);
1911 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1912
1913 return ERROR_SUCCESS;
1914}

◆ rmi_present()

UINT WINAPI rmi_present ( MSIHANDLE  hinst)

Definition at line 1894 of file custom.c.

1895{
1896 HKEY key;
1897 LONG res;
1898
1899 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "MIME\\Database\\Content Type\\mime/type", &key);
1900 ok(hinst, !res, "got %ld\n", res);
1901
1902 return ERROR_SUCCESS;
1903}

◆ rp_absent()

UINT WINAPI rp_absent ( MSIHANDLE  hinst)

Definition at line 1932 of file custom.c.

1933{
1934 HKEY key;
1935 LONG res;
1936
1938 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1939
1940 return ERROR_SUCCESS;
1941}
static const char rp_key[]
Definition: custom.c:1916

◆ rp_present()

UINT WINAPI rp_present ( MSIHANDLE  hinst)

Definition at line 1919 of file custom.c.

1920{
1921 HKEY key;
1922 LONG res;
1923
1925 ok(hinst, !res, "got %ld\n", res);
1926 check_reg_str(hinst, key, "DisplayName", "MSITEST");
1928
1929 return ERROR_SUCCESS;
1930}

◆ rpi_absent()

UINT WINAPI rpi_absent ( MSIHANDLE  hinst)

Definition at line 1968 of file custom.c.

1969{
1970 HKEY key;
1971 LONG res;
1972
1973 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
1975 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1976
1977 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
1978 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1979
1980 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
1981 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1982
1983 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
1984 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
1985
1986 return ERROR_SUCCESS;
1987}

◆ rpi_present()

UINT WINAPI rpi_present ( MSIHANDLE  hinst)

Definition at line 1943 of file custom.c.

1944{
1945 HKEY key;
1946 LONG res;
1947
1948 res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "CLSID\\{110913E7-86D1-4BF3-9922-BA103FCDDDFA}",
1950 ok(hinst, !res, "got %ld\n", res);
1952
1953 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.1", &key);
1954 ok(hinst, !res, "got %ld\n", res);
1956
1957 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class", &key);
1958 ok(hinst, !res, "got %ld\n", res);
1960
1961 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "Winetest.Class.2", &key);
1962 ok(hinst, !res, "got %ld\n", res);
1964
1965 return ERROR_SUCCESS;
1966}

◆ ru_absent()

UINT WINAPI ru_absent ( MSIHANDLE  hinst)

Definition at line 2005 of file custom.c.

2006{
2007 HKEY key;
2008 LONG res;
2009
2011 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
2012
2013 return ERROR_SUCCESS;
2014}
static const CHAR ru_key[]
Definition: custom.c:1989

◆ ru_present()

UINT WINAPI ru_present ( MSIHANDLE  hinst)

Definition at line 1992 of file custom.c.

1993{
1994 HKEY key;
1995 LONG res;
1996
1998 ok(hinst, !res, "got %ld\n", res);
1999 check_reg_str(hinst, key, "ProductID", "none");
2001
2002 return ERROR_SUCCESS;
2003}

◆ sds_absent()

UINT WINAPI sds_absent ( MSIHANDLE  hinst)

Definition at line 1478 of file custom.c.

1479{
1480 SC_HANDLE manager, service;
1482 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
1483 ok(hinst, !service, "service present\n");
1484 if (service) CloseServiceHandle(service);
1485 CloseServiceHandle(manager);
1486 return ERROR_SUCCESS;
1487}
#define GENERIC_ALL
Definition: nt_native.h:92
SC_HANDLE WINAPI OpenServiceA(SC_HANDLE hSCManager, LPCSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2112
SC_HANDLE WINAPI OpenSCManagerA(LPCSTR lpMachineName, LPCSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2024
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
#define SC_MANAGER_ALL_ACCESS
Definition: winsvc.h:13

◆ sds_present()

UINT WINAPI sds_present ( MSIHANDLE  hinst)

Definition at line 1467 of file custom.c.

1468{
1469 SC_HANDLE manager, service;
1471 service = OpenServiceA(manager, "TestService3", GENERIC_ALL);
1472 ok(hinst, !!service, "service absent: %lu\n", GetLastError());
1473 CloseServiceHandle(service);
1474 CloseServiceHandle(manager);
1475 return ERROR_SUCCESS;
1476}

◆ sis_absent()

UINT WINAPI sis_absent ( MSIHANDLE  hinst)

Definition at line 1500 of file custom.c.

1501{
1502 SC_HANDLE manager, service;
1504 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
1505 ok(hinst, !service, "service present\n");
1506 if (service) CloseServiceHandle(service);
1507 CloseServiceHandle(manager);
1508 return ERROR_SUCCESS;
1509}

◆ sis_present()

UINT WINAPI sis_present ( MSIHANDLE  hinst)

Definition at line 1489 of file custom.c.

1490{
1491 SC_HANDLE manager, service;
1493 service = OpenServiceA(manager, "TestService", GENERIC_ALL);
1494 ok(hinst, !!service, "service absent: %lu\n", GetLastError());
1495 CloseServiceHandle(service);
1496 CloseServiceHandle(manager);
1497 return ERROR_SUCCESS;
1498}

◆ sr_absent()

UINT WINAPI sr_absent ( MSIHANDLE  hinst)

Definition at line 2054 of file custom.c.

2055{
2056 HKEY key;
2057 LONG res;
2058
2059 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
2060 ok(hinst, res == ERROR_FILE_NOT_FOUND, "got %ld\n", res);
2061
2062 return ERROR_SUCCESS;
2063}

◆ sr_present()

UINT WINAPI sr_present ( MSIHANDLE  hinst)

Definition at line 2042 of file custom.c.

2043{
2044 HKEY key;
2045 LONG res;
2046
2047 res = RegOpenKeyA(HKEY_CLASSES_ROOT, "selfreg_test", &key);
2048 ok(hinst, !res, "got %ld\n", res);
2050
2051 return ERROR_SUCCESS;
2052}

◆ sss_started()

UINT WINAPI sss_started ( MSIHANDLE  hinst)

Definition at line 1511 of file custom.c.

1512{
1513 SC_HANDLE manager, service;
1515 BOOL ret;
1516
1518 service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
1519 ret = QueryServiceStatus(service, &status);
1520 ok(hinst, ret, "QueryServiceStatus failed: %lu\n", GetLastError());
1521 ok(hinst, status.dwCurrentState == SERVICE_RUNNING, "got %lu\n", status.dwCurrentState);
1522
1523 CloseServiceHandle(service);
1524 CloseServiceHandle(manager);
1525 return ERROR_SUCCESS;
1526}
BOOL WINAPI QueryServiceStatus(SC_HANDLE hService, LPSERVICE_STATUS lpServiceStatus)
Definition: scm.c:2845
Definition: ps.c:97
int ret
#define SERVICE_RUNNING
Definition: winsvc.h:24

◆ sss_stopped()

UINT WINAPI sss_stopped ( MSIHANDLE  hinst)

Definition at line 1528 of file custom.c.

1529{
1530 SC_HANDLE manager, service;
1532 BOOL ret;
1533
1535 service = OpenServiceA(manager, "Spooler", SC_MANAGER_ALL_ACCESS);
1536 ret = QueryServiceStatus(service, &status);
1537 ok(hinst, ret, "QueryServiceStatus failed: %lu\n", GetLastError());
1538 ok(hinst, status.dwCurrentState == SERVICE_STOPPED, "got %lu\n", status.dwCurrentState);
1539
1540 CloseServiceHandle(service);
1541 CloseServiceHandle(manager);
1542 return ERROR_SUCCESS;
1543}
#define SERVICE_STOPPED
Definition: winsvc.h:21

◆ test_costs()

static void test_costs ( MSIHANDLE  hinst)
static

Definition at line 980 of file custom.c.

981{
982 WCHAR bufferW[10];
983 char buffer[10];
984 int cost, temp;
985 DWORD sz;
986 UINT r;
987
988 cost = 0xdead;
990 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
992 ok(hinst, !cost, "got %d\n", cost);
993
995 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
996
997 cost = 0xdead;
999 ok(hinst, !r, "got %u\n", r);
1000 todo_wine
1001 ok(hinst, cost == 8, "got %d\n", cost);
1002
1003 sz = cost = temp = 0xdead;
1004 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, NULL, &sz, &cost, &temp);
1005 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
1006 ok(hinst, sz == 0xdead, "got size %lu\n", sz);
1007 ok(hinst, cost == 0xdead, "got cost %d\n", cost);
1008 ok(hinst, temp == 0xdead, "got temp %d\n", temp);
1009
1010 cost = temp = 0xdead;
1012 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
1013 ok(hinst, cost == 0xdead, "got cost %d\n", cost);
1014 ok(hinst, temp == 0xdead, "got temp %d\n", temp);
1015
1016 sz = temp = 0xdead;
1018 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
1019 ok(hinst, sz == 0xdead, "got size %lu\n", sz);
1020 ok(hinst, temp == 0xdead, "got temp %d\n", temp);
1021
1022 sz = cost = 0xdead;
1023 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, NULL);
1024 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
1025 ok(hinst, sz == 0xdead, "got size %lu\n", sz);
1026 ok(hinst, cost == 0xdead, "got cost %d\n", cost);
1027
1028 cost = temp = 0xdead;
1029 sz = sizeof(buffer);
1031 ok(hinst, !r, "got %u\n", r);
1032 ok(hinst, sz == 2, "got size %lu\n", sz);
1033 ok(hinst, !strcmp(buffer, "C:"), "got '%s'\n", buffer);
1034 ok(hinst, !cost, "got cost %d\n", cost);
1035 ok(hinst, temp && temp != 0xdead, "got temp %d\n", temp);
1036
1037 cost = temp = 0xdead;
1038 sz = sizeof(buffer);
1039 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
1040 ok(hinst, !r, "got %u\n", r);
1041 ok(hinst, sz == 2, "got size %lu\n", sz);
1042 ok(hinst, !strcmp(buffer, "C:"), "got '%s'\n", buffer);
1043 ok(hinst, cost == 8, "got cost %d\n", cost);
1044 ok(hinst, !temp, "got temp %d\n", temp);
1045
1046 /* same string behaviour */
1047 cost = temp = 0xdead;
1048 sz = 0;
1049 strcpy(buffer,"q");
1050 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
1051 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1052 ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
1053 todo_wine
1054 ok(hinst, sz == 4, "got size %lu\n", sz);
1055 ok(hinst, cost == 8, "got cost %d\n", cost);
1056 ok(hinst, !temp, "got temp %d\n", temp);
1057
1058 sz = 1;
1059 strcpy(buffer,"x");
1060 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
1061 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1062 todo_wine {
1063 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
1064 ok(hinst, sz == 4, "got size %lu\n", sz);
1065 }
1066
1067 sz = 2;
1068 strcpy(buffer,"x");
1069 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
1070 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1071 todo_wine {
1072 ok(hinst, !strcmp(buffer, "C"), "got \"%s\"\n", buffer);
1073 ok(hinst, sz == 4, "got size %lu\n", sz);
1074 }
1075
1076 sz = 3;
1077 strcpy(buffer,"x");
1078 r = MsiEnumComponentCostsA(hinst, "One", 0, INSTALLSTATE_LOCAL, buffer, &sz, &cost, &temp);
1079 ok(hinst, !r, "got %u\n", r);
1080 ok(hinst, !strcmp(buffer, "C:"), "got \"%s\"\n", buffer);
1081 ok(hinst, sz == 2, "got size %lu\n", sz);
1082
1083 sz = 0;
1084 bufferW[0] = 'q';
1085 r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
1086 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1087 ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
1088 ok(hinst, sz == 2, "got size %lu\n", sz);
1089
1090 sz = 1;
1091 bufferW[0] = 'q';
1092 r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
1093 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1094 ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
1095 ok(hinst, sz == 2, "got size %lu\n", sz);
1096
1097 sz = 2;
1098 bufferW[0] = 'q';
1099 r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
1100 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
1101 ok(hinst, !lstrcmpW(bufferW, L"C"), "got %s\n", dbgstr_w(bufferW));
1102 ok(hinst, sz == 2, "got size %lu\n", sz);
1103
1104 sz = 3;
1105 bufferW[0] = 'q';
1106 r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
1107 ok(hinst, !r, "got %u\n", r);
1108 ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
1109 ok(hinst, sz == 2, "got size %lu\n", sz);
1110}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
UINT WINAPI MsiGetFeatureCostA(MSIHANDLE hInstall, LPCSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
Definition: install.c:1128
UINT WINAPI MsiEnumComponentCostsW(MSIHANDLE handle, const WCHAR *component, DWORD index, INSTALLSTATE state, WCHAR *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1962
UINT WINAPI MsiEnumComponentCostsA(MSIHANDLE handle, const char *component, DWORD index, INSTALLSTATE state, char *drive, DWORD *buflen, int *cost, int *temp)
Definition: msi.c:1925
static const char * dbgstr_w(WCHAR *str)
Definition: custom.c:91
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ MSICOSTTREE_CHILDREN
Definition: msiquery.h:43
#define L(x)
Definition: ntvdm.h:50
static calc_node_t temp
Definition: rpn_ieee.c:38
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ test_db()

static void test_db ( MSIHANDLE  hinst)
static

Definition at line 285 of file custom.c.

286{
287 static const UINT prop_type[20] = { VT_EMPTY, VT_EMPTY, VT_LPSTR, VT_EMPTY, VT_EMPTY,
291 MSIHANDLE hdb, hdb2, view, rec, rec2, suminfo;
292 char buffer[10];
293 DWORD sz;
294 UINT r, count, type, i;
295 INT int_value;
296 FILETIME ft;
297
299 ok(hinst, hdb, "MsiGetActiveDatabase failed\n");
300
301 r = MsiDatabaseIsTablePersistentA(hdb, "Test");
302 ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r);
303
305 ok(hinst, r == ERROR_BAD_QUERY_SYNTAX, "got %u\n", r);
306
307 r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test`", NULL);
308 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
309
310 r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test`", &view);
311 ok(hinst, !r, "got %u\n", r);
312
314 ok(hinst, !r, "got %u\n", r);
315
316 sz = sizeof(buffer);
317 r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
318 ok(hinst, !r, "got %u\n", r);
319 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
320 ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer);
321
322 /* Test MsiGetActiveDatabase + MsiDatabaseIsTablePersistent once again */
324 ok(hinst, hdb2, "MsiGetActiveDatabase failed\n");
325 ok(hinst, hdb2 != hdb, "db handles should be different\n");
326
327 r = MsiDatabaseIsTablePersistentA(hdb2, "Test");
328 ok(hinst, r == MSICONDITION_TRUE, "got %u\n", r);
329
330 r = MsiCloseHandle(hdb2);
331 ok(hinst, !r, "got %u\n", r);
332
333 r = MsiCloseHandle(rec2);
334 ok(hinst, !r, "got %u\n", r);
335
336 r = MsiViewExecute(view, 0);
337 ok(hinst, !r, "got %u\n", r);
338
339 r = MsiViewFetch(view, &rec2);
340 ok(hinst, !r, "got %u\n", r);
341
343 ok(hinst, r == 3, "got %u\n", r);
344
345 sz = sizeof(buffer);
346 r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
347 ok(hinst, !r, "got %u\n", r);
348 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
349 ok(hinst, !strcmp(buffer, "one"), "got '%s'\n", buffer);
350
351 r = MsiRecordGetInteger(rec2, 2);
352 ok(hinst, r == 1, "got %u\n", r);
353
354 sz = sizeof(buffer);
355 r = MsiRecordReadStream(rec2, 3, buffer, &sz);
356 ok(hinst, !r, "got %u\n", r);
357 ok(hinst, !memcmp(buffer, "unus", 4), "wrong data\n");
358
359 r = MsiCloseHandle(rec2);
360 ok(hinst, !r, "got %u\n", r);
361
362 r = MsiViewFetch(view, &rec2);
363 ok(hinst, !r, "got %u\n", r);
364
366 ok(hinst, r == 3, "got %u\n", r);
367
368 sz = sizeof(buffer);
369 r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
370 ok(hinst, !r, "got %u\n", r);
371 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
372 ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer);
373
374 r = MsiRecordGetInteger(rec2, 2);
375 ok(hinst, r == 2, "got %u\n", r);
376
377 sz = sizeof(buffer);
378 r = MsiRecordReadStream(rec2, 3, buffer, &sz);
379 ok(hinst, !r, "got %u\n", r);
380 ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n");
381
383 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
384
385 r = MsiRecordSetStringA(rec2, 1, "three");
386 ok(hinst, !r, "got %u\n", r);
387
388 r = MsiRecordSetInteger(rec2, 2, 3);
389 ok(hinst, !r, "got %u\n", r);
390
391 r = MsiRecordSetInteger(rec2, 3, 3);
392 ok(hinst, !r, "got %u\n", r);
393
395 ok(hinst, !r, "got %u\n", r);
396
397 sz = sizeof(buffer);
398 r = MsiRecordGetStringA(rec2, 1, buffer, &sz);
399 ok(hinst, !r, "got %u\n", r);
400 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
401 ok(hinst, !strcmp(buffer, "two"), "got '%s'\n", buffer);
402
403 r = MsiRecordGetInteger(rec2, 2);
404 ok(hinst, r == 2, "got %u\n", r);
405
406 sz = sizeof(buffer);
407 r = MsiRecordReadStream(rec2, 3, buffer, &sz);
408 ok(hinst, !r, "got %u\n", r);
409 ok(hinst, !memcmp(buffer, "duo", 3), "wrong data\n");
410
411 r = MsiCloseHandle(rec2);
412 ok(hinst, !r, "got %u\n", r);
413
414 r = MsiViewFetch(view, &rec2);
415 ok(hinst, r == ERROR_NO_MORE_ITEMS, "got %u\n", r);
416 ok(hinst, !rec2, "got %lu\n", rec2);
417
419 ok(hinst, !r, "got %u\n", r);
420
422 ok(hinst, !r, "got %u\n", r);
423
424 r = MsiDatabaseOpenViewA(hdb, "SELECT * FROM `Test` WHERE `Name` = ?", &view);
425 ok(hinst, !r, "got %u\n", r);
426
427 rec = MsiCreateRecord(1);
428 MsiRecordSetStringA(rec, 1, "one");
429
430 r = MsiViewExecute(view, rec);
431 ok(hinst, !r, "got %u\n", r);
432
433 r = MsiViewFetch(view, &rec2);
434 ok(hinst, !r, "got %u\n", r);
435
436 r = MsiRecordGetInteger(rec2, 2);
437 ok(hinst, r == 1, "got %u\n", r);
438
439 r = MsiCloseHandle(rec2);
440 ok(hinst, !r, "got %u\n", r);
441
442 r = MsiViewFetch(view, &rec2);
443 ok(hinst, r == ERROR_NO_MORE_ITEMS, "got %u\n", r);
444 ok(hinst, !rec2, "got %lu\n", rec2);
445
446 r = MsiCloseHandle(rec);
447 ok(hinst, !r, "got %u\n", r);
448
450 ok(hinst, !r, "got %u\n", r);
451
452 /* test MsiDatabaseGetPrimaryKeys() */
453 r = MsiDatabaseGetPrimaryKeysA(hdb, "Test", &rec);
454 ok(hinst, !r, "got %u\n", r);
455
457 ok(hinst, r == 1, "got %u\n", r);
458
459 sz = sizeof(buffer);
460 r = MsiRecordGetStringA(rec, 0, buffer, &sz);
461 ok(hinst, !r, "got %u\n", r);
462 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
463 ok(hinst, !strcmp(buffer, "Test"), "got '%s'\n", buffer);
464
465 sz = sizeof(buffer);
466 r = MsiRecordGetStringA(rec, 1, buffer, &sz);
467 ok(hinst, !r, "got %u\n", r);
468 ok(hinst, sz == strlen(buffer), "got size %lu\n", sz);
469 ok(hinst, !strcmp(buffer, "Name"), "got '%s'\n", buffer);
470
471 r = MsiCloseHandle(rec);
472 ok(hinst, !r, "got %u\n", r);
473
475 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
476
478 ok(hinst, !r, "got %u\n", r);
479
481 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
482
483 count = 0xdeadbeef;
485 ok(hinst, !r, "got %u\n", r);
486 ok(hinst, count == 5, "got %u\n", count);
487
489 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
490
491 for (i = 0; i < 20; i++)
492 {
493 /* for some reason query for PID_TITLE leads to install failure under Windows */
494 if (i == PID_TITLE) continue;
495
496 type = 0xdeadbeef;
497 int_value = 0xdeadbeef;
498 *buffer = 0;
499 sz = sizeof(buffer);
500 r = MsiSummaryInfoGetPropertyA(suminfo, i, &type, &int_value, &ft, buffer, &sz);
501 if (sz == sizeof(buffer) || i == PID_TEMPLATE)
502 ok(hinst, !r, "%u: got %u\n", i, r);
503 else
504 ok(hinst, r == ERROR_MORE_DATA, "%u: got %u\n", i, r);
505 ok(hinst, type == prop_type[i], "%u: expected %u, got %u\n", i, prop_type[i], type);
506 if (i == PID_PAGECOUNT)
507 ok(hinst, int_value == 100, "%u: got %u\n", i, int_value);
508 else
509 ok(hinst, int_value == 0, "%u: got %u\n", i, int_value);
510 if (i == PID_TEMPLATE)
511 {
512 ok(hinst, sz == 5, "%u: got %lu\n", i, sz);
513 ok(hinst, !lstrcmpA(buffer, ";1033"), "%u: got %s\n", i, buffer);
514 }
515 else if (i == PID_REVNUMBER)
516 {
517 ok(hinst, sz == 76, "%u: got %lu\n", i, sz);
518 ok(hinst, !lstrcmpA(buffer, "{004757CA"), "%u: got %s\n", i, buffer);
519 }
520 else
521 {
522 ok(hinst, sz == sizeof(buffer), "%u: got %lu\n", i, sz);
523 ok(hinst, !*buffer, "%u: got %s\n", i, buffer);
524 }
525 }
526
528
529 for (i = 0; i < 20; i++)
530 {
531 r = MsiSummaryInfoSetPropertyA(suminfo, i, prop_type[i], 1252, &ft, "");
532 ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r);
533
534 r = MsiSummaryInfoSetPropertyW(suminfo, i, prop_type[i], 1252, &ft, L"");
535 ok(hinst, r == ERROR_FUNCTION_FAILED, "%u: got %u\n", i, r);
536 }
537
539 ok(hinst, !r, "got %u\n", r);
540
541 r = MsiCloseHandle(hdb);
542 ok(hinst, !r, "got %u\n", r);
543}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static const CHAR suminfo[]
Definition: db.c:2166
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
@ VT_LPSTR
Definition: compat.h:2324
@ VT_I4
Definition: compat.h:2298
@ VT_EMPTY
Definition: compat.h:2295
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4194
MSIHANDLE WINAPI MsiGetActiveDatabase(MSIHANDLE hInstall)
Definition: package.c:1669
int WINAPI MsiRecordGetInteger(MSIHANDLE handle, UINT iField)
Definition: record.c:237
UINT WINAPI MsiRecordGetStringA(MSIHANDLE handle, UINT iField, char *szValue, DWORD *pcchValue)
Definition: record.c:403
UINT WINAPI MsiRecordReadStream(MSIHANDLE handle, UINT iField, char *buf, DWORD *sz)
Definition: record.c:819
UINT WINAPI MsiRecordGetFieldCount(MSIHANDLE handle)
Definition: record.c:113
UINT WINAPI MsiSummaryInfoSetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const char *szValue)
Definition: suminfo.c:942
UINT WINAPI MsiSummaryInfoGetPropertyA(MSIHANDLE handle, UINT uiProperty, UINT *puiDataType, INT *piValue, FILETIME *pftValue, char *szValueBuf, DWORD *pcchValueBuf)
Definition: suminfo.c:742
UINT WINAPI MsiGetSummaryInformationA(MSIHANDLE hDatabase, const char *szDatabase, UINT uiUpdateCount, MSIHANDLE *pHandle)
Definition: suminfo.c:589
UINT WINAPI MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, UINT *pCount)
Definition: suminfo.c:611
UINT WINAPI MsiSummaryInfoSetPropertyW(MSIHANDLE handle, UINT uiProperty, UINT uiDataType, INT iValue, FILETIME *pftValue, const WCHAR *szValue)
Definition: suminfo.c:912
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PID_TEMPLATE
Definition: suminfo.c:49
#define PID_PAGECOUNT
Definition: suminfo.c:56
#define PID_TITLE
Definition: suminfo.c:44
#define PID_REVNUMBER
Definition: suminfo.c:51
UINT WINAPI MsiViewModify(MSIHANDLE hView, MSIMODIFY eModifyMode, MSIHANDLE hRecord)
Definition: msiquery.c:719
UINT WINAPI MsiViewClose(MSIHANDLE hView)
Definition: msiquery.c:469
UINT WINAPI MsiViewExecute(MSIHANDLE hView, MSIHANDLE hRec)
Definition: msiquery.c:518
UINT WINAPI MsiDatabaseGetPrimaryKeysA(MSIHANDLE hdb, const char *table, MSIHANDLE *phRec)
Definition: msiquery.c:1127
UINT WINAPI MsiViewGetColumnInfo(MSIHANDLE hView, MSICOLINFO info, MSIHANDLE *hRec)
Definition: msiquery.c:641
UINT WINAPI MsiDatabaseOpenViewA(MSIHANDLE hdb, const char *szQuery, MSIHANDLE *phView)
Definition: msiquery.c:88
UINT WINAPI MsiViewFetch(MSIHANDLE hView, MSIHANDLE *record)
Definition: msiquery.c:404
MSICONDITION WINAPI MsiDatabaseIsTablePersistentA(MSIHANDLE hDatabase, const char *szTableName)
Definition: msiquery.c:1146
@ MSIMODIFY_REFRESH
Definition: msiquery.h:51
@ MSICONDITION_TRUE
Definition: msiquery.h:27
@ MSICOLINFO_NAMES
Definition: msiquery.h:36
int32_t INT
Definition: typedefs.h:58
#define ERROR_BAD_QUERY_SYNTAX
Definition: winerror.h:973
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985

Referenced by main_test().

◆ test_doaction()

static void test_doaction ( MSIHANDLE  hinst)
static

Definition at line 545 of file custom.c.

546{
547 UINT r;
548
549 r = MsiDoActionA(hinst, "nested51");
550 ok(hinst, !r, "got %u\n", r);
551 check_prop(hinst, "nested", "1");
552
553 r = MsiDoActionA(hinst, "nested1");
554 ok(hinst, !r, "got %u\n", r);
555 check_prop(hinst, "nested", "2");
556
557 r = MsiSequenceA(hinst, NULL, 0);
558 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
559
560 r = MsiSequenceA(hinst, "TestSequence", 0);
561 ok(hinst, !r, "got %u\n", r);
562 check_prop(hinst, "nested", "1");
563}
UINT WINAPI MsiDoActionA(MSIHANDLE hInstall, LPCSTR szAction)
Definition: install.c:45
UINT WINAPI MsiSequenceA(MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode)
Definition: install.c:104
static void check_prop(MSIHANDLE hinst, const char *prop, const char *expect)
Definition: custom.c:107

◆ test_feature_states()

static void test_feature_states ( MSIHANDLE  hinst)
static

Definition at line 783 of file custom.c.

784{
786 UINT r;
787
788 /* test feature states */
789
791 ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r);
792
793 r = MsiGetFeatureStateA(hinst, "fake", &state, &action);
794 ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r);
795
797 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
798
799 r = MsiGetFeatureStateA(hinst, "One", &state, NULL);
800 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
801
802 r = MsiGetFeatureStateA(hinst, "One", &state, &action);
803 ok(hinst, !r, "got %u\n", r);
804 ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state);
805 ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action);
806
808 ok(hinst, r == ERROR_UNKNOWN_FEATURE, "got %u\n", r);
809
811 ok(hinst, !r, "got %u\n", r);
812
813 r = MsiGetFeatureStateA(hinst, "One", &state, &action);
814 ok(hinst, !r, "got %u\n", r);
815 ok(hinst, action == INSTALLSTATE_ADVERTISED, "got action %d\n", action);
816
818 ok(hinst, !r, "got %u\n", r);
819
820 r = MsiGetFeatureStateA(hinst, "One", &state, &action);
821 ok(hinst, !r, "got %u\n", r);
822 ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action);
823
824 /* test component states */
825
827 ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r);
828
830 ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r);
831
833 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
834
836 ok(hinst, r == RPC_X_NULL_REF_POINTER, "got %u\n", r);
837
839 ok(hinst, !r, "got %u\n", r);
840 ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state);
841 ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action);
842
843 r = MsiGetComponentStateA(hinst, "dangler", &state, &action);
844 ok(hinst, !r, "got %u\n", r);
845 ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state);
846 ok(hinst, action == INSTALLSTATE_UNKNOWN, "got action %d\n", action);
847
848 r = MsiGetComponentStateA(hinst, "component", &state, &action);
849 ok(hinst, !r, "got %u\n", r);
850 ok(hinst, state == INSTALLSTATE_UNKNOWN, "got state %d\n", state);
851 ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action);
852
854 ok(hinst, r == ERROR_UNKNOWN_COMPONENT, "got %u\n", r);
855
857 ok(hinst, !r, "got %u\n", r);
858
860 ok(hinst, !r, "got %u\n", r);
861 ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state);
862 ok(hinst, action == INSTALLSTATE_SOURCE, "got action %d\n", action);
863
865 ok(hinst, !r, "got %u\n", r);
866
868 ok(hinst, !r, "got %u\n", r);
869 ok(hinst, state == INSTALLSTATE_ABSENT, "got state %d\n", state);
870 ok(hinst, action == INSTALLSTATE_LOCAL, "got action %d\n", action);
871}
static int state
Definition: maze.c:121
const WCHAR * action
Definition: action.c:7509
UINT WINAPI MsiGetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1395
UINT WINAPI MsiSetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE iState)
Definition: install.c:817
UINT WINAPI MsiGetFeatureStateA(MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1052
UINT WINAPI MsiSetComponentStateA(MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1379
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_ABSENT
Definition: msi.h:45
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
int INSTALLSTATE
Definition: winemsi.idl:31
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964

Referenced by main_test().

◆ test_format_record()

static void test_format_record ( MSIHANDLE  hinst)
static

Definition at line 873 of file custom.c.

874{
875 WCHAR bufferW[10];
876 char buffer[10];
877 MSIHANDLE rec;
878 DWORD sz;
879 UINT r;
880
882 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
883
884 rec = MsiCreateRecord(1);
885 MsiRecordSetStringA(rec, 0, "foo [1]");
886 MsiRecordSetInteger(rec, 1, 123);
887
888 r = MsiFormatRecordA(hinst, rec, NULL, NULL);
889 ok(hinst, !r, "got %u\n", r);
890
892 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
893
894 /* Returned size is in bytes, not chars, but only for custom actions. */
895
896 sz = 0;
897 r = MsiFormatRecordA(hinst, rec, NULL, &sz);
898 ok(hinst, !r, "got %u\n", r);
899 ok(hinst, sz == 14, "got size %lu\n", sz);
900
901 sz = 0;
902 strcpy(buffer,"q");
903 r = MsiFormatRecordA(hinst, rec, buffer, &sz);
904 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
905 ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
906 ok(hinst, sz == 14, "got size %lu\n", sz);
907
908 sz = 1;
909 strcpy(buffer,"x");
910 r = MsiFormatRecordA(hinst, rec, buffer, &sz);
911 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
912 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
913 ok(hinst, sz == 14, "got size %lu\n", sz);
914
915 sz = 7;
916 strcpy(buffer,"x");
917 r = MsiFormatRecordA(hinst, rec, buffer, &sz);
918 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
919 ok(hinst, !strcmp(buffer, "foo 12"), "got \"%s\"\n", buffer);
920 ok(hinst, sz == 14, "got size %lu\n", sz);
921
922 sz = 8;
923 strcpy(buffer,"x");
924 r = MsiFormatRecordA(hinst, rec, buffer, &sz);
925 ok(hinst, !r, "got %u\n", r);
926 ok(hinst, !strcmp(buffer, "foo 123"), "got \"%s\"\n", buffer);
927 ok(hinst, sz == 7, "got size %lu\n", sz);
928
929 r = MsiFormatRecordW(hinst, rec, NULL, NULL);
930 ok(hinst, !r, "got %u\n", r);
931
932 r = MsiFormatRecordW(hinst, rec, bufferW, NULL);
933 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
934
935 sz = 0;
936 r = MsiFormatRecordW(hinst, rec, NULL, &sz);
937 ok(hinst, !r, "got %u\n", r);
938 ok(hinst, sz == 7, "got size %lu\n", sz);
939
940 sz = 0;
941 bufferW[0] = 'q';
942 r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
943 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
944 ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
945 ok(hinst, sz == 7, "got size %lu\n", sz);
946
947 sz = 1;
948 bufferW[0] = 'q';
949 r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
950 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
951 ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
952 ok(hinst, sz == 7, "got size %lu\n", sz);
953
954 sz = 7;
955 bufferW[0] = 'q';
956 r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
957 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
958 ok(hinst, !lstrcmpW(bufferW, L"foo 12"), "got %s\n", dbgstr_w(bufferW));
959 ok(hinst, sz == 7, "got size %lu\n", sz);
960
961 sz = 8;
962 bufferW[0] = 'q';
963 r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
964 ok(hinst, !r, "got %u\n", r);
965 ok(hinst, !lstrcmpW(bufferW, L"foo 123"), "got %s\n", dbgstr_w(bufferW));
966 ok(hinst, sz == 7, "got size %lu\n", sz);
967
968 /* check that properties work */
969 MsiSetPropertyA(hinst, "fmtprop", "foobar");
970 MsiRecordSetStringA(rec, 0, "[fmtprop]");
971 sz = sizeof(buffer);
972 r = MsiFormatRecordA(hinst, rec, buffer, &sz);
973 ok(hinst, !r, "got %u\n", r);
974 ok(hinst, !strcmp(buffer, "foobar"), "got \"%s\"\n", buffer);
975 ok(hinst, sz == 6, "got size %lu\n", sz);
976
977 MsiCloseHandle(rec);
978}
UINT WINAPI MsiFormatRecordA(MSIHANDLE hinst, MSIHANDLE hrec, char *buf, DWORD *sz)
Definition: format.c:955
UINT WINAPI MsiFormatRecordW(MSIHANDLE hInstall, MSIHANDLE hRecord, WCHAR *szResult, DWORD *sz)
Definition: format.c:900

Referenced by main_test().

◆ test_invalid_functions()

static void test_invalid_functions ( MSIHANDLE  hinst)
static

Definition at line 1112 of file custom.c.

1113{
1114 char path[MAX_PATH], package_name[20];
1115 MSIHANDLE db, preview, package;
1116 UINT r;
1117
1119 ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
1120
1122 ok(hinst, db, "MsiGetActiveDatabase failed\n");
1123
1124 r = MsiDatabaseGenerateTransformA(db, db, "bogus.mst", 0, 0);
1125 todo_wine ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1126
1127 r = MsiDatabaseApplyTransformA(db, "bogus.mst", 0);
1128 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1129
1130 r = MsiCreateTransformSummaryInfoA(db, db, "bogus.mst", 0, 0);
1132
1133 GetCurrentDirectoryA(sizeof(path), path);
1134 r = MsiDatabaseExportA(db, "Test", path, "bogus.idt");
1135 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1136
1137 r = MsiDatabaseImportA(db, path, "bogus.idt");
1138 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1139
1140 r = MsiDatabaseCommit(db);
1141 ok(hinst, r == ERROR_SUCCESS, "got %u\n", r);
1142
1143 r = MsiDatabaseMergeA(db, db, "MergeErrors");
1144 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1145
1146 r = MsiGetDatabaseState(db);
1147 ok(hinst, r == MSIDBSTATE_ERROR, "got %u\n", r);
1148
1150 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1151
1152 sprintf(package_name, "#%lu", db);
1153 r = MsiOpenPackageA(package_name, &package);
1154 ok(hinst, r == ERROR_INVALID_HANDLE, "got %u\n", r);
1155
1156 MsiCloseHandle(db);
1157}
static previewinfo preview
Definition: print.c:56
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2146
MSIDBSTATE WINAPI MsiGetDatabaseState(MSIHANDLE handle)
Definition: database.c:1919
UINT WINAPI MsiDatabaseImportA(MSIHANDLE handle, const char *szFolder, const char *szFilename)
Definition: database.c:863
UINT WINAPI MsiDatabaseMergeA(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, const char *szTableName)
Definition: database.c:1222
UINT WINAPI MsiDatabaseExportA(MSIHANDLE handle, const char *szTable, const char *szFolder, const char *szFilename)
Definition: database.c:1184
UINT WINAPI MsiEnableUIPreview(MSIHANDLE hdb, MSIHANDLE *phPreview)
Definition: dialog.c:4144
UINT WINAPI MsiOpenPackageA(LPCSTR szPackage, MSIHANDLE *phPackage)
Definition: package.c:1664
UINT WINAPI MsiCreateTransformSummaryInfoA(MSIHANDLE db, MSIHANDLE db_ref, const char *transform, int error, int validation)
Definition: suminfo.c:1244
#define sprintf(buf, format,...)
Definition: sprintf.c:55
UINT WINAPI MsiDatabaseApplyTransformA(MSIHANDLE hdb, const char *transform, int error_cond)
Definition: msiquery.c:932
UINT WINAPI MsiDatabaseGenerateTransformA(MSIHANDLE hdb, MSIHANDLE hdbref, const char *szTransformFile, int iReserved1, int iReserved2)
Definition: msiquery.c:948
UINT WINAPI MsiDatabaseCommit(MSIHANDLE hdb)
Definition: msiquery.c:962
@ MSIDBSTATE_ERROR
Definition: msiquery.h:143
#define ERROR_INSTALL_PACKAGE_OPEN_FAILED
Definition: winerror.h:977

Referenced by main_test().

◆ test_misc()

static void test_misc ( MSIHANDLE  hinst)
static

Definition at line 758 of file custom.c.

759{
760 MSICONDITION cond;
761 LANGID lang;
762 UINT r;
763
765 ok(hinst, !r, "got %u\n", r);
766
768 ok(hinst, lang == 1033, "got %u\n", lang);
769
770 check_prop(hinst, "INSTALLLEVEL", "3");
771 r = MsiSetInstallLevel(hinst, 123);
772 ok(hinst, !r, "got %u\n", r);
773 check_prop(hinst, "INSTALLLEVEL", "123");
775
777 ok(hinst, cond == MSICONDITION_NONE, "got %u\n", cond);
778 MsiSetPropertyA(hinst, "condprop", "1");
779 cond = MsiEvaluateConditionA(hinst, "condprop = 1");
780 ok(hinst, cond == MSICONDITION_TRUE, "got %u\n", cond);
781}
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
Definition: install.c:1596
UINT WINAPI MsiSetMode(MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
Definition: install.c:763
@ MSICONDITION_NONE
Definition: msiquery.h:28
MSICONDITION WINAPI MsiEvaluateConditionA(MSIHANDLE, LPCSTR)
@ MSIRUNMODE_REBOOTATEND
Definition: msiquery.h:89
int MSICONDITION
Definition: winemsi.idl:29

◆ test_props()

static void test_props ( MSIHANDLE  hinst)
static

Definition at line 117 of file custom.c.

118{
119 char buffer[10];
120 WCHAR bufferW[10];
121 DWORD sz;
122 UINT r;
123
124 /* test invalid values */
126 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
127
128 r = MsiGetPropertyA(hinst, "boo", NULL, NULL);
129 ok(hinst, !r, "got %u\n", r);
130
131 r = MsiGetPropertyA(hinst, "boo", buffer, NULL );
132 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
133
134 sz = 0;
135 r = MsiGetPropertyA(hinst, "boo", NULL, &sz);
136 ok(hinst, !r, "got %u\n", r);
137 ok(hinst, sz == 0, "got size %lu\n", sz);
138
139 sz = 0;
140 strcpy(buffer,"x");
141 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
142 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
143 ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
144 ok(hinst, sz == 0, "got size %lu\n", sz);
145
146 sz = 1;
147 strcpy(buffer,"x");
148 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
149 ok(hinst, !r, "got %u\n", r);
150 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
151 ok(hinst, sz == 0, "got size %lu\n", sz);
152
153 /* set the property to something */
155 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
156
157 r = MsiSetPropertyA(hinst, "", NULL);
158 ok(hinst, !r, "got %u\n", r);
159
160 r = MsiSetPropertyA(hinst, "", "asdf");
161 ok(hinst, r == ERROR_FUNCTION_FAILED, "got %u\n", r);
162
163 r = MsiSetPropertyA(hinst, "=", "asdf");
164 ok(hinst, !r, "got %u\n", r);
165 check_prop(hinst, "=", "asdf");
166
167 r = MsiSetPropertyA(hinst, " ", "asdf");
168 ok(hinst, !r, "got %u\n", r);
169 check_prop(hinst, " ", "asdf");
170
171 r = MsiSetPropertyA(hinst, "'", "asdf");
172 ok(hinst, !r, "got %u\n", r);
173 check_prop(hinst, "'", "asdf");
174
175 r = MsiSetPropertyA(hinst, "boo", NULL);
176 ok(hinst, !r, "got %u\n", r);
177 check_prop(hinst, "boo", "");
178
179 r = MsiSetPropertyA(hinst, "boo", "");
180 ok(hinst, !r, "got %u\n", r);
181 check_prop(hinst, "boo", "");
182
183 r = MsiSetPropertyA(hinst, "boo", "xyz");
184 ok(hinst, !r, "got %u\n", r);
185 check_prop(hinst, "boo", "xyz");
186
187 r = MsiGetPropertyA(hinst, "boo", NULL, NULL);
188 ok(hinst, !r, "got %u\n", r);
189
190 r = MsiGetPropertyA(hinst, "boo", buffer, NULL );
191 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
192
193 /* Returned size is in bytes, not chars, but only for custom actions.
194 * Seems to be a casualty of RPC... */
195
196 sz = 0;
197 r = MsiGetPropertyA(hinst, "boo", NULL, &sz);
198 ok(hinst, !r, "got %u\n", r);
199 ok(hinst, sz == 6, "got size %lu\n", sz);
200
201 sz = 0;
202 strcpy(buffer,"q");
203 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
204 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
205 ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
206 ok(hinst, sz == 6, "got size %lu\n", sz);
207
208 sz = 1;
209 strcpy(buffer,"x");
210 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
211 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
212 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
213 ok(hinst, sz == 6, "got size %lu\n", sz);
214
215 sz = 3;
216 strcpy(buffer,"x");
217 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
218 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
219 ok(hinst, !strcmp(buffer, "xy"), "got \"%s\"\n", buffer);
220 ok(hinst, sz == 6, "got size %lu\n", sz);
221
222 sz = 4;
223 strcpy(buffer,"x");
224 r = MsiGetPropertyA(hinst, "boo", buffer, &sz);
225 ok(hinst, !r, "got %u\n", r);
226 ok(hinst, !strcmp(buffer, "xyz"), "got \"%s\"\n", buffer);
227 ok(hinst, sz == 3, "got size %lu\n", sz);
228
229 r = MsiGetPropertyW(hinst, L"boo", NULL, NULL);
230 ok(hinst, !r, "got %u\n", r);
231
232 r = MsiGetPropertyW(hinst, L"boo", bufferW, NULL );
233 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
234
235 sz = 0;
236 r = MsiGetPropertyW(hinst, L"boo", NULL, &sz);
237 ok(hinst, !r, "got %u\n", r);
238 ok(hinst, sz == 3, "got size %lu\n", sz);
239
240 sz = 0;
241 lstrcpyW(bufferW, L"boo");
242 r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
243 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
244 ok(hinst, !lstrcmpW(bufferW, L"boo"), "got %s\n", dbgstr_w(bufferW));
245 ok(hinst, sz == 3, "got size %lu\n", sz);
246
247 sz = 1;
248 lstrcpyW(bufferW, L"boo");
249 r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
250 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
251 ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
252 ok(hinst, sz == 3, "got size %lu\n", sz);
253
254 sz = 3;
255 lstrcpyW(bufferW, L"boo");
256 r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
257 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
258 ok(hinst, !lstrcmpW(bufferW, L"xy"), "got %s\n", dbgstr_w(bufferW));
259 ok(hinst, sz == 3, "got size %lu\n", sz);
260
261 sz = 4;
262 lstrcpyW(bufferW, L"boo");
263 r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
264 ok(hinst, !r, "got %u\n", r);
265 ok(hinst, !lstrcmpW(bufferW, L"xyz"), "got %s\n", dbgstr_w(bufferW));
266 ok(hinst, sz == 3, "got size %lu\n", sz);
267
268 r = MsiSetPropertyA(hinst, "boo", NULL);
269 ok(hinst, !r, "got %u\n", r);
270 check_prop(hinst, "boo", "");
271
272 sz = 0;
273 r = MsiGetPropertyA(hinst, "embednullprop", NULL, &sz);
274 ok(hinst, !r, "got %u\n", r);
275 ok(hinst, sz == 6, "got size %lu\n", sz);
276
277 sz = 4;
278 memset(buffer, 0xcc, sizeof(buffer));
279 r = MsiGetPropertyA(hinst, "embednullprop", buffer, &sz);
280 ok(hinst, !r, "got %u\n", r);
281 ok(hinst, sz == 3, "got size %lu\n", sz);
282 ok(hinst, !memcmp(buffer, "a\0\0\0\xcc", 5), "wrong data\n");
283}
#define lstrcpyW
Definition: compat.h:749
UINT WINAPI MsiGetPropertyW(MSIHANDLE hinst, const WCHAR *name, WCHAR *buf, DWORD *sz)
Definition: package.c:2385
#define memset(x, y, z)
Definition: compat.h:39

◆ test_retval()

UINT WINAPI test_retval ( MSIHANDLE  hinst)

Definition at line 1294 of file custom.c.

1295{
1296 char prop[10];
1297 DWORD len = sizeof(prop);
1298 UINT retval;
1299
1300 MsiGetPropertyA(hinst, "TEST_RETVAL", prop, &len);
1301 sscanf(prop, "%u", &retval);
1302 return retval;
1303}
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)

◆ test_targetpath()

static void test_targetpath ( MSIHANDLE  hinst)
static

Definition at line 572 of file custom.c.

573{
574 WCHAR bufferW[100];
575 char buffer[100];
576 DWORD sz, srcsz;
577 UINT r;
578
579 /* test invalid values */
581 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
582
583 r = MsiGetTargetPathA(hinst, "TARGETDIR", NULL, NULL );
584 ok(hinst, !r, "got %u\n", r);
585
586 r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, NULL );
587 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
588
589 /* Returned size is in bytes, not chars, but only for custom actions.
590 * Seems to be a casualty of RPC... */
591
592 sz = 0;
593 r = MsiGetTargetPathA(hinst, "TARGETDIR", NULL, &sz);
594 ok(hinst, !r, "got %u\n", r);
595 ok(hinst, sz == 6, "got size %lu\n", sz);
596
597 sz = 0;
598 strcpy(buffer,"q");
599 r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
600 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
601 ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
602 ok(hinst, sz == 6, "got size %lu\n", sz);
603
604 sz = 1;
605 strcpy(buffer,"x");
606 r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
607 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
608 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
609 ok(hinst, sz == 6, "got size %lu\n", sz);
610
611 sz = 3;
612 strcpy(buffer,"x");
613 r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
614 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
615 ok(hinst, !strcmp(buffer, "C:"), "got \"%s\"\n", buffer);
616 ok(hinst, sz == 6, "got size %lu\n", sz);
617
618 sz = 4;
619 strcpy(buffer,"x");
620 r = MsiGetTargetPathA(hinst, "TARGETDIR", buffer, &sz);
621 ok(hinst, !r, "got %u\n", r);
622 ok(hinst, !strcmp(buffer, "C:\\"), "got \"%s\"\n", buffer);
623 ok(hinst, sz == 3, "got size %lu\n", sz);
624
625 sz = 0;
626 r = MsiGetTargetPathW(hinst, L"TARGETDIR", NULL, &sz);
627 ok(hinst, !r, "got %u\n", r);
628 ok(hinst, sz == 3, "got size %lu\n", sz);
629
630 sz = 0;
631 bufferW[0] = 'q';
632 r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
633 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
634 ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
635 ok(hinst, sz == 3, "got size %lu\n", sz);
636
637 sz = 1;
638 bufferW[0] = 'q';
639 r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
640 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
641 ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
642 ok(hinst, sz == 3, "got size %lu\n", sz);
643
644 sz = 3;
645 bufferW[0] = 'q';
646 r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
647 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
648 ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
649 ok(hinst, sz == 3, "got size %lu\n", sz);
650
651 sz = 4;
652 bufferW[0] = 'q';
653 r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
654 ok(hinst, !r, "got %u\n", r);
655 ok(hinst, !lstrcmpW(bufferW, L"C:\\"), "got %s\n", dbgstr_w(bufferW));
656 ok(hinst, sz == 3, "got size %lu\n", sz);
657
658 r = MsiSetTargetPathA(hinst, NULL, "C:\\subdir");
659 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
660
661 r = MsiSetTargetPathA(hinst, "MSITESTDIR", NULL);
662 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
663
664 r = MsiSetTargetPathA(hinst, "MSITESTDIR", "C:\\subdir");
665 ok(hinst, !r, "got %u\n", r);
666
667 sz = sizeof(buffer);
668 r = MsiGetTargetPathA(hinst, "MSITESTDIR", buffer, &sz);
669 ok(hinst, !r, "got %u\n", r);
670 ok(hinst, !strcmp(buffer, "C:\\subdir\\"), "got \"%s\"\n", buffer);
671
672 r = MsiSetTargetPathA(hinst, "MSITESTDIR", "C:\\");
673
674 /* test GetSourcePath() */
675
677 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
678
679 r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, NULL );
680 ok(hinst, !r, "got %u\n", r);
681
682 r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, NULL );
683 ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
684
685 /* Returned size is in bytes, not chars, but only for custom actions.
686 * Seems to be a casualty of RPC... */
687
688 srcsz = 0;
689 MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &srcsz);
690
691 sz = 0;
692 r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, &sz);
693 ok(hinst, !r, "got %u\n", r);
694 ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
695
696 sz = 0;
697 strcpy(buffer,"q");
698 r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
699 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
700 ok(hinst, !strcmp(buffer, "q"), "got \"%s\"\n", buffer);
701 ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
702
703 sz = 1;
704 strcpy(buffer,"x");
705 r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
706 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
707 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
708 ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
709
710 sz = srcsz;
711 strcpy(buffer,"x");
712 r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
713 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
714 ok(hinst, strlen(buffer) == srcsz - 1, "wrong buffer length %Iu\n", strlen(buffer));
715 ok(hinst, sz == srcsz * 2, "got size %lu\n", sz);
716
717 sz = srcsz + 1;
718 strcpy(buffer,"x");
719 r = MsiGetSourcePathA(hinst, "TARGETDIR", buffer, &sz);
720 ok(hinst, !r, "got %u\n", r);
721 ok(hinst, strlen(buffer) == srcsz, "wrong buffer length %Iu\n", strlen(buffer));
722 ok(hinst, sz == srcsz, "got size %lu\n", sz);
723
724 sz = 0;
725 r = MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &sz);
726 ok(hinst, !r, "got %u\n", r);
727 ok(hinst, sz == srcsz, "got size %lu\n", sz);
728
729 sz = 0;
730 bufferW[0] = 'q';
731 r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
732 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
733 ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
734 ok(hinst, sz == srcsz, "got size %lu\n", sz);
735
736 sz = 1;
737 bufferW[0] = 'q';
738 r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
739 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
740 ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
741 ok(hinst, sz == srcsz, "got size %lu\n", sz);
742
743 sz = srcsz;
744 bufferW[0] = 'q';
745 r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
746 ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
747 ok(hinst, lstrlenW(bufferW) == srcsz - 1, "wrong buffer length %d\n", lstrlenW(bufferW));
748 ok(hinst, sz == srcsz, "got size %lu\n", sz);
749
750 sz = srcsz + 1;
751 bufferW[0] = 'q';
752 r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
753 ok(hinst, !r, "got %u\n", r);
754 ok(hinst, lstrlenW(bufferW) == srcsz, "wrong buffer length %d\n", lstrlenW(bufferW));
755 ok(hinst, sz == srcsz, "got size %lu\n", sz);
756}
#define lstrlenW
Definition: compat.h:750
UINT WINAPI MsiGetSourcePathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
Definition: install.c:409
UINT WINAPI MsiGetTargetPathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:311
UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz)
Definition: install.c:252
UINT WINAPI MsiGetSourcePathW(MSIHANDLE hinst, const WCHAR *folder, WCHAR *buf, DWORD *sz)
Definition: install.c:468
UINT WINAPI MsiSetTargetPathA(MSIHANDLE hInstall, LPCSTR szFolder, LPCSTR szFolderPath)
Definition: install.c:519

Referenced by main_test().

◆ test_view_get_error()

static void test_view_get_error ( MSIHANDLE  hinst)
static

Definition at line 1159 of file custom.c.

1160{
1161 MSIHANDLE db, view, rec;
1162 char buffer[5];
1164 DWORD sz;
1165 UINT r;
1166
1168 ok(hinst, db, "MsiGetActiveDatabase failed\n");
1169
1170 r = MsiDatabaseOpenViewA(db, "SELECT * FROM `test2`", &view);
1171 ok(hinst, !r, "got %u\n", r);
1172
1173 r = MsiViewExecute(view, 0);
1174 ok(hinst, !r, "got %u\n", r);
1175
1176 sz = 0;
1177 err = MsiViewGetErrorA(0, NULL, &sz);
1179 ok(hinst, sz == 0, "got size %lu\n", sz);
1180
1182 ok(hinst, err == MSIDBERROR_INVALIDARG, "got %d\n", err);
1183
1184 sz = 0;
1185 err = MsiViewGetErrorA(view, NULL, &sz);
1186 ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
1187 ok(hinst, sz == 0, "got size %lu\n", sz);
1188
1189 sz = 0;
1190 strcpy(buffer, "x");
1192 ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
1193 ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
1194 ok(hinst, sz == 0, "got size %lu\n", sz);
1195
1196 sz = 1;
1197 strcpy(buffer, "x");
1199 ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
1200 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
1201 ok(hinst, sz == 0, "got size %lu\n", sz);
1202
1203 rec = MsiCreateRecord(2);
1204 MsiRecordSetInteger(rec, 1, 1);
1205 MsiRecordSetInteger(rec, 2, 2);
1207 ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r);
1208
1209 sz = 2;
1210 strcpy(buffer, "x");
1212 ok(hinst, err == MSIDBERROR_DUPLICATEKEY, "got %d\n", err);
1213 ok(hinst, !strcmp(buffer, "A"), "got \"%s\"\n", buffer);
1214 ok(hinst, sz == 1, "got size %lu\n", sz);
1215
1216 sz = 2;
1217 strcpy(buffer, "x");
1219 todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
1220 todo_wine ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
1221 todo_wine ok(hinst, sz == 0, "got size %lu\n", sz);
1222
1224 ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r);
1225
1226 sz = 1;
1227 strcpy(buffer, "x");
1229 ok(hinst, err == MSIDBERROR_MOREDATA, "got %d\n", err);
1230 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
1231 ok(hinst, sz == 1, "got size %lu\n", sz);
1232
1233 sz = 1;
1234 strcpy(buffer, "x");
1236 todo_wine ok(hinst, err == MSIDBERROR_NOERROR, "got %d\n", err);
1237 ok(hinst, !buffer[0], "got \"%s\"\n", buffer);
1238 todo_wine ok(hinst, sz == 0, "got size %lu\n", sz);
1239
1241 ok(hinst, r == ERROR_INVALID_DATA, "got %u\n", r);
1242
1243 sz = 0;
1244 strcpy(buffer, "x");
1246 ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
1247 ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
1248 ok(hinst, sz == 0, "got size %lu\n", sz);
1249
1250 sz = 0;
1251 strcpy(buffer, "x");
1253 ok(hinst, err == MSIDBERROR_FUNCTIONERROR, "got %d\n", err);
1254 ok(hinst, !strcmp(buffer, "x"), "got \"%s\"\n", buffer);
1255 ok(hinst, sz == 0, "got size %lu\n", sz);
1256
1257 MsiCloseHandle(rec);
1259 MsiCloseHandle(db);
1260}
MSIDBERROR WINAPI MsiViewGetErrorA(MSIHANDLE handle, char *buffer, DWORD *buflen)
Definition: msiquery.c:820
@ MSIMODIFY_VALIDATE_NEW
Definition: msiquery.h:60
@ MSIDBERROR_NOERROR
Definition: msiquery.h:109
@ MSIDBERROR_DUPLICATEKEY
Definition: msiquery.h:110
@ MSIDBERROR_FUNCTIONERROR
Definition: msiquery.h:108
@ MSIDBERROR_INVALIDARG
Definition: msiquery.h:106
@ MSIDBERROR_MOREDATA
Definition: msiquery.h:107
#define err(...)
int MSIDBERROR
Definition: winemsi.idl:35
#define ERROR_INVALID_DATA
Definition: winerror.h:116

◆ tl_absent()

UINT WINAPI tl_absent ( MSIHANDLE  hinst)

Definition at line 2031 of file custom.c.

2032{
2033 ITypeLib *tlb;
2034 HRESULT hr;
2035
2036 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
2037 ok(hinst, hr == TYPE_E_LIBNOTREGISTERED, "got %#lx\n", hr);
2038
2039 return ERROR_SUCCESS;
2040}
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:531
static const GUID LIBID_register_test
Definition: custom.c:2016
#define TYPE_E_LIBNOTREGISTERED
Definition: winerror.h:2534

◆ tl_present()

UINT WINAPI tl_present ( MSIHANDLE  hinst)

Definition at line 2019 of file custom.c.

2020{
2021 ITypeLib *tlb;
2022 HRESULT hr;
2023
2024 hr = LoadRegTypeLib(&LIBID_register_test, 7, 1, 0, &tlb);
2025 ok(hinst, hr == S_OK, "got %#lx\n", hr);
2026 ITypeLib_Release(tlb);
2027
2028 return ERROR_SUCCESS;
2029}

◆ winetest_end_todo()

static void winetest_end_todo ( void  )
static

Definition at line 80 of file custom.c.

81{
82 todo_level >>= 1;
83}
static int todo_level
Definition: custom.c:45

◆ winetest_loop_todo()

static int winetest_loop_todo ( void  )
static

Definition at line 73 of file custom.c.

74{
77 return do_loop;
78}
static INT do_loop(const PropSheetInfo *psInfo)
Definition: propsheet.c:2800
static int todo_do_loop
Definition: custom.c:45

◆ winetest_start_todo()

static void winetest_start_todo ( int  is_todo)
static

Definition at line 67 of file custom.c.

68{
69 todo_level = (todo_level << 1) | (is_todo != 0);
71}

◆ wrv_absent()

UINT WINAPI wrv_absent ( MSIHANDLE  hinst)

Definition at line 2136 of file custom.c.

2137{
2138 HKEY key;
2139 LONG res;
2140
2141 res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
2142 ok(hinst, !res, "got %ld\n", res);
2143 check_reg_str(hinst, key, "sz", NULL);
2145
2146 return ERROR_SUCCESS;
2147}

◆ wrv_present()

UINT WINAPI wrv_present ( MSIHANDLE  hinst)

Definition at line 2123 of file custom.c.

2124{
2125 HKEY key;
2126 LONG res;
2127
2128 res = RegOpenKeyA(HKEY_CURRENT_USER, "msitest", &key);
2129 ok(hinst, !res, "got %ld\n", res);
2130 check_reg_str(hinst, key, "sz", "string");
2132
2133 return ERROR_SUCCESS;
2134}

Variable Documentation

◆ font_key

const char font_key[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
static

Definition at line 1865 of file custom.c.

Referenced by font_absent(), and font_present().

◆ global_state

int global_state
static

Definition at line 1374 of file custom.c.

Referenced by process1(), and process2().

◆ LIBID_register_test

const GUID LIBID_register_test
static
Initial value:
=
{0xeac5166a, 0x9734, 0x4d91, {0x87,0x8f, 0x1d,0xd0,0x23,0x04,0xc6,0x6c}}

Definition at line 2016 of file custom.c.

Referenced by test_LoadRegTypeLib(), test_register_typelib(), tl_absent(), and tl_present().

◆ name_dotnet

const char name_dotnet[]
static
Initial value:
= "Wine.Dotnet.Assembly,processorArchitecture=\"MSIL\","
"publicKeyToken=\"abcdef0123456789\",version=\"1.0.0.0\",culture=\"neutral\""

Definition at line 1643 of file custom.c.

Referenced by pa_absent(), pa_present(), and test_publish_assemblies().

◆ path_dotnet

const char path_dotnet[] = "Software\\Microsoft\\Installer\\Assemblies\\Global"
static

Definition at line 1642 of file custom.c.

Referenced by pa_absent(), pa_present(), and test_publish_assemblies().

◆ pf_classkey

const char pf_classkey[] = "Installer\\Features\\84A88FD7F6998CE40A22FB59F6B9C2BB"
static

Definition at line 1730 of file custom.c.

Referenced by pf_absent(), and pf_present().

◆ pf_userkey

const char pf_userkey[]
static
Initial value:
= "Software\\Microsoft\\Windows\\CurrentVersion\\"
"Installer\\UserData\\S-1-5-18\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\Features"

Definition at line 1731 of file custom.c.

Referenced by pf_absent(), and pf_present().

◆ pp_prodkey

const char pp_prodkey[] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB"
static

Definition at line 1768 of file custom.c.

Referenced by pp_absent(), and pp_present().

◆ ppc_key

const char ppc_key[]
static
Initial value:
= "Software\\Microsoft\\Windows\\CurrentVersion\\"
"Installer\\UserData\\S-1-5-18\\Components\\CBABC2FDCCB35E749A8944D8C1C098B5"

Definition at line 1674 of file custom.c.

Referenced by ppc_absent(), and ppc_present().

◆ pub_key

const char pub_key[] = "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA"
static

Definition at line 1705 of file custom.c.

Referenced by pub_absent(), and pub_present().

◆ rp_key

const char rp_key[]
static
Initial value:
= "Software\\Microsoft\\Windows\\CurrentVersion\\"
"Uninstall\\{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}"

Definition at line 1916 of file custom.c.

Referenced by rp_absent(), and rp_present().

◆ ru_key

const CHAR ru_key[]
static
Initial value:
= "Software\\Microsoft\\Windows\\CurrentVersion\\Installer"
"\\UserData\\S-1-5-18\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB\\InstallProperties"

Definition at line 1989 of file custom.c.

Referenced by ru_absent(), and ru_present().

◆ todo_do_loop

int todo_do_loop
static

Definition at line 45 of file custom.c.

Referenced by winetest_loop_todo(), and winetest_start_todo().

◆ todo_level

int todo_level
static

Definition at line 45 of file custom.c.

Referenced by winetest_end_todo(), and winetest_start_todo().