ReactOS  0.4.14-dev-552-g2fad488
propidl.idl File Reference

Go to the source code of this file.

Classes

interface  IPropertyStorage
 
struct  IPropertyStorage::tagPROPVARIANT
 
struct  IPropertyStorage::tagPROPSPEC
 
struct  IPropertyStorage::tagSTATPROPSTG
 
struct  IPropertyStorage::tagSTATPROPSETSTG
 
interface  IPropertySetStorage
 
interface  IEnumSTATPROPSTG
 
interface  struct
 

Macros

#define TYPEDEF_CA(type, name)
 

Functions

HRESULT WINAPI FreePropVariantArray (ULONG, PROPVARIANT *)
 
HRESULT WINAPI PropVariantClear (PROPVARIANT *)
 
HRESULT WINAPI PropVariantCopy (PROPVARIANT *, const PROPVARIANT *)
 
_STGCREATEPROPSTG_DEFINED_(p) HRESULT WINAPI StgCreatePropStg (IUnknown *, REFFMTID, const CLSID *, DWORD, DWORD, IPropertyStorage **)
 
HRESULT WINAPI StgOpenPropStg (IUnknown *, REFFMTID, DWORD, DWORD, IPropertyStorage **)
 
HRESULT WINAPI StgCreatePropSetStg (IStorage *, DWORD, IPropertySetStorage **)
 
CCH_MAX_PROPSTG_NAME HRESULT WINAPI FmtIdToPropStgName (const FMTID *, LPOLESTR)
 
HRESULT WINAPI PropStgNameToFmtId (const LPOLESTR, FMTID *)
 

Variables

BYTE rgb [1]
 
 SERIALIZEDPROPERTYVALUE
 

Macro Definition Documentation

◆ TYPEDEF_CA

#define TYPEDEF_CA (   type,
  name 
)
Value:
typedef struct tag##name { \
ULONG cElems; \
[size_is(cElems)] \
type *pElems; \
} name
Definition: ecma_167.h:138
Definition: name.c:38

Definition at line 81 of file propidl.idl.

Function Documentation

◆ FmtIdToPropStgName()

CCH_MAX_PROPSTG_NAME HRESULT WINAPI FmtIdToPropStgName ( const FMTID ,
LPOLESTR   
)

Definition at line 2635 of file stg_prop.c.

2636 {
2637  static const char fmtMap[] = "abcdefghijklmnopqrstuvwxyz012345";
2638 
2639  TRACE("%s, %p\n", debugstr_guid(rfmtid), str);
2640 
2641  if (!rfmtid) return E_INVALIDARG;
2642  if (!str) return E_INVALIDARG;
2643 
2644  if (IsEqualGUID(&FMTID_SummaryInformation, rfmtid))
2646  else if (IsEqualGUID(&FMTID_DocSummaryInformation, rfmtid))
2648  else if (IsEqualGUID(&FMTID_UserDefinedProperties, rfmtid))
2650  else
2651  {
2652  const BYTE *fmtptr;
2653  WCHAR *pstr = str;
2654  ULONG bitsRemaining = BITS_PER_BYTE;
2655 
2656  *pstr++ = 5;
2657  for (fmtptr = (const BYTE *)rfmtid; fmtptr < (const BYTE *)rfmtid + sizeof(FMTID); )
2658  {
2659  ULONG i = *fmtptr >> (BITS_PER_BYTE - bitsRemaining);
2660 
2661  if (bitsRemaining >= BITS_IN_CHARMASK)
2662  {
2663  *pstr = (WCHAR)(fmtMap[i & CHARMASK]);
2664  if (bitsRemaining == BITS_PER_BYTE && *pstr >= 'a' &&
2665  *pstr <= 'z')
2666  *pstr += 'A' - 'a';
2667  pstr++;
2668  bitsRemaining -= BITS_IN_CHARMASK;
2669  if (bitsRemaining == 0)
2670  {
2671  fmtptr++;
2672  bitsRemaining = BITS_PER_BYTE;
2673  }
2674  }
2675  else
2676  {
2677  if (++fmtptr < (const BYTE *)rfmtid + sizeof(FMTID))
2678  i |= *fmtptr << bitsRemaining;
2679  *pstr++ = (WCHAR)(fmtMap[i & CHARMASK]);
2680  bitsRemaining += BITS_PER_BYTE - BITS_IN_CHARMASK;
2681  }
2682  }
2683  *pstr = 0;
2684  }
2685  TRACE("returning %s\n", debugstr_w(str));
2686  return S_OK;
2687 }
GUID FMTID
Definition: guiddef.h:94
#define CHARMASK
Definition: stg_prop.c:2618
const FMTID FMTID_UserDefinedProperties
const FMTID FMTID_SummaryInformation
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 debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define BITS_IN_CHARMASK
Definition: stg_prop.c:2619
const FMTID FMTID_DocSummaryInformation
unsigned char BYTE
Definition: mem.h:68
static const WCHAR szSummaryInfo[]
Definition: stg_prop.c:2612
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
#define BITS_PER_BYTE
Definition: stg_prop.c:2617
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static const WCHAR szDocSummaryInfo[]
Definition: stg_prop.c:2614
unsigned int ULONG
Definition: retypes.h:1

Referenced by IPropertySetStorage_fnCreate(), IPropertySetStorage_fnDelete(), and IPropertySetStorage_fnOpen().

◆ FreePropVariantArray()

HRESULT WINAPI FreePropVariantArray ( ULONG  ,
PROPVARIANT *   
)

Definition at line 3267 of file ole2.c.

3269 {
3270  ULONG i;
3271 
3272  TRACE("(%u, %p)\n", cVariants, rgvars);
3273 
3274  if (!rgvars)
3275  return E_INVALIDARG;
3276 
3277  for(i = 0; i < cVariants; i++)
3278  PropVariantClear(&rgvars[i]);
3279 
3280  return S_OK;
3281 }
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: ole2.c:2968
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
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1

Referenced by PropVariantClear().

◆ PropStgNameToFmtId()

HRESULT WINAPI PropStgNameToFmtId ( const  LPOLESTR,
FMTID  
)

Definition at line 2700 of file stg_prop.c.

2701 {
2703 
2704  TRACE("%s, %p\n", debugstr_w(str), rfmtid);
2705 
2706  if (!rfmtid) return E_INVALIDARG;
2707  if (!str) return STG_E_INVALIDNAME;
2708 
2710  {
2711  *rfmtid = FMTID_DocSummaryInformation;
2712  hr = S_OK;
2713  }
2714  else if (!lstrcmpiW(str, szSummaryInfo))
2715  {
2716  *rfmtid = FMTID_SummaryInformation;
2717  hr = S_OK;
2718  }
2719  else
2720  {
2721  ULONG bits;
2722  BYTE *fmtptr = (BYTE *)rfmtid - 1;
2723  const WCHAR *pstr = str;
2724 
2725  memset(rfmtid, 0, sizeof(*rfmtid));
2726  for (bits = 0; bits < sizeof(FMTID) * BITS_PER_BYTE;
2728  {
2729  ULONG bitsUsed = bits % BITS_PER_BYTE, bitsStored;
2730  WCHAR wc;
2731 
2732  if (bitsUsed == 0)
2733  fmtptr++;
2734  wc = *++pstr - 'A';
2735  if (wc > NUM_ALPHA_CHARS)
2736  {
2737  wc += 'A' - 'a';
2738  if (wc > NUM_ALPHA_CHARS)
2739  {
2740  wc += 'a' - '0' + NUM_ALPHA_CHARS;
2741  if (wc > CHARMASK)
2742  {
2743  WARN("invalid character (%d)\n", *pstr);
2744  goto end;
2745  }
2746  }
2747  }
2748  *fmtptr |= wc << bitsUsed;
2749  bitsStored = min(BITS_PER_BYTE - bitsUsed, BITS_IN_CHARMASK);
2750  if (bitsStored < BITS_IN_CHARMASK)
2751  {
2752  wc >>= BITS_PER_BYTE - bitsUsed;
2753  if (bits + bitsStored == sizeof(FMTID) * BITS_PER_BYTE)
2754  {
2755  if (wc != 0)
2756  {
2757  WARN("extra bits\n");
2758  goto end;
2759  }
2760  break;
2761  }
2762  fmtptr++;
2763  *fmtptr |= (BYTE)wc;
2764  }
2765  }
2766  hr = S_OK;
2767  }
2768 end:
2769  return hr;
2770 }
GUID FMTID
Definition: guiddef.h:94
#define STG_E_INVALIDNAME
Definition: winerror.h:2584
HRESULT hr
Definition: shlfolder.c:183
#define CHARMASK
Definition: stg_prop.c:2618
#define WARN(fmt,...)
Definition: debug.h:111
GLuint GLuint end
Definition: gl.h:1545
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
int WINAPI lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:194
const FMTID FMTID_SummaryInformation
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define BITS_IN_CHARMASK
Definition: stg_prop.c:2619
const FMTID FMTID_DocSummaryInformation
unsigned char BYTE
Definition: mem.h:68
static const WCHAR szSummaryInfo[]
Definition: stg_prop.c:2612
#define NUM_ALPHA_CHARS
Definition: stg_prop.c:2620
#define S_OK
Definition: intsafe.h:59
#define BITS_PER_BYTE
Definition: stg_prop.c:2617
#define min(a, b)
Definition: monoChain.cc:55
static const WCHAR szDocSummaryInfo[]
Definition: stg_prop.c:2614
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39

Referenced by create_EnumSTATPROPSETSTG().

◆ PropVariantClear()

HRESULT WINAPI PropVariantClear ( PROPVARIANT *  )

Definition at line 2968 of file ole2.c.

2969 {
2970  HRESULT hr;
2971 
2972  TRACE("(%p)\n", pvar);
2973 
2974  if (!pvar)
2975  return S_OK;
2976 
2977  hr = PROPVARIANT_ValidateType(pvar->vt);
2978  if (FAILED(hr))
2979  {
2980  memset(pvar, 0, sizeof(*pvar));
2981  return hr;
2982  }
2983 
2984  switch(pvar->vt)
2985  {
2986  case VT_EMPTY:
2987  case VT_NULL:
2988  case VT_I1:
2989  case VT_I2:
2990  case VT_I4:
2991  case VT_I8:
2992  case VT_R4:
2993  case VT_R8:
2994  case VT_CY:
2995  case VT_DATE:
2996  case VT_ERROR:
2997  case VT_BOOL:
2998  case VT_DECIMAL:
2999  case VT_UI1:
3000  case VT_UI2:
3001  case VT_UI4:
3002  case VT_UI8:
3003  case VT_INT:
3004  case VT_UINT:
3005  case VT_FILETIME:
3006  break;
3007  case VT_DISPATCH:
3008  case VT_UNKNOWN:
3009  case VT_STREAM:
3010  case VT_STREAMED_OBJECT:
3011  case VT_STORAGE:
3012  case VT_STORED_OBJECT:
3013  if (pvar->u.pStream)
3014  IStream_Release(pvar->u.pStream);
3015  break;
3016  case VT_CLSID:
3017  case VT_LPSTR:
3018  case VT_LPWSTR:
3019  /* pick an arbitrary typed pointer - we don't care about the type
3020  * as we are just freeing it */
3021  CoTaskMemFree(pvar->u.puuid);
3022  break;
3023  case VT_BLOB:
3024  case VT_BLOB_OBJECT:
3025  CoTaskMemFree(pvar->u.blob.pBlobData);
3026  break;
3027  case VT_BSTR:
3028  PropSysFreeString(pvar->u.bstrVal);
3029  break;
3030  case VT_CF:
3031  if (pvar->u.pclipdata)
3032  {
3033  OLE_FreeClipDataArray(1, pvar->u.pclipdata);
3034  CoTaskMemFree(pvar->u.pclipdata);
3035  }
3036  break;
3037  default:
3038  if (pvar->vt & VT_VECTOR)
3039  {
3040  ULONG i;
3041 
3042  switch (pvar->vt & ~VT_VECTOR)
3043  {
3044  case VT_VARIANT:
3045  FreePropVariantArray(pvar->u.capropvar.cElems, pvar->u.capropvar.pElems);
3046  break;
3047  case VT_CF:
3048  OLE_FreeClipDataArray(pvar->u.caclipdata.cElems, pvar->u.caclipdata.pElems);
3049  break;
3050  case VT_BSTR:
3051  for (i = 0; i < pvar->u.cabstr.cElems; i++)
3052  PropSysFreeString(pvar->u.cabstr.pElems[i]);
3053  break;
3054  case VT_LPSTR:
3055  for (i = 0; i < pvar->u.calpstr.cElems; i++)
3056  CoTaskMemFree(pvar->u.calpstr.pElems[i]);
3057  break;
3058  case VT_LPWSTR:
3059  for (i = 0; i < pvar->u.calpwstr.cElems; i++)
3060  CoTaskMemFree(pvar->u.calpwstr.pElems[i]);
3061  break;
3062  }
3063  if (pvar->vt & ~VT_VECTOR)
3064  {
3065  /* pick an arbitrary VT_VECTOR structure - they all have the same
3066  * memory layout */
3067  CoTaskMemFree(pvar->u.capropvar.pElems);
3068  }
3069  }
3070  else if (pvar->vt & VT_ARRAY)
3071  hr = SafeArrayDestroy(pvar->u.parray);
3072  else
3073  {
3074  WARN("Invalid/unsupported type %d\n", pvar->vt);
3076  }
3077  }
3078 
3079  memset(pvar, 0, sizeof(*pvar));
3080  return hr;
3081 }
Definition: compat.h:1947
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Definition: compat.h:1963
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1959
HRESULT WINAPI FreePropVariantArray(ULONG cVariants, PROPVARIANT *rgvars)
Definition: ole2.c:3267
#define WARN(fmt,...)
Definition: debug.h:111
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 TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
void WINAPI PropSysFreeString(LPOLESTR str)
Definition: ole2.c:2874
#define STG_E_INVALIDPARAMETER
Definition: winerror.h:2580
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
Definition: compat.h:1948
Definition: compat.h:1950
Definition: compat.h:1985
#define S_OK
Definition: intsafe.h:59
static void OLE_FreeClipDataArray(ULONG count, CLIPDATA *pClipDataArray)
Definition: ole2.c:2852
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
Definition: compat.h:1949
Definition: compat.h:1946
static HRESULT PROPVARIANT_ValidateType(VARTYPE vt)
Definition: ole2.c:2882

Referenced by compare_metadata(), destroy_format(), free_header(), FreePropVariantArray(), GdipGetAllPropertyItems(), GdipGetPropertyItem(), GdipGetPropertyItemSize(), GdipGetPropertySize(), get_bool_property(), get_next_reader(), get_property(), get_token(), get_ulong_by_index(), MetadataHandler_FreeItems(), MimeBody_GetProp(), MMDevice_Create(), MMDevice_GetPropValue(), mqr_GetMetadataByName(), on_mime_message_available(), PersistFile_Save(), png_metadata_reader(), PropertyStorage_PropertyDestroy(), PropertyStorage_ReadFromStream(), PropertyStorage_StorePropWithId(), PropertyStore_SetValue(), PropertyStore_SetValueAndState(), PropVariantCompareEx(), set_driver_prop_value(), test_BodyDeleteProp(), test_convert(), test_copy(), test_CreateMessage(), test_deviceinterface(), test_first_device(), test_InitPropVariantFromBuffer(), test_InitPropVariantFromCLSID(), test_intconversions(), test_MessageGetPropInfo(), test_MessageOptions(), test_MessageSetProp(), test_metadata_APE(), test_metadata_cHRM(), test_metadata_gAMA(), test_metadata_gif(), test_metadata_GIF_comment(), test_metadata_IFD(), test_metadata_tEXt(), test_metadata_unknown(), test_propertystore(), test_propertytovariant(), test_PropVariantChangeType_LPWSTR(), test_PropVariantToBuffer(), test_PropVariantToDouble(), test_PropVariantToGUID(), test_PropVariantToString(), test_PropVariantToStringAlloc(), test_validtypes(), testCodepage(), and testPropsHelper().

◆ PropVariantCopy()

HRESULT WINAPI PropVariantCopy ( PROPVARIANT *  ,
const PROPVARIANT *   
)

Definition at line 3086 of file ole2.c.

3088 {
3089  ULONG len;
3090  HRESULT hr;
3091 
3092  TRACE("(%p, %p vt %04x)\n", pvarDest, pvarSrc, pvarSrc->vt);
3093 
3094  hr = PROPVARIANT_ValidateType(pvarSrc->vt);
3095  if (FAILED(hr))
3096  return DISP_E_BADVARTYPE;
3097 
3098  /* this will deal with most cases */
3099  *pvarDest = *pvarSrc;
3100 
3101  switch(pvarSrc->vt)
3102  {
3103  case VT_EMPTY:
3104  case VT_NULL:
3105  case VT_I1:
3106  case VT_UI1:
3107  case VT_I2:
3108  case VT_UI2:
3109  case VT_BOOL:
3110  case VT_DECIMAL:
3111  case VT_I4:
3112  case VT_UI4:
3113  case VT_R4:
3114  case VT_ERROR:
3115  case VT_I8:
3116  case VT_UI8:
3117  case VT_INT:
3118  case VT_UINT:
3119  case VT_R8:
3120  case VT_CY:
3121  case VT_DATE:
3122  case VT_FILETIME:
3123  break;
3124  case VT_DISPATCH:
3125  case VT_UNKNOWN:
3126  case VT_STREAM:
3127  case VT_STREAMED_OBJECT:
3128  case VT_STORAGE:
3129  case VT_STORED_OBJECT:
3130  if (pvarDest->u.pStream)
3131  IStream_AddRef(pvarDest->u.pStream);
3132  break;
3133  case VT_CLSID:
3134  pvarDest->u.puuid = CoTaskMemAlloc(sizeof(CLSID));
3135  *pvarDest->u.puuid = *pvarSrc->u.puuid;
3136  break;
3137  case VT_LPSTR:
3138  if (pvarSrc->u.pszVal)
3139  {
3140  len = strlen(pvarSrc->u.pszVal);
3141  pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR));
3142  CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR));
3143  }
3144  break;
3145  case VT_LPWSTR:
3146  if (pvarSrc->u.pwszVal)
3147  {
3148  len = lstrlenW(pvarSrc->u.pwszVal);
3149  pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
3150  CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR));
3151  }
3152  break;
3153  case VT_BLOB:
3154  case VT_BLOB_OBJECT:
3155  if (pvarSrc->u.blob.pBlobData)
3156  {
3157  len = pvarSrc->u.blob.cbSize;
3158  pvarDest->u.blob.pBlobData = CoTaskMemAlloc(len);
3159  CopyMemory(pvarDest->u.blob.pBlobData, pvarSrc->u.blob.pBlobData, len);
3160  }
3161  break;
3162  case VT_BSTR:
3163  pvarDest->u.bstrVal = PropSysAllocString(pvarSrc->u.bstrVal);
3164  break;
3165  case VT_CF:
3166  if (pvarSrc->u.pclipdata)
3167  {
3168  len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt);
3169  pvarDest->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA));
3170  pvarDest->u.pclipdata->cbSize = pvarSrc->u.pclipdata->cbSize;
3171  pvarDest->u.pclipdata->ulClipFmt = pvarSrc->u.pclipdata->ulClipFmt;
3172  pvarDest->u.pclipdata->pClipData = CoTaskMemAlloc(len);
3173  CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len);
3174  }
3175  break;
3176  default:
3177  if (pvarSrc->vt & VT_VECTOR)
3178  {
3179  int elemSize;
3180  ULONG i;
3181 
3182  switch(pvarSrc->vt & ~VT_VECTOR)
3183  {
3184  case VT_I1: elemSize = sizeof(pvarSrc->u.cVal); break;
3185  case VT_UI1: elemSize = sizeof(pvarSrc->u.bVal); break;
3186  case VT_I2: elemSize = sizeof(pvarSrc->u.iVal); break;
3187  case VT_UI2: elemSize = sizeof(pvarSrc->u.uiVal); break;
3188  case VT_BOOL: elemSize = sizeof(pvarSrc->u.boolVal); break;
3189  case VT_I4: elemSize = sizeof(pvarSrc->u.lVal); break;
3190  case VT_UI4: elemSize = sizeof(pvarSrc->u.ulVal); break;
3191  case VT_R4: elemSize = sizeof(pvarSrc->u.fltVal); break;
3192  case VT_R8: elemSize = sizeof(pvarSrc->u.dblVal); break;
3193  case VT_ERROR: elemSize = sizeof(pvarSrc->u.scode); break;
3194  case VT_I8: elemSize = sizeof(pvarSrc->u.hVal); break;
3195  case VT_UI8: elemSize = sizeof(pvarSrc->u.uhVal); break;
3196  case VT_CY: elemSize = sizeof(pvarSrc->u.cyVal); break;
3197  case VT_DATE: elemSize = sizeof(pvarSrc->u.date); break;
3198  case VT_FILETIME: elemSize = sizeof(pvarSrc->u.filetime); break;
3199  case VT_CLSID: elemSize = sizeof(*pvarSrc->u.puuid); break;
3200  case VT_CF: elemSize = sizeof(*pvarSrc->u.pclipdata); break;
3201  case VT_BSTR: elemSize = sizeof(pvarSrc->u.bstrVal); break;
3202  case VT_LPSTR: elemSize = sizeof(pvarSrc->u.pszVal); break;
3203  case VT_LPWSTR: elemSize = sizeof(pvarSrc->u.pwszVal); break;
3204  case VT_VARIANT: elemSize = sizeof(*pvarSrc->u.pvarVal); break;
3205 
3206  default:
3207  FIXME("Invalid element type: %ul\n", pvarSrc->vt & ~VT_VECTOR);
3208  return E_INVALIDARG;
3209  }
3210  len = pvarSrc->u.capropvar.cElems;
3211  pvarDest->u.capropvar.pElems = len ? CoTaskMemAlloc(len * elemSize) : NULL;
3212  if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT))
3213  {
3214  for (i = 0; i < len; i++)
3215  PropVariantCopy(&pvarDest->u.capropvar.pElems[i], &pvarSrc->u.capropvar.pElems[i]);
3216  }
3217  else if (pvarSrc->vt == (VT_VECTOR | VT_CF))
3218  {
3219  FIXME("Copy clipformats\n");
3220  }
3221  else if (pvarSrc->vt == (VT_VECTOR | VT_BSTR))
3222  {
3223  for (i = 0; i < len; i++)
3224  pvarDest->u.cabstr.pElems[i] = PropSysAllocString(pvarSrc->u.cabstr.pElems[i]);
3225  }
3226  else if (pvarSrc->vt == (VT_VECTOR | VT_LPSTR))
3227  {
3228  size_t strLen;
3229  for (i = 0; i < len; i++)
3230  {
3231  strLen = lstrlenA(pvarSrc->u.calpstr.pElems[i]) + 1;
3232  pvarDest->u.calpstr.pElems[i] = CoTaskMemAlloc(strLen);
3233  memcpy(pvarDest->u.calpstr.pElems[i],
3234  pvarSrc->u.calpstr.pElems[i], strLen);
3235  }
3236  }
3237  else if (pvarSrc->vt == (VT_VECTOR | VT_LPWSTR))
3238  {
3239  size_t strLen;
3240  for (i = 0; i < len; i++)
3241  {
3242  strLen = (lstrlenW(pvarSrc->u.calpwstr.pElems[i]) + 1) *
3243  sizeof(WCHAR);
3244  pvarDest->u.calpstr.pElems[i] = CoTaskMemAlloc(strLen);
3245  memcpy(pvarDest->u.calpstr.pElems[i],
3246  pvarSrc->u.calpstr.pElems[i], strLen);
3247  }
3248  }
3249  else
3250  CopyMemory(pvarDest->u.capropvar.pElems, pvarSrc->u.capropvar.pElems, len * elemSize);
3251  }
3252  else if (pvarSrc->vt & VT_ARRAY)
3253  {
3254  pvarDest->u.uhVal.QuadPart = 0;
3255  return SafeArrayCopy(pvarSrc->u.parray, &pvarDest->u.parray);
3256  }
3257  else
3258  WARN("Invalid/unsupported type %d\n", pvarSrc->vt);
3259  }
3260 
3261  return S_OK;
3262 }
BSTR WINAPI PropSysAllocString(LPCOLESTR str)
Definition: ole2.c:2864
Definition: compat.h:1947
Definition: compat.h:1963
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1959
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char CHAR
Definition: xmlstorage.h:175
#define WARN(fmt,...)
Definition: debug.h:111
#define lstrlenW
Definition: compat.h:415
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
HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, const PROPVARIANT *pvarSrc)
Definition: ole2.c:3086
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI SafeArrayCopy(SAFEARRAY *psa, SAFEARRAY **ppsaOut)
Definition: safearray.c:1379
#define CopyMemory
Definition: winbase.h:1640
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
Definition: compat.h:1948
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: compat.h:1950
Definition: compat.h:1985
#define S_OK
Definition: intsafe.h:59
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
unsigned int ULONG
Definition: retypes.h:1
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
Definition: compat.h:1949
Definition: compat.h:1946
static HRESULT PROPVARIANT_ValidateType(VARTYPE vt)
Definition: ole2.c:2882

Referenced by IPropertyStorage_fnWriteMultiple(), MetadataHandler_GetValue(), MetadataHandler_GetValueByIndex(), MetadataHandlerEnum_Next(), MimeBody_SetProp(), PropertyStorage_PropVariantCopy(), PropertyStore_GetValue(), PropertyStore_GetValueAndState(), PropertyStore_SetValue(), PropertyStore_SetValueAndState(), PropVariantChangeType(), PropVariantCopy(), test_copy(), and test_validtypes().

◆ StgCreatePropSetStg()

HRESULT WINAPI StgCreatePropSetStg ( IStorage ,
DWORD  ,
IPropertySetStorage **   
)

Definition at line 8698 of file storage32.c.

8700 {
8701  TRACE("(%p, 0x%x, %p)\n", pstg, reserved, propset);
8702  if (reserved)
8703  return STG_E_INVALIDPARAMETER;
8704 
8705  return IStorage_QueryInterface(pstg, &IID_IPropertySetStorage, (void**)propset);
8706 }
r reserved
Definition: btrfs.c:2865
#define TRACE(s)
Definition: solgame.cpp:4
#define STG_E_INVALIDPARAMETER
Definition: winerror.h:2580

◆ StgCreatePropStg()

_STGCREATEPROPSTG_DEFINED_ (p) HRESULT WINAPI StgCreatePropStg ( IUnknown ,
REFFMTID  ,
const CLSID ,
DWORD  ,
DWORD  ,
IPropertyStorage **   
)

Definition at line 2820 of file stg_prop.c.

2822 {
2823  IStorage *stg;
2824  IStream *stm;
2825  HRESULT r;
2826 
2827  TRACE("%p %s %s %08x %d %p\n", unk, debugstr_guid(fmt), debugstr_guid(clsid), flags, reserved, prop_stg);
2828 
2829  if (!fmt || reserved)
2830  {
2831  r = E_INVALIDARG;
2832  goto end;
2833  }
2834 
2835  if (flags & PROPSETFLAG_NONSIMPLE)
2836  {
2837  r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
2838  if (FAILED(r))
2839  goto end;
2840 
2841  /* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to create a
2842  * storage, not a stream. For now, disallow it.
2843  */
2844  FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
2845  IStorage_Release(stg);
2846  r = STG_E_INVALIDFLAG;
2847  }
2848  else
2849  {
2850  r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
2851  if (FAILED(r))
2852  goto end;
2853 
2856 
2857  IStream_Release( stm );
2858  }
2859 
2860 end:
2861  TRACE("returning 0x%08x\n", r);
2862  return r;
2863 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define STGM_CREATE
Definition: objbase.h:925
GLuint GLuint end
Definition: gl.h:1545
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2865
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define STG_E_INVALIDFLAG
Definition: winerror.h:2587
GLbitfield flags
Definition: glext.h:7161
REFCLSID clsid
Definition: msctf.c:82
#define STGM_READWRITE
Definition: objbase.h:918
static HRESULT PropertyStorage_ConstructEmpty(IStream *stm, REFFMTID rfmtid, DWORD grfFlags, DWORD grfMode, IPropertyStorage **pps)
Definition: stg_prop.c:2122
Definition: dsound.c:943

◆ StgOpenPropStg()

HRESULT WINAPI StgOpenPropStg ( IUnknown ,
REFFMTID  ,
DWORD  ,
DWORD  ,
IPropertyStorage **   
)

Definition at line 2865 of file stg_prop.c.

2867 {
2868  IStorage *stg;
2869  IStream *stm;
2870  HRESULT r;
2871 
2872  TRACE("%p %s %08x %d %p\n", unk, debugstr_guid(fmt), flags, reserved, prop_stg);
2873 
2874  if (!fmt || reserved)
2875  {
2876  r = E_INVALIDARG;
2877  goto end;
2878  }
2879 
2880  if (flags & PROPSETFLAG_NONSIMPLE)
2881  {
2882  r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
2883  if (FAILED(r))
2884  goto end;
2885 
2886  /* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to open a
2887  * storage, not a stream. For now, disallow it.
2888  */
2889  FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
2890  IStorage_Release(stg);
2891  r = STG_E_INVALIDFLAG;
2892  }
2893  else
2894  {
2895  r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
2896  if (FAILED(r))
2897  goto end;
2898 
2901 
2902  IStream_Release( stm );
2903  }
2904 
2905 end:
2906  TRACE("returning 0x%08x\n", r);
2907  return r;
2908 }
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
#define FIXME(fmt,...)
Definition: debug.h:110
r reserved
Definition: btrfs.c:2865
#define E_INVALIDARG
Definition: ddrawi.h:101
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define STG_E_INVALIDFLAG
Definition: winerror.h:2587
GLbitfield flags
Definition: glext.h:7161
#define STGM_READWRITE
Definition: objbase.h:918
static HRESULT PropertyStorage_ConstructFromStream(IStream *stm, REFFMTID rfmtid, DWORD grfMode, IPropertyStorage **pps)
Definition: stg_prop.c:2100
Definition: dsound.c:943

Variable Documentation

◆ rgb

BYTE rgb[1]

Definition at line 438 of file propidl.idl.

◆ SERIALIZEDPROPERTYVALUE

SERIALIZEDPROPERTYVALUE

Definition at line 439 of file propidl.idl.

Referenced by test_propertytovariant(), and test_varianttoproperty().