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
202942de
Commit
202942de
authored
Feb 14, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Feb 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Handle the INFINFO_INF_NAME_IS_ABSOLUTE and
INFINFO_DEFAULT_SEARCH search flags.
parent
f29d4af3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
45 deletions
+45
-45
query.c
dlls/setupapi/query.c
+33
-15
query.c
dlls/setupapi/tests/query.c
+12
-30
No files found.
dlls/setupapi/query.c
View file @
202942de
...
...
@@ -98,12 +98,13 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
PSP_INF_INFORMATION
ReturnBuffer
,
DWORD
ReturnBufferSize
,
PDWORD
RequiredSize
)
{
HINF
inf
=
(
HINF
)
InfSpec
;
HINF
inf
;
BOOL
ret
;
TRACE
(
"(%p, %ld, %p, %ld, %p)
\n
"
,
InfSpec
,
SearchControl
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
if
(
!
inf
)
if
(
!
InfSpec
)
{
if
(
SearchControl
==
INFINFO_INF_SPEC_IS_HINF
)
SetLastError
(
ERROR_INVALID_HANDLE
);
...
...
@@ -113,30 +114,47 @@ BOOL WINAPI SetupGetInfInformationW(LPCVOID InfSpec, DWORD SearchControl,
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
)
if
(
!
ReturnBuffer
&&
ReturnBufferSize
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
SearchControl
!=
INFINFO_INF_SPEC_IS_HINF
)
switch
(
SearchControl
)
{
FIXME
(
"Unhandled search control: %ld
\n
"
,
SearchControl
);
case
INFINFO_INF_SPEC_IS_HINF
:
inf
=
(
HINF
)
InfSpec
;
break
;
case
INFINFO_INF_NAME_IS_ABSOLUTE
:
case
INFINFO_DEFAULT_SEARCH
:
inf
=
SetupOpenInfFileW
(
InfSpec
,
NULL
,
INF_STYLE_OLDNT
|
INF_STYLE_WIN4
,
NULL
);
break
;
case
INFINFO_REVERSE_DEFAULT_SEARCH
:
case
INFINFO_INF_PATH_LIST_SEARCH
:
FIXME
(
"Unhandled search control: %ld
\n
"
,
SearchControl
);
if
(
RequiredSize
)
*
RequiredSize
=
0
;
if
(
RequiredSize
)
*
RequiredSize
=
0
;
return
FALSE
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
inf
==
INVALID_HANDLE_VALUE
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
return
fill_inf_info
(
inf
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
ret
=
fill_inf_info
(
inf
,
ReturnBuffer
,
ReturnBufferSize
,
RequiredSize
);
if
(
SearchControl
>=
INFINFO_INF_NAME_IS_ABSOLUTE
)
SetupCloseInfFile
(
inf
);
return
ret
;
}
/***********************************************************************
...
...
dlls/setupapi/tests/query.c
View file @
202942de
...
...
@@ -167,31 +167,22 @@ static void test_SetupGetInfInformation(void)
SetLastError
(
0xbeefcafe
);
ret
=
pSetupGetInfInformationA
(
"idontexist"
,
INFINFO_INF_NAME_IS_ABSOLUTE
,
NULL
,
0
,
&
size
);
ok
(
ret
==
FALSE
,
"Expected SetupGetInfInformation to fail
\n
"
);
todo_wine
{
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
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"Expected ERROR_FILE_NOT_FOUND, got %ld
\n
"
,
GetLastError
());
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
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\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
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
}
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
GetLastError
());
info
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
...
@@ -199,19 +190,13 @@ static void test_SetupGetInfInformation(void)
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
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld
\n
"
,
GetLastError
());
}
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
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_filename
),
"Expected returned filename to be equal
\n
"
);
}
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
);
...
...
@@ -238,11 +223,8 @@ static void test_SetupGetInfInformation(void)
/* test the INFINFO_DEFAULT_SEARCH search flag */
ret
=
pSetupGetInfInformationA
(
"test.inf"
,
INFINFO_DEFAULT_SEARCH
,
info
,
size
,
&
size
);
todo_wine
{
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_one
),
"Expected returned filename to be equal
\n
"
);
}
ok
(
ret
==
TRUE
,
"Expected SetupGetInfInformation to succeed
\n
"
);
ok
(
check_info_filename
(
info
,
inf_one
),
"Expected returned filename to be equal
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
info
=
alloc_inf_info
(
"test.inf"
,
INFINFO_REVERSE_DEFAULT_SEARCH
,
&
size
);
...
...
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