Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
be5c1c86
Commit
be5c1c86
authored
May 02, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmic: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6cd7240f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
Makefile.in
programs/wmic/Makefile.in
+2
-1
main.c
programs/wmic/main.c
+20
-21
No files found.
programs/wmic/Makefile.in
View file @
be5c1c86
MODULE
=
wmic.exe
APPMODE
=
-mconsole
-municode
IMPORTS
=
oleaut32 ole32 user32
EXTRADLLFLAGS
=
-mconsole
-municode
-mno-cygwin
C_SRCS
=
\
main.c
...
...
programs/wmic/main.c
View file @
be5c1c86
...
...
@@ -28,7 +28,6 @@
#include "wmic.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wmic
);
...
...
@@ -84,7 +83,7 @@ static const WCHAR *find_class( const WCHAR *alias )
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
alias_map
);
i
++
)
{
if
(
!
strcmpiW
(
alias
,
alias_map
[
i
].
alias
))
return
alias_map
[
i
].
class
;
if
(
!
wcsicmp
(
alias
,
alias_map
[
i
].
alias
))
return
alias_map
[
i
].
class
;
}
return
NULL
;
}
...
...
@@ -93,8 +92,8 @@ static inline WCHAR *strdupW( const WCHAR *src )
{
WCHAR
*
dst
;
if
(
!
src
)
return
NULL
;
if
(
!
(
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
strcpyW
(
dst
,
src
);
if
(
!
(
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
l
strlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
l
strcpyW
(
dst
,
src
);
return
dst
;
}
...
...
@@ -111,7 +110,7 @@ static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop )
for
(
i
=
0
;
i
<=
last_index
;
i
++
)
{
SafeArrayGetElement
(
sa
,
&
i
,
&
str
);
if
(
!
strcmpiW
(
str
,
prop
))
if
(
!
wcsicmp
(
str
,
prop
))
{
ret
=
strdupW
(
str
);
break
;
...
...
@@ -121,16 +120,16 @@ static WCHAR *find_prop( IWbemClassObject *class, const WCHAR *prop )
return
ret
;
}
static
int
output_string
(
HANDLE
handle
,
const
WCHAR
*
msg
,
...
)
static
int
WINAPIV
output_string
(
HANDLE
handle
,
const
WCHAR
*
msg
,
...
)
{
va_list
va_args
;
__ms_
va_list
va_args
;
int
len
;
DWORD
count
;
WCHAR
buffer
[
8192
];
va_start
(
va_args
,
msg
);
len
=
vs
nprintfW
(
buffer
,
ARRAY_SIZE
(
buffer
),
msg
,
va_args
);
va_end
(
va_args
);
__ms_
va_start
(
va_args
,
msg
);
len
=
vs
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
msg
,
va_args
);
__ms_
va_end
(
va_args
);
if
(
!
WriteConsoleW
(
handle
,
buffer
,
len
,
&
count
,
NULL
))
WriteFile
(
handle
,
buffer
,
len
*
sizeof
(
WCHAR
),
&
count
,
FALSE
);
...
...
@@ -154,7 +153,7 @@ static int output_header( const WCHAR *prop, ULONG column_width )
DWORD
count
;
WCHAR
buffer
[
8192
];
len
=
s
nprintfW
(
buffer
,
ARRAY_SIZE
(
buffer
),
fmtW
,
column_width
,
prop
);
len
=
s
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
fmtW
,
column_width
,
prop
);
if
(
!
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
buffer
,
len
,
&
count
,
NULL
))
/* redirected */
{
...
...
@@ -204,10 +203,10 @@ static int query_prop( const WCHAR *class, const WCHAR *propname )
hr
=
IWbemLocator_ConnectServer
(
locator
,
path
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
NULL
,
&
services
);
if
(
hr
!=
S_OK
)
goto
done
;
len
=
strlenW
(
class
)
+
ARRAY_SIZE
(
select_allW
);
len
=
l
strlenW
(
class
)
+
ARRAY_SIZE
(
select_allW
);
if
(
!
(
query
=
SysAllocStringLen
(
NULL
,
len
)))
goto
done
;
strcpyW
(
query
,
select_allW
);
strcatW
(
query
,
class
);
l
strcpyW
(
query
,
select_allW
);
l
strcatW
(
query
,
class
);
if
(
!
(
wql
=
SysAllocString
(
wqlW
)))
goto
done
;
hr
=
IWbemServices_ExecQuery
(
services
,
wql
,
query
,
flags
,
NULL
,
&
result
);
...
...
@@ -226,7 +225,7 @@ static int query_prop( const WCHAR *class, const WCHAR *propname )
if
(
IWbemClassObject_Get
(
obj
,
prop
,
0
,
&
v
,
NULL
,
NULL
)
==
WBEM_S_NO_ERROR
)
{
VariantChangeType
(
&
v
,
&
v
,
0
,
VT_BSTR
);
width
=
max
(
strlenW
(
V_BSTR
(
&
v
)
),
width
);
width
=
max
(
l
strlenW
(
V_BSTR
(
&
v
)
),
width
);
VariantClear
(
&
v
);
}
IWbemClassObject_Release
(
obj
);
...
...
@@ -283,20 +282,20 @@ int wmain(int argc, WCHAR *argv[])
if
(
i
>=
argc
)
goto
not_supported
;
if
(
!
strcmpiW
(
argv
[
i
],
quitW
)
||
!
strcmpiW
(
argv
[
i
],
exitW
))
if
(
!
wcsicmp
(
argv
[
i
],
quitW
)
||
!
wcsicmp
(
argv
[
i
],
exitW
))
{
return
0
;
}
if
(
!
strcmpiW
(
argv
[
i
],
classW
)
||
!
strcmpiW
(
argv
[
i
],
contextW
))
if
(
!
wcsicmp
(
argv
[
i
],
classW
)
||
!
wcsicmp
(
argv
[
i
],
contextW
))
{
WINE_FIXME
(
"command %s not supported
\n
"
,
debugstr_w
(
argv
[
i
])
);
goto
not_supported
;
}
if
(
!
strcmpiW
(
argv
[
i
],
pathW
))
if
(
!
wcsicmp
(
argv
[
i
],
pathW
))
{
if
(
++
i
>=
argc
)
{
...
...
@@ -318,7 +317,7 @@ int wmain(int argc, WCHAR *argv[])
if
(
++
i
>=
argc
)
goto
not_supported
;
if
(
!
strcmpiW
(
argv
[
i
],
getW
))
if
(
!
wcsicmp
(
argv
[
i
],
getW
))
{
if
(
++
i
>=
argc
)
goto
not_supported
;
...
...
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