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
aa4fe067
Commit
aa4fe067
authored
Apr 10, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupGetFileCompressionInfo on top of SetupGetFileCompressionInfoEx.
parent
2423c9f0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
121 additions
and
2 deletions
+121
-2
misc.c
dlls/setupapi/misc.c
+75
-0
setupapi.spec
dlls/setupapi/setupapi.spec
+2
-2
misc.c
dlls/setupapi/tests/misc.c
+41
-0
setupapi.h
include/setupapi.h
+3
-0
No files found.
dlls/setupapi/misc.c
View file @
aa4fe067
...
...
@@ -1201,6 +1201,81 @@ BOOL WINAPI SetupGetFileCompressionInfoExW( PCWSTR source, PWSTR name, DWORD len
return
ret
;
}
/***********************************************************************
* SetupGetFileCompressionInfoA (SETUPAPI.@)
*
* See SetupGetFileCompressionInfoW.
*/
DWORD
WINAPI
SetupGetFileCompressionInfoA
(
PCSTR
source
,
PSTR
*
name
,
PDWORD
source_size
,
PDWORD
target_size
,
PUINT
type
)
{
BOOL
ret
;
DWORD
error
,
required
;
LPSTR
actual_name
;
TRACE
(
"%s, %p, %p, %p, %p
\n
"
,
debugstr_a
(
source
),
name
,
source_size
,
target_size
,
type
);
if
(
!
source
||
!
name
||
!
source_size
||
!
target_size
||
!
type
)
return
ERROR_INVALID_PARAMETER
;
ret
=
SetupGetFileCompressionInfoExA
(
source
,
NULL
,
0
,
&
required
,
NULL
,
NULL
,
NULL
);
if
(
!
(
actual_name
=
MyMalloc
(
required
)))
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
SetupGetFileCompressionInfoExA
(
source
,
actual_name
,
required
,
&
required
,
source_size
,
target_size
,
type
);
if
(
!
ret
)
{
error
=
GetLastError
();
MyFree
(
actual_name
);
return
error
;
}
*
name
=
actual_name
;
return
ERROR_SUCCESS
;
}
/***********************************************************************
* SetupGetFileCompressionInfoW (SETUPAPI.@)
*
* Get compression type and compressed/uncompressed sizes of a given file.
*
* PARAMS
* source [I] File to examine.
* name [O] Actual filename used.
* source_size [O] Size of compressed file.
* target_size [O] Size of uncompressed file.
* type [O] Compression type.
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: Win32 error code.
*/
DWORD
WINAPI
SetupGetFileCompressionInfoW
(
PCWSTR
source
,
PWSTR
*
name
,
PDWORD
source_size
,
PDWORD
target_size
,
PUINT
type
)
{
BOOL
ret
;
DWORD
error
,
required
;
LPWSTR
actual_name
;
TRACE
(
"%s, %p, %p, %p, %p
\n
"
,
debugstr_w
(
source
),
name
,
source_size
,
target_size
,
type
);
if
(
!
source
||
!
name
||
!
source_size
||
!
target_size
||
!
type
)
return
ERROR_INVALID_PARAMETER
;
ret
=
SetupGetFileCompressionInfoExW
(
source
,
NULL
,
0
,
&
required
,
NULL
,
NULL
,
NULL
);
if
(
!
(
actual_name
=
MyMalloc
(
required
)))
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
SetupGetFileCompressionInfoExW
(
source
,
actual_name
,
required
,
&
required
,
source_size
,
target_size
,
type
);
if
(
!
ret
)
{
error
=
GetLastError
();
MyFree
(
actual_name
);
return
error
;
}
*
name
=
actual_name
;
return
ERROR_SUCCESS
;
}
static
DWORD
decompress_file_lz
(
LPCWSTR
source
,
LPCWSTR
target
)
{
DWORD
ret
;
...
...
dlls/setupapi/setupapi.spec
View file @
aa4fe067
...
...
@@ -395,10 +395,10 @@
@ stub SetupGetBackupInformationW
@ stdcall SetupGetBinaryField(ptr long ptr long ptr)
@ stdcall SetupGetFieldCount(ptr)
@ st
ub SetupGetFileCompressionInfoA
@ st
dcall SetupGetFileCompressionInfoA(str ptr ptr ptr ptr)
@ stdcall SetupGetFileCompressionInfoExA(str ptr long ptr ptr ptr ptr)
@ stdcall SetupGetFileCompressionInfoExW(wstr ptr long ptr ptr ptr ptr)
@ st
ub SetupGetFileCompressionInfoW
@ st
dcall SetupGetFileCompressionInfoW(wstr ptr ptr ptr ptr)
@ stdcall SetupGetFileQueueCount(long long ptr)
@ stdcall SetupGetFileQueueFlags(long ptr)
@ stub SetupGetInfFileListA
...
...
dlls/setupapi/tests/misc.c
View file @
aa4fe067
...
...
@@ -316,6 +316,46 @@ static const BYTE comp_cab_zip[] = {
0x2d
,
0x28
,
0x4a
,
0x2d
,
0x2e
,
0x4e
,
0x4d
,
0xe1
,
0xe5
,
0x02
,
0x00
};
static
void
test_SetupGetFileCompressionInfo
(
void
)
{
DWORD
ret
,
source_size
,
target_size
;
char
source
[
MAX_PATH
],
temp
[
MAX_PATH
],
*
name
;
UINT
type
;
GetTempPathA
(
sizeof
(
temp
),
temp
);
GetTempFileNameA
(
temp
,
"fci"
,
0
,
source
);
create_source_file
(
source
,
uncompressed
,
sizeof
(
uncompressed
));
ret
=
SetupGetFileCompressionInfoA
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
ret
=
SetupGetFileCompressionInfoA
(
source
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
ret
=
SetupGetFileCompressionInfoA
(
source
,
&
name
,
NULL
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
ret
=
SetupGetFileCompressionInfoA
(
source
,
&
name
,
&
source_size
,
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
ret
=
SetupGetFileCompressionInfoA
(
source
,
&
name
,
&
source_size
,
&
target_size
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
name
=
NULL
;
source_size
=
target_size
=
0
;
type
=
5
;
ret
=
SetupGetFileCompressionInfoA
(
source
,
&
name
,
&
source_size
,
&
target_size
,
&
type
);
ok
(
!
ret
,
"SetupGetFileCompressionInfo failed unexpectedly
\n
"
);
ok
(
name
&&
!
lstrcmpA
(
name
,
source
),
"got %s, expected %s
\n
"
,
name
,
source
);
ok
(
source_size
==
sizeof
(
uncompressed
),
"got %d
\n
"
,
source_size
);
ok
(
target_size
==
sizeof
(
uncompressed
),
"got %d
\n
"
,
target_size
);
ok
(
type
==
FILE_COMPRESSION_NONE
,
"got %d, expected FILE_COMPRESSION_NONE
\n
"
,
type
);
DeleteFileA
(
source
);
}
static
void
test_SetupGetFileCompressionInfoEx
(
void
)
{
BOOL
ret
;
...
...
@@ -491,6 +531,7 @@ START_TEST(misc)
GetCurrentDirectoryA
(
MAX_PATH
,
CURR_DIR
);
test_SetupCopyOEMInf
();
test_SetupGetFileCompressionInfo
();
if
(
pSetupGetFileCompressionInfoExA
)
test_SetupGetFileCompressionInfoEx
();
...
...
include/setupapi.h
View file @
aa4fe067
...
...
@@ -819,6 +819,9 @@ BOOL WINAPI SetupFindNextMatchLineW( PINFCONTEXT context_in, PCWSTR key, PIN
#define SetupFindNextMatchLine WINELIB_NAME_AW(SetupFindNextMatchLine)
BOOL
WINAPI
SetupGetBinaryField
(
PINFCONTEXT
context
,
DWORD
index
,
BYTE
*
buffer
,
DWORD
size
,
LPDWORD
required
);
DWORD
WINAPI
SetupGetFieldCount
(
PINFCONTEXT
context
);
DWORD
WINAPI
SetupGetFileCompressionInfoA
(
PCSTR
,
PSTR
*
,
PDWORD
,
PDWORD
,
PUINT
);
DWORD
WINAPI
SetupGetFileCompressionInfoW
(
PCWSTR
,
PWSTR
*
,
PDWORD
,
PDWORD
,
PUINT
);
#define SetupGetFileCompressionInfo WINELIB_NAME_AW(SetupGetFileCompressionInfo)
BOOL
WINAPI
SetupGetFileCompressionInfoExA
(
PCSTR
,
PSTR
,
DWORD
,
PDWORD
,
PDWORD
,
PDWORD
,
PUINT
);
BOOL
WINAPI
SetupGetFileCompressionInfoExW
(
PCWSTR
,
PWSTR
,
DWORD
,
PDWORD
,
PDWORD
,
PDWORD
,
PUINT
);
#define SetupGetFileCompressionInfoEx WINELIB_NAME_AW(SetupGetFileCompressionInfoEx)
...
...
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