Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
48850536
Commit
48850536
authored
Feb 23, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
Feb 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack/tests: Enable compilation with long types.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
339f4a3a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
94 deletions
+93
-94
Makefile.in
dlls/advpack/tests/Makefile.in
+0
-1
advpack.c
dlls/advpack/tests/advpack.c
+44
-44
files.c
dlls/advpack/tests/files.c
+24
-24
install.c
dlls/advpack/tests/install.c
+25
-25
No files found.
dlls/advpack/tests/Makefile.in
View file @
48850536
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
TESTDLL
=
advpack.dll
IMPORTS
=
cabinet advapi32 advpack
...
...
dlls/advpack/tests/advpack.c
View file @
48850536
...
...
@@ -99,28 +99,28 @@ static void version_test(void)
major
=
minor
=
0
;
hr
=
pGetVersionFromFile
(
"kernel32.dll"
,
&
major
,
&
minor
,
FALSE
);
ok
(
hr
==
S_OK
,
"GetVersionFromFileEx(kernel32.dll) failed, returned "
"0x%08x
\n
"
,
hr
);
trace
(
"kernel32.dll Language ID: 0x%08
x, Codepage ID: 0x%08
x
\n
"
,
"0x%08
l
x
\n
"
,
hr
);
trace
(
"kernel32.dll Language ID: 0x%08
lx, Codepage ID: 0x%08l
x
\n
"
,
major
,
minor
);
major
=
minor
=
0
;
hr
=
pGetVersionFromFile
(
"kernel32.dll"
,
&
major
,
&
minor
,
TRUE
);
ok
(
hr
==
S_OK
,
"GetVersionFromFileEx(kernel32.dll) failed, returned "
"0x%08x
\n
"
,
hr
);
"0x%08
l
x
\n
"
,
hr
);
trace
(
"kernel32.dll version: %d.%d.%d.%d
\n
"
,
HIWORD
(
major
),
LOWORD
(
major
),
HIWORD
(
minor
),
LOWORD
(
minor
));
major
=
minor
=
0
;
hr
=
pGetVersionFromFile
(
"advpack.dll"
,
&
major
,
&
minor
,
FALSE
);
ok
(
hr
==
S_OK
,
"GetVersionFromFileEx(advpack.dll) failed, returned "
"0x%08x
\n
"
,
hr
);
trace
(
"advpack.dll Language ID: 0x%08
x, Codepage ID: 0x%08
x
\n
"
,
"0x%08
l
x
\n
"
,
hr
);
trace
(
"advpack.dll Language ID: 0x%08
lx, Codepage ID: 0x%08l
x
\n
"
,
major
,
minor
);
major
=
minor
=
0
;
hr
=
pGetVersionFromFile
(
"advpack.dll"
,
&
major
,
&
minor
,
TRUE
);
ok
(
hr
==
S_OK
,
"GetVersionFromFileEx(advpack.dll) failed, returned "
"0x%08x
\n
"
,
hr
);
"0x%08
l
x
\n
"
,
hr
);
trace
(
"advpack.dll version: %d.%d.%d.%d
\n
"
,
HIWORD
(
major
),
LOWORD
(
major
),
HIWORD
(
minor
),
LOWORD
(
minor
));
}
...
...
@@ -278,7 +278,7 @@ static void translateinfstring_test(void)
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got 0x%08x
\n
"
,
(
UINT
)
hr
);
ok
(
!
strcmp
(
buffer
,
TEST_STRING2
),
"Expected %s, got %s
\n
"
,
TEST_STRING2
,
buffer
);
ok
(
dwSize
==
25
,
"Expected size 25, got %d
\n
"
,
dwSize
);
ok
(
dwSize
==
25
,
"Expected size 25, got %
l
d
\n
"
,
dwSize
);
buffer
[
0
]
=
0
;
/* try other nonexistent section */
...
...
@@ -304,7 +304,7 @@ static void translateinfstring_test(void)
if
(
hr
==
ERROR_SUCCESS
)
{
ok
(
!
strcmp
(
buffer
,
APP_PATH
),
"Expected '%s', got '%s'
\n
"
,
APP_PATH
,
buffer
);
ok
(
dwSize
==
APP_PATH_LEN
,
"Expected size %
d, got %
d
\n
"
,
APP_PATH_LEN
,
dwSize
);
ok
(
dwSize
==
APP_PATH_LEN
,
"Expected size %
ld, got %l
d
\n
"
,
APP_PATH_LEN
,
dwSize
);
}
buffer
[
0
]
=
0
;
...
...
@@ -315,7 +315,7 @@ static void translateinfstring_test(void)
todo_wine
{
ok
(
!
strcmp
(
buffer
,
TEST_STRING2
),
"Expected %s, got %s
\n
"
,
TEST_STRING2
,
buffer
);
ok
(
dwSize
==
25
,
"Expected size 25, got %d
\n
"
,
dwSize
);
ok
(
dwSize
==
25
,
"Expected size 25, got %
l
d
\n
"
,
dwSize
);
}
DeleteFileA
(
"c:
\\
a.inf"
);
...
...
@@ -342,31 +342,31 @@ static void translateinfstringex_test(void)
/* try a NULL filename */
hr
=
pOpenINFEngine
(
NULL
,
"Options.NTx86"
,
0
,
&
hinf
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* try an empty filename */
hr
=
pOpenINFEngine
(
""
,
"Options.NTx86"
,
0
,
&
hinf
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
)
/* NT+ */
||
hr
==
HRESULT_FROM_WIN32
(
E_UNEXPECTED
)
/* 9x */
,
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND or E_UNEXPECTED), got %08x
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND or E_UNEXPECTED), got %08
l
x
\n
"
,
hr
);
/* try a NULL hinf */
hr
=
pOpenINFEngine
(
inf_file
,
"Options.NTx86"
,
0
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* open the INF without the Install section specified */
hr
=
pOpenINFEngine
(
inf_file
,
NULL
,
0
,
&
hinf
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
/* try a NULL hinf */
hr
=
pTranslateInfStringEx
(
NULL
,
inf_file
,
"Options.NTx86"
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* try a NULL filename */
hr
=
pTranslateInfStringEx
(
hinf
,
NULL
,
"Options.NTx86"
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* try an empty filename */
memset
(
buffer
,
'a'
,
25
);
...
...
@@ -374,32 +374,32 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
""
,
"Options.NTx86"
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
todo_wine
{
ok
(
!
strcmp
(
buffer
,
TEST_STRING2
),
"Expected %s, got %s
\n
"
,
TEST_STRING2
,
buffer
);
ok
(
size
==
25
,
"Expected size 25, got %d
\n
"
,
size
);
ok
(
size
==
25
,
"Expected size 25, got %
l
d
\n
"
,
size
);
}
/* try a NULL translate section */
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
NULL
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* try an empty translate section */
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
""
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
SPAPI_E_LINE_NOT_FOUND
,
"Expected SPAPI_E_LINE_NOT_FOUND, got %08x
\n
"
,
hr
);
ok
(
hr
==
SPAPI_E_LINE_NOT_FOUND
,
"Expected SPAPI_E_LINE_NOT_FOUND, got %08
l
x
\n
"
,
hr
);
/* try a NULL translate key */
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
NULL
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* try an empty translate key */
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
""
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
SPAPI_E_LINE_NOT_FOUND
,
"Expected SPAPI_E_LINE_NOT_FOUND, got %08x
\n
"
,
hr
);
ok
(
hr
==
SPAPI_E_LINE_NOT_FOUND
,
"Expected SPAPI_E_LINE_NOT_FOUND, got %08
l
x
\n
"
,
hr
);
/* successfully translate the string */
memset
(
buffer
,
'a'
,
25
);
...
...
@@ -407,20 +407,20 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
todo_wine
{
ok
(
!
strcmp
(
buffer
,
TEST_STRING2
),
"Expected %s, got %s
\n
"
,
TEST_STRING2
,
buffer
);
ok
(
size
==
25
,
"Expected size 25, got %d
\n
"
,
size
);
ok
(
size
==
25
,
"Expected size 25, got %
l
d
\n
"
,
size
);
}
/* try a NULL hinf */
hr
=
pCloseINFEngine
(
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08x
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %08
l
x
\n
"
,
hr
);
/* successfully close the hinf */
hr
=
pCloseINFEngine
(
hinf
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
/* open the inf with the install section */
hr
=
pOpenINFEngine
(
inf_file
,
"section"
,
0
,
&
hinf
,
NULL
);
...
...
@@ -430,7 +430,7 @@ static void translateinfstringex_test(void)
DeleteFileA
(
inf_file
);
return
;
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
/* translate the string with the install section specified */
memset
(
buffer
,
'a'
,
APP_PATH_LEN
);
...
...
@@ -438,9 +438,9 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"InstallDir"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
!
strcmp
(
buffer
,
APP_PATH
),
"Expected %s, got %s
\n
"
,
APP_PATH
,
buffer
);
ok
(
size
==
APP_PATH_LEN
,
"Expected size %
d, got %
d
\n
"
,
APP_PATH_LEN
,
size
);
ok
(
size
==
APP_PATH_LEN
,
"Expected size %
ld, got %l
d
\n
"
,
APP_PATH_LEN
,
size
);
/* Single quote test (Note size includes null on return from call) */
memset
(
buffer
,
'a'
,
APP_PATH_LEN
);
...
...
@@ -448,10 +448,10 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"Result1"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpiA
(
buffer
,
PROG_FILES_ROOT
),
"Expected %s, got %s
\n
"
,
PROG_FILES_ROOT
,
buffer
);
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %d
\n
"
,
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %
l
d
\n
"
,
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
size
);
memset
(
buffer
,
'a'
,
APP_PATH_LEN
);
...
...
@@ -459,10 +459,10 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"Result2"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpiA
(
buffer
,
PROG_FILES_ROOT
),
"Expected %s, got %s
\n
"
,
PROG_FILES_ROOT
,
buffer
);
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %d
\n
"
,
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %
l
d
\n
"
,
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
size
);
{
...
...
@@ -475,16 +475,16 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"Result3"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpiA
(
buffer
,
drive
),
"Expected %s, got %s
\n
"
,
drive
,
buffer
);
ok
(
size
==
strlen
(
drive
)
+
1
,
"Expected size %d, got %d
\n
"
,
ok
(
size
==
strlen
(
drive
)
+
1
,
"Expected size %d, got %
l
d
\n
"
,
lstrlenA
(
drive
)
+
1
,
size
);
}
/* close the INF again */
hr
=
pCloseINFEngine
(
hinf
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
DeleteFileA
(
inf_file
);
...
...
@@ -525,7 +525,7 @@ static void translateinfstringex_test(void)
/* open the inf with the install section */
hr
=
pOpenINFEngine
(
inf_file
,
"section"
,
0
,
&
hinf
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
/* Single quote test (Note size includes null on return from call) */
memset
(
buffer
,
'a'
,
APP_PATH_LEN
);
...
...
@@ -533,15 +533,15 @@ static void translateinfstringex_test(void)
size
=
MAX_PATH
;
hr
=
pTranslateInfStringEx
(
hinf
,
inf_file
,
"Options.NTx86"
,
"Result2"
,
buffer
,
size
,
&
size
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
!
lstrcmpiA
(
buffer
,
PROG_FILES_ROOT
),
"Expected %s, got %s
\n
"
,
PROG_FILES_ROOT
,
buffer
);
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %d
\n
"
,
ok
(
size
==
strlen
(
PROG_FILES_ROOT
)
+
1
,
"Expected size %d, got %
l
d
\n
"
,
lstrlenA
(
PROG_FILES_ROOT
)
+
1
,
size
);
/* close the INF again */
hr
=
pCloseINFEngine
(
hinf
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
DeleteFileA
(
inf_file
);
}
...
...
@@ -588,14 +588,14 @@ static void setperusersecvalues_test(void)
/* This crashes on systems with IE7 */
hr
=
pSetPerUserSecValues
(
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
!
OPEN_GUID_KEY
(),
"Expected guid key to not exist
\n
"
);
}
/* at the very least, szGUID must be valid */
peruser
.
szGUID
[
0
]
=
'\0'
;
hr
=
pSetPerUserSecValues
(
&
peruser
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
!
OPEN_GUID_KEY
(),
"Expected guid key to not exist
\n
"
);
/* set initial values */
...
...
@@ -606,7 +606,7 @@ static void setperusersecvalues_test(void)
skip
(
"SetPerUserSecValues is broken
\n
"
);
return
;
}
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
OPEN_GUID_KEY
(),
"Expected guid key to exist
\n
"
);
ok
(
check_reg_str
(
guid
,
NULL
,
"displayname"
),
"Expected displayname
\n
"
);
ok
(
check_reg_str
(
guid
,
"ComponentID"
,
"compid"
),
"Expected compid
\n
"
);
...
...
@@ -623,7 +623,7 @@ static void setperusersecvalues_test(void)
/* raise the version, but bRollback is FALSE, so vals not saved */
lstrcpyA
(
peruser
.
szVersion
,
"2,1,1,1"
);
hr
=
pSetPerUserSecValues
(
&
peruser
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
check_reg_str
(
guid
,
NULL
,
"displayname"
),
"Expected displayname
\n
"
);
ok
(
check_reg_str
(
guid
,
"ComponentID"
,
"compid"
),
"Expected compid
\n
"
);
ok
(
check_reg_str
(
guid
,
"Locale"
,
"locale"
),
"Expected locale
\n
"
);
...
...
@@ -640,7 +640,7 @@ static void setperusersecvalues_test(void)
peruser
.
bRollback
=
TRUE
;
lstrcpyA
(
peruser
.
szVersion
,
"3,1,1,1"
);
hr
=
pSetPerUserSecValues
(
&
peruser
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
check_reg_str
(
guid
,
NULL
,
"displayname"
),
"Expected displayname
\n
"
);
ok
(
check_reg_str
(
guid
,
"ComponentID"
,
"compid"
),
"Expected compid
\n
"
);
ok
(
check_reg_str
(
guid
,
"Locale"
,
"locale"
),
"Expected locale
\n
"
);
...
...
dlls/advpack/tests/files.c
View file @
48850536
...
...
@@ -111,7 +111,7 @@ static void test_AddDelBackupEntry(void)
/* try a NULL file list */
res
=
pAddDelBackupEntry
(
NULL
,
"backup"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ok
(
!
DeleteFileA
(
path
),
"Expected path to not exist
\n
"
);
lstrcpyA
(
path
,
CURR_DIR
);
...
...
@@ -119,7 +119,7 @@ static void test_AddDelBackupEntry(void)
/* try an empty base name */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
"backup"
,
""
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ok
(
!
DeleteFileA
(
path
),
"Expected path to not exist
\n
"
);
lstrcpyA
(
path
,
CURR_DIR
);
...
...
@@ -127,14 +127,14 @@ static void test_AddDelBackupEntry(void)
/* try an invalid flag */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
NULL
,
"basename"
,
0
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ok
(
!
DeleteFileA
(
path
),
"Expected path to not exist
\n
"
);
lstrcpyA
(
path
,
"c:
\\
basename.INI"
);
/* create the INF file */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
"c:
\\
"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
if
(
GetFileAttributesA
(
path
)
!=
INVALID_FILE_ATTRIBUTES
)
{
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
...
...
@@ -149,14 +149,14 @@ static void test_AddDelBackupEntry(void)
/* try to create the INI file in a nonexistent directory */
RemoveDirectoryA
(
"backup"
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
"backup"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ok
(
!
check_ini_file_attr
(
path
),
"Expected ini file to not be hidden
\n
"
);
ok
(
!
DeleteFileA
(
path
),
"Expected path to not exist
\n
"
);
/* try an existent, relative backup directory */
CreateDirectoryA
(
"backup"
,
NULL
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
"backup"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
RemoveDirectoryA
(
"backup"
);
...
...
@@ -166,13 +166,13 @@ static void test_AddDelBackupEntry(void)
/* try a NULL backup dir, INI is created in the windows directory */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three
\0
"
,
NULL
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
/* remove the entries with AADBE_DEL_ENTRY */
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
res
=
pAddDelBackupEntry
(
"one
\0
three
\0
"
,
NULL
,
"basename"
,
AADBE_DEL_ENTRY
);
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
res
);
ret
=
DeleteFileA
(
path
);
ok
(
ret
==
TRUE
||
broken
(
ret
==
FALSE
),
/* win98 */
...
...
@@ -395,19 +395,19 @@ static void test_ExtractFiles(void)
/* try NULL cab file */
hr
=
pExtractFiles
(
NULL
,
destFolder
,
0
,
NULL
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
ok
(
RemoveDirectoryA
(
"dest"
),
"Expected dest to exist
\n
"
);
/* try NULL destination */
hr
=
pExtractFiles
(
"extract.cab"
,
NULL
,
0
,
NULL
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
ok
(
!
RemoveDirectoryA
(
"dest"
),
"Expected dest to not exist
\n
"
);
/* extract all files in the cab to nonexistent destination directory */
hr
=
pExtractFiles
(
"extract.cab"
,
destFolder
,
0
,
NULL
,
NULL
,
0
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
)
||
hr
==
E_FAIL
,
/* win95 */
"Expected %08
x or %08x, got %08
x
\n
"
,
E_FAIL
,
"Expected %08
lx or %08lx, got %08l
x
\n
"
,
E_FAIL
,
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to not exist
\n
"
);
...
...
@@ -417,7 +417,7 @@ static void test_ExtractFiles(void)
/* extract all files in the cab to the destination directory */
CreateDirectoryA
(
"dest"
,
NULL
);
hr
=
pExtractFiles
(
"extract.cab"
,
destFolder
,
0
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
b.txt"
),
"Expected dest
\\
b.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to exist
\n
"
);
...
...
@@ -426,7 +426,7 @@ static void test_ExtractFiles(void)
/* extract all files to a relative destination directory */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
NULL
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
b.txt"
),
"Expected dest
\\
b.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to exist
\n
"
);
...
...
@@ -435,7 +435,7 @@ static void test_ExtractFiles(void)
/* only extract two of the files from the cab */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
"a.txt:testdir
\\
c.txt"
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to exist
\n
"
);
...
...
@@ -444,7 +444,7 @@ static void test_ExtractFiles(void)
/* use valid chars before and after file list */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
" :
\t
: a.txt:testdir
\\
c.txt
\t
:"
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to exist
\n
"
);
...
...
@@ -453,27 +453,27 @@ static void test_ExtractFiles(void)
/* use invalid chars before and after file list */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
" +-
\\
a.txt:testdir
\\
c.txt a_:"
,
NULL
,
0
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %d
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to not exist
\n
"
);
ok
(
!
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to not exist
\n
"
);
/* try an empty file list */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
""
,
NULL
,
0
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %d
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to not exist
\n
"
);
ok
(
!
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to not exist
\n
"
);
/* try a nonexistent file in the file list */
hr
=
pExtractFiles
(
"extract.cab"
,
"dest"
,
0
,
"a.txt:idontexist:testdir
\\
c.txt"
,
NULL
,
0
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %d
\n
"
,
hr
);
ok
(
hr
==
E_FAIL
,
"Expected E_FAIL, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to not exist
\n
"
);
ok
(
!
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to not exist
\n
"
);
ok
(
!
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to not exist
\n
"
);
if
(
pExtractFilesW
)
{
hr
=
pExtractFilesW
(
L"extract.cab"
,
L"dest"
,
0
,
L"a.txt:testdir
\\
c.txt"
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08
l
x
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
a.txt"
),
"Expected dest
\\
a.txt to exist
\n
"
);
ok
(
DeleteFileA
(
"dest
\\
testdir
\\
c.txt"
),
"Expected dest
\\
testdir
\\
c.txt to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dest
\\
testdir"
),
"Expected dest
\\
testdir to exist
\n
"
);
...
...
@@ -507,22 +507,22 @@ static void test_AdvInstallFile(void)
/* try invalid source directory */
hr
=
pAdvInstallFile
(
NULL
,
NULL
,
"source.txt"
,
destFolder
,
"destination.txt"
,
0
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
destination.txt"
),
"Expected dest
\\
destination.txt to not exist
\n
"
);
/* try invalid source file */
hr
=
pAdvInstallFile
(
NULL
,
CURR_DIR
,
NULL
,
destFolder
,
"destination.txt"
,
0
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
destination.txt"
),
"Expected dest
\\
destination.txt to not exist
\n
"
);
/* try invalid destination directory */
hr
=
pAdvInstallFile
(
NULL
,
CURR_DIR
,
"source.txt"
,
NULL
,
"destination.txt"
,
0
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
ok
(
!
DeleteFileA
(
"dest
\\
destination.txt"
),
"Expected dest
\\
destination.txt to not exist
\n
"
);
/* try copying to nonexistent destination directory */
hr
=
pAdvInstallFile
(
NULL
,
CURR_DIR
,
"source.txt"
,
destFolder
,
"destination.txt"
,
0
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
destination.txt"
),
"Expected dest
\\
destination.txt to exist
\n
"
);
/* native windows screws up if the source file doesn't exist */
...
...
@@ -531,7 +531,7 @@ static void test_AdvInstallFile(void)
createTestFile
(
"dest
\\
destination.txt"
);
hr
=
pAdvInstallFile
(
NULL
,
CURR_DIR
,
"source.txt"
,
destFolder
,
"destination.txt"
,
AIF_NOOVERWRITE
|
AIF_QUIET
,
0
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %
l
d
\n
"
,
hr
);
ok
(
DeleteFileA
(
"dest
\\
destination.txt"
),
"Expected dest
\\
destination.txt to exist
\n
"
);
ok
(
RemoveDirectoryA
(
"dest"
),
"Expected dest to exist
\n
"
);
...
...
dlls/advpack/tests/install.c
View file @
48850536
...
...
@@ -84,17 +84,17 @@ static void test_RunSetupCommand(void)
/* try an invalid cmd name */
hr
=
pRunSetupCommand
(
NULL
,
NULL
,
"Install"
,
"Dir"
,
"Title"
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
/* try an invalid directory */
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
NULL
,
"Title"
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
/* try to run a nonexistent exe */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"idontexist.exe"
,
"Install"
,
systemdir
,
"Title"
,
&
hexe
,
0
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %
l
d
\n
"
,
hr
);
ok
(
hexe
==
NULL
,
"Expected hexe to be NULL
\n
"
);
ok
(
!
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to fail
\n
"
);
...
...
@@ -102,21 +102,21 @@ static void test_RunSetupCommand(void)
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
"non
\\
existent
\\
directory"
,
"Title"
,
&
hexe
,
0
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_DIRECTORY
),
"Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_DIRECTORY), got %
l
d
\n
"
,
hr
);
ok
(
hexe
==
NULL
,
"Expected hexe to be NULL
\n
"
);
ok
(
!
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to fail
\n
"
);
/* try to run an exe with the RSC_FLAG_INF flag */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
systemdir
,
"Title"
,
&
hexe
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
is_spapi_err
(
hr
),
"Expected a setupapi error, got %d
\n
"
,
hr
);
ok
(
is_spapi_err
(
hr
),
"Expected a setupapi error, got %
l
d
\n
"
,
hr
);
ok
(
hexe
==
(
HANDLE
)
0xdeadbeef
,
"Expected hexe to be 0xdeadbeef
\n
"
);
ok
(
!
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to fail
\n
"
);
/* run winver.exe */
hexe
=
(
HANDLE
)
0xdeadbeef
;
hr
=
pRunSetupCommand
(
NULL
,
"winver.exe"
,
"Install"
,
systemdir
,
"Title"
,
&
hexe
,
0
,
NULL
);
ok
(
hr
==
S_ASYNCHRONOUS
,
"Expected S_ASYNCHRONOUS, got %d
\n
"
,
hr
);
ok
(
hr
==
S_ASYNCHRONOUS
,
"Expected S_ASYNCHRONOUS, got %
l
d
\n
"
,
hr
);
ok
(
hexe
!=
NULL
,
"Expected hexe to be non-NULL
\n
"
);
ok
(
TerminateProcess
(
hexe
,
0
),
"Expected TerminateProcess to succeed
\n
"
);
...
...
@@ -129,42 +129,42 @@ static void test_RunSetupCommand(void)
lstrcpyA
(
dir
,
CURR_DIR
);
lstrcatA
(
dir
,
"
\\
one"
);
hr
=
pRunSetupCommand
(
NULL
,
path
,
"DefaultInstall"
,
dir
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
hr
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %
l
d
\n
"
,
hr
);
/* try a full path to the INF, NULL working dir */
hr
=
pRunSetupCommand
(
NULL
,
path
,
"DefaultInstall"
,
NULL
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %
l
d
\n
"
,
hr
);
/* try a full path to the INF, empty working dir */
hr
=
pRunSetupCommand
(
NULL
,
path
,
"DefaultInstall"
,
""
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
hr
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %
l
d
\n
"
,
hr
);
/* try a relative path to the INF, with working dir provided */
hr
=
pRunSetupCommand
(
NULL
,
"one
\\
test.inf"
,
"DefaultInstall"
,
dir
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
hr
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %
l
d
\n
"
,
hr
);
/* try a relative path to the INF, NULL working dir */
hr
=
pRunSetupCommand
(
NULL
,
"one
\\
test.inf"
,
"DefaultInstall"
,
NULL
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %
l
d
\n
"
,
hr
);
/* try a relative path to the INF, empty working dir */
hr
=
pRunSetupCommand
(
NULL
,
"one
\\
test.inf"
,
"DefaultInstall"
,
""
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
hr
);
ok
(
hr
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %
l
d
\n
"
,
hr
);
/* try only the INF filename, with working dir provided */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
dir
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %
l
d
\n
"
,
hr
);
/* try only the INF filename, NULL working dir */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
NULL
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %
l
d
\n
"
,
hr
);
/* try only the INF filename, empty working dir */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
""
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %
l
d
\n
"
,
hr
);
DeleteFileA
(
"one
\\
test.inf"
);
RemoveDirectoryA
(
"one"
);
...
...
@@ -173,16 +173,16 @@ static void test_RunSetupCommand(void)
/* try INF file in the current directory, working directory provided */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
CURR_DIR
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %
l
d
\n
"
,
hr
);
/* try INF file in the current directory, NULL working directory */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
NULL
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %d
\n
"
,
hr
);
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %
l
d
\n
"
,
hr
);
/* try INF file in the current directory, empty working directory */
hr
=
pRunSetupCommand
(
NULL
,
"test.inf"
,
"DefaultInstall"
,
CURR_DIR
,
"Title"
,
NULL
,
RSC_FLAG_INF
|
RSC_FLAG_QUIET
,
NULL
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %d
\n
"
,
hr
);
ok
(
hr
==
HRESULT_FROM_WIN32
(
ERROR_FILE_NOT_FOUND
),
"Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %
l
d
\n
"
,
hr
);
}
static
void
test_LaunchINFSection
(
void
)
...
...
@@ -199,7 +199,7 @@ static void test_LaunchINFSection(void)
{
/* try an invalid cmdline */
hr
=
pLaunchINFSection
(
NULL
,
NULL
,
NULL
,
0
);
ok
(
hr
==
1
,
"Expected 1, got %d
\n
"
,
hr
);
ok
(
hr
==
1
,
"Expected 1, got %
l
d
\n
"
,
hr
);
}
CreateDirectoryA
(
"one"
,
NULL
);
...
...
@@ -210,7 +210,7 @@ static void test_LaunchINFSection(void)
lstrcatA
(
cmdline
,
"
\\
"
);
lstrcatA
(
cmdline
,
"one
\\
test.inf,DefaultInstall,,4"
);
hr
=
pLaunchINFSection
(
NULL
,
NULL
,
cmdline
,
0
);
ok
(
hr
==
0
,
"Expected 0, got %d
\n
"
,
hr
);
ok
(
hr
==
0
,
"Expected 0, got %
l
d
\n
"
,
hr
);
DeleteFileA
(
"one
\\
test.inf"
);
RemoveDirectoryA
(
"one"
);
...
...
@@ -219,10 +219,10 @@ static void test_LaunchINFSection(void)
/* try just the INF filename */
hr
=
pLaunchINFSection
(
NULL
,
NULL
,
file
,
0
);
ok
(
hr
==
0
,
"Expected 0, got %d
\n
"
,
hr
);
ok
(
hr
==
0
,
"Expected 0, got %
l
d
\n
"
,
hr
);
hr
=
pLaunchINFSection
(
NULL
,
NULL
,
file2
,
0
);
ok
(
hr
==
0
,
"Expected 0, got %d
\n
"
,
hr
);
ok
(
hr
==
0
,
"Expected 0, got %
l
d
\n
"
,
hr
);
DeleteFileA
(
"test.inf"
);
}
...
...
@@ -239,14 +239,14 @@ static void test_LaunchINFSectionEx(void)
lstrcatA
(
cmdline
,
"
\\
"
);
lstrcatA
(
cmdline
,
"test.inf,DefaultInstall,c:imacab.cab,4"
);
hr
=
pLaunchINFSectionEx
(
NULL
,
NULL
,
cmdline
,
0
);
ok
(
hr
==
0
,
"Expected 0, got %d
\n
"
,
hr
);
ok
(
hr
==
0
,
"Expected 0, got %
l
d
\n
"
,
hr
);
/* try quoting the parameters */
lstrcpyA
(
cmdline
,
"
\"
"
);
lstrcatA
(
cmdline
,
CURR_DIR
);
lstrcatA
(
cmdline
,
"
\\
test.inf
\"
,
\"
DefaultInstall
\"
,
\"
c:,imacab.cab
\"
,
\"
4
\"
"
);
hr
=
pLaunchINFSectionEx
(
NULL
,
NULL
,
cmdline
,
0
);
ok
(
hr
==
0
,
"Expected 0, got %d
\n
"
,
hr
);
ok
(
hr
==
0
,
"Expected 0, got %
l
d
\n
"
,
hr
);
/* The 'No UI' flag seems to have no effect whatsoever on Windows.
* So only do this test in interactive mode.
...
...
@@ -256,7 +256,7 @@ static void test_LaunchINFSectionEx(void)
/* try an invalid CAB filename with a relative INF name */
lstrcpyA
(
cmdline
,
"test.inf,DefaultInstall,c:imacab.cab,4"
);
hr
=
pLaunchINFSectionEx
(
NULL
,
NULL
,
cmdline
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %d
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Expected E_INVALIDARG, got %
l
d
\n
"
,
hr
);
}
DeleteFileA
(
"test.inf"
);
...
...
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