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
21fb7ab6
Commit
21fb7ab6
authored
Feb 07, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Feb 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Add an initial implementation of SetupGetInfInformation.
parent
647329d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
55 deletions
+115
-55
query.c
dlls/setupapi/query.c
+93
-0
stubs.c
dlls/setupapi/stubs.c
+0
-24
query.c
dlls/setupapi/tests/query.c
+22
-31
No files found.
dlls/setupapi/query.c
View file @
21fb7ab6
...
...
@@ -33,6 +33,99 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
setupapi
);
/* fills the PSP_INF_INFORMATION struct fill_info is TRUE
* always returns the required size of the information
*/
static
BOOL
fill_inf_info
(
HINF
inf
,
PSP_INF_INFORMATION
buffer
,
DWORD
size
,
DWORD
*
required
)
{
LPCWSTR
filename
=
PARSER_get_inf_filename
(
inf
);
DWORD
total_size
=
FIELD_OFFSET
(
SP_INF_INFORMATION
,
VersionData
)
+
(
lstrlenW
(
filename
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
required
)
*
required
=
total_size
;
/* FIXME: we need to parse the INF file to find the correct version info */
if
(
buffer
)
{
if
(
size
<
total_size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
buffer
->
InfStyle
=
INF_STYLE_WIN4
;
buffer
->
InfCount
=
1
;
/* put the filename in buffer->VersionData */
lstrcpyW
((
LPWSTR
)
&
buffer
->
VersionData
[
0
],
filename
);
}
return
TRUE
;
}
/***********************************************************************
* SetupGetInfInformationA (SETUPAPI.@)
*
* BUGS
* If SearchControl is anything other than INFINFO_INF_SPEC_IS_HINF,
* then InfSpec needs to be converted to unicode.
*/
BOOL
WINAPI
SetupGetInfInformationA
(
LPCVOID
InfSpec
,
DWORD
SearchControl
,
PSP_INF_INFORMATION
ReturnBuffer
,
DWORD
ReturnBufferSize
,
PDWORD
RequiredSize
)
{
return
SetupGetInfInformationW
(
InfSpec
,
SearchControl
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
}
/***********************************************************************
* SetupGetInfInformationW (SETUPAPI.@)
*
* BUGS
* Only handles the case when InfSpec is an INF handle.
*/
BOOL
WINAPI
SetupGetInfInformationW
(
LPCVOID
InfSpec
,
DWORD
SearchControl
,
PSP_INF_INFORMATION
ReturnBuffer
,
DWORD
ReturnBufferSize
,
PDWORD
RequiredSize
)
{
HINF
inf
=
(
HINF
)
InfSpec
;
TRACE
(
"(%p, %ld, %p, %ld, %p)
\n
"
,
InfSpec
,
SearchControl
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
if
(
!
inf
)
{
if
(
SearchControl
==
INFINFO_INF_SPEC_IS_HINF
)
SetLastError
(
ERROR_INVALID_HANDLE
);
else
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
inf
==
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
if
(
SearchControl
<
INFINFO_INF_SPEC_IS_HINF
||
SearchControl
>
INFINFO_INF_PATH_LIST_SEARCH
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
SearchControl
!=
INFINFO_INF_SPEC_IS_HINF
)
{
FIXME
(
"Unhandled search control: %ld
\n
"
,
SearchControl
);
if
(
RequiredSize
)
*
RequiredSize
=
0
;
return
FALSE
;
}
return
fill_inf_info
(
inf
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
}
/***********************************************************************
* SetupQueryInfFileInformationA (SETUPAPI.@)
*/
...
...
dlls/setupapi/stubs.c
View file @
21fb7ab6
...
...
@@ -151,30 +151,6 @@ BOOL WINAPI SetupCopyOEMInfW(PCWSTR sourceinffile, PCWSTR sourcemedialoc,
}
/***********************************************************************
* SetupGetInfInformationA (SETUPAPI.@)
*/
BOOL
WINAPI
SetupGetInfInformationA
(
LPCVOID
InfSpec
,
DWORD
SearchControl
,
PSP_INF_INFORMATION
ReturnBuffer
,
DWORD
ReturnBufferSize
,
PDWORD
RequiredSize
)
{
FIXME
(
"(%p, %ld, %p, %ld, %p) Stub!
\n
"
,
InfSpec
,
SearchControl
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
return
TRUE
;
}
/***********************************************************************
* SetupGetInfInformationW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupGetInfInformationW
(
LPCVOID
InfSpec
,
DWORD
SearchControl
,
PSP_INF_INFORMATION
ReturnBuffer
,
DWORD
ReturnBufferSize
,
PDWORD
RequiredSize
)
{
FIXME
(
"(%p, %ld, %p, %ld, %p) Stub!
\n
"
,
InfSpec
,
SearchControl
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
return
TRUE
;
}
/***********************************************************************
* SetupInitializeFileLogW(SETUPAPI.@)
*/
HANDLE
WINAPI
SetupInitializeFileLogW
(
LPWSTR
LogFileName
,
DWORD
Flags
)
...
...
dlls/setupapi/tests/query.c
View file @
21fb7ab6
...
...
@@ -137,24 +137,18 @@ static void test_SetupGetInfInformation(void)
size
=
0xdeadbeef
;
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_SPEC_IS_HINF
,
NULL
,
0
,
&
size
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %ld
\n
"
,
GetLastError
());
}
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"Expected ERROR_INVALID_HANDLE, got %ld
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* try an invalid inf filename */
size
=
0xdeadbeef
;
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
NULL
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
create_inf_file
(
inf_filename
);
...
...
@@ -163,41 +157,38 @@ static void test_SetupGetInfInformation(void)
size
=
0xdeadbeef
;
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
-
1
,
NULL
,
0
,
&
size
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* try a nonexistent inf file */
size
=
0xdeadbeef
;
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
"idontexist"
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %ld
\n
"
,
GetLastError
());
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
}
ok
(
size
==
0xdeadbeef
,
"Expected size to remain unchanged
\n
"
);
/* successfully open the inf file */
size
=
0xdeadbeef
;
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
todo_wine
{
ok
(
size
!=
0xdeadbeef
,
"Expected a valid size on return
\n
"
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
}
ok
(
size
!=
0xdeadbeef
,
"Expected a valid size on return
\n
"
);
/* set ReturnBuffer to NULL and ReturnBufferSize to non-zero */
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
size
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
...
...
@@ -207,29 +198,29 @@ static void test_SetupGetInfInformation(void)
/* try valid ReturnBuffer but too small size */
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
-
1
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
todo_wine
{
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld
\n
"
,
GetLastError
());
}
/* successfully get the inf information */
ret
=
pSetupGetInfInformationA
(
inf_filename
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
info
,
size
,
&
size
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_filename
),
"Expected returned filename to be equal
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
info
);
/* try the INFINFO_INF_SPEC_IS_HINF search flag */
hinf
=
pSetupOpenInfFileA
(
inf_filename
,
NULL
,
INF_STYLE_WIN4
,
NULL
);
info
=
alloc_inf_info
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
&
size
);
ret
=
pSetupGetInfInformationA
(
hinf
,
INFINFO_INF_SPEC_IS_HINF
,
info
,
size
,
&
size
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
todo_wine
{
ok
(
check_info_filename
(
info
,
inf_filename
),
"Expected returned filename to be equal
\n
"
);
}
ok
(
check_info_filename
(
info
,
inf_filename
),
"Expected returned filename to be equal
\n
"
);
pSetupCloseInfFile
(
hinf
);
lstrcpyA
(
inf_one
,
WIN_DIR
);
...
...
@@ -247,9 +238,9 @@ static void test_SetupGetInfInformation(void)
/* test the INFINFO_DEFAULT_SEARCH search flag */
ret
=
pSetupGetInfInformationA
(
"test.inf"
,
INFINFO_DEFAULT_SEARCH
,
info
,
size
,
&
size
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_one
),
"Expected returned filename to be equal
\n
"
);
}
...
...
@@ -258,9 +249,9 @@ static void test_SetupGetInfInformation(void)
/* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */
ret
=
pSetupGetInfInformationA
(
"test.inf"
,
INFINFO_REVERSE_DEFAULT_SEARCH
,
info
,
size
,
&
size
);
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_two
),
"Expected returned filename to be equal
\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