ReactOS  0.4.15-dev-1200-gc3b3fcd
propsys_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "propsys.h"
#include "wine/debug.h"
#include "propsys_private.h"
Include dependency graph for propsys_main.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (propsys)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL fLock)
 
static HRESULT WINAPI InMemoryPropertyStoreFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
static HRESULT WINAPI propsys_QueryInterface (IPropertySystem *iface, REFIID riid, void **obj)
 
static ULONG WINAPI propsys_AddRef (IPropertySystem *iface)
 
static ULONG WINAPI propsys_Release (IPropertySystem *iface)
 
static HRESULT WINAPI propsys_GetPropertyDescription (IPropertySystem *iface, REFPROPERTYKEY propkey, REFIID riid, void **ppv)
 
static HRESULT WINAPI propsys_GetPropertyDescriptionByName (IPropertySystem *iface, LPCWSTR canonical_name, REFIID riid, void **ppv)
 
static HRESULT WINAPI propsys_GetPropertyDescriptionListFromString (IPropertySystem *iface, LPCWSTR proplist, REFIID riid, void **ppv)
 
static HRESULT WINAPI propsys_EnumeratePropertyDescriptions (IPropertySystem *iface, PROPDESC_ENUMFILTER filter, REFIID riid, void **ppv)
 
static HRESULT WINAPI propsys_FormatForDisplay (IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR dest, DWORD destlen)
 
static HRESULT WINAPI propsys_FormatForDisplayAlloc (IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR *text)
 
static HRESULT WINAPI propsys_RegisterPropertySchema (IPropertySystem *iface, LPCWSTR path)
 
static HRESULT WINAPI propsys_UnregisterPropertySchema (IPropertySystem *iface, LPCWSTR path)
 
static HRESULT WINAPI propsys_RefreshPropertySchema (IPropertySystem *iface)
 
HRESULT WINAPI PSGetPropertySystem (REFIID riid, void **obj)
 
HRESULT WINAPI PSRegisterPropertySchema (PCWSTR path)
 
HRESULT WINAPI PSUnregisterPropertySchema (PCWSTR path)
 
HRESULT WINAPI PSGetPropertyDescription (REFPROPERTYKEY propkey, REFIID riid, void **ppv)
 
HRESULT WINAPI PSGetPropertyDescriptionListFromString (LPCWSTR proplist, REFIID riid, void **ppv)
 
HRESULT WINAPI PSGetPropertyKeyFromName (PCWSTR name, PROPERTYKEY *key)
 
HRESULT WINAPI PSRefreshPropertySchema (void)
 
HRESULT WINAPI PSStringFromPropertyKey (REFPROPERTYKEY pkey, LPWSTR psz, UINT cch)
 
static BOOL validate_indices (LPCWSTR s, int min, int max)
 
static BOOL string_to_guid (LPCWSTR s, LPGUID id)
 
HRESULT WINAPI PSPropertyKeyFromString (LPCWSTR pszString, PROPERTYKEY *pkey)
 
HRESULT WINAPI PSCreateMemoryPropertyStore (REFIID riid, void **ppv)
 

Variables

static HINSTANCE propsys_hInstance
 
static const IClassFactoryVtbl InMemoryPropertyStoreFactoryVtbl
 
static IClassFactory InMemoryPropertyStoreFactory = { &InMemoryPropertyStoreFactoryVtbl }
 
static const IPropertySystemVtbl propsysvtbl
 
static IPropertySystem propsys = { &propsysvtbl }
 
static const BYTE hex2bin []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file propsys_main.c.

Function Documentation

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 90 of file propsys_main.c.

91 {
92  TRACE("(%p)\n", iface);
93  return 2;
94 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  fLock 
)
static

Definition at line 102 of file propsys_main.c.

103 {
104  TRACE("(%p)->(%x)\n", iface, fLock);
105 
106  return S_OK;
107 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 69 of file propsys_main.c.

70 {
71  *ppv = NULL;
72 
74  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
75  *ppv = iface;
76  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
77  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
78  *ppv = iface;
79  }
80 
81  if(*ppv) {
82  IUnknown_AddRef((IUnknown*)*ppv);
83  return S_OK;
84  }
85 
86  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
87  return E_NOINTERFACE;
88 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 96 of file propsys_main.c.

97 {
98  TRACE("(%p)\n", iface);
99  return 1;
100 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 138 of file propsys_main.c.

139 {
140  return S_FALSE;
141 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 127 of file propsys_main.c.

128 {
129  if(IsEqualGUID(&CLSID_InMemoryPropertyStore, rclsid)) {
130  TRACE("(CLSID_InMemoryPropertyStore %s %p)\n", debugstr_guid(riid), ppv);
131  return IClassFactory_QueryInterface(&InMemoryPropertyStoreFactory, riid, ppv);
132  }
133 
134  FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
136 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IClassFactory InMemoryPropertyStoreFactory
Definition: propsys_main.c:125

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 42 of file propsys_main.c.

43 {
44  TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
45 
46  switch (fdwReason)
47  {
48  case DLL_WINE_PREATTACH:
49  return FALSE; /* prefer native version */
50  case DLL_PROCESS_ATTACH:
51  propsys_hInstance = hinstDLL;
52  DisableThreadLibraryCalls(hinstDLL);
53  break;
54  }
55 
56  return TRUE;
57 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static IN DWORD IN LPVOID lpvReserved
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
static HINSTANCE propsys_hInstance
Definition: propsys_main.c:40

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 59 of file propsys_main.c.

60 {
62 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE propsys_hInstance
Definition: propsys_main.c:40

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 64 of file propsys_main.c.

65 {
67 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
static HINSTANCE propsys_hInstance
Definition: propsys_main.c:40

◆ InMemoryPropertyStoreFactory_CreateInstance()

static HRESULT WINAPI InMemoryPropertyStoreFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 109 of file propsys_main.c.

111 {
112  TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
113 
114  return PropertyStore_CreateInstance(outer, riid, ppv);
115 }
REFIID riid
Definition: precomp.h:44
HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppv)
Definition: propstore.c:451
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

◆ propsys_AddRef()

static ULONG WINAPI propsys_AddRef ( IPropertySystem iface)
static

Definition at line 157 of file propsys_main.c.

158 {
159  return 2;
160 }

◆ propsys_EnumeratePropertyDescriptions()

static HRESULT WINAPI propsys_EnumeratePropertyDescriptions ( IPropertySystem iface,
PROPDESC_ENUMFILTER  filter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 186 of file propsys_main.c.

188 {
189  FIXME("%d %s %p: stub\n", filter, debugstr_guid(riid), ppv);
190  return E_NOTIMPL;
191 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

◆ propsys_FormatForDisplay()

static HRESULT WINAPI propsys_FormatForDisplay ( IPropertySystem iface,
REFPROPERTYKEY  key,
REFPROPVARIANT  propvar,
PROPDESC_FORMAT_FLAGS  flags,
LPWSTR  dest,
DWORD  destlen 
)
static

Definition at line 193 of file propsys_main.c.

196 {
197  FIXME("%p %p %x %p %d: stub\n", key, propvar, flags, dest, destlen);
198  return E_NOTIMPL;
199 }
#define FIXME(fmt,...)
Definition: debug.h:111
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99
static char * dest
Definition: rtl.c:135
Definition: path.c:41

◆ propsys_FormatForDisplayAlloc()

static HRESULT WINAPI propsys_FormatForDisplayAlloc ( IPropertySystem iface,
REFPROPERTYKEY  key,
REFPROPVARIANT  propvar,
PROPDESC_FORMAT_FLAGS  flags,
LPWSTR text 
)
static

Definition at line 201 of file propsys_main.c.

204 {
205  FIXME("%p %p %x %p: stub\n", key, propvar, flags, text);
206  return E_NOTIMPL;
207 }
const WCHAR * text
Definition: package.c:1827
#define FIXME(fmt,...)
Definition: debug.h:111
GLbitfield flags
Definition: glext.h:7161
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: path.c:41

◆ propsys_GetPropertyDescription()

static HRESULT WINAPI propsys_GetPropertyDescription ( IPropertySystem iface,
REFPROPERTYKEY  propkey,
REFIID  riid,
void **  ppv 
)
static

Definition at line 167 of file propsys_main.c.

169 {
170  return PSGetPropertyDescription(propkey, riid, ppv);
171 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI PSGetPropertyDescription(REFPROPERTYKEY propkey, REFIID riid, void **ppv)
Definition: propsys_main.c:260

◆ propsys_GetPropertyDescriptionByName()

static HRESULT WINAPI propsys_GetPropertyDescriptionByName ( IPropertySystem iface,
LPCWSTR  canonical_name,
REFIID  riid,
void **  ppv 
)
static

Definition at line 173 of file propsys_main.c.

175 {
176  FIXME("%s %s %p: stub\n", debugstr_w(canonical_name), debugstr_guid(riid), ppv);
177  return E_NOTIMPL;
178 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ propsys_GetPropertyDescriptionListFromString()

static HRESULT WINAPI propsys_GetPropertyDescriptionListFromString ( IPropertySystem iface,
LPCWSTR  proplist,
REFIID  riid,
void **  ppv 
)
static

Definition at line 180 of file propsys_main.c.

182 {
184 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI PSGetPropertyDescriptionListFromString(LPCWSTR proplist, REFIID riid, void **ppv)
Definition: propsys_main.c:266

◆ propsys_QueryInterface()

static HRESULT WINAPI propsys_QueryInterface ( IPropertySystem iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 143 of file propsys_main.c.

144 {
145  *obj = NULL;
146 
147  if (IsEqualIID(riid, &IID_IPropertySystem) || IsEqualIID(riid, &IID_IUnknown)) {
148  *obj = iface;
149  IPropertySystem_AddRef(iface);
150  return S_OK;
151  }
152 
153  FIXME("%s\n", debugstr_guid(riid));
154  return E_NOINTERFACE;
155 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ propsys_RefreshPropertySchema()

static HRESULT WINAPI propsys_RefreshPropertySchema ( IPropertySystem iface)
static

Definition at line 219 of file propsys_main.c.

220 {
221  return PSRefreshPropertySchema();
222 }
HRESULT WINAPI PSRefreshPropertySchema(void)
Definition: propsys_main.c:278

◆ propsys_RegisterPropertySchema()

static HRESULT WINAPI propsys_RegisterPropertySchema ( IPropertySystem iface,
LPCWSTR  path 
)
static

Definition at line 209 of file propsys_main.c.

210 {
212 }
HRESULT WINAPI PSRegisterPropertySchema(PCWSTR path)
Definition: propsys_main.c:246

◆ propsys_Release()

static ULONG WINAPI propsys_Release ( IPropertySystem iface)
static

Definition at line 162 of file propsys_main.c.

163 {
164  return 1;
165 }

◆ propsys_UnregisterPropertySchema()

static HRESULT WINAPI propsys_UnregisterPropertySchema ( IPropertySystem iface,
LPCWSTR  path 
)
static

Definition at line 214 of file propsys_main.c.

215 {
217 }
HRESULT WINAPI PSUnregisterPropertySchema(PCWSTR path)
Definition: propsys_main.c:253

◆ PSCreateMemoryPropertyStore()

HRESULT WINAPI PSCreateMemoryPropertyStore ( REFIID  riid,
void **  ppv 
)

Definition at line 514 of file propsys_main.c.

515 {
516  TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
517 
519 }
REFIID riid
Definition: precomp.h:44
HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppv)
Definition: propstore.c:451
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by test_propertystore(), and test_PSCreateMemoryPropertyStore().

◆ PSGetPropertyDescription()

HRESULT WINAPI PSGetPropertyDescription ( REFPROPERTYKEY  propkey,
REFIID  riid,
void **  ppv 
)

Definition at line 260 of file propsys_main.c.

261 {
262  FIXME("%p, %p, %p\n", propkey, riid, ppv);
263  return E_NOTIMPL;
264 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by propsys_GetPropertyDescription().

◆ PSGetPropertyDescriptionListFromString()

HRESULT WINAPI PSGetPropertyDescriptionListFromString ( LPCWSTR  proplist,
REFIID  riid,
void **  ppv 
)

Definition at line 266 of file propsys_main.c.

267 {
268  FIXME("%s, %p, %p\n", debugstr_w(proplist), riid, ppv);
269  return E_NOTIMPL;
270 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by propsys_GetPropertyDescriptionListFromString().

◆ PSGetPropertyKeyFromName()

HRESULT WINAPI PSGetPropertyKeyFromName ( PCWSTR  name,
PROPERTYKEY *  key 
)

Definition at line 272 of file propsys_main.c.

273 {
274  FIXME("%s, %p\n", debugstr_w(name), key);
275  return E_NOTIMPL;
276 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
Definition: name.c:38
Definition: path.c:41

◆ PSGetPropertySystem()

HRESULT WINAPI PSGetPropertySystem ( REFIID  riid,
void **  obj 
)

Definition at line 241 of file propsys_main.c.

242 {
243  return IPropertySystem_QueryInterface(&propsys, riid, obj);
244 }
REFIID riid
Definition: precomp.h:44
static IPropertySystem propsys
Definition: propsys_main.c:239

◆ PSPropertyKeyFromString()

HRESULT WINAPI PSPropertyKeyFromString ( LPCWSTR  pszString,
PROPERTYKEY *  pkey 
)

Definition at line 432 of file propsys_main.c.

433 {
434  BOOL has_minus = FALSE, has_comma = FALSE;
435 
436  TRACE("(%s, %p)\n", debugstr_w(pszString), pkey);
437 
438  if (!pszString || !pkey)
439  return E_POINTER;
440 
441  memset(pkey, 0, sizeof(PROPERTYKEY));
442 
443  if (!string_to_guid(pszString, &pkey->fmtid))
444  return E_INVALIDARG;
445 
446  pszString += GUIDSTRING_MAX - 1;
447 
448  if (!*pszString)
449  return E_INVALIDARG;
450 
451  /* Only the space seems to be recognized as whitespace. The comma is only
452  * recognized once and processing terminates if another comma is found. */
453  while (*pszString == ' ' || *pszString == ',')
454  {
455  if (*pszString == ',')
456  {
457  if (has_comma)
458  return S_OK;
459  else
460  has_comma = TRUE;
461  }
462  pszString++;
463  }
464 
465  if (!*pszString)
466  return E_INVALIDARG;
467 
468  /* Only two minus signs are recognized if no comma is detected. The first
469  * sign is ignored, and the second is interpreted. If a comma is detected
470  * before the minus sign, then only one minus sign counts, and property ID
471  * interpretation begins with the next character. */
472  if (has_comma)
473  {
474  if (*pszString == '-')
475  {
476  has_minus = TRUE;
477  pszString++;
478  }
479  }
480  else
481  {
482  if (*pszString == '-')
483  pszString++;
484 
485  /* Skip any intermediate spaces after the first minus sign. */
486  while (*pszString == ' ')
487  pszString++;
488 
489  if (*pszString == '-')
490  {
491  has_minus = TRUE;
492  pszString++;
493  }
494 
495  /* Skip any remaining spaces after minus sign. */
496  while (*pszString == ' ')
497  pszString++;
498  }
499 
500  /* Overflow is not checked. */
501  while (iswdigit(*pszString))
502  {
503  pkey->pid *= 10;
504  pkey->pid += (*pszString - '0');
505  pszString++;
506  }
507 
508  if (has_minus)
509  pkey->pid = ~pkey->pid + 1;
510 
511  return S_OK;
512 }
#define TRUE
Definition: types.h:120
#define iswdigit(_c)
Definition: ctype.h:667
static BOOL string_to_guid(LPCWSTR s, LPGUID id)
Definition: propsys_main.c:397
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
Definition: wincrypt.h:4505

Referenced by test_PSPropertyKeyFromString().

◆ PSRefreshPropertySchema()

HRESULT WINAPI PSRefreshPropertySchema ( void  )

Definition at line 278 of file propsys_main.c.

279 {
280  FIXME("\n");
281  return S_OK;
282 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:51

Referenced by propsys_RefreshPropertySchema(), and test_PSRefreshPropertySchema().

◆ PSRegisterPropertySchema()

HRESULT WINAPI PSRegisterPropertySchema ( PCWSTR  path)

Definition at line 246 of file propsys_main.c.

247 {
248  FIXME("%s stub\n", debugstr_w(path));
249 
250  return S_OK;
251 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:51

Referenced by propsys_RegisterPropertySchema().

◆ PSStringFromPropertyKey()

HRESULT WINAPI PSStringFromPropertyKey ( REFPROPERTYKEY  pkey,
LPWSTR  psz,
UINT  cch 
)

Definition at line 284 of file propsys_main.c.

285 {
286  static const WCHAR guid_fmtW[] = {'{','%','0','8','X','-','%','0','4','X','-',
287  '%','0','4','X','-','%','0','2','X','%','0','2','X','-',
288  '%','0','2','X','%','0','2','X','%','0','2','X',
289  '%','0','2','X','%','0','2','X','%','0','2','X','}',0};
290  static const WCHAR pid_fmtW[] = {'%','u',0};
291 
292  WCHAR pidW[PKEY_PIDSTR_MAX + 1];
293  LPWSTR p = psz;
294  int len;
295 
296  TRACE("(%p, %p, %u)\n", pkey, psz, cch);
297 
298  if (!psz)
299  return E_POINTER;
300 
301  /* GUIDSTRING_MAX accounts for null terminator, +1 for space character. */
302  if (cch <= GUIDSTRING_MAX + 1)
304 
305  if (!pkey)
306  {
307  psz[0] = '\0';
309  }
310 
311  swprintf(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2,
312  pkey->fmtid.Data3, pkey->fmtid.Data4[0], pkey->fmtid.Data4[1],
313  pkey->fmtid.Data4[2], pkey->fmtid.Data4[3], pkey->fmtid.Data4[4],
314  pkey->fmtid.Data4[5], pkey->fmtid.Data4[6], pkey->fmtid.Data4[7]);
315 
316  /* Overwrite the null terminator with the space character. */
317  p += GUIDSTRING_MAX - 1;
318  *p++ = ' ';
319  cch -= GUIDSTRING_MAX - 1 + 1;
320 
321  len = swprintf(pidW, pid_fmtW, pkey->pid);
322 
323  if (cch >= len + 1)
324  {
325  lstrcpyW(p, pidW);
326  return S_OK;
327  }
328  else
329  {
330  WCHAR *ptr = pidW + len - 1;
331 
332  psz[0] = '\0';
333  *p++ = '\0';
334  cch--;
335 
336  /* Replicate a quirk of the native implementation where the contents
337  * of the property ID string are written backwards to the output
338  * buffer, skipping the rightmost digit. */
339  if (cch)
340  {
341  ptr--;
342  while (cch--)
343  *p++ = *ptr--;
344  }
345 
347  }
348 }
static PVOID ptr
Definition: dispmode.c:27
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:201
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
GLenum GLsizei len
Definition: glext.h:6722
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
#define S_OK
Definition: intsafe.h:51
#define lstrcpyW
Definition: compat.h:608
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define E_POINTER
Definition: winerror.h:2365

Referenced by test_PSStringFromPropertyKey().

◆ PSUnregisterPropertySchema()

HRESULT WINAPI PSUnregisterPropertySchema ( PCWSTR  path)

Definition at line 253 of file propsys_main.c.

254 {
255  FIXME("%s stub\n", debugstr_w(path));
256 
257  return E_NOTIMPL;
258 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by propsys_UnregisterPropertySchema().

◆ string_to_guid()

static BOOL string_to_guid ( LPCWSTR  s,
LPGUID  id 
)
static

Definition at line 397 of file propsys_main.c.

398 {
399  /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
400 
401  if (!validate_indices(s, 0, 8)) return FALSE;
402  id->Data1 = (hex2bin[s[1]] << 28 | hex2bin[s[2]] << 24 | hex2bin[s[3]] << 20 | hex2bin[s[4]] << 16 |
403  hex2bin[s[5]] << 12 | hex2bin[s[6]] << 8 | hex2bin[s[7]] << 4 | hex2bin[s[8]]);
404  if (!validate_indices(s, 9, 14)) return FALSE;
405  id->Data2 = hex2bin[s[10]] << 12 | hex2bin[s[11]] << 8 | hex2bin[s[12]] << 4 | hex2bin[s[13]];
406  if (!validate_indices(s, 15, 19)) return FALSE;
407  id->Data3 = hex2bin[s[15]] << 12 | hex2bin[s[16]] << 8 | hex2bin[s[17]] << 4 | hex2bin[s[18]];
408 
409  /* these are just sequential bytes */
410 
411  if (!validate_indices(s, 20, 21)) return FALSE;
412  id->Data4[0] = hex2bin[s[20]] << 4 | hex2bin[s[21]];
413  if (!validate_indices(s, 22, 24)) return FALSE;
414  id->Data4[1] = hex2bin[s[22]] << 4 | hex2bin[s[23]];
415 
416  if (!validate_indices(s, 25, 26)) return FALSE;
417  id->Data4[2] = hex2bin[s[25]] << 4 | hex2bin[s[26]];
418  if (!validate_indices(s, 27, 28)) return FALSE;
419  id->Data4[3] = hex2bin[s[27]] << 4 | hex2bin[s[28]];
420  if (!validate_indices(s, 29, 30)) return FALSE;
421  id->Data4[4] = hex2bin[s[29]] << 4 | hex2bin[s[30]];
422  if (!validate_indices(s, 31, 32)) return FALSE;
423  id->Data4[5] = hex2bin[s[31]] << 4 | hex2bin[s[32]];
424  if (!validate_indices(s, 33, 34)) return FALSE;
425  id->Data4[6] = hex2bin[s[33]] << 4 | hex2bin[s[34]];
426  if (!validate_indices(s, 35, 37)) return FALSE;
427  id->Data4[7] = hex2bin[s[35]] << 4 | hex2bin[s[36]];
428 
429  return TRUE;
430 }
#define TRUE
Definition: types.h:120
static BOOL validate_indices(LPCWSTR s, int min, int max)
Definition: propsys_main.c:361
#define FALSE
Definition: types.h:117
static const BYTE hex2bin[]
Definition: propsys_main.c:350
GLdouble s
Definition: gl.h:2039

Referenced by PSPropertyKeyFromString().

◆ validate_indices()

static BOOL validate_indices ( LPCWSTR  s,
int  min,
int  max 
)
static

Definition at line 361 of file propsys_main.c.

362 {
363  int i;
364 
365  for (i = min; i <= max; i++)
366  {
367  if (!s[i])
368  return FALSE;
369 
370  if (i == 0)
371  {
372  if (s[i] != '{')
373  return FALSE;
374  }
375  else if (i == 9 || i == 14 || i == 19 || i == 24)
376  {
377  if (s[i] != '-')
378  return FALSE;
379  }
380  else if (i == 37)
381  {
382  if (s[i] != '}')
383  return FALSE;
384  }
385  else
386  {
387  if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0'))
388  return FALSE;
389  }
390  }
391 
392  return TRUE;
393 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
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 FALSE
Definition: types.h:117
static const BYTE hex2bin[]
Definition: propsys_main.c:350
GLdouble s
Definition: gl.h:2039
#define min(a, b)
Definition: monoChain.cc:55

Referenced by string_to_guid().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( propsys  )

Variable Documentation

◆ hex2bin

const BYTE hex2bin[]
static
Initial value:
=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0,
0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,10,11,12,13,14,15
}

Definition at line 350 of file propsys_main.c.

Referenced by string_to_guid(), and validate_indices().

◆ InMemoryPropertyStoreFactory

IClassFactory InMemoryPropertyStoreFactory = { &InMemoryPropertyStoreFactoryVtbl }
static

Definition at line 125 of file propsys_main.c.

Referenced by DllGetClassObject().

◆ InMemoryPropertyStoreFactoryVtbl

const IClassFactoryVtbl InMemoryPropertyStoreFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: propsys_main.c:102
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: propsys_main.c:69
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: propsys_main.c:96
static HRESULT WINAPI InMemoryPropertyStoreFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: propsys_main.c:109
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: propsys_main.c:90

Definition at line 117 of file propsys_main.c.

◆ propsys

IPropertySystem propsys = { &propsysvtbl }
static

Definition at line 239 of file propsys_main.c.

Referenced by propvar_changetype(), and PSGetPropertySystem().

◆ propsys_hInstance

HINSTANCE propsys_hInstance
static

Definition at line 40 of file propsys_main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ propsysvtbl

const IPropertySystemVtbl propsysvtbl
static
Initial value:
= {
}
static HRESULT WINAPI propsys_UnregisterPropertySchema(IPropertySystem *iface, LPCWSTR path)
Definition: propsys_main.c:214
static HRESULT WINAPI propsys_EnumeratePropertyDescriptions(IPropertySystem *iface, PROPDESC_ENUMFILTER filter, REFIID riid, void **ppv)
Definition: propsys_main.c:186
static ULONG WINAPI propsys_AddRef(IPropertySystem *iface)
Definition: propsys_main.c:157
static HRESULT WINAPI propsys_GetPropertyDescription(IPropertySystem *iface, REFPROPERTYKEY propkey, REFIID riid, void **ppv)
Definition: propsys_main.c:167
static HRESULT WINAPI propsys_FormatForDisplayAlloc(IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR *text)
Definition: propsys_main.c:201
static HRESULT WINAPI propsys_QueryInterface(IPropertySystem *iface, REFIID riid, void **obj)
Definition: propsys_main.c:143
static HRESULT WINAPI propsys_FormatForDisplay(IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR dest, DWORD destlen)
Definition: propsys_main.c:193
static HRESULT WINAPI propsys_GetPropertyDescriptionListFromString(IPropertySystem *iface, LPCWSTR proplist, REFIID riid, void **ppv)
Definition: propsys_main.c:180
static HRESULT WINAPI propsys_RegisterPropertySchema(IPropertySystem *iface, LPCWSTR path)
Definition: propsys_main.c:209
static HRESULT WINAPI propsys_GetPropertyDescriptionByName(IPropertySystem *iface, LPCWSTR canonical_name, REFIID riid, void **ppv)
Definition: propsys_main.c:173
static HRESULT WINAPI propsys_RefreshPropertySchema(IPropertySystem *iface)
Definition: propsys_main.c:219
static ULONG WINAPI propsys_Release(IPropertySystem *iface)
Definition: propsys_main.c:162

Definition at line 224 of file propsys_main.c.