#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.
60 DWORD dwNumberOfBytesWritten;
64 static const char data[] =
66 "Signature=\"$Chicago$\"\n" 69 "CheckAdminRights=1\n";
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
#define FILE_ATTRIBUTE_NORMAL
#define CreateFileA(a, b, c, d, e, f, g)
Referenced by test_LaunchINFSection(), test_LaunchINFSectionEx(), and test_RunSetupCommand().
◆ HRESULT()
◆ init_function_pointers()
static BOOL init_function_pointers |
( |
void |
| ) |
|
|
static |
Definition at line 34 of file install.c.
44 if (!pRunSetupCommand || !pLaunchINFSection || !pLaunchINFSectionEx)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
#define GetProcAddress(x, y)
Referenced by START_TEST().
◆ is_spapi_err()
◆ START_TEST()
Definition at line 285 of file install.c.
295 skip(
"Most tests need admin rights\n");
static void test_LaunchINFSection(void)
BOOL WINAPI IsNTAdmin(DWORD reserved, LPDWORD pReserved)
static char CURR_DIR[MAX_PATH]
static void test_LaunchINFSectionEx(void)
static void test_RunSetupCommand(void)
static BOOL init_function_pointers(void)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
int WINAPI lstrlenA(LPCSTR lpString)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
◆ test_LaunchINFSection()
static void test_LaunchINFSection |
( |
void |
| ) |
|
|
static |
Definition at line 208 of file install.c.
212 static char file[] =
"test.inf,DefaultInstall,4,0";
213 static char file2[] =
"test.inf,,1,0";
222 ok(
hr == 1,
"Expected 1, got %d\n",
hr);
233 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
242 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
245 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
static char CURR_DIR[MAX_PATH]
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
static void create_inf_file(LPCSTR filename)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Referenced by START_TEST().
◆ test_LaunchINFSectionEx()
static void test_LaunchINFSectionEx |
( |
void |
| ) |
|
|
static |
Definition at line 250 of file install.c.
262 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
267 lstrcatA(
cmdline,
"\\test.inf\",\"DefaultInstall\",\"c:,imacab.cab\",\"4\"");
269 ok(
hr == 0,
"Expected 0, got %d\n",
hr);
static char CURR_DIR[MAX_PATH]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
static void create_inf_file(LPCSTR filename)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Referenced by START_TEST().
◆ test_RunSetupCommand()
static void test_RunSetupCommand |
( |
void |
| ) |
|
|
static |
Definition at line 75 of file install.c.
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");
109 hexe = (
HANDLE)0xdeadbeef;
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");
121 hexe = (
HANDLE)0xdeadbeef;
126 ok(hexe == (
HANDLE)(
ULONG_PTR)0xdeadbeefdeadbeefull,
"Expected hexe to be 0xdeadbeef\n");
128 ok(hexe == (
HANDLE)0xdeadbeef,
"Expected hexe to be 0xdeadbeef\n");
136 hexe = (
HANDLE)0xdeadbeef;
138 hr = pRunSetupCommand(
NULL,
"winver.exe",
"Install", systemdir,
"Title", &hexe, 0,
NULL);
140 ok(hexe !=
NULL,
"Expected hexe to be non-NULL\n");
157 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
170 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
183 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
201 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d\n",
hr);
#define ERROR_INVALID_PARAMETER
static BOOL is_spapi_err(DWORD err)
#define HRESULT_FROM_WIN32(x)
static char CURR_DIR[MAX_PATH]
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
#define ERROR_FILE_NOT_FOUND
static void create_inf_file(LPCSTR filename)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Referenced by START_TEST().
◆ CURR_DIR
◆ DWORD
◆ hAdvPack
◆ HINSTANCE
◆ INT
◆ LPCSTR
◆ LPSTR
◆ LPVOID