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
fdc124c1
Commit
fdc124c1
authored
Apr 29, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hostname: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cc47be73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
Makefile.in
programs/hostname/Makefile.in
+2
-1
hostname.c
programs/hostname/hostname.c
+12
-13
No files found.
programs/hostname/Makefile.in
View file @
fdc124c1
MODULE
=
hostname.exe
APPMODE
=
-mconsole
-municode
DELAYIMPORTS
=
user32
EXTRADLLFLAGS
=
-mconsole
-municode
-mno-cygwin
C_SRCS
=
hostname.c
RC_SRCS
=
hostname.rc
programs/hostname/hostname.c
View file @
fdc124c1
...
...
@@ -20,23 +20,22 @@
*/
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <wincon.h>
#include <winnls.h>
#include <winuser.h>
#include <wine/unicode.h>
#include "hostname.h"
static
int
hostname_vprintfW
(
const
WCHAR
*
msg
,
va_list
va_args
)
static
int
hostname_vprintfW
(
const
WCHAR
*
msg
,
__ms_
va_list
va_args
)
{
int
wlen
;
DWORD
count
,
ret
;
WCHAR
msg_buffer
[
8192
];
wlen
=
vs
printfW
(
msg_buffer
,
msg
,
va_args
);
wlen
=
vs
wprintf
(
msg_buffer
,
ARRAY_SIZE
(
msg_buffer
)
,
msg
,
va_args
);
ret
=
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
msg_buffer
,
wlen
,
&
count
,
NULL
);
if
(
!
ret
)
...
...
@@ -63,29 +62,29 @@ static int hostname_vprintfW(const WCHAR *msg, va_list va_args)
return
count
;
}
static
int
hostname_printfW
(
const
WCHAR
*
msg
,
...)
static
int
WINAPIV
hostname_printfW
(
const
WCHAR
*
msg
,
...)
{
va_list
va_args
;
__ms_
va_list
va_args
;
int
len
;
va_start
(
va_args
,
msg
);
__ms_
va_start
(
va_args
,
msg
);
len
=
hostname_vprintfW
(
msg
,
va_args
);
va_end
(
va_args
);
__ms_
va_end
(
va_args
);
return
len
;
}
static
int
hostname_message_printfW
(
int
msg
,
...)
static
int
WINAPIV
hostname_message_printfW
(
int
msg
,
...)
{
va_list
va_args
;
__ms_
va_list
va_args
;
WCHAR
msg_buffer
[
8192
];
int
len
;
LoadStringW
(
GetModuleHandleW
(
NULL
),
msg
,
msg_buffer
,
ARRAY_SIZE
(
msg_buffer
));
va_start
(
va_args
,
msg
);
__ms_
va_start
(
va_args
,
msg
);
len
=
hostname_vprintfW
(
msg_buffer
,
va_args
);
va_end
(
va_args
);
__ms_
va_end
(
va_args
);
return
len
;
}
...
...
@@ -127,7 +126,7 @@ int wmain(int argc, WCHAR *argv[])
unsigned
int
i
;
if
(
!
strncmpW
(
argv
[
1
],
slashHelpW
,
ARRAY_SIZE
(
slashHelpW
)
-
1
))
if
(
!
wcsncmp
(
argv
[
1
],
slashHelpW
,
ARRAY_SIZE
(
slashHelpW
)
-
1
))
{
hostname_message
(
STRING_USAGE
);
return
1
;
...
...
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