ReactOS  0.4.14-dev-337-gf981a68
recinfo.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "oaidl.h"
#include "oleauto.h"
#include "variant.h"
#include "wine/unicode.h"
#include "wine/debug.h"
Include dependency graph for recinfo.c:

Go to the source code of this file.

Classes

struct  fieldstr
 
struct  IRecordInfoImpl
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define CASE_COPY(x)
 
#define CASE_COPY(x)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static IRecordInfoImplimpl_from_IRecordInfo (IRecordInfo *iface)
 
static HRESULT copy_to_variant (void *src, VARIANT *pvar, enum VARENUM vt)
 
static HRESULT copy_from_variant (VARIANT *src, void *dest, enum VARENUM vt)
 
static HRESULT WINAPI IRecordInfoImpl_QueryInterface (IRecordInfo *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IRecordInfoImpl_AddRef (IRecordInfo *iface)
 
static ULONG WINAPI IRecordInfoImpl_Release (IRecordInfo *iface)
 
static HRESULT WINAPI IRecordInfoImpl_RecordInit (IRecordInfo *iface, PVOID pvNew)
 
static HRESULT WINAPI IRecordInfoImpl_RecordClear (IRecordInfo *iface, PVOID pvExisting)
 
static HRESULT WINAPI IRecordInfoImpl_RecordCopy (IRecordInfo *iface, void *src_rec, void *dest_rec)
 
static HRESULT WINAPI IRecordInfoImpl_GetGuid (IRecordInfo *iface, GUID *pguid)
 
static HRESULT WINAPI IRecordInfoImpl_GetName (IRecordInfo *iface, BSTR *pbstrName)
 
static HRESULT WINAPI IRecordInfoImpl_GetSize (IRecordInfo *iface, ULONG *pcbSize)
 
static HRESULT WINAPI IRecordInfoImpl_GetTypeInfo (IRecordInfo *iface, ITypeInfo **ppTypeInfo)
 
static HRESULT WINAPI IRecordInfoImpl_GetField (IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy (IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray)
 
static HRESULT WINAPI IRecordInfoImpl_PutField (IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy (IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
 
static HRESULT WINAPI IRecordInfoImpl_GetFieldNames (IRecordInfo *iface, ULONG *pcNames, BSTR *rgBstrNames)
 
static BOOL WINAPI IRecordInfoImpl_IsMatchingType (IRecordInfo *iface, IRecordInfo *info2)
 
static PVOID WINAPI IRecordInfoImpl_RecordCreate (IRecordInfo *iface)
 
static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy (IRecordInfo *iface, PVOID pvSource, PVOID *ppvDest)
 
static HRESULT WINAPI IRecordInfoImpl_RecordDestroy (IRecordInfo *iface, PVOID pvRecord)
 
HRESULT WINAPI GetRecordInfoFromGuids (REFGUID rGuidTypeLib, ULONG uVerMajor, ULONG uVerMinor, LCID lcid, REFGUID rGuidTypeInfo, IRecordInfo **ppRecInfo)
 
HRESULT WINAPI GetRecordInfoFromTypeInfo (ITypeInfo *pTI, IRecordInfo **ppRecInfo)
 

Variables

static const IRecordInfoVtbl IRecordInfoImplVtbl
 

Macro Definition Documentation

◆ CASE_COPY [1/2]

#define CASE_COPY (   x)
Value:
case VT_ ## x: \
memcpy(&V_ ## x(pvar), src, sizeof(V_ ## x(pvar))); \
break
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLenum src
Definition: glext.h:6340

◆ CASE_COPY [2/2]

#define CASE_COPY (   x)
Value:
case VT_ ## x: \
memcpy(dest, &V_ ## x(&var), sizeof(V_ ## x(&var))); \
break
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static char * dest
Definition: rtl.c:135

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file recinfo.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 22 of file recinfo.c.

Function Documentation

◆ copy_from_variant()

static HRESULT copy_from_variant ( VARIANT src,
void dest,
enum VARENUM  vt 
)
static

Definition at line 101 of file recinfo.c.

102 {
103  VARIANT var;
104  HRESULT hres;
105 
106  TRACE("(%p(%d) %p %d)\n", src, V_VT(src), dest, vt);
107 
108  hres = VariantChangeType(&var, src, 0, vt);
109  if(FAILED(hres))
110  return hres;
111 
112 #define CASE_COPY(x) \
113  case VT_ ## x: \
114  memcpy(dest, &V_ ## x(&var), sizeof(V_ ## x(&var))); \
115  break
116 
117  switch(vt) {
118  CASE_COPY(I2);
119  CASE_COPY(I4);
120  CASE_COPY(R4);
121  CASE_COPY(R8);
122  CASE_COPY(CY);
123  CASE_COPY(DATE);
124  CASE_COPY(BSTR);
125  CASE_COPY(ERROR);
126  CASE_COPY(BOOL);
128  CASE_COPY(I1);
129  CASE_COPY(UI1);
130  CASE_COPY(UI2);
131  CASE_COPY(UI4);
132  CASE_COPY(I8);
133  CASE_COPY(UI8);
134  CASE_COPY(INT);
135  CASE_COPY(UINT);
138  default:
139  FIXME("Not supported type: %d\n", V_VT(&var));
140  return E_NOTIMPL;
141  };
142 #undef CASE_COPY
143  return S_OK;
144 }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
#define ERROR(name)
Definition: error_private.h:53
double DATE
Definition: compat.h:1902
OLECHAR * BSTR
Definition: compat.h:1942
#define CASE_COPY(x)
int32_t INT_PTR
Definition: typedefs.h:62
int32_t INT
Definition: typedefs.h:56
Definition: compat.h:1904
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define V_VT(A)
Definition: oleauto.h:211
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define R4(v, w, x, y, z, i)
Definition: sha1.c:39
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
static char * dest
Definition: rtl.c:135

Referenced by IRecordInfoImpl_PutField().

◆ copy_to_variant()

static HRESULT copy_to_variant ( void src,
VARIANT pvar,
enum VARENUM  vt 
)
static

Definition at line 61 of file recinfo.c.

62 {
63  TRACE("%p %p %d\n", src, pvar, vt);
64 
65 #define CASE_COPY(x) \
66  case VT_ ## x: \
67  memcpy(&V_ ## x(pvar), src, sizeof(V_ ## x(pvar))); \
68  break
69 
70  switch(vt) {
71  CASE_COPY(I2);
72  CASE_COPY(I4);
73  CASE_COPY(R4);
74  CASE_COPY(R8);
75  CASE_COPY(CY);
76  CASE_COPY(DATE);
77  CASE_COPY(BSTR);
79  CASE_COPY(BOOL);
81  CASE_COPY(I1);
82  CASE_COPY(UI1);
83  CASE_COPY(UI2);
84  CASE_COPY(UI4);
85  CASE_COPY(I8);
86  CASE_COPY(UI8);
87  CASE_COPY(INT);
88  CASE_COPY(UINT);
91  default:
92  FIXME("Not supported type: %d\n", vt);
93  return E_NOTIMPL;
94  };
95 #undef CASE_COPY
96 
97  V_VT(pvar) = vt;
98  return S_OK;
99 }
#define ERROR(name)
Definition: error_private.h:53
double DATE
Definition: compat.h:1902
OLECHAR * BSTR
Definition: compat.h:1942
#define CASE_COPY(x)
int32_t INT_PTR
Definition: typedefs.h:62
int32_t INT
Definition: typedefs.h:56
Definition: compat.h:1904
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
Definition: suminfo.c:85
#define V_VT(A)
Definition: oleauto.h:211
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define R4(v, w, x, y, z, i)
Definition: sha1.c:39
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50

Referenced by IRecordInfoImpl_GetField().

◆ GetRecordInfoFromGuids()

HRESULT WINAPI GetRecordInfoFromGuids ( REFGUID  rGuidTypeLib,
ULONG  uVerMajor,
ULONG  uVerMinor,
LCID  lcid,
REFGUID  rGuidTypeInfo,
IRecordInfo **  ppRecInfo 
)

Definition at line 595 of file recinfo.c.

597 {
598  ITypeInfo *pTypeInfo;
599  ITypeLib *pTypeLib;
600  HRESULT hres;
601 
602  TRACE("(%p,%d,%d,%d,%s,%p)\n", rGuidTypeLib, uVerMajor, uVerMinor,
603  lcid, debugstr_guid(rGuidTypeInfo), ppRecInfo);
604 
605  hres = LoadRegTypeLib(rGuidTypeLib, uVerMajor, uVerMinor, lcid, &pTypeLib);
606  if(FAILED(hres)) {
607  WARN("LoadRegTypeLib failed!\n");
608  return hres;
609  }
610 
611  hres = ITypeLib_GetTypeInfoOfGuid(pTypeLib, rGuidTypeInfo, &pTypeInfo);
612  ITypeLib_Release(pTypeLib);
613  if(FAILED(hres)) {
614  WARN("GetTypeInfoOfGuid failed!\n");
615  return hres;
616  }
617 
618  hres = GetRecordInfoFromTypeInfo(pTypeInfo, ppRecInfo);
619  ITypeInfo_Release(pTypeInfo);
620  return hres;
621 }
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI GetRecordInfoFromTypeInfo(ITypeInfo *pTI, IRecordInfo **ppRecInfo)
Definition: recinfo.c:626
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:534

◆ GetRecordInfoFromTypeInfo()

HRESULT WINAPI GetRecordInfoFromTypeInfo ( ITypeInfo pTI,
IRecordInfo **  ppRecInfo 
)

Definition at line 626 of file recinfo.c.

626  {
627  HRESULT hres;
628  TYPEATTR *typeattr;
630  ITypeInfo *pTypeInfo;
631  int i;
632  GUID guid;
633 
634  TRACE("(%p %p)\n", pTI, ppRecInfo);
635 
636  if(!pTI || !ppRecInfo)
637  return E_INVALIDARG;
638 
639  hres = ITypeInfo_GetTypeAttr(pTI, &typeattr);
640  if(FAILED(hres) || !typeattr) {
641  WARN("GetTypeAttr failed: %08x\n", hres);
642  return hres;
643  }
644 
645  if(typeattr->typekind == TKIND_ALIAS) {
646  hres = ITypeInfo_GetRefTypeInfo(pTI, typeattr->tdescAlias.u.hreftype, &pTypeInfo);
647  guid = typeattr->guid;
648  ITypeInfo_ReleaseTypeAttr(pTI, typeattr);
649  if(FAILED(hres)) {
650  WARN("GetRefTypeInfo failed: %08x\n", hres);
651  return hres;
652  }
653  hres = ITypeInfo_GetTypeAttr(pTypeInfo, &typeattr);
654  if(FAILED(hres)) {
655  ITypeInfo_Release(pTypeInfo);
656  WARN("GetTypeAttr failed for referenced type: %08x\n", hres);
657  return hres;
658  }
659  }else {
660  pTypeInfo = pTI;
661  ITypeInfo_AddRef(pTypeInfo);
662  guid = typeattr->guid;
663  }
664 
665  if(typeattr->typekind != TKIND_RECORD) {
666  WARN("typekind != TKIND_RECORD\n");
667  ITypeInfo_ReleaseTypeAttr(pTypeInfo, typeattr);
668  ITypeInfo_Release(pTypeInfo);
669  return E_INVALIDARG;
670  }
671 
672  ret = HeapAlloc(GetProcessHeap(), 0, sizeof(*ret));
673  ret->IRecordInfo_iface.lpVtbl = &IRecordInfoImplVtbl;
674  ret->ref = 1;
675  ret->pTypeInfo = pTypeInfo;
676  ret->n_vars = typeattr->cVars;
677  ret->size = typeattr->cbSizeInstance;
678  ITypeInfo_ReleaseTypeAttr(pTypeInfo, typeattr);
679 
680  ret->guid = guid;
681 
682  /* NOTE: Windows implementation calls ITypeInfo::GetCantainingTypeLib and
683  * ITypeLib::GetLibAttr, but we currently don't need this.
684  */
685 
686  hres = ITypeInfo_GetDocumentation(pTypeInfo, MEMBERID_NIL, &ret->name, NULL, NULL, NULL);
687  if(FAILED(hres)) {
688  WARN("ITypeInfo::GetDocumentation failed\n");
689  ret->name = NULL;
690  }
691 
692  ret->fields = HeapAlloc(GetProcessHeap(), 0, ret->n_vars*sizeof(fieldstr));
693  for(i = 0; i<ret->n_vars; i++) {
694  VARDESC *vardesc;
695  hres = ITypeInfo_GetVarDesc(pTypeInfo, i, &vardesc);
696  if(FAILED(hres)) {
697  WARN("GetVarDesc failed\n");
698  continue;
699  }
700  ret->fields[i].vt = vardesc->elemdescVar.tdesc.vt;
701  ret->fields[i].varkind = vardesc->varkind;
702  ret->fields[i].offset = vardesc->u.oInst;
703  hres = ITypeInfo_GetDocumentation(pTypeInfo, vardesc->memid, &ret->fields[i].name,
704  NULL, NULL, NULL);
705  if(FAILED(hres))
706  WARN("GetDocumentation failed: %08x\n", hres);
707  TRACE("field=%s, offset=%d\n", debugstr_w(ret->fields[i].name), ret->fields[i].offset);
708  ITypeInfo_ReleaseVarDesc(pTypeInfo, vardesc);
709  }
710 
711  *ppRecInfo = &ret->IRecordInfo_iface;
712 
713  return S_OK;
714 }
static const IRecordInfoVtbl IRecordInfoImplVtbl
Definition: recinfo.c:566
#define WARN(fmt,...)
Definition: debug.h:111
#define MEMBERID_NIL
Definition: oleauto.h:1003
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const GUID * guid
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59

Referenced by GetRecordInfoFromGuids(), and test_recinfo().

◆ impl_from_IRecordInfo()

◆ IRecordInfoImpl_AddRef()

static ULONG WINAPI IRecordInfoImpl_AddRef ( IRecordInfo iface)
static

Definition at line 163 of file recinfo.c.

164 {
167  TRACE("(%p) -> %d\n", This, ref);
168  return ref;
169 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ IRecordInfoImpl_GetField()

static HRESULT WINAPI IRecordInfoImpl_GetField ( IRecordInfo iface,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 393 of file recinfo.c.

395 {
397  int i;
398 
399  TRACE("(%p)->(%p %s %p)\n", This, pvData, debugstr_w(szFieldName), pvarField);
400 
401  if(!pvData || !szFieldName || !pvarField)
402  return E_INVALIDARG;
403 
404  for(i=0; i<This->n_vars; i++)
405  if(!strcmpW(This->fields[i].name, szFieldName))
406  break;
407  if(i == This->n_vars)
408  return TYPE_E_FIELDNOTFOUND;
409 
410  VariantClear(pvarField);
411  return copy_to_variant(((PBYTE)pvData)+This->fields[i].offset, pvarField,
412  This->fields[i].vt);
413 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TYPE_E_FIELDNOTFOUND
Definition: winerror.h:2530
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
static HRESULT copy_to_variant(void *src, VARIANT *pvar, enum VARENUM vt)
Definition: recinfo.c:61
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
BYTE * PBYTE
Definition: pedump.c:66

◆ IRecordInfoImpl_GetFieldNames()

static HRESULT WINAPI IRecordInfoImpl_GetFieldNames ( IRecordInfo iface,
ULONG pcNames,
BSTR rgBstrNames 
)
static

Definition at line 488 of file recinfo.c.

490 {
492  ULONG n = This->n_vars, i;
493 
494  TRACE("(%p)->(%p %p)\n", This, pcNames, rgBstrNames);
495 
496  if(!pcNames)
497  return E_INVALIDARG;
498 
499  if(*pcNames < n)
500  n = *pcNames;
501 
502  if(rgBstrNames) {
503  for(i=0; i<n; i++)
504  rgBstrNames[i] = SysAllocString(This->fields[i].name);
505  }
506 
507  *pcNames = n;
508  return S_OK;
509 }
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_INVALIDARG
Definition: ddrawi.h:101
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1

◆ IRecordInfoImpl_GetFieldNoCopy()

static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy ( IRecordInfo iface,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField,
PVOID ppvDataCArray 
)
static

Definition at line 415 of file recinfo.c.

417 {
419  int i;
420 
421  TRACE("(%p)->(%p %s %p %p)\n", This, pvData, debugstr_w(szFieldName), pvarField, ppvDataCArray);
422 
423  if(!pvData || !szFieldName || !pvarField)
424  return E_INVALIDARG;
425 
426  for(i=0; i<This->n_vars; i++)
427  if(!strcmpW(This->fields[i].name, szFieldName))
428  break;
429  if(i == This->n_vars)
430  return TYPE_E_FIELDNOTFOUND;
431 
432  VariantClear(pvarField);
433  V_VT(pvarField) = VT_BYREF|This->fields[i].vt;
434  V_BYREF(pvarField) = ((PBYTE)pvData)+This->fields[i].offset;
435  *ppvDataCArray = NULL;
436  return S_OK;
437 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TYPE_E_FIELDNOTFOUND
Definition: winerror.h:2530
#define debugstr_w
Definition: kernel32.h:32
#define V_BYREF(A)
Definition: oleauto.h:228
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
smooth NULL
Definition: ftsmooth.c:416
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
BYTE * PBYTE
Definition: pedump.c:66

◆ IRecordInfoImpl_GetGuid()

static HRESULT WINAPI IRecordInfoImpl_GetGuid ( IRecordInfo iface,
GUID pguid 
)
static

Definition at line 339 of file recinfo.c.

340 {
342 
343  TRACE("(%p)->(%p)\n", This, pguid);
344 
345  if(!pguid)
346  return E_INVALIDARG;
347 
348  *pguid = This->guid;
349  return S_OK;
350 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ IRecordInfoImpl_GetName()

static HRESULT WINAPI IRecordInfoImpl_GetName ( IRecordInfo iface,
BSTR pbstrName 
)
static

Definition at line 352 of file recinfo.c.

353 {
355 
356  TRACE("(%p)->(%p)\n", This, pbstrName);
357 
358  if(!pbstrName)
359  return E_INVALIDARG;
360 
361  *pbstrName = SysAllocString(This->name);
362  return S_OK;
363 }
#define E_INVALIDARG
Definition: ddrawi.h:101
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ IRecordInfoImpl_GetSize()

static HRESULT WINAPI IRecordInfoImpl_GetSize ( IRecordInfo iface,
ULONG pcbSize 
)
static

Definition at line 365 of file recinfo.c.

366 {
368 
369  TRACE("(%p)->(%p)\n", This, pcbSize);
370 
371  if(!pcbSize)
372  return E_INVALIDARG;
373 
374  *pcbSize = This->size;
375  return S_OK;
376 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ IRecordInfoImpl_GetTypeInfo()

static HRESULT WINAPI IRecordInfoImpl_GetTypeInfo ( IRecordInfo iface,
ITypeInfo **  ppTypeInfo 
)
static

Definition at line 378 of file recinfo.c.

379 {
381 
382  TRACE("(%p)->(%p)\n", This, ppTypeInfo);
383 
384  if(!ppTypeInfo)
385  return E_INVALIDARG;
386 
387  ITypeInfo_AddRef(This->pTypeInfo);
388  *ppTypeInfo = This->pTypeInfo;
389 
390  return S_OK;
391 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ IRecordInfoImpl_IsMatchingType()

static BOOL WINAPI IRecordInfoImpl_IsMatchingType ( IRecordInfo iface,
IRecordInfo info2 
)
static

Definition at line 511 of file recinfo.c.

512 {
514  GUID guid2;
515 
516  TRACE( "(%p)->(%p)\n", This, info2 );
517 
518  IRecordInfo_GetGuid( info2, &guid2 );
519  return IsEqualGUID( &This->guid, &guid2 );
520 }
static GUID guid2
Definition: devinst.c:42
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ IRecordInfoImpl_PutField()

static HRESULT WINAPI IRecordInfoImpl_PutField ( IRecordInfo iface,
ULONG  wFlags,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 439 of file recinfo.c.

441 {
443  int i;
444 
445  TRACE("(%p)->(%08x %p %s %p)\n", This, wFlags, pvData, debugstr_w(szFieldName),
446  pvarField);
447 
448  if(!pvData || !szFieldName || !pvarField
449  || (wFlags != INVOKE_PROPERTYPUTREF && wFlags != INVOKE_PROPERTYPUT))
450  return E_INVALIDARG;
451 
452  if(wFlags == INVOKE_PROPERTYPUTREF) {
453  FIXME("wFlag == INVOKE_PROPERTYPUTREF not supported\n");
454  return E_NOTIMPL;
455  }
456 
457  for(i=0; i<This->n_vars; i++)
458  if(!strcmpW(This->fields[i].name, szFieldName))
459  break;
460  if(i == This->n_vars)
461  return TYPE_E_FIELDNOTFOUND;
462 
463  return copy_from_variant(pvarField, ((PBYTE)pvData)+This->fields[i].offset,
464  This->fields[i].vt);
465 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TYPE_E_FIELDNOTFOUND
Definition: winerror.h:2530
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
static HRESULT copy_from_variant(VARIANT *src, void *dest, enum VARENUM vt)
Definition: recinfo.c:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define E_NOTIMPL
Definition: ddrawi.h:99
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
BYTE * PBYTE
Definition: pedump.c:66

◆ IRecordInfoImpl_PutFieldNoCopy()

static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy ( IRecordInfo iface,
ULONG  wFlags,
PVOID  pvData,
LPCOLESTR  szFieldName,
VARIANT pvarField 
)
static

Definition at line 467 of file recinfo.c.

469 {
471  int i;
472 
473  FIXME("(%p)->(%08x %p %s %p) stub\n", This, wFlags, pvData, debugstr_w(szFieldName), pvarField);
474 
475  if(!pvData || !szFieldName || !pvarField
476  || (wFlags != INVOKE_PROPERTYPUTREF && wFlags != INVOKE_PROPERTYPUT))
477  return E_INVALIDARG;
478 
479  for(i=0; i<This->n_vars; i++)
480  if(!strcmpW(This->fields[i].name, szFieldName))
481  break;
482  if(i == This->n_vars)
483  return TYPE_E_FIELDNOTFOUND;
484 
485  return E_NOTIMPL;
486 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TYPE_E_FIELDNOTFOUND
Definition: winerror.h:2530
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3748
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define E_NOTIMPL
Definition: ddrawi.h:99
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

◆ IRecordInfoImpl_QueryInterface()

static HRESULT WINAPI IRecordInfoImpl_QueryInterface ( IRecordInfo iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 146 of file recinfo.c.

148 {
149  TRACE("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppvObject);
150 
151  *ppvObject = NULL;
152 
153  if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IRecordInfo, riid)) {
154  *ppvObject = iface;
155  IRecordInfo_AddRef(iface);
156  return S_OK;
157  }
158 
159  FIXME("Not supported interface: %s\n", debugstr_guid(riid));
160  return E_NOINTERFACE;
161 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ IRecordInfoImpl_RecordClear()

static HRESULT WINAPI IRecordInfoImpl_RecordClear ( IRecordInfo iface,
PVOID  pvExisting 
)
static

Definition at line 202 of file recinfo.c.

203 {
205  int i;
206  PVOID var;
207 
208  TRACE("(%p)->(%p)\n", This, pvExisting);
209 
210  if(!pvExisting)
211  return E_INVALIDARG;
212 
213  for(i=0; i<This->n_vars; i++) {
214  if(This->fields[i].varkind != VAR_PERINSTANCE) {
215  ERR("varkind != VAR_PERINSTANCE\n");
216  continue;
217  }
218  var = ((PBYTE)pvExisting)+This->fields[i].offset;
219  switch(This->fields[i].vt) {
220  case VT_BSTR:
221  SysFreeString(*(BSTR*)var);
222  *(BSTR*)var = NULL;
223  break;
224  case VT_I2:
225  case VT_I4:
226  case VT_R4:
227  case VT_R8:
228  case VT_CY:
229  case VT_DATE:
230  case VT_ERROR:
231  case VT_BOOL:
232  case VT_DECIMAL:
233  case VT_I1:
234  case VT_UI1:
235  case VT_UI2:
236  case VT_UI4:
237  case VT_I8:
238  case VT_UI8:
239  case VT_INT:
240  case VT_UINT:
241  case VT_HRESULT:
242  break;
243  case VT_INT_PTR:
244  case VT_UINT_PTR:
245  *(void**)var = NULL;
246  break;
247  case VT_SAFEARRAY:
248  SafeArrayDestroy(var);
249  break;
250  case VT_UNKNOWN:
251  case VT_DISPATCH:
252  {
253  IUnknown *unk = *(IUnknown**)var;
254  if (unk)
255  IUnknown_Release(unk);
256  *(void**)var = NULL;
257  break;
258  }
259  default:
260  FIXME("Not supported vt = %d\n", This->fields[i].vt);
261  break;
262  }
263  }
264 
265  return S_OK;
266 }
Definition: compat.h:1947
Definition: compat.h:1963
Definition: compat.h:1959
OLECHAR * BSTR
Definition: compat.h:1942
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1349
Definition: compat.h:1948
Definition: compat.h:1950
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
BYTE * PBYTE
Definition: pedump.c:66
Definition: compat.h:1949
Definition: compat.h:1946

◆ IRecordInfoImpl_RecordCopy()

static HRESULT WINAPI IRecordInfoImpl_RecordCopy ( IRecordInfo iface,
void src_rec,
void dest_rec 
)
static

Definition at line 268 of file recinfo.c.

269 {
271  HRESULT hr = S_OK;
272  int i;
273 
274  TRACE("(%p)->(%p %p)\n", This, src_rec, dest_rec);
275 
276  if(!src_rec || !dest_rec)
277  return E_INVALIDARG;
278 
279  /* release already stored data */
280  IRecordInfo_RecordClear(iface, dest_rec);
281 
282  for (i = 0; i < This->n_vars; i++)
283  {
284  void *src, *dest;
285 
286  if (This->fields[i].varkind != VAR_PERINSTANCE) {
287  ERR("varkind != VAR_PERINSTANCE\n");
288  continue;
289  }
290 
291  src = ((BYTE*)src_rec) + This->fields[i].offset;
292  dest = ((BYTE*)dest_rec) + This->fields[i].offset;
293  switch (This->fields[i].vt)
294  {
295  case VT_BSTR:
296  {
297  BSTR src_str = *(BSTR*)src;
298 
299  if (src_str)
300  {
302  if (!str) hr = E_OUTOFMEMORY;
303 
304  *(BSTR*)dest = str;
305  }
306  else
307  *(BSTR*)dest = NULL;
308  break;
309  }
310  case VT_UNKNOWN:
311  case VT_DISPATCH:
312  {
313  IUnknown *unk = *(IUnknown**)src;
314  *(IUnknown**)dest = unk;
315  if (unk) IUnknown_AddRef(unk);
316  break;
317  }
318  case VT_SAFEARRAY:
319  hr = SafeArrayCopy(src, dest);
320  break;
321  default:
322  {
323  /* copy directly for types that don't need deep copy */
324  int len = get_type_size(NULL, This->fields[i].vt);
325  memcpy(dest, src, len);
326  break;
327  }
328  }
329 
330  if (FAILED(hr)) break;
331  }
332 
333  if (FAILED(hr))
334  IRecordInfo_RecordClear(iface, dest_rec);
335 
336  return hr;
337 }
HRESULT hr
Definition: shlfolder.c:183
OLECHAR * BSTR
Definition: compat.h:1942
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int get_type_size(ULONG *pFlags, VARTYPE vt)
Definition: usrmarshal.c:209
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI SafeArrayCopy(SAFEARRAY *psa, SAFEARRAY **ppsaOut)
Definition: safearray.c:1381
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
static char * dest
Definition: rtl.c:135

◆ IRecordInfoImpl_RecordCreate()

static PVOID WINAPI IRecordInfoImpl_RecordCreate ( IRecordInfo iface)
static

Definition at line 522 of file recinfo.c.

523 {
525  void *record;
526 
527  TRACE("(%p)\n", This);
528 
529  record = HeapAlloc(GetProcessHeap(), 0, This->size);
530  IRecordInfo_RecordInit(iface, record);
531  TRACE("created record at %p\n", record);
532  return record;
533 }
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)

◆ IRecordInfoImpl_RecordCreateCopy()

static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy ( IRecordInfo iface,
PVOID  pvSource,
PVOID ppvDest 
)
static

Definition at line 535 of file recinfo.c.

537 {
539 
540  TRACE("(%p)->(%p %p)\n", This, pvSource, ppvDest);
541 
542  if(!pvSource || !ppvDest)
543  return E_INVALIDARG;
544 
545  *ppvDest = IRecordInfo_RecordCreate(iface);
546  return IRecordInfo_RecordCopy(iface, pvSource, *ppvDest);
547 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4

◆ IRecordInfoImpl_RecordDestroy()

static HRESULT WINAPI IRecordInfoImpl_RecordDestroy ( IRecordInfo iface,
PVOID  pvRecord 
)
static

Definition at line 549 of file recinfo.c.

550 {
552  HRESULT hres;
553 
554  TRACE("(%p)->(%p)\n", This, pvRecord);
555 
556  hres = IRecordInfo_RecordClear(iface, pvRecord);
557  if(FAILED(hres))
558  return hres;
559 
560  if(!HeapFree(GetProcessHeap(), 0, pvRecord))
561  return E_INVALIDARG;
562 
563  return S_OK;
564 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define GetProcessHeap()
Definition: compat.h:403
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ IRecordInfoImpl_RecordInit()

static HRESULT WINAPI IRecordInfoImpl_RecordInit ( IRecordInfo iface,
PVOID  pvNew 
)
static

Definition at line 190 of file recinfo.c.

191 {
193  TRACE("(%p)->(%p)\n", This, pvNew);
194 
195  if(!pvNew)
196  return E_INVALIDARG;
197 
198  memset(pvNew, 0, This->size);
199  return S_OK;
200 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define memset(x, y, z)
Definition: compat.h:39

◆ IRecordInfoImpl_Release()

static ULONG WINAPI IRecordInfoImpl_Release ( IRecordInfo iface)
static

Definition at line 171 of file recinfo.c.

172 {
175 
176  TRACE("(%p) -> %d\n", This, ref);
177 
178  if(!ref) {
179  int i;
180  for(i=0; i<This->n_vars; i++)
181  SysFreeString(This->fields[i].name);
182  SysFreeString(This->name);
183  HeapFree(GetProcessHeap(), 0, This->fields);
184  ITypeInfo_Release(This->pTypeInfo);
186  }
187  return ref;
188 }
Definition: send.c:47
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLenum GLint ref
Definition: glext.h:6028
static IRecordInfoImpl * impl_from_IRecordInfo(IRecordInfo *iface)
Definition: recinfo.c:56
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
#define InterlockedDecrement
Definition: armddk.h:52
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ IRecordInfoImplVtbl

const IRecordInfoVtbl IRecordInfoImplVtbl
static
Initial value:
= {
}
static HRESULT WINAPI IRecordInfoImpl_GetFieldNames(IRecordInfo *iface, ULONG *pcNames, BSTR *rgBstrNames)
Definition: recinfo.c:488
static HRESULT WINAPI IRecordInfoImpl_QueryInterface(IRecordInfo *iface, REFIID riid, void **ppvObject)
Definition: recinfo.c:146
static HRESULT WINAPI IRecordInfoImpl_PutField(IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
Definition: recinfo.c:439
static HRESULT WINAPI IRecordInfoImpl_GetTypeInfo(IRecordInfo *iface, ITypeInfo **ppTypeInfo)
Definition: recinfo.c:378
static HRESULT WINAPI IRecordInfoImpl_RecordClear(IRecordInfo *iface, PVOID pvExisting)
Definition: recinfo.c:202
static ULONG WINAPI IRecordInfoImpl_AddRef(IRecordInfo *iface)
Definition: recinfo.c:163
static HRESULT WINAPI IRecordInfoImpl_GetGuid(IRecordInfo *iface, GUID *pguid)
Definition: recinfo.c:339
static HRESULT WINAPI IRecordInfoImpl_RecordCopy(IRecordInfo *iface, void *src_rec, void *dest_rec)
Definition: recinfo.c:268
static HRESULT WINAPI IRecordInfoImpl_PutFieldNoCopy(IRecordInfo *iface, ULONG wFlags, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
Definition: recinfo.c:467
static HRESULT WINAPI IRecordInfoImpl_GetName(IRecordInfo *iface, BSTR *pbstrName)
Definition: recinfo.c:352
static HRESULT WINAPI IRecordInfoImpl_RecordDestroy(IRecordInfo *iface, PVOID pvRecord)
Definition: recinfo.c:549
static HRESULT WINAPI IRecordInfoImpl_GetFieldNoCopy(IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField, PVOID *ppvDataCArray)
Definition: recinfo.c:415
static HRESULT WINAPI IRecordInfoImpl_GetField(IRecordInfo *iface, PVOID pvData, LPCOLESTR szFieldName, VARIANT *pvarField)
Definition: recinfo.c:393
static HRESULT WINAPI IRecordInfoImpl_RecordCreateCopy(IRecordInfo *iface, PVOID pvSource, PVOID *ppvDest)
Definition: recinfo.c:535
static ULONG WINAPI IRecordInfoImpl_Release(IRecordInfo *iface)
Definition: recinfo.c:171
static BOOL WINAPI IRecordInfoImpl_IsMatchingType(IRecordInfo *iface, IRecordInfo *info2)
Definition: recinfo.c:511
static HRESULT WINAPI IRecordInfoImpl_GetSize(IRecordInfo *iface, ULONG *pcbSize)
Definition: recinfo.c:365
static HRESULT WINAPI IRecordInfoImpl_RecordInit(IRecordInfo *iface, PVOID pvNew)
Definition: recinfo.c:190
static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface)
Definition: recinfo.c:522

Definition at line 566 of file recinfo.c.

Referenced by GetRecordInfoFromTypeInfo().