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
5928f54a
Commit
5928f54a
authored
Aug 16, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wbemdisp: Add a stub implementation of ISWbemLocator.
parent
786daa1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
299 additions
and
0 deletions
+299
-0
Makefile.in
dlls/wbemdisp/Makefile.in
+2
-0
locator.c
dlls/wbemdisp/locator.c
+267
-0
wbemdisp_private.h
dlls/wbemdisp/wbemdisp_private.h
+30
-0
No files found.
dlls/wbemdisp/Makefile.in
View file @
5928f54a
MODULE
=
wbemdisp.dll
IMPORTS
=
oleaut32
C_SRCS
=
\
locator.c
\
main.c
IDL_R_SRCS
=
wbemdisp_classes.idl
...
...
dlls/wbemdisp/locator.c
0 → 100644
View file @
5928f54a
/*
* Copyright 2013 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 "windef.h"
#include "winbase.h"
#include "initguid.h"
#include "objbase.h"
#include "wbemdisp.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wbemdisp_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wbemdisp
);
struct
locator
{
ISWbemLocator
ISWbemLocator_iface
;
LONG
refs
;
};
static
inline
struct
locator
*
impl_from_ISWbemLocator
(
ISWbemLocator
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
locator
,
ISWbemLocator_iface
);
}
static
ULONG
WINAPI
locator_AddRef
(
ISWbemLocator
*
iface
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
return
InterlockedIncrement
(
&
locator
->
refs
);
}
static
ULONG
WINAPI
locator_Release
(
ISWbemLocator
*
iface
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
LONG
refs
=
InterlockedDecrement
(
&
locator
->
refs
);
if
(
!
refs
)
{
TRACE
(
"destroying %p
\n
"
,
locator
);
heap_free
(
locator
);
}
return
refs
;
}
static
HRESULT
WINAPI
locator_QueryInterface
(
ISWbemLocator
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
TRACE
(
"%p, %s, %p
\n
"
,
locator
,
debugstr_guid
(
riid
),
ppvObject
);
if
(
IsEqualGUID
(
riid
,
&
IID_ISWbemLocator
)
||
IsEqualGUID
(
riid
,
&
IID_IDispatch
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
*
ppvObject
=
iface
;
}
else
{
FIXME
(
"interface %s not implemented
\n
"
,
debugstr_guid
(
riid
)
);
return
E_NOINTERFACE
;
}
ISWbemLocator_AddRef
(
iface
);
return
S_OK
;
}
static
HRESULT
WINAPI
locator_GetTypeInfoCount
(
ISWbemLocator
*
iface
,
UINT
*
count
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
TRACE
(
"%p, %p
\n
"
,
locator
,
count
);
*
count
=
1
;
return
S_OK
;
}
enum
type_id
{
ISWbemLocator_tid
,
last_tid
};
static
ITypeLib
*
wbemdisp_typelib
;
static
ITypeInfo
*
wbemdisp_typeinfo
[
last_tid
];
static
REFIID
wbemdisp_tid_id
[]
=
{
&
IID_ISWbemLocator
};
static
HRESULT
get_typeinfo
(
enum
type_id
tid
,
ITypeInfo
**
ret
)
{
HRESULT
hr
;
if
(
!
wbemdisp_typelib
)
{
ITypeLib
*
typelib
;
hr
=
LoadRegTypeLib
(
&
LIBID_WbemScripting
,
1
,
2
,
LOCALE_SYSTEM_DEFAULT
,
&
typelib
);
if
(
FAILED
(
hr
))
{
ERR
(
"LoadRegTypeLib failed: %08x
\n
"
,
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
(
(
void
**
)
&
wbemdisp_typelib
,
typelib
,
NULL
))
ITypeLib_Release
(
typelib
);
}
if
(
!
wbemdisp_typeinfo
[
tid
])
{
ITypeInfo
*
typeinfo
;
hr
=
ITypeLib_GetTypeInfoOfGuid
(
wbemdisp_typelib
,
wbemdisp_tid_id
[
tid
],
&
typeinfo
);
if
(
FAILED
(
hr
))
{
ERR
(
"GetTypeInfoOfGuid(%s) failed: %08x
\n
"
,
debugstr_guid
(
wbemdisp_tid_id
[
tid
]),
hr
);
return
hr
;
}
if
(
InterlockedCompareExchangePointer
(
(
void
**
)(
wbemdisp_typeinfo
+
tid
),
typeinfo
,
NULL
))
ITypeInfo_Release
(
typeinfo
);
}
*
ret
=
wbemdisp_typeinfo
[
tid
];
return
S_OK
;
}
static
HRESULT
WINAPI
locator_GetTypeInfo
(
ISWbemLocator
*
iface
,
UINT
index
,
LCID
lcid
,
ITypeInfo
**
info
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
TRACE
(
"%p, %u, %u, %p
\n
"
,
locator
,
index
,
lcid
,
info
);
return
get_typeinfo
(
ISWbemLocator_tid
,
info
);
}
static
HRESULT
WINAPI
locator_GetIDsOfNames
(
ISWbemLocator
*
iface
,
REFIID
riid
,
LPOLESTR
*
names
,
UINT
count
,
LCID
lcid
,
DISPID
*
dispid
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"%p, %s, %p, %u, %u, %p
\n
"
,
locator
,
debugstr_guid
(
riid
),
names
,
count
,
lcid
,
dispid
);
if
(
!
names
||
!
count
||
!
dispid
)
return
E_INVALIDARG
;
hr
=
get_typeinfo
(
ISWbemLocator_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_GetIDsOfNames
(
typeinfo
,
names
,
count
,
dispid
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
locator_Invoke
(
ISWbemLocator
*
iface
,
DISPID
member
,
REFIID
riid
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
result
,
EXCEPINFO
*
excep_info
,
UINT
*
arg_err
)
{
struct
locator
*
locator
=
impl_from_ISWbemLocator
(
iface
);
ITypeInfo
*
typeinfo
;
HRESULT
hr
;
TRACE
(
"%p, %d, %s, %d, %d, %p, %p, %p, %p
\n
"
,
locator
,
member
,
debugstr_guid
(
riid
),
lcid
,
flags
,
params
,
result
,
excep_info
,
arg_err
);
hr
=
get_typeinfo
(
ISWbemLocator_tid
,
&
typeinfo
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
ITypeInfo_Invoke
(
typeinfo
,
&
locator
->
ISWbemLocator_iface
,
member
,
flags
,
params
,
result
,
excep_info
,
arg_err
);
ITypeInfo_Release
(
typeinfo
);
}
return
hr
;
}
static
HRESULT
WINAPI
locator_ConnectServer
(
ISWbemLocator
*
iface
,
BSTR
strServer
,
BSTR
strNamespace
,
BSTR
strUser
,
BSTR
strPassword
,
BSTR
strLocale
,
BSTR
strAuthority
,
LONG
iSecurityFlags
,
IDispatch
*
objWbemNamedValueSet
,
ISWbemServices
**
objWbemServices
)
{
FIXME
(
"%p, %s, %s, %s, %p, %s, %s, 0x%08x, %p, %p
\n
"
,
iface
,
debugstr_w
(
strServer
),
debugstr_w
(
strNamespace
),
debugstr_w
(
strUser
),
strPassword
,
debugstr_w
(
strLocale
),
debugstr_w
(
strAuthority
),
iSecurityFlags
,
objWbemNamedValueSet
,
objWbemServices
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
locator_get_Security_
(
ISWbemLocator
*
iface
,
ISWbemSecurity
**
objWbemSecurity
)
{
FIXME
(
"%p, %p
\n
"
,
iface
,
objWbemSecurity
);
return
E_NOTIMPL
;
}
static
const
ISWbemLocatorVtbl
locator_vtbl
=
{
locator_QueryInterface
,
locator_AddRef
,
locator_Release
,
locator_GetTypeInfoCount
,
locator_GetTypeInfo
,
locator_GetIDsOfNames
,
locator_Invoke
,
locator_ConnectServer
,
locator_get_Security_
};
HRESULT
SWbemLocator_create
(
IUnknown
*
unk
,
void
**
obj
)
{
struct
locator
*
locator
;
TRACE
(
"%p, %p
\n
"
,
unk
,
obj
);
if
(
!
(
locator
=
heap_alloc
(
sizeof
(
*
locator
)
)))
return
E_OUTOFMEMORY
;
locator
->
ISWbemLocator_iface
.
lpVtbl
=
&
locator_vtbl
;
locator
->
refs
=
1
;
*
obj
=
&
locator
->
ISWbemLocator_iface
;
TRACE
(
"returning iface %p
\n
"
,
*
obj
);
return
S_OK
;
}
dlls/wbemdisp/wbemdisp_private.h
0 → 100644
View file @
5928f54a
/*
* Copyright 2013 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
SWbemLocator_create
(
IUnknown
*
,
LPVOID
*
)
DECLSPEC_HIDDEN
;
static
void
*
heap_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
static
inline
void
*
heap_alloc
(
size_t
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
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