ReactOS  0.4.14-dev-317-g96040ec
propsys_main.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "propsys.h"
#include "wine/debug.h"
#include "wine/unicode.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)
 

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 89 of file propsys_main.c.

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

◆ ClassFactory_LockServer()

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

Definition at line 101 of file propsys_main.c.

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

◆ ClassFactory_QueryInterface()

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

Definition at line 68 of file propsys_main.c.

69 {
70  *ppv = NULL;
71 
73  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
74  *ppv = iface;
75  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
76  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
77  *ppv = iface;
78  }
79 
80  if(*ppv) {
81  IUnknown_AddRef((IUnknown*)*ppv);
82  return S_OK;
83  }
84 
85  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
86  return E_NOINTERFACE;
87 }
#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:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
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 95 of file propsys_main.c.

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

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 137 of file propsys_main.c.

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

◆ DllGetClassObject()

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

Definition at line 126 of file propsys_main.c.

127 {
128  if(IsEqualGUID(&CLSID_InMemoryPropertyStore, rclsid)) {
129  TRACE("(CLSID_InMemoryPropertyStore %s %p)\n", debugstr_guid(riid), ppv);
130  return IClassFactory_QueryInterface(&InMemoryPropertyStoreFactory, riid, ppv);
131  }
132 
133  FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
135 }
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:110
#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:124

◆ DllMain()

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

Definition at line 41 of file propsys_main.c.

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

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 58 of file propsys_main.c.

59 {
61 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE propsys_hInstance
Definition: propsys_main.c:39

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 63 of file propsys_main.c.

64 {
66 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
static HINSTANCE propsys_hInstance
Definition: propsys_main.c:39

◆ InMemoryPropertyStoreFactory_CreateInstance()

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

Definition at line 108 of file propsys_main.c.

110 {
111  TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
112 
113  return PropertyStore_CreateInstance(outer, riid, ppv);
114 }
REFIID riid
Definition: precomp.h:44
HRESULT PropertyStore_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void **ppv)
Definition: propstore.c:453
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 156 of file propsys_main.c.

157 {
158  return 2;
159 }

◆ propsys_EnumeratePropertyDescriptions()

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

Definition at line 185 of file propsys_main.c.

187 {
188  FIXME("%d %s %p: stub\n", filter, debugstr_guid(riid), ppv);
189  return E_NOTIMPL;
190 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
#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 192 of file propsys_main.c.

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

◆ propsys_FormatForDisplayAlloc()

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

Definition at line 200 of file propsys_main.c.

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

◆ propsys_GetPropertyDescription()

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

Definition at line 166 of file propsys_main.c.

168 {
169  return PSGetPropertyDescription(propkey, riid, ppv);
170 }
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:259

◆ propsys_GetPropertyDescriptionByName()

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

Definition at line 172 of file propsys_main.c.

174 {
175  FIXME("%s %s %p: stub\n", debugstr_w(canonical_name), debugstr_guid(riid), ppv);
176  return E_NOTIMPL;
177 }
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:110
#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 179 of file propsys_main.c.

181 {
183 }
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:265

◆ propsys_QueryInterface()

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

Definition at line 142 of file propsys_main.c.

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

◆ propsys_RefreshPropertySchema()

static HRESULT WINAPI propsys_RefreshPropertySchema ( IPropertySystem iface)
static

Definition at line 218 of file propsys_main.c.

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

◆ propsys_RegisterPropertySchema()

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

Definition at line 208 of file propsys_main.c.

209 {
211 }
HRESULT WINAPI PSRegisterPropertySchema(PCWSTR path)
Definition: propsys_main.c:245
Definition: services.c:325

◆ propsys_Release()

static ULONG WINAPI propsys_Release ( IPropertySystem iface)
static

Definition at line 161 of file propsys_main.c.

162 {
163  return 1;
164 }

◆ propsys_UnregisterPropertySchema()

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

Definition at line 213 of file propsys_main.c.

214 {
216 }
HRESULT WINAPI PSUnregisterPropertySchema(PCWSTR path)
Definition: propsys_main.c:252
Definition: services.c:325

◆ PSGetPropertyDescription()

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

Definition at line 259 of file propsys_main.c.

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

Referenced by propsys_GetPropertyDescription().

◆ PSGetPropertyDescriptionListFromString()

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

Definition at line 265 of file propsys_main.c.

266 {
267  FIXME("%s, %p, %p\n", debugstr_w(proplist), riid, ppv);
268  return E_NOTIMPL;
269 }
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:110
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by propsys_GetPropertyDescriptionListFromString().

◆ PSGetPropertyKeyFromName()

HRESULT WINAPI PSGetPropertyKeyFromName ( PCWSTR  name,
PROPERTYKEY *  key 
)

Definition at line 271 of file propsys_main.c.

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

◆ PSGetPropertySystem()

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

Definition at line 240 of file propsys_main.c.

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

◆ PSPropertyKeyFromString()

HRESULT WINAPI PSPropertyKeyFromString ( LPCWSTR  pszString,
PROPERTYKEY *  pkey 
)

Definition at line 431 of file propsys_main.c.

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

Referenced by test_PSPropertyKeyFromString().

◆ PSRefreshPropertySchema()

HRESULT WINAPI PSRefreshPropertySchema ( void  )

Definition at line 277 of file propsys_main.c.

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

Referenced by propsys_RefreshPropertySchema(), and test_PSRefreshPropertySchema().

◆ PSRegisterPropertySchema()

HRESULT WINAPI PSRegisterPropertySchema ( PCWSTR  path)

Definition at line 245 of file propsys_main.c.

246 {
247  FIXME("%s stub\n", debugstr_w(path));
248 
249  return S_OK;
250 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59
Definition: services.c:325

Referenced by propsys_RegisterPropertySchema().

◆ PSStringFromPropertyKey()

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

Definition at line 283 of file propsys_main.c.

284 {
285  static const WCHAR guid_fmtW[] = {'{','%','0','8','X','-','%','0','4','X','-',
286  '%','0','4','X','-','%','0','2','X','%','0','2','X','-',
287  '%','0','2','X','%','0','2','X','%','0','2','X',
288  '%','0','2','X','%','0','2','X','%','0','2','X','}',0};
289  static const WCHAR pid_fmtW[] = {'%','u',0};
290 
291  WCHAR pidW[PKEY_PIDSTR_MAX + 1];
292  LPWSTR p = psz;
293  int len;
294 
295  TRACE("(%p, %p, %u)\n", pkey, psz, cch);
296 
297  if (!psz)
298  return E_POINTER;
299 
300  /* GUIDSTRING_MAX accounts for null terminator, +1 for space character. */
301  if (cch <= GUIDSTRING_MAX + 1)
303 
304  if (!pkey)
305  {
306  psz[0] = '\0';
308  }
309 
310  sprintfW(psz, guid_fmtW, pkey->fmtid.Data1, pkey->fmtid.Data2,
311  pkey->fmtid.Data3, pkey->fmtid.Data4[0], pkey->fmtid.Data4[1],
312  pkey->fmtid.Data4[2], pkey->fmtid.Data4[3], pkey->fmtid.Data4[4],
313  pkey->fmtid.Data4[5], pkey->fmtid.Data4[6], pkey->fmtid.Data4[7]);
314 
315  /* Overwrite the null terminator with the space character. */
316  p += GUIDSTRING_MAX - 1;
317  *p++ = ' ';
318  cch -= GUIDSTRING_MAX - 1 + 1;
319 
320  len = sprintfW(pidW, pid_fmtW, pkey->pid);
321 
322  if (cch >= len + 1)
323  {
324  strcpyW(p, pidW);
325  return S_OK;
326  }
327  else
328  {
329  WCHAR *ptr = pidW + len - 1;
330 
331  psz[0] = '\0';
332  *p++ = '\0';
333  cch--;
334 
335  /* Replicate a quirk of the native implementation where the contents
336  * of the property ID string are written backwards to the output
337  * buffer, skipping the rightmost digit. */
338  if (cch)
339  {
340  ptr--;
341  while (cch--)
342  *p++ = *ptr--;
343  }
344 
346  }
347 }
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
GLenum GLsizei len
Definition: glext.h:6722
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:2345
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define sprintfW
Definition: unicode.h:58
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 252 of file propsys_main.c.

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

Referenced by propsys_UnregisterPropertySchema().

◆ string_to_guid()

static BOOL string_to_guid ( LPCWSTR  s,
LPGUID  id 
)
static

Definition at line 396 of file propsys_main.c.

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

361 {
362  int i;
363 
364  for (i = min; i <= max; i++)
365  {
366  if (!s[i])
367  return FALSE;
368 
369  if (i == 0)
370  {
371  if (s[i] != '{')
372  return FALSE;
373  }
374  else if (i == 9 || i == 14 || i == 19 || i == 24)
375  {
376  if (s[i] != '-')
377  return FALSE;
378  }
379  else if (i == 37)
380  {
381  if (s[i] != '}')
382  return FALSE;
383  }
384  else
385  {
386  if (s[i] > 'f' || (!hex2bin[s[i]] && s[i] != '0'))
387  return FALSE;
388  }
389  }
390 
391  return TRUE;
392 }
#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
static const BYTE hex2bin[]
Definition: propsys_main.c:349
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 349 of file propsys_main.c.

Referenced by string_to_guid(), and validate_indices().

◆ InMemoryPropertyStoreFactory

IClassFactory InMemoryPropertyStoreFactory = { &InMemoryPropertyStoreFactoryVtbl }
static

Definition at line 124 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:101
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: propsys_main.c:68
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: propsys_main.c:95
static HRESULT WINAPI InMemoryPropertyStoreFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: propsys_main.c:108
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: propsys_main.c:89

Definition at line 116 of file propsys_main.c.

◆ propsys

IPropertySystem propsys = { &propsysvtbl }
static

Definition at line 238 of file propsys_main.c.

Referenced by propvar_changetype(), and PSGetPropertySystem().

◆ propsys_hInstance

HINSTANCE propsys_hInstance
static

Definition at line 39 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:213
static HRESULT WINAPI propsys_EnumeratePropertyDescriptions(IPropertySystem *iface, PROPDESC_ENUMFILTER filter, REFIID riid, void **ppv)
Definition: propsys_main.c:185
static ULONG WINAPI propsys_AddRef(IPropertySystem *iface)
Definition: propsys_main.c:156
static HRESULT WINAPI propsys_GetPropertyDescription(IPropertySystem *iface, REFPROPERTYKEY propkey, REFIID riid, void **ppv)
Definition: propsys_main.c:166
static HRESULT WINAPI propsys_FormatForDisplayAlloc(IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR *text)
Definition: propsys_main.c:200
static HRESULT WINAPI propsys_QueryInterface(IPropertySystem *iface, REFIID riid, void **obj)
Definition: propsys_main.c:142
static HRESULT WINAPI propsys_FormatForDisplay(IPropertySystem *iface, REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS flags, LPWSTR dest, DWORD destlen)
Definition: propsys_main.c:192
static HRESULT WINAPI propsys_GetPropertyDescriptionListFromString(IPropertySystem *iface, LPCWSTR proplist, REFIID riid, void **ppv)
Definition: propsys_main.c:179
static HRESULT WINAPI propsys_RegisterPropertySchema(IPropertySystem *iface, LPCWSTR path)
Definition: propsys_main.c:208
static HRESULT WINAPI propsys_GetPropertyDescriptionByName(IPropertySystem *iface, LPCWSTR canonical_name, REFIID riid, void **ppv)
Definition: propsys_main.c:172
static HRESULT WINAPI propsys_RefreshPropertySchema(IPropertySystem *iface)
Definition: propsys_main.c:218
static ULONG WINAPI propsys_Release(IPropertySystem *iface)
Definition: propsys_main.c:161

Definition at line 223 of file propsys_main.c.