39 static const char empty[] =
"",
40 regedit[] =
"regedit",
41 regedit_exe[] =
"regedit.exe";
53 ok(dwCur == 1,
"Wrong length of buffer for current location: "
54 "got %d(%s) expected 1\n", dwCur, curdir);
55 ok(dwOut == 1,
"Wrong length of buffer for the recommended installation location: "
56 "got %d(%s) expected 1\n", dwOut, outBuf);
59 ok(dwCur ==
MAX_PATH,
"Wrong length of buffer for current location: "
60 "got %d(%s) expected MAX_PATH\n", dwCur, curdir);
61 ok(dwOut ==
MAX_PATH,
"Wrong length of buffer for the recommended installation location: "
62 "got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
65 ok(0,
"Got unexpected return value %x\n",
ret);
69 trace(
"GetWindowsDirectoryA failed\n");
71 sprintf(appdir,
"%s\\regedit.exe", windir);
73 trace(
"GetFileAttributesA(%s) failed\n", appdir);
82 ok(dwCur == 1 +
strlen(windir),
"Wrong length of buffer for current location: "
83 "got %d(%s) expected %d\n", dwCur, curdir,
lstrlenA(windir)+1);
84 ok(dwOut == 1,
"Wrong length of buffer for the recommended installation location: "
85 "got %d(%s) expected 1\n", dwOut, outBuf);
88 ok(dwCur ==
MAX_PATH,
"Wrong length of buffer for current location: "
89 "got %d(%s) expected MAX_PATH\n", dwCur, curdir);
90 ok(dwOut ==
MAX_PATH,
"Wrong length of buffer for the recommended installation location: "
91 "got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
94 ok(0,
"Got unexpected return value %x\n",
ret);
104 ok(dwCur == 1 +
strlen(windir),
"Wrong length of buffer for current location: "
105 "got %d(%s) expected %d\n", dwCur, curdir,
lstrlenA(windir)+1);
106 ok(dwOut == 1,
"Wrong length of buffer for the recommended installation location: "
107 "got %d(%s) expected 1\n", dwOut, outBuf);
110 ok(dwCur ==
MAX_PATH,
"Wrong length of buffer for current location: "
111 "got %d(%s) expected MAX_PATH\n", dwCur, curdir);
112 ok(dwOut ==
MAX_PATH,
"Wrong length of buffer for the recommended installation location: "
113 "got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
116 ok(0,
"Got unexpected return value %x\n",
ret);
124 ok(0,
"GetSystemDirectoryA, SHGetSpecialFolderPathA, GetTempPathA or GetTempFileNameA failed\n");
140 ok(dwOut == 1,
"Wrong length of buffer for the recommended installation location"
141 "got %d(%s) expected 1\n", dwOut, outBuf);
144 ok(dwOut ==
MAX_PATH,
"Wrong length of buffer for the recommended installation location"
145 "got %d(%s) expected MAX_PATH\n", dwOut, outBuf);
157 ok(dwOut == 1 +
strlen(windir),
"Wrong length of buffer for current location: "
158 "got %d(%s) expected %d\n", dwOut, outBuf,
lstrlenA(windir)+1);
166 ok(dwOut == 1 +
strlen(appdir),
"Wrong length of buffer for current location: "
167 "got %d(%s) expected %d\n", dwOut, outBuf,
lstrlenA(appdir)+1);
204 ok(!
ret,
"Wrong return value got %x expected 0\n",
ret);
209 ok(!
ret,
"Wrong return value got %x expected 0\n",
ret);
266 ok(!
ret,
"Wrong return value got %x expected 0\n",
ret);
271 ok(!
ret,
"Wrong return value got %x expected 0\n",
ret);
280 ret =
VerFindFileA(0,
"doesnotexist.exe",
NULL,
"C:\\random_path_does_not_exist", curdir, &dwCur, outBuf, &dwOut);
312 static const CHAR szSrcFileName[] =
"nofile.txt";
313 static const CHAR szDestFileName[] =
"nofile2.txt";
314 static const CHAR szSrcDir[] =
"D:\\oes\\not\\exist";
315 static const CHAR szDestDir[] =
"D:\\oes\\not\\exist\\either";
316 static const CHAR szCurDir[] =
"C:\\";
319 memset(tmpname,0,
sizeof(tmpname));
321 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
322 memset(tmpname,0,
sizeof(tmpname));
325 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
326 memset(tmpname,0,
sizeof(tmpname));
329 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
330 memset(tmpname,0,
sizeof(tmpname));
333 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
337 memset(tmpname,0,
sizeof(tmpname));
340 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
341 memset(tmpname,0,
sizeof(tmpname));
343 rc =
VerInstallFileA(0x0, szSrcFileName, szDestFileName, szSrcDir, szDestDir, szCurDir, tmpname, &
size);
344 ok (rc == 0x10000 && tmpname[0]==0,
" expected return 0x10000 and no tempname, got %08x/\'%s\'\n",rc,tmpname);
ACPI_SIZE strlen(const char *String)
static const WCHAR empty[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SHGetSpecialFolderPathA(HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate)
DWORD WINAPI VerFindFileA(DWORD flags, LPCSTR lpszFilename, LPCSTR lpszWinDir, LPCSTR lpszAppDir, LPSTR lpszCurDir, PUINT lpuCurDirLen, LPSTR lpszDestDir, PUINT lpuDestDirLen)
DWORD WINAPI VerInstallFileA(DWORD flags, LPCSTR srcfilename, LPCSTR destfilename, LPCSTR srcdir, LPCSTR destdir, LPCSTR curdir, LPSTR tmpfile, PUINT tmpfilelen)
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
int WINAPI lstrlenA(LPCSTR lpString)
#define memmove(s1, s2, n)
#define sprintf(buf, format,...)
static void test_find_file(void)
static void test_install_file(void)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define CSIDL_PROGRAM_FILES
#define VFFF_ISSHAREDFILE
#define INVALID_FILE_ATTRIBUTES