Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9d03aa32
Commit
9d03aa32
authored
Oct 29, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Enable compilation with -D__WINESRC__.
parent
60f62f4d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
83 deletions
+82
-83
Makefile.in
dlls/setupapi/tests/Makefile.in
+0
-1
devinst.c
dlls/setupapi/tests/devinst.c
+5
-5
install.c
dlls/setupapi/tests/install.c
+40
-40
misc.c
dlls/setupapi/tests/misc.c
+30
-30
parser.c
dlls/setupapi/tests/parser.c
+3
-3
query.c
dlls/setupapi/tests/query.c
+2
-2
setupcab.c
dlls/setupapi/tests/setupcab.c
+2
-2
No files found.
dlls/setupapi/tests/Makefile.in
View file @
9d03aa32
TESTDLL
=
setupapi.dll
IMPORTS
=
setupapi user32 advapi32
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
devinst.c
\
...
...
dlls/setupapi/tests/devinst.c
View file @
9d03aa32
...
...
@@ -241,7 +241,7 @@ static void clean_devclass_key(void)
* the keys under the DeviceClasses key after a SetupDiDestroyDeviceInfoList.
*/
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
devclass
,
&
key
);
RegQueryInfoKey
(
key
,
NULL
,
NULL
,
NULL
,
&
subkeys
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
RegQueryInfoKey
W
(
key
,
NULL
,
NULL
,
NULL
,
&
subkeys
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
subkeys
>
0
)
{
trace
(
"We are most likely on Windows 2000
\n
"
);
...
...
@@ -342,8 +342,8 @@ static void test_SetupDiOpenClassRegKeyExA(void)
static
void
create_inf_file
(
LPCSTR
filename
)
{
DWORD
dwNumberOfBytesWritten
;
HANDLE
hf
=
CreateFile
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
HANDLE
hf
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
static
const
char
data
[]
=
"[Version]
\n
"
...
...
@@ -410,7 +410,7 @@ static void testInstallClass(void)
ok
(
!
RegDeleteKeyW
(
HKEY_LOCAL_MACHINE
,
classKey
),
"Couldn't delete classkey
\n
"
);
DeleteFile
(
tmpfile
);
DeleteFile
A
(
tmpfile
);
}
static
void
testCreateDeviceInfo
(
void
)
...
...
@@ -533,7 +533,7 @@ static void testCreateDeviceInfo(void)
DWORD
subkeys
;
/* Check if we have subkeys */
RegQueryInfoKey
(
key
,
NULL
,
NULL
,
NULL
,
&
subkeys
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
RegQueryInfoKey
A
(
key
,
NULL
,
NULL
,
NULL
,
&
subkeys
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
subkeys
>
0
)
{
int
i
;
...
...
dlls/setupapi/tests/install.c
View file @
9d03aa32
...
...
@@ -63,7 +63,7 @@ static BOOL (WINAPI *pSetupGetInfFileListW)(PCWSTR, DWORD, PWSTR, DWORD, PDWORD)
static
void
create_inf_file
(
LPCSTR
filename
,
const
char
*
data
)
{
DWORD
res
;
HANDLE
handle
=
CreateFile
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
HANDLE
handle
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
assert
(
handle
!=
INVALID_HANDLE_VALUE
);
assert
(
WriteFile
(
handle
,
data
,
strlen
(
data
),
&
res
,
NULL
));
...
...
@@ -107,7 +107,7 @@ static void ok_registry(BOOL expectsuccess)
LONG
ret
;
/* Functional tests for success of install and clean up */
ret
=
RegDeleteKey
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest"
);
ret
=
RegDeleteKey
A
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest"
);
ok
((
expectsuccess
&&
ret
==
ERROR_SUCCESS
)
||
(
!
expectsuccess
&&
ret
==
ERROR_FILE_NOT_FOUND
),
"Expected registry key Software
\\
Wine
\\
setupapitest to %s, RegDeleteKey returned %d
\n
"
,
...
...
@@ -126,7 +126,7 @@ static void test_cmdline(void)
sprintf
(
path
,
"%s
\\
%s"
,
CURR_DIR
,
inffile
);
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
ok_registry
(
TRUE
);
ret
=
DeleteFile
(
inffile
);
ret
=
DeleteFile
A
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
/* Test handling of spaces in path, unquoted and quoted */
...
...
@@ -140,7 +140,7 @@ static void test_cmdline(void)
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
ok_registry
(
FALSE
);
ret
=
DeleteFile
(
infwithspaces
);
ret
=
DeleteFile
A
(
infwithspaces
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
...
...
@@ -180,7 +180,7 @@ static void test_registry(void)
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest
\\
setupapitest"
);
RegDeleteKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest"
);
}
ret
=
DeleteFile
(
inffile
);
ret
=
DeleteFile
A
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
...
...
@@ -216,7 +216,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_SECTION_NOT_FOUND
,
"Expected ERROR_SECTION_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Add the section */
strcat
(
inf
,
"[Winetest.Services]
\n
"
);
...
...
@@ -228,7 +228,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_SECTION_NOT_FOUND
,
"Expected ERROR_SECTION_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Add a reference */
strcat
(
inf
,
"AddService=Winetest,,Winetest.Service
\n
"
);
...
...
@@ -240,7 +240,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_BAD_SERVICE_INSTALLSECT
,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Add the section */
strcat
(
inf
,
"[Winetest.Service]
\n
"
);
...
...
@@ -252,7 +252,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_BAD_SERVICE_INSTALLSECT
,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Just the ServiceBinary */
strcat
(
inf
,
"ServiceBinary=%12%
\\
winetest.sys
\n
"
);
...
...
@@ -264,7 +264,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_BAD_SERVICE_INSTALLSECT
,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Add the ServiceType */
strcat
(
inf
,
"ServiceType=1
\n
"
);
...
...
@@ -276,7 +276,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_BAD_SERVICE_INSTALLSECT
,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* Add the StartType */
strcat
(
inf
,
"StartType=4
\n
"
);
...
...
@@ -288,7 +288,7 @@ static void test_install_svc_from(void)
ok
(
GetLastError
()
==
ERROR_BAD_SERVICE_INSTALLSECT
,
"Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* This should be it, the minimal entries to install a service */
strcat
(
inf
,
"ErrorControl=1"
);
...
...
@@ -300,14 +300,14 @@ static void test_install_svc_from(void)
{
skip
(
"Not enough rights to install the service
\n
"
);
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
return
;
}
ok
(
ret
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
scm_handle
=
OpenSCManagerA
(
NULL
,
NULL
,
GENERIC_ALL
);
...
...
@@ -334,7 +334,7 @@ static void test_install_svc_from(void)
ok
(
ret
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
infhandle
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
/* TODO: Test the Flags */
}
...
...
@@ -395,7 +395,7 @@ static void test_driver_install(void)
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
/* Driver should have been installed */
attrs
=
GetFileAttributes
(
driver
);
attrs
=
GetFileAttributes
A
(
driver
);
ok
(
attrs
!=
INVALID_FILE_ATTRIBUTES
,
"Expected driver to exist
\n
"
);
scm_handle
=
OpenSCManagerA
(
NULL
,
NULL
,
GENERIC_ALL
);
...
...
@@ -412,9 +412,9 @@ static void test_driver_install(void)
CloseServiceHandle
(
scm_handle
);
/* File cleanup */
DeleteFile
(
inffile
);
DeleteFile
(
"winetest.sys"
);
DeleteFile
(
driver
);
DeleteFile
A
(
inffile
);
DeleteFile
A
(
"winetest.sys"
);
DeleteFile
A
(
driver
);
}
static
void
test_profile_items
(
void
)
...
...
@@ -458,34 +458,34 @@ static void test_profile_items(void)
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem.lnk"
,
commonprogs
);
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributes
(
path
))
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributes
A
(
path
))
{
win_skip
(
"ProfileItems not implemented on this system
\n
"
);
}
else
{
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir"
,
commonprogs
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
(
path
),
"directory not created
\n
"
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
A
(
path
),
"directory not created
\n
"
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir
\\
TestItem2.lnk"
,
commonprogs
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
(
path
),
"link not created
\n
"
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
A
(
path
),
"link not created
\n
"
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestGroup"
,
commonprogs
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
(
path
),
"group not created
\n
"
);
ok
(
INVALID_FILE_ATTRIBUTES
!=
GetFileAttributes
A
(
path
),
"group not created
\n
"
);
}
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem.lnk"
,
commonprogs
);
DeleteFile
(
path
);
DeleteFile
A
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir
\\
TestItem2.lnk"
,
commonprogs
);
DeleteFile
(
path
);
DeleteFile
A
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestItem2.lnk"
,
commonprogs
);
DeleteFile
(
path
);
DeleteFile
A
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestDir"
,
commonprogs
);
RemoveDirectory
(
path
);
RemoveDirectory
A
(
path
);
snprintf
(
path
,
MAX_PATH
,
"%s
\\
TestGroup"
,
commonprogs
);
RemoveDirectory
(
path
);
RemoveDirectory
A
(
path
);
cleanup:
if
(
hShell32
)
FreeLibrary
(
hShell32
);
DeleteFile
(
inffile
);
DeleteFile
A
(
inffile
);
}
static
void
test_inffilelistA
(
void
)
...
...
@@ -541,8 +541,8 @@ static void test_inffilelistA(void)
ok
(
!
lstrcmpA
(
p
,
inffile2
)
||
!
lstrcmpA
(
p
,
inffile
),
"unexpected filename %s
\n
"
,
p
);
DeleteFile
(
inffile
);
DeleteFile
(
inffile2
);
DeleteFile
A
(
inffile
);
DeleteFile
A
(
inffile2
);
SetCurrentDirectoryA
(
CURR_DIR
);
RemoveDirectoryA
(
dir
);
}
...
...
@@ -711,22 +711,22 @@ static void test_inffilelist(void)
ok
(
!
lstrcmpW
(
p
,
inffile2W
)
||
!
lstrcmpW
(
p
,
inffileW
)
||
!
lstrcmpW
(
p
,
invalid_infW
),
"unexpected filename %s
\n
"
,
wine_dbgstr_w
(
p
));
DeleteFile
(
inffile
);
DeleteFile
(
inffile2
);
DeleteFile
(
invalid_inf
);
DeleteFile
A
(
inffile
);
DeleteFile
A
(
inffile2
);
DeleteFile
A
(
invalid_inf
);
SetCurrentDirectoryA
(
CURR_DIR
);
RemoveDirectoryA
(
dirA
);
}
START_TEST
(
install
)
{
HMODULE
hsetupapi
=
GetModuleHandle
(
"setupapi.dll"
);
HMODULE
hsetupapi
=
GetModuleHandle
A
(
"setupapi.dll"
);
char
temp_path
[
MAX_PATH
],
prev_path
[
MAX_PATH
];
DWORD
len
;
GetCurrentDirectory
(
MAX_PATH
,
prev_path
);
GetTempPath
(
MAX_PATH
,
temp_path
);
SetCurrentDirectory
(
temp_path
);
GetCurrentDirectory
A
(
MAX_PATH
,
prev_path
);
GetTempPath
A
(
MAX_PATH
,
temp_path
);
SetCurrentDirectory
A
(
temp_path
);
strcpy
(
CURR_DIR
,
temp_path
);
len
=
strlen
(
CURR_DIR
);
...
...
@@ -753,7 +753,7 @@ START_TEST(install)
skip
(
"InstallHinfSectionA is broken (stub)
\n
"
);
pInstallHinfSectionA
=
NULL
;
}
ret
=
DeleteFile
(
inffile
);
ret
=
DeleteFile
A
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
if
(
!
pInstallHinfSectionW
&&
!
pInstallHinfSectionA
)
...
...
@@ -779,5 +779,5 @@ START_TEST(install)
test_inffilelist
();
test_inffilelistA
();
SetCurrentDirectory
(
prev_path
);
SetCurrentDirectory
A
(
prev_path
);
}
dlls/setupapi/tests/misc.c
View file @
9d03aa32
...
...
@@ -51,8 +51,8 @@ static BOOL (WINAPI *pSetupUninstallOEMInfA)(PCSTR, DWORD, PVOID);
static
void
create_inf_file
(
LPCSTR
filename
)
{
DWORD
dwNumberOfBytesWritten
;
HANDLE
hf
=
CreateFile
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
HANDLE
hf
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
static
const
char
data
[]
=
"[Version]
\n
"
...
...
@@ -72,15 +72,15 @@ static void get_temp_filename(LPSTR path)
CHAR
temp
[
MAX_PATH
];
LPSTR
ptr
;
GetTempFileName
(
CURR_DIR
,
"set"
,
0
,
temp
);
GetTempFileName
A
(
CURR_DIR
,
"set"
,
0
,
temp
);
ptr
=
strrchr
(
temp
,
'\\'
);
l
strcpy
(
path
,
ptr
+
1
);
strcpy
(
path
,
ptr
+
1
);
}
static
BOOL
file_exists
(
LPSTR
path
)
{
return
GetFileAttributes
(
path
)
!=
INVALID_FILE_ATTRIBUTES
;
return
GetFileAttributes
A
(
path
)
!=
INVALID_FILE_ATTRIBUTES
;
}
static
BOOL
check_format
(
LPSTR
path
,
LPSTR
inf
)
...
...
@@ -90,19 +90,19 @@ static BOOL check_format(LPSTR path, LPSTR inf)
static
const
CHAR
format
[]
=
"
\\
INF
\\
oem"
;
GetWindowsDirectory
(
check
,
MAX_PATH
);
l
strcat
(
check
,
format
);
res
=
CompareString
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
check
,
-
1
,
path
,
l
strlen
(
check
))
==
CSTR_EQUAL
&&
path
[
l
strlen
(
check
)]
!=
'\\'
;
GetWindowsDirectory
A
(
check
,
MAX_PATH
);
strcat
(
check
,
format
);
res
=
CompareString
A
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
check
,
-
1
,
path
,
strlen
(
check
))
==
CSTR_EQUAL
&&
path
[
strlen
(
check
)]
!=
'\\'
;
return
(
!
inf
)
?
res
:
res
&&
(
inf
==
path
+
l
strlen
(
check
)
-
3
);
return
(
!
inf
)
?
res
:
res
&&
(
inf
==
path
+
strlen
(
check
)
-
3
);
}
static
void
test_original_file_name
(
LPCSTR
original
,
LPCSTR
dest
)
{
HINF
hinf
;
PSP_INF_INFORMATION
pspii
;
SP_ORIGINAL_FILE_INFO
spofi
;
SP_ORIGINAL_FILE_INFO
_A
spofi
;
BOOL
res
;
DWORD
size
;
...
...
@@ -115,12 +115,12 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest)
hinf
=
SetupOpenInfFileA
(
dest
,
NULL
,
INF_STYLE_WIN4
,
NULL
);
ok
(
hinf
!=
NULL
,
"SetupOpenInfFileA failed with error %d
\n
"
,
GetLastError
());
res
=
SetupGetInfInformation
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
res
=
SetupGetInfInformation
A
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
ok
(
res
,
"SetupGetInfInformation failed with error %d
\n
"
,
GetLastError
());
pspii
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
res
=
SetupGetInfInformation
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
pspii
,
size
,
NULL
);
res
=
SetupGetInfInformation
A
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
pspii
,
size
,
NULL
);
ok
(
res
,
"SetupGetInfInformation failed with error %d
\n
"
,
GetLastError
());
spofi
.
cbSize
=
0
;
...
...
@@ -173,8 +173,8 @@ static void test_SetupCopyOEMInf(void)
"Expected ERROR_FILE_NOT_FOUND, got %d
\n
"
,
GetLastError
());
/* try an absolute nonexistent SourceInfFileName */
l
strcpy
(
path
,
CURR_DIR
);
l
strcat
(
path
,
"
\\
nonexistent"
);
strcpy
(
path
,
CURR_DIR
);
strcat
(
path
,
"
\\
nonexistent"
);
SetLastError
(
0xdeadbeef
);
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
0
,
SP_COPY_NOOVERWRITE
,
NULL
,
0
,
NULL
,
NULL
);
ok
(
res
==
FALSE
,
"Expected FALSE, got %d
\n
"
,
res
);
...
...
@@ -207,7 +207,7 @@ static void test_SetupCopyOEMInf(void)
* popups during the installation though as it also needs a catalog file (signed?).
*/
win_skip
(
"Needs a different inf file on Vista+
\n
"
);
DeleteFile
(
tmpfile
);
DeleteFile
A
(
tmpfile
);
return
;
}
...
...
@@ -225,9 +225,9 @@ static void test_SetupCopyOEMInf(void)
ok
(
file_exists
(
tmpfile
),
"Expected source inf to exist
\n
"
);
/* try an absolute SourceInfFileName, without DestinationInfFileName */
l
strcpy
(
path
,
CURR_DIR
);
l
strcat
(
path
,
"
\\
"
);
l
strcat
(
path
,
tmpfile
);
strcpy
(
path
,
CURR_DIR
);
strcat
(
path
,
"
\\
"
);
strcat
(
path
,
tmpfile
);
SetLastError
(
0xdeadbeef
);
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
SPOST_NONE
,
0
,
NULL
,
0
,
NULL
,
NULL
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
...
...
@@ -253,18 +253,18 @@ static void test_SetupCopyOEMInf(void)
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
SPOST_NONE
,
0
,
dest
,
MAX_PATH
,
NULL
,
NULL
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
ok
(
l
strlen
(
dest
)
!=
0
,
"Expected a non-zero length string
\n
"
);
ok
(
strlen
(
dest
)
!=
0
,
"Expected a non-zero length string
\n
"
);
ok
(
file_exists
(
dest
),
"Expected destination inf to exist
\n
"
);
ok
(
check_format
(
dest
,
NULL
),
"Expected %%windir%%
\\
inf
\\
OEMx.inf, got %s
\n
"
,
dest
);
ok
(
file_exists
(
path
),
"Expected source inf to exist
\n
"
);
l
strcpy
(
dest_save
,
dest
);
DeleteFile
(
dest_save
);
strcpy
(
dest_save
,
dest
);
DeleteFile
A
(
dest_save
);
/* get the DestinationInfFileName, DestinationInfFileNameSize is too small
* - inf is still copied
*/
l
strcpy
(
dest
,
"aaa"
);
strcpy
(
dest
,
"aaa"
);
size
=
0
;
SetLastError
(
0xdeadbeef
);
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
SPOST_NONE
,
0
,
dest
,
5
,
&
size
,
NULL
);
...
...
@@ -273,19 +273,19 @@ static void test_SetupCopyOEMInf(void)
"Expected ERROR_INSUFFICIENT_BUFFER, got %d
\n
"
,
GetLastError
());
ok
(
file_exists
(
path
),
"Expected source inf to exist
\n
"
);
ok
(
file_exists
(
dest_save
),
"Expected dest inf to exist
\n
"
);
ok
(
!
l
strcmp
(
dest
,
"aaa"
),
"Expected dest to be unchanged
\n
"
);
ok
(
size
==
l
strlen
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
ok
(
!
strcmp
(
dest
,
"aaa"
),
"Expected dest to be unchanged
\n
"
);
ok
(
size
==
strlen
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
/* get the DestinationInfFileName and DestinationInfFileNameSize */
SetLastError
(
0xdeadbeef
);
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
SPOST_NONE
,
0
,
dest
,
MAX_PATH
,
&
size
,
NULL
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
ok
(
lstrlen
(
dest
)
+
1
==
size
,
"Expected sizes to match, got (%d, %d)
\n
"
,
lstrlen
(
dest
),
size
);
ok
(
lstrlen
A
(
dest
)
+
1
==
size
,
"Expected sizes to match, got (%d, %d)
\n
"
,
lstrlenA
(
dest
),
size
);
ok
(
file_exists
(
dest
),
"Expected destination inf to exist
\n
"
);
ok
(
check_format
(
dest
,
NULL
),
"Expected %%windir%%
\\
inf
\\
OEMx.inf, got %s
\n
"
,
dest
);
ok
(
file_exists
(
path
),
"Expected source inf to exist
\n
"
);
ok
(
size
==
lstrlen
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
ok
(
size
==
lstrlen
A
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
test_original_file_name
(
strrchr
(
path
,
'\\'
)
+
1
,
dest
);
...
...
@@ -294,14 +294,14 @@ static void test_SetupCopyOEMInf(void)
res
=
pSetupCopyOEMInfA
(
path
,
NULL
,
SPOST_NONE
,
0
,
dest
,
MAX_PATH
,
&
size
,
&
inf
);
ok
(
res
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
res
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
GetLastError
());
ok
(
lstrlen
(
dest
)
+
1
==
size
,
"Expected sizes to match, got (%d, %d)
\n
"
,
lstrlen
(
dest
),
size
);
ok
(
lstrlen
A
(
dest
)
+
1
==
size
,
"Expected sizes to match, got (%d, %d)
\n
"
,
lstrlenA
(
dest
),
size
);
ok
(
file_exists
(
dest
),
"Expected destination inf to exist
\n
"
);
ok
((
inf
&&
inf
[
0
]
!=
0
)
||
broken
(
!
inf
),
/* Win98 */
"Expected inf to point to the filename
\n
"
);
ok
(
check_format
(
dest
,
inf
),
"Expected %%windir%%
\\
inf
\\
OEMx.inf, got %s
\n
"
,
dest
);
ok
(
file_exists
(
path
),
"Expected source inf to exist
\n
"
);
ok
(
size
==
lstrlen
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
ok
(
size
==
lstrlen
A
(
dest_save
)
+
1
,
"Expected size to be lstrlen(dest_save) + 1
\n
"
);
/* try SP_COPY_DELETESOURCE */
SetLastError
(
0xdeadbeef
);
...
...
@@ -733,7 +733,7 @@ static void test_SetupUninstallOEMInf(void)
START_TEST
(
misc
)
{
HMODULE
hsetupapi
=
GetModuleHandle
(
"setupapi.dll"
);
HMODULE
hsetupapi
=
GetModuleHandle
A
(
"setupapi.dll"
);
pSetupGetFileCompressionInfoExA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupGetFileCompressionInfoExA"
);
pSetupCopyOEMInfA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupCopyOEMInfA"
);
...
...
dlls/setupapi/tests/parser.c
View file @
9d03aa32
...
...
@@ -290,8 +290,8 @@ static void test_enum_sections(void)
ret
=
pSetupEnumInfSectionsA
(
hinf
,
index
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
ret
,
"SetupEnumInfSectionsA failed err %u
\n
"
,
GetLastError
()
);
ok
(
len
==
3
||
len
==
8
,
"wrong len %u
\n
"
,
len
);
ok
(
!
lstrcmpi
(
buffer
,
"version"
)
||
!
lstrcmpi
(
buffer
,
"s1"
)
||
!
lstrcmpi
(
buffer
,
"s2"
)
||
!
lstrcmpi
(
buffer
,
"s3"
)
||
!
lstrcmpi
(
buffer
,
"strings"
),
ok
(
!
lstrcmpi
A
(
buffer
,
"version"
)
||
!
lstrcmpiA
(
buffer
,
"s1"
)
||
!
lstrcmpi
A
(
buffer
,
"s2"
)
||
!
lstrcmpiA
(
buffer
,
"s3"
)
||
!
lstrcmpiA
(
buffer
,
"strings"
),
"bad section '%s'
\n
"
,
buffer
);
}
SetupCloseInfFile
(
hinf
);
...
...
@@ -542,7 +542,7 @@ static void test_pSetupGetField(void)
hinf
=
test_file_contents
(
contents
,
&
err
);
ok
(
hinf
!=
NULL
,
"Expected valid INF file
\n
"
);
ret
=
SetupFindFirstLine
(
hinf
,
"FileBranchInfo"
,
NULL
,
&
context
);
ret
=
SetupFindFirstLine
A
(
hinf
,
"FileBranchInfo"
,
NULL
,
&
context
);
ok
(
ret
,
"Failed to find first line
\n
"
);
/* native Windows crashes if a NULL context is sent in */
...
...
dlls/setupapi/tests/query.c
View file @
9d03aa32
...
...
@@ -102,8 +102,8 @@ static const char inf_data6[] =
static
void
create_inf_file
(
LPSTR
filename
,
const
char
*
data
,
DWORD
size
)
{
DWORD
dwNumberOfBytesWritten
;
HANDLE
hf
=
CreateFile
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
HANDLE
hf
=
CreateFile
A
(
filename
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
WriteFile
(
hf
,
data
,
size
,
&
dwNumberOfBytesWritten
,
NULL
);
CloseHandle
(
hf
);
}
...
...
dlls/setupapi/tests/setupcab.c
View file @
9d03aa32
...
...
@@ -91,7 +91,7 @@ static void test_invalid_parametersA(void)
const
struct
{
PCSTR
CabinetFile
;
PSP_FILE_CALLBACK
MsgHandler
;
PSP_FILE_CALLBACK
_A
MsgHandler
;
DWORD
expected_lasterror
;
int
todo_lasterror
;
}
invalid_parameters
[]
=
...
...
@@ -161,7 +161,7 @@ static void test_invalid_parametersW(void)
const
struct
{
PCWSTR
CabinetFile
;
PSP_FILE_CALLBACK
MsgHandler
;
PSP_FILE_CALLBACK
_W
MsgHandler
;
DWORD
expected_lasterror
;
int
todo_lasterror
;
}
invalid_parameters
[]
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment