#include <stdio.h>
#include <windows.h>
#include <advpub.h>
#include "wine/test.h"
Go to the source code of this file.
◆ create_inf_file()
Definition at line 58 of file install.c.
59{
60 DWORD dwNumberOfBytesWritten;
63
64 static const char data[] =
65 "[Version]\n"
66 "Signature=\"$Chicago$\"\n"
67 "AdvancedINF=2.5\n"
68 "[DefaultInstall]\n"
69 "CheckAdminRights=1\n";
70
73}
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
◆ HRESULT()
◆ init_function_pointers()
static BOOL init_function_pointers |
( |
void |
| ) |
|
|
static |
Definition at line 34 of file install.c.
35{
39
43
44 if (!pRunSetupCommand || !pLaunchINFSection || !pLaunchINFSectionEx)
46
48}
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Referenced by START_TEST().
◆ is_spapi_err()
◆ START_TEST()
Definition at line 285 of file install.c.
286{
289
291 return;
292
294 {
295 skip(
"Most tests need admin rights\n");
296 return;
297 }
298
302
305
308
312
315}
BOOL WINAPI IsNTAdmin(DWORD reserved, LPDWORD pReserved)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
static BOOL init_function_pointers(void)
static char CURR_DIR[MAX_PATH]
static void test_LaunchINFSectionEx(void)
static void test_RunSetupCommand(void)
static void test_LaunchINFSection(void)
◆ test_LaunchINFSection()
static void test_LaunchINFSection |
( |
void |
| ) |
|
|
static |
Definition at line 208 of file install.c.
209{
212 static char file[] =
"test.inf,DefaultInstall,4,0";
213 static char file2[] = "test.inf,,1,0";
214
215
216
217
219 {
220
222 ok(
hr == 1,
"Expected 1, got %d\n",
hr);
223 }
224
227
228
233 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
234
237
239
240
242 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
243
245 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
246
248}
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
static void create_inf_file(void)
Referenced by START_TEST().
◆ test_LaunchINFSectionEx()
static void test_LaunchINFSectionEx |
( |
void |
| ) |
|
|
static |
Definition at line 250 of file install.c.
251{
254
256
257
262 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
263
264
267 lstrcatA(
cmdline,
"\\test.inf\",\"DefaultInstall\",\"c:,imacab.cab\",\"4\"");
269 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
270
271
272
273
275 {
276
280 }
281
283}
Referenced by START_TEST().
◆ test_RunSetupCommand()
static void test_RunSetupCommand |
( |
void |
| ) |
|
|
static |
Definition at line 75 of file install.c.
76{
82
84
85
88
89
92
93
94#ifdef __REACTOS__
96#else
98#endif
99 hr = pRunSetupCommand(
NULL,
"idontexist.exe",
"Install", systemdir,
"Title", &hexe, 0,
NULL);
101 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d\n",
hr);
102 ok(hexe ==
NULL,
"Expected hexe to be NULL\n");
104
105
106#ifdef __REACTOS__
108#else
109 hexe = (
HANDLE)0xdeadbeef;
110#endif
111 hr = pRunSetupCommand(
NULL,
"winver.exe",
"Install",
"non\\existent\\directory",
"Title", &hexe, 0,
NULL);
113 "Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %d\n",
hr);
114 ok(hexe ==
NULL,
"Expected hexe to be NULL\n");
116
117
118#ifdef __REACTOS__
120#else
121 hexe = (
HANDLE)0xdeadbeef;
122#endif
125#ifdef __REACTOS__
126 ok(hexe == (
HANDLE)(
ULONG_PTR)0xdeadbeefdeadbeefull,
"Expected hexe to be 0xdeadbeef\n");
127#else
128 ok(hexe == (
HANDLE)0xdeadbeef,
"Expected hexe to be 0xdeadbeef\n");
129#endif
131
132
133#ifdef __REACTOS__
135#else
136 hexe = (
HANDLE)0xdeadbeef;
137#endif
138 hr = pRunSetupCommand(
NULL,
"winver.exe",
"Install", systemdir,
"Title", &hexe, 0,
NULL);
140 ok(hexe !=
NULL,
"Expected hexe to be non-NULL\n");
142
145
146
153
154
157 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
158
159
162
163
166
167
170 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
171
172
175
176
179
180
183 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
184
185
188
191
193
194
197
198
201 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
202
203
206}
#define ERROR_INVALID_PARAMETER
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
#define ERROR_FILE_NOT_FOUND
static BOOL is_spapi_err(DWORD err)
#define HRESULT_FROM_WIN32(x)
Referenced by START_TEST().
◆ CURR_DIR
Definition at line 32 of file install.c.
Referenced by add_file(), check_dirid(), create_database_wordcount(), delete_cab_files(), set_cab_parameters(), START_TEST(), test_cmdline(), test_currentworkingdir(), test_driver_install(), test_inffilelist(), test_inffilelistA(), test_install_from(), test_install_svc_from(), test_LaunchINFSection(), test_LaunchINFSectionEx(), test_MsiSetComponentState(), test_packagecoltypes(), test_profile_items(), test_registry(), test_RunSetupCommand(), and test_sourcedirprop().
◆ DWORD
◆ hAdvPack
◆ HINSTANCE
◆ INT
◆ LPCSTR
◆ LPSTR
◆ LPVOID