ReactOS 0.4.15-dev-8131-g4988de4
filemoniker.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "wine/debug.h"
#include "objbase.h"
#include "moniker.h"
#include "compobj_private.h"
Include dependency graph for filemoniker.c:

Go to the source code of this file.

Classes

struct  FileMonikerImpl
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 

Typedefs

typedef struct FileMonikerImpl FileMonikerImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static FileMonikerImplimpl_from_IMoniker (IMoniker *iface)
 
static FileMonikerImplimpl_from_IROTData (IROTData *iface)
 
static HRESULT FileMonikerImpl_Construct (FileMonikerImpl *iface, LPCOLESTR lpszPathName)
 
static HRESULT FileMonikerImpl_Destroy (FileMonikerImpl *iface)
 
static HRESULT WINAPI FileMonikerImpl_QueryInterface (IMoniker *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI FileMonikerImpl_AddRef (IMoniker *iface)
 
static ULONG WINAPI FileMonikerImpl_Release (IMoniker *iface)
 
static HRESULT WINAPI FileMonikerImpl_GetClassID (IMoniker *iface, CLSID *pClassID)
 
static HRESULT WINAPI FileMonikerImpl_IsDirty (IMoniker *iface)
 
static HRESULT WINAPI FileMonikerImpl_Load (IMoniker *iface, IStream *pStm)
 
static HRESULT WINAPI FileMonikerImpl_Save (IMoniker *iface, IStream *pStm, BOOL fClearDirty)
 
static HRESULT WINAPI FileMonikerImpl_GetSizeMax (IMoniker *iface, ULARGE_INTEGER *pcbSize)
 
static HRESULT WINAPI FileMonikerImpl_BindToObject (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
 
static HRESULT WINAPI FileMonikerImpl_BindToStorage (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvObject)
 
static HRESULT WINAPI FileMonikerImpl_Reduce (IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
 
static void free_stringtable (LPOLESTR *stringTable)
 
static HRESULT WINAPI FileMonikerImpl_ComposeWith (IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
 
static HRESULT WINAPI FileMonikerImpl_Enum (IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
 
static HRESULT WINAPI FileMonikerImpl_IsEqual (IMoniker *iface, IMoniker *pmkOtherMoniker)
 
static HRESULT WINAPI FileMonikerImpl_Hash (IMoniker *iface, DWORD *pdwHash)
 
static HRESULT WINAPI FileMonikerImpl_IsRunning (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
 
static HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
 
static HRESULT WINAPI FileMonikerImpl_Inverse (IMoniker *iface, IMoniker **ppmk)
 
static HRESULT WINAPI FileMonikerImpl_CommonPrefixWith (IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
 
int FileMonikerImpl_DecomposePath (LPCOLESTR str, LPOLESTR **stringTable)
 
static HRESULT WINAPI FileMonikerImpl_RelativePathTo (IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
 
static HRESULT WINAPI FileMonikerImpl_GetDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
 
static HRESULT WINAPI FileMonikerImpl_ParseDisplayName (IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
 
static HRESULT WINAPI FileMonikerImpl_IsSystemMoniker (IMoniker *iface, DWORD *pwdMksys)
 
static HRESULT WINAPI FileMonikerROTDataImpl_QueryInterface (IROTData *iface, REFIID riid, VOID **ppvObject)
 
static ULONG WINAPI FileMonikerROTDataImpl_AddRef (IROTData *iface)
 
static ULONG WINAPI FileMonikerROTDataImpl_Release (IROTData *iface)
 
static HRESULT WINAPI FileMonikerROTDataImpl_GetComparisonData (IROTData *iface, BYTE *pbData, ULONG cbMax, ULONG *pcbData)
 
HRESULT WINAPI CreateFileMoniker (LPCOLESTR lpszPathName, IMoniker **ppmk)
 
static WCHARmemrpbrkW (const WCHAR *ptr, size_t n, const WCHAR *accept)
 
HRESULT FileMoniker_CreateFromDisplayName (LPBC pbc, LPCOLESTR szDisplayName, LPDWORD pchEaten, IMoniker **ppmk)
 
HRESULT WINAPI FileMoniker_CreateInstance (IClassFactory *iface, IUnknown *pUnk, REFIID riid, void **ppv)
 

Variables

static const IMonikerVtbl VT_FileMonikerImpl
 
static const IROTDataVtbl VT_ROTDataImpl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 26 of file filemoniker.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 27 of file filemoniker.c.

Typedef Documentation

◆ FileMonikerImpl

Function Documentation

◆ CreateFileMoniker()

HRESULT WINAPI CreateFileMoniker ( LPCOLESTR  lpszPathName,
IMoniker **  ppmk 
)

Definition at line 1414 of file filemoniker.c.

1415{
1416 FileMonikerImpl* newFileMoniker;
1417 HRESULT hr;
1418
1419 TRACE("(%s,%p)\n",debugstr_w(lpszPathName),ppmk);
1420
1421 if (!ppmk)
1422 return E_POINTER;
1423
1424 if(!lpszPathName)
1425 return MK_E_SYNTAX;
1426
1427 *ppmk=NULL;
1428
1429 newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl));
1430
1431 if (!newFileMoniker)
1432 return E_OUTOFMEMORY;
1433
1434 hr = FileMonikerImpl_Construct(newFileMoniker,lpszPathName);
1435
1436 if (SUCCEEDED(hr))
1437 hr = IMoniker_QueryInterface(&newFileMoniker->IMoniker_iface,&IID_IMoniker,(void**)ppmk);
1438 else
1439 HeapFree(GetProcessHeap(),0,newFileMoniker);
1440
1441 return hr;
1442}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
static HRESULT FileMonikerImpl_Construct(FileMonikerImpl *iface, LPCOLESTR lpszPathName)
Definition: filemoniker.c:1344
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_w
Definition: kernel32.h:32
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
IMoniker IMoniker_iface
Definition: filemoniker.c:43
#define MK_E_SYNTAX
Definition: winerror.h:2785
#define E_POINTER
Definition: winerror.h:2365

Referenced by FileMoniker_CreateFromDisplayName(), FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_RelativePathTo(), HlinkParseDisplayName(), IHlink_fnSetStringReference(), OleCreateFromFileEx(), test_file_moniker(), test_HlinkMoniker(), test_MkParseDisplayName(), test_ROT(), test_ROT_multiple_entries(), and test_save_load_filemoniker().

◆ FileMoniker_CreateFromDisplayName()

HRESULT FileMoniker_CreateFromDisplayName ( LPBC  pbc,
LPCOLESTR  szDisplayName,
LPDWORD  pchEaten,
IMoniker **  ppmk 
)

Definition at line 1452 of file filemoniker.c.

1454{
1455 LPCWSTR end;
1456 static const WCHAR wszSeparators[] = {':','\\','/','!',0};
1457
1458 for (end = szDisplayName + lstrlenW(szDisplayName);
1459 end && (end != szDisplayName);
1460 end = memrpbrkW(szDisplayName, end - szDisplayName, wszSeparators))
1461 {
1462 HRESULT hr;
1464 IMoniker *file_moniker;
1465 LPWSTR file_display_name;
1466 LPWSTR full_path_name;
1467 DWORD full_path_name_len;
1468 int len = end - szDisplayName;
1469
1470 file_display_name = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
1471 if (!file_display_name) return E_OUTOFMEMORY;
1472 memcpy(file_display_name, szDisplayName, len * sizeof(WCHAR));
1473 file_display_name[len] = '\0';
1474
1475 hr = CreateFileMoniker(file_display_name, &file_moniker);
1476 if (FAILED(hr))
1477 {
1478 HeapFree(GetProcessHeap(), 0, file_display_name);
1479 return hr;
1480 }
1481
1482 hr = IBindCtx_GetRunningObjectTable(pbc, &rot);
1483 if (FAILED(hr))
1484 {
1485 HeapFree(GetProcessHeap(), 0, file_display_name);
1486 IMoniker_Release(file_moniker);
1487 return hr;
1488 }
1489
1490 hr = IRunningObjectTable_IsRunning(rot, file_moniker);
1491 IRunningObjectTable_Release(rot);
1492 if (FAILED(hr))
1493 {
1494 HeapFree(GetProcessHeap(), 0, file_display_name);
1495 IMoniker_Release(file_moniker);
1496 return hr;
1497 }
1498 if (hr == S_OK)
1499 {
1500 TRACE("found running file moniker for %s\n", debugstr_w(file_display_name));
1501 *pchEaten = len;
1502 *ppmk = file_moniker;
1503 HeapFree(GetProcessHeap(), 0, file_display_name);
1504 return S_OK;
1505 }
1506
1507 full_path_name_len = GetFullPathNameW(file_display_name, 0, NULL, NULL);
1508 if (!full_path_name_len)
1509 {
1510 HeapFree(GetProcessHeap(), 0, file_display_name);
1511 IMoniker_Release(file_moniker);
1512 return MK_E_SYNTAX;
1513 }
1514 full_path_name = HeapAlloc(GetProcessHeap(), 0, full_path_name_len * sizeof(WCHAR));
1515 if (!full_path_name)
1516 {
1517 HeapFree(GetProcessHeap(), 0, file_display_name);
1518 IMoniker_Release(file_moniker);
1519 return E_OUTOFMEMORY;
1520 }
1521 GetFullPathNameW(file_display_name, full_path_name_len, full_path_name, NULL);
1522
1523 if (GetFileAttributesW(full_path_name) == INVALID_FILE_ATTRIBUTES)
1524 TRACE("couldn't open file %s\n", debugstr_w(full_path_name));
1525 else
1526 {
1527 TRACE("got file moniker for %s\n", debugstr_w(szDisplayName));
1528 *pchEaten = len;
1529 *ppmk = file_moniker;
1530 HeapFree(GetProcessHeap(), 0, file_display_name);
1531 HeapFree(GetProcessHeap(), 0, full_path_name);
1532 return S_OK;
1533 }
1534 HeapFree(GetProcessHeap(), 0, file_display_name);
1535 HeapFree(GetProcessHeap(), 0, full_path_name);
1536 IMoniker_Release(file_moniker);
1537 }
1538
1539 return MK_E_CANTOPENFILE;
1540}
GLfloat rot
Definition: 3dtext.c:36
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
HRESULT WINAPI CreateFileMoniker(LPCOLESTR lpszPathName, IMoniker **ppmk)
Definition: filemoniker.c:1414
static WCHAR * memrpbrkW(const WCHAR *ptr, size_t n, const WCHAR *accept)
Definition: filemoniker.c:1445
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define MK_E_CANTOPENFILE
Definition: winerror.h:2791
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MkParseDisplayName().

◆ FileMoniker_CreateInstance()

HRESULT WINAPI FileMoniker_CreateInstance ( IClassFactory iface,
IUnknown pUnk,
REFIID  riid,
void **  ppv 
)

Definition at line 1543 of file filemoniker.c.

1544{
1545 FileMonikerImpl* newFileMoniker;
1546 HRESULT hr;
1547 static const WCHAR wszEmpty[] = { 0 };
1548
1549 TRACE("(%p, %s, %p)\n", pUnk, debugstr_guid(riid), ppv);
1550
1551 *ppv = NULL;
1552
1553 if (pUnk)
1554 return CLASS_E_NOAGGREGATION;
1555
1556 newFileMoniker = HeapAlloc(GetProcessHeap(), 0, sizeof(FileMonikerImpl));
1557 if (!newFileMoniker)
1558 return E_OUTOFMEMORY;
1559
1560 hr = FileMonikerImpl_Construct(newFileMoniker, wszEmpty);
1561
1562 if (SUCCEEDED(hr))
1563 hr = IMoniker_QueryInterface(&newFileMoniker->IMoniker_iface, riid, ppv);
1564 if (FAILED(hr))
1565 HeapFree(GetProcessHeap(),0,newFileMoniker);
1566
1567 return hr;
1568}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
static const WCHAR wszEmpty[]
Definition: misc.c:327
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ FileMonikerImpl_AddRef()

static ULONG WINAPI FileMonikerImpl_AddRef ( IMoniker iface)
static

Definition at line 115 of file filemoniker.c.

116{
118
119 TRACE("(%p)\n",iface);
120
121 return InterlockedIncrement(&This->ref);
122}
#define InterlockedIncrement
Definition: armddk.h:53
static FileMonikerImpl * impl_from_IMoniker(IMoniker *iface)
Definition: filemoniker.c:50

◆ FileMonikerImpl_BindToObject()

static HRESULT WINAPI FileMonikerImpl_BindToObject ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riid,
VOID **  ppvResult 
)
static

Definition at line 478 of file filemoniker.c.

480{
483 CLSID clsID;
484 IUnknown* pObj=0;
485 IRunningObjectTable *prot=0;
486 IPersistFile *ppf=0;
487 IClassFactory *pcf=0;
489
490 *ppvResult=0;
491
492 TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvResult);
493
494 if(pmkToLeft==NULL){
495
496 res=IBindCtx_GetRunningObjectTable(pbc,&prot);
497
498 if (SUCCEEDED(res)){
499 /* if the requested class was loaded before ! we don't need to reload it */
500 res = IRunningObjectTable_GetObject(prot,iface,&pObj);
501
502 if (res != S_OK){
503 /* first activation of this class */
504 res=GetClassFile(This->filePathName,&clsID);
505 if (SUCCEEDED(res)){
506
507 res=CoCreateInstance(&clsID,NULL,CLSCTX_SERVER,&IID_IPersistFile,(void**)&ppf);
508 if (SUCCEEDED(res)){
509
510 res=IPersistFile_Load(ppf,This->filePathName,STGM_READ);
511 if (SUCCEEDED(res)){
512
513 pObj=(IUnknown*)ppf;
514 IUnknown_AddRef(pObj);
515 }
516 }
517 }
518 }
519 }
520 }
521 else{
522 res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassFactory,(void**)&pcf);
523
524 if (res==E_NOINTERFACE){
525
526 res=IMoniker_BindToObject(pmkToLeft,pbc,NULL,&IID_IClassActivator,(void**)&pca);
527
528 if (res==E_NOINTERFACE)
530 }
531 if (pcf!=NULL){
532
533 IClassFactory_CreateInstance(pcf,NULL,&IID_IPersistFile,(void**)&ppf);
534
535 res=IPersistFile_Load(ppf,This->filePathName,STGM_READ);
536
537 if (SUCCEEDED(res)){
538
539 pObj=(IUnknown*)ppf;
540 IUnknown_AddRef(pObj);
541 }
542 }
543 if (pca!=NULL){
544
545 FIXME("()\n");
546
547 /*res=GetClassFile(This->filePathName,&clsID);
548
549 if (SUCCEEDED(res)){
550
551 res=IClassActivator_GetClassObject(pca,&clsID,CLSCTX_ALL,0,&IID_IPersistFile,(void**)&ppf);
552
553 if (SUCCEEDED(res)){
554
555 pObj=(IUnknown*)ppf;
556 IUnknown_AddRef(pObj);
557 }
558 }*/
559 }
560 }
561
562 if (pObj!=NULL){
563 /* get the requested interface from the loaded class */
564 res= IUnknown_QueryInterface(pObj,riid,ppvResult);
565
566 IBindCtx_RegisterObjectBound(pbc,*ppvResult);
567
568 IUnknown_Release(pObj);
569 }
570
571 if (prot!=NULL)
572 IRunningObjectTable_Release(prot);
573
574 if (ppf!=NULL)
575 IPersistFile_Release(ppf);
576
577 if (pca!=NULL)
578 IClassActivator_Release(pca);
579
580 if (pcf!=NULL)
581 IClassFactory_Release(pcf);
582
583 return res;
584}
const GUID IID_IClassFactory
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_FAIL
Definition: ddrawi.h:102
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI GetClassFile(LPCOLESTR filePathName, CLSID *pclsid)
Definition: moniker.c:1213
GLuint res
Definition: glext.h:9613
#define STGM_READ
Definition: objbase.h:917
const GUID IID_IPersistFile
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_opt_ COLORADJUSTMENT * pca
Definition: winddi.h:3779
#define E_NOINTERFACE
Definition: winerror.h:2364
#define MK_E_INTERMEDIATEINTERFACENOTSUPPORTED
Definition: winerror.h:2788

◆ FileMonikerImpl_BindToStorage()

static HRESULT WINAPI FileMonikerImpl_BindToStorage ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
REFIID  riid,
VOID **  ppvObject 
)
static

Definition at line 590 of file filemoniker.c.

592{
593 LPOLESTR filePath=0;
594 IStorage *pstg=0;
595 HRESULT res;
596
597 TRACE("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvObject);
598
599 if (pmkToLeft==NULL){
600
601 if (IsEqualIID(&IID_IStorage, riid)){
602
603 /* get the file name */
604 IMoniker_GetDisplayName(iface,pbc,pmkToLeft,&filePath);
605
607
608 if (SUCCEEDED(res))
609 *ppvObject=pstg;
610
611 CoTaskMemFree(filePath);
612 }
613 else
614 if ( (IsEqualIID(&IID_IStream, riid)) || (IsEqualIID(&IID_ILockBytes, riid)) )
615 return E_FAIL;
616 else
617 return E_NOINTERFACE;
618 }
619 else {
620
621 FIXME("(%p,%p,%p,%s,%p)\n",iface,pbc,pmkToLeft,debugstr_guid(riid),ppvObject);
622
623 return E_NOTIMPL;
624 }
625 return res;
626}
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
Definition: storage32.c:8755
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static LPOLESTR
Definition: stg_prop.c:27
#define STGM_READWRITE
Definition: objbase.h:919
#define STGM_SHARE_DENY_WRITE
Definition: objbase.h:922
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ FileMonikerImpl_CommonPrefixWith()

static HRESULT WINAPI FileMonikerImpl_CommonPrefixWith ( IMoniker iface,
IMoniker pmkOther,
IMoniker **  ppmkPrefix 
)
static

Definition at line 922 of file filemoniker.c.

923{
924
925 LPOLESTR pathThis = NULL, pathOther = NULL, *stringTable1 = NULL;
926 LPOLESTR *stringTable2 = NULL, commonPath = NULL;
927 IBindCtx *bindctx;
928 DWORD mkSys;
929 ULONG nb1,nb2,i,sameIdx;
930 BOOL machineNameCase = FALSE;
931 HRESULT ret;
932
933 if (ppmkPrefix==NULL)
934 return E_POINTER;
935
936 if (pmkOther==NULL)
937 return E_INVALIDARG;
938
939 *ppmkPrefix=0;
940
941 /* check if we have the same type of moniker */
942 IMoniker_IsSystemMoniker(pmkOther,&mkSys);
943 if (mkSys != MKSYS_FILEMONIKER)
944 return MonikerCommonPrefixWith(iface, pmkOther, ppmkPrefix);
945
946 ret = CreateBindCtx(0, &bindctx);
947 if (FAILED(ret))
948 return ret;
949
950 /* create a string based on common part of the two paths */
951 ret = IMoniker_GetDisplayName(iface, bindctx, NULL, &pathThis);
952 if (FAILED(ret))
953 goto failed;
954
955 ret = IMoniker_GetDisplayName(pmkOther, bindctx, NULL, &pathOther);
956 if (FAILED(ret))
957 goto failed;
958
959 nb1 = FileMonikerImpl_DecomposePath(pathThis, &stringTable1);
960 if (FAILED(nb1)) {
961 ret = nb1;
962 goto failed;
963 }
964
965 nb2 = FileMonikerImpl_DecomposePath(pathOther, &stringTable2);
966 if (FAILED(nb2)) {
967 ret = nb2;
968 goto failed;
969 }
970
971 if (nb1 == 0 || nb2 == 0) {
973 goto failed;
974 }
975
976 commonPath = CoTaskMemAlloc(sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1));
977 if (!commonPath) {
979 goto failed;
980 }
981
982 *commonPath = 0;
983 for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) &&
984 (stringTable2[sameIdx]!=NULL) &&
985 (lstrcmpiW(stringTable1[sameIdx],stringTable2[sameIdx])==0)); sameIdx++);
986
987 if (sameIdx > 1 && *stringTable1[0]=='\\' && *stringTable2[1]=='\\'){
988 machineNameCase = TRUE;
989
990 for(i=2;i<sameIdx;i++)
991 if( (*stringTable1[i]=='\\') && (i+1 < sameIdx) && (*stringTable1[i+1]=='\\') ){
992 machineNameCase = FALSE;
993 break;
994 }
995 }
996
997 if (machineNameCase && *stringTable1[sameIdx-1]=='\\')
998 sameIdx--;
999
1000 if (machineNameCase && (sameIdx<=3) && (nb1 > 3 || nb2 > 3) )
1002 else
1003 {
1004 for (i = 0; i < sameIdx; i++)
1005 lstrcatW(commonPath,stringTable1[i]);
1006 ret = CreateFileMoniker(commonPath, ppmkPrefix);
1007 }
1008
1009failed:
1010 IBindCtx_Release(bindctx);
1011 CoTaskMemFree(pathThis);
1012 CoTaskMemFree(pathOther);
1013 CoTaskMemFree(commonPath);
1014 if (stringTable1) free_stringtable(stringTable1);
1015 if (stringTable2) free_stringtable(stringTable2);
1016
1017 return ret;
1018}
HRESULT WINAPI MonikerCommonPrefixWith(IMoniker *pmkThis, IMoniker *pmkOther, IMoniker **ppmkCommon)
#define E_INVALIDARG
Definition: ddrawi.h:101
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
static void free_stringtable(LPOLESTR *stringTable)
Definition: filemoniker.c:647
int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR **stringTable)
Definition: filemoniker.c:1023
unsigned int BOOL
Definition: ntddk_ex.h:94
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
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define min(a, b)
Definition: monoChain.cc:55
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
Definition: bindctx.c:556
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define MK_E_NOPREFIX
Definition: winerror.h:2795

◆ FileMonikerImpl_ComposeWith()

static HRESULT WINAPI FileMonikerImpl_ComposeWith ( IMoniker iface,
IMoniker pmkRight,
BOOL  fOnlyIfNotGeneric,
IMoniker **  ppmkComposite 
)
static

Definition at line 660 of file filemoniker.c.

662{
663 HRESULT res;
664 LPOLESTR str1=0,str2=0,*strDec1=0,*strDec2=0,newStr=0;
665 static const WCHAR twoPoint[]={'.','.',0};
666 static const WCHAR bkSlash[]={'\\',0};
667 IBindCtx *bind=0;
668 int i=0,j=0,lastIdx1=0,lastIdx2=0;
669 DWORD mkSys;
670
671 TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
672
673 if (ppmkComposite==NULL)
674 return E_POINTER;
675
676 if (pmkRight==NULL)
677 return E_INVALIDARG;
678
679 *ppmkComposite=0;
680
681 IMoniker_IsSystemMoniker(pmkRight,&mkSys);
682
683 /* check if we have two FileMonikers to compose or not */
684 if(mkSys==MKSYS_FILEMONIKER){
685
687
688 IMoniker_GetDisplayName(iface,bind,NULL,&str1);
689 IMoniker_GetDisplayName(pmkRight,bind,NULL,&str2);
690
691 /* decompose pathnames of the two monikers : (to prepare the path merge operation ) */
692 lastIdx1=FileMonikerImpl_DecomposePath(str1,&strDec1)-1;
693 lastIdx2=FileMonikerImpl_DecomposePath(str2,&strDec2)-1;
694
695 if ((lastIdx1==-1 && lastIdx2>-1)||(lastIdx1==1 && wcscmp(strDec1[0],twoPoint)==0))
697 else{
698 if(wcscmp(strDec1[lastIdx1],bkSlash)==0)
699 lastIdx1--;
700
701 /* for each "..\" in the left of str2 remove the right element from str1 */
702 for(i=0; ( (lastIdx1>=0) && (strDec2[i]!=NULL) && (wcscmp(strDec2[i],twoPoint)==0) ); i+=2){
703
704 lastIdx1-=2;
705 }
706
707 /* the length of the composed path string is increased by the sum of the two paths' lengths */
708 newStr=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(lstrlenW(str1)+lstrlenW(str2)+1));
709
710 if (newStr){
711 /* new path is the concatenation of the rest of str1 and str2 */
712 for(*newStr=0,j=0;j<=lastIdx1;j++)
713 lstrcatW(newStr,strDec1[j]);
714
715 if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || wcscmp(strDec2[i],bkSlash)!=0)
716 lstrcatW(newStr,bkSlash);
717
718 for(j=i;j<=lastIdx2;j++)
719 lstrcatW(newStr,strDec2[j]);
720
721 /* create a new moniker with the new string */
722 res=CreateFileMoniker(newStr,ppmkComposite);
723
724 /* free string memory used by this function */
725 HeapFree(GetProcessHeap(),0,newStr);
726 }
727 else res = E_OUTOFMEMORY;
728 }
729
730 free_stringtable(strDec1);
731 free_stringtable(strDec2);
732
733 CoTaskMemFree(str1);
734 CoTaskMemFree(str2);
735
736 return res;
737 }
738 else if(mkSys==MKSYS_ANTIMONIKER){
739
740 *ppmkComposite=NULL;
741 return S_OK;
742 }
743 else if (fOnlyIfNotGeneric){
744
745 *ppmkComposite=NULL;
746 return MK_E_NEEDGENERIC;
747 }
748 else
749
750 return CreateGenericComposite(iface,pmkRight,ppmkComposite);
751}
HRESULT WINAPI CreateGenericComposite(IMoniker *pmkFirst, IMoniker *pmkRest, IMoniker **ppmkComposite)
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 GLint GLint j
Definition: glfuncs.h:250
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
Definition: socklife.c:36
#define MK_E_NEEDGENERIC
Definition: winerror.h:2783

◆ FileMonikerImpl_Construct()

static HRESULT FileMonikerImpl_Construct ( FileMonikerImpl iface,
LPCOLESTR  lpszPathName 
)
static

Definition at line 1344 of file filemoniker.c.

1345{
1346 int nb=0,i;
1347 int sizeStr=lstrlenW(lpszPathName);
1348 LPOLESTR *tabStr=0;
1349 static const WCHAR twoPoint[]={'.','.',0};
1350 static const WCHAR bkSlash[]={'\\',0};
1351 BOOL addBkSlash;
1352
1353 TRACE("(%p,%s)\n",This,debugstr_w(lpszPathName));
1354
1355 /* Initialize the virtual function table. */
1356 This->IMoniker_iface.lpVtbl = &VT_FileMonikerImpl;
1357 This->IROTData_iface.lpVtbl = &VT_ROTDataImpl;
1358 This->ref = 0;
1359 This->pMarshal = NULL;
1360
1361 This->filePathName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(sizeStr+1));
1362
1363 if (This->filePathName==NULL)
1364 return E_OUTOFMEMORY;
1365
1366 lstrcpyW(This->filePathName,lpszPathName);
1367
1368 nb=FileMonikerImpl_DecomposePath(This->filePathName,&tabStr);
1369
1370 if (nb > 0 ){
1371
1372 addBkSlash = TRUE;
1373 if (wcscmp(tabStr[0],twoPoint)!=0)
1374 addBkSlash = FALSE;
1375 else
1376 for(i=0;i<nb;i++){
1377
1378 if ( (wcscmp(tabStr[i],twoPoint)!=0) && (wcscmp(tabStr[i],bkSlash)!=0) ){
1379 addBkSlash = FALSE;
1380 break;
1381 }
1382 else
1383
1384 if (wcscmp(tabStr[i],bkSlash)==0 && i<nb-1 && wcscmp(tabStr[i+1],bkSlash)==0){
1385 *tabStr[i]=0;
1386 sizeStr--;
1387 addBkSlash = FALSE;
1388 break;
1389 }
1390 }
1391
1392 if (wcscmp(tabStr[nb-1],bkSlash)==0)
1393 addBkSlash = FALSE;
1394
1395 This->filePathName=HeapReAlloc(GetProcessHeap(),0,This->filePathName,(sizeStr+1)*sizeof(WCHAR));
1396
1397 *This->filePathName=0;
1398
1399 for(i=0;tabStr[i]!=NULL;i++)
1400 lstrcatW(This->filePathName,tabStr[i]);
1401
1402 if (addBkSlash)
1403 lstrcatW(This->filePathName,bkSlash);
1404 }
1405
1406 free_stringtable(tabStr);
1407
1408 return S_OK;
1409}
#define HeapReAlloc
Definition: compat.h:734
#define lstrcpyW
Definition: compat.h:749
static const IMonikerVtbl VT_FileMonikerImpl
Definition: filemoniker.c:1305
static const IROTDataVtbl VT_ROTDataImpl
Definition: filemoniker.c:1333

Referenced by CreateFileMoniker(), and FileMoniker_CreateInstance().

◆ FileMonikerImpl_DecomposePath()

int FileMonikerImpl_DecomposePath ( LPCOLESTR  str,
LPOLESTR **  stringTable 
)

Definition at line 1023 of file filemoniker.c.

1024{
1025 static const WCHAR bSlash[] = {'\\',0};
1026 LPOLESTR word;
1027 int i=0,j,tabIndex=0, ret=0;
1028 LPOLESTR *strgtable ;
1029
1030 int len=lstrlenW(str);
1031
1032 TRACE("%s, %p\n", debugstr_w(str), *stringTable);
1033
1034 strgtable = CoTaskMemAlloc((len + 1)*sizeof(*strgtable));
1035
1036 if (strgtable==NULL)
1037 return E_OUTOFMEMORY;
1038
1039 word = CoTaskMemAlloc((len + 1)*sizeof(WCHAR));
1040
1041 if (word==NULL)
1042 {
1044 goto lend;
1045 }
1046
1047 while(str[i]!=0){
1048
1049 if(str[i]==bSlash[0]){
1050
1051 strgtable[tabIndex]=CoTaskMemAlloc(2*sizeof(WCHAR));
1052
1053 if (strgtable[tabIndex]==NULL)
1054 {
1056 goto lend;
1057 }
1058
1059 lstrcpyW(strgtable[tabIndex++],bSlash);
1060
1061 i++;
1062
1063 }
1064 else {
1065
1066 for(j=0; str[i]!=0 && str[i]!=bSlash[0] ; i++,j++)
1067 word[j]=str[i];
1068
1069 word[j]=0;
1070
1071 strgtable[tabIndex]=CoTaskMemAlloc(sizeof(WCHAR)*(j+1));
1072
1073 if (strgtable[tabIndex]==NULL)
1074 {
1076 goto lend;
1077 }
1078
1079 lstrcpyW(strgtable[tabIndex++],word);
1080 }
1081 }
1082 strgtable[tabIndex]=NULL;
1083
1084 *stringTable=strgtable;
1085
1086 ret = tabIndex;
1087
1088lend:
1089 if (ret < 0)
1090 {
1091 for (i = 0; i < tabIndex; i++)
1092 CoTaskMemFree(strgtable[i]);
1093
1094 CoTaskMemFree(strgtable);
1095 }
1096
1098
1099 return ret;
1100}
const WCHAR * word
Definition: lex.c:36
const WCHAR * str

Referenced by FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_Construct(), FileMonikerImpl_RelativePathTo(), and GetClassFile().

◆ FileMonikerImpl_Destroy()

HRESULT FileMonikerImpl_Destroy ( FileMonikerImpl iface)
static

Definition at line 463 of file filemoniker.c.

464{
465 TRACE("(%p)\n",This);
466
467 if (This->pMarshal) IUnknown_Release(This->pMarshal);
468 HeapFree(GetProcessHeap(),0,This->filePathName);
470
471 return S_OK;
472}

Referenced by FileMonikerImpl_Release().

◆ FileMonikerImpl_Enum()

static HRESULT WINAPI FileMonikerImpl_Enum ( IMoniker iface,
BOOL  fForward,
IEnumMoniker **  ppenumMoniker 
)
static

Definition at line 757 of file filemoniker.c.

758{
759 TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker);
760
761 if (ppenumMoniker == NULL)
762 return E_POINTER;
763
764 *ppenumMoniker = NULL;
765
766 return S_OK;
767}

◆ FileMonikerImpl_GetClassID()

static HRESULT WINAPI FileMonikerImpl_GetClassID ( IMoniker iface,
CLSID pClassID 
)
static

Definition at line 147 of file filemoniker.c.

148{
149 TRACE("(%p,%p)\n",iface,pClassID);
150
151 if (pClassID==NULL)
152 return E_POINTER;
153
154 *pClassID = CLSID_FileMoniker;
155
156 return S_OK;
157}

◆ FileMonikerImpl_GetDisplayName()

static HRESULT WINAPI FileMonikerImpl_GetDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR ppszDisplayName 
)
static

Definition at line 1183 of file filemoniker.c.

1185{
1187 int len=lstrlenW(This->filePathName);
1188
1189 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName);
1190
1191 if (ppszDisplayName==NULL)
1192 return E_POINTER;
1193
1194 if (pmkToLeft!=NULL)
1195 return E_INVALIDARG;
1196
1197 *ppszDisplayName=CoTaskMemAlloc(sizeof(WCHAR)*(len+1));
1198 if (*ppszDisplayName==NULL)
1199 return E_OUTOFMEMORY;
1200
1201 lstrcpyW(*ppszDisplayName,This->filePathName);
1202
1203 TRACE("-- %s\n", debugstr_w(*ppszDisplayName));
1204
1205 return S_OK;
1206}

◆ FileMonikerImpl_GetSizeMax()

static HRESULT WINAPI FileMonikerImpl_GetSizeMax ( IMoniker iface,
ULARGE_INTEGER pcbSize 
)
static

Definition at line 442 of file filemoniker.c.

443{
445
446 TRACE("(%p,%p)\n",iface,pcbSize);
447
448 if (!pcbSize)
449 return E_POINTER;
450
451 /* We could calculate exactly (see ...::Save()) but instead
452 * we'll make a quick over-estimate, like Windows (NT4, XP) does.
453 */
454 pcbSize->u.LowPart = 0x38 + 4 * lstrlenW(This->filePathName);
455 pcbSize->u.HighPart = 0;
456
457 return S_OK;
458}
struct _ULARGE_INTEGER::@4145 u

◆ FileMonikerImpl_GetTimeOfLastChange()

static HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
FILETIME pFileTime 
)
static

Definition at line 873 of file filemoniker.c.

875{
878 HRESULT res;
880
881 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pFileTime);
882
883 if (pFileTime==NULL)
884 return E_POINTER;
885
886 if (pmkToLeft!=NULL)
887 return E_INVALIDARG;
888
889 res=IBindCtx_GetRunningObjectTable(pbc,&rot);
890
891 if (FAILED(res))
892 return res;
893
894 res= IRunningObjectTable_GetTimeOfLastChange(rot,iface,pFileTime);
895
896 if (FAILED(res)){ /* the moniker is not registered */
897
899 return MK_E_NOOBJECT;
900
901 *pFileTime=info.ftLastWriteTime;
902 }
903
904 return S_OK;
905}
BOOL WINAPI GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation)
Definition: fileinfo.c:552
@ GetFileExInfoStandard
Definition: winbase.h:1161
#define MK_E_NOOBJECT
Definition: winerror.h:2786

◆ FileMonikerImpl_Hash()

static HRESULT WINAPI FileMonikerImpl_Hash ( IMoniker iface,
DWORD pdwHash 
)
static

Definition at line 809 of file filemoniker.c.

810{
812 int h = 0,i,skip,len;
813 int off = 0;
815
816 if (pdwHash==NULL)
817 return E_POINTER;
818
819 val = This->filePathName;
820 len = lstrlenW(val);
821
822 if (len < 16) {
823 for (i = len ; i > 0; i--) {
824 h = (h * 37) + val[off++];
825 }
826 } else {
827 /* only sample some characters */
828 skip = len / 8;
829 for (i = len ; i > 0; i -= skip, off += skip) {
830 h = (h * 39) + val[off];
831 }
832 }
833
834 *pdwHash=h;
835
836 return S_OK;
837}
#define skip(...)
Definition: atltest.h:64
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723

◆ FileMonikerImpl_Inverse()

static HRESULT WINAPI FileMonikerImpl_Inverse ( IMoniker iface,
IMoniker **  ppmk 
)
static

Definition at line 911 of file filemoniker.c.

912{
913 TRACE("(%p,%p)\n",iface,ppmk);
914
915 return CreateAntiMoniker(ppmk);
916}
HRESULT WINAPI CreateAntiMoniker(IMoniker **ppmk)
Definition: antimoniker.c:608

◆ FileMonikerImpl_IsDirty()

static HRESULT WINAPI FileMonikerImpl_IsDirty ( IMoniker iface)
static

Definition at line 167 of file filemoniker.c.

168{
169
170 TRACE("(%p)\n",iface);
171
172 return S_FALSE;
173}
#define S_FALSE
Definition: winerror.h:2357

◆ FileMonikerImpl_IsEqual()

static HRESULT WINAPI FileMonikerImpl_IsEqual ( IMoniker iface,
IMoniker pmkOtherMoniker 
)
static

Definition at line 773 of file filemoniker.c.

774{
776 CLSID clsid;
777 LPOLESTR filePath;
778 IBindCtx* bind;
779 HRESULT res;
780
781 TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
782
783 if (pmkOtherMoniker==NULL)
784 return S_FALSE;
785
786 IMoniker_GetClassID(pmkOtherMoniker,&clsid);
787
788 if (!IsEqualCLSID(&clsid,&CLSID_FileMoniker))
789 return S_FALSE;
790
791 res = CreateBindCtx(0,&bind);
792 if (FAILED(res)) return res;
793
794 res = S_FALSE;
795 if (SUCCEEDED(IMoniker_GetDisplayName(pmkOtherMoniker,bind,NULL,&filePath))) {
796 if (!lstrcmpiW(filePath, This->filePathName))
797 res = S_OK;
798 CoTaskMemFree(filePath);
799 }
800
801 IBindCtx_Release(bind);
802 return res;
803}
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96

◆ FileMonikerImpl_IsRunning()

static HRESULT WINAPI FileMonikerImpl_IsRunning ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
IMoniker pmkNewlyRunning 
)
static

Definition at line 843 of file filemoniker.c.

845{
847 HRESULT res;
848
849 TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,pmkNewlyRunning);
850
851 if ( (pmkNewlyRunning!=NULL) && (IMoniker_IsEqual(pmkNewlyRunning,iface)==S_OK) )
852 return S_OK;
853
854 if (pbc==NULL)
855 return E_POINTER;
856
857 res=IBindCtx_GetRunningObjectTable(pbc,&rot);
858
859 if (FAILED(res))
860 return res;
861
862 res = IRunningObjectTable_IsRunning(rot,iface);
863
864 IRunningObjectTable_Release(rot);
865
866 return res;
867}

◆ FileMonikerImpl_IsSystemMoniker()

static HRESULT WINAPI FileMonikerImpl_IsSystemMoniker ( IMoniker iface,
DWORD pwdMksys 
)
static

Definition at line 1223 of file filemoniker.c.

1224{
1225 TRACE("(%p,%p)\n",iface,pwdMksys);
1226
1227 if (!pwdMksys)
1228 return E_POINTER;
1229
1230 (*pwdMksys)=MKSYS_FILEMONIKER;
1231
1232 return S_OK;
1233}

◆ FileMonikerImpl_Load()

static HRESULT WINAPI FileMonikerImpl_Load ( IMoniker iface,
IStream pStm 
)
static

Definition at line 182 of file filemoniker.c.

183{
185 HRESULT res;
186 CHAR* filePathA = NULL;
187 WCHAR* filePathW = NULL;
188 ULONG bread;
189 WORD wbuffer;
190 DWORD dwbuffer, bytesA, bytesW, len;
191 int i;
192
193
194 TRACE("(%p,%p)\n",iface,pStm);
195
196 /* first WORD */
197 res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
198 if (bread!=sizeof(WORD))
199 {
200 WARN("Couldn't read 0 word\n");
201 goto fail;
202 }
203
204 /* read filePath string length (plus one) */
205 res=IStream_Read(pStm,&bytesA,sizeof(DWORD),&bread);
206 if (bread != sizeof(DWORD))
207 {
208 WARN("Couldn't read file string length\n");
209 goto fail;
210 }
211
212 /* read filePath string */
213 filePathA=HeapAlloc(GetProcessHeap(),0,bytesA);
214 if (!filePathA)
215 {
217 goto fail;
218 }
219
220 res=IStream_Read(pStm,filePathA,bytesA,&bread);
221 if (bread != bytesA)
222 {
223 WARN("Couldn't read file path string\n");
224 goto fail;
225 }
226
227 /* read the unknown value */
228 IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
229 if (bread != sizeof(WORD))
230 {
231 WARN("Couldn't read unknown value\n");
232 goto fail;
233 }
234
235 /* read the DEAD constant */
236 IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
237 if (bread != sizeof(WORD))
238 {
239 WARN("Couldn't read DEAD constant\n");
240 goto fail;
241 }
242
243 for(i=0;i<5;i++)
244 {
245 res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
246 if (bread!=sizeof(DWORD))
247 {
248 WARN("Couldn't read 0 padding\n");
249 goto fail;
250 }
251 }
252
253 res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
254 if (bread!=sizeof(DWORD))
255 goto fail;
256
257 if (!dwbuffer) /* No W-string */
258 {
259 bytesA--;
260 len=MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filePathA, bytesA, NULL, 0);
261 if (!len)
262 goto fail;
263
264 filePathW=HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
265 if (!filePathW)
266 {
268 goto fail;
269 }
270 MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, filePathA, -1, filePathW, len+1);
271 goto succeed;
272 }
273
274 if (dwbuffer < 6)
275 goto fail;
276
277 bytesW=dwbuffer - 6;
278
279 res=IStream_Read(pStm,&dwbuffer,sizeof(DWORD),&bread);
280 if (bread!=sizeof(DWORD) || dwbuffer!=bytesW)
281 goto fail;
282
283 res=IStream_Read(pStm,&wbuffer,sizeof(WORD),&bread);
284 if (bread!=sizeof(WORD) || wbuffer!=0x3)
285 goto fail;
286
287 len=bytesW/sizeof(WCHAR);
288 filePathW=HeapAlloc(GetProcessHeap(),0,(len+1)*sizeof(WCHAR));
289 if(!filePathW)
290 {
292 goto fail;
293 }
294 res=IStream_Read(pStm,filePathW,bytesW,&bread);
295 if (bread!=bytesW)
296 goto fail;
297
298 filePathW[len]=0;
299
300 succeed:
301 HeapFree(GetProcessHeap(),0,filePathA);
302 HeapFree(GetProcessHeap(),0,This->filePathName);
303 This->filePathName=filePathW;
304
305 return S_OK;
306
307 fail:
308 HeapFree(GetProcessHeap(), 0, filePathA);
309 HeapFree(GetProcessHeap(), 0, filePathW);
310
311 if (SUCCEEDED(res))
312 res = E_FAIL;
313 return res;
314}
#define WARN(fmt,...)
Definition: debug.h:115
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
unsigned short WORD
Definition: ntddk_ex.h:93
#define MB_ERR_INVALID_CHARS
Definition: unicode.h:41
return succeed
Definition: scsi.h:3736
char CHAR
Definition: xmlstorage.h:175

◆ FileMonikerImpl_ParseDisplayName()

static HRESULT WINAPI FileMonikerImpl_ParseDisplayName ( IMoniker iface,
IBindCtx pbc,
IMoniker pmkToLeft,
LPOLESTR  pszDisplayName,
ULONG pchEaten,
IMoniker **  ppmkOut 
)
static

Definition at line 1212 of file filemoniker.c.

1214{
1215 FIXME("(%p,%p,%p,%p,%p,%p),stub!\n",iface,pbc,pmkToLeft,pszDisplayName,pchEaten,ppmkOut);
1216 return E_NOTIMPL;
1217}

◆ FileMonikerImpl_QueryInterface()

static HRESULT WINAPI FileMonikerImpl_QueryInterface ( IMoniker iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 68 of file filemoniker.c.

69{
71
72 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
73
74 /* Perform a sanity check on the parameters.*/
75 if ( ppvObject==0 )
76 return E_INVALIDARG;
77
78 /* Initialize the return parameter */
79 *ppvObject = 0;
80
81 /* Compare the riid with the interface IDs implemented by this object.*/
85 IsEqualIID(&IID_IMoniker, riid)
86 )
87 *ppvObject = iface;
88
89 else if (IsEqualIID(&IID_IROTData, riid))
90 *ppvObject = &This->IROTData_iface;
91 else if (IsEqualIID(&IID_IMarshal, riid))
92 {
93 HRESULT hr = S_OK;
94 if (!This->pMarshal)
95 hr = MonikerMarshal_Create(iface, &This->pMarshal);
96 if (hr != S_OK)
97 return hr;
98 return IUnknown_QueryInterface(This->pMarshal, riid, ppvObject);
99 }
100
101 /* Check that we obtained an interface.*/
102 if ((*ppvObject)==0)
103 return E_NOINTERFACE;
104
105 /* Query Interface always increases the reference count by one when it is successful */
106 IMoniker_AddRef(iface);
107
108 return S_OK;
109}
const GUID IID_IUnknown
HRESULT MonikerMarshal_Create(IMoniker *inner, IUnknown **outer)
Definition: moniker.c:1677
const GUID IID_IPersist
Definition: proxy.cpp:14
const GUID IID_IPersistStream
Definition: proxy.cpp:13

Referenced by FileMonikerROTDataImpl_QueryInterface().

◆ FileMonikerImpl_Reduce()

static HRESULT WINAPI FileMonikerImpl_Reduce ( IMoniker iface,
IBindCtx pbc,
DWORD  dwReduceHowFar,
IMoniker **  ppmkToLeft,
IMoniker **  ppmkReduced 
)
static

Definition at line 632 of file filemoniker.c.

634{
635 TRACE("(%p,%p,%d,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
636
637 if (ppmkReduced==NULL)
638 return E_POINTER;
639
640 IMoniker_AddRef(iface);
641
642 *ppmkReduced=iface;
643
645}
#define MK_S_REDUCED_TO_SELF
Definition: winerror.h:2773

◆ FileMonikerImpl_RelativePathTo()

static HRESULT WINAPI FileMonikerImpl_RelativePathTo ( IMoniker iface,
IMoniker pmOther,
IMoniker **  ppmkRelPath 
)
static

Definition at line 1106 of file filemoniker.c.

1107{
1108 IBindCtx *bind;
1109 HRESULT res;
1110 LPOLESTR str1=0,str2=0,*tabStr1=0,*tabStr2=0,relPath=0;
1111 DWORD len1=0,len2=0,sameIdx=0,j=0;
1112 static const WCHAR back[] ={'.','.','\\',0};
1113
1114 TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
1115
1116 if (ppmkRelPath==NULL)
1117 return E_POINTER;
1118
1119 if (pmOther==NULL)
1120 return E_INVALIDARG;
1121
1123 if (FAILED(res))
1124 return res;
1125
1126 res=IMoniker_GetDisplayName(iface,bind,NULL,&str1);
1127 if (FAILED(res))
1128 return res;
1129 res=IMoniker_GetDisplayName(pmOther,bind,NULL,&str2);
1130 if (FAILED(res))
1131 return res;
1132
1133 len1=FileMonikerImpl_DecomposePath(str1,&tabStr1);
1134 if (FAILED(len1))
1135 return E_OUTOFMEMORY;
1136 len2=FileMonikerImpl_DecomposePath(str2,&tabStr2);
1137
1138 if (FAILED(len2))
1139 {
1140 free_stringtable(tabStr1);
1141 return E_OUTOFMEMORY;
1142 }
1143
1144 /* count the number of similar items from the begin of the two paths */
1145 for(sameIdx=0; ( (tabStr1[sameIdx]!=NULL) &&
1146 (tabStr2[sameIdx]!=NULL) &&
1147 (lstrcmpiW(tabStr1[sameIdx],tabStr2[sameIdx])==0)); sameIdx++);
1148
1149 /* begin the construction of relativePath */
1150 /* if the two paths have a consecutive similar item from the begin ! the relativePath will be composed */
1151 /* by "..\\" in the begin */
1152 relPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(1+lstrlenW(str1)+lstrlenW(str2)));
1153
1154 *relPath=0;
1155
1156 if (len2>0 && !(len1==1 && len2==1 && sameIdx==0))
1157 for(j=sameIdx;(tabStr1[j] != NULL); j++)
1158 if (*tabStr1[j]!='\\')
1159 lstrcatW(relPath,back);
1160
1161 /* add items of the second path (similar items with the first path are not included) to the relativePath */
1162 for(j=sameIdx;tabStr2[j]!=NULL;j++)
1163 lstrcatW(relPath,tabStr2[j]);
1164
1165 res=CreateFileMoniker(relPath,ppmkRelPath);
1166
1167 free_stringtable(tabStr1);
1168 free_stringtable(tabStr2);
1169 CoTaskMemFree(str1);
1170 CoTaskMemFree(str2);
1171 HeapFree(GetProcessHeap(),0,relPath);
1172
1173 if (len1==0 || len2==0 || (len1==1 && len2==1 && sameIdx==0))
1174 return MK_S_HIM;
1175
1176 return res;
1177}
#define MK_S_HIM
Definition: winerror.h:2775

◆ FileMonikerImpl_Release()

static ULONG WINAPI FileMonikerImpl_Release ( IMoniker iface)
static

Definition at line 128 of file filemoniker.c.

129{
131 ULONG ref;
132
133 TRACE("(%p)\n",iface);
134
136
137 /* destroy the object if there are no more references to it */
139
140 return ref;
141}
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT FileMonikerImpl_Destroy(FileMonikerImpl *iface)
Definition: filemoniker.c:463
Definition: send.c:48

Referenced by FileMonikerROTDataImpl_Release().

◆ FileMonikerImpl_Save()

static HRESULT WINAPI FileMonikerImpl_Save ( IMoniker iface,
IStream pStm,
BOOL  fClearDirty 
)
static

Definition at line 343 of file filemoniker.c.

344{
346 HRESULT res;
347 LPOLESTR filePathW=This->filePathName;
348 CHAR* filePathA;
349 DWORD bytesA, bytesW, len;
350
351 static const WORD FFFF = 0xFFFF; /* Constants */
352 static const WORD DEAD = 0xDEAD;
353 static const DWORD ZERO = 0;
354 static const WORD THREE = 0x3;
355
356 int i;
357 BOOL bUsedDefault, bWriteWide;
358
359 TRACE("(%p,%p,%d)\n",iface,pStm,fClearDirty);
360
361 if (pStm==NULL)
362 return E_POINTER;
363
364 /* write a 0 WORD */
365 res=IStream_Write(pStm,&ZERO,sizeof(WORD),NULL);
366 if (FAILED(res)) return res;
367
368 /* write length of filePath string ( 0 included )*/
369 bytesA = WideCharToMultiByte( CP_ACP, 0, filePathW, -1, NULL, 0, NULL, NULL );
370 res=IStream_Write(pStm,&bytesA,sizeof(DWORD),NULL);
371 if (FAILED(res)) return res;
372
373 /* write A string (with '\0') */
374 filePathA=HeapAlloc(GetProcessHeap(),0,bytesA);
375 if (!filePathA)
376 return E_OUTOFMEMORY;
377 WideCharToMultiByte( CP_ACP, 0, filePathW, -1, filePathA, bytesA, NULL, &bUsedDefault);
378 res=IStream_Write(pStm,filePathA,bytesA,NULL);
379 HeapFree(GetProcessHeap(),0,filePathA);
380 if (FAILED(res)) return res;
381
382 /* write a WORD 0xFFFF */
383 res=IStream_Write(pStm,&FFFF,sizeof(WORD),NULL);
384 if (FAILED(res)) return res;
385
386 /* write a WORD 0xDEAD */
387 res=IStream_Write(pStm,&DEAD,sizeof(WORD),NULL);
388 if (FAILED(res)) return res;
389
390 /* write 5 zero DWORDs */
391 for(i=0;i<5;i++)
392 {
393 res=IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
394 if (FAILED(res)) return res;
395 }
396
397 /* Write the wide version if:
398 * + couldn't convert to CP_ACP,
399 * or + it's a directory,
400 * or + there's a character > 0xFF
401 */
402 len = lstrlenW(filePathW);
403 bWriteWide = (bUsedDefault || (len > 0 && filePathW[len-1]=='\\' ));
404 if (!bWriteWide)
405 {
406 WCHAR* pch;
407 for(pch=filePathW;*pch;++pch)
408 {
409 if (*pch > 0xFF)
410 {
411 bWriteWide = TRUE;
412 break;
413 }
414 }
415 }
416
417 if (!bWriteWide)
418 return IStream_Write(pStm,&ZERO,sizeof(DWORD),NULL);
419
420 /* write bytes needed for the filepathW (without 0) + 6 */
421 bytesW = len*sizeof(WCHAR) + 6;
422 res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
423 if (FAILED(res)) return res;
424
425 /* try again, without the extra 6 */
426 bytesW -= 6;
427 res=IStream_Write(pStm,&bytesW,sizeof(DWORD),NULL);
428 if (FAILED(res)) return res;
429
430 /* write a WORD 3 */
431 res=IStream_Write(pStm,&THREE,sizeof(WORD),NULL);
432 if (FAILED(res)) return res;
433
434 /* write W string (no 0) */
435 return IStream_Write(pStm,filePathW,bytesW,NULL);
436}
#define DEAD
#define ZERO
Definition: arc.cc:50
#define WideCharToMultiByte
Definition: compat.h:111
#define pch(ap)
Definition: match.c:418

◆ FileMonikerROTDataImpl_AddRef()

static ULONG WINAPI FileMonikerROTDataImpl_AddRef ( IROTData iface)
static

Definition at line 1253 of file filemoniker.c.

1254{
1256
1257 TRACE("(%p)\n",This);
1258
1259 return IMoniker_AddRef(&This->IMoniker_iface);
1260}
static FileMonikerImpl * impl_from_IROTData(IROTData *iface)
Definition: filemoniker.c:55

◆ FileMonikerROTDataImpl_GetComparisonData()

static HRESULT WINAPI FileMonikerROTDataImpl_GetComparisonData ( IROTData iface,
BYTE pbData,
ULONG  cbMax,
ULONG pcbData 
)
static

Definition at line 1279 of file filemoniker.c.

1281{
1283 int len = lstrlenW(This->filePathName)+1;
1284 int i;
1286
1287 TRACE("(%p, %u, %p)\n", pbData, cbMax, pcbData);
1288
1289 *pcbData = sizeof(CLSID) + len * sizeof(WCHAR);
1290 if (cbMax < *pcbData)
1291 return E_OUTOFMEMORY;
1292
1293 memcpy(pbData, &CLSID_FileMoniker, sizeof(CLSID));
1294 pszFileName = (LPWSTR)(pbData+sizeof(CLSID));
1295 for (i = 0; i < len; i++)
1296 pszFileName[i] = towupper(This->filePathName[i]);
1297
1298 return S_OK;
1299}
IID CLSID
Definition: mstsclib_i.c:62
#define towupper(c)
Definition: wctype.h:99
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
_In_ HCRYPTHASH _In_ BOOL _In_ DWORD _Inout_updates_bytes_to_ pdwDataLen BYTE * pbData
Definition: wincrypt.h:4201
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4950

◆ FileMonikerROTDataImpl_QueryInterface()

static HRESULT WINAPI FileMonikerROTDataImpl_QueryInterface ( IROTData iface,
REFIID  riid,
VOID **  ppvObject 
)
static

Definition at line 1239 of file filemoniker.c.

1240{
1241
1243
1244 TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject);
1245
1246 return FileMonikerImpl_QueryInterface(&This->IMoniker_iface, riid, ppvObject);
1247}
static HRESULT WINAPI FileMonikerImpl_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject)
Definition: filemoniker.c:68

◆ FileMonikerROTDataImpl_Release()

static ULONG WINAPI FileMonikerROTDataImpl_Release ( IROTData iface)
static

Definition at line 1266 of file filemoniker.c.

1267{
1269
1270 TRACE("(%p)\n",This);
1271
1272 return FileMonikerImpl_Release(&This->IMoniker_iface);
1273}
static ULONG WINAPI FileMonikerImpl_Release(IMoniker *iface)
Definition: filemoniker.c:128

◆ free_stringtable()

static void free_stringtable ( LPOLESTR stringTable)
static

Definition at line 647 of file filemoniker.c.

648{
649 int i;
650
651 for (i=0; stringTable[i]!=NULL; i++)
652 CoTaskMemFree(stringTable[i]);
653 CoTaskMemFree(stringTable);
654}

Referenced by FileMonikerImpl_CommonPrefixWith(), FileMonikerImpl_ComposeWith(), FileMonikerImpl_Construct(), and FileMonikerImpl_RelativePathTo().

◆ impl_from_IMoniker()

◆ impl_from_IROTData()

static FileMonikerImpl * impl_from_IROTData ( IROTData iface)
inlinestatic

◆ memrpbrkW()

static WCHAR * memrpbrkW ( const WCHAR ptr,
size_t  n,
const WCHAR accept 
)
inlinestatic

Definition at line 1445 of file filemoniker.c.

1446{
1447 const WCHAR *end, *ret = NULL;
1448 for (end = ptr + n; ptr < end; ptr++) if (wcschr(accept, *ptr)) ret = ptr;
1449 return (WCHAR *)ret;
1450}
#define wcschr
Definition: compat.h:17
GLdouble n
Definition: glext.h:7729
static PVOID ptr
Definition: dispmode.c:27
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
Definition: socklife.c:23

Referenced by FileMoniker_CreateFromDisplayName().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ VT_FileMonikerImpl

const IMonikerVtbl VT_FileMonikerImpl
static
Initial value:
=
{
}
static HRESULT WINAPI FileMonikerImpl_IsRunning(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
Definition: filemoniker.c:843
static HRESULT WINAPI FileMonikerImpl_BindToObject(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvResult)
Definition: filemoniker.c:478
static HRESULT WINAPI FileMonikerImpl_GetTimeOfLastChange(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
Definition: filemoniker.c:873
static HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker *iface, IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
Definition: filemoniker.c:660
static HRESULT WINAPI FileMonikerImpl_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker)
Definition: filemoniker.c:757
static HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker *iface, IMoniker *pmkOther, IMoniker **ppmkPrefix)
Definition: filemoniker.c:922
static HRESULT WINAPI FileMonikerImpl_ParseDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)
Definition: filemoniker.c:1212
static HRESULT WINAPI FileMonikerImpl_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
Definition: filemoniker.c:632
static HRESULT WINAPI FileMonikerImpl_IsDirty(IMoniker *iface)
Definition: filemoniker.c:167
static HRESULT WINAPI FileMonikerImpl_Save(IMoniker *iface, IStream *pStm, BOOL fClearDirty)
Definition: filemoniker.c:343
static HRESULT WINAPI FileMonikerImpl_BindToStorage(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, VOID **ppvObject)
Definition: filemoniker.c:590
static HRESULT WINAPI FileMonikerImpl_Hash(IMoniker *iface, DWORD *pdwHash)
Definition: filemoniker.c:809
static HRESULT WINAPI FileMonikerImpl_IsSystemMoniker(IMoniker *iface, DWORD *pwdMksys)
Definition: filemoniker.c:1223
static HRESULT WINAPI FileMonikerImpl_GetClassID(IMoniker *iface, CLSID *pClassID)
Definition: filemoniker.c:147
static HRESULT WINAPI FileMonikerImpl_IsEqual(IMoniker *iface, IMoniker *pmkOtherMoniker)
Definition: filemoniker.c:773
static HRESULT WINAPI FileMonikerImpl_GetDisplayName(IMoniker *iface, IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
Definition: filemoniker.c:1183
static HRESULT WINAPI FileMonikerImpl_RelativePathTo(IMoniker *iface, IMoniker *pmOther, IMoniker **ppmkRelPath)
Definition: filemoniker.c:1106
static ULONG WINAPI FileMonikerImpl_AddRef(IMoniker *iface)
Definition: filemoniker.c:115
static HRESULT WINAPI FileMonikerImpl_Inverse(IMoniker *iface, IMoniker **ppmk)
Definition: filemoniker.c:911
static HRESULT WINAPI FileMonikerImpl_Load(IMoniker *iface, IStream *pStm)
Definition: filemoniker.c:182
static HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker *iface, ULARGE_INTEGER *pcbSize)
Definition: filemoniker.c:442

Definition at line 1305 of file filemoniker.c.

Referenced by FileMonikerImpl_Construct().

◆ VT_ROTDataImpl

const IROTDataVtbl VT_ROTDataImpl
static
Initial value:
=
{
}
static ULONG WINAPI FileMonikerROTDataImpl_AddRef(IROTData *iface)
Definition: filemoniker.c:1253
static HRESULT WINAPI FileMonikerROTDataImpl_QueryInterface(IROTData *iface, REFIID riid, VOID **ppvObject)
Definition: filemoniker.c:1239
static HRESULT WINAPI FileMonikerROTDataImpl_GetComparisonData(IROTData *iface, BYTE *pbData, ULONG cbMax, ULONG *pcbData)
Definition: filemoniker.c:1279
static ULONG WINAPI FileMonikerROTDataImpl_Release(IROTData *iface)
Definition: filemoniker.c:1266

Definition at line 1333 of file filemoniker.c.

Referenced by FileMonikerImpl_Construct().