ReactOS 0.4.17-dev-966-gf06eace
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 keylist * impl_from_IWbemPathKeyList (IWbemPathKeyList *iface)
 
static struct path * impl_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 WCHAR * build_namespace (struct path *path, int *len, BOOL leading_slash)
 
static WCHAR * build_server (struct path *path, int *len)
 
static WCHAR * build_keylist (struct path *path, int *len)
 
static WCHAR * build_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 596 of file path.c.

597{
598 WCHAR *ret, *p;
599 unsigned int i;
600
601 *len = 0;
602 for (i = 0; i < path->num_keys; i++)
603 {
604 if (i > 0) *len += 1;
605 *len += path->keys[i].len_name + path->keys[i].len_value + 1;
606 }
607 if (!(p = ret = malloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
608 for (i = 0; i < path->num_keys; i++)
609 {
610 if (i > 0) *p++ = ',';
611 memcpy( p, path->keys[i].name, path->keys[i].len_name * sizeof(WCHAR) );
612 p += path->keys[i].len_name;
613 *p++ = '=';
614 memcpy( p, path->keys[i].value, path->keys[i].len_value * sizeof(WCHAR) );
615 p += path->keys[i].len_value;
616 }
617 *p = 0;
618 return ret;
619}
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
return ret
Definition: mutex.c:147
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
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 memcpy(s1, s2, n)
Definition: mkisofs.h:878
short WCHAR
Definition: pedump.c:58
struct key * keys
Definition: path.c:63
unsigned int num_keys
Definition: path.c:64

Referenced by build_path().

◆ build_namespace()

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

Definition at line 552 of file path.c.

553{
554 WCHAR *ret, *p;
555 int i;
556
557 *len = 0;
558 for (i = 0; i < path->num_namespaces; i++)
559 {
560 if (i > 0 || leading_slash) *len += 1;
561 *len += path->len_namespaces[i];
562 }
563 if (!(p = ret = malloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
564 for (i = 0; i < path->num_namespaces; i++)
565 {
566 if (i > 0 || leading_slash) *p++ = '\\';
567 memcpy( p, path->namespaces[i], path->len_namespaces[i] * sizeof(WCHAR) );
568 p += path->len_namespaces[i];
569 }
570 *p = 0;
571 return ret;
572}
WCHAR ** namespaces
Definition: path.c:58
int num_namespaces
Definition: path.c:60
int * len_namespaces
Definition: path.c:59

◆ build_path()

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

Definition at line 621 of file path.c.

622{
623 *len = 0;
624 switch (flags)
625 {
626 case 0:
627 {
628 int len_namespace, len_keylist;
629 WCHAR *ret, *namespace = build_namespace( path, &len_namespace, FALSE );
630 WCHAR *keylist = build_keylist( path, &len_keylist );
631
632 if (!namespace || !keylist)
633 {
634 free( namespace );
635 free( keylist );
636 return NULL;
637 }
638 *len = len_namespace;
639 if (path->len_class)
640 {
641 *len += path->len_class + 1;
642 if (path->num_keys) *len += len_keylist + 1;
643 }
644 if (!(ret = malloc( (*len + 1) * sizeof(WCHAR) )))
645 {
646 free( namespace );
647 free( keylist );
648 return NULL;
649 }
650 lstrcpyW( ret, namespace );
651 if (path->len_class)
652 {
653 unsigned int offset = len_namespace + path->len_class + 1;
654
655 ret[len_namespace] = ':';
656 lstrcpyW( ret + len_namespace + 1, path->class );
657 if (path->num_keys)
658 {
659 if (*keylist != '=') ret[offset++] = '.';
661 }
662 }
663 free( namespace );
664 free( keylist );
665 return ret;
666
667 }
669 {
670 int len_keylist;
671 WCHAR *ret, *keylist;
672
673 if (!path->len_class) return NULL;
674 if (!(keylist = build_keylist( path, &len_keylist ))) return NULL;
675
676 *len = path->len_class;
677 if (path->num_keys) *len += len_keylist + 1;
678 if (!(ret = malloc( (*len + 1) * sizeof(WCHAR) )))
679 {
680 free( keylist );
681 return NULL;
682 }
683 lstrcpyW( ret, path->class );
684 if (path->num_keys)
685 {
686 unsigned int offset = path->len_class;
687
688 if (*keylist != '=') ret[offset++] = '.';
690 }
691 free( keylist );
692 return ret;
693 }
695 {
696 int len_namespace, len_server, len_keylist;
697 WCHAR *p, *ret, *namespace = build_namespace( path, &len_namespace, TRUE );
698 WCHAR *server = build_server( path, &len_server );
699 WCHAR *keylist = build_keylist( path, &len_keylist );
700
701 if (!namespace || !server || !keylist)
702 {
703 free( namespace );
704 free( server );
705 free( keylist );
706 return NULL;
707 }
708 *len = len_namespace + len_server;
709 if (path->len_class)
710 {
711 *len += path->len_class + 1;
712 if (path->num_keys) *len += len_keylist + 1;
713 }
714 if (!(p = ret = malloc( (*len + 1) * sizeof(WCHAR) )))
715 {
716 free( namespace );
717 free( server );
718 free( keylist );
719 return NULL;
720 }
721 lstrcpyW( p, server );
722 p += len_server;
723 lstrcpyW( p, namespace );
724 p += len_namespace;
725 if (path->len_class)
726 {
727 *p++ = ':';
728 lstrcpyW( p, path->class );
729 if (path->num_keys)
730 {
731 unsigned int offset = path->len_class;
732
733 if (*keylist != '=') p[offset++] = '.';
734 lstrcpyW( p + offset, keylist );
735 }
736 }
737 free( namespace );
738 free( server );
739 free( keylist );
740 return ret;
741 }
743 {
744 int len_namespace, len_server;
745 WCHAR *p, *ret, *namespace = build_namespace( path, &len_namespace, TRUE );
746 WCHAR *server = build_server( path, &len_server );
747
748 if (!namespace || !server)
749 {
750 free( namespace );
751 free( server );
752 return NULL;
753 }
754 *len = len_namespace + len_server;
755 if (!(p = ret = malloc( (*len + 1) * sizeof(WCHAR) )))
756 {
757 free( namespace );
758 free( server );
759 return NULL;
760 }
761 lstrcpyW( p, server );
762 p += len_server;
763 lstrcpyW( p, namespace );
764 free( namespace );
765 free( server );
766 return ret;
767 }
769 return build_namespace( path, len, FALSE );
770
772 if (!path->len_text) return NULL;
773 *len = path->len_text;
774 return wcsdup( path->text );
775
776 default:
777 ERR( "unhandled flags %#lx\n", flags );
778 return NULL;
779 }
780}
#define ERR(fmt,...)
Definition: precomp.h:57
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define lstrcpyW
Definition: compat.h:749
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
static BSTR build_namespace(void)
Definition: query.c:528
static WCHAR * build_keylist(struct path *path, int *len)
Definition: path.c:596
static WCHAR * build_server(struct path *path, int *len)
Definition: path.c:574
GLintptr offset
Definition: glext.h:5920
GLbitfield flags
Definition: glext.h:7161
Definition: path.c:35
int len_text
Definition: path.c:55
int len_class
Definition: path.c:62
WCHAR * text
Definition: path.c:54
WCHAR * class
static rfbScreenInfoPtr server
Definition: vnc.c:74
@ WBEMPATH_GET_RELATIVE_ONLY
Definition: wmiutils.idl:57
@ WBEMPATH_GET_ORIGINAL
Definition: wmiutils.idl:61
@ WBEMPATH_GET_SERVER_AND_NAMESPACE_ONLY
Definition: wmiutils.idl:59
@ WBEMPATH_GET_SERVER_TOO
Definition: wmiutils.idl:58
@ WBEMPATH_GET_NAMESPACE_ONLY
Definition: wmiutils.idl:60

Referenced by path_GetText().

◆ build_server()

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

Definition at line 574 of file path.c.

575{
576 WCHAR *ret, *p;
577
578 *len = 0;
579 if (path->len_server) *len += 2 + path->len_server;
580 else *len += 3;
581 if (!(p = ret = malloc( (*len + 1) * sizeof(WCHAR) ))) return NULL;
582 if (path->len_server)
583 {
584 p[0] = p[1] = '\\';
585 lstrcpyW( p + 2, path->server );
586 }
587 else
588 {
589 p[0] = p[1] = '\\';
590 p[2] = '.';
591 p[3] = 0;
592 }
593 return ret;
594}
WCHAR * server
Definition: path.c:56
int len_server
Definition: path.c:57

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 free( path->text );
318 free( path->server );
319 for (i = 0; i < path->num_namespaces; i++) free( path->namespaces[i] );
320 free( path->namespaces );
322 free( path->class );
324 init_path( path );
325}
static void free_keys(struct key *keys, unsigned int count)
Definition: path.c:201
static void init_path(struct path *path)
Definition: path.c:297

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 free( keys[i].name );
208 free( keys[i].value );
209 }
210 free( keys );
211}
const UINT * keys
Definition: locale.c:418
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: name.c:39
Definition: pdh_main.c:64

Referenced by clear_path(), and keylist_RemoveAllKeys().

◆ impl_from_IWbemPath()

◆ 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}

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;
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}
ULONGLONG flags
Definition: path.c:65

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{
83}
#define InterlockedIncrement
Definition: armddk.h:53
static struct keylist * impl_from_IWbemPathKeyList(IWbemPathKeyList *iface)
Definition: path.c:68
LONG refs
Definition: path.c:38

◆ 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}
static struct path * impl_from_IWbemPath(IWbemPath *iface)
Definition: path.c:73
r parent
Definition: btrfs.c:3010
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4
IWbemPath * parent
Definition: path.c:37
@ WBEM_E_INVALID_PARAMETER
Definition: wbemcli.idl:58
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ 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, %lu, %p\n", iface, uRequestedInfo, puResponse);
248 return E_NOTIMPL;
249}
#define FIXME(fmt,...)
Definition: precomp.h:53
#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, %lu, %#lx, %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

◆ 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, %lu, %#lx, %p, %p, %p, %p\n", iface, uKeyIx, uFlags, puNameBufSize,
188 pszKeyName, pKeyValue, puApparentCimType);
189 return E_NOTIMPL;
190}

◆ 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, %#lx, %p, %p\n", iface, lFlags, puBuffLength, pszText);
258 return E_NOTIMPL;
259}

◆ 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}

◆ 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}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ keylist_Release()

static ULONG WINAPI keylist_Release ( IWbemPathKeyList *  iface)
static

Definition at line 85 of file path.c.

87{
90 if (!refs)
91 {
92 TRACE("destroying %p\n", keylist);
93 IWbemPath_Release( keylist->parent );
94 free( keylist );
95 }
96 return refs;
97}
#define InterlockedDecrement
Definition: armddk.h:52
LONG refs
Definition: port.c:62
long LONG
Definition: pedump.c:60

◆ 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, %#lx\n", iface, uFlags);
221
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}

◆ 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, %#lx\n", iface, debugstr_w(wszName), uFlags);
198 return E_NOTIMPL;
199}
#define debugstr_w
Definition: kernel32.h:32

◆ 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, %#lx, %lu, %p\n", iface, debugstr_w(wszName), uFlags, uCimType, pKeyVal);
149 return E_NOTIMPL;
150}

◆ 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, %#lx, %lu, %p\n", iface, debugstr_w(wszName), uFlags, uCimType, pKeyVal);
160 return E_NOTIMPL;
161}

◆ 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 = malloc( (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 = malloc( (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}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:81
const WCHAR * str
#define iswspace(_c)
Definition: ctype.h:669
Definition: copy.c:22
int len_value
Definition: path.c:46
WCHAR * value
Definition: path.c:45
int len_name
Definition: path.c:44
WCHAR * name
Definition: path.c:43

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 = malloc( (len + 1) * sizeof(WCHAR) ))) goto done;
419 memcpy( path->server, p, len * sizeof(WCHAR) );
420 path->server[len] = 0;
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 = calloc( path->num_namespaces, sizeof(WCHAR *) ))) goto done;
441 if (!(path->len_namespaces = malloc( 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] = malloc( (len + 1) * sizeof(WCHAR) ))) goto done;
451 memcpy( path->namespaces[i], q, len * sizeof(WCHAR) );
452 path->namespaces[i][len] = 0;
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] = malloc( (len + 1) * sizeof(WCHAR) ))) goto done;
465 memcpy( path->namespaces[i], q + 1, len * sizeof(WCHAR) );
466 path->namespaces[i][len] = 0;
468 i++;
469 }
470 q++;
471 }
472 }
473 if (*q == ':') q++;
474 p = q;
475 while (*q && *q != '.' && *q != '=') q++;
476 len = q - p;
477 if (!(path->class = malloc( (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 = calloc( 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 else if (*q == '=')
504 {
505 path->num_keys = 1;
506 if (!(path->keys = calloc( path->num_keys, sizeof(struct key) ))) goto done;
507 hr = parse_key( &path->keys[0], q, &len );
508 if (hr != S_OK) goto done;
509 }
510 hr = S_OK;
511
512done:
513 if (hr != S_OK) clear_path( path );
515 return hr;
516}
HRESULT hr
Definition: delayimp.cpp:582
#define wcschr
Definition: compat.h:17
const WCHAR * text
Definition: package.c:1826
static HRESULT parse_key(struct key *key, const WCHAR *str, unsigned int *ret_len)
Definition: path.c:373
static void clear_path(struct path *path)
Definition: path.c:313
#define calloc
Definition: rosglue.h:14
@ WBEMPATH_INFO_V2_COMPLIANT
Definition: wmiutils.idl:36
@ WBEMPATH_INFO_PATH_HAD_SERVER
Definition: wmiutils.idl:43
@ WBEMPATH_INFO_CIM_COMPLIANT
Definition: wmiutils.idl:37

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

◆ path_CreateClassPart()

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

Definition at line 1208 of file path.c.

1212{
1213 FIXME("%p, %#lx, %s\n", iface, lFlags, debugstr_w(Name));
1214 return E_NOTIMPL;
1215}
LPWSTR Name
Definition: desk.c:124

◆ path_DeleteClassPart()

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

Definition at line 1217 of file path.c.

1220{
1221 FIXME("%p, %#lx\n", iface, lFlags);
1222 return E_NOTIMPL;
1223}

◆ path_GetClassName()

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

Definition at line 1161 of file path.c.

1165{
1166 struct path *path = impl_from_IWbemPath( iface );
1167
1168 TRACE("%p, %p, %p\n", iface, len, name);
1169
1170 if (!len || (*len && !name)) return WBEM_E_INVALID_PARAMETER;
1171
1173
1174 if (!path->class)
1175 {
1178 }
1179 if (*len > path->len_class) lstrcpyW( name, path->class );
1180 *len = path->len_class + 1;
1181
1183 return S_OK;
1184}
CRITICAL_SECTION cs
Definition: path.c:53
@ WBEM_E_INVALID_OBJECT_PATH
Definition: wbemcli.idl:108

◆ path_GetInfo()

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

Definition at line 822 of file path.c.

826{
827 struct path *path = impl_from_IWbemPath( iface );
828
829 TRACE("%p, %lu, %p\n", iface, info, response);
830
831 if (info || !response) return WBEM_E_INVALID_PARAMETER;
832
833 FIXME("some flags are not implemented\n");
834
836
837 *response = path->flags;
838 if (!path->server || (path->len_server == 1 && path->server[0] == '.'))
840 else
842
843 if (!path->class)
845 else
846 {
847 *response |= WBEMPATH_INFO_HAS_SUBSCOPES;
848 if (path->num_keys)
849 {
850 unsigned int i;
851 for (i = 0; i < path->num_keys; i++)
852 if (!path->keys[i].name[0]) *response |= WBEMPATH_INFO_HAS_IMPLIED_KEY;
853 *response |= WBEMPATH_INFO_IS_INST_REF;
854 }
855 else
856 *response |= WBEMPATH_INFO_IS_CLASS_REF;
857 }
858
860 return S_OK;
861}
@ WBEMPATH_INFO_HAS_IMPLIED_KEY
Definition: wmiutils.idl:33
@ WBEMPATH_INFO_IS_CLASS_REF
Definition: wmiutils.idl:28
@ WBEMPATH_INFO_HAS_MACHINE_NAME
Definition: wmiutils.idl:27
@ WBEMPATH_INFO_HAS_SUBSCOPES
Definition: wmiutils.idl:30
@ WBEMPATH_INFO_IS_INST_REF
Definition: wmiutils.idl:29
@ WBEMPATH_INFO_SERVER_NAMESPACE_ONLY
Definition: wmiutils.idl:40
@ WBEMPATH_INFO_ANON_LOCAL_MACHINE
Definition: wmiutils.idl:26

◆ path_GetKeyList()

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

Definition at line 1186 of file path.c.

1189{
1190 struct path *path = impl_from_IWbemPath( iface );
1191 HRESULT hr;
1192
1193 TRACE("%p, %p\n", iface, pOut);
1194
1196
1197 if (!path->class)
1198 {
1201 }
1202 hr = WbemPathKeyList_create( iface, (void **)pOut );
1203
1205 return hr;
1206}
static HRESULT WbemPathKeyList_create(IWbemPath *parent, LPVOID *ppObj)
Definition: path.c:278

◆ path_GetNamespaceAt()

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

Definition at line 1003 of file path.c.

1008{
1009 struct path *path = impl_from_IWbemPath( iface );
1010
1011 TRACE( "%p, %lu, %p, %p\n", iface, idx, len, name );
1012
1014
1015 if (!len || (*len && !name) || idx >= path->num_namespaces)
1016 {
1019 }
1021 *len = path->len_namespaces[idx] + 1;
1022
1024 return S_OK;
1025}
unsigned int idx
Definition: utils.c:40

◆ path_GetNamespaceCount()

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

Definition at line 926 of file path.c.

929{
930 struct path *path = impl_from_IWbemPath( iface );
931
932 TRACE("%p, %p\n", iface, puCount);
933
934 if (!puCount) return WBEM_E_INVALID_PARAMETER;
935
937 *puCount = path->num_namespaces;
939 return S_OK;
940}

◆ path_GetScope()

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

Definition at line 1102 of file path.c.

1108{
1109 FIXME("%p, %lu, %p, %p, %p\n", iface, uIndex, puClassNameBufSize, pszClass, pKeyList);
1110 return E_NOTIMPL;
1111}

◆ path_GetScopeAsText()

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

Definition at line 1113 of file path.c.

1118{
1119 FIXME("%p, %lu, %p, %p\n", iface, uIndex, puTextBufSize, pszText);
1120 return E_NOTIMPL;
1121}

◆ path_GetScopeCount()

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

Definition at line 1076 of file path.c.

1079{
1080 FIXME("%p, %p\n", iface, puCount);
1081 return E_NOTIMPL;
1082}

◆ path_GetServer()

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

Definition at line 901 of file path.c.

905{
906 struct path *path = impl_from_IWbemPath( iface );
907
908 TRACE("%p, %p, %p\n", iface, len, name);
909
910 if (!len || (*len && !name)) return WBEM_E_INVALID_PARAMETER;
911
913
914 if (!path->server)
915 {
918 }
919 if (*len > path->len_server) lstrcpyW( name, path->server );
920 *len = path->len_server + 1;
921
923 return S_OK;
924}
@ WBEM_E_NOT_AVAILABLE
Definition: wbemcli.idl:59

◆ path_GetText()

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

Definition at line 782 of file path.c.

787{
788 struct path *path = impl_from_IWbemPath( iface );
789 HRESULT hr = S_OK;
790 WCHAR *str;
791 int len;
792
793 TRACE("%p, %#lx, %p, %p\n", iface, lFlags, puBufferLength, pszText);
794
795 if (!puBufferLength) return WBEM_E_INVALID_PARAMETER;
796
798
799 str = build_path( path, lFlags, &len );
800 if (*puBufferLength < len + 1)
801 {
802 *puBufferLength = len + 1;
803 goto done;
804 }
805 if (!pszText)
806 {
808 goto done;
809 }
810 if (str) lstrcpyW( pszText, str );
811 else pszText[0] = 0;
812 *puBufferLength = len + 1;
813
814 TRACE("returning %s\n", debugstr_w(pszText));
815
816done:
817 free( str );
819 return hr;
820}
static WCHAR * build_path(struct path *path, LONG flags, int *len)
Definition: path.c:621

◆ path_IsLocal()

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

Definition at line 1244 of file path.c.

1247{
1248 FIXME("%p, %s\n", iface, debugstr_w(wszMachine));
1249 return FALSE;
1250}

◆ path_IsRelative()

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

Definition at line 1225 of file path.c.

1229{
1230 FIXME("%p, %s, %s\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace));
1231 return FALSE;
1232}

◆ path_IsRelativeOrChild()

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

Definition at line 1234 of file path.c.

1239{
1240 FIXME("%p, %s, %s, %#lx\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace), lFlags);
1241 return FALSE;
1242}

◆ path_IsSameClassName()

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

Definition at line 1252 of file path.c.

1255{
1256 FIXME("%p, %s\n", iface, debugstr_w(wszClass));
1257 return FALSE;
1258}

◆ 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}

◆ 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 free( path );
346 }
347 return refs;
348}
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
Definition: rtltypes.h:1478
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ path_RemoveAllNamespaces()

static HRESULT WINAPI path_RemoveAllNamespaces ( IWbemPath *  iface)
static

Definition at line 1055 of file path.c.

1057{
1058 struct path *path = impl_from_IWbemPath( iface );
1059 int i;
1060
1061 TRACE("%p\n", iface);
1062
1064
1065 for (i = 0; i < path->num_namespaces; i++) free( path->namespaces[i] );
1066 path->num_namespaces = 0;
1067 free( path->namespaces );
1068 path->namespaces = NULL;
1071
1073 return S_OK;
1074}

◆ path_RemoveAllScopes()

static HRESULT WINAPI path_RemoveAllScopes ( IWbemPath *  iface)
static

Definition at line 1131 of file path.c.

1133{
1134 FIXME("%p\n", iface);
1135 return E_NOTIMPL;
1136}

◆ path_RemoveNamespaceAt()

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

Definition at line 1027 of file path.c.

1030{
1031 struct path *path = impl_from_IWbemPath( iface );
1032
1033 TRACE( "%p, %lu\n", iface, idx );
1034
1036
1037 if (idx >= path->num_namespaces)
1038 {
1041 }
1042 free( path->namespaces[idx] );
1043 while (idx < path->num_namespaces - 1)
1044 {
1047 idx++;
1048 }
1050
1052 return S_OK;
1053}

◆ path_RemoveScope()

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

Definition at line 1123 of file path.c.

1126{
1127 FIXME("%p, %lu\n", iface, uIndex);
1128 return E_NOTIMPL;
1129}

◆ path_SetClassName()

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

Definition at line 1138 of file path.c.

1141{
1142 struct path *path = impl_from_IWbemPath( iface );
1143 WCHAR *class;
1144
1145 TRACE("%p, %s\n", iface, debugstr_w(name));
1146
1147 if (!name) return WBEM_E_INVALID_PARAMETER;
1148 if (!(class = wcsdup( name ))) return WBEM_E_OUT_OF_MEMORY;
1149
1151
1152 free( path->class );
1153 path->class = class;
1156
1158 return S_OK;
1159}
#define lstrlenW
Definition: compat.h:750
@ WBEM_E_OUT_OF_MEMORY
Definition: wbemcli.idl:56

◆ path_SetNamespaceAt()

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

Definition at line 942 of file path.c.

946{
947 struct path *path = impl_from_IWbemPath( iface );
948 static const ULONGLONG flags =
951 int i, *tmp_len;
952 WCHAR **tmp, *new;
953 DWORD size;
954
955 TRACE( "%p, %lu, %s\n", iface, idx, debugstr_w(name) );
956
958
959 if (idx > path->num_namespaces || !name)
960 {
963 }
964 if (!(new = wcsdup( name )))
965 {
968 }
969 size = (path->num_namespaces + 1) * sizeof(WCHAR *);
970 if (path->namespaces) tmp = realloc( path->namespaces, size );
971 else tmp = malloc( size );
972 if (!tmp)
973 {
974 free( new );
977 }
978 path->namespaces = tmp;
979 size = (path->num_namespaces + 1) * sizeof(int);
980 if (path->len_namespaces) tmp_len = realloc( path->len_namespaces, size );
981 else tmp_len = malloc( size );
982 if (!tmp_len)
983 {
984 free( new );
987 }
988 path->len_namespaces = tmp_len;
989 for (i = idx; i < path->num_namespaces; i++)
990 {
991 path->namespaces[i + 1] = path->namespaces[i];
993 }
994 path->namespaces[idx] = new;
995 path->len_namespaces[idx] = lstrlenW( new );
997 path->flags |= flags;
998
1000 return S_OK;
1001}
#define realloc
Definition: debug_ros.c:6
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
uint64_t ULONGLONG
Definition: typedefs.h:67
@ WBEMPATH_INFO_V1_COMPLIANT
Definition: wmiutils.idl:35

◆ path_SetScope()

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

Definition at line 1084 of file path.c.

1088{
1089 FIXME("%p, %lu, %s\n", iface, uIndex, debugstr_w(pszClass));
1090 return E_NOTIMPL;
1091}

◆ path_SetScopeFromText()

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

Definition at line 1093 of file path.c.

1097{
1098 FIXME("%p, %lu, %s\n", iface, uIndex, debugstr_w(pszText));
1099 return E_NOTIMPL;
1100}

◆ path_SetServer()

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

Definition at line 863 of file path.c.

866{
867 struct path *path = impl_from_IWbemPath( iface );
868 static const ULONGLONG flags =
871 WCHAR *server;
872
873 TRACE("%p, %s\n", iface, debugstr_w(name));
874
876
877 if (name)
878 {
879 if (!(server = wcsdup( name )))
880 {
883 }
884 free( path->server );
885 path->server = server;
887 path->flags |= flags;
888 }
889 else
890 {
891 free( path->server );
892 path->server = NULL;
893 path->len_server = 0;
894 path->flags &= ~flags;
895 }
896
898 return S_OK;
899}

◆ path_SetText()

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

Definition at line 518 of file path.c.

522{
523 struct path *path = impl_from_IWbemPath( iface );
524 HRESULT hr = S_OK;
525 int len;
526
527 TRACE("%p, %lu, %s\n", iface, uMode, debugstr_w(pszPath));
528
529 if (!uMode || !pszPath) return WBEM_E_INVALID_PARAMETER;
530
532
533 clear_path( path );
534 if (!pszPath[0]) goto done;
535 if ((hr = parse_text( path, uMode, pszPath )) != S_OK) goto done;
536
537 len = lstrlenW( pszPath );
538 if (!(path->text = malloc( (len + 1) * sizeof(WCHAR) )))
539 {
540 clear_path( path );
542 goto done;
543 }
544 lstrcpyW( path->text, pszPath );
545 path->len_text = len;
546
547done:
549 return hr;
550}
static HRESULT parse_text(struct path *path, ULONG mode, const WCHAR *text)
Definition: path.c:405

◆ WbemPath_create()

HRESULT WbemPath_create ( LPVOID *  ppObj)

Definition at line 1293 of file path.c.

1294{
1295 struct path *path;
1296
1297 TRACE("%p\n", ppObj);
1298
1299 if (!(path = calloc( 1, sizeof(*path) ))) return E_OUTOFMEMORY;
1300
1301 path->IWbemPath_iface.lpVtbl = &path_vtbl;
1302 path->refs = 1;
1304 path->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": wmiutils_path.cs");
1305 init_path( path );
1306
1307 *ppObj = &path->IWbemPath_iface;
1308
1309 TRACE("returning iface %p\n", *ppObj);
1310 return S_OK;
1311}
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static const struct IWbemPathVtbl path_vtbl
Definition: path.c:1260
IWbemPath IWbemPath_iface
Definition: path.c:51
#define DWORD_PTR
Definition: treelist.c:76
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

◆ 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 = calloc( 1, sizeof(*keylist) ))) return E_OUTOFMEMORY;
285
287 keylist->refs = 1;
289 IWbemPath_AddRef( keylist->parent );
290
292
293 TRACE("returning iface %p\n", *ppObj);
294 return S_OK;
295}
static const struct IWbemPathKeyListVtbl keylist_vtbl
Definition: path.c:261
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_SetKey(IWbemPathKeyList *iface, LPCWSTR wszName, ULONG uFlags, ULONG uCimType, LPVOID pKeyVal)
Definition: path.c:141
static HRESULT WINAPI keylist_QueryInterface(IWbemPathKeyList *iface, REFIID riid, void **ppvObject)
Definition: path.c:99
static HRESULT WINAPI keylist_RemoveAllKeys(IWbemPathKeyList *iface, ULONG uFlags)
Definition: path.c:213
static HRESULT WINAPI keylist_GetInfo(IWbemPathKeyList *iface, ULONG uRequestedInfo, ULONGLONG *puResponse)
Definition: path.c:242
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_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_GetText(IWbemPathKeyList *iface, LONG lFlags, ULONG *puBuffLength, LPWSTR pszText)
Definition: path.c:251
static HRESULT WINAPI keylist_GetCount(IWbemPathKeyList *iface, ULONG *puKeyCount)
Definition: path.c:122
static ULONG WINAPI keylist_AddRef(IWbemPathKeyList *iface)
Definition: path.c:78
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 ULONG WINAPI keylist_Release(IWbemPathKeyList *iface)
Definition: path.c:85

Definition at line 261 of file path.c.

Referenced by WbemPathKeyList_create().

◆ path_vtbl

const struct IWbemPathVtbl path_vtbl
static

Definition at line 1260 of file path.c.

Referenced by WbemPath_create().