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
05a308a8
Commit
05a308a8
authored
Apr 05, 2010
by
Stefan Leichter
Committed by
Alexandre Julliard
Apr 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupGetInfFileListA.
parent
714283c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
1 deletion
+97
-1
install.c
dlls/setupapi/install.c
+34
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+1
-1
install.c
dlls/setupapi/tests/install.c
+62
-0
No files found.
dlls/setupapi/install.c
View file @
05a308a8
...
...
@@ -1463,6 +1463,40 @@ BOOL WINAPI SetupInstallServicesFromInfSectionA( HINF Inf, PCSTR SectionName, DW
/***********************************************************************
* SetupGetInfFileListA (SETUPAPI.@)
*/
BOOL
WINAPI
SetupGetInfFileListA
(
PCSTR
dir
,
DWORD
style
,
PSTR
buffer
,
DWORD
insize
,
PDWORD
outsize
)
{
UNICODE_STRING
dirW
;
PWSTR
bufferW
=
NULL
;
BOOL
ret
=
FALSE
;
DWORD
outsizeA
,
outsizeW
;
if
(
dir
)
RtlCreateUnicodeStringFromAsciiz
(
&
dirW
,
dir
);
else
dirW
.
Buffer
=
NULL
;
if
(
buffer
)
bufferW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
insize
*
sizeof
(
WCHAR
));
ret
=
SetupGetInfFileListW
(
dirW
.
Buffer
,
style
,
bufferW
,
insize
,
&
outsizeW
);
if
(
ret
)
{
outsizeA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
bufferW
,
outsizeW
,
buffer
,
insize
,
NULL
,
NULL
);
if
(
outsize
)
*
outsize
=
outsizeA
;
}
HeapFree
(
GetProcessHeap
(),
0
,
bufferW
);
RtlFreeUnicodeString
(
&
dirW
);
return
ret
;
}
/***********************************************************************
* SetupGetInfFileListW (SETUPAPI.@)
*/
BOOL
WINAPI
SetupGetInfFileListW
(
PCWSTR
dir
,
DWORD
style
,
PWSTR
buffer
,
...
...
dlls/setupapi/setupapi.spec
View file @
05a308a8
...
...
@@ -412,7 +412,7 @@
@ stdcall SetupGetFileCompressionInfoW(wstr ptr ptr ptr ptr)
@ stdcall SetupGetFileQueueCount(long long ptr)
@ stdcall SetupGetFileQueueFlags(long ptr)
@ st
ub SetupGetInfFileListA
@ st
dcall SetupGetInfFileListA(str long ptr long ptr)
@ stdcall SetupGetInfFileListW(wstr long ptr long ptr)
@ stdcall SetupGetInfInformationA(ptr long ptr long ptr)
@ stdcall SetupGetInfInformationW(ptr long ptr long ptr)
...
...
dlls/setupapi/tests/install.c
View file @
05a308a8
...
...
@@ -53,6 +53,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
*
pSetupGetInfFileListA
)(
PCSTR
,
DWORD
,
PSTR
,
DWORD
,
PDWORD
);
static
BOOL
(
WINAPI
*
pSetupGetInfFileListW
)(
PCWSTR
,
DWORD
,
PWSTR
,
DWORD
,
PDWORD
);
/*
...
...
@@ -468,6 +469,65 @@ cleanup:
DeleteFile
(
inffile
);
}
static
void
test_inffilelistA
(
void
)
{
static
const
char
inffile2
[]
=
"test2.inf"
;
static
const
char
*
inf
=
"[Version]
\n
"
"Signature=
\"
$Chicago$
\"
"
;
char
buffer
[
MAX_PATH
]
=
{
0
};
char
dir
[
MAX_PATH
],
*
p
;
DWORD
expected
,
outsize
;
BOOL
ret
;
if
(
!
pSetupGetInfFileListA
)
{
win_skip
(
"SetupGetInfFileListA not present
\n
"
);
return
;
}
/* create a private directory, the temp directory may contain some
* inf files left over from old installations
*/
if
(
!
GetTempFileNameA
(
CURR_DIR
,
"inftest"
,
1
,
dir
))
{
win_skip
(
"GetTempFileNameA failed with error %d
\n
"
,
GetLastError
());
return
;
}
if
(
!
CreateDirectoryA
(
dir
,
NULL
))
{
win_skip
(
"CreateDirectoryA(%s) failed with error %d
\n
"
,
dir
,
GetLastError
());
return
;
}
if
(
!
SetCurrentDirectoryA
(
dir
))
{
win_skip
(
"SetCurrentDirectoryA failed with error %d
\n
"
,
GetLastError
());
RemoveDirectoryA
(
dir
);
return
;
}
create_inf_file
(
inffile
,
inf
);
create_inf_file
(
inffile2
,
inf
);
/* mixed style
*/
expected
=
3
+
strlen
(
inffile
)
+
strlen
(
inffile2
);
ret
=
pSetupGetInfFileListA
(
dir
,
INF_STYLE_OLDNT
|
INF_STYLE_WIN4
,
buffer
,
MAX_PATH
,
&
outsize
);
ok
(
ret
,
"expected SetupGetInfFileListA to succeed!
\n
"
);
ok
(
expected
==
outsize
,
"expected required buffersize to be %d, got %d
\n
"
,
expected
,
outsize
);
for
(
p
=
buffer
;
lstrlenA
(
p
)
&&
(
outsize
>
(
p
-
buffer
));
p
+=
lstrlenA
(
p
)
+
1
)
ok
(
!
lstrcmpA
(
p
,
inffile2
)
||
!
lstrcmpA
(
p
,
inffile
),
"unexpected filename %s
\n
"
,
p
);
DeleteFile
(
inffile
);
DeleteFile
(
inffile2
);
SetCurrentDirectoryA
(
CURR_DIR
);
RemoveDirectoryA
(
dir
);
}
static
void
test_inffilelist
(
void
)
{
static
const
char
inffile2
[]
=
"test2.inf"
;
...
...
@@ -656,6 +716,7 @@ START_TEST(install)
pInstallHinfSectionA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"InstallHinfSectionA"
);
pInstallHinfSectionW
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"InstallHinfSectionW"
);
pSetupGetInfFileListA
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupGetInfFileListA"
);
pSetupGetInfFileListW
=
(
void
*
)
GetProcAddress
(
hsetupapi
,
"SetupGetInfFileListW"
);
if
(
pInstallHinfSectionA
)
...
...
@@ -695,6 +756,7 @@ START_TEST(install)
}
test_inffilelist
();
test_inffilelistA
();
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