Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
202942de
Commit
202942de
authored
19 years ago
by
James Hawkins
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
setupapi: Handle the INFINFO_INF_NAME_IS_ABSOLUTE and
INFINFO_DEFAULT_SEARCH search flags.
parent
f29d4af3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/setupapi/query.c
+33
-15
33 additions, 15 deletions
dlls/setupapi/query.c
dlls/setupapi/tests/query.c
+12
-30
12 additions, 30 deletions
dlls/setupapi/tests/query.c
with
45 additions
and
45 deletions
dlls/setupapi/query.c
+
33
−
15
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
(
!
i
nf
)
if
(
!
I
nf
Spec
)
{
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
;
}
/***********************************************************************
...
...
This diff is collapsed.
Click to expand it.
dlls/setupapi/tests/query.c
+
12
−
30
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment