Changeset 4274 for trunk/src/ole32/filemoniker.cpp
- Timestamp:
- Sep 17, 2000, 12:31:07 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/filemoniker.cpp
r3167 r4274 1 /* $Id: filemoniker.cpp,v 1. 2 2000-03-19 15:33:06davidr Exp $ */1 /* $Id: filemoniker.cpp,v 1.3 2000-09-17 10:31:03 davidr Exp $ */ 2 2 /* 3 3 * FileMonikers functions. … … 17 17 #include "winnls.h" 18 18 19 DEFAULT_DEBUG_CHANNEL( ole)19 DEFAULT_DEBUG_CHANNEL(moniker) 20 20 21 21 /********************************************************************************/ … … 63 63 /* IROTData prototype function */ 64 64 static HRESULT WINAPI FileMonikerROTDataImpl_GetComparaisonData(IROTData* iface,BYTE* pbData,ULONG cbMax,ULONG* pcbData); 65 66 65 67 66 /********************************************************************************/ … … 347 346 DWORD doubleLenHex; 348 347 int i=0; 349 WCHAR temp = 0;350 348 351 349 … … 421 419 * FileMoniker_GetSizeMax 422 420 ******************************************************************************/ 423 HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface, 424 ULARGE_INTEGER* pcbSize)/* Pointer to size of stream needed to save object */ 421 HRESULT WINAPI FileMonikerImpl_GetSizeMax(IMoniker* iface,ULARGE_INTEGER* pcbSize) 425 422 { 426 423 ICOM_THIS(FileMonikerImpl,iface); 427 DWORD len=lstrlenW(This->filePathName);428 DWORD sizeMAx;429 430 TRACE("(%p,%p)\n",iface,pcbSize);431 424 432 425 if (pcbSize==NULL) 433 426 return E_POINTER; 434 427 435 /* for more details see FileMonikerImpl_Save coments */ 436 437 sizeMAx = sizeof(WORD) + /* first WORD is 0 */ 438 sizeof(DWORD)+ /* length of filePath including "\0" in the end of the string */ 439 (len+1)+ /* filePath string */ 440 sizeof(DWORD)+ /* constant : 0xDEADFFFF */ 441 10*sizeof(WORD)+ /* 10 zero WORD */ 442 sizeof(DWORD); /* size of the unicode filePath: "\0" not included */ 443 444 if(!This->bIsLongFileName) 445 { 446 447 sizeMAx += sizeof(DWORD)+ /* size of the unicode filePath: "\0" not included */ 448 sizeof(WORD)+ /* constant : 0x3 */ 449 len*sizeof(WCHAR); /* unicde filePath string */ 450 } 451 452 pcbSize->LowPart=sizeMAx; 453 pcbSize->HighPart=0; 454 428 /* GetSizeMax = SizeToSave + 2*len + 22 */ 429 FileMonikerImpl_GetSizeToSave(iface,pcbSize); 430 pcbSize->LowPart += 2 * lstrlenW(This->filePathName) + 22; 431 pcbSize->HighPart = 0; 432 433 TRACE("(iface:%p pcbSize:(LowPart:%ld - HighPart:0))\n",iface,pcbSize->LowPart); 455 434 return S_OK; 456 435 } 436 437 HRESULT FileMonikerImpl_GetSizeToSave(IMoniker* iface,ULARGE_INTEGER* pcbSize) 438 { 439 ICOM_THIS(FileMonikerImpl,iface); 440 DWORD len = lstrlenW(This->filePathName); 441 442 if (pcbSize==NULL) 443 return E_POINTER; 444 445 pcbSize->LowPart = sizeof(WORD) + /* first WORD is 0 */ 446 sizeof(DWORD) + /* length of filePath including "\0" in the end of the string */ 447 len + 1 + /* filePath string */ 448 sizeof(DWORD) + /* constant : 0xDEADFFFF */ 449 10 * sizeof(WORD) + /* 10 zero WORD */ 450 sizeof(DWORD) + /* size of the unicode filePath: "\0" not included */ 451 ((!This->bIsLongFileName) ? 452 sizeof(DWORD) + /* size of the unicode filePath: "\0" not included */ 453 sizeof(WORD) + /* constant : 0x3 */ 454 len * sizeof(WCHAR) : 0); /* unicde filePath string */ 455 pcbSize->HighPart = 0; 456 457 return S_OK; 458 } 459 457 460 458 461 void WINAPI FileMonikerImpl_CheckFileFormat(FileMonikerImpl* This, LPCOLESTR lpszPathName) … … 473 476 return; 474 477 } 478 475 479 len = lstrlenW(lpszPathName); 476 if(len == 0)477 {478 return;479 }480 481 480 if( len >= 2) 482 481 {
Note:
See TracChangeset
for help on using the changeset viewer.