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
0520defe
Commit
0520defe
authored
Jul 14, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wmiutils: Add a stub implementation of IWbemStatusCodeText.
parent
dd1d8cab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
175 additions
and
2 deletions
+175
-2
Makefile.in
dlls/wmiutils/Makefile.in
+3
-2
statuscode.c
dlls/wmiutils/statuscode.c
+153
-0
wmiutils_private.h
dlls/wmiutils/wmiutils_private.h
+19
-0
No files found.
dlls/wmiutils/Makefile.in
View file @
0520defe
...
@@ -3,10 +3,11 @@ TOPOBJDIR = ../..
...
@@ -3,10 +3,11 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
wmiutils.dll
MODULE
=
wmiutils.dll
IMPORTS
=
kernel32
IMPORTS
=
oleaut32
kernel32
C_SRCS
=
\
C_SRCS
=
\
main.c
main.c
\
statuscode.c
@MAKE_DLL_RULES@
@MAKE_DLL_RULES@
...
...
dlls/wmiutils/statuscode.c
0 → 100644
View file @
0520defe
/*
* Copyright 2009 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "initguid.h"
#include "ole2.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wmiutils_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wmiutils
);
typedef
struct
status_code
{
const
IWbemStatusCodeTextVtbl
*
vtbl
;
LONG
refs
;
}
status_code
;
static
inline
status_code
*
impl_from_IWbemStatusCodeText
(
IWbemStatusCodeText
*
iface
)
{
return
(
status_code
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
status_code
,
vtbl
));
}
static
ULONG
WINAPI
status_code_AddRef
(
IWbemStatusCodeText
*
iface
)
{
status_code
*
status_code
=
impl_from_IWbemStatusCodeText
(
iface
);
return
InterlockedIncrement
(
&
status_code
->
refs
);
}
static
ULONG
WINAPI
status_code_Release
(
IWbemStatusCodeText
*
iface
)
{
status_code
*
status_code
=
impl_from_IWbemStatusCodeText
(
iface
);
LONG
refs
=
InterlockedDecrement
(
&
status_code
->
refs
);
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
status_code
);
HeapFree
(
GetProcessHeap
(),
0
,
status_code
);
}
return
refs
;
}
static
HRESULT
WINAPI
status_code_QueryInterface
(
IWbemStatusCodeText
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
status_code
*
This
=
impl_from_IWbemStatusCodeText
(
iface
);
TRACE
(
"%p %s %p
\n
"
,
This
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualGUID
(
riid
,
&
IID_IWbemStatusCodeText
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
)
)
{
*
ppvObject
=
iface
;
}
else
{
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
));
return
E_NOINTERFACE
;
}
IWbemStatusCodeText_AddRef
(
iface
);
return
S_OK
;
}
static
HRESULT
WINAPI
status_code_GetErrorCodeText
(
IWbemStatusCodeText
*
iface
,
HRESULT
res
,
LCID
lcid
,
LONG
flags
,
BSTR
*
text
)
{
static
const
WCHAR
fmt
[]
=
{
'E'
,
'r'
,
'r'
,
'o'
,
'r'
,
' '
,
'c'
,
'o'
,
'd'
,
'e'
,
':'
,
' '
,
'0'
,
'x'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
WCHAR
msg
[
32
];
FIXME
(
"%p, 0x%08x, 0x%04x, 0x%08x, %p
\n
"
,
iface
,
res
,
lcid
,
flags
,
text
);
sprintfW
(
msg
,
fmt
,
res
);
*
text
=
SysAllocString
(
msg
);
return
WBEM_S_NO_ERROR
;
}
static
HRESULT
WINAPI
status_code_GetFacilityCodeText
(
IWbemStatusCodeText
*
iface
,
HRESULT
res
,
LCID
lcid
,
LONG
flags
,
BSTR
*
text
)
{
static
const
WCHAR
fmt
[]
=
{
'F'
,
'a'
,
'c'
,
'i'
,
'l'
,
'i'
,
't'
,
'y'
,
' '
,
'c'
,
'o'
,
'd'
,
'e'
,
':'
,
' '
,
'0'
,
'x'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
WCHAR
msg
[
32
];
FIXME
(
"%p, 0x%08x, 0x%04x, 0x%08x, %p
\n
"
,
iface
,
res
,
lcid
,
flags
,
text
);
sprintfW
(
msg
,
fmt
,
res
);
*
text
=
SysAllocString
(
msg
);
return
WBEM_S_NO_ERROR
;
}
static
const
struct
IWbemStatusCodeTextVtbl
status_code_vtbl
=
{
status_code_QueryInterface
,
status_code_AddRef
,
status_code_Release
,
status_code_GetErrorCodeText
,
status_code_GetFacilityCodeText
};
HRESULT
WbemStatusCodeText_create
(
IUnknown
*
pUnkOuter
,
LPVOID
*
ppObj
)
{
status_code
*
sc
;
TRACE
(
"(%p,%p)
\n
"
,
pUnkOuter
,
ppObj
);
sc
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
sc
)
);
if
(
!
sc
)
return
E_OUTOFMEMORY
;
sc
->
vtbl
=
&
status_code_vtbl
;
sc
->
refs
=
1
;
*
ppObj
=
&
sc
->
vtbl
;
TRACE
(
"returning iface %p
\n
"
,
*
ppObj
);
return
S_OK
;
}
dlls/wmiutils/wmiutils_private.h
0 → 100644
View file @
0520defe
/*
* Copyright 2009 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
HRESULT
WbemStatusCodeText_create
(
IUnknown
*
,
LPVOID
*
);
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