[WBEMPROX]

* Import from Wine 1.5.26

svn path=/trunk/; revision=59324
This commit is contained in:
Amine Khaldi 2013-06-23 20:41:42 +00:00
parent 5323dbcb6c
commit 583b6cfed0
35 changed files with 13292 additions and 53 deletions

View file

@ -30,6 +30,7 @@ Signature = "$ReactOS$"
14 = Microsoft.NET\Framework\v2.0.50727
15 = Resources
16 = Resources\Themes
17 = system32\wbem
.InfEnd

View file

@ -187,7 +187,9 @@ macro(dir_to_num dir var)
set(${var} 15)
elseif(${dir} STREQUAL reactos/Resources/Themes)
set(${var} 16)
else()
elseif(${dir} STREQUAL reactos/system32/wbem)
set(${var} 17)
else()
message(FATAL_ERROR "Wrong destination: ${dir}")
endif()
endmacro()

View file

@ -208,6 +208,7 @@ add_subdirectory(uxtheme)
add_subdirectory(vbscript)
add_subdirectory(vdmdbg)
add_subdirectory(version)
add_subdirectory(wbemprox)
if(ARCH STREQUAL "i386")
add_subdirectory(wdmaud.drv)
endif()

View file

@ -0,0 +1,38 @@
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
add_definitions(-D__WINESRC__)
remove_definitions(-D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x600)
spec2def(wbemprox.dll wbemprox.spec)
list(APPEND SOURCE
builtin.c
class.c
main.c
process.c
qualifier.c
query.c
reg.c
service.c
services.c
table.c
wbemlocator.c
wql.tab.c
${CMAKE_CURRENT_BINARY_DIR}/wbemprox.def)
add_library(wbemprox SHARED ${SOURCE} wbemprox.rc)
if(NOT MSVC)
# FIXME: http://www.cmake.org/Bug/view.php?id=12998
#allow_warnings(wbemprox)
set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error")
endif()
set_source_files_properties(wbemprox.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wbemprox.rgs)
set_module_type(wbemprox win32dll)
target_link_libraries(wbemprox wine)
add_importlibs(wbemprox iphlpapi dxgi oleaut32 ole32 advapi32 user32 gdi32 msvcrt kernel32 ntdll)
add_dependencies(wbemprox d3d_idl_headers)
add_cd_file(TARGET wbemprox DESTINATION reactos/system32/wbem FOR all)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,180 @@
/*
*
* Copyright 2009 Austin English
*
* 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wbemprov.h"
#include "rpcproxy.h"
#include "wbemprox_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
static HINSTANCE instance;
typedef HRESULT (*fnCreateInstance)( IUnknown *pUnkOuter, LPVOID *ppObj );
typedef struct
{
IClassFactory IClassFactory_iface;
fnCreateInstance pfnCreateInstance;
} wbemprox_cf;
static inline wbemprox_cf *impl_from_IClassFactory( IClassFactory *iface )
{
return CONTAINING_RECORD(iface, wbemprox_cf, IClassFactory_iface);
}
static HRESULT WINAPI wbemprox_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj )
{
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory))
{
IClassFactory_AddRef( iface );
*ppobj = iface;
return S_OK;
}
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
static ULONG WINAPI wbemprox_cf_AddRef( IClassFactory *iface )
{
return 2;
}
static ULONG WINAPI wbemprox_cf_Release( IClassFactory *iface )
{
return 1;
}
static HRESULT WINAPI wbemprox_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter,
REFIID riid, LPVOID *ppobj )
{
wbemprox_cf *This = impl_from_IClassFactory( iface );
HRESULT r;
IUnknown *punk;
TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
*ppobj = NULL;
if (pOuter)
return CLASS_E_NOAGGREGATION;
r = This->pfnCreateInstance( pOuter, (LPVOID *)&punk );
if (FAILED(r))
return r;
r = IUnknown_QueryInterface( punk, riid, ppobj );
if (FAILED(r))
return r;
IUnknown_Release( punk );
return r;
}
static HRESULT WINAPI wbemprox_cf_LockServer( IClassFactory *iface, BOOL dolock )
{
FIXME("(%p)->(%d)\n", iface, dolock);
return S_OK;
}
static const struct IClassFactoryVtbl wbemprox_cf_vtbl =
{
wbemprox_cf_QueryInterface,
wbemprox_cf_AddRef,
wbemprox_cf_Release,
wbemprox_cf_CreateInstance,
wbemprox_cf_LockServer
};
static wbemprox_cf wbem_locator_cf = { { &wbemprox_cf_vtbl }, WbemLocator_create };
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
init_table_list();
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv )
{
IClassFactory *cf = NULL;
TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
if (IsEqualGUID( rclsid, &CLSID_WbemLocator ) ||
IsEqualGUID( rclsid, &CLSID_WbemAdministrativeLocator ))
{
cf = &wbem_locator_cf.IClassFactory_iface;
}
if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
return IClassFactory_QueryInterface( cf, iid, ppv );
}
/***********************************************************************
* DllCanUnloadNow (WBEMPROX.@)
*/
HRESULT WINAPI DllCanUnloadNow( void )
{
return S_FALSE;
}
/***********************************************************************
* DllRegisterServer (WBEMPROX.@)
*/
HRESULT WINAPI DllRegisterServer(void)
{
return __wine_register_resources( instance );
}
/***********************************************************************
* DllUnregisterServer (WBEMPROX.@)
*/
HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources( instance );
}

View file

@ -0,0 +1,108 @@
/*
* Win32_Process methods implementation
*
* 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
static HRESULT get_owner( VARIANT *user, VARIANT *domain, VARIANT *retval )
{
DWORD len;
UINT error = 8;
len = 0;
GetUserNameW( NULL, &len );
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) goto done;
if (!(V_BSTR( user ) = heap_alloc( len * sizeof(WCHAR) ))) goto done;
if (!GetUserNameW( V_BSTR( user ), &len )) goto done;
V_VT( user ) = VT_BSTR;
len = 0;
GetComputerNameW( NULL, &len );
if (GetLastError() != ERROR_BUFFER_OVERFLOW) goto done;
if (!(V_BSTR( domain ) = heap_alloc( len * sizeof(WCHAR) ))) goto done;
if (!GetComputerNameW( V_BSTR( domain ), &len )) goto done;
V_VT( domain ) = VT_BSTR;
error = 0;
done:
if (error)
{
VariantClear( user );
VariantClear( domain );
}
set_variant( VT_UI4, error, NULL, retval );
return S_OK;
}
HRESULT process_get_owner( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT user, domain, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p, %p\n", obj, in, out);
hr = create_signature( class_processW, method_getownerW, PARAM_OUT, &sig );
if (hr != S_OK) return hr;
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
IWbemClassObject_Release( sig );
return hr;
}
VariantInit( &user );
VariantInit( &domain );
hr = get_owner( &user, &domain, &retval );
if (hr != S_OK) goto done;
if (!V_UI4( &retval ))
{
hr = IWbemClassObject_Put( *out, param_userW, 0, &user, CIM_STRING );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_domainW, 0, &domain, CIM_STRING );
if (hr != S_OK) goto done;
}
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &user );
VariantClear( &domain );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}

View file

@ -0,0 +1,283 @@
/*
* 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
struct qualifier_set
{
IWbemQualifierSet IWbemQualifierSet_iface;
LONG refs;
WCHAR *class;
WCHAR *member;
};
static inline struct qualifier_set *impl_from_IWbemQualifierSet(
IWbemQualifierSet *iface )
{
return CONTAINING_RECORD(iface, struct qualifier_set, IWbemQualifierSet_iface);
}
static ULONG WINAPI qualifier_set_AddRef(
IWbemQualifierSet *iface )
{
struct qualifier_set *set = impl_from_IWbemQualifierSet( iface );
return InterlockedIncrement( &set->refs );
}
static ULONG WINAPI qualifier_set_Release(
IWbemQualifierSet *iface )
{
struct qualifier_set *set = impl_from_IWbemQualifierSet( iface );
LONG refs = InterlockedDecrement( &set->refs );
if (!refs)
{
TRACE("destroying %p\n", set);
heap_free( set->class );
heap_free( set->member );
heap_free( set );
}
return refs;
}
static HRESULT WINAPI qualifier_set_QueryInterface(
IWbemQualifierSet *iface,
REFIID riid,
void **ppvObject )
{
struct qualifier_set *set = impl_from_IWbemQualifierSet( iface );
TRACE("%p, %s, %p\n", set, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IWbemQualifierSet ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = set;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IWbemQualifierSet_AddRef( iface );
return S_OK;
}
static HRESULT create_qualifier_enum( const WCHAR *class, const WCHAR *member, const WCHAR *name,
IEnumWbemClassObject **iter )
{
static const WCHAR fmtW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','_','_','Q','U','A','L',
'I','F','I','E','R','S',' ','W','H','E','R','E',' ','C','l','a','s','s','=',
'\'','%','s','\'',' ','A','N','D',' ','M','e','m','b','e','r','=','\'','%','s','\'',' ',
'A','N','D',' ','N','a','m','e','=','\'','%','s','\'',0};
static const WCHAR fmt2W[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','_','_','Q','U','A','L',
'I','F','I','E','R','S',' ','W','H','E','R','E',' ','C','l','a','s','s','=',
'\'','%','s','\'',' ','A','N','D',' ','M','e','m','b','e','r','=','\'','%','s','\'',0};
static const WCHAR noneW[] = {'_','_','N','O','N','E',0};
WCHAR *query;
HRESULT hr;
int len;
if (!member) member = noneW;
len = strlenW( class ) + strlenW( member );
if (name) len += strlenW( name ) + SIZEOF(fmtW);
else len += SIZEOF(fmt2W);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
if (name) sprintfW( query, fmtW, class, member, name );
else sprintfW( query, fmt2W, class, member );
hr = exec_query( query, iter );
heap_free( query );
return hr;
}
static HRESULT get_qualifier_value( const WCHAR *class, const WCHAR *member, const WCHAR *name,
VARIANT *val, LONG *flavor )
{
static const WCHAR qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0};
static const WCHAR intvalueW[] = {'I','n','t','e','g','e','r','V','a','l','u','e',0};
static const WCHAR strvalueW[] = {'S','t','r','i','n','g','V','a','l','u','e',0};
static const WCHAR flavorW[] = {'F','l','a','v','o','r',0};
static const WCHAR typeW[] = {'T','y','p','e',0};
IEnumWbemClassObject *iter;
IWbemClassObject *obj;
VARIANT var;
HRESULT hr;
hr = create_qualifier_enum( class, member, name, &iter );
if (FAILED( hr )) return hr;
hr = create_class_object( qualifiersW, iter, 0, NULL, &obj );
IEnumWbemClassObject_Release( iter );
if (FAILED( hr )) return hr;
if (flavor)
{
hr = IWbemClassObject_Get( obj, flavorW, 0, &var, NULL, NULL );
if (hr != S_OK) goto done;
*flavor = V_I4( &var );
}
hr = IWbemClassObject_Get( obj, typeW, 0, &var, NULL, NULL );
if (hr != S_OK) goto done;
switch (V_UI4( &var ))
{
case CIM_STRING:
hr = IWbemClassObject_Get( obj, strvalueW, 0, val, NULL, NULL );
break;
case CIM_SINT32:
hr = IWbemClassObject_Get( obj, intvalueW, 0, val, NULL, NULL );
break;
default:
ERR("unhandled type %u\n", V_UI4( &var ));
break;
}
done:
IWbemClassObject_Release( obj );
return hr;
}
static HRESULT WINAPI qualifier_set_Get(
IWbemQualifierSet *iface,
LPCWSTR wszName,
LONG lFlags,
VARIANT *pVal,
LONG *plFlavor )
{
struct qualifier_set *set = impl_from_IWbemQualifierSet( iface );
FIXME("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, plFlavor);
return get_qualifier_value( set->class, set->member, wszName, pVal, plFlavor );
}
static HRESULT WINAPI qualifier_set_Put(
IWbemQualifierSet *iface,
LPCWSTR wszName,
VARIANT *pVal,
LONG lFlavor )
{
FIXME("%p, %s, %p, %d\n", iface, debugstr_w(wszName), pVal, lFlavor);
return E_NOTIMPL;
}
static HRESULT WINAPI qualifier_set_Delete(
IWbemQualifierSet *iface,
LPCWSTR wszName )
{
FIXME("%p, %s\n", iface, debugstr_w(wszName));
return E_NOTIMPL;
}
static HRESULT WINAPI qualifier_set_GetNames(
IWbemQualifierSet *iface,
LONG lFlags,
SAFEARRAY **pNames )
{
FIXME("%p, %08x, %p\n", iface, lFlags, pNames);
return E_NOTIMPL;
}
static HRESULT WINAPI qualifier_set_BeginEnumeration(
IWbemQualifierSet *iface,
LONG lFlags )
{
FIXME("%p, %08x\n", iface, lFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI qualifier_set_Next(
IWbemQualifierSet *iface,
LONG lFlags,
BSTR *pstrName,
VARIANT *pVal,
LONG *plFlavor )
{
FIXME("%p, %08x, %p, %p, %p\n", iface, lFlags, pstrName, pVal, plFlavor);
return E_NOTIMPL;
}
static HRESULT WINAPI qualifier_set_EndEnumeration(
IWbemQualifierSet *iface )
{
FIXME("%p\n", iface);
return E_NOTIMPL;
}
static const IWbemQualifierSetVtbl qualifier_set_vtbl =
{
qualifier_set_QueryInterface,
qualifier_set_AddRef,
qualifier_set_Release,
qualifier_set_Get,
qualifier_set_Put,
qualifier_set_Delete,
qualifier_set_GetNames,
qualifier_set_BeginEnumeration,
qualifier_set_Next,
qualifier_set_EndEnumeration
};
HRESULT WbemQualifierSet_create(
IUnknown *pUnkOuter, const WCHAR *class, const WCHAR *member, LPVOID *ppObj )
{
struct qualifier_set *set;
TRACE("%p, %p\n", pUnkOuter, ppObj);
if (!(set = heap_alloc( sizeof(*set) ))) return E_OUTOFMEMORY;
set->IWbemQualifierSet_iface.lpVtbl = &qualifier_set_vtbl;
if (!(set->class = heap_strdupW( class )))
{
heap_free( set );
return E_OUTOFMEMORY;
}
if (!member) set->member = NULL;
else if (!(set->member = heap_strdupW( member )))
{
heap_free( set->class );
heap_free( set );
return E_OUTOFMEMORY;
}
set->refs = 1;
*ppObj = &set->IWbemQualifierSet_iface;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,887 @@
/*
* Copyright 2012 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
HRESULT create_view( const struct property *proplist, const WCHAR *class,
const struct expr *cond, struct view **ret )
{
struct view *view = heap_alloc( sizeof(struct view) );
if (!view) return E_OUTOFMEMORY;
view->proplist = proplist;
view->table = grab_table( class );
view->cond = cond;
view->result = NULL;
view->count = 0;
*ret = view;
return S_OK;
}
void destroy_view( struct view *view )
{
if (!view) return;
if (view->table) release_table( view->table );
heap_free( view->result );
heap_free( view );
}
static BOOL eval_like( const WCHAR *lstr, const WCHAR *rstr )
{
const WCHAR *p = lstr, *q = rstr;
while (*p && *q)
{
if (*q == '%')
{
while (*q == '%') q++;
if (!*q) return TRUE;
while (*p && toupperW( p[1] ) != toupperW( q[1] )) p++;
if (!*p) return TRUE;
}
if (toupperW( *p++ ) != toupperW( *q++ )) return FALSE;
}
return TRUE;
}
static HRESULT eval_strcmp( UINT op, const WCHAR *lstr, const WCHAR *rstr, LONGLONG *val )
{
if (!lstr || !rstr)
{
*val = 0;
return S_OK;
}
switch (op)
{
case OP_EQ:
*val = !strcmpW( lstr, rstr );
break;
case OP_GT:
*val = strcmpW( lstr, rstr ) > 0;
break;
case OP_LT:
*val = strcmpW( lstr, rstr ) < 0;
break;
case OP_LE:
*val = strcmpW( lstr, rstr ) <= 0;
break;
case OP_GE:
*val = strcmpW( lstr, rstr ) >= 0;
break;
case OP_NE:
*val = strcmpW( lstr, rstr );
break;
case OP_LIKE:
*val = eval_like( lstr, rstr );
break;
default:
ERR("unhandled operator %u\n", op);
return WBEM_E_INVALID_QUERY;
}
return S_OK;
}
static inline BOOL is_strcmp( const struct complex_expr *expr )
{
return ((expr->left->type == EXPR_PROPVAL && expr->right->type == EXPR_SVAL) ||
(expr->left->type == EXPR_SVAL && expr->right->type == EXPR_PROPVAL));
}
static HRESULT eval_cond( const struct table *, UINT, const struct expr *, LONGLONG * );
static HRESULT eval_binary( const struct table *table, UINT row, const struct complex_expr *expr,
LONGLONG *val )
{
HRESULT lret, rret;
LONGLONG lval, rval;
lret = eval_cond( table, row, expr->left, &lval );
rret = eval_cond( table, row, expr->right, &rval );
if (lret != S_OK || rret != S_OK) return WBEM_E_INVALID_QUERY;
if (is_strcmp( expr ))
{
const WCHAR *lstr = (const WCHAR *)(INT_PTR)lval;
const WCHAR *rstr = (const WCHAR *)(INT_PTR)rval;
return eval_strcmp( expr->op, lstr, rstr, val );
}
switch (expr->op)
{
case OP_EQ:
*val = (lval == rval);
break;
case OP_AND:
*val = (lval && rval);
break;
case OP_OR:
*val = (lval || rval);
break;
case OP_GT:
*val = (lval > rval);
break;
case OP_LT:
*val = (lval < rval);
break;
case OP_LE:
*val = (lval <= rval);
break;
case OP_GE:
*val = (lval >= rval);
break;
case OP_NE:
*val = (lval != rval);
break;
default:
ERR("unhandled operator %u\n", expr->op);
return WBEM_E_INVALID_QUERY;
}
return S_OK;
}
static HRESULT eval_unary( const struct table *table, UINT row, const struct complex_expr *expr,
LONGLONG *val )
{
HRESULT hr;
UINT column;
LONGLONG lval;
hr = get_column_index( table, expr->left->u.propval->name, &column );
if (hr != S_OK)
return hr;
hr = get_value( table, row, column, &lval );
if (hr != S_OK)
return hr;
switch (expr->op)
{
case OP_ISNULL:
*val = !lval;
break;
case OP_NOTNULL:
*val = lval;
break;
default:
ERR("unknown operator %u\n", expr->op);
return WBEM_E_INVALID_QUERY;
}
return S_OK;
}
static HRESULT eval_propval( const struct table *table, UINT row, const struct property *propval,
LONGLONG *val )
{
HRESULT hr;
UINT column;
hr = get_column_index( table, propval->name, &column );
if (hr != S_OK)
return hr;
return get_value( table, row, column, val );
}
static HRESULT eval_cond( const struct table *table, UINT row, const struct expr *cond,
LONGLONG *val )
{
if (!cond)
{
*val = 1;
return S_OK;
}
switch (cond->type)
{
case EXPR_COMPLEX:
return eval_binary( table, row, &cond->u.expr, val );
case EXPR_UNARY:
return eval_unary( table, row, &cond->u.expr, val );
case EXPR_PROPVAL:
return eval_propval( table, row, cond->u.propval, val );
case EXPR_SVAL:
*val = (INT_PTR)cond->u.sval;
return S_OK;
case EXPR_IVAL:
case EXPR_BVAL:
*val = cond->u.ival;
return S_OK;
default:
ERR("invalid expression type\n");
break;
}
return WBEM_E_INVALID_QUERY;
}
static HRESULT execute_view( struct view *view )
{
UINT i, j = 0, len;
if (!view->table || !view->table->num_rows) return S_OK;
len = min( view->table->num_rows, 16 );
if (!(view->result = heap_alloc( len * sizeof(UINT) ))) return E_OUTOFMEMORY;
for (i = 0; i < view->table->num_rows; i++)
{
HRESULT hr;
LONGLONG val = 0;
if (j >= len)
{
UINT *tmp;
len *= 2;
if (!(tmp = heap_realloc( view->result, len * sizeof(UINT) ))) return E_OUTOFMEMORY;
view->result = tmp;
}
if ((hr = eval_cond( view->table, i, view->cond, &val )) != S_OK) return hr;
if (val) view->result[j++] = i;
}
view->count = j;
return S_OK;
}
static struct query *create_query(void)
{
struct query *query;
if (!(query = heap_alloc( sizeof(*query) ))) return NULL;
list_init( &query->mem );
query->refs = 1;
return query;
}
static void free_query( struct query *query )
{
struct list *mem, *next;
destroy_view( query->view );
LIST_FOR_EACH_SAFE( mem, next, &query->mem )
{
heap_free( mem );
}
heap_free( query );
}
struct query *addref_query( struct query *query )
{
InterlockedIncrement( &query->refs );
return query;
}
void release_query( struct query *query )
{
if (!InterlockedDecrement( &query->refs )) free_query( query );
}
HRESULT exec_query( const WCHAR *str, IEnumWbemClassObject **result )
{
HRESULT hr;
struct query *query;
*result = NULL;
if (!(query = create_query())) return E_OUTOFMEMORY;
hr = parse_query( str, &query->view, &query->mem );
if (hr != S_OK) goto done;
hr = execute_view( query->view );
if (hr != S_OK) goto done;
hr = EnumWbemClassObject_create( NULL, query, (void **)result );
done:
release_query( query );
return hr;
}
static BOOL is_selected_prop( const struct view *view, const WCHAR *name )
{
const struct property *prop = view->proplist;
if (!prop) return TRUE;
while (prop)
{
if (!strcmpiW( prop->name, name )) return TRUE;
prop = prop->next;
}
return FALSE;
}
static BOOL is_system_prop( const WCHAR *name )
{
return (name[0] == '_' && name[1] == '_');
}
static BSTR build_servername( const struct view *view )
{
WCHAR server[MAX_COMPUTERNAME_LENGTH + 1], *p;
DWORD len = sizeof(server)/sizeof(server[0]);
if (view->proplist) return NULL;
if (!(GetComputerNameW( server, &len ))) return NULL;
for (p = server; *p; p++) *p = toupperW( *p );
return SysAllocString( server );
}
static BSTR build_classname( const struct view *view )
{
return SysAllocString( view->table->name );
}
static BSTR build_namespace( const struct view *view )
{
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
if (view->proplist) return NULL;
return SysAllocString( cimv2W );
}
static BSTR build_proplist( const struct view *view, UINT index, UINT count, UINT *len )
{
static const WCHAR fmtW[] = {'%','s','=','%','s',0};
UINT i, j, offset, row = view->result[index];
BSTR *values, ret = NULL;
if (!(values = heap_alloc( count * sizeof(BSTR) ))) return NULL;
*len = j = 0;
for (i = 0; i < view->table->num_cols; i++)
{
if (view->table->columns[i].type & COL_FLAG_KEY)
{
const WCHAR *name = view->table->columns[i].name;
values[j] = get_value_bstr( view->table, row, i );
*len += strlenW( fmtW ) + strlenW( name ) + strlenW( values[j] );
j++;
}
}
if ((ret = SysAllocStringLen( NULL, *len )))
{
offset = j = 0;
for (i = 0; i < view->table->num_cols; i++)
{
if (view->table->columns[i].type & COL_FLAG_KEY)
{
const WCHAR *name = view->table->columns[i].name;
offset += sprintfW( ret + offset, fmtW, name, values[j] );
if (j < count - 1) ret[offset++] = ',';
j++;
}
}
}
for (i = 0; i < count; i++) SysFreeString( values[i] );
heap_free( values );
return ret;
}
static UINT count_key_columns( const struct view *view )
{
UINT i, num_keys = 0;
for (i = 0; i < view->table->num_cols; i++)
{
if (view->table->columns[i].type & COL_FLAG_KEY) num_keys++;
}
return num_keys;
}
static BSTR build_relpath( const struct view *view, UINT index, const WCHAR *name )
{
static const WCHAR fmtW[] = {'%','s','.','%','s',0};
BSTR class, proplist, ret = NULL;
UINT num_keys, len;
if (view->proplist) return NULL;
if (!(class = build_classname( view ))) return NULL;
if (!(num_keys = count_key_columns( view ))) return class;
if (!(proplist = build_proplist( view, index, num_keys, &len ))) goto done;
len += strlenW( fmtW ) + SysStringLen( class );
if (!(ret = SysAllocStringLen( NULL, len ))) goto done;
sprintfW( ret, fmtW, class, proplist );
done:
SysFreeString( class );
SysFreeString( proplist );
return ret;
}
static BSTR build_path( const struct view *view, UINT index, const WCHAR *name )
{
static const WCHAR fmtW[] = {'\\','\\','%','s','\\','%','s',':','%','s',0};
BSTR server, namespace = NULL, relpath = NULL, ret = NULL;
UINT len;
if (view->proplist) return NULL;
if (!(server = build_servername( view ))) return NULL;
if (!(namespace = build_namespace( view ))) goto done;
if (!(relpath = build_relpath( view, index, name ))) goto done;
len = strlenW( fmtW ) + SysStringLen( server ) + SysStringLen( namespace ) + SysStringLen( relpath );
if (!(ret = SysAllocStringLen( NULL, len ))) goto done;
sprintfW( ret, fmtW, server, namespace, relpath );
done:
SysFreeString( server );
SysFreeString( namespace );
SysFreeString( relpath );
return ret;
}
static inline BOOL is_method( const struct table *table, UINT column )
{
return table->columns[column].type & COL_FLAG_METHOD;
}
static UINT count_properties( const struct view *view )
{
UINT i, num_props = 0;
for (i = 0; i < view->table->num_cols; i++)
{
if (!is_method( view->table, i)) num_props++;
}
return num_props;
}
static UINT count_selected_properties( const struct view *view )
{
const struct property *prop = view->proplist;
UINT count;
if (!prop) return count_properties( view );
count = 1;
while ((prop = prop->next)) count++;
return count;
}
static HRESULT get_system_propval( const struct view *view, UINT index, const WCHAR *name,
VARIANT *ret, CIMTYPE *type, LONG *flavor )
{
static const WCHAR classW[] = {'_','_','C','L','A','S','S',0};
static const WCHAR genusW[] = {'_','_','G','E','N','U','S',0};
static const WCHAR pathW[] = {'_','_','P','A','T','H',0};
static const WCHAR namespaceW[] = {'_','_','N','A','M','E','S','P','A','C','E',0};
static const WCHAR propcountW[] = {'_','_','P','R','O','P','E','R','T','Y','_','C','O','U','N','T',0};
static const WCHAR relpathW[] = {'_','_','R','E','L','P','A','T','H',0};
static const WCHAR serverW[] = {'_','_','S','E','R','V','E','R',0};
if (flavor) *flavor = WBEM_FLAVOR_ORIGIN_SYSTEM;
if (!strcmpiW( name, classW ))
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_classname( view );
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, genusW ))
{
V_VT( ret ) = VT_I4;
V_I4( ret ) = WBEM_GENUS_INSTANCE; /* FIXME */
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, namespaceW ))
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_namespace( view );
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, pathW ))
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_path( view, index, name );
if (type) *type = CIM_STRING;
return S_OK;
}
if (!strcmpiW( name, propcountW ))
{
V_VT( ret ) = VT_I4;
V_I4( ret ) = count_selected_properties( view );
if (type) *type = CIM_SINT32;
return S_OK;
}
else if (!strcmpiW( name, relpathW ))
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_relpath( view, index, name );
if (type) *type = CIM_STRING;
return S_OK;
}
else if (!strcmpiW( name, serverW ))
{
V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = build_servername( view );
if (type) *type = CIM_STRING;
return S_OK;
}
FIXME("system property %s not implemented\n", debugstr_w(name));
return WBEM_E_NOT_FOUND;
}
VARTYPE to_vartype( CIMTYPE type )
{
switch (type)
{
case CIM_BOOLEAN: return VT_BOOL;
case CIM_STRING:
case CIM_DATETIME: return VT_BSTR;
case CIM_SINT16: return VT_I2;
case CIM_UINT16: return VT_UI2;
case CIM_SINT32: return VT_I4;
case CIM_UINT32: return VT_UI4;
case CIM_SINT64: return VT_I8;
case CIM_UINT64: return VT_UI8;
default:
ERR("unhandled type %u\n", type);
break;
}
return 0;
}
SAFEARRAY *to_safearray( const struct array *array, CIMTYPE type )
{
SAFEARRAY *ret;
UINT size = get_type_size( type );
VARTYPE vartype = to_vartype( type );
LONG i;
if (!(ret = SafeArrayCreateVector( vartype, 0, array->count ))) return NULL;
for (i = 0; i < array->count; i++)
{
void *ptr = (char *)array->ptr + i * size;
if (vartype == VT_BSTR)
{
BSTR str = SysAllocString( *(const WCHAR **)ptr );
if (!str || SafeArrayPutElement( ret, &i, str ) != S_OK)
{
SysFreeString( str );
SafeArrayDestroy( ret );
return NULL;
}
}
else if (SafeArrayPutElement( ret, &i, ptr ) != S_OK)
{
SafeArrayDestroy( ret );
return NULL;
}
}
return ret;
}
void set_variant( VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret )
{
if (type & VT_ARRAY)
{
V_VT( ret ) = type;
V_ARRAY( ret ) = val_ptr;
return;
}
switch (type)
{
case VT_BOOL:
V_BOOL( ret ) = val;
break;
case VT_BSTR:
V_BSTR( ret ) = val_ptr;
break;
case VT_I2:
V_I2( ret ) = val;
break;
case VT_UI2:
V_UI2( ret ) = val;
break;
case VT_I4:
V_I4( ret ) = val;
break;
case VT_UI4:
V_UI4( ret ) = val;
break;
case VT_NULL:
break;
default:
ERR("unhandled variant type %u\n", type);
return;
}
V_VT( ret ) = type;
}
HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *ret,
CIMTYPE *type, LONG *flavor )
{
HRESULT hr;
UINT column, row;
VARTYPE vartype;
void *val_ptr = NULL;
LONGLONG val;
if (is_system_prop( name )) return get_system_propval( view, index, name, ret, type, flavor );
if (!view->count || !is_selected_prop( view, name )) return WBEM_E_NOT_FOUND;
hr = get_column_index( view->table, name, &column );
if (hr != S_OK || is_method( view->table, column )) return WBEM_E_NOT_FOUND;
row = view->result[index];
hr = get_value( view->table, row, column, &val );
if (hr != S_OK) return hr;
vartype = view->table->columns[column].vartype;
if (view->table->columns[column].type & CIM_FLAG_ARRAY)
{
CIMTYPE basetype = view->table->columns[column].type & CIM_TYPE_MASK;
val_ptr = to_safearray( (const struct array *)(INT_PTR)val, basetype );
if (!vartype) vartype = to_vartype( basetype ) | VT_ARRAY;
goto done;
}
switch (view->table->columns[column].type & COL_TYPE_MASK)
{
case CIM_BOOLEAN:
if (!vartype) vartype = VT_BOOL;
break;
case CIM_STRING:
case CIM_DATETIME:
if (val)
{
vartype = VT_BSTR;
val_ptr = SysAllocString( (const WCHAR *)(INT_PTR)val );
}
else
vartype = VT_NULL;
break;
case CIM_SINT16:
if (!vartype) vartype = VT_I2;
break;
case CIM_UINT16:
if (!vartype) vartype = VT_UI2;
break;
case CIM_SINT32:
if (!vartype) vartype = VT_I4;
break;
case CIM_UINT32:
if (!vartype) vartype = VT_UI4;
break;
case CIM_SINT64:
vartype = VT_BSTR;
val_ptr = get_value_bstr( view->table, row, column );
break;
case CIM_UINT64:
vartype = VT_BSTR;
val_ptr = get_value_bstr( view->table, row, column );
break;
default:
ERR("unhandled column type %u\n", view->table->columns[column].type);
return WBEM_E_FAILED;
}
done:
set_variant( vartype, val, val_ptr, ret );
if (type) *type = view->table->columns[column].type & COL_TYPE_MASK;
if (flavor) *flavor = 0;
return S_OK;
}
static CIMTYPE to_cimtype( VARTYPE type )
{
switch (type)
{
case VT_BOOL: return CIM_BOOLEAN;
case VT_BSTR: return CIM_STRING;
case VT_I2: return CIM_SINT16;
case VT_UI2: return CIM_UINT16;
case VT_I4: return CIM_SINT32;
case VT_UI4: return CIM_UINT32;
case VT_I8: return CIM_SINT64;
case VT_UI8: return CIM_UINT64;
default:
ERR("unhandled type %u\n", type);
break;
}
return 0;
}
static struct array *to_array( VARIANT *var, CIMTYPE *type )
{
struct array *ret;
LONG bound, i;
VARTYPE vartype;
CIMTYPE basetype;
UINT size;
if (SafeArrayGetVartype( V_ARRAY( var ), &vartype ) != S_OK) return NULL;
if (!(basetype = to_cimtype( vartype ))) return NULL;
if (SafeArrayGetUBound( V_ARRAY( var ), 1, &bound ) != S_OK) return NULL;
if (!(ret = heap_alloc( sizeof(struct array) ))) return NULL;
ret->count = bound + 1;
size = get_type_size( basetype );
if (!(ret->ptr = heap_alloc_zero( ret->count * size )))
{
heap_free( ret );
return NULL;
}
for (i = 0; i < ret->count; i++)
{
void *ptr = (char *)ret->ptr + i * size;
if (vartype == VT_BSTR)
{
BSTR str;
if (SafeArrayGetElement( V_ARRAY( var ), &i, &str ) != S_OK)
{
destroy_array( ret, basetype );
return NULL;
}
*(WCHAR **)ptr = heap_strdupW( str );
SysFreeString( str );
if (!*(WCHAR **)ptr)
{
destroy_array( ret, basetype );
return NULL;
}
}
else if (SafeArrayGetElement( V_ARRAY( var ), &i, ptr ) != S_OK)
{
destroy_array( ret, basetype );
return NULL;
}
}
*type = basetype | CIM_FLAG_ARRAY;
return ret;
}
HRESULT to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
{
if (!var)
{
*val = 0;
return S_OK;
}
if (V_VT( var ) & VT_ARRAY)
{
*val = (INT_PTR)to_array( var, type );
if (!*val) return E_OUTOFMEMORY;
return S_OK;
}
switch (V_VT( var ))
{
case VT_BOOL:
*val = V_BOOL( var );
*type = CIM_BOOLEAN;
break;
case VT_BSTR:
*val = (INT_PTR)heap_strdupW( V_BSTR( var ) );
if (!*val) return E_OUTOFMEMORY;
*type = CIM_STRING;
break;
case VT_I2:
*val = V_I2( var );
*type = CIM_SINT16;
break;
case VT_UI2:
*val = V_UI2( var );
*type = CIM_UINT16;
break;
case VT_I4:
*val = V_I4( var );
*type = CIM_SINT32;
break;
case VT_UI4:
*val = V_UI4( var );
*type = CIM_UINT32;
break;
case VT_NULL:
*val = 0;
break;
default:
ERR("unhandled type %u\n", V_VT( var ));
return WBEM_E_FAILED;
}
return S_OK;
}
HRESULT put_propval( const struct view *view, UINT index, const WCHAR *name, VARIANT *var, CIMTYPE type )
{
HRESULT hr;
UINT column, row = view->result[index];
LONGLONG val;
hr = get_column_index( view->table, name, &column );
if (hr != S_OK)
{
FIXME("no support for creating new properties\n");
return WBEM_E_FAILED;
}
if (is_method( view->table, column ) || !(view->table->columns[column].type & COL_FLAG_DYNAMIC))
return WBEM_E_FAILED;
hr = to_longlong( var, &val, &type );
if (hr != S_OK) return hr;
return set_value( view->table, row, column, val, type );
}
HRESULT get_properties( const struct view *view, SAFEARRAY **props )
{
SAFEARRAY *sa;
BSTR str;
LONG i;
UINT num_props = count_properties( view );
if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, num_props ))) return E_OUTOFMEMORY;
for (i = 0; i < view->table->num_cols; i++)
{
if (is_method( view->table, i )) continue;
str = SysAllocString( view->table->columns[i].name );
if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK)
{
SysFreeString( str );
SafeArrayDestroy( sa );
return E_OUTOFMEMORY;
}
}
*props = sa;
return S_OK;
}

View file

@ -0,0 +1,347 @@
/*
* StdRegProv implementation
*
* Copyright 2012 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
static HRESULT to_bstr_array( BSTR *strings, DWORD count, VARIANT *var )
{
SAFEARRAY *sa;
HRESULT hr;
LONG i;
if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, count ))) return E_OUTOFMEMORY;
for (i = 0; i < count; i++)
{
if ((hr = SafeArrayPutElement( sa, &i, strings[i] )) != S_OK)
{
SafeArrayDestroy( sa );
return hr;
}
}
set_variant( VT_BSTR|VT_ARRAY, 0, sa, var );
return S_OK;
}
static HRESULT to_i4_array( DWORD *values, DWORD count, VARIANT *var )
{
SAFEARRAY *sa;
HRESULT hr;
LONG i;
if (!(sa = SafeArrayCreateVector( VT_I4, 0, count ))) return E_OUTOFMEMORY;
for (i = 0; i < count; i++)
{
if ((hr = SafeArrayPutElement( sa, &i, &values[i] )) != S_OK)
{
SafeArrayDestroy( sa );
return hr;
}
}
set_variant( VT_I4|VT_ARRAY, 0, sa, var );
return S_OK;
}
static HRESULT enum_key( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *retval )
{
HKEY hkey;
HRESULT hr = S_OK;
WCHAR buf[256];
BSTR *strings, *tmp;
DWORD count = 2, len = sizeof(buf)/sizeof(buf[0]);
LONG res, i = 0;
TRACE("%p, %s\n", root, debugstr_w(subkey));
if (!(strings = heap_alloc( count * sizeof(BSTR) ))) return E_OUTOFMEMORY;
if ((res = RegOpenKeyExW( root, subkey, 0, KEY_ENUMERATE_SUB_KEYS, &hkey )))
{
set_variant( VT_UI4, res, NULL, retval );
heap_free( strings );
return S_OK;
}
for (;;)
{
if (i >= count)
{
count *= 2;
if (!(tmp = heap_realloc( strings, count * sizeof(BSTR) )))
{
RegCloseKey( hkey );
return E_OUTOFMEMORY;
}
strings = tmp;
}
if ((res = RegEnumKeyW( hkey, i, buf, len )) == ERROR_NO_MORE_ITEMS)
{
if (i) res = ERROR_SUCCESS;
break;
}
if (res) break;
if (!(strings[i] = SysAllocString( buf )))
{
for (i--; i >= 0; i--) SysFreeString( strings[i] );
hr = ERROR_OUTOFMEMORY;
break;
}
i++;
}
if (hr == S_OK && !res) hr = to_bstr_array( strings, i, names );
set_variant( VT_UI4, res, NULL, retval );
RegCloseKey( hkey );
heap_free( strings );
return hr;
}
HRESULT reg_enum_key( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT defkey, subkey, names, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p\n", in, out);
hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_stdregprovW, method_enumkeyW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &subkey );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &subkey );
IWbemClassObject_Release( sig );
return hr;
}
VariantInit( &names );
hr = enum_key( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), &names, &retval );
if (hr != S_OK) goto done;
if (!V_UI4( &retval ))
{
hr = IWbemClassObject_Put( *out, param_namesW, 0, &names, CIM_STRING|CIM_FLAG_ARRAY );
if (hr != S_OK) goto done;
}
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &names );
VariantClear( &subkey );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}
static HRESULT enum_values( HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *types, VARIANT *retval )
{
HKEY hkey = NULL;
HRESULT hr = S_OK;
BSTR *value_names = NULL;
DWORD count, buflen, len, *value_types = NULL;
LONG res, i = 0;
WCHAR *buf = NULL;
TRACE("%p, %s\n", root, debugstr_w(subkey));
if ((res = RegOpenKeyExW( root, subkey, 0, KEY_QUERY_VALUE, &hkey ))) goto done;
if ((res = RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, NULL, &count, &buflen, NULL, NULL, NULL )))
goto done;
hr = E_OUTOFMEMORY;
if (!(buf = heap_alloc( (buflen + 1) * sizeof(WCHAR) ))) goto done;
if (!(value_names = heap_alloc( count * sizeof(BSTR) ))) goto done;
if (!(value_types = heap_alloc( count * sizeof(DWORD) ))) goto done;
hr = S_OK;
for (;;)
{
len = buflen + 1;
res = RegEnumValueW( hkey, i, buf, &len, NULL, &value_types[i], NULL, NULL );
if (res == ERROR_NO_MORE_ITEMS)
{
if (i) res = ERROR_SUCCESS;
break;
}
if (res) break;
if (!(value_names[i] = SysAllocString( buf )))
{
for (i--; i >= 0; i--) SysFreeString( value_names[i] );
hr = ERROR_OUTOFMEMORY;
break;
}
i++;
}
if (hr == S_OK && !res)
{
hr = to_bstr_array( value_names, i, names );
if (hr == S_OK) hr = to_i4_array( value_types, i, types );
}
done:
set_variant( VT_UI4, res, NULL, retval );
RegCloseKey( hkey );
heap_free( value_names );
heap_free( value_types );
heap_free( buf );
return hr;
}
HRESULT reg_enum_values( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT defkey, subkey, names, types, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p\n", in, out);
hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_stdregprovW, method_enumvaluesW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &subkey );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &subkey );
IWbemClassObject_Release( sig );
return hr;
}
VariantInit( &names );
VariantInit( &types );
hr = enum_values( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), &names, &types, &retval );
if (hr != S_OK) goto done;
if (!V_UI4( &retval ))
{
hr = IWbemClassObject_Put( *out, param_namesW, 0, &names, CIM_STRING|CIM_FLAG_ARRAY );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_typesW, 0, &types, CIM_SINT32|CIM_FLAG_ARRAY );
if (hr != S_OK) goto done;
}
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &types );
VariantClear( &names );
VariantClear( &subkey );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}
static HRESULT get_stringvalue( HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, VARIANT *retval )
{
HRESULT hr = S_OK;
WCHAR *buf = NULL;
DWORD size;
LONG res;
TRACE("%p, %s, %s\n", root, debugstr_w(subkey), debugstr_w(name));
if ((res = RegGetValueW( root, subkey, name, RRF_RT_REG_SZ, NULL, NULL, &size ))) goto done;
if (!(buf = heap_alloc( size )))
{
hr = E_OUTOFMEMORY;
goto done;
}
if (!(res = RegGetValueW( root, subkey, name, RRF_RT_REG_SZ, NULL, buf, &size )))
set_variant( VT_BSTR, 0, buf, value );
done:
set_variant( VT_UI4, res, NULL, retval );
heap_free( buf );
return hr;
}
HRESULT reg_get_stringvalue( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT defkey, subkey, name, value, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p\n", in, out);
hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
if (hr != S_OK) return hr;
hr = IWbemClassObject_Get( in, param_valuenameW, 0, &name, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_stdregprovW, method_getstringvalueW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &name );
VariantClear( &subkey );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &name );
VariantClear( &subkey );
IWbemClassObject_Release( sig );
return hr;
}
VariantInit( &value );
hr = get_stringvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), &value, &retval );
if (hr != S_OK) goto done;
if (!V_UI4( &retval ))
{
hr = IWbemClassObject_Put( *out, param_valueW, 0, &value, CIM_STRING );
if (hr != S_OK) goto done;
}
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &name );
VariantClear( &subkey );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}

View file

@ -0,0 +1,248 @@
/*
* Win32_Service methods implementation
*
* Copyright 2012 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "winsvc.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
static UINT map_error( DWORD error )
{
switch (error)
{
case ERROR_SUCCESS: return 0;
case ERROR_ACCESS_DENIED: return 2;
case ERROR_DEPENDENT_SERVICES_RUNNING: return 3;
case ERROR_INVALID_SERVICE_CONTROL: return 4;
case ERROR_SERVICE_CANNOT_ACCEPT_CTRL: return 5;
case ERROR_SERVICE_NOT_ACTIVE: return 6;
case ERROR_SERVICE_REQUEST_TIMEOUT: return 7;
case ERROR_SERVICE_ALREADY_RUNNING: return 10;
default:
WARN("unknown error %u\n", error);
break;
}
return 8;
}
static HRESULT control_service( const WCHAR *name, DWORD control, VARIANT *retval )
{
SC_HANDLE manager, service = NULL;
SERVICE_STATUS status;
UINT error = 0;
if (!(manager = OpenSCManagerW( NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE )))
{
error = map_error( GetLastError() );
goto done;
}
if (!(service = OpenServiceW( manager, name, SERVICE_STOP|SERVICE_START|SERVICE_PAUSE_CONTINUE )))
{
error = map_error( GetLastError() );
goto done;
}
if (!ControlService( service, control, &status )) error = map_error( GetLastError() );
done:
set_variant( VT_UI4, error, NULL, retval );
CloseServiceHandle( service );
CloseServiceHandle( manager );
return S_OK;
}
HRESULT service_pause_service( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT name, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p, %p\n", obj, in, out);
hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_serviceW, method_pauseserviceW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &name );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &name );
IWbemClassObject_Release( sig );
return hr;
}
hr = control_service( V_BSTR(&name), SERVICE_CONTROL_PAUSE, &retval );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &name );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}
HRESULT service_resume_service( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT name, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p, %p\n", obj, in, out);
hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_serviceW, method_resumeserviceW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &name );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &name );
IWbemClassObject_Release( sig );
return hr;
}
hr = control_service( V_BSTR(&name), SERVICE_CONTROL_CONTINUE, &retval );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &name );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}
static HRESULT start_service( const WCHAR *name, VARIANT *retval )
{
SC_HANDLE manager, service = NULL;
UINT error = 0;
if (!(manager = OpenSCManagerW( NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE )))
{
error = map_error( GetLastError() );
goto done;
}
if (!(service = OpenServiceW( manager, name, SERVICE_START )))
{
error = map_error( GetLastError() );
goto done;
}
if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() );
done:
set_variant( VT_UI4, error, NULL, retval );
CloseServiceHandle( service );
CloseServiceHandle( manager );
return S_OK;
}
HRESULT service_start_service( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT name, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p, %p\n", obj, in, out);
hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_serviceW, method_startserviceW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &name );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &name );
IWbemClassObject_Release( sig );
return hr;
}
hr = start_service( V_BSTR(&name), &retval );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &name );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}
HRESULT service_stop_service( IWbemClassObject *obj, IWbemClassObject *in, IWbemClassObject **out )
{
VARIANT name, retval;
IWbemClassObject *sig;
HRESULT hr;
TRACE("%p, %p, %p\n", obj, in, out);
hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
if (hr != S_OK) return hr;
hr = create_signature( class_serviceW, method_stopserviceW, PARAM_OUT, &sig );
if (hr != S_OK)
{
VariantClear( &name );
return hr;
}
hr = IWbemClassObject_SpawnInstance( sig, 0, out );
if (hr != S_OK)
{
VariantClear( &name );
IWbemClassObject_Release( sig );
return hr;
}
hr = control_service( V_BSTR(&name), SERVICE_CONTROL_STOP, &retval );
if (hr != S_OK) goto done;
hr = IWbemClassObject_Put( *out, param_returnvalueW, 0, &retval, CIM_UINT32 );
done:
VariantClear( &name );
IWbemClassObject_Release( sig );
if (hr != S_OK) IWbemClassObject_Release( *out );
return hr;
}

View file

@ -0,0 +1,680 @@
/*
* Copyright 2012 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
struct client_security
{
IClientSecurity IClientSecurity_iface;
};
static inline struct client_security *impl_from_IClientSecurity( IClientSecurity *iface )
{
return CONTAINING_RECORD( iface, struct client_security, IClientSecurity_iface );
}
static HRESULT WINAPI client_security_QueryInterface(
IClientSecurity *iface,
REFIID riid,
void **ppvObject )
{
struct client_security *cs = impl_from_IClientSecurity( iface );
TRACE("%p %s %p\n", cs, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IClientSecurity ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = cs;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IClientSecurity_AddRef( iface );
return S_OK;
}
static ULONG WINAPI client_security_AddRef(
IClientSecurity *iface )
{
FIXME("%p\n", iface);
return 2;
}
static ULONG WINAPI client_security_Release(
IClientSecurity *iface )
{
FIXME("%p\n", iface);
return 1;
}
static HRESULT WINAPI client_security_QueryBlanket(
IClientSecurity *iface,
IUnknown *pProxy,
DWORD *pAuthnSvc,
DWORD *pAuthzSvc,
OLECHAR **pServerPrincName,
DWORD *pAuthnLevel,
DWORD *pImpLevel,
void **pAuthInfo,
DWORD *pCapabilities )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI client_security_SetBlanket(
IClientSecurity *iface,
IUnknown *pProxy,
DWORD AuthnSvc,
DWORD AuthzSvc,
OLECHAR *pServerPrincName,
DWORD AuthnLevel,
DWORD ImpLevel,
void *pAuthInfo,
DWORD Capabilities )
{
static const OLECHAR defaultW[] =
{'<','C','O','L','E','_','D','E','F','A','U','L','T','_','P','R','I','N','C','I','P','A','L','>',0};
const OLECHAR *princname = (pServerPrincName == COLE_DEFAULT_PRINCIPAL) ? defaultW : pServerPrincName;
FIXME("%p, %p, %u, %u, %s, %u, %u, %p, 0x%08x\n", iface, pProxy, AuthnSvc, AuthzSvc,
debugstr_w(princname), AuthnLevel, ImpLevel, pAuthInfo, Capabilities);
return WBEM_NO_ERROR;
}
static HRESULT WINAPI client_security_CopyProxy(
IClientSecurity *iface,
IUnknown *pProxy,
IUnknown **ppCopy )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static const IClientSecurityVtbl client_security_vtbl =
{
client_security_QueryInterface,
client_security_AddRef,
client_security_Release,
client_security_QueryBlanket,
client_security_SetBlanket,
client_security_CopyProxy
};
IClientSecurity client_security = { &client_security_vtbl };
struct wbem_services
{
IWbemServices IWbemServices_iface;
LONG refs;
WCHAR *namespace;
};
static inline struct wbem_services *impl_from_IWbemServices( IWbemServices *iface )
{
return CONTAINING_RECORD( iface, struct wbem_services, IWbemServices_iface );
}
static ULONG WINAPI wbem_services_AddRef(
IWbemServices *iface )
{
struct wbem_services *ws = impl_from_IWbemServices( iface );
return InterlockedIncrement( &ws->refs );
}
static ULONG WINAPI wbem_services_Release(
IWbemServices *iface )
{
struct wbem_services *ws = impl_from_IWbemServices( iface );
LONG refs = InterlockedDecrement( &ws->refs );
if (!refs)
{
TRACE("destroying %p\n", ws);
heap_free( ws->namespace );
heap_free( ws );
}
return refs;
}
static HRESULT WINAPI wbem_services_QueryInterface(
IWbemServices *iface,
REFIID riid,
void **ppvObject )
{
struct wbem_services *ws = impl_from_IWbemServices( iface );
TRACE("%p %s %p\n", ws, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IWbemServices ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = ws;
}
else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
{
*ppvObject = &client_security;
return S_OK;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IWbemServices_AddRef( iface );
return S_OK;
}
static HRESULT WINAPI wbem_services_OpenNamespace(
IWbemServices *iface,
const BSTR strNamespace,
LONG lFlags,
IWbemContext *pCtx,
IWbemServices **ppWorkingNamespace,
IWbemCallResult **ppResult )
{
static const WCHAR cimv2W[] = {'c','i','m','v','2',0};
static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0};
struct wbem_services *ws = impl_from_IWbemServices( iface );
TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strNamespace), lFlags,
pCtx, ppWorkingNamespace, ppResult);
if ((strcmpiW( strNamespace, cimv2W ) && strcmpiW( strNamespace, defaultW )) || ws->namespace)
return WBEM_E_INVALID_NAMESPACE;
return WbemServices_create( NULL, cimv2W, (void **)ppWorkingNamespace );
}
static HRESULT WINAPI wbem_services_CancelAsyncCall(
IWbemServices *iface,
IWbemObjectSink *pSink )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_QueryObjectSink(
IWbemServices *iface,
LONG lFlags,
IWbemObjectSink **ppResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
struct path
{
WCHAR *class;
UINT class_len;
WCHAR *filter;
UINT filter_len;
};
static HRESULT parse_path( const WCHAR *str, struct path **ret )
{
struct path *path;
const WCHAR *p = str, *q;
UINT len;
if (!(path = heap_alloc_zero( sizeof(*path) ))) return E_OUTOFMEMORY;
while (*p && *p != '.') p++;
len = p - str;
if (!(path->class = heap_alloc( (len + 1) * sizeof(WCHAR) )))
{
heap_free( path );
return E_OUTOFMEMORY;
}
memcpy( path->class, str, len * sizeof(WCHAR) );
path->class[len] = 0;
path->class_len = len;
if (p[0] == '.' && p[1])
{
q = ++p;
while (*q) q++;
len = q - p;
if (!(path->filter = heap_alloc( (len + 1) * sizeof(WCHAR) )))
{
heap_free( path->class );
heap_free( path );
return E_OUTOFMEMORY;
}
memcpy( path->filter, p, len * sizeof(WCHAR) );
path->filter[len] = 0;
path->filter_len = len;
}
*ret = path;
return S_OK;
}
static void free_path( struct path *path )
{
heap_free( path->class );
heap_free( path->filter );
heap_free( path );
}
static HRESULT create_instance_enum( const struct path *path, IEnumWbemClassObject **iter )
{
static const WCHAR selectW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','%','s',' ',
'W','H','E','R','E',' ','%','s',0};
static const WCHAR select_allW[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
WCHAR *query;
HRESULT hr;
UINT len;
if (path->filter)
{
len = path->class_len + path->filter_len + SIZEOF(selectW);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
sprintfW( query, selectW, path->class, path->filter );
}
else
{
len = path->class_len + SIZEOF(select_allW);
if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
strcpyW( query, select_allW );
strcatW( query, path->class );
}
hr = exec_query( query, iter );
heap_free( query );
return hr;
}
HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
{
IEnumWbemClassObject *iter;
struct path *path;
HRESULT hr;
hr = parse_path( object_path, &path );
if (hr != S_OK) return hr;
hr = create_instance_enum( path, &iter );
if (hr != S_OK)
{
free_path( path );
return hr;
}
hr = create_class_object( path->class, iter, 0, NULL, obj );
IEnumWbemClassObject_Release( iter );
free_path( path );
return hr;
}
static HRESULT WINAPI wbem_services_GetObject(
IWbemServices *iface,
const BSTR strObjectPath,
LONG lFlags,
IWbemContext *pCtx,
IWbemClassObject **ppObject,
IWbemCallResult **ppCallResult )
{
TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strObjectPath), lFlags,
pCtx, ppObject, ppCallResult);
if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags);
if (!strObjectPath || !strObjectPath[0])
return create_class_object( NULL, NULL, 0, NULL, ppObject );
return get_object( strObjectPath, ppObject );
}
static HRESULT WINAPI wbem_services_GetObjectAsync(
IWbemServices *iface,
const BSTR strObjectPath,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_PutClass(
IWbemServices *iface,
IWbemClassObject *pObject,
LONG lFlags,
IWbemContext *pCtx,
IWbemCallResult **ppCallResult )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_PutClassAsync(
IWbemServices *iface,
IWbemClassObject *pObject,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_DeleteClass(
IWbemServices *iface,
const BSTR strClass,
LONG lFlags,
IWbemContext *pCtx,
IWbemCallResult **ppCallResult )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_DeleteClassAsync(
IWbemServices *iface,
const BSTR strClass,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_CreateClassEnum(
IWbemServices *iface,
const BSTR strSuperclass,
LONG lFlags,
IWbemContext *pCtx,
IEnumWbemClassObject **ppEnum )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_CreateClassEnumAsync(
IWbemServices *iface,
const BSTR strSuperclass,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_PutInstance(
IWbemServices *iface,
IWbemClassObject *pInst,
LONG lFlags,
IWbemContext *pCtx,
IWbemCallResult **ppCallResult )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_PutInstanceAsync(
IWbemServices *iface,
IWbemClassObject *pInst,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_DeleteInstance(
IWbemServices *iface,
const BSTR strObjectPath,
LONG lFlags,
IWbemContext *pCtx,
IWbemCallResult **ppCallResult )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_DeleteInstanceAsync(
IWbemServices *iface,
const BSTR strObjectPath,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_CreateInstanceEnum(
IWbemServices *iface,
const BSTR strClass,
LONG lFlags,
IWbemContext *pCtx,
IEnumWbemClassObject **ppEnum )
{
struct path *path;
HRESULT hr;
TRACE("%p, %s, 0%08x, %p, %p\n", iface, debugstr_w(strClass), lFlags, pCtx, ppEnum);
if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags);
hr = parse_path( strClass, &path );
if (hr != S_OK) return hr;
hr = create_instance_enum( path, ppEnum );
free_path( path );
return hr;
}
static HRESULT WINAPI wbem_services_CreateInstanceEnumAsync(
IWbemServices *iface,
const BSTR strFilter,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_ExecQuery(
IWbemServices *iface,
const BSTR strQueryLanguage,
const BSTR strQuery,
LONG lFlags,
IWbemContext *pCtx,
IEnumWbemClassObject **ppEnum )
{
static const WCHAR wqlW[] = {'W','Q','L',0};
TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage),
debugstr_w(strQuery), lFlags, pCtx, ppEnum);
if (!strQueryLanguage || !strQuery || !strQuery[0]) return WBEM_E_INVALID_PARAMETER;
if (strcmpiW( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE;
return exec_query( strQuery, ppEnum );
}
static HRESULT WINAPI wbem_services_ExecQueryAsync(
IWbemServices *iface,
const BSTR strQueryLanguage,
const BSTR strQuery,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_ExecNotificationQuery(
IWbemServices *iface,
const BSTR strQueryLanguage,
const BSTR strQuery,
LONG lFlags,
IWbemContext *pCtx,
IEnumWbemClassObject **ppEnum )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(
IWbemServices *iface,
const BSTR strQueryLanguage,
const BSTR strQuery,
LONG lFlags,
IWbemContext *pCtx,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static HRESULT WINAPI wbem_services_ExecMethod(
IWbemServices *iface,
const BSTR strObjectPath,
const BSTR strMethodName,
LONG lFlags,
IWbemContext *pCtx,
IWbemClassObject *pInParams,
IWbemClassObject **ppOutParams,
IWbemCallResult **ppCallResult )
{
IWbemClassObject *obj;
struct table *table;
class_method *func;
struct path *path;
HRESULT hr;
TRACE("%p, %s, %s, %08x, %p, %p, %p, %p\n", iface, debugstr_w(strObjectPath),
debugstr_w(strMethodName), lFlags, pCtx, pInParams, ppOutParams, ppCallResult);
if (lFlags) FIXME("flags %08x not supported\n", lFlags);
if ((hr = get_object( strObjectPath, &obj ))) return hr;
if ((hr = parse_path( strObjectPath, &path )) != S_OK)
{
IWbemClassObject_Release( obj );
return hr;
}
table = grab_table( path->class );
free_path( path );
if (!table)
{
IWbemClassObject_Release( obj );
return WBEM_E_NOT_FOUND;
}
hr = get_method( table, strMethodName, &func );
release_table( table );
if (hr != S_OK)
{
IWbemClassObject_Release( obj );
return hr;
}
hr = func( obj, pInParams, ppOutParams );
IWbemClassObject_Release( obj );
return hr;
}
static HRESULT WINAPI wbem_services_ExecMethodAsync(
IWbemServices *iface,
const BSTR strObjectPath,
const BSTR strMethodName,
LONG lFlags,
IWbemContext *pCtx,
IWbemClassObject *pInParams,
IWbemObjectSink *pResponseHandler )
{
FIXME("\n");
return WBEM_E_FAILED;
}
static const IWbemServicesVtbl wbem_services_vtbl =
{
wbem_services_QueryInterface,
wbem_services_AddRef,
wbem_services_Release,
wbem_services_OpenNamespace,
wbem_services_CancelAsyncCall,
wbem_services_QueryObjectSink,
wbem_services_GetObject,
wbem_services_GetObjectAsync,
wbem_services_PutClass,
wbem_services_PutClassAsync,
wbem_services_DeleteClass,
wbem_services_DeleteClassAsync,
wbem_services_CreateClassEnum,
wbem_services_CreateClassEnumAsync,
wbem_services_PutInstance,
wbem_services_PutInstanceAsync,
wbem_services_DeleteInstance,
wbem_services_DeleteInstanceAsync,
wbem_services_CreateInstanceEnum,
wbem_services_CreateInstanceEnumAsync,
wbem_services_ExecQuery,
wbem_services_ExecQueryAsync,
wbem_services_ExecNotificationQuery,
wbem_services_ExecNotificationQueryAsync,
wbem_services_ExecMethod,
wbem_services_ExecMethodAsync
};
HRESULT WbemServices_create( IUnknown *pUnkOuter, const WCHAR *namespace, LPVOID *ppObj )
{
struct wbem_services *ws;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
ws = heap_alloc( sizeof(*ws) );
if (!ws) return E_OUTOFMEMORY;
ws->IWbemServices_iface.lpVtbl = &wbem_services_vtbl;
ws->refs = 1;
ws->namespace = heap_strdupW( namespace );
*ppObj = &ws->IWbemServices_iface;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,437 @@
/*
* Copyright 2012 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
HRESULT get_column_index( const struct table *table, const WCHAR *name, UINT *column )
{
UINT i;
for (i = 0; i < table->num_cols; i++)
{
if (!strcmpiW( table->columns[i].name, name ))
{
*column = i;
return S_OK;
}
}
return WBEM_E_INVALID_QUERY;
}
UINT get_type_size( CIMTYPE type )
{
if (type & CIM_FLAG_ARRAY) return sizeof(void *);
switch (type)
{
case CIM_BOOLEAN:
return sizeof(int);
case CIM_SINT16:
case CIM_UINT16:
return sizeof(INT16);
case CIM_SINT32:
case CIM_UINT32:
return sizeof(INT32);
case CIM_SINT64:
case CIM_UINT64:
return sizeof(INT64);
case CIM_DATETIME:
case CIM_STRING:
return sizeof(WCHAR *);
default:
ERR("unhandled type %u\n", type);
break;
}
return sizeof(LONGLONG);
}
static UINT get_column_size( const struct table *table, UINT column )
{
return get_type_size( table->columns[column].type & COL_TYPE_MASK );
}
static UINT get_column_offset( const struct table *table, UINT column )
{
UINT i, offset = 0;
for (i = 0; i < column; i++) offset += get_column_size( table, i );
return offset;
}
static UINT get_row_size( const struct table *table )
{
return get_column_offset( table, table->num_cols - 1 ) + get_column_size( table, table->num_cols - 1 );
}
HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *val )
{
UINT col_offset, row_size;
const BYTE *ptr;
col_offset = get_column_offset( table, column );
row_size = get_row_size( table );
ptr = table->data + row * row_size + col_offset;
if (table->columns[column].type & CIM_FLAG_ARRAY)
{
*val = (INT_PTR)*(const void **)ptr;
return S_OK;
}
switch (table->columns[column].type & COL_TYPE_MASK)
{
case CIM_BOOLEAN:
*val = *(const int *)ptr;
break;
case CIM_DATETIME:
case CIM_STRING:
*val = (INT_PTR)*(const WCHAR **)ptr;
break;
case CIM_SINT16:
*val = *(const INT16 *)ptr;
break;
case CIM_UINT16:
*val = *(const UINT16 *)ptr;
break;
case CIM_SINT32:
*val = *(const INT32 *)ptr;
break;
case CIM_UINT32:
*val = *(const UINT32 *)ptr;
break;
case CIM_SINT64:
*val = *(const INT64 *)ptr;
break;
case CIM_UINT64:
*val = *(const UINT64 *)ptr;
break;
default:
ERR("invalid column type %u\n", table->columns[column].type & COL_TYPE_MASK);
*val = 0;
break;
}
return S_OK;
}
BSTR get_value_bstr( const struct table *table, UINT row, UINT column )
{
static const WCHAR fmt_signedW[] = {'%','d',0};
static const WCHAR fmt_unsignedW[] = {'%','u',0};
static const WCHAR fmt_signed64W[] = {'%','I','6','4','d',0};
static const WCHAR fmt_unsigned64W[] = {'%','I','6','4','u',0};
static const WCHAR fmt_strW[] = {'\"','%','s','\"',0};
static const WCHAR trueW[] = {'T','R','U','E',0};
static const WCHAR falseW[] = {'F','A','L','S','E',0};
LONGLONG val;
BSTR ret;
WCHAR number[22];
UINT len;
if (table->columns[column].type & CIM_FLAG_ARRAY)
{
FIXME("array to string conversion not handled\n");
return NULL;
}
if (get_value( table, row, column, &val ) != S_OK) return NULL;
switch (table->columns[column].type & COL_TYPE_MASK)
{
case CIM_BOOLEAN:
if (val) return SysAllocString( trueW );
else return SysAllocString( falseW );
case CIM_DATETIME:
case CIM_STRING:
if (!val) return NULL;
len = strlenW( (const WCHAR *)(INT_PTR)val ) + 2;
if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
sprintfW( ret, fmt_strW, (const WCHAR *)(INT_PTR)val );
return ret;
case CIM_SINT16:
case CIM_SINT32:
sprintfW( number, fmt_signedW, val );
return SysAllocString( number );
case CIM_UINT16:
case CIM_UINT32:
sprintfW( number, fmt_unsignedW, val );
return SysAllocString( number );
case CIM_SINT64:
wsprintfW( number, fmt_signed64W, val );
return SysAllocString( number );
case CIM_UINT64:
wsprintfW( number, fmt_unsigned64W, val );
return SysAllocString( number );
default:
FIXME("unhandled column type %u\n", table->columns[column].type & COL_TYPE_MASK);
break;
}
return NULL;
}
HRESULT set_value( const struct table *table, UINT row, UINT column, LONGLONG val,
CIMTYPE type )
{
UINT col_offset, row_size;
BYTE *ptr;
if ((table->columns[column].type & COL_TYPE_MASK) != type) return WBEM_E_TYPE_MISMATCH;
col_offset = get_column_offset( table, column );
row_size = get_row_size( table );
ptr = table->data + row * row_size + col_offset;
switch (table->columns[column].type & COL_TYPE_MASK)
{
case CIM_DATETIME:
case CIM_STRING:
*(WCHAR **)ptr = (WCHAR *)(INT_PTR)val;
break;
case CIM_SINT16:
*(INT16 *)ptr = val;
break;
case CIM_UINT16:
*(UINT16 *)ptr = val;
break;
case CIM_SINT32:
*(INT32 *)ptr = val;
break;
case CIM_UINT32:
*(UINT32 *)ptr = val;
break;
case CIM_SINT64:
*(INT64 *)ptr = val;
break;
case CIM_UINT64:
*(UINT64 *)ptr = val;
break;
default:
FIXME("unhandled column type %u\n", type);
return WBEM_E_FAILED;
}
return S_OK;
}
HRESULT get_method( const struct table *table, const WCHAR *name, class_method **func )
{
UINT i, j;
for (i = 0; i < table->num_rows; i++)
{
for (j = 0; j < table->num_cols; j++)
{
if (table->columns[j].type & COL_FLAG_METHOD && !strcmpW( table->columns[j].name, name ))
{
HRESULT hr;
LONGLONG val;
if ((hr = get_value( table, i, j, &val )) != S_OK) return hr;
*func = (class_method *)(INT_PTR)val;
return S_OK;
}
}
}
return WBEM_E_INVALID_METHOD;
}
static void clear_table( struct table *table )
{
UINT i, j, type;
LONGLONG val;
if (!table->data) return;
for (i = 0; i < table->num_rows; i++)
{
for (j = 0; j < table->num_cols; j++)
{
if (!(table->columns[j].type & COL_FLAG_DYNAMIC)) continue;
type = table->columns[j].type & COL_TYPE_MASK;
if (type == CIM_STRING || type == CIM_DATETIME || (type & CIM_FLAG_ARRAY))
{
if (get_value( table, i, j, &val ) == S_OK) heap_free( (void *)(INT_PTR)val );
}
}
}
if (table->fill)
{
table->num_rows = 0;
heap_free( table->data );
table->data = NULL;
}
}
void free_columns( struct column *columns, UINT num_cols )
{
UINT i;
for (i = 0; i < num_cols; i++)
{
heap_free( (WCHAR *)columns[i].name );
}
heap_free( columns );
}
void free_table( struct table *table )
{
if (!table) return;
clear_table( table );
if (table->flags & TABLE_FLAG_DYNAMIC)
{
TRACE("destroying %p\n", table);
heap_free( (WCHAR *)table->name );
free_columns( (struct column *)table->columns, table->num_cols );
list_remove( &table->entry );
heap_free( table );
}
}
void release_table( struct table *table )
{
if (!InterlockedDecrement( &table->refs )) free_table( table );
}
struct table *addref_table( struct table *table )
{
InterlockedIncrement( &table->refs );
return table;
}
struct table *grab_table( const WCHAR *name )
{
struct table *table;
LIST_FOR_EACH_ENTRY( table, table_list, struct table, entry )
{
if (!strcmpiW( table->name, name ))
{
if (table->fill && !table->data) table->fill( table );
TRACE("returning %p\n", table);
return addref_table( table );
}
}
return NULL;
}
struct table *create_table( const WCHAR *name, UINT num_cols, const struct column *columns,
UINT num_rows, BYTE *data, void (*fill)(struct table *) )
{
struct table *table;
if (!(table = heap_alloc( sizeof(*table) ))) return NULL;
table->name = heap_strdupW( name );
table->num_cols = num_cols;
table->columns = columns;
table->num_rows = num_rows;
table->data = data;
table->fill = fill;
table->flags = TABLE_FLAG_DYNAMIC;
table->refs = 0;
list_init( &table->entry );
return table;
}
BOOL add_table( struct table *table )
{
struct table *iter;
LIST_FOR_EACH_ENTRY( iter, table_list, struct table, entry )
{
if (!strcmpiW( iter->name, table->name ))
{
TRACE("table %s already exists\n", debugstr_w(table->name));
return FALSE;
}
}
list_add_tail( table_list, &table->entry );
TRACE("added %p\n", table);
return TRUE;
}
BSTR get_method_name( const WCHAR *class, UINT index )
{
struct table *table;
UINT i, count = 0;
BSTR ret;
if (!(table = grab_table( class ))) return NULL;
for (i = 0; i < table->num_cols; i++)
{
if (table->columns[i].type & COL_FLAG_METHOD)
{
if (index == count)
{
ret = SysAllocString( table->columns[i].name );
release_table( table );
return ret;
}
count++;
}
}
release_table( table );
return NULL;
}
BSTR get_property_name( const WCHAR *class, UINT index )
{
struct table *table;
UINT i, count = 0;
BSTR ret;
if (!(table = grab_table( class ))) return NULL;
for (i = 0; i < table->num_cols; i++)
{
if (!(table->columns[i].type & COL_FLAG_METHOD))
{
if (index == count)
{
ret = SysAllocString( table->columns[i].name );
release_table( table );
return ret;
}
count++;
}
}
release_table( table );
return NULL;
}

View file

@ -0,0 +1,231 @@
/*
* 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 WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oleauto.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wbemprox_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
typedef struct
{
IWbemLocator IWbemLocator_iface;
LONG refs;
} wbem_locator;
static inline wbem_locator *impl_from_IWbemLocator( IWbemLocator *iface )
{
return CONTAINING_RECORD(iface, wbem_locator, IWbemLocator_iface);
}
static ULONG WINAPI wbem_locator_AddRef(
IWbemLocator *iface )
{
wbem_locator *wl = impl_from_IWbemLocator( iface );
return InterlockedIncrement( &wl->refs );
}
static ULONG WINAPI wbem_locator_Release(
IWbemLocator *iface )
{
wbem_locator *wl = impl_from_IWbemLocator( iface );
LONG refs = InterlockedDecrement( &wl->refs );
if (!refs)
{
TRACE("destroying %p\n", wl);
heap_free( wl );
}
return refs;
}
static HRESULT WINAPI wbem_locator_QueryInterface(
IWbemLocator *iface,
REFIID riid,
void **ppvObject )
{
wbem_locator *This = impl_from_IWbemLocator( iface );
TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppvObject );
if ( IsEqualGUID( riid, &IID_IWbemLocator ) ||
IsEqualGUID( riid, &IID_IUnknown ) )
{
*ppvObject = iface;
}
else
{
FIXME("interface %s not implemented\n", debugstr_guid(riid));
return E_NOINTERFACE;
}
IWbemLocator_AddRef( iface );
return S_OK;
}
static BOOL is_local_machine( const WCHAR *server )
{
static const WCHAR dotW[] = {'.',0};
WCHAR buffer[MAX_COMPUTERNAME_LENGTH + 1];
DWORD len = sizeof(buffer) / sizeof(buffer[0]);
if (!server || !strcmpW( server, dotW )) return TRUE;
if (GetComputerNameW( buffer, &len ) && !strcmpiW( server, buffer )) return TRUE;
return FALSE;
}
static HRESULT parse_resource( const WCHAR *resource, WCHAR **server, WCHAR **namespace )
{
static const WCHAR rootW[] = {'R','O','O','T'};
static const WCHAR cimv2W[] = {'C','I','M','V','2'};
HRESULT hr = WBEM_E_INVALID_NAMESPACE;
const WCHAR *p, *q;
unsigned int len;
*server = NULL;
*namespace = NULL;
p = q = resource;
if (*p == '\\' || *p == '/')
{
p++;
if (*p == '\\' || *p == '/') p++;
if (!*p) return WBEM_E_INVALID_NAMESPACE;
if (*p == '\\' || *p == '/') return WBEM_E_INVALID_PARAMETER;
q = p + 1;
while (*q && *q != '\\' && *q != '/') q++;
if (!*q) return WBEM_E_INVALID_NAMESPACE;
len = q - p;
if (!(*server = heap_alloc( (len + 1) * sizeof(WCHAR) )))
{
hr = E_OUTOFMEMORY;
goto done;
}
memcpy( *server, p, len * sizeof(WCHAR) );
(*server)[len] = 0;
q++;
}
if (!*q) goto done;
p = q;
while (*q && *q != '\\' && *q != '/') q++;
len = q - p;
if (len >= sizeof(rootW) / sizeof(rootW[0]) && memicmpW( rootW, p, len )) goto done;
if (!*q)
{
hr = S_OK;
goto done;
}
q++;
if ((len = strlenW( q )) != sizeof(cimv2W) / sizeof(cimv2W[0]) || memicmpW( q, cimv2W, len ))
goto done;
if (!(*namespace = heap_alloc( (len + 1) * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
{
memcpy( *namespace, p, len * sizeof(WCHAR) );
(*namespace)[len] = 0;
hr = S_OK;
}
done:
if (hr != S_OK)
{
heap_free( *server );
heap_free( *namespace );
}
return hr;
}
static HRESULT WINAPI wbem_locator_ConnectServer(
IWbemLocator *iface,
const BSTR NetworkResource,
const BSTR User,
const BSTR Password,
const BSTR Locale,
LONG SecurityFlags,
const BSTR Authority,
IWbemContext *pCtx,
IWbemServices **ppNamespace)
{
HRESULT hr;
WCHAR *server, *namespace;
TRACE("%p, %s, %s, %s, %s, 0x%08x, %s, %p, %p)\n", iface, debugstr_w(NetworkResource), debugstr_w(User),
debugstr_w(Password), debugstr_w(Locale), SecurityFlags, debugstr_w(Authority), pCtx, ppNamespace);
hr = parse_resource( NetworkResource, &server, &namespace );
if (hr != S_OK) return hr;
if (!is_local_machine( server ))
{
FIXME("remote computer not supported\n");
heap_free( server );
heap_free( namespace );
return WBEM_E_TRANSPORT_FAILURE;
}
if (User || Password || Authority)
FIXME("authentication not supported\n");
if (Locale)
FIXME("specific locale not supported\n");
if (SecurityFlags)
FIXME("unsupported flags\n");
hr = WbemServices_create( NULL, namespace, (void **)ppNamespace );
heap_free( namespace );
if (SUCCEEDED( hr ))
return WBEM_NO_ERROR;
return WBEM_E_FAILED;
}
static const IWbemLocatorVtbl wbem_locator_vtbl =
{
wbem_locator_QueryInterface,
wbem_locator_AddRef,
wbem_locator_Release,
wbem_locator_ConnectServer
};
HRESULT WbemLocator_create( IUnknown *pUnkOuter, LPVOID *ppObj )
{
wbem_locator *wl;
TRACE("(%p,%p)\n", pUnkOuter, ppObj);
wl = heap_alloc( sizeof(*wl) );
if (!wl) return E_OUTOFMEMORY;
wl->IWbemLocator_iface.lpVtbl = &wbem_locator_vtbl;
wl->refs = 1;
*ppObj = &wl->IWbemLocator_iface;
TRACE("returning iface %p\n", *ppObj);
return S_OK;
}

View file

@ -0,0 +1,33 @@
/*
* COM Classes for wbemprox
*
* Copyright 2010 Alexandre Julliard
*
* 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
*/
[
helpstring("WBEM Locator"),
threading(both),
uuid(4590f811-1d3a-11d0-891f-00aa004b2e24)
]
coclass WbemLocator { interface IWbemLocator; }
[
helpstring("WBEM Administrative Locator"),
threading(both),
uuid(cb8555cc-9128-11d1-ad9b-00c04fd8fdff)
]
coclass WbemAdministrativeLocator { interface IWbemLocator; }

View file

@ -0,0 +1 @@
1 WINE_REGISTRY wbemprox.rgs

View file

@ -0,0 +1,17 @@
HKCR
{
NoRemove Interface
{
}
NoRemove CLSID
{
'{4590F811-1D3A-11D0-891F-00AA004B2E24}' = s 'WBEM Locator'
{
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
'{CB8555CC-9128-11D1-AD9B-00C04FD8FDFF}' = s 'WBEM Administrative Locator'
{
InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' }
}
}
}

View file

@ -0,0 +1,4 @@
@ stdcall -private DllCanUnloadNow()
@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stdcall -private DllRegisterServer()
@ stdcall -private DllUnregisterServer()

View file

@ -0,0 +1,297 @@
/*
* 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
*/
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/unicode.h"
IClientSecurity client_security;
struct list *table_list;
#define SIZEOF(array) (sizeof(array)/sizeof((array)[0]))
enum param_direction
{
PARAM_OUT = -1,
PARAM_INOUT = 0,
PARAM_IN = 1
};
#define CIM_TYPE_MASK 0x00000fff
#define COL_TYPE_MASK 0x0000ffff
#define COL_FLAG_DYNAMIC 0x00010000
#define COL_FLAG_KEY 0x00020000
#define COL_FLAG_METHOD 0x00040000
typedef HRESULT (class_method)(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **);
struct column
{
const WCHAR *name;
UINT type;
VARTYPE vartype; /* 0 for default mapping */
};
#define TABLE_FLAG_DYNAMIC 0x00000001
struct table
{
const WCHAR *name;
UINT num_cols;
const struct column *columns;
UINT num_rows;
BYTE *data;
void (*fill)(struct table *);
UINT flags;
struct list entry;
LONG refs;
};
struct property
{
const WCHAR *name;
const WCHAR *class;
const struct property *next;
};
struct array
{
UINT count;
void *ptr;
};
struct field
{
UINT type;
VARTYPE vartype; /* 0 for default mapping */
union
{
LONGLONG ival;
WCHAR *sval;
struct array *aval;
} u;
};
struct record
{
UINT count;
struct field *fields;
struct table *table;
};
enum operator
{
OP_EQ = 1,
OP_AND = 2,
OP_OR = 3,
OP_GT = 4,
OP_LT = 5,
OP_LE = 6,
OP_GE = 7,
OP_NE = 8,
OP_ISNULL = 9,
OP_NOTNULL = 10,
OP_LIKE = 11
};
struct expr;
struct complex_expr
{
enum operator op;
struct expr *left;
struct expr *right;
};
enum expr_type
{
EXPR_COMPLEX = 1,
EXPR_UNARY = 2,
EXPR_PROPVAL = 3,
EXPR_SVAL = 4,
EXPR_IVAL = 5,
EXPR_BVAL = 6
};
struct expr
{
enum expr_type type;
union
{
struct complex_expr expr;
const struct property *propval;
const WCHAR *sval;
int ival;
} u;
};
struct view
{
const struct property *proplist;
struct table *table;
const struct expr *cond;
UINT *result;
UINT count;
};
struct query
{
LONG refs;
struct view *view;
struct list mem;
};
struct query *addref_query( struct query * ) DECLSPEC_HIDDEN;
void release_query( struct query *query ) DECLSPEC_HIDDEN;
HRESULT exec_query( const WCHAR *, IEnumWbemClassObject ** ) DECLSPEC_HIDDEN;
HRESULT parse_query( const WCHAR *, struct view **, struct list * ) DECLSPEC_HIDDEN;
HRESULT create_view( const struct property *, const WCHAR *, const struct expr *,
struct view ** ) DECLSPEC_HIDDEN;
void destroy_view( struct view * ) DECLSPEC_HIDDEN;
void init_table_list( void ) DECLSPEC_HIDDEN;
struct table *grab_table( const WCHAR * ) DECLSPEC_HIDDEN;
struct table *addref_table( struct table * ) DECLSPEC_HIDDEN;
void release_table( struct table * ) DECLSPEC_HIDDEN;
struct table *create_table( const WCHAR *, UINT, const struct column *, UINT,
BYTE *, void (*)(struct table *)) DECLSPEC_HIDDEN;
BOOL add_table( struct table * ) DECLSPEC_HIDDEN;
void free_columns( struct column *, UINT ) DECLSPEC_HIDDEN;
void free_table( struct table * ) DECLSPEC_HIDDEN;
UINT get_type_size( CIMTYPE ) DECLSPEC_HIDDEN;
HRESULT get_column_index( const struct table *, const WCHAR *, UINT * ) DECLSPEC_HIDDEN;
HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN;
BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN;
HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN;
HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN;
HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *,
CIMTYPE *, LONG * ) DECLSPEC_HIDDEN;
HRESULT put_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE ) DECLSPEC_HIDDEN;
HRESULT to_longlong( VARIANT *, LONGLONG *, CIMTYPE * ) DECLSPEC_HIDDEN;
SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN;
void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN;
HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN;
HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN;
BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN;
void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN;
HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction,
IWbemClassObject ** ) DECLSPEC_HIDDEN;
HRESULT WbemLocator_create(IUnknown *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemServices_create(IUnknown *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT create_class_object(const WCHAR *, IEnumWbemClassObject *, UINT,
struct record *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT EnumWbemClassObject_create(IUnknown *, struct query *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT WbemQualifierSet_create(IUnknown *, const WCHAR *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN;
HRESULT process_get_owner(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT reg_enum_key(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT reg_enum_values(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT reg_get_stringvalue(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT service_pause_service(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT service_resume_service(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT service_start_service(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN;
HRESULT service_stop_service(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) 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 void *heap_realloc( void *mem, size_t len ) __WINE_ALLOC_SIZE(2);
static inline void *heap_realloc( void *mem, size_t len )
{
return HeapReAlloc( GetProcessHeap(), 0, mem, len );
}
static void *heap_alloc_zero( size_t len ) __WINE_ALLOC_SIZE(1);
static inline void *heap_alloc_zero( size_t len )
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
}
static inline BOOL heap_free( void *mem )
{
return HeapFree( GetProcessHeap(), 0, mem );
}
static inline WCHAR *heap_strdupW( const WCHAR *src )
{
WCHAR *dst;
if (!src) return NULL;
if ((dst = heap_alloc( (strlenW( src ) + 1) * sizeof(WCHAR) ))) strcpyW( dst, src );
return dst;
}
static inline const char *debugstr_variant( const VARIANT *v )
{
if (!v) return "(null)";
switch (V_VT(v))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf( "{VT_I4: %d}", V_I4(v) );
case VT_R8:
return wine_dbg_sprintf( "{VT_R8: %lf}", V_R8(v) );
case VT_BSTR:
return wine_dbg_sprintf( "{VT_BSTR: %s}", debugstr_w(V_BSTR(v)) );
case VT_DISPATCH:
return wine_dbg_sprintf( "{VT_DISPATCH: %p}", V_DISPATCH(v) );
case VT_BOOL:
return wine_dbg_sprintf( "{VT_BOOL: %x}", V_BOOL(v) );
case VT_UNKNOWN:
return wine_dbg_sprintf( "{VT_UNKNOWN: %p}", V_UNKNOWN(v) );
case VT_UINT:
return wine_dbg_sprintf( "{VT_UINT: %u}", V_UINT(v) );
case VT_BSTR|VT_BYREF:
return wine_dbg_sprintf( "{VT_BSTR|VT_BYREF: ptr %p, data %s}",
V_BSTRREF(v), V_BSTRREF(v) ? debugstr_w( *V_BSTRREF(v) ) : NULL );
default:
return wine_dbg_sprintf( "{vt %d}", V_VT(v) );
}
}
static const WCHAR class_processW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0};
static const WCHAR class_serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e',0};
static const WCHAR class_stdregprovW[] = {'S','t','d','R','e','g','P','r','o','v',0};
static const WCHAR prop_nameW[] = {'N','a','m','e',0};
static const WCHAR method_enumkeyW[] = {'E','n','u','m','K','e','y',0};
static const WCHAR method_enumvaluesW[] = {'E','n','u','m','V','a','l','u','e','s',0};
static const WCHAR method_getownerW[] = {'G','e','t','O','w','n','e','r',0};
static const WCHAR method_getstringvalueW[] = {'G','e','t','S','t','r','i','n','g','V','a','l','u','e',0};
static const WCHAR method_pauseserviceW[] = {'P','a','u','s','e','S','e','r','v','i','c','e',0};
static const WCHAR method_resumeserviceW[] = {'R','e','s','u','m','e','S','e','r','v','i','c','e',0};
static const WCHAR method_startserviceW[] = {'S','t','a','r','t','S','e','r','v','i','c','e',0};
static const WCHAR method_stopserviceW[] = {'S','t','o','p','S','e','r','v','i','c','e',0};
static const WCHAR param_defkeyW[] = {'h','D','e','f','K','e','y',0};
static const WCHAR param_domainW[] = {'D','o','m','a','i','n',0};
static const WCHAR param_namesW[] = {'s','N','a','m','e','s',0};
static const WCHAR param_returnvalueW[] = {'R','e','t','u','r','n','V','a','l','u','e',0};
static const WCHAR param_subkeynameW[] = {'s','S','u','b','K','e','y','N','a','m','e',0};
static const WCHAR param_typesW[] = {'T','y','p','e','s',0};
static const WCHAR param_userW[] = {'U','s','e','r',0};
static const WCHAR param_valueW[] = {'s','V','a','l','u','e',0};
static const WCHAR param_valuenameW[] = {'s','V','a','l','u','e','N','a','m','e',0};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,698 @@
%{
/*
* Copyright 2012 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
*/
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wbemcli.h"
#include "wbemprox_private.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#define YYLEX_PARAM ctx
#define YYPARSE_PARAM ctx
#define YYERROR_DEBUG 1
#define YYERROR_VERBOSE 1
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
struct parser
{
const WCHAR *cmd;
UINT idx;
UINT len;
HRESULT error;
struct view **view;
struct list *mem;
};
struct string
{
const WCHAR *data;
int len;
};
static void *alloc_mem( struct parser *parser, UINT size )
{
struct list *mem = heap_alloc( sizeof(struct list) + size );
list_add_tail( parser->mem, mem );
return &mem[1];
}
static struct property *alloc_property( struct parser *parser, const WCHAR *class, const WCHAR *name )
{
struct property *prop = alloc_mem( parser, sizeof(*prop) );
if (prop)
{
prop->name = name;
prop->class = class;
prop->next = NULL;
}
return prop;
}
static WCHAR *get_string( struct parser *parser, const struct string *str )
{
const WCHAR *p = str->data;
int len = str->len;
WCHAR *ret;
if ((p[0] == '\"' && p[len - 1] != '\"') ||
(p[0] == '\'' && p[len - 1] != '\'')) return NULL;
if ((p[0] == '\"' && p[len - 1] == '\"') ||
(p[0] == '\'' && p[len - 1] == '\''))
{
p++;
len -= 2;
}
if (!(ret = alloc_mem( parser, (len + 1) * sizeof(WCHAR) ))) return NULL;
memcpy( ret, p, len * sizeof(WCHAR) );
ret[len] = 0;
return ret;
}
static int get_int( struct parser *parser )
{
const WCHAR *p = &parser->cmd[parser->idx];
int i, ret = 0;
for (i = 0; i < parser->len; i++)
{
if (p[i] < '0' || p[i] > '9')
{
ERR("should only be numbers here!\n");
break;
}
ret = (p[i] - '0') + ret * 10;
}
return ret;
}
static struct expr *expr_complex( struct parser *parser, struct expr *l, UINT op, struct expr *r )
{
struct expr *e = alloc_mem( parser, sizeof(*e) );
if (e)
{
e->type = EXPR_COMPLEX;
e->u.expr.left = l;
e->u.expr.op = op;
e->u.expr.right = r;
}
return e;
}
static struct expr *expr_unary( struct parser *parser, struct expr *l, UINT op )
{
struct expr *e = alloc_mem( parser, sizeof(*e) );
if (e)
{
e->type = EXPR_UNARY;
e->u.expr.left = l;
e->u.expr.op = op;
e->u.expr.right = NULL;
}
return e;
}
static struct expr *expr_ival( struct parser *parser, int val )
{
struct expr *e = alloc_mem( parser, sizeof *e );
if (e)
{
e->type = EXPR_IVAL;
e->u.ival = val;
}
return e;
}
static struct expr *expr_sval( struct parser *parser, const struct string *str )
{
struct expr *e = alloc_mem( parser, sizeof *e );
if (e)
{
e->type = EXPR_SVAL;
e->u.sval = get_string( parser, str );
if (!e->u.sval)
return NULL; /* e will be freed by query destructor */
}
return e;
}
static struct expr *expr_bval( struct parser *parser, int val )
{
struct expr *e = alloc_mem( parser, sizeof *e );
if (e)
{
e->type = EXPR_BVAL;
e->u.ival = val;
}
return e;
}
static struct expr *expr_propval( struct parser *parser, const struct property *prop )
{
struct expr *e = alloc_mem( parser, sizeof *e );
if (e)
{
e->type = EXPR_PROPVAL;
e->u.propval = prop;
}
return e;
}
static int wql_error( const char *str );
static int wql_lex( void *val, struct parser *parser );
#define PARSER_BUBBLE_UP_VIEW( parser, result, current_view ) \
*parser->view = current_view; \
result = current_view
%}
%pure-parser
%union
{
struct string str;
WCHAR *string;
struct property *proplist;
struct view *view;
struct expr *expr;
int integer;
}
%token TK_SELECT TK_FROM TK_STAR TK_COMMA TK_DOT TK_IS TK_LP TK_RP TK_NULL TK_FALSE TK_TRUE
%token TK_INTEGER TK_WHERE TK_SPACE TK_MINUS TK_ILLEGAL TK_BY
%token <str> TK_STRING TK_ID
%type <string> id
%type <proplist> prop proplist
%type <view> select
%type <expr> expr prop_val const_val string_val
%type <integer> number
%left TK_OR
%left TK_AND
%left TK_NOT
%left TK_EQ TK_NE TK_LT TK_GT TK_LE TK_GE TK_LIKE
%%
select:
TK_SELECT TK_FROM id
{
HRESULT hr;
struct parser *parser = ctx;
struct view *view;
hr = create_view( NULL, $3, NULL, &view );
if (hr != S_OK)
YYABORT;
PARSER_BUBBLE_UP_VIEW( parser, $$, view );
}
| TK_SELECT proplist TK_FROM id
{
HRESULT hr;
struct parser *parser = ctx;
struct view *view;
hr = create_view( $2, $4, NULL, &view );
if (hr != S_OK)
YYABORT;
PARSER_BUBBLE_UP_VIEW( parser, $$, view );
}
| TK_SELECT proplist TK_FROM id TK_WHERE expr
{
HRESULT hr;
struct parser *parser = ctx;
struct view *view;
hr = create_view( $2, $4, $6, &view );
if (hr != S_OK)
YYABORT;
PARSER_BUBBLE_UP_VIEW( parser, $$, view );
}
;
proplist:
prop
| prop TK_COMMA proplist
{
$1->next = $3;
}
| TK_STAR
{
$$ = NULL;
}
;
prop:
id TK_DOT id
{
$$ = alloc_property( ctx, $1, $3 );
if (!$$)
YYABORT;
}
| id
{
$$ = alloc_property( ctx, NULL, $1 );
if (!$$)
YYABORT;
}
;
id:
TK_ID
{
$$ = get_string( ctx, &$1 );
if (!$$)
YYABORT;
}
;
number:
TK_INTEGER
{
$$ = get_int( ctx );
}
;
expr:
TK_LP expr TK_RP
{
$$ = $2;
if (!$$)
YYABORT;
}
| expr TK_AND expr
{
$$ = expr_complex( ctx, $1, OP_AND, $3 );
if (!$$)
YYABORT;
}
| expr TK_OR expr
{
$$ = expr_complex( ctx, $1, OP_OR, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_EQ const_val
{
$$ = expr_complex( ctx, $1, OP_EQ, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_GT const_val
{
$$ = expr_complex( ctx, $1, OP_GT, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_LT const_val
{
$$ = expr_complex( ctx, $1, OP_LT, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_LE const_val
{
$$ = expr_complex( ctx, $1, OP_LE, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_GE const_val
{
$$ = expr_complex( ctx, $1, OP_GE, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_NE const_val
{
$$ = expr_complex( ctx, $1, OP_NE, $3 );
if (!$$)
YYABORT;
}
| const_val TK_EQ prop_val
{
$$ = expr_complex( ctx, $1, OP_EQ, $3 );
if (!$$)
YYABORT;
}
| const_val TK_GT prop_val
{
$$ = expr_complex( ctx, $1, OP_GT, $3 );
if (!$$)
YYABORT;
}
| const_val TK_LT prop_val
{
$$ = expr_complex( ctx, $1, OP_LT, $3 );
if (!$$)
YYABORT;
}
| const_val TK_LE prop_val
{
$$ = expr_complex( ctx, $1, OP_LE, $3 );
if (!$$)
YYABORT;
}
| const_val TK_GE prop_val
{
$$ = expr_complex( ctx, $1, OP_GE, $3 );
if (!$$)
YYABORT;
}
| const_val TK_NE prop_val
{
$$ = expr_complex( ctx, $1, OP_NE, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_LIKE string_val
{
$$ = expr_complex( ctx, $1, OP_LIKE, $3 );
if (!$$)
YYABORT;
}
| prop_val TK_IS TK_NULL
{
$$ = expr_unary( ctx, $1, OP_ISNULL );
if (!$$)
YYABORT;
}
| prop_val TK_IS TK_NOT TK_NULL
{
$$ = expr_unary( ctx, $1, OP_NOTNULL );
if (!$$)
YYABORT;
}
;
string_val:
TK_STRING
{
$$ = expr_sval( ctx, &$1 );
if (!$$)
YYABORT;
}
;
prop_val:
prop
{
$$ = expr_propval( ctx, $1 );
if (!$$)
YYABORT;
}
;
const_val:
number
{
$$ = expr_ival( ctx, $1 );
if (!$$)
YYABORT;
}
| TK_STRING
{
$$ = expr_sval( ctx, &$1 );
if (!$$)
YYABORT;
}
| TK_TRUE
{
$$ = expr_bval( ctx, -1 );
if (!$$)
YYABORT;
}
| TK_FALSE
{
$$ = expr_bval( ctx, 0 );
if (!$$)
YYABORT;
}
;
%%
HRESULT parse_query( const WCHAR *str, struct view **view, struct list *mem )
{
struct parser parser;
int ret;
*view = NULL;
parser.cmd = str;
parser.idx = 0;
parser.len = 0;
parser.error = WBEM_E_INVALID_QUERY;
parser.view = view;
parser.mem = mem;
ret = wql_parse( &parser );
TRACE("wql_parse returned %d\n", ret);
if (ret)
{
if (*parser.view)
{
destroy_view( *parser.view );
*parser.view = NULL;
}
return parser.error;
}
return S_OK;
}
static const char id_char[] =
{
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
};
struct keyword
{
const WCHAR *name;
unsigned int len;
int type;
};
#define MAX_TOKEN_LEN 6
static const WCHAR andW[] = {'A','N','D'};
static const WCHAR byW[] = {'B','Y'};
static const WCHAR falseW[] = {'F','A','L','S','E'};
static const WCHAR fromW[] = {'F','R','O','M'};
static const WCHAR isW[] = {'I','S'};
static const WCHAR likeW[] = {'L','I','K','E'};
static const WCHAR notW[] = {'N','O','T'};
static const WCHAR nullW[] = {'N','U','L','L'};
static const WCHAR orW[] = {'O','R'};
static const WCHAR selectW[] = {'S','E','L','E','C','T'};
static const WCHAR trueW[] = {'T','R','U','E'};
static const WCHAR whereW[] = {'W','H','E','R','E'};
static const struct keyword keyword_table[] =
{
{ andW, SIZEOF(andW), TK_AND },
{ byW, SIZEOF(byW), TK_BY },
{ falseW, SIZEOF(falseW), TK_FALSE },
{ fromW, SIZEOF(fromW), TK_FROM },
{ isW, SIZEOF(isW), TK_IS },
{ likeW, SIZEOF(likeW), TK_LIKE },
{ notW, SIZEOF(notW), TK_NOT },
{ nullW, SIZEOF(nullW), TK_NULL },
{ orW, SIZEOF(orW), TK_OR },
{ selectW, SIZEOF(selectW), TK_SELECT },
{ trueW, SIZEOF(trueW), TK_TRUE },
{ whereW, SIZEOF(whereW), TK_WHERE }
};
static int cmp_keyword( const void *arg1, const void *arg2 )
{
const struct keyword *key1 = arg1, *key2 = arg2;
int len = min( key1->len, key2->len );
int ret;
if ((ret = memicmpW( key1->name, key2->name, len ))) return ret;
if (key1->len < key2->len) return -1;
else if (key1->len > key2->len) return 1;
return 0;
}
static int keyword_type( const WCHAR *str, unsigned int len )
{
struct keyword key, *ret;
if (len > MAX_TOKEN_LEN) return TK_ID;
key.name = str;
key.len = len;
key.type = 0;
ret = bsearch( &key, keyword_table, SIZEOF(keyword_table), sizeof(struct keyword), cmp_keyword );
if (ret) return ret->type;
return TK_ID;
}
static int get_token( const WCHAR *s, int *token )
{
int i;
switch (*s)
{
case ' ':
case '\t':
case '\n':
for (i = 1; isspaceW( s[i] ); i++) {}
*token = TK_SPACE;
return i;
case '-':
if (!s[1]) return -1;
*token = TK_MINUS;
return 1;
case '(':
*token = TK_LP;
return 1;
case ')':
*token = TK_RP;
return 1;
case '*':
*token = TK_STAR;
return 1;
case '=':
*token = TK_EQ;
return 1;
case '<':
if (s[1] == '=' )
{
*token = TK_LE;
return 2;
}
else if (s[1] == '>')
{
*token = TK_NE;
return 2;
}
else
{
*token = TK_LT;
return 1;
}
case '>':
if (s[1] == '=')
{
*token = TK_GE;
return 2;
}
else
{
*token = TK_GT;
return 1;
}
case '!':
if (s[1] != '=')
{
*token = TK_ILLEGAL;
return 2;
}
else
{
*token = TK_NE;
return 2;
}
case ',':
*token = TK_COMMA;
return 1;
case '\"':
case '\'':
{
for (i = 1; s[i]; i++)
{
if (s[i] == s[0]) break;
}
if (s[i]) i++;
*token = TK_STRING;
return i;
}
case '.':
if (!isdigitW( s[1] ))
{
*token = TK_DOT;
return 1;
}
/* fall through */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
*token = TK_INTEGER;
for (i = 1; isdigitW( s[i] ); i++) {}
return i;
default:
if (!id_char[*s]) break;
for (i = 1; id_char[s[i]]; i++) {}
*token = keyword_type( s, i );
return i;
}
*token = TK_ILLEGAL;
return 1;
}
static int wql_lex( void *p, struct parser *parser )
{
struct string *str = p;
int token = -1;
do
{
parser->idx += parser->len;
if (!parser->cmd[parser->idx]) return 0;
parser->len = get_token( &parser->cmd[parser->idx], &token );
if (!parser->len) break;
str->data = &parser->cmd[parser->idx];
str->len = parser->len;
} while (token == TK_SPACE);
return token;
}
static int wql_error( const char *str )
{
ERR("%s\n", str);
return 0;
}

View file

@ -108,6 +108,8 @@ list(APPEND SOURCE
urlmon.idl
vmr9.idl
# vmrender.idl
wbemcli.idl
wbemprov.idl
wia_lh.idl
wia_xp.idl
wincodec.idl
@ -120,16 +122,12 @@ list(APPEND SOURCE
ctfutb.idl
xmllite.idl)
if(NOT MSVC)
list(APPEND SOURCE
wbemcli.idl)
endif()
add_idl_headers(psdk ${SOURCE})
add_typelib(stdole2.idl)
add_custom_target(stdole2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stdole2.tlb)
add_idl_headers(d3d_idl_headers d3d10.idl d3dcommon.idl)
add_iid_library(dxgi_uuids dxgi.idl)
add_iid_library(wuguid wuapi.idl)
add_iid_library(xml_uuids msxml2.idl)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,857 @@
/*
* Copyright 2009 Henri Verbeet 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
*
*/
#ifndef __WINE_D3D10EFFECT_H
#define __WINE_D3D10EFFECT_H
#include "d3d10.h"
#define D3D10_EFFECT_VARIABLE_POOLED 0x1
#define D3D10_EFFECT_VARIABLE_ANNOTATION 0x2
#define D3D10_EFFECT_VARIABLE_EXPLICIT_BIND_POINT 0x4
#ifndef D3D10_BYTES_FROM_BITS
#define D3D10_BYTES_FROM_BITS(x) (((x) + 7) >> 3)
#endif
typedef enum _D3D10_DEVICE_STATE_TYPES
{
D3D10_DST_SO_BUFFERS = 1,
D3D10_DST_OM_RENDER_TARGETS,
D3D10_DST_DEPTH_STENCIL_STATE,
D3D10_DST_BLEND_STATE,
D3D10_DST_VS,
D3D10_DST_VS_SAMPLERS,
D3D10_DST_VS_SHADER_RESOURCES,
D3D10_DST_VS_CONSTANT_BUFFERS,
D3D10_DST_GS,
D3D10_DST_GS_SAMPLERS,
D3D10_DST_GS_SHADER_RESOURCES,
D3D10_DST_GS_CONSTANT_BUFFERS,
D3D10_DST_PS,
D3D10_DST_PS_SAMPLERS,
D3D10_DST_PS_SHADER_RESOURCES,
D3D10_DST_PS_CONSTANT_BUFFERS,
D3D10_DST_IA_VERTEX_BUFFERS,
D3D10_DST_IA_INDEX_BUFFER,
D3D10_DST_IA_INPUT_LAYOUT,
D3D10_DST_IA_PRIMITIVE_TOPOLOGY,
D3D10_DST_RS_VIEWPORTS,
D3D10_DST_RS_SCISSOR_RECTS,
D3D10_DST_RS_RASTERIZER_STATE,
D3D10_DST_PREDICATION,
} D3D10_DEVICE_STATE_TYPES;
typedef struct _D3D10_EFFECT_TYPE_DESC
{
LPCSTR TypeName;
D3D10_SHADER_VARIABLE_CLASS Class;
D3D10_SHADER_VARIABLE_TYPE Type;
UINT Elements;
UINT Members;
UINT Rows;
UINT Columns;
UINT PackedSize;
UINT UnpackedSize;
UINT Stride;
} D3D10_EFFECT_TYPE_DESC;
typedef struct _D3D10_EFFECT_VARIABLE_DESC
{
LPCSTR Name;
LPCSTR Semantic;
UINT Flags;
UINT Annotations;
UINT BufferOffset;
UINT ExplicitBindPoint;
} D3D10_EFFECT_VARIABLE_DESC;
typedef struct _D3D10_TECHNIQUE_DESC
{
LPCSTR Name;
UINT Passes;
UINT Annotations;
} D3D10_TECHNIQUE_DESC;
typedef struct _D3D10_STATE_BLOCK_MASK
{
BYTE VS;
BYTE VSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
BYTE VSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
BYTE VSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
BYTE GS;
BYTE GSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
BYTE GSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
BYTE GSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
BYTE PS;
BYTE PSSamplers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT)];
BYTE PSShaderResources[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT)];
BYTE PSConstantBuffers[D3D10_BYTES_FROM_BITS(D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT)];
BYTE IAVertexBuffers[D3D10_BYTES_FROM_BITS(D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT)];
BYTE IAIndexBuffer;
BYTE IAInputLayout;
BYTE IAPrimitiveTopology;
BYTE OMRenderTargets;
BYTE OMDepthStencilState;
BYTE OMBlendState;
BYTE RSViewports;
BYTE RSScissorRects;
BYTE RSRasterizerState;
BYTE SOBuffers;
BYTE Predication;
} D3D10_STATE_BLOCK_MASK;
typedef struct _D3D10_EFFECT_DESC
{
BOOL IsChildEffect;
UINT ConstantBuffers;
UINT SharedConstantBuffers;
UINT GlobalVariables;
UINT SharedGlobalVariables;
UINT Techniques;
} D3D10_EFFECT_DESC;
typedef struct _D3D10_EFFECT_SHADER_DESC
{
const BYTE *pInputSignature;
BOOL IsInline;
const BYTE *pBytecode;
UINT BytecodeLength;
LPCSTR SODecl;
UINT NumInputSignatureEntries;
UINT NumOutputSignatureEntries;
} D3D10_EFFECT_SHADER_DESC;
typedef struct _D3D10_PASS_DESC
{
LPCSTR Name;
UINT Annotations;
BYTE *pIAInputSignature;
SIZE_T IAInputSignatureSize;
UINT StencilRef;
UINT SampleMask;
FLOAT BlendFactor[4];
} D3D10_PASS_DESC;
typedef struct _D3D10_PASS_SHADER_DESC
{
struct ID3D10EffectShaderVariable *pShaderVariable;
UINT ShaderIndex;
} D3D10_PASS_SHADER_DESC;
#define D3D10_EFFECT_COMPILE_CHILD_EFFECT 0x0001
#define D3D10_EFFECT_COMPILE_ALLOW_SLOW_OPS 0x0002
#define D3D10_EFFECT_SINGLE_THREADED 0x0008
DEFINE_GUID(IID_ID3D10EffectType, 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd);
#define INTERFACE ID3D10EffectType
DECLARE_INTERFACE(ID3D10EffectType)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_TYPE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetMemberTypeBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(LPCSTR, GetMemberName)(THIS_ UINT index) PURE;
STDMETHOD_(LPCSTR, GetMemberSemantic)(THIS_ UINT index) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectVariable, 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b);
#define INTERFACE ID3D10EffectVariable
DECLARE_INTERFACE(ID3D10EffectVariable)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectConstantBuffer, 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3);
#define INTERFACE ID3D10EffectConstantBuffer
DECLARE_INTERFACE_(ID3D10EffectConstantBuffer, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectConstantBuffer methods */
STDMETHOD(SetConstantBuffer)(THIS_ ID3D10Buffer *buffer) PURE;
STDMETHOD(GetConstantBuffer)(THIS_ ID3D10Buffer **buffer) PURE;
STDMETHOD(SetTextureBuffer)(THIS_ ID3D10ShaderResourceView *view) PURE;
STDMETHOD(GetTextureBuffer)(THIS_ ID3D10ShaderResourceView **view) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectScalarVariable, 0x00e48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x02, 0x2d, 0xee, 0x53, 0x43, 0x1f);
#define INTERFACE ID3D10EffectScalarVariable
DECLARE_INTERFACE_(ID3D10EffectScalarVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectScalarVariable methods */
STDMETHOD(SetFloat)(THIS_ float value) PURE;
STDMETHOD(GetFloat)(THIS_ float *value) PURE;
STDMETHOD(SetFloatArray)(THIS_ float *values, UINT offset, UINT count) PURE;
STDMETHOD(GetFloatArray)(THIS_ float *values, UINT offset, UINT count) PURE;
STDMETHOD(SetInt)(THIS_ int value) PURE;
STDMETHOD(GetInt)(THIS_ int *value) PURE;
STDMETHOD(SetIntArray)(THIS_ int *values, UINT offset, UINT count) PURE;
STDMETHOD(GetIntArray)(THIS_ int *values, UINT offset, UINT count) PURE;
STDMETHOD(SetBool)(THIS_ BOOL value) PURE;
STDMETHOD(GetBool)(THIS_ BOOL *value) PURE;
STDMETHOD(SetBoolArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
STDMETHOD(GetBoolArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectVectorVariable, 0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81);
#define INTERFACE ID3D10EffectVectorVariable
DECLARE_INTERFACE_(ID3D10EffectVectorVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectVectorVariable methods */
STDMETHOD(SetBoolVector)(THIS_ BOOL *value) PURE;
STDMETHOD(SetIntVector)(THIS_ int *value) PURE;
STDMETHOD(SetFloatVector)(THIS_ float *value) PURE;
STDMETHOD(GetBoolVector)(THIS_ BOOL *value) PURE;
STDMETHOD(GetIntVector)(THIS_ int *value) PURE;
STDMETHOD(GetFloatVector)(THIS_ float *value) PURE;
STDMETHOD(SetBoolVectorArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
STDMETHOD(SetIntVectorArray)(THIS_ int *values, UINT offset, UINT count) PURE;
STDMETHOD(SetFloatVectorArray)(THIS_ float *values, UINT offset, UINT count) PURE;
STDMETHOD(GetBoolVectorArray)(THIS_ BOOL *values, UINT offset, UINT count) PURE;
STDMETHOD(GetIntVectorArray)(THIS_ int *values, UINT offset, UINT count) PURE;
STDMETHOD(GetFloatVectorArray)(THIS_ float *values, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectMatrixVariable, 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0);
#define INTERFACE ID3D10EffectMatrixVariable
DECLARE_INTERFACE_(ID3D10EffectMatrixVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectMatrixVariable methods */
STDMETHOD(SetMatrix)(THIS_ float *data) PURE;
STDMETHOD(GetMatrix)(THIS_ float *data) PURE;
STDMETHOD(SetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
STDMETHOD(GetMatrixArray)(THIS_ float *data, UINT offset, UINT count) PURE;
STDMETHOD(SetMatrixTranspose)(THIS_ float *data) PURE;
STDMETHOD(GetMatrixTranspose)(THIS_ float *data) PURE;
STDMETHOD(SetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
STDMETHOD(GetMatrixTransposeArray)(THIS_ float *data, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectStringVariable, 0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff);
#define INTERFACE ID3D10EffectStringVariable
DECLARE_INTERFACE_(ID3D10EffectStringVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectStringVariable methods */
STDMETHOD(GetString)(THIS_ LPCSTR *str) PURE;
STDMETHOD(GetStringArray)(THIS_ LPCSTR *strs, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectShaderResourceVariable,
0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc);
#define INTERFACE ID3D10EffectShaderResourceVariable
DECLARE_INTERFACE_(ID3D10EffectShaderResourceVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectShaderResourceVariable methods */
STDMETHOD(SetResource)(THIS_ ID3D10ShaderResourceView *resource) PURE;
STDMETHOD(GetResource)(THIS_ ID3D10ShaderResourceView **resource) PURE;
STDMETHOD(SetResourceArray)(THIS_ ID3D10ShaderResourceView **resources, UINT offset, UINT count) PURE;
STDMETHOD(GetResourceArray)(THIS_ ID3D10ShaderResourceView **resources, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectRenderTargetViewVariable,
0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17);
#define INTERFACE ID3D10EffectRenderTargetViewVariable
DECLARE_INTERFACE_(ID3D10EffectRenderTargetViewVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectRenderTargetViewVariable methods */
STDMETHOD(SetRenderTarget)(THIS_ ID3D10RenderTargetView *view) PURE;
STDMETHOD(GetRenderTarget)(THIS_ ID3D10RenderTargetView **view) PURE;
STDMETHOD(SetRenderTargetArray)(THIS_ ID3D10RenderTargetView **views, UINT offset, UINT count) PURE;
STDMETHOD(GetRenderTargetArray)(THIS_ ID3D10RenderTargetView **views, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectDepthStencilViewVariable,
0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23);
#define INTERFACE ID3D10EffectDepthStencilViewVariable
DECLARE_INTERFACE_(ID3D10EffectDepthStencilViewVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectDepthStencilViewVariable methods */
STDMETHOD(SetDepthStencil)(THIS_ ID3D10DepthStencilView *view) PURE;
STDMETHOD(GetDepthStencil)(THIS_ ID3D10DepthStencilView **view) PURE;
STDMETHOD(SetDepthStencilArray)(THIS_ ID3D10DepthStencilView **views, UINT offset, UINT count) PURE;
STDMETHOD(GetDepthStencilArray)(THIS_ ID3D10DepthStencilView **views, UINT offset, UINT count) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectShaderVariable, 0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x04, 0x07, 0xa0, 0x7d, 0x9e, 0x06);
#define INTERFACE ID3D10EffectShaderVariable
DECLARE_INTERFACE_(ID3D10EffectShaderVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectShaderVariable methods */
STDMETHOD(GetShaderDesc)(THIS_ UINT index, D3D10_EFFECT_SHADER_DESC *desc) PURE;
STDMETHOD(GetVertexShader)(THIS_ UINT index, ID3D10VertexShader **shader) PURE;
STDMETHOD(GetGeometryShader)(THIS_ UINT index, ID3D10GeometryShader **shader) PURE;
STDMETHOD(GetPixelShader)(THIS_ UINT index, ID3D10PixelShader **shader) PURE;
STDMETHOD(GetInputSignatureElementDesc)(THIS_ UINT shader_index, UINT element_index,
D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
STDMETHOD(GetOutputSignatureElementDesc)(THIS_ UINT shader_index, UINT element_index,
D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectBlendVariable, 0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0x0e, 0x91, 0x60, 0xcf, 0xb0, 0x7b);
#define INTERFACE ID3D10EffectBlendVariable
DECLARE_INTERFACE_(ID3D10EffectBlendVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectBlendVariable methods */
STDMETHOD(GetBlendState)(THIS_ UINT index, ID3D10BlendState **blend_state) PURE;
STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_BLEND_DESC *desc) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectDepthStencilVariable,
0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x01, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d);
#define INTERFACE ID3D10EffectDepthStencilVariable
DECLARE_INTERFACE_(ID3D10EffectDepthStencilVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectDepthStencilVariable methods */
STDMETHOD(GetDepthStencilState)(THIS_ UINT index, ID3D10DepthStencilState **depth_stencil_state) PURE;
STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_DEPTH_STENCIL_DESC *desc) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectRasterizerVariable,
0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0x0b, 0x34);
#define INTERFACE ID3D10EffectRasterizerVariable
DECLARE_INTERFACE_(ID3D10EffectRasterizerVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectRasterizerVariable methods */
STDMETHOD(GetRasterizerState)(THIS_ UINT index, ID3D10RasterizerState **rasterizer_state) PURE;
STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_RASTERIZER_DESC *desc) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectSamplerVariable,
0x6530d5c7, 0x07e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80);
#define INTERFACE ID3D10EffectSamplerVariable
DECLARE_INTERFACE_(ID3D10EffectSamplerVariable, ID3D10EffectVariable)
{
/* ID3D10EffectVariable methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectType *, GetType)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetMemberBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetElement)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetParentConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectScalarVariable *, AsScalar)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectVectorVariable *, AsVector)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectMatrixVariable *, AsMatrix)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectStringVariable *, AsString)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderResourceVariable *, AsShaderResource)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRenderTargetViewVariable *, AsRenderTargetView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilViewVariable *, AsDepthStencilView)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, AsConstantBuffer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectShaderVariable *, AsShader)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectBlendVariable *, AsBlend)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectDepthStencilVariable *, AsDepthStencil)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectRasterizerVariable *, AsRasterizer)(THIS) PURE;
STDMETHOD_(struct ID3D10EffectSamplerVariable *, AsSampler)(THIS) PURE;
STDMETHOD(SetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
STDMETHOD(GetRawValue)(THIS_ void *data, UINT offset, UINT count) PURE;
/* ID3D10EffectSamplerVariable methods */
STDMETHOD(GetSampler)(THIS_ UINT index, ID3D10SamplerState **sampler) PURE;
STDMETHOD(GetBackingStore)(THIS_ UINT index, D3D10_SAMPLER_DESC *desc) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectTechnique, 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75);
#define INTERFACE ID3D10EffectTechnique
DECLARE_INTERFACE(ID3D10EffectTechnique)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_TECHNIQUE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectPass *, GetPassByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectPass *, GetPassByName)(THIS_ LPCSTR name) PURE;
STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10Effect, 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7);
#define INTERFACE ID3D10Effect
DECLARE_INTERFACE_(ID3D10Effect, IUnknown)
{
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
/* ID3D10Effect methods */
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD_(BOOL, IsPool)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_EFFECT_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetVariableBySemantic)(THIS_ LPCSTR semantic) PURE;
STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectTechnique *, GetTechniqueByName)(THIS_ LPCSTR name) PURE;
STDMETHOD(Optimize)(THIS) PURE;
STDMETHOD_(BOOL, IsOptimized)(THIS) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33);
#define INTERFACE ID3D10EffectPool
DECLARE_INTERFACE_(ID3D10EffectPool, IUnknown)
{
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
/* ID3D10EffectPool methods */
STDMETHOD_(struct ID3D10Effect *, AsEffect)(THIS) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10EffectPass, 0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54);
#define INTERFACE ID3D10EffectPass
DECLARE_INTERFACE(ID3D10EffectPass)
{
STDMETHOD_(BOOL, IsValid)(THIS) PURE;
STDMETHOD(GetDesc)(THIS_ D3D10_PASS_DESC *desc) PURE;
STDMETHOD(GetVertexShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
STDMETHOD(GetGeometryShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
STDMETHOD(GetPixelShaderDesc)(THIS_ D3D10_PASS_SHADER_DESC *desc) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10EffectVariable *, GetAnnotationByName)(THIS_ LPCSTR name) PURE;
STDMETHOD(Apply)(THIS_ UINT flags) PURE;
STDMETHOD(ComputeStateBlockMask)(THIS_ D3D10_STATE_BLOCK_MASK *mask) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10StateBlock, 0x0803425a, 0x57f5, 0x4dd6, 0x94, 0x65, 0xa8, 0x75, 0x70, 0x83, 0x4a, 0x08);
#define INTERFACE ID3D10StateBlock
DECLARE_INTERFACE_(ID3D10StateBlock, IUnknown)
{
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **object) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
/* ID3D10StateBlock methods */
STDMETHOD(Capture)(THIS) PURE;
STDMETHOD(Apply)(THIS) PURE;
STDMETHOD(ReleaseAllDeviceObjects)(THIS) PURE;
STDMETHOD(GetDevice)(THIS_ ID3D10Device **device) PURE;
};
#undef INTERFACE
#ifdef __cplusplus
extern "C" {
#endif
HRESULT WINAPI D3D10CompileEffectFromMemory(void *data, SIZE_T data_size, const char *filename,
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, UINT hlsl_flags, UINT fx_flags,
ID3D10Blob **effect, ID3D10Blob **errors);
HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags,
ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect);
HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device,
D3D10_STATE_BLOCK_MASK *mask, ID3D10StateBlock **stateblock);
HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x,
D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result);
HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *mask);
HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *mask,
D3D10_DEVICE_STATE_TYPES state_type, UINT start_idx, UINT count);
HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *mask);
HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *mask,
D3D10_DEVICE_STATE_TYPES state_type, UINT start_idx, UINT count);
BOOL WINAPI D3D10StateBlockMaskGetSetting(D3D10_STATE_BLOCK_MASK *mask,
D3D10_DEVICE_STATE_TYPES state_type, UINT idx);
HRESULT WINAPI D3D10StateBlockMaskIntersect(D3D10_STATE_BLOCK_MASK *mask_x,
D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result);
HRESULT WINAPI D3D10StateBlockMaskUnion(D3D10_STATE_BLOCK_MASK *mask_x,
D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result);
#ifdef __cplusplus
}
#endif
#endif /* __WINE_D3D10EFFECT_H */

View file

@ -0,0 +1,48 @@
/*
* Copyright 2008 Henri Verbeet 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
*/
#ifndef __D3D10MISC_H__
#define __D3D10MISC_H__
#include "d3d10.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum D3D10_DRIVER_TYPE {
D3D10_DRIVER_TYPE_HARDWARE = 0,
D3D10_DRIVER_TYPE_REFERENCE = 1,
D3D10_DRIVER_TYPE_NULL = 2,
D3D10_DRIVER_TYPE_SOFTWARE = 3,
} D3D10_DRIVER_TYPE;
HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device);
HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,
HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc,
IDXGISwapChain **swapchain, ID3D10Device **device);
HRESULT WINAPI D3D10CreateBlob(SIZE_T data_size, ID3D10Blob **blob);
#ifdef __cplusplus
}
#endif
#endif /* __D3D10MISC_H__ */

View file

@ -0,0 +1,233 @@
/*
* Copyright 2009 Henri Verbeet 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
*
*/
#ifndef __WINE_D3D10SHADER_H
#define __WINE_D3D10SHADER_H
#include "d3d10.h"
#define D3D10_SHADER_DEBUG 0x0001
#define D3D10_SHADER_SKIP_VALIDATION 0x0002
#define D3D10_SHADER_SKIP_OPTIMIZATION 0x0004
#define D3D10_SHADER_PACK_MATRIX_ROW_MAJOR 0x0008
#define D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR 0x0010
#define D3D10_SHADER_PARTIAL_PRECISION 0x0020
#define D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT 0x0040
#define D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT 0x0080
#define D3D10_SHADER_NO_PRESHADER 0x0100
#define D3D10_SHADER_AVOID_FLOW_CONTROL 0x0200
#define D3D10_SHADER_PREFER_FLOW_CONTROL 0x0400
#define D3D10_SHADER_ENABLE_STRICTNESS 0x0800
#define D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY 0x1000
#define D3D10_SHADER_IEEE_STRICTNESS 0x2000
#define D3D10_SHADER_WARNINGS_ARE_ERRORS 0x40000
#define D3D10_SHADER_OPTIMIZATION_LEVEL0 0x4000
#define D3D10_SHADER_OPTIMIZATION_LEVEL1 0x0000
#define D3D10_SHADER_OPTIMIZATION_LEVEL2 0xC000
#define D3D10_SHADER_OPTIMIZATION_LEVEL3 0x8000
/* These are defined as version-neutral in d3dcommon.h */
typedef D3D_SHADER_MACRO D3D10_SHADER_MACRO;
typedef D3D_SHADER_MACRO *LPD3D10_SHADER_MACRO;
typedef D3D_SHADER_VARIABLE_CLASS D3D10_SHADER_VARIABLE_CLASS;
typedef D3D_SHADER_VARIABLE_CLASS *LPD3D10_SHADER_VARIABLE_CLASS;
typedef D3D_CBUFFER_TYPE D3D10_CBUFFER_TYPE;
typedef D3D_CBUFFER_TYPE *LPD3D10_CBUFFER_TYPE;
typedef D3D_REGISTER_COMPONENT_TYPE D3D10_REGISTER_COMPONENT_TYPE;
typedef D3D_RESOURCE_RETURN_TYPE D3D10_RESOURCE_RETURN_TYPE;
typedef D3D_NAME D3D10_NAME;
typedef D3D_SHADER_INPUT_TYPE D3D10_SHADER_INPUT_TYPE;
typedef D3D_SHADER_INPUT_TYPE *LPD3D10_SHADER_INPUT_TYPE;
typedef D3D_SHADER_VARIABLE_TYPE D3D10_SHADER_VARIABLE_TYPE;
typedef D3D_SHADER_VARIABLE_TYPE *LPD3D10_SHADER_VARIABLE_TYPE;
typedef D3D_INCLUDE_TYPE D3D10_INCLUDE_TYPE;
typedef ID3DInclude ID3D10Include;
typedef ID3DInclude *LPD3D10INCLUDE;
#define IID_ID3D10Include IID_ID3DInclude
typedef struct _D3D10_SHADER_INPUT_BIND_DESC
{
LPCSTR Name;
D3D10_SHADER_INPUT_TYPE Type;
UINT BindPoint;
UINT BindCount;
UINT uFlags;
D3D10_RESOURCE_RETURN_TYPE ReturnType;
D3D10_SRV_DIMENSION Dimension;
UINT NumSamples;
} D3D10_SHADER_INPUT_BIND_DESC;
typedef struct _D3D10_SIGNATURE_PARAMETER_DESC
{
LPCSTR SemanticName;
UINT SemanticIndex;
UINT Register;
D3D10_NAME SystemValueType;
D3D10_REGISTER_COMPONENT_TYPE ComponentType;
BYTE Mask;
BYTE ReadWriteMask;
} D3D10_SIGNATURE_PARAMETER_DESC;
typedef struct _D3D10_SHADER_DESC
{
UINT Version;
LPCSTR Creator;
UINT Flags;
UINT ConstantBuffers;
UINT BoundResources;
UINT InputParameters;
UINT OutputParameters;
UINT InstructionCount;
UINT TempRegisterCount;
UINT TempArrayCount;
UINT DefCount;
UINT DclCount;
UINT TextureNormalInstructions;
UINT TextureLoadInstructions;
UINT TextureCompInstructions;
UINT TextureBiasInstructions;
UINT TextureGradientInstructions;
UINT FloatInstructionCount;
UINT IntInstructionCount;
UINT UintInstructionCount;
UINT StaticFlowControlCount;
UINT DynamicFlowControlCount;
UINT MacroInstructionCount;
UINT ArrayInstructionCount;
UINT CutInstructionCount;
UINT EmitInstructionCount;
D3D10_PRIMITIVE_TOPOLOGY GSOutputTopology;
UINT GSMaxOutputVertexCount;
} D3D10_SHADER_DESC;
typedef struct _D3D10_SHADER_BUFFER_DESC
{
LPCSTR Name;
D3D10_CBUFFER_TYPE Type;
UINT Variables;
UINT Size;
UINT uFlags;
} D3D10_SHADER_BUFFER_DESC;
typedef struct _D3D10_SHADER_VARIABLE_DESC
{
LPCSTR Name;
UINT StartOffset;
UINT Size;
UINT uFlags;
LPVOID DefaultValue;
} D3D10_SHADER_VARIABLE_DESC;
typedef struct _D3D10_SHADER_TYPE_DESC
{
D3D10_SHADER_VARIABLE_CLASS Class;
D3D10_SHADER_VARIABLE_TYPE Type;
UINT Rows;
UINT Columns;
UINT Elements;
UINT Members;
UINT Offset;
} D3D10_SHADER_TYPE_DESC;
DEFINE_GUID(IID_ID3D10ShaderReflectionType, 0xc530ad7d, 0x9b16, 0x4395, 0xa9, 0x79, 0xba, 0x2e, 0xcf, 0xf8, 0x3a, 0xdd);
#define INTERFACE ID3D10ShaderReflectionType
DECLARE_INTERFACE(ID3D10ShaderReflectionType)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_TYPE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionType *, GetMemberTypeByName)(THIS_ LPCSTR name) PURE;
STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ UINT index) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10ShaderReflectionVariable, 0x1bf63c95, 0x2650, 0x405d, 0x99, 0xc1, 0x36, 0x36, 0xbd, 0x1d, 0xa0, 0xa1);
#define INTERFACE ID3D10ShaderReflectionVariable
DECLARE_INTERFACE(ID3D10ShaderReflectionVariable)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_VARIABLE_DESC *desc) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionType *, GetType)(THIS) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10ShaderReflectionConstantBuffer, 0x66c66a94, 0xdddd, 0x4b62, 0xa6, 0x6a, 0xf0, 0xda, 0x33, 0xc2, 0xb4, 0xd0);
#define INTERFACE ID3D10ShaderReflectionConstantBuffer
DECLARE_INTERFACE(ID3D10ShaderReflectionConstantBuffer)
{
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_BUFFER_DESC *desc) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionVariable *, GetVariableByName)(THIS_ LPCSTR name) PURE;
};
#undef INTERFACE
DEFINE_GUID(IID_ID3D10ShaderReflection, 0xd40e20b6, 0xf8f7, 0x42ad, 0xab, 0x20, 0x4b, 0xaf, 0x8f, 0x15, 0xdf, 0xaa);
#define INTERFACE ID3D10ShaderReflection
DECLARE_INTERFACE_(ID3D10ShaderReflection, IUnknown)
{
/* IUnknown methods */
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE;
STDMETHOD_(ULONG, AddRef)(THIS) PURE;
STDMETHOD_(ULONG, Release)(THIS) PURE;
/* ID3D10ShaderReflection methods */
STDMETHOD(GetDesc)(THIS_ D3D10_SHADER_DESC *desc) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ UINT index) PURE;
STDMETHOD_(struct ID3D10ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ LPCSTR name) PURE;
STDMETHOD(GetResourceBindingDesc)(THIS_ UINT index, D3D10_SHADER_INPUT_BIND_DESC *desc) PURE;
STDMETHOD(GetInputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
STDMETHOD(GetOutputParameterDesc)(THIS_ UINT index, D3D10_SIGNATURE_PARAMETER_DESC *desc) PURE;
};
#undef INTERFACE
#ifdef __cplusplus
extern "C" {
#endif
HRESULT WINAPI D3D10CompileShader(LPCSTR data, SIZE_T data_size, LPCSTR filename,
const D3D10_SHADER_MACRO *defines, ID3D10Include *include, LPCSTR entrypoint,
LPCSTR profile, UINT flags, ID3D10Blob **shader, ID3D10Blob **error_messages);
HRESULT WINAPI D3D10DisassembleShader(const void *data, SIZE_T data_size,
BOOL color_code, const char *comments, ID3D10Blob **disassembly);
LPCSTR WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device);
LPCSTR WINAPI D3D10GetGeometryShaderProfile(ID3D10Device *device);
LPCSTR WINAPI D3D10GetPixelShaderProfile(ID3D10Device *device);
HRESULT WINAPI D3D10ReflectShader(const void *data, SIZE_T data_size, ID3D10ShaderReflection **reflector);
HRESULT WINAPI D3D10GetInputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
HRESULT WINAPI D3D10GetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
HRESULT WINAPI D3D10GetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3D10Blob **blob);
HRESULT WINAPI D3D10GetShaderDebugInfo(const void *data, SIZE_T data_size, ID3D10Blob **blob);
#ifdef __cplusplus
}
#endif
#endif /* __WINE_D3D10SHADER_H */

View file

@ -0,0 +1,620 @@
/*
* Copyright 2010 Matteo Bruni 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
*/
import "oaidl.idl";
import "ocidl.idl";
typedef struct _D3D_SHADER_MACRO
{
LPCSTR Name;
LPCSTR Definition;
} D3D_SHADER_MACRO;
typedef struct _D3D_SHADER_MACRO* LPD3D_SHADER_MACRO;
[
object,
local,
uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102)
]
interface ID3D10Blob : IUnknown
{
void *GetBufferPointer();
SIZE_T GetBufferSize();
}
typedef ID3D10Blob* LPD3D10BLOB;
typedef ID3D10Blob ID3DBlob;
typedef ID3DBlob* LPD3DBLOB;
cpp_quote("#define IID_ID3DBlob IID_ID3D10Blob")
typedef enum _D3D_INCLUDE_TYPE
{
D3D_INCLUDE_LOCAL = 0,
D3D_INCLUDE_SYSTEM,
D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL,
D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM,
D3D_INCLUDE_FORCE_DWORD = 0x7fffffff
} D3D_INCLUDE_TYPE;
[
object,
local,
]
interface ID3DInclude
{
HRESULT Open(D3D_INCLUDE_TYPE include_type,
const char *filename,
const void *parent_data,
const void **data,
UINT *bytes);
HRESULT Close(const void *data);
}
typedef ID3DInclude* LPD3DINCLUDE;
typedef enum D3D_DRIVER_TYPE
{
D3D_DRIVER_TYPE_UNKNOWN,
D3D_DRIVER_TYPE_HARDWARE,
D3D_DRIVER_TYPE_REFERENCE,
D3D_DRIVER_TYPE_NULL,
D3D_DRIVER_TYPE_SOFTWARE,
D3D_DRIVER_TYPE_WARP,
} D3D_DRIVER_TYPE;
typedef enum D3D_FEATURE_LEVEL
{
D3D_FEATURE_LEVEL_9_1 = 0x9100,
D3D_FEATURE_LEVEL_9_2 = 0x9200,
D3D_FEATURE_LEVEL_9_3 = 0x9300,
D3D_FEATURE_LEVEL_10_0 = 0xa000,
D3D_FEATURE_LEVEL_10_1 = 0xa100,
D3D_FEATURE_LEVEL_11_0 = 0xb000,
} D3D_FEATURE_LEVEL;
typedef enum _D3D_SHADER_VARIABLE_CLASS
{
D3D_SVC_SCALAR,
D3D_SVC_VECTOR,
D3D_SVC_MATRIX_ROWS,
D3D_SVC_MATRIX_COLUMNS,
D3D_SVC_OBJECT,
D3D_SVC_STRUCT,
D3D_SVC_INTERFACE_CLASS,
D3D_SVC_INTERFACE_POINTER,
D3D10_SVC_SCALAR = 0,
D3D10_SVC_VECTOR,
D3D10_SVC_MATRIX_ROWS,
D3D10_SVC_MATRIX_COLUMNS,
D3D10_SVC_OBJECT,
D3D10_SVC_STRUCT,
D3D11_SVC_INTERFACE_CLASS,
D3D11_SVC_INTERFACE_POINTER,
D3D_SVC_FORCE_DWORD = 0x7fffffff,
} D3D_SHADER_VARIABLE_CLASS;
typedef enum _D3D_SHADER_VARIABLE_TYPE
{
D3D_SVT_VOID,
D3D_SVT_BOOL,
D3D_SVT_INT,
D3D_SVT_FLOAT,
D3D_SVT_STRING,
D3D_SVT_TEXTURE,
D3D_SVT_TEXTURE1D,
D3D_SVT_TEXTURE2D,
D3D_SVT_TEXTURE3D,
D3D_SVT_TEXTURECUBE,
D3D_SVT_SAMPLER,
D3D_SVT_SAMPLER1D,
D3D_SVT_SAMPLER2D,
D3D_SVT_SAMPLER3D,
D3D_SVT_SAMPLERCUBE,
D3D_SVT_PIXELSHADER,
D3D_SVT_VERTEXSHADER,
D3D_SVT_PIXELFRAGMENT,
D3D_SVT_VERTEXFRAGMENT,
D3D_SVT_UINT,
D3D_SVT_UINT8,
D3D_SVT_GEOMETRYSHADER,
D3D_SVT_RASTERIZER,
D3D_SVT_DEPTHSTENCIL,
D3D_SVT_BLEND,
D3D_SVT_BUFFER,
D3D_SVT_CBUFFER,
D3D_SVT_TBUFFER,
D3D_SVT_TEXTURE1DARRAY,
D3D_SVT_TEXTURE2DARRAY,
D3D_SVT_RENDERTARGETVIEW,
D3D_SVT_DEPTHSTENCILVIEW,
D3D_SVT_TEXTURE2DMS,
D3D_SVT_TEXTURE2DMSARRAY,
D3D_SVT_TEXTURECUBEARRAY,
D3D_SVT_HULLSHADER,
D3D_SVT_DOMAINSHADER,
D3D_SVT_INTERFACE_POINTER,
D3D_SVT_COMPUTESHADER,
D3D_SVT_DOUBLE,
D3D_SVT_RWTEXTURE1D,
D3D_SVT_RWTEXTURE1DARRAY,
D3D_SVT_RWTEXTURE2D,
D3D_SVT_RWTEXTURE2DARRAY,
D3D_SVT_RWTEXTURE3D,
D3D_SVT_RWBUFFER,
D3D_SVT_BYTEADDRESS_BUFFER,
D3D_SVT_RWBYTEADDRESS_BUFFER,
D3D_SVT_STRUCTURED_BUFFER,
D3D_SVT_RWSTRUCTURED_BUFFER,
D3D_SVT_APPEND_STRUCTURED_BUFFER,
D3D_SVT_CONSUME_STRUCTURED_BUFFER,
D3D10_SVT_VOID = 0,
D3D10_SVT_BOOL,
D3D10_SVT_INT,
D3D10_SVT_FLOAT,
D3D10_SVT_STRING,
D3D10_SVT_TEXTURE,
D3D10_SVT_TEXTURE1D,
D3D10_SVT_TEXTURE2D,
D3D10_SVT_TEXTURE3D,
D3D10_SVT_TEXTURECUBE,
D3D10_SVT_SAMPLER,
D3D10_SVT_SAMPLER1D,
D3D10_SVT_SAMPLER2D,
D3D10_SVT_SAMPLER3D,
D3D10_SVT_SAMPLERCUBE,
D3D10_SVT_PIXELSHADER,
D3D10_SVT_VERTEXSHADER,
D3D10_SVT_PIXELFRAGMENT,
D3D10_SVT_VERTEXFRAGMENT,
D3D10_SVT_UINT,
D3D10_SVT_UINT8,
D3D10_SVT_GEOMETRYSHADER,
D3D10_SVT_RASTERIZER,
D3D10_SVT_DEPTHSTENCIL,
D3D10_SVT_BLEND,
D3D10_SVT_BUFFER,
D3D10_SVT_CBUFFER,
D3D10_SVT_TBUFFER,
D3D10_SVT_TEXTURE1DARRAY,
D3D10_SVT_TEXTURE2DARRAY,
D3D10_SVT_RENDERTARGETVIEW,
D3D10_SVT_DEPTHSTENCILVIEW,
D3D10_SVT_TEXTURE2DMS,
D3D10_SVT_TEXTURE2DMSARRAY,
D3D10_SVT_TEXTURECUBEARRAY,
D3D11_SVT_HULLSHADER,
D3D11_SVT_DOMAINSHADER,
D3D11_SVT_INTERFACE_POINTER,
D3D11_SVT_COMPUTESHADER,
D3D11_SVT_DOUBLE,
D3D11_SVT_RWTEXTURE1D,
D3D11_SVT_RWTEXTURE1DARRAY,
D3D11_SVT_RWTEXTURE2D,
D3D11_SVT_RWTEXTURE2DARRAY,
D3D11_SVT_RWTEXTURE3D,
D3D11_SVT_RWBUFFER,
D3D11_SVT_BYTEADDRESS_BUFFER,
D3D11_SVT_RWBYTEADDRESS_BUFFER,
D3D11_SVT_STRUCTURED_BUFFER,
D3D11_SVT_RWSTRUCTURED_BUFFER,
D3D11_SVT_APPEND_STRUCTURED_BUFFER,
D3D11_SVT_CONSUME_STRUCTURED_BUFFER,
D3D_SVT_FORCE_DWORD = 0x7fffffff,
} D3D_SHADER_VARIABLE_TYPE;
typedef enum D3D_PRIMITIVE
{
D3D_PRIMITIVE_UNDEFINED,
D3D_PRIMITIVE_POINT,
D3D_PRIMITIVE_LINE,
D3D_PRIMITIVE_TRIANGLE,
D3D_PRIMITIVE_LINE_ADJ = 6,
D3D_PRIMITIVE_TRIANGLE_ADJ,
D3D_PRIMITIVE_1_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_2_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_3_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_4_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_5_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_6_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_7_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_8_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_9_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_10_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_11_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_12_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_13_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_14_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_15_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_16_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_17_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_18_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_19_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 28,
D3D_PRIMITIVE_21_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_22_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_23_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_24_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_25_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_26_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_27_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_28_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_29_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_30_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_31_CONTROL_POINT_PATCH,
D3D_PRIMITIVE_32_CONTROL_POINT_PATCH,
D3D10_PRIMITIVE_UNDEFINED = 0,
D3D10_PRIMITIVE_POINT,
D3D10_PRIMITIVE_LINE,
D3D10_PRIMITIVE_TRIANGLE,
D3D10_PRIMITIVE_LINE_ADJ = 6,
D3D10_PRIMITIVE_TRIANGLE_ADJ,
D3D11_PRIMITIVE_UNDEFINED = 0,
D3D11_PRIMITIVE_POINT,
D3D11_PRIMITIVE_LINE,
D3D11_PRIMITIVE_TRIANGLE,
D3D11_PRIMITIVE_LINE_ADJ = 6,
D3D11_PRIMITIVE_TRIANGLE_ADJ,
D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = 28,
D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH,
D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH,
} D3D_PRIMITIVE;
typedef enum D3D_PRIMITIVE_TOPOLOGY
{
D3D_PRIMITIVE_TOPOLOGY_UNDEFINED,
D3D_PRIMITIVE_TOPOLOGY_POINTLIST,
D3D_PRIMITIVE_TOPOLOGY_LINELIST,
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST,
D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
D3D10_PRIMITIVE_TOPOLOGY_POINTLIST,
D3D10_PRIMITIVE_TOPOLOGY_LINELIST,
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP,
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST,
D3D11_PRIMITIVE_TOPOLOGY_LINELIST,
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP,
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST,
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP,
D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ,
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ,
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ,
D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33,
D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST,
D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST,
} D3D_PRIMITIVE_TOPOLOGY;
typedef enum D3D_TESSELLATOR_DOMAIN
{
D3D_TESSELLATOR_DOMAIN_UNDEFINED,
D3D_TESSELLATOR_DOMAIN_ISOLINE,
D3D_TESSELLATOR_DOMAIN_TRI,
D3D_TESSELLATOR_DOMAIN_QUAD,
D3D11_TESSELLATOR_DOMAIN_UNDEFINED = 0,
D3D11_TESSELLATOR_DOMAIN_ISOLINE,
D3D11_TESSELLATOR_DOMAIN_TRI,
D3D11_TESSELLATOR_DOMAIN_QUAD,
} D3D_TESSELLATOR_DOMAIN;
typedef enum D3D_TESSELLATOR_PARTITIONING
{
D3D_TESSELLATOR_PARTITIONING_UNDEFINED,
D3D_TESSELLATOR_PARTITIONING_INTEGER,
D3D_TESSELLATOR_PARTITIONING_POW2,
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN,
D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = 0,
D3D11_TESSELLATOR_PARTITIONING_INTEGER,
D3D11_TESSELLATOR_PARTITIONING_POW2,
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD,
D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN,
} D3D_TESSELLATOR_PARTITIONING;
typedef enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE
{
D3D_TESSELLATOR_OUTPUT_UNDEFINED,
D3D_TESSELLATOR_OUTPUT_POINT,
D3D_TESSELLATOR_OUTPUT_LINE,
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW,
D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW,
D3D11_TESSELLATOR_OUTPUT_UNDEFINED = 0,
D3D11_TESSELLATOR_OUTPUT_POINT,
D3D11_TESSELLATOR_OUTPUT_LINE,
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW,
D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW,
} D3D_TESSELLATOR_OUTPUT_PRIMITIVE;
typedef enum D3D_CBUFFER_TYPE
{
D3D_CT_CBUFFER,
D3D_CT_TBUFFER,
D3D_CT_INTERFACE_POINTERS,
D3D_CT_RESOURCE_BIND_INFO,
D3D10_CT_CBUFFER = 0,
D3D10_CT_TBUFFER,
D3D11_CT_CBUFFER = 0,
D3D11_CT_TBUFFER,
D3D11_CT_INTERFACE_POINTERS,
D3D11_CT_RESOURCE_BIND_INFO,
} D3D_CBUFFER_TYPE;
typedef enum D3D_SRV_DIMENSION
{
D3D_SRV_DIMENSION_UNKNOWN,
D3D_SRV_DIMENSION_BUFFER,
D3D_SRV_DIMENSION_TEXTURE1D,
D3D_SRV_DIMENSION_TEXTURE1DARRAY,
D3D_SRV_DIMENSION_TEXTURE2D,
D3D_SRV_DIMENSION_TEXTURE2DARRAY,
D3D_SRV_DIMENSION_TEXTURE2DMS,
D3D_SRV_DIMENSION_TEXTURE2DMSARRAY,
D3D_SRV_DIMENSION_TEXTURE3D,
D3D_SRV_DIMENSION_TEXTURECUBE,
D3D_SRV_DIMENSION_TEXTURECUBEARRAY,
D3D_SRV_DIMENSION_BUFFEREX,
D3D10_SRV_DIMENSION_UNKNOWN = 0,
D3D10_SRV_DIMENSION_BUFFER,
D3D10_SRV_DIMENSION_TEXTURE1D,
D3D10_SRV_DIMENSION_TEXTURE1DARRAY,
D3D10_SRV_DIMENSION_TEXTURE2D,
D3D10_SRV_DIMENSION_TEXTURE2DARRAY,
D3D10_SRV_DIMENSION_TEXTURE2DMS,
D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY,
D3D10_SRV_DIMENSION_TEXTURE3D,
D3D10_SRV_DIMENSION_TEXTURECUBE,
D3D10_1_SRV_DIMENSION_UNKNOWN = 0,
D3D10_1_SRV_DIMENSION_BUFFER,
D3D10_1_SRV_DIMENSION_TEXTURE1D,
D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY,
D3D10_1_SRV_DIMENSION_TEXTURE2D,
D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY,
D3D10_1_SRV_DIMENSION_TEXTURE2DMS,
D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY,
D3D10_1_SRV_DIMENSION_TEXTURE3D,
D3D10_1_SRV_DIMENSION_TEXTURECUBE,
D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY,
D3D11_SRV_DIMENSION_UNKNOWN = 0,
D3D11_SRV_DIMENSION_BUFFER,
D3D11_SRV_DIMENSION_TEXTURE1D,
D3D11_SRV_DIMENSION_TEXTURE1DARRAY,
D3D11_SRV_DIMENSION_TEXTURE2D,
D3D11_SRV_DIMENSION_TEXTURE2DARRAY,
D3D11_SRV_DIMENSION_TEXTURE2DMS,
D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY,
D3D11_SRV_DIMENSION_TEXTURE3D,
D3D11_SRV_DIMENSION_TEXTURECUBE,
D3D11_SRV_DIMENSION_TEXTURECUBEARRAY,
D3D11_SRV_DIMENSION_BUFFEREX,
} D3D_SRV_DIMENSION;
typedef enum D3D_REGISTER_COMPONENT_TYPE
{
D3D_REGISTER_COMPONENT_UNKNOWN,
D3D_REGISTER_COMPONENT_UINT32,
D3D_REGISTER_COMPONENT_SINT32,
D3D_REGISTER_COMPONENT_FLOAT32,
D3D10_REGISTER_COMPONENT_UNKNOWN = 0,
D3D10_REGISTER_COMPONENT_UINT32,
D3D10_REGISTER_COMPONENT_SINT32,
D3D10_REGISTER_COMPONENT_FLOAT32,
} D3D_REGISTER_COMPONENT_TYPE;
typedef enum D3D_RESOURCE_RETURN_TYPE
{
D3D_RETURN_TYPE_UNORM = 1,
D3D_RETURN_TYPE_SNORM,
D3D_RETURN_TYPE_SINT,
D3D_RETURN_TYPE_UINT,
D3D_RETURN_TYPE_FLOAT,
D3D_RETURN_TYPE_MIXED,
D3D_RETURN_TYPE_DOUBLE,
D3D_RETURN_TYPE_CONTINUED,
D3D10_RETURN_TYPE_UNORM = 1,
D3D10_RETURN_TYPE_SNORM,
D3D10_RETURN_TYPE_SINT,
D3D10_RETURN_TYPE_UINT,
D3D10_RETURN_TYPE_FLOAT,
D3D10_RETURN_TYPE_MIXED,
D3D11_RETURN_TYPE_UNORM = 1,
D3D11_RETURN_TYPE_SNORM,
D3D11_RETURN_TYPE_SINT,
D3D11_RETURN_TYPE_UINT,
D3D11_RETURN_TYPE_FLOAT,
D3D11_RETURN_TYPE_MIXED,
D3D11_RETURN_TYPE_DOUBLE,
D3D11_RETURN_TYPE_CONTINUED,
} D3D_RESOURCE_RETURN_TYPE;
typedef enum D3D_NAME
{
D3D_NAME_UNDEFINED,
D3D_NAME_POSITION,
D3D_NAME_CLIP_DISTANCE,
D3D_NAME_CULL_DISTANCE,
D3D_NAME_RENDER_TARGET_ARRAY_INDEX,
D3D_NAME_VIEWPORT_ARRAY_INDEX,
D3D_NAME_VERTEX_ID,
D3D_NAME_PRIMITIVE_ID,
D3D_NAME_INSTANCE_ID,
D3D_NAME_IS_FRONT_FACE,
D3D_NAME_SAMPLE_INDEX,
D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR,
D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
D3D_NAME_TARGET = 64,
D3D_NAME_DEPTH,
D3D_NAME_COVERAGE,
D3D_NAME_DEPTH_GREATER_EQUAL,
D3D_NAME_DEPTH_LESS_EQUAL,
D3D10_NAME_UNDEFINED = 0,
D3D10_NAME_POSITION,
D3D10_NAME_CLIP_DISTANCE,
D3D10_NAME_CULL_DISTANCE,
D3D10_NAME_RENDER_TARGET_ARRAY_INDEX,
D3D10_NAME_VIEWPORT_ARRAY_INDEX,
D3D10_NAME_VERTEX_ID,
D3D10_NAME_PRIMITIVE_ID,
D3D10_NAME_INSTANCE_ID,
D3D10_NAME_IS_FRONT_FACE,
D3D10_NAME_SAMPLE_INDEX,
D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR,
D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR,
D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR,
D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR,
D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR,
D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR,
D3D10_NAME_TARGET = 64,
D3D10_NAME_DEPTH,
D3D10_NAME_COVERAGE,
D3D11_NAME_DEPTH_GREATER_EQUAL,
D3D11_NAME_DEPTH_LESS_EQUAL,
} D3D_NAME;
typedef enum _D3D_SHADER_INPUT_TYPE
{
D3D_SIT_CBUFFER,
D3D_SIT_TBUFFER,
D3D_SIT_TEXTURE,
D3D_SIT_SAMPLER,
D3D_SIT_UAV_RWTYPED,
D3D_SIT_STRUCTURED,
D3D_SIT_UAV_RWSTRUCTURED,
D3D_SIT_BYTEADDRESS,
D3D_SIT_UAV_RWBYTEADDRESS,
D3D_SIT_UAV_APPEND_STRUCTURED,
D3D_SIT_UAV_CONSUME_STRUCTURED,
D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER,
D3D10_SIT_CBUFFER = 0,
D3D10_SIT_TBUFFER,
D3D10_SIT_TEXTURE,
D3D10_SIT_SAMPLER,
D3D11_SIT_UAV_RWTYPED,
D3D11_SIT_STRUCTURED,
D3D11_SIT_UAV_RWSTRUCTURED,
D3D11_SIT_BYTEADDRESS,
D3D11_SIT_UAV_RWBYTEADDRESS,
D3D11_SIT_UAV_APPEND_STRUCTURED,
D3D11_SIT_UAV_CONSUME_STRUCTURED,
D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER,
} D3D_SHADER_INPUT_TYPE;

View file

@ -1,35 +1,251 @@
#ifndef _IPIFCONS_H
#define _IPIFCONS_H
/* WINE ipifcons.h
* Copyright (C) 2003 Juan Lang
*
* 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
*/
#ifndef WINE_IPIFCONS_H__
#define WINE_IPIFCONS_H__
#define IF_ADMIN_STATUS_UP 1
#define IF_ADMIN_STATUS_DOWN 2
#define IF_ADMIN_STATUS_TESTING 3
#define IF_OPER_STATUS_NON_OPERATIONAL 0
#define IF_OPER_STATUS_UNREACHABLE 1
#define IF_OPER_STATUS_DISCONNECTED 2
#define IF_OPER_STATUS_CONNECTING 3
#define IF_OPER_STATUS_CONNECTED 4
#define IF_OPER_STATUS_OPERATIONAL 5
#define IF_TYPE_OTHER 1
#define IF_TYPE_REGULAR_1822 2
#define IF_TYPE_HDH_1822 3
#define IF_TYPE_DDN_X25 4
#define IF_TYPE_RFC877_X25 5
#define IF_TYPE_ETHERNET_CSMACD 6
#define IF_TYPE_IS088023_CSMACD 7
#define IF_TYPE_ISO88024_TOKENBUS 8
#define IF_TYPE_ISO88025_TOKENRING 9
#define IF_TYPE_ISO88026_MAN 10
#define IF_TYPE_STARLAN 11
#define IF_TYPE_PROTEON_10MBIT 12
#define IF_TYPE_PROTEON_80MBIT 13
#define IF_TYPE_HYPERCHANNEL 14
#define IF_TYPE_FDDI 15
#define IF_TYPE_LAP_B 16
#define IF_TYPE_SDLC 17
#define IF_TYPE_DS1 18
#define IF_TYPE_E1 19
#define IF_TYPE_BASIC_ISDN 20
#define IF_TYPE_PRIMARY_ISDN 21
#define IF_TYPE_PROP_POINT2POINT_SERIAL 22
#define IF_TYPE_PPP 23
#define IF_TYPE_SOFTWARE_LOOPBACK 24
#define IF_TYPE_EON 25
#define IF_TYPE_ETHERNET_3MBIT 26
#define IF_TYPE_NSIP 27
#define IF_TYPE_SLIP 28
#define IF_TYPE_ULTRA 29
#define IF_TYPE_DS3 30
#define IF_TYPE_SIP 31
#define IF_TYPE_FRAMERELAY 32
#define IF_TYPE_RS232 33
#define IF_TYPE_PARA 34
#define IF_TYPE_ARCNET 35
#define IF_TYPE_ARCNET_PLUS 36
#define IF_TYPE_ATM 37
#define IF_TYPE_MIO_X25 38
#define IF_TYPE_SONET 39
#define IF_TYPE_X25_PLE 40
#define IF_TYPE_ISO88022_LLC 41
#define IF_TYPE_LOCALTALK 42
#define IF_TYPE_SMDS_DXI 43
#define IF_TYPE_FRAMERELAY_SERVICE 44
#define IF_TYPE_V35 45
#define IF_TYPE_HSSI 46
#define IF_TYPE_HIPPI 47
#define IF_TYPE_MODEM 48
#define IF_TYPE_AAL5 49
#define IF_TYPE_SONET_PATH 50
#define IF_TYPE_SONET_VT 51
#define IF_TYPE_SMDS_ICIP 52
#define IF_TYPE_PROP_VIRTUAL 53
#define IF_TYPE_PROP_MULTIPLEXOR 54
#define IF_TYPE_IEEE80212 55
#define IF_TYPE_FIBRECHANNEL 56
#define IF_TYPE_HIPPIINTERFACE 57
#define IF_TYPE_FRAMERELAY_INTERCONNECT 58
#define IF_TYPE_AFLANE_8023 59
#define IF_TYPE_AFLANE_8025 60
#define IF_TYPE_CCTEMUL 61
#define IF_TYPE_FASTETHER 62
#define IF_TYPE_ISDN 63
#define IF_TYPE_V11 64
#define IF_TYPE_V36 65
#define IF_TYPE_G703_64K 66
#define IF_TYPE_G703_2MB 67
#define IF_TYPE_QLLC 68
#define IF_TYPE_FASTETHER_FX 69
#define IF_TYPE_CHANNEL 70
#define IF_TYPE_IEEE80211 71
#define IF_TYPE_IBM370PARCHAN 72
#define IF_TYPE_ESCON 73
#define IF_TYPE_DLSW 74
#define IF_TYPE_ISDN_S 75
#define IF_TYPE_ISDN_U 76
#define IF_TYPE_LAP_D 77
#define IF_TYPE_IPSWITCH 78
#define IF_TYPE_RSRB 79
#define IF_TYPE_ATM_LOGICAL 80
#define IF_TYPE_DS0 81
#define IF_TYPE_DS0_BUNDLE 82
#define IF_TYPE_BSC 83
#define IF_TYPE_ASYNC 84
#define IF_TYPE_CNR 85
#define IF_TYPE_ISO88025R_DTR 86
#define IF_TYPE_EPLRS 87
#define IF_TYPE_ARAP 88
#define IF_TYPE_PROP_CNLS 89
#define IF_TYPE_HOSTPAD 90
#define IF_TYPE_TERMPAD 91
#define IF_TYPE_FRAMERELAY_MPI 92
#define IF_TYPE_X213 93
#define IF_TYPE_ADSL 94
#define IF_TYPE_RADSL 95
#define IF_TYPE_SDSL 96
#define IF_TYPE_VDSL 97
#define IF_TYPE_ISO88025_CRFPRINT 98
#define IF_TYPE_MYRINET 99
#define IF_TYPE_VOICE_EM 100
#define IF_TYPE_VOICE_FXO 101
#define IF_TYPE_VOICE_FXS 102
#define IF_TYPE_VOICE_ENCAP 103
#define IF_TYPE_VOICE_OVERIP 104
#define IF_TYPE_ATM_DXI 105
#define IF_TYPE_ATM_FUNI 106
#define IF_TYPE_ATM_IMA 107
#define IF_TYPE_PPPMULTILINKBUNDLE 108
#define IF_TYPE_IPOVER_CDLC 109
#define IF_TYPE_IPOVER_CLAW 110
#define IF_TYPE_STACKTOSTACK 111
#define IF_TYPE_VIRTUALIPADDRESS 112
#define IF_TYPE_MPC 113
#define IF_TYPE_IPOVER_ATM 114
#define IF_TYPE_ISO88025_FIBER 115
#define IF_TYPE_TDLC 116
#define IF_TYPE_GIGABITETHERNET 117
#define IF_TYPE_HDLC 118
#define IF_TYPE_LAP_F 119
#define IF_TYPE_V37 120
#define IF_TYPE_X25_MLP 121
#define IF_TYPE_X25_HUNTGROUP 122
#define IF_TYPE_TRANSPHDLC 123
#define IF_TYPE_INTERLEAVE 124
#define IF_TYPE_FAST 125
#define IF_TYPE_IP 126
#define IF_TYPE_DOCSCABLE_MACLAYER 127
#define IF_TYPE_DOCSCABLE_DOWNSTREAM 128
#define IF_TYPE_DOCSCABLE_UPSTREAM 129
#define IF_TYPE_A12MPPSWITCH 130
#define IF_TYPE_TUNNEL 131
#define IF_TYPE_COFFEE 132
#define IF_TYPE_CES 133
#define IF_TYPE_ATM_SUBINTERFACE 134
#define IF_TYPE_L2_VLAN 135
#define IF_TYPE_L3_IPVLAN 136
#define IF_TYPE_L3_IPXVLAN 137
#define IF_TYPE_DIGITALPOWERLINE 138
#define IF_TYPE_MEDIAMAILOVERIP 139
#define IF_TYPE_DTM 140
#define IF_TYPE_DCN 141
#define IF_TYPE_IPFORWARD 142
#define IF_TYPE_MSDSL 143
#define IF_TYPE_IEEE1394 144
#define IF_TYPE_IF_GSN 145
#define IF_TYPE_DVBRCC_MACLAYER 146
#define IF_TYPE_DVBRCC_DOWNSTREAM 147
#define IF_TYPE_DVBRCC_UPSTREAM 148
#define IF_TYPE_ATM_VIRTUAL 149
#define IF_TYPE_MPLS_TUNNEL 150
#define IF_TYPE_SRP 151
#define IF_TYPE_VOICEOVERATM 152
#define IF_TYPE_VOICEOVERFRAMERELAY 153
#define IF_TYPE_IDSL 154
#define IF_TYPE_COMPOSITELINK 155
#define IF_TYPE_SS7_SIGLINK 156
#define IF_TYPE_PROP_WIRELESS_P2P 157
#define IF_TYPE_FR_FORWARD 158
#define IF_TYPE_RFC1483 159
#define IF_TYPE_USB 160
#define IF_TYPE_IEEE8023AD_LAG 161
#define IF_TYPE_BGP_POLICY_ACCOUNTING 162
#define IF_TYPE_FRF16_MFR_BUNDLE 163
#define IF_TYPE_H323_GATEKEEPER 164
#define IF_TYPE_H323_PROXY 165
#define IF_TYPE_MPLS 166
#define IF_TYPE_MF_SIGLINK 167
#define IF_TYPE_HDSL2 168
#define IF_TYPE_SHDSL 169
#define IF_TYPE_DS1_FDL 170
#define IF_TYPE_POS 171
#define IF_TYPE_DVB_ASI_IN 172
#define IF_TYPE_DVB_ASI_OUT 173
#define IF_TYPE_PLC 175
#define IF_TYPE_NFAS 175
#define IF_TYPE_TR008 176
#define IF_TYPE_GR303_RDT 177
#define IF_TYPE_GR303_IDT 178
#define IF_TYPE_ISUP 179
#define IF_TYPE_PROP_DOCS_WIRELESS_MACLAYER 180
#define IF_TYPE_PROP_DOCS_WIRELESS_DOWNSTREAM 181
#define IF_TYPE_PROP_DOCS_WIRELESS_UPSTREAM 182
#define IF_TYPE_HIPERLAN2 183
#define IF_TYPE_PROP_BWA_P2MP 184
#define IF_TYPE_SONET_OVERHEAD_CHANNEL 185
#define IF_TYPE_DIGITAL_WRAPPER_OVERHEAD_CHANNEL 186
#define IF_TYPE_AAL2 187
#define IF_TYPE_RADIO_MAC 188
#define IF_TYPE_ATM_RADIO 189
#define IF_TYPE_IMT 190
#define IF_TYPE_MVL 191
#define IF_TYPE_REACH_DSL 192
#define IF_TYPE_FR_DLCI_ENDPT 193
#define IF_TYPE_ATM_VCI_ENDPT 194
#define IF_TYPE_OPTICAL_CHANNEL 195
#define IF_TYPE_OPTICAL_TRANSPORT 196
#define IF_TYPE_IEEE80216_WANN 237
#define IF_TYPE_WWANPP 243
#define IF_TYPE_WWANPP2 244
#define MAX_IF_TYPE 244
#define MIB_IF_ADMIN_STATUS_UP 1
#define MIB_IF_ADMIN_STATUS_DOWN 2
#define MIB_IF_ADMIN_STATUS_TESTING 3
#define MIB_IF_OPER_STATUS_NON_OPERATIONAL 0
#define MIB_IF_OPER_STATUS_UNREACHABLE 1
#define MIB_IF_OPER_STATUS_DISCONNECTED 2
#define MIB_IF_OPER_STATUS_CONNECTING 3
#define MIB_IF_OPER_STATUS_CONNECTED 4
#define MIB_IF_OPER_STATUS_OPERATIONAL 5
#define MIB_IF_TYPE_OTHER 1
#define MIB_IF_TYPE_ETHERNET 6
#define MIB_IF_TYPE_TOKENRING 9
#define MIB_IF_TYPE_FDDI 15
#define MIB_IF_TYPE_PPP 23
#define MIB_IF_TYPE_LOOPBACK 24
#define MIB_IF_TYPE_SLIP 28
#define MIB_IF_TYPE_OTHER 1
#define MIB_IF_TYPE_ETHERNET 6
#define MIB_IF_TYPE_TOKENRING 9
#define MIB_IF_TYPE_FDDI 15
#define MIB_IF_TYPE_PPP 23
#define MIB_IF_TYPE_LOOPBACK 24
#define MIB_IF_TYPE_SLIP 28
#define IF_TYPE_OTHER 1
#define IF_TYPE_ETHERNET_CSMACD 6
#define IF_TYPE_IEEE80211 71
#define MIB_IF_ADMIN_STATUS_UP 1
#define MIB_IF_ADMIN_STATUS_DOWN 2
#define MIB_IF_ADMIN_STATUS_TESTING 3
#endif /* _IPIFCONS_H */
typedef enum _INTERNAL_IF_OPER_STATUS
{
IF_OPER_STATUS_NON_OPERATIONAL = 0,
IF_OPER_STATUS_UNREACHABLE = 1,
IF_OPER_STATUS_DISCONNECTED = 2,
IF_OPER_STATUS_CONNECTING = 3,
IF_OPER_STATUS_CONNECTED = 4,
IF_OPER_STATUS_OPERATIONAL = 5,
} INTERNAL_IF_OPER_STATUS;
#define MIB_IF_OPER_STATUS_NON_OPERATIONAL IF_OPER_STATUS_NON_OPERATIONAL
#define MIB_IF_OPER_STATUS_UNREACHABLE IF_OPER_STATUS_UNREACHABLE
#define MIB_IF_OPER_STATUS_DISCONNECTED IF_OPER_STATUS_DISCONNECTED
#define MIB_IF_OPER_STATUS_CONNECTING IF_OPER_STATUS_CONNECTING
#define MIB_IF_OPER_STATUS_CONNECTED IF_OPER_STATUS_CONNECTED
#define MIB_IF_OPER_STATUS_OPERATIONAL IF_OPER_STATUS_OPERATIONAL
#endif /* WINE_IPIFCONS_H__ */

View file

@ -169,8 +169,8 @@ typedef struct _IP_ADAPTER_ADDRESSES {
struct {
ULONG Length;
DWORD IfIndex;
};
};
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
struct _IP_ADAPTER_ADDRESSES *Next;
PCHAR AdapterName;
PIP_ADAPTER_UNICAST_ADDRESS FirstUnicastAddress;

View file

@ -19,6 +19,7 @@
cpp_quote("DEFINE_GUID(CLSID_WbemLocator, 0x4590f811,0x1d3A,0x11d0,0x89,0x1f,0x00,0xaa,0x00,0x4b,0x2e,0x24);")
cpp_quote("DEFINE_GUID(CLSID_WbemStatusCode, 0xeb87e1bd,0x3233,0x11d2,0xae,0xc9,0x00,0xc0,0x4f,0xb6,0x88,0x20);")
import "oaidl.idl";
import "objidl.idl";
interface IWbemContext;
@ -28,6 +29,7 @@ interface IWbemCallResult;
interface IWbemObjectSink;
interface IWbemClassObject;
interface IEnumWbemClassObject;
interface IWbemQualifierSet;
typedef [v1_enum] enum tag_WBEMSTATUS
{
@ -174,6 +176,80 @@ typedef [v1_enum] enum tag_WBEMSTATUS
WBEM_E_PROVIDER_DISABLED = 0x8004108a
} WBEMSTATUS;
typedef [v1_enum] enum tag_WBEM_TIMEOUT_TYPE
{
WBEM_NO_WAIT = 0,
WBEM_INFINITE = 0xffffffff
} WBEM_TIMEOUT_TYPE;
typedef [v1_enum] enum tag_WBEM_CONDITION_FLAG_TYPE
{
WBEM_FLAG_ALWAYS = 0,
WBEM_FLAG_ONLY_IF_TRUE = 0x1,
WBEM_FLAG_ONLY_IF_FALSE = 0x2,
WBEM_FLAG_ONLY_IF_IDENTICAL = 0x3,
WBEM_MASK_PRIMARY_CONDITION = 0x3,
WBEM_FLAG_KEYS_ONLY = 0x4,
WBEM_FLAG_REFS_ONLY = 0x8,
WBEM_FLAG_LOCAL_ONLY = 0x10,
WBEM_FLAG_PROPAGATED_ONLY = 0x20,
WBEM_FLAG_SYSTEM_ONLY = 0x30,
WBEM_FLAG_NONSYSTEM_ONLY = 0x40,
WBEM_MASK_CONDITION_ORIGIN = 0x70,
WBEM_FLAG_CLASS_OVERRIDES_ONLY = 0x100,
WBEM_FLAG_CLASS_LOCAL_AND_OVERRIDES = 0x200,
WBEM_MASK_CLASS_CONDITION = 0x300
} WBEM_CONDITION_FLAG_TYPE;
typedef [v1_enum] enum tag_WBEM_FLAVOR_TYPE
{
WBEM_FLAVOR_DONT_PROPAGATE = 0,
WBEM_FLAVOR_FLAG_PROPAGATE_TO_INSTANCE = 0x1,
WBEM_FLAVOR_FLAG_PROPAGATE_TO_DERIVED_CLASS = 0x2,
WBEM_FLAVOR_MASK_PROPAGATION = 0xf,
WBEM_FLAVOR_OVERRIDABLE = 0,
WBEM_FLAVOR_NOT_OVERRIDABLE = 0x10,
WBEM_FLAVOR_MASK_PERMISSIONS = 0x10,
WBEM_FLAVOR_ORIGIN_LOCAL = 0,
WBEM_FLAVOR_ORIGIN_PROPAGATED = 0x20,
WBEM_FLAVOR_ORIGIN_SYSTEM = 0x40,
WBEM_FLAVOR_MASK_ORIGIN = 0x60,
WBEM_FLAVOR_NOT_AMENDED = 0,
WBEM_FLAVOR_AMENDED = 0x80,
WBEM_FLAVOR_MASK_AMENDED = 0x80
} WBEM_FLAVOR_TYPE;
typedef [v1_enum] enum tag_WBEM_GENUS_TYPE
{
WBEM_GENUS_CLASS = 1,
WBEM_GENUS_INSTANCE = 2
} WBEM_GENUS_TYPE;
typedef [v1_enum] enum tag_CIMTYPE_ENUMERATION
{
CIM_ILLEGAL = 0xfff,
CIM_EMPTY = 0,
CIM_SINT16 = 2,
CIM_SINT32 = 3,
CIM_REAL32 = 4,
CIM_REAL64 = 5,
CIM_STRING = 8,
CIM_BOOLEAN = 11,
CIM_OBJECT = 13,
CIM_SINT8 = 16,
CIM_UINT8 = 17,
CIM_UINT16 = 18,
CIM_UINT32 = 19,
CIM_SINT64 = 20,
CIM_UINT64 = 21,
CIM_DATETIME = 101,
CIM_REFERENCE = 102,
CIM_CHAR16 = 103,
CIM_FLAG_ARRAY = 0x2000
} CIMTYPE_ENUMERATION;
typedef long CIMTYPE;
[
object,
restricted,
@ -214,6 +290,24 @@ interface IWbemStatusCodeText : IUnknown
[out] BSTR *MessageText);
};
typedef [v1_enum] enum tag_WBEM_GENERIC_FLAG_TYPE
{
WBEM_FLAG_RETURN_WBEM_COMPLETE = 0,
WBEM_FLAG_BIDIRECTIONAL = 0,
WBEM_FLAG_RETURN_ERROR_OBJECT = 0,
WBEM_FLAG_DONT_SEND_STATUS = 0,
WBEM_FLAG_SEND_ONLY_SELECTED = 0,
WBEM_FLAG_RETURN_IMMEDIATELY = 0x10,
WBEM_FLAG_FORWARD_ONLY = 0x20,
WBEM_FLAG_NO_ERROR_OBJECT = 0x40,
WBEM_FLAG_SEND_STATUS = 0x80,
WBEM_FLAG_ENSURE_LOCATABLE = 0x100,
WBEM_FLAG_DIRECT_READ = 0x200,
WBEM_MASK_RESERVED_FLAGS = 0x1f000,
WBEM_FLAG_USE_AMENDED_QUALIFIERS = 0x20000,
WBEM_FLAG_STRONG_VALIDATION = 0x100000
} WBEM_GENERIC_FLAG_TYPE;
[
object,
restricted,
@ -393,3 +487,151 @@ interface IEnumWbemClassObject : IUnknown
[in] long lTimeout,
[in] ULONG nCount);
};
[
object,
restricted,
local,
uuid(dc12a681-737f-11cf-884d-00aa004b2e24)
]
interface IWbemClassObject : IUnknown
{
HRESULT GetQualifierSet(
[out] IWbemQualifierSet **ppQualSet);
HRESULT Get(
[in,string] LPCWSTR wszName,
[in] long lFlags,
[out] VARIANT *pVal,
[out] CIMTYPE *pType,
[out] long *plFlavor);
HRESULT Put(
[in,string] LPCWSTR wszName,
[in] long lFlags,
[in] VARIANT *pVal,
[in] CIMTYPE Type);
HRESULT Delete(
[in,string] LPCWSTR wszName);
HRESULT GetNames(
[in,string] LPCWSTR wszQualifierName,
[in] long lFlags,
[in] VARIANT *pQualifierVal,
[out] SAFEARRAY **pNames);
HRESULT BeginEnumeration(
[in] long lEnumFlags);
HRESULT Next(
[in] long lFlags,
[out] BSTR *strName,
[out] VARIANT *pVal,
[out] CIMTYPE *pType,
[out] long *plFlavor);
HRESULT EndEnumeration();
HRESULT GetPropertyQualifierSet(
[in,string] LPCWSTR wszProperty,
[out] IWbemQualifierSet **ppQualSet);
HRESULT Clone(
[out] IWbemClassObject **ppCopy);
HRESULT GetObjectText(
[in] long lFlags,
[out] BSTR *pstrObjectText);
HRESULT SpawnDerivedClass(
[in] long lFlags,
[out] IWbemClassObject **ppNewClass);
HRESULT SpawnInstance(
[in] long lFlags,
[out] IWbemClassObject **ppNewInstance);
HRESULT CompareTo(
[in] long lFlags,
[in] IWbemClassObject *pCompareTo);
HRESULT GetPropertyOrigin(
[in,string] LPCWSTR wszName,
[out] BSTR *pstrClassName);
HRESULT InheritsFrom(
[in] LPCWSTR strAncestor);
HRESULT GetMethod(
[in,string] LPCWSTR wszName,
[in] long lFlags,
[out] IWbemClassObject **ppInSignature,
[out] IWbemClassObject **ppOutSignature);
HRESULT PutMethod(
[in,string] LPCWSTR wszName,
[in] long lFlags,
[in] IWbemClassObject *pInSignature,
[in] IWbemClassObject *pOutSignature);
HRESULT DeleteMethod(
[in,string] LPCWSTR wszName);
HRESULT BeginMethodEnumeration(
[in] long lEnumFlags);
HRESULT NextMethod(
[in] long lFlags,
[out] BSTR *pstrName,
[out] IWbemClassObject **ppInSignature,
[out] IWbemClassObject **ppOutSignature);
HRESULT EndMethodEnumeration();
HRESULT GetMethodQualifierSet(
[in,string] LPCWSTR wszMethod,
[out] IWbemQualifierSet **ppQualSet);
HRESULT GetMethodOrigin(
[in,string] LPCWSTR wszMethodName,
[out] BSTR *pstrClassName);
}
[
object,
restricted,
local,
uuid(dc12a680-737f-11cf-884d-00aa004b2e24)
]
interface IWbemQualifierSet : IUnknown
{
HRESULT Get(
[in,string] LPCWSTR wszName,
[in] long lFlags,
[out] VARIANT *pVal,
[out] long *plFlavor);
HRESULT Put(
[in,string] LPCWSTR wszName,
[in] VARIANT *pVal,
[in] long lFlavor);
HRESULT Delete(
[in,string] LPCWSTR wszName);
HRESULT GetNames(
[in] long lFlags,
[out] SAFEARRAY **pNames);
HRESULT BeginEnumeration(
[in] long lFlags);
HRESULT Next(
[in] long lFlags,
[out] BSTR *pstrName,
[out] VARIANT *pVal,
[out] long *plFlavor);
HRESULT EndEnumeration();
};

View file

@ -0,0 +1,28 @@
/*
* Copyright 2012 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
*/
[
uuid(092df710-7010-11d1-ad90-00c04fd8fdff)
]
library WbemProviders_v1
{
[
uuid(cb8555cc-9128-11d1-ad9b-00c04fd8fdff)
]
coclass WbemAdministrativeLocator { interface IWbemLocator; }
}

View file

@ -1084,19 +1084,17 @@ typedef struct _RTL_RWLOCK {
typedef struct _SYSTEM_BASIC_INFORMATION {
#ifdef __WINESRC__
DWORD dwUnknown1;
ULONG uKeMaximumIncrement;
ULONG uPageSize;
ULONG uMmNumberOfPhysicalPages;
ULONG uMmLowestPhysicalPage;
ULONG uMmHighestPhysicalPage;
ULONG uAllocationGranularity;
PVOID pLowestUserAddress;
PVOID pMmHighestUserAddress;
ULONG uKeActiveProcessors;
BYTE bKeNumberProcessors;
BYTE bUnknown2;
WORD wUnknown3;
DWORD unknown;
ULONG KeMaximumIncrement;
ULONG PageSize;
ULONG MmNumberOfPhysicalPages;
ULONG MmLowestPhysicalPage;
ULONG MmHighestPhysicalPage;
ULONG_PTR AllocationGranularity;
PVOID LowestUserAddress;
PVOID HighestUserAddress;
ULONG_PTR ActiveProcessorsAffinityMask;
BYTE NumberOfProcessors;
#else
BYTE Reserved1[24];
PVOID Reserved2[4];

View file

@ -187,6 +187,7 @@ reactos/dll/win32/usp10 # Synced to Wine-1.5.26
reactos/dll/win32/uxtheme # Forked
reactos/dll/win32/vbscript # Synced to Wine-1.5.26
reactos/dll/win32/version # Autosync
reactos/dll/win32/wbemprox # Synced to Wine-1.5.26
reactos/dll/win32/wer # Autosync
reactos/dll/win32/windowscodecs # Synced to Wine-1.5.26
reactos/dll/win32/winemp3.acm # Synced to Wine-1.5.19

View file

@ -98,6 +98,7 @@ AddReg=Classes
11,,wininet.dll,2
11,,wintrust.dll,1
11,,wuapi.dll,1
11,wbem,wbemprox.dll,1
[TypeLibraries]
stdole2.tlb