[APITESTS] Use StringCbPrintfA instead of sprintf

And fix a buffer size in Test_AddFontResourceA
This commit is contained in:
Victor Perevertkin 2019-08-17 23:04:41 +03:00
parent f7dc14cca5
commit 6b10706205
8 changed files with 36 additions and 32 deletions

View file

@ -18,9 +18,9 @@ PVOID LoadCodePageData(ULONG Code)
GetSystemDirectoryA(sysdir, MAX_PATH); GetSystemDirectoryA(sysdir, MAX_PATH);
if (Code != -1) if (Code != -1)
sprintf(filename, "%s\\c_%lu.nls", sysdir, Code); StringCbPrintfA(filename, sizeof(filename), "%s\\c_%lu.nls", sysdir, Code);
else else
sprintf(filename, "%s\\l_intl.nls", sysdir); StringCbPrintfA(filename, sizeof(filename), "%s\\l_intl.nls", sysdir);
hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)

View file

@ -17,6 +17,7 @@
#endif #endif
#include <winerror.h> #include <winerror.h>
#include <stdio.h> #include <stdio.h>
#include <strsafe.h>
#include "wine/test.h" #include "wine/test.h"
#include "apitest_iathook.h" #include "apitest_iathook.h"
@ -310,9 +311,9 @@ static void test_SdbGetPermLayerKeys(void)
skip("Skipping tests for HKLM, cannot alter the registry\n"); skip("Skipping tests for HKLM, cannot alter the registry\n");
} }
/* Fail from these paths */ /* Fail from these paths */
sprintf(tmp, "\\?\\%s", file); StringCbPrintfA(tmp, sizeof(tmp), "\\?\\%s", file);
expect_Sdb(tmp, GPLK_USER, FALSE, 0xffffffff, ""); expect_Sdb(tmp, GPLK_USER, FALSE, 0xffffffff, "");
sprintf(tmp, "\\??\\%s", file); StringCbPrintfA(tmp, sizeof(tmp), "\\??\\%s", file);
expect_Sdb(tmp, GPLK_USER, FALSE, 0xffffffff, ""); expect_Sdb(tmp, GPLK_USER, FALSE, 0xffffffff, "");
ok(setLayerValue(FALSE, file, "!#!# RUNASADMIN RUNASADMIN !# WINXPSP3 "), "Expected setLayerValue not to fail\n"); ok(setLayerValue(FALSE, file, "!#!# RUNASADMIN RUNASADMIN !# WINXPSP3 "), "Expected setLayerValue not to fail\n");

View file

@ -11,7 +11,7 @@
void Test_AddFontResourceA() void Test_AddFontResourceA()
{ {
CHAR szFileNameA[MAX_PATH]; CHAR szFileNameA[MAX_PATH*2 + 3];
CHAR szFileNameFont1A[MAX_PATH]; CHAR szFileNameFont1A[MAX_PATH];
CHAR szFileNameFont2A[MAX_PATH]; CHAR szFileNameFont2A[MAX_PATH];
int result; int result;
@ -24,7 +24,7 @@ void Test_AddFontResourceA()
memcpy(szFileNameFont2A,szFileNameA,MAX_PATH ); memcpy(szFileNameFont2A,szFileNameA,MAX_PATH );
strcat(szFileNameFont2A, "\\bin\\testdata\\test.otf"); strcat(szFileNameFont2A, "\\bin\\testdata\\test.otf");
RtlZeroMemory(szFileNameA,MAX_PATH); RtlZeroMemory(szFileNameA, sizeof(szFileNameA));
/* /*
* Start testing Ansi version * Start testing Ansi version

View file

@ -73,7 +73,7 @@ TestGetVolumeInformationW(VOID)
WCHAR Outbuf[MAX_PATH]; WCHAR Outbuf[MAX_PATH];
DWORD i, MCL, Flags, Len; DWORD i, MCL, Flags, Len;
memset(Outbuf, 0xAA, MAX_PATH); memset(Outbuf, 0xAA, sizeof(Outbuf));
Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, MAX_PATH); Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, MAX_PATH);
ok(Ret != FALSE, "GetVolumeInformationW failed: %ld\n", GetLastError()); ok(Ret != FALSE, "GetVolumeInformationW failed: %ld\n", GetLastError());
for (i = 0; i < MAX_PATH; ++i) for (i = 0; i < MAX_PATH; ++i)
@ -85,7 +85,7 @@ TestGetVolumeInformationW(VOID)
} }
ok(i != MAX_PATH, "String was not null terminated!\n"); ok(i != MAX_PATH, "String was not null terminated!\n");
memset(Outbuf, 0xAA, MAX_PATH); memset(Outbuf, 0xAA, sizeof(Outbuf));
Len = i; Len = i;
Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, Len + 1); Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, Len + 1);
ok(Ret != FALSE, "GetVolumeInformationW failed: %ld\n", GetLastError()); ok(Ret != FALSE, "GetVolumeInformationW failed: %ld\n", GetLastError());
@ -99,7 +99,7 @@ TestGetVolumeInformationW(VOID)
ok(i != MAX_PATH, "String was not null terminated!\n"); ok(i != MAX_PATH, "String was not null terminated!\n");
ok(i == Len, "String was truncated\n"); ok(i == Len, "String was truncated\n");
memset(Outbuf, 0xAA, MAX_PATH); memset(Outbuf, 0xAA, sizeof(Outbuf));
Len = i; Len = i;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, Len); Ret = GetVolumeInformationW(L"C:\\", NULL, 0, NULL, &MCL, &Flags, Outbuf, Len);

View file

@ -57,7 +57,7 @@ typedef struct UNICODE_STRING {
USHORT Length; USHORT Length;
USHORT MaximumLength; USHORT MaximumLength;
PWSTR Buffer; PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING; } UNICODE_STRING, *PUNICODE_STRING;
typedef struct _RTLP_CURDIR_REF typedef struct _RTLP_CURDIR_REF
{ {
@ -207,7 +207,8 @@ typedef struct DirComponents
char szCD[512]; char szCD[512];
char szCDPlusSlash[512]; char szCDPlusSlash[512];
char* pszLastCDComponent; char* pszLastCDComponent;
char szCurDrive[4]; char szCurDrive[3];
char reserved1;
char szCurDriveSlash[4]; char szCurDriveSlash[4];
char szParentDir[512]; char szParentDir[512];
char szParentDirPlusSlash[512]; char szParentDirPlusSlash[512];
@ -346,7 +347,7 @@ int main()
#endif // PRINT_INFO #endif // PRINT_INFO
DirComponents cd; DirComponents cd;
char szTmp[512]; char szTmp[518];
#ifndef COMPILE_AS_ROSTEST #ifndef COMPILE_AS_ROSTEST
InitFunctionPointer(); InitFunctionPointer();

View file

@ -76,9 +76,9 @@ PVOID LoadCodePageData(ULONG Code)
GetSystemDirectoryA(sysdir, MAX_PATH); GetSystemDirectoryA(sysdir, MAX_PATH);
if (Code != -1) if (Code != -1)
sprintf(filename, "%s\\c_%lu.nls", sysdir, Code); StringCbPrintfA(filename, sizeof(filename), "%s\\c_%lu.nls", sysdir, Code);
else else
sprintf(filename, "%s\\l_intl.nls", sysdir); StringCbPrintfA(filename, sizeof(filename), "%s\\l_intl.nls", sysdir);
hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)

View file

@ -25,6 +25,7 @@
#include <winreg.h> #include <winreg.h>
#include <winsvc.h> #include <winsvc.h>
#include <setupapi.h> #include <setupapi.h>
#include <strsafe.h>
static const char inffile[] = "test.inf"; static const char inffile[] = "test.inf";
static char CURR_DIR[MAX_PATH]; static char CURR_DIR[MAX_PATH];
@ -56,7 +57,7 @@ static void test_SetupDiInstallClassExA(void)
/* [Version]:Signature */ /* [Version]:Signature */
strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n"); strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -68,7 +69,7 @@ static void test_SetupDiInstallClassExA(void)
/* [Version]:Signature+Class */ /* [Version]:Signature+Class */
strcat(inf, "Class=MySampleClass\n"); strcat(inf, "Class=MySampleClass\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -80,7 +81,7 @@ static void test_SetupDiInstallClassExA(void)
/* [Version]:Signature+Class+ClassGUID */ /* [Version]:Signature+Class+ClassGUID */
strcat(inf, "ClassGuid={3b409830-5f9d-432a-abf5-7d2e4e102467}\n"); strcat(inf, "ClassGuid={3b409830-5f9d-432a-abf5-7d2e4e102467}\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -92,7 +93,7 @@ static void test_SetupDiInstallClassExA(void)
/* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]Empty */ /* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]Empty */
strcat(inf, "[ClassInstall32.NT]\n"); strcat(inf, "[ClassInstall32.NT]\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -104,13 +105,13 @@ static void test_SetupDiInstallClassExA(void)
{ {
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle); RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle);
del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}"); del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}");
ok(del == ERROR_SUCCESS, "Expected success \n"); ok(del == ERROR_SUCCESS, "Expected success \n");
} }
/* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg */ /* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg */
strcat(inf, "AddReg=SampleClassAddReg\n"); strcat(inf, "AddReg=SampleClassAddReg\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -122,13 +123,13 @@ static void test_SetupDiInstallClassExA(void)
{ {
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle); RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle);
del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}"); del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}");
ok(del == ERROR_SUCCESS, "Expected success \n"); ok(del == ERROR_SUCCESS, "Expected success \n");
} }
/* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg; [SampleClassAddReg];*/ /* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg; [SampleClassAddReg];*/
strcat(inf, "[SampleClassAddReg]\n"); strcat(inf, "[SampleClassAddReg]\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -140,13 +141,13 @@ static void test_SetupDiInstallClassExA(void)
{ {
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle); RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle);
del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}"); del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}");
ok(del == ERROR_SUCCESS, "Expected success \n"); ok(del == ERROR_SUCCESS, "Expected success \n");
} }
/* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg; [SampleClassAddReg]HKR;*/ /* [Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg; [SampleClassAddReg]HKR;*/
strcat(inf, "HKR,,,,\"ReactOS Test SetupDiInstallClassExA\"\n"); strcat(inf, "HKR,,,,\"ReactOS Test SetupDiInstallClassExA\"\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -158,13 +159,13 @@ static void test_SetupDiInstallClassExA(void)
{ {
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle); RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle);
del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}"); del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}");
ok(del == ERROR_SUCCESS, "Expected success \n"); ok(del == ERROR_SUCCESS, "Expected success \n");
} }
/*[Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg;[SampleClassAddReg]HKR;[ClassInstall32.NT.Services]*/ /*[Version]Signature+Class+ClassGUID;[ClassInstall32.NT]AddReg;[SampleClassAddReg]HKR;[ClassInstall32.NT.Services]*/
strcat(inf, "[ClassInstall32.NT.Services]\n"); strcat(inf, "[ClassInstall32.NT.Services]\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL); ret = SetupDiInstallClassExA(NULL, path, DI_QUIETINSTALL, NULL, NULL, NULL,NULL);
@ -176,7 +177,7 @@ static void test_SetupDiInstallClassExA(void)
{ {
RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle); RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM", 0, KEY_ALL_ACCESS, &RegHandle);
del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}"); del = RegDeleteKeyW(RegHandle, L"CurrentControlSet\\Control\\Class\\{3B409830-5F9D-432A-ABF5-7D2E4E102467}");
ok(del == ERROR_SUCCESS, "Expected success\n"); ok(del == ERROR_SUCCESS, "Expected success\n");
} }
/* Add a reference */ /* Add a reference */

View file

@ -25,6 +25,7 @@
#include <winreg.h> #include <winreg.h>
#include <winsvc.h> #include <winsvc.h>
#include <setupapi.h> #include <setupapi.h>
#include <strsafe.h>
static const char inffile[] = "test.inf"; static const char inffile[] = "test.inf";
static char CURR_DIR[MAX_PATH]; static char CURR_DIR[MAX_PATH];
@ -72,7 +73,7 @@ static void test_SetupInstallServicesFromInfSectionExA(void)
/* Basic inf file to satisfy SetupOpenInfFileA */ /* Basic inf file to satisfy SetupOpenInfFileA */
strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n"); strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL); infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
/* Nothing but the Version section */ /* Nothing but the Version section */
@ -193,7 +194,7 @@ static void test_SetupInstallServicesFromInfSectionExA(void)
strcat(inf, "[XSP.InstallPerVer]\n"); strcat(inf, "[XSP.InstallPerVer]\n");
strcat(inf, "AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n"); strcat(inf, "AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL); infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -227,7 +228,7 @@ static void test_SetupInstallServicesFromInfSectionExW(void)
/* Basic inf file to satisfy SetupOpenInfFileA */ /* Basic inf file to satisfy SetupOpenInfFileA */
strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n"); strcpy(inf, "[Version]\nSignature=\"$Chicago$\"\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL); infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
/* Nothing but the Version section */ /* Nothing but the Version section */
@ -348,7 +349,7 @@ static void test_SetupInstallServicesFromInfSectionExW(void)
strcat(inf, "[XSP.InstallPerVer]\n"); strcat(inf, "[XSP.InstallPerVer]\n");
strcat(inf, "AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n"); strcat(inf, "AddReg=AspEventlogMsg.Reg,Perf.Reg,AspVersions.Reg,FreeADO.Reg,IndexServer.Reg\n");
create_inf_file(inffile, inf); create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile); StringCbPrintfA(path, sizeof(path), "%s\\%s", CURR_DIR, inffile);
infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL); infhandle = SetupOpenInfFileA(path, NULL, INF_STYLE_WIN4, NULL);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -364,7 +365,7 @@ static void test_SetupInstallServicesFromInfSectionExW(void)
START_TEST(SetupInstallServicesFromInfSectionEx) START_TEST(SetupInstallServicesFromInfSectionEx)
{ {
char temp_path[MAX_PATH], prev_path[MAX_PATH]; char temp_path[MAX_PATH], prev_path[MAX_PATH];
GetCurrentDirectoryA(MAX_PATH, prev_path); GetCurrentDirectoryA(MAX_PATH, prev_path);
GetTempPathA(MAX_PATH, temp_path); GetTempPathA(MAX_PATH, temp_path);