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
381221de
Commit
381221de
authored
Nov 09, 2009
by
Stefan Leichter
Committed by
Alexandre Julliard
Nov 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Add stub and some tests for SetupGetInfFileListW.
parent
ffb2cfc2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
1 deletion
+113
-1
install.c
dlls/setupapi/install.c
+13
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+1
-1
install.c
dlls/setupapi/tests/install.c
+99
-0
No files found.
dlls/setupapi/install.c
View file @
381221de
...
...
@@ -1446,3 +1446,16 @@ BOOL WINAPI SetupInstallServicesFromInfSectionA( HINF Inf, PCSTR SectionName, DW
return
ret
;
}
/***********************************************************************
* SetupGetInfFileListW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupGetInfFileListW
(
PCWSTR
dir
,
DWORD
style
,
PWSTR
buffer
,
DWORD
insize
,
PDWORD
outsize
)
{
FIXME
(
"(%s %d %p %d %p) stub
\n
"
,
debugstr_w
(
dir
),
style
,
buffer
,
insize
,
outsize
);
if
(
buffer
)
buffer
[
0
]
=
0
;
if
(
outsize
)
*
outsize
=
1
;
return
TRUE
;
}
dlls/setupapi/setupapi.spec
View file @
381221de
...
...
@@ -413,7 +413,7 @@
@ stdcall SetupGetFileQueueCount(long long ptr)
@ stdcall SetupGetFileQueueFlags(long ptr)
@ stub SetupGetInfFileListA
@ st
ub SetupGetInfFileListW
@ st
dcall SetupGetInfFileListW(wstr long ptr long ptr)
@ stdcall SetupGetInfInformationA(ptr long ptr long ptr)
@ stdcall SetupGetInfInformationW(ptr long ptr long ptr)
@ stub SetupGetInfSections
...
...
dlls/setupapi/tests/install.c
View file @
381221de
...
...
@@ -52,6 +52,7 @@ static char CURR_DIR[MAX_PATH];
static
void
(
WINAPI
*
pInstallHinfSectionA
)(
HWND
,
HINSTANCE
,
LPCSTR
,
INT
);
static
void
(
WINAPI
*
pInstallHinfSectionW
)(
HWND
,
HINSTANCE
,
LPCWSTR
,
INT
);
static
BOOL
(
WINAPI
*
pSetupGetInfFileListW
)(
PCWSTR
,
DWORD
,
PWSTR
,
DWORD
,
PDWORD
);
/*
* Helpers
...
...
@@ -466,6 +467,100 @@ cleanup:
DeleteFile
(
inffile
);
}
static
void
test_inffilelist
(
void
)
{
static
const
char
inffile2
[]
=
"test2.inf"
;
static
const
char
invalid_inf
[]
=
"invalid.inf"
;
static
const
char
*
inf
=
"[Version]
\n
"
"Signature=
\"
$Chicago$
\"
"
;
WCHAR
*
ptr
;
WCHAR
dir
[
MAX_PATH
]
=
{
0
};
WCHAR
buffer
[
MAX_PATH
]
=
{
0
};
DWORD
expected
,
outsize
;
BOOL
ret
;
if
(
!
pSetupGetInfFileListW
)
{
win_skip
(
"SetupGetInfFileListW not present
\n
"
);
return
;
}
/* NULL means %windir%\\inf
* get the value as reference
*/
expected
=
0
;
ret
=
pSetupGetInfFileListW
(
NULL
,
INF_STYLE_WIN4
,
NULL
,
0
,
&
expected
);
ok
(
ret
,
"expected SetupGetInfFileListW to succeed! Error: %d
\n
"
,
GetLastError
());
ok
(
expected
>
0
,
"expected required buffersize to be at least 1
\n
"
);
/* check if an empty string doesn't behaves like NULL */
outsize
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupGetInfFileListW
(
dir
,
INF_STYLE_WIN4
,
NULL
,
0
,
&
outsize
);
todo_wine
ok
(
!
ret
,
"expected SetupGetInfFileListW to fail!
\n
"
);
/* check a not existing directory
*/
MultiByteToWideChar
(
CP_ACP
,
0
,
CURR_DIR
,
-
1
,
dir
,
MAX_PATH
);
ptr
=
dir
+
lstrlenW
(
dir
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"
\\
not_existent"
,
-
1
,
ptr
,
MAX_PATH
-
lstrlenW
(
dir
));
outsize
=
0xffffffff
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupGetInfFileListW
(
dir
,
INF_STYLE_WIN4
,
NULL
,
0
,
&
outsize
);
ok
(
ret
,
"expected SetupGetInfFileListW to succeed!
\n
"
);
ok
(
outsize
==
1
,
"expected required buffersize to be 1, got %d
\n
"
,
outsize
);
todo_wine
ok
(
ERROR_PATH_NOT_FOUND
==
GetLastError
(),
"expected error ERROR_PATH_NOT_FOUND, got %d
\n
"
,
GetLastError
());
create_inf_file
(
inffile
,
inf
);
create_inf_file
(
inffile2
,
inf
);
create_inf_file
(
invalid_inf
,
"This content does not match the inf file format"
);
/* pass a filename instead of a directory
*/
*
ptr
=
'\\'
;
MultiByteToWideChar
(
CP_ACP
,
0
,
invalid_inf
,
-
1
,
ptr
+
1
,
MAX_PATH
-
lstrlenW
(
dir
));
outsize
=
0xffffffff
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupGetInfFileListW
(
dir
,
INF_STYLE_WIN4
,
NULL
,
0
,
&
outsize
);
todo_wine
ok
(
!
ret
,
"expected SetupGetInfFileListW to fail!
\n
"
);
todo_wine
ok
(
ERROR_DIRECTORY
==
GetLastError
(),
"expected error ERROR_DIRECTORY, got %d
\n
"
,
GetLastError
());
/* make the filename look like directory
*/
dir
[
1
+
lstrlenW
(
dir
)]
=
0
;
dir
[
lstrlenW
(
dir
)]
=
'\\'
;
SetLastError
(
0xdeadbeef
);
ret
=
pSetupGetInfFileListW
(
dir
,
INF_STYLE_WIN4
,
NULL
,
0
,
&
outsize
);
todo_wine
ok
(
!
ret
,
"expected SetupGetInfFileListW to fail!
\n
"
);
todo_wine
ok
(
ERROR_DIRECTORY
==
GetLastError
(),
"expected error ERROR_DIRECTORY, got %d
\n
"
,
GetLastError
());
/* now check the buffer content of a vaild call
*/
*
ptr
=
0
;
expected
=
3
+
strlen
(
inffile
)
+
strlen
(
inffile2
);
ret
=
pSetupGetInfFileListW
(
dir
,
INF_STYLE_WIN4
,
buffer
,
MAX_PATH
,
&
outsize
);
ok
(
ret
,
"expected SetupGetInfFileListW to succeed!
\n
"
);
todo_wine
ok
(
expected
==
outsize
,
"expected required buffersize to be %d, got %d
\n
"
,
expected
,
outsize
);
DeleteFile
(
inffile
);
DeleteFile
(
inffile2
);
DeleteFile
(
invalid_inf
);
}
START_TEST
(
install
)
{
HMODULE
hsetupapi
=
GetModuleHandle
(
"setupapi.dll"
);
...
...
@@ -483,6 +578,8 @@ START_TEST(install)
pInstallHinfSectionA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"InstallHinfSectionA"
);
pInstallHinfSectionW
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"InstallHinfSectionW"
);
pSetupGetInfFileListW
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupGetInfFileListW"
);
if
(
pInstallHinfSectionA
)
{
/* Check if pInstallHinfSectionA sets last error or is a stub (as on WinXP) */
...
...
@@ -519,5 +616,7 @@ START_TEST(install)
test_profile_items
();
}
test_inffilelist
();
SetCurrentDirectory
(
prev_path
);
}
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