ReactOS  0.4.14-dev-49-gfb4591c
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:36

Definition at line 81 of file propidl.idl.

Function Documentation

◆ FmtIdToPropStgName()

CCH_MAX_PROPSTG_NAME HRESULT WINAPI FmtIdToPropStgName ( const FMTID ,
LPOLESTR   
)

Definition at line 2642 of file stg_prop.c.

2643 {
2644  static const char fmtMap[] = "abcdefghijklmnopqrstuvwxyz012345";
2645 
2646  TRACE("%s, %p\n", debugstr_guid(rfmtid), str);
2647 
2648  if (!rfmtid) return E_INVALIDARG;
2649  if (!str) return E_INVALIDARG;
2650 
2651  if (IsEqualGUID(&FMTID_SummaryInformation, rfmtid))
2653  else if (IsEqualGUID(&FMTID_DocSummaryInformation, rfmtid))
2655  else if (IsEqualGUID(&FMTID_UserDefinedProperties, rfmtid))
2657  else
2658  {
2659  const BYTE *fmtptr;
2660  WCHAR *pstr = str;
2661  ULONG bitsRemaining = BITS_PER_BYTE;
2662 
2663  *pstr++ = 5;
2664  for (fmtptr = (const BYTE *)rfmtid; fmtptr < (const BYTE *)rfmtid + sizeof(FMTID); )
2665  {
2666  ULONG i = *fmtptr >> (BITS_PER_BYTE - bitsRemaining);
2667 
2668  if (bitsRemaining >= BITS_IN_CHARMASK)
2669  {
2670  *pstr = (WCHAR)(fmtMap[i & CHARMASK]);
2671  if (bitsRemaining == BITS_PER_BYTE && *pstr >= 'a' &&
2672  *pstr <= 'z')
2673  *pstr += 'A' - 'a';
2674  pstr++;
2675  bitsRemaining -= BITS_IN_CHARMASK;
2676  if (bitsRemaining == 0)
2677  {
2678  fmtptr++;
2679  bitsRemaining = BITS_PER_BYTE;
2680  }
2681  }
2682  else
2683  {
2684  if (++fmtptr < (const BYTE *)rfmtid + sizeof(FMTID))
2685  i |= *fmtptr << bitsRemaining;
2686  *pstr++ = (WCHAR)(fmtMap[i & CHARMASK]);
2687  bitsRemaining += BITS_PER_BYTE - BITS_IN_CHARMASK;
2688  }
2689  }
2690  *pstr = 0;
2691  }
2692  TRACE("returning %s\n", debugstr_w(str));
2693  return S_OK;
2694 }
GUID FMTID
Definition: guiddef.h:94
#define CHARMASK
Definition: stg_prop.c:2625
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:2626
const FMTID FMTID_DocSummaryInformation
unsigned char BYTE
Definition: mem.h:68
static const WCHAR szSummaryInfo[]
Definition: stg_prop.c:2619
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:406
#define BITS_PER_BYTE
Definition: stg_prop.c:2624
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static const WCHAR szDocSummaryInfo[]
Definition: stg_prop.c:2621
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 3244 of file ole2.c.

3246 {
3247  ULONG i;
3248 
3249  TRACE("(%u, %p)\n", cVariants, rgvars);
3250 
3251  if (!rgvars)
3252  return E_INVALIDARG;
3253 
3254  for(i = 0; i < cVariants; i++)
3255  PropVariantClear(&rgvars[i]);
3256 
3257  return S_OK;
3258 }
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
Definition: ole2.c:2952
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 2707 of file stg_prop.c.

2708 {
2710 
2711  TRACE("%s, %p\n", debugstr_w(str), rfmtid);
2712 
2713  if (!rfmtid) return E_INVALIDARG;
2714  if (!str) return STG_E_INVALIDNAME;
2715 
2717  {
2718  *rfmtid = FMTID_DocSummaryInformation;
2719  hr = S_OK;
2720  }
2721  else if (!lstrcmpiW(str, szSummaryInfo))
2722  {
2723  *rfmtid = FMTID_SummaryInformation;
2724  hr = S_OK;
2725  }
2726  else
2727  {
2728  ULONG bits;
2729  BYTE *fmtptr = (BYTE *)rfmtid - 1;
2730  const WCHAR *pstr = str;
2731 
2732  memset(rfmtid, 0, sizeof(*rfmtid));
2733  for (bits = 0; bits < sizeof(FMTID) * BITS_PER_BYTE;
2735  {
2736  ULONG bitsUsed = bits % BITS_PER_BYTE, bitsStored;
2737  WCHAR wc;
2738 
2739  if (bitsUsed == 0)
2740  fmtptr++;
2741  wc = *++pstr - 'A';
2742  if (wc > NUM_ALPHA_CHARS)
2743  {
2744  wc += 'A' - 'a';
2745  if (wc > NUM_ALPHA_CHARS)
2746  {
2747  wc += 'a' - '0' + NUM_ALPHA_CHARS;
2748  if (wc > CHARMASK)
2749  {
2750  WARN("invalid character (%d)\n", *pstr);
2751  goto end;
2752  }
2753  }
2754  }
2755  *fmtptr |= wc << bitsUsed;
2756  bitsStored = min(BITS_PER_BYTE - bitsUsed, BITS_IN_CHARMASK);
2757  if (bitsStored < BITS_IN_CHARMASK)
2758  {
2759  wc >>= BITS_PER_BYTE - bitsUsed;
2760  if (bits + bitsStored == sizeof(FMTID) * BITS_PER_BYTE)
2761  {
2762  if (wc != 0)
2763  {
2764  WARN("extra bits\n");
2765  goto end;
2766  }
2767  break;
2768  }
2769  fmtptr++;
2770  *fmtptr |= (BYTE)wc;
2771  }
2772  }
2773  hr = S_OK;
2774  }
2775 end:
2776  return hr;
2777 }
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:2625
#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:2626
const FMTID FMTID_DocSummaryInformation
unsigned char BYTE
Definition: mem.h:68
static const WCHAR szSummaryInfo[]
Definition: stg_prop.c:2619
#define NUM_ALPHA_CHARS
Definition: stg_prop.c:2627
#define S_OK
Definition: intsafe.h:59
#define BITS_PER_BYTE
Definition: stg_prop.c:2624
#define min(a, b)
Definition: monoChain.cc:55
static const WCHAR szDocSummaryInfo[]
Definition: stg_prop.c:2621
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 2952 of file ole2.c.

2953 {
2954  HRESULT hr;
2955 
2956  TRACE("(%p)\n", pvar);
2957 
2958  if (!pvar)
2959  return S_OK;
2960 
2961  hr = PROPVARIANT_ValidateType(pvar->vt);
2962  if (FAILED(hr))
2963  {
2964  memset(pvar, 0, sizeof(*pvar));
2965  return hr;
2966  }
2967 
2968  switch(pvar->vt)
2969  {
2970  case VT_EMPTY:
2971  case VT_NULL:
2972  case VT_I1:
2973  case VT_I2:
2974  case VT_I4:
2975  case VT_I8:
2976  case VT_R4:
2977  case VT_R8:
2978  case VT_CY:
2979  case VT_DATE:
2980  case VT_ERROR:
2981  case VT_BOOL:
2982  case VT_DECIMAL:
2983  case VT_UI1:
2984  case VT_UI2:
2985  case VT_UI4:
2986  case VT_UI8:
2987  case VT_INT:
2988  case VT_UINT:
2989  case VT_FILETIME:
2990  break;
2991  case VT_DISPATCH:
2992  case VT_UNKNOWN:
2993  case VT_STREAM:
2994  case VT_STREAMED_OBJECT:
2995  case VT_STORAGE:
2996  case VT_STORED_OBJECT:
2997  if (pvar->u.pStream)
2998  IStream_Release(pvar->u.pStream);
2999  break;
3000  case VT_CLSID:
3001  case VT_LPSTR:
3002  case VT_LPWSTR:
3003  /* pick an arbitrary typed pointer - we don't care about the type
3004  * as we are just freeing it */
3005  CoTaskMemFree(pvar->u.puuid);
3006  break;
3007  case VT_BLOB:
3008  case VT_BLOB_OBJECT:
3009  CoTaskMemFree(pvar->u.blob.pBlobData);
3010  break;
3011  case VT_BSTR:
3012  PropSysFreeString(pvar->u.bstrVal);
3013  break;
3014  case VT_CF:
3015  if (pvar->u.pclipdata)
3016  {
3017  OLE_FreeClipDataArray(1, pvar->u.pclipdata);
3018  CoTaskMemFree(pvar->u.pclipdata);
3019  }
3020  break;
3021  default:
3022  if (pvar->vt & VT_VECTOR)
3023  {
3024  ULONG i;
3025 
3026  switch (pvar->vt & ~VT_VECTOR)
3027  {
3028  case VT_VARIANT:
3029  FreePropVariantArray(pvar->u.capropvar.cElems, pvar->u.capropvar.pElems);
3030  break;
3031  case VT_CF:
3032  OLE_FreeClipDataArray(pvar->u.caclipdata.cElems, pvar->u.caclipdata.pElems);
3033  break;
3034  case VT_BSTR:
3035  for (i = 0; i < pvar->u.cabstr.cElems; i++)
3036  PropSysFreeString(pvar->u.cabstr.pElems[i]);
3037  break;
3038  case VT_LPSTR:
3039  for (i = 0; i < pvar->u.calpstr.cElems; i++)
3040  CoTaskMemFree(pvar->u.calpstr.pElems[i]);
3041  break;
3042  case VT_LPWSTR:
3043  for (i = 0; i < pvar->u.calpwstr.cElems; i++)
3044  CoTaskMemFree(pvar->u.calpwstr.pElems[i]);
3045  break;
3046  }
3047  if (pvar->vt & ~VT_VECTOR)
3048  {
3049  /* pick an arbitrary VT_VECTOR structure - they all have the same
3050  * memory layout */
3051  CoTaskMemFree(pvar->u.capropvar.pElems);
3052  }
3053  }
3054  else
3055  {
3056  WARN("Invalid/unsupported type %d\n", pvar->vt);
3058  }
3059  }
3060 
3061  memset(pvar, 0, sizeof(*pvar));
3062  return hr;
3063 }
Definition: compat.h:1939
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
Definition: compat.h:1955
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1951
HRESULT WINAPI FreePropVariantArray(ULONG cVariants, PROPVARIANT *rgvars)
Definition: ole2.c:3244
#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:2877
#define STG_E_INVALIDPARAMETER
Definition: winerror.h:2580
Definition: compat.h:1940
Definition: compat.h:1942
Definition: compat.h:1977
#define S_OK
Definition: intsafe.h:59
static void OLE_FreeClipDataArray(ULONG count, CLIPDATA *pClipDataArray)
Definition: ole2.c:2855
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
Definition: compat.h:1941
Definition: compat.h:1938
static HRESULT PROPVARIANT_ValidateType(VARTYPE vt)
Definition: ole2.c:2885

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_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_propertytovariant(), test_PropVariantChangeType_LPWSTR(), test_PropVariantToGUID(), test_PropVariantToStringAlloc(), test_validtypes(), testCodepage(), and testPropsHelper().

◆ PropVariantCopy()

HRESULT WINAPI PropVariantCopy ( PROPVARIANT *  ,
const PROPVARIANT *   
)

Definition at line 3068 of file ole2.c.

3070 {
3071  ULONG len;
3072  HRESULT hr;
3073 
3074  TRACE("(%p, %p vt %04x)\n", pvarDest, pvarSrc, pvarSrc->vt);
3075 
3076  hr = PROPVARIANT_ValidateType(pvarSrc->vt);
3077  if (FAILED(hr))
3078  return DISP_E_BADVARTYPE;
3079 
3080  /* this will deal with most cases */
3081  *pvarDest = *pvarSrc;
3082 
3083  switch(pvarSrc->vt)
3084  {
3085  case VT_EMPTY:
3086  case VT_NULL:
3087  case VT_I1:
3088  case VT_UI1:
3089  case VT_I2:
3090  case VT_UI2:
3091  case VT_BOOL:
3092  case VT_DECIMAL:
3093  case VT_I4:
3094  case VT_UI4:
3095  case VT_R4:
3096  case VT_ERROR:
3097  case VT_I8:
3098  case VT_UI8:
3099  case VT_INT:
3100  case VT_UINT:
3101  case VT_R8:
3102  case VT_CY:
3103  case VT_DATE:
3104  case VT_FILETIME:
3105  break;
3106  case VT_DISPATCH:
3107  case VT_UNKNOWN:
3108  case VT_STREAM:
3109  case VT_STREAMED_OBJECT:
3110  case VT_STORAGE:
3111  case VT_STORED_OBJECT:
3112  if (pvarDest->u.pStream)
3113  IStream_AddRef(pvarDest->u.pStream);
3114  break;
3115  case VT_CLSID:
3116  pvarDest->u.puuid = CoTaskMemAlloc(sizeof(CLSID));
3117  *pvarDest->u.puuid = *pvarSrc->u.puuid;
3118  break;
3119  case VT_LPSTR:
3120  if (pvarSrc->u.pszVal)
3121  {
3122  len = strlen(pvarSrc->u.pszVal);
3123  pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR));
3124  CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR));
3125  }
3126  break;
3127  case VT_LPWSTR:
3128  if (pvarSrc->u.pwszVal)
3129  {
3130  len = lstrlenW(pvarSrc->u.pwszVal);
3131  pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR));
3132  CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR));
3133  }
3134  break;
3135  case VT_BLOB:
3136  case VT_BLOB_OBJECT:
3137  if (pvarSrc->u.blob.pBlobData)
3138  {
3139  len = pvarSrc->u.blob.cbSize;
3140  pvarDest->u.blob.pBlobData = CoTaskMemAlloc(len);
3141  CopyMemory(pvarDest->u.blob.pBlobData, pvarSrc->u.blob.pBlobData, len);
3142  }
3143  break;
3144  case VT_BSTR:
3145  pvarDest->u.bstrVal = PropSysAllocString(pvarSrc->u.bstrVal);
3146  break;
3147  case VT_CF:
3148  if (pvarSrc->u.pclipdata)
3149  {
3150  len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt);
3151  pvarDest->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA));
3152  pvarDest->u.pclipdata->cbSize = pvarSrc->u.pclipdata->cbSize;
3153  pvarDest->u.pclipdata->ulClipFmt = pvarSrc->u.pclipdata->ulClipFmt;
3154  pvarDest->u.pclipdata->pClipData = CoTaskMemAlloc(len);
3155  CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len);
3156  }
3157  break;
3158  default:
3159  if (pvarSrc->vt & VT_VECTOR)
3160  {
3161  int elemSize;
3162  ULONG i;
3163 
3164  switch(pvarSrc->vt & ~VT_VECTOR)
3165  {
3166  case VT_I1: elemSize = sizeof(pvarSrc->u.cVal); break;
3167  case VT_UI1: elemSize = sizeof(pvarSrc->u.bVal); break;
3168  case VT_I2: elemSize = sizeof(pvarSrc->u.iVal); break;
3169  case VT_UI2: elemSize = sizeof(pvarSrc->u.uiVal); break;
3170  case VT_BOOL: elemSize = sizeof(pvarSrc->u.boolVal); break;
3171  case VT_I4: elemSize = sizeof(pvarSrc->u.lVal); break;
3172  case VT_UI4: elemSize = sizeof(pvarSrc->u.ulVal); break;
3173  case VT_R4: elemSize = sizeof(pvarSrc->u.fltVal); break;
3174  case VT_R8: elemSize = sizeof(pvarSrc->u.dblVal); break;
3175  case VT_ERROR: elemSize = sizeof(pvarSrc->u.scode); break;
3176  case VT_I8: elemSize = sizeof(pvarSrc->u.hVal); break;
3177  case VT_UI8: elemSize = sizeof(pvarSrc->u.uhVal); break;
3178  case VT_CY: elemSize = sizeof(pvarSrc->u.cyVal); break;
3179  case VT_DATE: elemSize = sizeof(pvarSrc->u.date); break;
3180  case VT_FILETIME: elemSize = sizeof(pvarSrc->u.filetime); break;
3181  case VT_CLSID: elemSize = sizeof(*pvarSrc->u.puuid); break;
3182  case VT_CF: elemSize = sizeof(*pvarSrc->u.pclipdata); break;
3183  case VT_BSTR: elemSize = sizeof(pvarSrc->u.bstrVal); break;
3184  case VT_LPSTR: elemSize = sizeof(pvarSrc->u.pszVal); break;
3185  case VT_LPWSTR: elemSize = sizeof(pvarSrc->u.pwszVal); break;
3186  case VT_VARIANT: elemSize = sizeof(*pvarSrc->u.pvarVal); break;
3187 
3188  default:
3189  FIXME("Invalid element type: %ul\n", pvarSrc->vt & ~VT_VECTOR);
3190  return E_INVALIDARG;
3191  }
3192  len = pvarSrc->u.capropvar.cElems;
3193  pvarDest->u.capropvar.pElems = len ? CoTaskMemAlloc(len * elemSize) : NULL;
3194  if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT))
3195  {
3196  for (i = 0; i < len; i++)
3197  PropVariantCopy(&pvarDest->u.capropvar.pElems[i], &pvarSrc->u.capropvar.pElems[i]);
3198  }
3199  else if (pvarSrc->vt == (VT_VECTOR | VT_CF))
3200  {
3201  FIXME("Copy clipformats\n");
3202  }
3203  else if (pvarSrc->vt == (VT_VECTOR | VT_BSTR))
3204  {
3205  for (i = 0; i < len; i++)
3206  pvarDest->u.cabstr.pElems[i] = PropSysAllocString(pvarSrc->u.cabstr.pElems[i]);
3207  }
3208  else if (pvarSrc->vt == (VT_VECTOR | VT_LPSTR))
3209  {
3210  size_t strLen;
3211  for (i = 0; i < len; i++)
3212  {
3213  strLen = lstrlenA(pvarSrc->u.calpstr.pElems[i]) + 1;
3214  pvarDest->u.calpstr.pElems[i] = CoTaskMemAlloc(strLen);
3215  memcpy(pvarDest->u.calpstr.pElems[i],
3216  pvarSrc->u.calpstr.pElems[i], strLen);
3217  }
3218  }
3219  else if (pvarSrc->vt == (VT_VECTOR | VT_LPWSTR))
3220  {
3221  size_t strLen;
3222  for (i = 0; i < len; i++)
3223  {
3224  strLen = (lstrlenW(pvarSrc->u.calpwstr.pElems[i]) + 1) *
3225  sizeof(WCHAR);
3226  pvarDest->u.calpstr.pElems[i] = CoTaskMemAlloc(strLen);
3227  memcpy(pvarDest->u.calpstr.pElems[i],
3228  pvarSrc->u.calpstr.pElems[i], strLen);
3229  }
3230  }
3231  else
3232  CopyMemory(pvarDest->u.capropvar.pElems, pvarSrc->u.capropvar.pElems, len * elemSize);
3233  }
3234  else
3235  WARN("Invalid/unsupported type %d\n", pvarSrc->vt);
3236  }
3237 
3238  return S_OK;
3239 }
BSTR WINAPI PropSysAllocString(LPCOLESTR str)
Definition: ole2.c:2867
Definition: compat.h:1939
Definition: compat.h:1955
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1951
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:407
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:3068
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define CopyMemory
Definition: winbase.h:1633
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
Definition: compat.h:1940
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: compat.h:1942
Definition: compat.h:1977
#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:406
Definition: compat.h:1941
Definition: compat.h:1938
static HRESULT PROPVARIANT_ValidateType(VARTYPE vt)
Definition: ole2.c:2885

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 8699 of file storage32.c.

8701 {
8702  TRACE("(%p, 0x%x, %p)\n", pstg, reserved, propset);
8703  if (reserved)
8704  return STG_E_INVALIDPARAMETER;
8705 
8706  return IStorage_QueryInterface(pstg, &IID_IPropertySetStorage, (void**)propset);
8707 }
r reserved
Definition: btrfs.c:2893
#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 2827 of file stg_prop.c.

2829 {
2830  IStorage *stg;
2831  IStream *stm;
2832  HRESULT r;
2833 
2834  TRACE("%p %s %s %08x %d %p\n", unk, debugstr_guid(fmt), debugstr_guid(clsid), flags, reserved, prop_stg);
2835 
2836  if (!fmt || reserved)
2837  {
2838  r = E_INVALIDARG;
2839  goto end;
2840  }
2841 
2842  if (flags & PROPSETFLAG_NONSIMPLE)
2843  {
2844  r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
2845  if (FAILED(r))
2846  goto end;
2847 
2848  /* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to create a
2849  * storage, not a stream. For now, disallow it.
2850  */
2851  FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
2852  IStorage_Release(stg);
2853  r = STG_E_INVALIDFLAG;
2854  }
2855  else
2856  {
2857  r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
2858  if (FAILED(r))
2859  goto end;
2860 
2863 
2864  IStream_Release( stm );
2865  }
2866 
2867 end:
2868  TRACE("returning 0x%08x\n", r);
2869  return r;
2870 }
#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:2893
#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:84
#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:2129
Definition: dsound.c:943

◆ StgOpenPropStg()

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

Definition at line 2872 of file stg_prop.c.

2874 {
2875  IStorage *stg;
2876  IStream *stm;
2877  HRESULT r;
2878 
2879  TRACE("%p %s %08x %d %p\n", unk, debugstr_guid(fmt), flags, reserved, prop_stg);
2880 
2881  if (!fmt || reserved)
2882  {
2883  r = E_INVALIDARG;
2884  goto end;
2885  }
2886 
2887  if (flags & PROPSETFLAG_NONSIMPLE)
2888  {
2889  r = IUnknown_QueryInterface(unk, &IID_IStorage, (void **)&stg);
2890  if (FAILED(r))
2891  goto end;
2892 
2893  /* FIXME: if (flags & PROPSETFLAG_NONSIMPLE), we need to open a
2894  * storage, not a stream. For now, disallow it.
2895  */
2896  FIXME("PROPSETFLAG_NONSIMPLE not supported\n");
2897  IStorage_Release(stg);
2898  r = STG_E_INVALIDFLAG;
2899  }
2900  else
2901  {
2902  r = IUnknown_QueryInterface(unk, &IID_IStream, (void **)&stm);
2903  if (FAILED(r))
2904  goto end;
2905 
2908 
2909  IStream_Release( stm );
2910  }
2911 
2912 end:
2913  TRACE("returning 0x%08x\n", r);
2914  return r;
2915 }
#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:2893
#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:2107
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().