ReactOS  0.4.14-dev-1256-g2125fec
path.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "wbemcli.h"
#include "wmiutils.h"
#include "wine/debug.h"
#include "wmiutils_private.h"
Include dependency graph for path.c:

Go to the source code of this file.

Classes

struct  keylist
 
struct  key
 
struct  path
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wmiutils)
 
static struct keylistimpl_from_IWbemPathKeyList (IWbemPathKeyList *iface)
 
static struct pathimpl_from_IWbemPath (IWbemPath *iface)
 
static ULONG WINAPI keylist_AddRef (IWbemPathKeyList *iface)
 
static ULONG WINAPI keylist_Release (IWbemPathKeyList *iface)
 
static HRESULT WINAPI keylist_QueryInterface (IWbemPathKeyList *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI keylist_GetCount (IWbemPathKeyList *iface, ULONG *puKeyCount)
 
static HRESULT WINAPI keylist_SetKey (IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags, ULONG uCimType, LPVOID pKeyVal)
 
static HRESULT WINAPI keylist_SetKey2 (IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags, ULONG uCimType, VARIANT *pKeyVal)
 
static HRESULT WINAPI keylist_GetKey (IWbemPathKeyList *iface, ULONG uKeyIx, ULONG uFlags, ULONG *puNameBufSize, LPWSTR pszKeyName, ULONG *puKeyValBufSize, LPVOID pKeyVal, ULONG *puApparentCimType)
 
static HRESULT WINAPI keylist_GetKey2 (IWbemPathKeyList *iface, ULONG uKeyIx, ULONG uFlags, ULONG *puNameBufSize, LPWSTR pszKeyName, VARIANT *pKeyValue, ULONG *puApparentCimType)
 
static HRESULT WINAPI keylist_RemoveKey (IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags)
 
static void free_keys (struct key *keys, unsigned int count)
 
static HRESULT WINAPI keylist_RemoveAllKeys (IWbemPathKeyList *iface, ULONG uFlags)
 
static HRESULT WINAPI keylist_MakeSingleton (IWbemPathKeyList *iface, boolean bSet)
 
static HRESULT WINAPI keylist_GetInfo (IWbemPathKeyList *iface, ULONG uRequestedInfo, ULONGLONG *puResponse)
 
static HRESULT WINAPI keylist_GetText (IWbemPathKeyList *iface, LONG lFlags, ULONG *puBuffLength, LPWSTR pszText)
 
static HRESULT WbemPathKeyList_create (IWbemPath *parent, LPVOID *ppObj)
 
static void init_path (struct path *path)
 
static void clear_path (struct path *path)
 
static ULONG WINAPI path_AddRef (IWbemPath *iface)
 
static ULONG WINAPI path_Release (IWbemPath *iface)
 
static HRESULT WINAPI path_QueryInterface (IWbemPath *iface, REFIID riid, void **ppvObject)
 
static HRESULT parse_key (struct key *key, const WCHAR *str, unsigned int *ret_len)
 
static HRESULT parse_text (struct path *path, ULONG mode, const WCHAR *text)
 
static HRESULT WINAPI path_SetText (IWbemPath *iface, ULONG uMode, LPCWSTR pszPath)
 
static WCHARbuild_namespace (struct path *path, int *len, BOOL leading_slash)
 
static WCHARbuild_server (struct path *path, int *len)
 
static WCHARbuild_keylist (struct path *path, int *len)
 
static WCHARbuild_path (struct path *path, LONG flags, int *len)
 
static HRESULT WINAPI path_GetText (IWbemPath *iface, LONG lFlags, ULONG *puBufferLength, LPWSTR pszText)
 
static HRESULT WINAPI path_GetInfo (IWbemPath *iface, ULONG info, ULONGLONG *response)
 
static HRESULT WINAPI path_SetServer (IWbemPath *iface, LPCWSTR name)
 
static HRESULT WINAPI path_GetServer (IWbemPath *iface, ULONG *len, LPWSTR name)
 
static HRESULT WINAPI path_GetNamespaceCount (IWbemPath *iface, ULONG *puCount)
 
static HRESULT WINAPI path_SetNamespaceAt (IWbemPath *iface, ULONG idx, LPCWSTR name)
 
static HRESULT WINAPI path_GetNamespaceAt (IWbemPath *iface, ULONG idx, ULONG *len, LPWSTR name)
 
static HRESULT WINAPI path_RemoveNamespaceAt (IWbemPath *iface, ULONG idx)
 
static HRESULT WINAPI path_RemoveAllNamespaces (IWbemPath *iface)
 
static HRESULT WINAPI path_GetScopeCount (IWbemPath *iface, ULONG *puCount)
 
static HRESULT WINAPI path_SetScope (IWbemPath *iface, ULONG uIndex, LPWSTR pszClass)
 
static HRESULT WINAPI path_SetScopeFromText (IWbemPath *iface, ULONG uIndex, LPWSTR pszText)
 
static HRESULT WINAPI path_GetScope (IWbemPath *iface, ULONG uIndex, ULONG *puClassNameBufSize, LPWSTR pszClass, IWbemPathKeyList **pKeyList)
 
static HRESULT WINAPI path_GetScopeAsText (IWbemPath *iface, ULONG uIndex, ULONG *puTextBufSize, LPWSTR pszText)
 
static HRESULT WINAPI path_RemoveScope (IWbemPath *iface, ULONG uIndex)
 
static HRESULT WINAPI path_RemoveAllScopes (IWbemPath *iface)
 
static HRESULT WINAPI path_SetClassName (IWbemPath *iface, LPCWSTR name)
 
static HRESULT WINAPI path_GetClassName (IWbemPath *iface, ULONG *len, LPWSTR name)
 
static HRESULT WINAPI path_GetKeyList (IWbemPath *iface, IWbemPathKeyList **pOut)
 
static HRESULT WINAPI path_CreateClassPart (IWbemPath *iface, LONG lFlags, LPCWSTR Name)
 
static HRESULT WINAPI path_DeleteClassPart (IWbemPath *iface, LONG lFlags)
 
static BOOL WINAPI path_IsRelative (IWbemPath *iface, LPWSTR wszMachine, LPWSTR wszNamespace)
 
static BOOL WINAPI path_IsRelativeOrChild (IWbemPath *iface, LPWSTR wszMachine, LPWSTR wszNamespace, LONG lFlags)
 
static BOOL WINAPI path_IsLocal (IWbemPath *iface, LPCWSTR wszMachine)
 
static BOOL WINAPI path_IsSameClassName (IWbemPath *iface, LPCWSTR wszClass)
 
HRESULT WbemPath_create (LPVOID *ppObj)
 

Variables

static const struct IWbemPathKeyListVtbl keylist_vtbl
 
static const struct IWbemPathVtbl path_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file path.c.

Function Documentation

◆ build_keylist()

static WCHAR* build_keylist ( struct path path,
int len 
)
static

Definition at line 589 of file path.c.

590 {
591  WCHAR *ret, *p;
592  unsigned int i;
593 
594  *len = 0;
595  for (i = 0; i < path->num_keys; i++)
596  {
597  if (i > 0) *len += 1;
598  *len += path->keys[i].len_name + path->keys[i].len_value + 1;
599  }
600  if (!(p = ret = heap_alloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
601  for (i = 0; i < path->num_keys; i++)
602  {
603  if (i > 0) *p++ = ',';
604  memcpy( p, path->keys[i].name, path->keys[i].len_name * sizeof(WCHAR) );
605  p += path->keys[i].len_name;
606  *p++ = '=';
607  memcpy( p, path->keys[i].value, path->keys[i].len_value * sizeof(WCHAR) );
608  p += path->keys[i].len_value;
609  }
610  *p = 0;
611  return ret;
612 }
DWORD ret
Definition: path.c:47
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned int num_keys
Definition: path.c:64
struct key * keys
Definition: path.c:63
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by build_path().

◆ build_namespace()

static WCHAR* build_namespace ( struct path path,
int len,
BOOL  leading_slash 
)
static

Definition at line 545 of file path.c.

546 {
547  WCHAR *ret, *p;
548  int i;
549 
550  *len = 0;
551  for (i = 0; i < path->num_namespaces; i++)
552  {
553  if (i > 0 || leading_slash) *len += 1;
554  *len += path->len_namespaces[i];
555  }
556  if (!(p = ret = heap_alloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
557  for (i = 0; i < path->num_namespaces; i++)
558  {
559  if (i > 0 || leading_slash) *p++ = '\\';
560  memcpy( p, path->namespaces[i], path->len_namespaces[i] * sizeof(WCHAR) );
561  p += path->len_namespaces[i];
562  }
563  *p = 0;
564  return ret;
565 }
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
DWORD ret
Definition: path.c:47
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
int * len_namespaces
Definition: path.c:59
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by build_path().

◆ build_path()

static WCHAR* build_path ( struct path path,
LONG  flags,
int len 
)
static

Definition at line 614 of file path.c.

615 {
616  *len = 0;
617  switch (flags)
618  {
619  case 0:
620  {
621  int len_namespace, len_keylist;
622  WCHAR *ret, *namespace = build_namespace( path, &len_namespace, FALSE );
623  WCHAR *keylist = build_keylist( path, &len_keylist );
624 
625  if (!namespace || !keylist)
626  {
627  heap_free( namespace );
628  heap_free( keylist );
629  return NULL;
630  }
631  *len = len_namespace;
632  if (path->len_class)
633  {
634  *len += path->len_class + 1;
635  if (path->num_keys) *len += len_keylist + 1;
636  }
637  if (!(ret = heap_alloc( (*len + 1) * sizeof(WCHAR) )))
638  {
639  heap_free( namespace );
640  heap_free( keylist );
641  return NULL;
642  }
643  lstrcpyW( ret, namespace );
644  if (path->len_class)
645  {
646  ret[len_namespace] = ':';
647  lstrcpyW( ret + len_namespace + 1, path->class );
648  if (path->num_keys)
649  {
650  ret[len_namespace + path->len_class + 1] = '.';
651  lstrcpyW( ret + len_namespace + path->len_class + 2, keylist );
652  }
653  }
654  heap_free( namespace );
655  heap_free( keylist );
656  return ret;
657 
658  }
660  {
661  int len_keylist;
662  WCHAR *ret, *keylist;
663 
664  if (!path->len_class) return NULL;
665  if (!(keylist = build_keylist( path, &len_keylist ))) return NULL;
666 
667  *len = path->len_class;
668  if (path->num_keys) *len += len_keylist + 1;
669  if (!(ret = heap_alloc( (*len + 1) * sizeof(WCHAR) )))
670  {
671  heap_free( keylist );
672  return NULL;
673  }
674  lstrcpyW( ret, path->class );
675  if (path->num_keys)
676  {
677  ret[path->len_class] = '.';
678  lstrcpyW( ret + path->len_class + 1, keylist );
679  }
680  heap_free( keylist );
681  return ret;
682  }
684  {
685  int len_namespace, len_server, len_keylist;
686  WCHAR *p, *ret, *namespace = build_namespace( path, &len_namespace, TRUE );
687  WCHAR *server = build_server( path, &len_server );
688  WCHAR *keylist = build_keylist( path, &len_keylist );
689 
690  if (!namespace || !server || !keylist)
691  {
692  heap_free( namespace );
693  heap_free( server );
694  heap_free( keylist );
695  return NULL;
696  }
697  *len = len_namespace + len_server;
698  if (path->len_class)
699  {
700  *len += path->len_class + 1;
701  if (path->num_keys) *len += len_keylist + 1;
702  }
703  if (!(p = ret = heap_alloc( (*len + 1) * sizeof(WCHAR) )))
704  {
705  heap_free( namespace );
706  heap_free( server );
707  heap_free( keylist );
708  return NULL;
709  }
710  lstrcpyW( p, server );
711  p += len_server;
712  lstrcpyW( p, namespace );
713  p += len_namespace;
714  if (path->len_class)
715  {
716  *p++ = ':';
717  lstrcpyW( p, path->class );
718  if (path->num_keys)
719  {
720  p[path->len_class] = '.';
721  lstrcpyW( p + path->len_class + 1, keylist );
722  }
723  }
724  heap_free( namespace );
725  heap_free( server );
726  heap_free( keylist );
727  return ret;
728  }
730  {
731  int len_namespace, len_server;
732  WCHAR *p, *ret, *namespace = build_namespace( path, &len_namespace, TRUE );
733  WCHAR *server = build_server( path, &len_server );
734 
735  if (!namespace || !server)
736  {
737  heap_free( namespace );
738  heap_free( server );
739  return NULL;
740  }
741  *len = len_namespace + len_server;
742  if (!(p = ret = heap_alloc( (*len + 1) * sizeof(WCHAR) )))
743  {
744  heap_free( namespace );
745  heap_free( server );
746  return NULL;
747  }
748  lstrcpyW( p, server );
749  p += len_server;
750  lstrcpyW( p, namespace );
751  heap_free( namespace );
752  heap_free( server );
753  return ret;
754  }
756  return build_namespace( path, len, FALSE );
757 
759  if (!path->len_text) return NULL;
760  *len = path->len_text;
761  return strdupW( path->text );
762 
763  default:
764  ERR("unhandled flags 0x%x\n", flags);
765  return NULL;
766  }
767 }
#define TRUE
Definition: types.h:120
static WCHAR * build_keylist(struct path *path, int *len)
Definition: path.c:589
static rfbScreenInfoPtr server
Definition: vnc.c:74
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
DWORD ret
Definition: path.c:47
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
WCHAR * class
__wchar_t WCHAR
Definition: xmlstorage.h:180
int len_class
Definition: path.c:62
static WCHAR * build_namespace(struct path *path, int *len, BOOL leading_slash)
Definition: path.c:545
GLbitfield flags
Definition: glext.h:7161
static WCHAR * build_server(struct path *path, int *len)
Definition: path.c:567
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:109
WCHAR * text
Definition: path.c:54
#define lstrcpyW
Definition: compat.h:414
unsigned int num_keys
Definition: path.c:64
int len_text
Definition: path.c:55
GLfloat GLfloat p
Definition: glext.h:8902
Definition: path.c:34
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by path_GetText().

◆ build_server()

static WCHAR* build_server ( struct path path,
int len 
)
static

Definition at line 567 of file path.c.

568 {
569  WCHAR *ret, *p;
570 
571  *len = 0;
572  if (path->len_server) *len += 2 + path->len_server;
573  else *len += 3;
574  if (!(p = ret = heap_alloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
575  if (path->len_server)
576  {
577  p[0] = p[1] = '\\';
578  lstrcpyW( p + 2, path->server );
579  }
580  else
581  {
582  p[0] = p[1] = '\\';
583  p[2] = '.';
584  p[3] = 0;
585  }
586  return ret;
587 }
int len_server
Definition: path.c:57
DWORD ret
Definition: path.c:47
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * server
Definition: path.c:56
GLenum GLsizei len
Definition: glext.h:6722
#define lstrcpyW
Definition: compat.h:414
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by build_path().

◆ clear_path()

static void clear_path ( struct path path)
static

Definition at line 313 of file path.c.

314 {
315  unsigned int i;
316 
317  heap_free( path->text );
318  heap_free( path->server );
319  for (i = 0; i < path->num_namespaces; i++) heap_free( path->namespaces[i] );
322  heap_free( path->class );
324  init_path( path );
325 }
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
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
int * len_namespaces
Definition: path.c:59
static void free_keys(struct key *keys, unsigned int count)
Definition: path.c:201
WCHAR * class
WCHAR * server
Definition: path.c:56
WCHAR * text
Definition: path.c:54
unsigned int num_keys
Definition: path.c:64
struct key * keys
Definition: path.c:63
static void init_path(struct path *path)
Definition: path.c:297
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by parse_text(), path_Release(), and path_SetText().

◆ free_keys()

static void free_keys ( struct key keys,
unsigned int  count 
)
static

Definition at line 201 of file path.c.

202 {
203  unsigned int i;
204 
205  for (i = 0; i < count; i++)
206  {
207  heap_free( keys[i].name );
208  heap_free( keys[i].value );
209  }
210  heap_free( keys );
211 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
Definition: name.c:38
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by clear_path(), and keylist_RemoveAllKeys().

◆ impl_from_IWbemPath()

static struct path* impl_from_IWbemPath ( IWbemPath iface)
inlinestatic

Definition at line 73 of file path.c.

74 {
75  return CONTAINING_RECORD(iface, struct path, IWbemPath_iface);
76 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by keylist_GetCount(), keylist_RemoveAllKeys(), path_AddRef(), path_GetClassName(), path_GetInfo(), path_GetKeyList(), path_GetNamespaceAt(), path_GetNamespaceCount(), path_GetServer(), path_GetText(), path_QueryInterface(), path_Release(), path_RemoveAllNamespaces(), path_RemoveNamespaceAt(), path_SetClassName(), path_SetNamespaceAt(), path_SetServer(), and path_SetText().

◆ impl_from_IWbemPathKeyList()

static struct keylist* impl_from_IWbemPathKeyList ( IWbemPathKeyList iface)
inlinestatic

Definition at line 68 of file path.c.

69 {
70  return CONTAINING_RECORD(iface, struct keylist, IWbemPathKeyList_iface);
71 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: path.c:34

Referenced by keylist_AddRef(), keylist_GetCount(), keylist_QueryInterface(), keylist_Release(), and keylist_RemoveAllKeys().

◆ init_path()

static void init_path ( struct path path)
static

Definition at line 297 of file path.c.

298 {
299  path->text = NULL;
300  path->len_text = 0;
301  path->server = NULL;
302  path->len_server = 0;
303  path->namespaces = NULL;
305  path->num_namespaces = 0;
306  path->class = NULL;
307  path->len_class = 0;
308  path->keys = NULL;
309  path->num_keys = 0;
310  path->flags = 0;
311 }
WCHAR ** namespaces
Definition: path.c:58
int len_server
Definition: path.c:57
int num_namespaces
Definition: path.c:60
int * len_namespaces
Definition: path.c:59
smooth NULL
Definition: ftsmooth.c:416
WCHAR * class
int len_class
Definition: path.c:62
ULONGLONG flags
Definition: path.c:65
WCHAR * server
Definition: path.c:56
WCHAR * text
Definition: path.c:54
unsigned int num_keys
Definition: path.c:64
struct key * keys
Definition: path.c:63
int len_text
Definition: path.c:55

Referenced by clear_path(), and WbemPath_create().

◆ keylist_AddRef()

static ULONG WINAPI keylist_AddRef ( IWbemPathKeyList iface)
static

Definition at line 78 of file path.c.

80 {
81  struct keylist *keylist = impl_from_IWbemPathKeyList( iface );
82  return InterlockedIncrement( &keylist->refs );
83 }
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
LONG refs
Definition: path.c:38
#define InterlockedIncrement
Definition: armddk.h:53
Definition: path.c:34

◆ keylist_GetCount()

static HRESULT WINAPI keylist_GetCount ( IWbemPathKeyList iface,
ULONG puKeyCount 
)
static

Definition at line 122 of file path.c.

125 {
126  struct keylist *keylist = impl_from_IWbemPathKeyList( iface );
128 
129  TRACE("%p, %p\n", iface, puKeyCount);
130 
131  if (!puKeyCount) return WBEM_E_INVALID_PARAMETER;
132 
134 
135  *puKeyCount = parent->num_keys;
136 
138  return S_OK;
139 }
IWbemPath * parent
Definition: path.c:37
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2869
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
Definition: path.c:34

◆ keylist_GetInfo()

static HRESULT WINAPI keylist_GetInfo ( IWbemPathKeyList iface,
ULONG  uRequestedInfo,
ULONGLONG puResponse 
)
static

Definition at line 242 of file path.c.

246 {
247  FIXME("%p, %u, %p\n", iface, uRequestedInfo, puResponse);
248  return E_NOTIMPL;
249 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_GetKey()

static HRESULT WINAPI keylist_GetKey ( IWbemPathKeyList iface,
ULONG  uKeyIx,
ULONG  uFlags,
ULONG puNameBufSize,
LPWSTR  pszKeyName,
ULONG puKeyValBufSize,
LPVOID  pKeyVal,
ULONG puApparentCimType 
)
static

Definition at line 163 of file path.c.

172 {
173  FIXME("%p, %u, 0x%x, %p, %p, %p, %p, %p\n", iface, uKeyIx, uFlags, puNameBufSize,
174  pszKeyName, puKeyValBufSize, pKeyVal, puApparentCimType);
175  return E_NOTIMPL;
176 }
UINT uFlags
Definition: api.c:59
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_GetKey2()

static HRESULT WINAPI keylist_GetKey2 ( IWbemPathKeyList iface,
ULONG  uKeyIx,
ULONG  uFlags,
ULONG puNameBufSize,
LPWSTR  pszKeyName,
VARIANT pKeyValue,
ULONG puApparentCimType 
)
static

Definition at line 178 of file path.c.

186 {
187  FIXME("%p, %u, 0x%x, %p, %p, %p, %p\n", iface, uKeyIx, uFlags, puNameBufSize,
188  pszKeyName, pKeyValue, puApparentCimType);
189  return E_NOTIMPL;
190 }
UINT uFlags
Definition: api.c:59
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_GetText()

static HRESULT WINAPI keylist_GetText ( IWbemPathKeyList iface,
LONG  lFlags,
ULONG puBuffLength,
LPWSTR  pszText 
)
static

Definition at line 251 of file path.c.

256 {
257  FIXME("%p, 0x%x, %p, %p\n", iface, lFlags, puBuffLength, pszText);
258  return E_NOTIMPL;
259 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_MakeSingleton()

static HRESULT WINAPI keylist_MakeSingleton ( IWbemPathKeyList iface,
boolean  bSet 
)
static

Definition at line 234 of file path.c.

237 {
238  FIXME("%p, %d\n", iface, bSet);
239  return E_NOTIMPL;
240 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_QueryInterface()

static HRESULT WINAPI keylist_QueryInterface ( IWbemPathKeyList iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 99 of file path.c.

103 {
104  struct keylist *keylist = impl_from_IWbemPathKeyList( iface );
105 
106  TRACE("%p, %s, %p\n", keylist, debugstr_guid(riid), ppvObject);
107 
108  if (IsEqualGUID( riid, &IID_IWbemPathKeyList ) ||
110  {
111  *ppvObject = iface;
112  }
113  else
114  {
115  FIXME("interface %s not implemented\n", debugstr_guid(riid));
116  return E_NOINTERFACE;
117  }
118  IWbemPathKeyList_AddRef( iface );
119  return S_OK;
120 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
Definition: path.c:34

◆ keylist_Release()

static ULONG WINAPI keylist_Release ( IWbemPathKeyList iface)
static

Definition at line 85 of file path.c.

87 {
88  struct keylist *keylist = impl_from_IWbemPathKeyList( iface );
90  if (!refs)
91  {
92  TRACE("destroying %p\n", keylist);
93  IWbemPath_Release( keylist->parent );
94  heap_free( keylist );
95  }
96  return refs;
97 }
IWbemPath * parent
Definition: path.c:37
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
LONG refs
Definition: path.c:38
#define InterlockedDecrement
Definition: armddk.h:52
Definition: path.c:34
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ keylist_RemoveAllKeys()

static HRESULT WINAPI keylist_RemoveAllKeys ( IWbemPathKeyList iface,
ULONG  uFlags 
)
static

Definition at line 213 of file path.c.

216 {
217  struct keylist *keylist = impl_from_IWbemPathKeyList( iface );
219 
220  TRACE("%p, 0x%x\n", iface, uFlags);
221 
222  if (uFlags) return WBEM_E_INVALID_PARAMETER;
223 
225 
226  free_keys( parent->keys, parent->num_keys );
227  parent->num_keys = 0;
228  parent->keys = NULL;
229 
231  return S_OK;
232 }
IWbemPath * parent
Definition: path.c:37
UINT uFlags
Definition: api.c:59
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void free_keys(struct key *keys, unsigned int count)
Definition: path.c:201
smooth NULL
Definition: ftsmooth.c:416
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2869
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
Definition: path.c:34

◆ keylist_RemoveKey()

static HRESULT WINAPI keylist_RemoveKey ( IWbemPathKeyList iface,
LPCWSTR  wszName,
ULONG  uFlags 
)
static

Definition at line 192 of file path.c.

196 {
197  FIXME("%p, %s, 0x%x\n", iface, debugstr_w(wszName), uFlags);
198  return E_NOTIMPL;
199 }
UINT uFlags
Definition: api.c:59
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_SetKey()

static HRESULT WINAPI keylist_SetKey ( IWbemPathKeyList iface,
LPCWSTR  wszName,
ULONG  uFlags,
ULONG  uCimType,
LPVOID  pKeyVal 
)
static

Definition at line 141 of file path.c.

147 {
148  FIXME("%p, %s, 0x%x, %u, %p\n", iface, debugstr_w(wszName), uFlags, uCimType, pKeyVal);
149  return E_NOTIMPL;
150 }
UINT uFlags
Definition: api.c:59
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ keylist_SetKey2()

static HRESULT WINAPI keylist_SetKey2 ( IWbemPathKeyList iface,
LPCWSTR  wszName,
ULONG  uFlags,
ULONG  uCimType,
VARIANT pKeyVal 
)
static

Definition at line 152 of file path.c.

158 {
159  FIXME("%p, %s, 0x%x, %u, %p\n", iface, debugstr_w(wszName), uFlags, uCimType, pKeyVal);
160  return E_NOTIMPL;
161 }
UINT uFlags
Definition: api.c:59
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ parse_key()

static HRESULT parse_key ( struct key key,
const WCHAR str,
unsigned int ret_len 
)
static

Definition at line 373 of file path.c.

374 {
375  const WCHAR *p, *q;
376  unsigned int len;
377 
378  p = q = str;
379  while (*q && *q != '=')
380  {
381  if (*q == ',' || iswspace( *q )) return WBEM_E_INVALID_PARAMETER;
382  q++;
383  }
384  len = q - p;
385  if (!(key->name = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
386  memcpy( key->name, p, len * sizeof(WCHAR) );
387  key->name[len] = 0;
388  key->len_name = len;
389 
390  p = ++q;
391  if (!*p || *p == ',' || iswspace( *p )) return WBEM_E_INVALID_PARAMETER;
392 
393  while (*q && *q != ',') q++;
394  len = q - p;
395  if (!(key->value = heap_alloc( (len + 1) * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
396  memcpy( key->value, p, len * sizeof(WCHAR) );
397  key->value[len] = 0;
398  key->len_value = len;
399 
400  *ret_len = q - str;
401  if (*q == ',') (*ret_len)++;
402  return S_OK;
403 }
WCHAR * name
Definition: path.c:43
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
WCHAR * value
Definition: path.c:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
#define iswspace(_c)
Definition: ctype.h:669
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
int len_name
Definition: path.c:44
int len_value
Definition: path.c:46
GLfloat GLfloat p
Definition: glext.h:8902
Definition: path.c:41

Referenced by parse_text().

◆ parse_text()

static HRESULT parse_text ( struct path path,
ULONG  mode,
const WCHAR text 
)
static

Definition at line 405 of file path.c.

406 {
408  const WCHAR *p, *q;
409  unsigned int i, len;
410 
411  p = q = text;
412  if ((p[0] == '\\' && p[1] == '\\') || (p[0] == '/' && p[1] == '/'))
413  {
414  p += 2;
415  q = p;
416  while (*q && *q != '\\' && *q != '/') q++;
417  len = q - p;
418  if (!(path->server = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
419  memcpy( path->server, p, len * sizeof(WCHAR) );
420  path->server[len] = 0;
421  path->len_server = len;
423  }
424  p = q;
425  if (wcschr( p, '\\' ) || wcschr( p, '/' ))
426  {
427  if (*q != '\\' && *q != '/' && *q != ':')
428  {
429  path->num_namespaces = 1;
430  q++;
431  }
432  while (*q && *q != ':')
433  {
434  if (*q == '\\' || *q == '/') path->num_namespaces++;
435  q++;
436  }
437  }
438  if (path->num_namespaces)
439  {
440  if (!(path->namespaces = heap_alloc( path->num_namespaces * sizeof(WCHAR *) ))) goto done;
441  if (!(path->len_namespaces = heap_alloc( path->num_namespaces * sizeof(int) ))) goto done;
442 
443  i = 0;
444  q = p;
445  if (*q && *q != '\\' && *q != '/' && *q != ':')
446  {
447  p = q;
448  while (*p && *p != '\\' && *p != '/' && *p != ':') p++;
449  len = p - q;
450  if (!(path->namespaces[i] = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
451  memcpy( path->namespaces[i], q, len * sizeof(WCHAR) );
452  path->namespaces[i][len] = 0;
453  path->len_namespaces[i] = len;
454  q = p;
455  i++;
456  }
457  while (*q && *q != ':')
458  {
459  if (*q == '\\' || *q == '/')
460  {
461  p = q + 1;
462  while (*p && *p != '\\' && *p != '/' && *p != ':') p++;
463  len = p - q - 1;
464  if (!(path->namespaces[i] = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
465  memcpy( path->namespaces[i], q + 1, len * sizeof(WCHAR) );
466  path->namespaces[i][len] = 0;
467  path->len_namespaces[i] = len;
468  i++;
469  }
470  q++;
471  }
472  }
473  if (*q == ':') q++;
474  p = q;
475  while (*q && *q != '.') q++;
476  len = q - p;
477  if (!(path->class = heap_alloc( (len + 1) * sizeof(WCHAR) ))) goto done;
478  memcpy( path->class, p, len * sizeof(WCHAR) );
479  path->class[len] = 0;
480  path->len_class = len;
481 
482  if (*q == '.')
483  {
484  p = ++q;
485  path->num_keys++;
486  while (*q)
487  {
488  if (*q == ',') path->num_keys++;
489  q++;
490  }
491  if (!(path->keys = heap_alloc_zero( path->num_keys * sizeof(struct key) ))) goto done;
492  i = 0;
493  q = p;
494  while (*q)
495  {
496  if (i >= path->num_keys) break;
497  hr = parse_key( &path->keys[i], q, &len );
498  if (hr != S_OK) goto done;
499  q += len;
500  i++;
501  }
502  }
503  hr = S_OK;
504 
505 done:
506  if (hr != S_OK) clear_path( path );
508  return hr;
509 }
WCHAR ** namespaces
Definition: path.c:58
int len_server
Definition: path.c:57
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * text
Definition: package.c:1827
int num_namespaces
Definition: path.c:60
static HRESULT parse_key(struct key *key, const WCHAR *str, unsigned int *ret_len)
Definition: path.c:373
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
int * len_namespaces
Definition: path.c:59
WCHAR * class
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
int len_class
Definition: path.c:62
ULONGLONG flags
Definition: path.c:65
WCHAR * server
Definition: path.c:56
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
unsigned int num_keys
Definition: path.c:64
struct key * keys
Definition: path.c:63
static void clear_path(struct path *path)
Definition: path.c:313
GLfloat GLfloat p
Definition: glext.h:8902
Definition: path.c:41

Referenced by path_SetText().

◆ path_AddRef()

static ULONG WINAPI path_AddRef ( IWbemPath iface)
static

Definition at line 327 of file path.c.

329 {
330  struct path *path = impl_from_IWbemPath( iface );
331  return InterlockedIncrement( &path->refs );
332 }
LONG refs
Definition: path.c:52
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define InterlockedIncrement
Definition: armddk.h:53

◆ path_CreateClassPart()

static HRESULT WINAPI path_CreateClassPart ( IWbemPath iface,
LONG  lFlags,
LPCWSTR  Name 
)
static

Definition at line 1190 of file path.c.

1194 {
1195  FIXME("%p, 0x%x, %s\n", iface, lFlags, debugstr_w(Name));
1196  return E_NOTIMPL;
1197 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_DeleteClassPart()

static HRESULT WINAPI path_DeleteClassPart ( IWbemPath iface,
LONG  lFlags 
)
static

Definition at line 1199 of file path.c.

1202 {
1203  FIXME("%p, 0x%x\n", iface, lFlags);
1204  return E_NOTIMPL;
1205 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_GetClassName()

static HRESULT WINAPI path_GetClassName ( IWbemPath iface,
ULONG len,
LPWSTR  name 
)
static

Definition at line 1143 of file path.c.

1147 {
1148  struct path *path = impl_from_IWbemPath( iface );
1149 
1150  TRACE("%p, %p, %p\n", iface, len, name);
1151 
1152  if (!len || (*len && !name)) return WBEM_E_INVALID_PARAMETER;
1153 
1155 
1156  if (!path->class)
1157  {
1160  }
1161  if (*len > path->len_class) lstrcpyW( name, path->class );
1162  *len = path->len_class + 1;
1163 
1165  return S_OK;
1166 }
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
WCHAR * class
int len_class
Definition: path.c:62
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetInfo()

static HRESULT WINAPI path_GetInfo ( IWbemPath iface,
ULONG  info,
ULONGLONG response 
)
static

Definition at line 809 of file path.c.

813 {
814  struct path *path = impl_from_IWbemPath( iface );
815 
816  TRACE("%p, %u, %p\n", iface, info, response);
817 
818  if (info || !response) return WBEM_E_INVALID_PARAMETER;
819 
820  FIXME("some flags are not implemented\n");
821 
823 
824  *response = path->flags;
825  if (!path->server || (path->len_server == 1 && path->server[0] == '.'))
827  else
828  *response |= WBEMPATH_INFO_HAS_MACHINE_NAME;
829 
830  if (!path->class)
832  else
833  {
834  *response |= WBEMPATH_INFO_HAS_SUBSCOPES;
835  if (path->num_keys)
836  *response |= WBEMPATH_INFO_IS_INST_REF;
837  else
838  *response |= WBEMPATH_INFO_IS_CLASS_REF;
839  }
840 
842  return S_OK;
843 }
int len_server
Definition: path.c:57
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define FIXME(fmt,...)
Definition: debug.h:110
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
WCHAR * class
ULONGLONG flags
Definition: path.c:65
WCHAR * server
Definition: path.c:56
#define S_OK
Definition: intsafe.h:59
unsigned int num_keys
Definition: path.c:64
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetKeyList()

static HRESULT WINAPI path_GetKeyList ( IWbemPath iface,
IWbemPathKeyList **  pOut 
)
static

Definition at line 1168 of file path.c.

1171 {
1172  struct path *path = impl_from_IWbemPath( iface );
1173  HRESULT hr;
1174 
1175  TRACE("%p, %p\n", iface, pOut);
1176 
1178 
1179  if (!path->class)
1180  {
1182  return WBEM_E_INVALID_PARAMETER;
1183  }
1184  hr = WbemPathKeyList_create( iface, (void **)pOut );
1185 
1187  return hr;
1188 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WbemPathKeyList_create(IWbemPath *parent, LPVOID *ppObj)
Definition: path.c:278
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
WCHAR * class
LONG HRESULT
Definition: typedefs.h:78
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetNamespaceAt()

static HRESULT WINAPI path_GetNamespaceAt ( IWbemPath iface,
ULONG  idx,
ULONG len,
LPWSTR  name 
)
static

Definition at line 985 of file path.c.

990 {
991  struct path *path = impl_from_IWbemPath( iface );
992 
993  TRACE("%p, %u, %p, %p\n", iface, idx, len, name);
994 
996 
997  if (!len || (*len && !name) || idx >= path->num_namespaces)
998  {
1000  return WBEM_E_INVALID_PARAMETER;
1001  }
1003  *len = path->len_namespaces[idx] + 1;
1004 
1006  return S_OK;
1007 }
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int * len_namespaces
Definition: path.c:59
unsigned int idx
Definition: utils.c:41
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetNamespaceCount()

static HRESULT WINAPI path_GetNamespaceCount ( IWbemPath iface,
ULONG puCount 
)
static

Definition at line 908 of file path.c.

911 {
912  struct path *path = impl_from_IWbemPath( iface );
913 
914  TRACE("%p, %p\n", iface, puCount);
915 
916  if (!puCount) return WBEM_E_INVALID_PARAMETER;
917 
919  *puCount = path->num_namespaces;
921  return S_OK;
922 }
int num_namespaces
Definition: path.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetScope()

static HRESULT WINAPI path_GetScope ( IWbemPath iface,
ULONG  uIndex,
ULONG puClassNameBufSize,
LPWSTR  pszClass,
IWbemPathKeyList **  pKeyList 
)
static

Definition at line 1084 of file path.c.

1090 {
1091  FIXME("%p, %u, %p, %p, %p\n", iface, uIndex, puClassNameBufSize, pszClass, pKeyList);
1092  return E_NOTIMPL;
1093 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_GetScopeAsText()

static HRESULT WINAPI path_GetScopeAsText ( IWbemPath iface,
ULONG  uIndex,
ULONG puTextBufSize,
LPWSTR  pszText 
)
static

Definition at line 1095 of file path.c.

1100 {
1101  FIXME("%p, %u, %p, %p\n", iface, uIndex, puTextBufSize, pszText);
1102  return E_NOTIMPL;
1103 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_GetScopeCount()

static HRESULT WINAPI path_GetScopeCount ( IWbemPath iface,
ULONG puCount 
)
static

Definition at line 1058 of file path.c.

1061 {
1062  FIXME("%p, %p\n", iface, puCount);
1063  return E_NOTIMPL;
1064 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_GetServer()

static HRESULT WINAPI path_GetServer ( IWbemPath iface,
ULONG len,
LPWSTR  name 
)
static

Definition at line 883 of file path.c.

887 {
888  struct path *path = impl_from_IWbemPath( iface );
889 
890  TRACE("%p, %p, %p\n", iface, len, name);
891 
892  if (!len || (*len && !name)) return WBEM_E_INVALID_PARAMETER;
893 
895 
896  if (!path->server)
897  {
899  return WBEM_E_NOT_AVAILABLE;
900  }
901  if (*len > path->len_server) lstrcpyW( name, path->server );
902  *len = path->len_server + 1;
903 
905  return S_OK;
906 }
int len_server
Definition: path.c:57
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
WCHAR * server
Definition: path.c:56
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ path_GetText()

static HRESULT WINAPI path_GetText ( IWbemPath iface,
LONG  lFlags,
ULONG puBufferLength,
LPWSTR  pszText 
)
static

Definition at line 769 of file path.c.

774 {
775  struct path *path = impl_from_IWbemPath( iface );
776  HRESULT hr = S_OK;
777  WCHAR *str;
778  int len;
779 
780  TRACE("%p, 0x%x, %p, %p\n", iface, lFlags, puBufferLength, pszText);
781 
782  if (!puBufferLength) return WBEM_E_INVALID_PARAMETER;
783 
785 
786  str = build_path( path, lFlags, &len );
787  if (*puBufferLength < len + 1)
788  {
789  *puBufferLength = len + 1;
790  goto done;
791  }
792  if (!pszText)
793  {
795  goto done;
796  }
797  if (str) lstrcpyW( pszText, str );
798  else pszText[0] = 0;
799  *puBufferLength = len + 1;
800 
801  TRACE("returning %s\n", debugstr_w(pszText));
802 
803 done:
804  heap_free( str );
806  return hr;
807 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * str
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
static WCHAR * build_path(struct path *path, LONG flags, int *len)
Definition: path.c:614
LONG HRESULT
Definition: typedefs.h:78
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_IsLocal()

static BOOL WINAPI path_IsLocal ( IWbemPath iface,
LPCWSTR  wszMachine 
)
static

Definition at line 1226 of file path.c.

1229 {
1230  FIXME("%p, %s\n", iface, debugstr_w(wszMachine));
1231  return FALSE;
1232 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ path_IsRelative()

static BOOL WINAPI path_IsRelative ( IWbemPath iface,
LPWSTR  wszMachine,
LPWSTR  wszNamespace 
)
static

Definition at line 1207 of file path.c.

1211 {
1212  FIXME("%p, %s, %s\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace));
1213  return FALSE;
1214 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ path_IsRelativeOrChild()

static BOOL WINAPI path_IsRelativeOrChild ( IWbemPath iface,
LPWSTR  wszMachine,
LPWSTR  wszNamespace,
LONG  lFlags 
)
static

Definition at line 1216 of file path.c.

1221 {
1222  FIXME("%p, %s, %s, 0x%x\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace), lFlags);
1223  return FALSE;
1224 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ path_IsSameClassName()

static BOOL WINAPI path_IsSameClassName ( IWbemPath iface,
LPCWSTR  wszClass 
)
static

Definition at line 1234 of file path.c.

1237 {
1238  FIXME("%p, %s\n", iface, debugstr_w(wszClass));
1239  return FALSE;
1240 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

◆ path_QueryInterface()

static HRESULT WINAPI path_QueryInterface ( IWbemPath iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 350 of file path.c.

354 {
355  struct path *path = impl_from_IWbemPath( iface );
356 
357  TRACE("%p, %s, %p\n", path, debugstr_guid( riid ), ppvObject );
358 
359  if ( IsEqualGUID( riid, &IID_IWbemPath ) ||
361  {
362  *ppvObject = iface;
363  }
364  else
365  {
366  FIXME("interface %s not implemented\n", debugstr_guid(riid));
367  return E_NOINTERFACE;
368  }
369  IWbemPath_AddRef( iface );
370  return S_OK;
371 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ path_Release()

static ULONG WINAPI path_Release ( IWbemPath iface)
static

Definition at line 334 of file path.c.

336 {
337  struct path *path = impl_from_IWbemPath( iface );
339  if (!refs)
340  {
341  TRACE("destroying %p\n", path);
342  clear_path( path );
343  path->cs.DebugInfo->Spare[0] = 0;
345  heap_free( path );
346  }
347  return refs;
348 }
LONG refs
Definition: path.c:52
long LONG
Definition: pedump.c:60
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:872
#define InterlockedDecrement
Definition: armddk.h:52
static void clear_path(struct path *path)
Definition: path.c:313
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:865
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_RemoveAllNamespaces()

static HRESULT WINAPI path_RemoveAllNamespaces ( IWbemPath iface)
static

Definition at line 1037 of file path.c.

1039 {
1040  struct path *path = impl_from_IWbemPath( iface );
1041  int i;
1042 
1043  TRACE("%p\n", iface);
1044 
1046 
1047  for (i = 0; i < path->num_namespaces; i++) heap_free( path->namespaces[i] );
1048  path->num_namespaces = 0;
1050  path->namespaces = NULL;
1053 
1055  return S_OK;
1056 }
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
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
int * len_namespaces
Definition: path.c:59
smooth NULL
Definition: ftsmooth.c:416
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_RemoveAllScopes()

static HRESULT WINAPI path_RemoveAllScopes ( IWbemPath iface)
static

Definition at line 1113 of file path.c.

1115 {
1116  FIXME("%p\n", iface);
1117  return E_NOTIMPL;
1118 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_RemoveNamespaceAt()

static HRESULT WINAPI path_RemoveNamespaceAt ( IWbemPath iface,
ULONG  idx 
)
static

Definition at line 1009 of file path.c.

1012 {
1013  struct path *path = impl_from_IWbemPath( iface );
1014 
1015  TRACE("%p, %u\n", iface, idx);
1016 
1018 
1019  if (idx >= path->num_namespaces)
1020  {
1022  return WBEM_E_INVALID_PARAMETER;
1023  }
1025  while (idx < path->num_namespaces - 1)
1026  {
1027  path->namespaces[idx] = path->namespaces[idx + 1];
1029  idx++;
1030  }
1031  path->num_namespaces--;
1032 
1034  return S_OK;
1035 }
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
int * len_namespaces
Definition: path.c:59
unsigned int idx
Definition: utils.c:41
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_RemoveScope()

static HRESULT WINAPI path_RemoveScope ( IWbemPath iface,
ULONG  uIndex 
)
static

Definition at line 1105 of file path.c.

1108 {
1109  FIXME("%p, %u\n", iface, uIndex);
1110  return E_NOTIMPL;
1111 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_SetClassName()

static HRESULT WINAPI path_SetClassName ( IWbemPath iface,
LPCWSTR  name 
)
static

Definition at line 1120 of file path.c.

1123 {
1124  struct path *path = impl_from_IWbemPath( iface );
1125  WCHAR *class;
1126 
1127  TRACE("%p, %s\n", iface, debugstr_w(name));
1128 
1129  if (!name) return WBEM_E_INVALID_PARAMETER;
1130  if (!(class = strdupW( name ))) return WBEM_E_OUT_OF_MEMORY;
1131 
1133 
1134  heap_free( path->class );
1135  path->class = class;
1136  path->len_class = lstrlenW( path->class );
1138 
1140  return S_OK;
1141 }
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define lstrlenW
Definition: compat.h:415
#define debugstr_w
Definition: kernel32.h:32
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
WCHAR * class
__wchar_t WCHAR
Definition: xmlstorage.h:180
int len_class
Definition: path.c:62
ULONGLONG flags
Definition: path.c:65
#define S_OK
Definition: intsafe.h:59
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_SetNamespaceAt()

static HRESULT WINAPI path_SetNamespaceAt ( IWbemPath iface,
ULONG  idx,
LPCWSTR  name 
)
static

Definition at line 924 of file path.c.

928 {
929  struct path *path = impl_from_IWbemPath( iface );
930  static const ULONGLONG flags =
933  int i, *tmp_len;
934  WCHAR **tmp, *new;
935  DWORD size;
936 
937  TRACE("%p, %u, %s\n", iface, idx, debugstr_w(name));
938 
940 
941  if (idx > path->num_namespaces || !name)
942  {
945  }
946  if (!(new = strdupW( name )))
947  {
949  return WBEM_E_OUT_OF_MEMORY;
950  }
951  size = (path->num_namespaces + 1) * sizeof(WCHAR *);
952  if (path->namespaces) tmp = heap_realloc( path->namespaces, size );
953  else tmp = heap_alloc( size );
954  if (!tmp)
955  {
956  heap_free( new );
958  return WBEM_E_OUT_OF_MEMORY;
959  }
960  path->namespaces = tmp;
961  size = (path->num_namespaces + 1) * sizeof(int);
963  else tmp_len = heap_alloc( size );
964  if (!tmp_len)
965  {
966  heap_free( new );
968  return WBEM_E_OUT_OF_MEMORY;
969  }
970  path->len_namespaces = tmp_len;
971  for (i = idx; i < path->num_namespaces; i++)
972  {
973  path->namespaces[i + 1] = path->namespaces[i];
975  }
976  path->namespaces[idx] = new;
977  path->len_namespaces[idx] = lstrlenW( new );
978  path->num_namespaces++;
979  path->flags |= flags;
980 
982  return S_OK;
983 }
WCHAR ** namespaces
Definition: path.c:58
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
int num_namespaces
Definition: path.c:60
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define lstrlenW
Definition: compat.h:415
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
int * len_namespaces
Definition: path.c:59
#define debugstr_w
Definition: kernel32.h:32
unsigned int idx
Definition: utils.c:41
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
CRITICAL_SECTION cs
Definition: path.c:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint64_t ULONGLONG
Definition: typedefs.h:66
ULONGLONG flags
Definition: path.c:65
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_SetScope()

static HRESULT WINAPI path_SetScope ( IWbemPath iface,
ULONG  uIndex,
LPWSTR  pszClass 
)
static

Definition at line 1066 of file path.c.

1070 {
1071  FIXME("%p, %u, %s\n", iface, uIndex, debugstr_w(pszClass));
1072  return E_NOTIMPL;
1073 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_SetScopeFromText()

static HRESULT WINAPI path_SetScopeFromText ( IWbemPath iface,
ULONG  uIndex,
LPWSTR  pszText 
)
static

Definition at line 1075 of file path.c.

1079 {
1080  FIXME("%p, %u, %s\n", iface, uIndex, debugstr_w(pszText));
1081  return E_NOTIMPL;
1082 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ path_SetServer()

static HRESULT WINAPI path_SetServer ( IWbemPath iface,
LPCWSTR  name 
)
static

Definition at line 845 of file path.c.

848 {
849  struct path *path = impl_from_IWbemPath( iface );
850  static const ULONGLONG flags =
853  WCHAR *server;
854 
855  TRACE("%p, %s\n", iface, debugstr_w(name));
856 
858 
859  if (name)
860  {
861  if (!(server = strdupW( name )))
862  {
864  return WBEM_E_OUT_OF_MEMORY;
865  }
866  heap_free( path->server );
867  path->server = server;
869  path->flags |= flags;
870  }
871  else
872  {
873  heap_free( path->server );
874  path->server = NULL;
875  path->len_server = 0;
876  path->flags &= ~flags;
877  }
878 
880  return S_OK;
881 }
static rfbScreenInfoPtr server
Definition: vnc.c:74
int len_server
Definition: path.c:57
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define lstrlenW
Definition: compat.h:415
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint64_t ULONGLONG
Definition: typedefs.h:66
ULONGLONG flags
Definition: path.c:65
WCHAR * server
Definition: path.c:56
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
Definition: name.c:38
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ path_SetText()

static HRESULT WINAPI path_SetText ( IWbemPath iface,
ULONG  uMode,
LPCWSTR  pszPath 
)
static

Definition at line 511 of file path.c.

515 {
516  struct path *path = impl_from_IWbemPath( iface );
517  HRESULT hr = S_OK;
518  int len;
519 
520  TRACE("%p, %u, %s\n", iface, uMode, debugstr_w(pszPath));
521 
522  if (!uMode || !pszPath) return WBEM_E_INVALID_PARAMETER;
523 
525 
526  clear_path( path );
527  if (!pszPath[0]) goto done;
528  if ((hr = parse_text( path, uMode, pszPath )) != S_OK) goto done;
529 
530  len = lstrlenW( pszPath );
531  if (!(path->text = heap_alloc( (len + 1) * sizeof(WCHAR) )))
532  {
533  clear_path( path );
534  hr = E_OUTOFMEMORY;
535  goto done;
536  }
537  lstrcpyW( path->text, pszPath );
538  path->len_text = len;
539 
540 done:
542  return hr;
543 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define lstrlenW
Definition: compat.h:415
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static HRESULT parse_text(struct path *path, ULONG mode, const WCHAR *text)
Definition: path.c:405
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
GLenum GLsizei len
Definition: glext.h:6722
WCHAR * text
Definition: path.c:54
#define S_OK
Definition: intsafe.h:59
#define lstrcpyW
Definition: compat.h:414
int len_text
Definition: path.c:55
static void clear_path(struct path *path)
Definition: path.c:313
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

◆ WbemPath_create()

HRESULT WbemPath_create ( LPVOID ppObj)

Definition at line 1275 of file path.c.

1276 {
1277  struct path *path;
1278 
1279  TRACE("%p\n", ppObj);
1280 
1281  if (!(path = heap_alloc( sizeof(*path) ))) return E_OUTOFMEMORY;
1282 
1283  path->IWbemPath_iface.lpVtbl = &path_vtbl;
1284  path->refs = 1;
1286  path->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": wmiutils_path.cs");
1287  init_path( path );
1288 
1289  *ppObj = &path->IWbemPath_iface;
1290 
1291  TRACE("returning iface %p\n", *ppObj);
1292  return S_OK;
1293 }
#define DWORD_PTR
Definition: treelist.c:76
LONG refs
Definition: path.c:52
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
const char * path
Definition: path.c:46
#define TRACE(s)
Definition: solgame.cpp:4
CRITICAL_SECTION cs
Definition: path.c:53
PCRITICAL_SECTION_DEBUG DebugInfo
Definition: winbase.h:872
#define S_OK
Definition: intsafe.h:59
static void init_path(struct path *path)
Definition: path.c:297
IWbemPath IWbemPath_iface
Definition: path.c:51
static const struct IWbemPathVtbl path_vtbl
Definition: path.c:1242
DWORD_PTR Spare[8/sizeof(DWORD_PTR)]
Definition: winbase.h:865

◆ WbemPathKeyList_create()

static HRESULT WbemPathKeyList_create ( IWbemPath parent,
LPVOID ppObj 
)
static

Definition at line 278 of file path.c.

279 {
280  struct keylist *keylist;
281 
282  TRACE("%p\n", ppObj);
283 
284  if (!(keylist = heap_alloc( sizeof(*keylist) ))) return E_OUTOFMEMORY;
285 
287  keylist->refs = 1;
288  keylist->parent = parent;
289  IWbemPath_AddRef( keylist->parent );
290 
291  *ppObj = &keylist->IWbemPathKeyList_iface;
292 
293  TRACE("returning iface %p\n", *ppObj);
294  return S_OK;
295 }
IWbemPath * parent
Definition: path.c:37
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct IWbemPathKeyListVtbl keylist_vtbl
Definition: path.c:261
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2869
LONG refs
Definition: path.c:38
#define S_OK
Definition: intsafe.h:59
Definition: path.c:34
IWbemPathKeyList IWbemPathKeyList_iface
Definition: path.c:36

Referenced by path_GetKeyList().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wmiutils  )

Variable Documentation

◆ keylist_vtbl

const struct IWbemPathKeyListVtbl keylist_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI keylist_GetKey(IWbemPathKeyList *iface, ULONG uKeyIx, ULONG uFlags, ULONG *puNameBufSize, LPWSTR pszKeyName, ULONG *puKeyValBufSize, LPVOID pKeyVal, ULONG *puApparentCimType)
Definition: path.c:163
static HRESULT WINAPI keylist_GetText(IWbemPathKeyList *iface, LONG lFlags, ULONG *puBuffLength, LPWSTR pszText)
Definition: path.c:251
static ULONG WINAPI keylist_Release(IWbemPathKeyList *iface)
Definition: path.c:85
static HRESULT WINAPI keylist_QueryInterface(IWbemPathKeyList *iface, REFIID riid, void **ppvObject)
Definition: path.c:99
static HRESULT WINAPI keylist_GetInfo(IWbemPathKeyList *iface, ULONG uRequestedInfo, ULONGLONG *puResponse)
Definition: path.c:242
static HRESULT WINAPI keylist_RemoveAllKeys(IWbemPathKeyList *iface, ULONG uFlags)
Definition: path.c:213
static HRESULT WINAPI keylist_RemoveKey(IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags)
Definition: path.c:192
static HRESULT WINAPI keylist_MakeSingleton(IWbemPathKeyList *iface, boolean bSet)
Definition: path.c:234
static HRESULT WINAPI keylist_SetKey(IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags, ULONG uCimType, LPVOID pKeyVal)
Definition: path.c:141
static ULONG WINAPI keylist_AddRef(IWbemPathKeyList *iface)
Definition: path.c:78
static HRESULT WINAPI keylist_GetKey2(IWbemPathKeyList *iface, ULONG uKeyIx, ULONG uFlags, ULONG *puNameBufSize, LPWSTR pszKeyName, VARIANT *pKeyValue, ULONG *puApparentCimType)
Definition: path.c:178
static HRESULT WINAPI keylist_SetKey2(IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags, ULONG uCimType, VARIANT *pKeyVal)
Definition: path.c:152
static HRESULT WINAPI keylist_GetCount(IWbemPathKeyList *iface, ULONG *puKeyCount)
Definition: path.c:122

Definition at line 261 of file path.c.

Referenced by WbemPathKeyList_create().

◆ path_vtbl

const struct IWbemPathVtbl path_vtbl
static

Definition at line 1242 of file path.c.

Referenced by WbemPath_create().