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
77fa32a8
Commit
77fa32a8
authored
May 15, 2009
by
Paul Vriens
Committed by
Alexandre Julliard
May 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Fix passing a NULL parameter (Coverity).
parent
6a025c5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
misc.c
dlls/setupapi/misc.c
+6
-0
misc.c
dlls/setupapi/tests/misc.c
+33
-0
No files found.
dlls/setupapi/misc.c
View file @
77fa32a8
...
...
@@ -1139,6 +1139,12 @@ BOOL WINAPI SetupUninstallOEMInfW( PCWSTR inf_file, DWORD flags, PVOID reserved
TRACE
(
"%s, 0x%08x, %p
\n
"
,
debugstr_w
(
inf_file
),
flags
,
reserved
);
if
(
!
inf_file
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
GetWindowsDirectoryW
(
target
,
sizeof
(
target
)
/
sizeof
(
WCHAR
)
))
return
FALSE
;
strcatW
(
target
,
infW
);
...
...
dlls/setupapi/tests/misc.c
View file @
77fa32a8
...
...
@@ -46,6 +46,7 @@ static CHAR CURR_DIR[MAX_PATH];
static
BOOL
(
WINAPI
*
pSetupGetFileCompressionInfoExA
)(
PCSTR
,
PSTR
,
DWORD
,
PDWORD
,
PDWORD
,
PDWORD
,
PUINT
);
static
BOOL
(
WINAPI
*
pSetupCopyOEMInfA
)(
PCSTR
,
PCSTR
,
DWORD
,
DWORD
,
PSTR
,
DWORD
,
PDWORD
,
PSTR
*
);
static
BOOL
(
WINAPI
*
pSetupQueryInfOriginalFileInformationA
)(
PSP_INF_INFORMATION
,
UINT
,
PSP_ALTPLATFORM_INFO
,
PSP_ORIGINAL_FILE_INFO_A
);
static
BOOL
(
WINAPI
*
pSetupUninstallOEMInfA
)(
PCSTR
,
DWORD
,
PVOID
);
static
void
create_inf_file
(
LPCSTR
filename
)
{
...
...
@@ -581,6 +582,32 @@ static void test_SetupDecompressOrCopyFile(void)
DeleteFileA
(
source
);
}
static
void
test_SetupUninstallOEMInf
(
void
)
{
BOOL
ret
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupUninstallOEMInfA
(
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pSetupUninstallOEMInfA
(
""
,
0
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
ret
=
pSetupUninstallOEMInfA
(
"nonexistent.inf"
,
0
,
NULL
);
todo_wine
{
ok
(
!
ret
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
}
}
START_TEST
(
misc
)
{
HMODULE
hsetupapi
=
GetModuleHandle
(
"setupapi.dll"
);
...
...
@@ -588,6 +615,7 @@ START_TEST(misc)
pSetupGetFileCompressionInfoExA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupGetFileCompressionInfoExA"
);
pSetupCopyOEMInfA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupCopyOEMInfA"
);
pSetupQueryInfOriginalFileInformationA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupQueryInfOriginalFileInformationA"
);
pSetupUninstallOEMInfA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupUninstallOEMInfA"
);
GetCurrentDirectoryA
(
MAX_PATH
,
CURR_DIR
);
...
...
@@ -604,4 +632,9 @@ START_TEST(misc)
win_skip
(
"SetupGetFileCompressionInfoExA is not available
\n
"
);
test_SetupDecompressOrCopyFile
();
if
(
pSetupUninstallOEMInfA
)
test_SetupUninstallOEMInf
();
else
win_skip
(
"SetupUninstallOEMInfA is not available
\n
"
);
}
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