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
8432e7dd
Commit
8432e7dd
authored
Aug 19, 2015
by
Hugh McMaster
Committed by
Alexandre Julliard
Aug 19, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uninstaller: Add WriteFile fallback.
parent
72807622
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
main.c
programs/uninstaller/main.c
+23
-2
No files found.
programs/uninstaller/main.c
View file @
8432e7dd
...
...
@@ -59,10 +59,31 @@ static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l
static
const
WCHAR
WindowsInstallerW
[]
=
{
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
SystemComponentW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'C'
,
'o'
,
'm'
,
'p'
,
'o'
,
'n'
,
'e'
,
'n'
,
't'
,
0
};
static
void
output_writeconsole
(
const
WCHAR
*
str
,
DWORD
len
)
{
DWORD
written
,
ret
,
lenA
;
char
*
strA
;
ret
=
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
str
,
len
,
&
written
,
NULL
);
if
(
ret
)
return
;
/* WriteConsole fails if its output is redirected to a file.
* If this occurs, we should use an OEM codepage and call WriteFile.
*/
lenA
=
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
str
,
len
,
NULL
,
0
,
NULL
,
NULL
);
strA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenA
);
if
(
strA
)
{
WideCharToMultiByte
(
GetConsoleOutputCP
(),
0
,
str
,
len
,
strA
,
lenA
,
NULL
,
NULL
);
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
strA
,
lenA
,
&
written
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
strA
);
}
}
static
void
output_formatstring
(
const
WCHAR
*
fmt
,
__ms_va_list
va_args
)
{
WCHAR
*
str
;
DWORD
len
,
count
;
DWORD
len
;
SetLastError
(
NO_ERROR
);
len
=
FormatMessageW
(
FORMAT_MESSAGE_FROM_STRING
|
FORMAT_MESSAGE_ALLOCATE_BUFFER
,
...
...
@@ -72,7 +93,7 @@ static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
WINE_FIXME
(
"Could not format string: le=%u, fmt=%s
\n
"
,
GetLastError
(),
wine_dbgstr_w
(
fmt
));
return
;
}
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
str
,
len
,
&
count
,
NULL
);
output_writeconsole
(
str
,
len
);
LocalFree
(
str
);
}
...
...
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