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
7628fcdd
Commit
7628fcdd
authored
Feb 23, 2010
by
Andrey Turkin
Committed by
Alexandre Julliard
Feb 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extrac32: Implement /C mode.
parent
2db497e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
Makefile.in
programs/extrac32/Makefile.in
+1
-1
extrac32.c
programs/extrac32/extrac32.c
+30
-2
No files found.
programs/extrac32/Makefile.in
View file @
7628fcdd
...
...
@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE
=
extrac32.exe
APPMODE
=
-mwindows
-municode
EXTRADEFS
=
-DWINE_NO_UNICODE
IMPORTS
=
shell32 setupapi user32 kernel32
IMPORTS
=
shell32 setupapi
shlwapi
user32 kernel32
C_SRCS
=
\
extrac32.c
...
...
programs/extrac32/extrac32.c
View file @
7628fcdd
...
...
@@ -22,12 +22,15 @@
#include <windows.h>
#include <shellapi.h>
#include <setupapi.h>
#include <shlwapi.h>
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
extrac32
);
static
BOOL
force_mode
;
static
UINT
WINAPI
ExtCabCallback
(
PVOID
Context
,
UINT
Notification
,
UINT_PTR
Param1
,
UINT_PTR
Param2
)
{
FILE_IN_CABINET_INFO_W
*
pInfo
;
...
...
@@ -54,6 +57,31 @@ static void extract(LPCWSTR cabfile, LPWSTR destdir)
WINE_ERR
(
"Could not extract cab file %s
\n
"
,
wine_dbgstr_w
(
cabfile
));
}
static
void
copy_file
(
LPCWSTR
source
,
LPCWSTR
destination
)
{
WCHAR
destfile
[
MAX_PATH
];
/* append source filename if destination is a directory */
if
(
PathIsDirectoryW
(
destination
))
{
PathCombineW
(
destfile
,
destination
,
PathFindFileNameW
(
source
));
destination
=
destfile
;
}
if
(
PathFileExistsW
(
destination
)
&&
!
force_mode
)
{
static
const
WCHAR
overwriteMsg
[]
=
{
'O'
,
'v'
,
'e'
,
'r'
,
'w'
,
'r'
,
'i'
,
't'
,
'e'
,
' '
,
'"'
,
'%'
,
's'
,
'"'
,
'?'
,
0
};
static
const
WCHAR
titleMsg
[]
=
{
'E'
,
'x'
,
't'
,
'r'
,
'a'
,
'c'
,
't'
,
0
};
WCHAR
msg
[
MAX_PATH
+
100
];
snprintfW
(
msg
,
sizeof
(
msg
)
/
sizeof
(
msg
[
0
]),
overwriteMsg
,
destination
);
if
(
MessageBoxW
(
NULL
,
msg
,
titleMsg
,
MB_YESNO
|
MB_ICONWARNING
)
!=
IDYES
)
return
;
}
WINE_TRACE
(
"copying %s to %s
\n
"
,
wine_dbgstr_w
(
source
),
wine_dbgstr_w
(
destination
));
CopyFileW
(
source
,
destination
,
FALSE
);
}
int
PASCAL
wWinMain
(
HINSTANCE
hInstance
,
HINSTANCE
prev
,
LPWSTR
cmdline
,
int
show
)
{
LPWSTR
*
argv
;
...
...
@@ -90,7 +118,7 @@ int PASCAL wWinMain(HINSTANCE hInstance, HINSTANCE prev, LPWSTR cmdline, int sho
WINE_FIXME
(
"/A not implemented
\n
"
);
break
;
case
'Y'
:
WINE_FIXME
(
"/Y not implemented
\n
"
)
;
force_mode
=
TRUE
;
break
;
case
'L'
:
if
((
i
+
1
)
>=
argc
)
return
0
;
...
...
@@ -128,7 +156,7 @@ int PASCAL wWinMain(HINSTANCE hInstance, HINSTANCE prev, LPWSTR cmdline, int sho
{
case
'C'
:
/* Copy file */
WINE_FIXME
(
"/C not implemented
\n
"
);
copy_file
(
cabfile
,
path
);
break
;
case
'E'
:
/* Extract CAB archive */
...
...
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