40#define NONAMELESSUNION
220 return This->numBlocks;
295 ERR(
"unknown flags %08x\n", stgm);
386 ERR(
"Invalid share mode!\n");
407 ERR(
"Invalid access mode!\n");
425 FIXME(
"STGM_CONVERT not implemented!\n");
430 ERR(
"Invalid create mode!\n");
448 return IStorage_QueryInterface(&
This->IStorage_iface,
riid,
obj);
454 return IStorage_AddRef(&
This->IStorage_iface);
460 return IStorage_Release(&
This->IStorage_iface);
516 while (diff == 0 && *
name1 != 0)
541 currentEntry =
data->dirRootEntry;
556 currentEntry =
data->leftChild;
559 currentEntry =
data->rightChild;
584 *parentEntry = storageEntry;
603 *parentData = childData;
604 *parentEntry = childEntry;
612 *parentData = childData;
613 *parentEntry = childEntry;
631 entry->leftChild = new_target;
634 entry->rightChild = new_target;
637 entry->dirRootEntry = new_target;
652 DirRef parentStorageIndex,
773 DirRef parentStorageIndex,
779 ULONG typeOfRelation;
791 &parentEntry, &parentEntryRef, &typeOfRelation);
827 &newRightChildParentEntry);
834 newRightChildParent = newRightChildParentEntry.
rightChild;
842 &newRightChildParentEntry);
899 IStorage_Release(&
This->parentStorage->IStorage_iface);
921 IEnumSTATSTG_AddRef(&
This->IEnumSTATSTG_iface);
926 TRACE(
"<-- E_NOINTERFACE\n");
967 This->parentStorage->storageDirEntry, &
entry);
968 searchNode =
entry.dirRootEntry;
980 searchNode =
entry.rightChild;
985 memcpy(result_name,
entry.name,
sizeof(result_name));
986 searchNode =
entry.leftChild;
995 memcpy(
This->name, result_name,
sizeof(result_name));
1006 ULONG* pceltFetched)
1011 STATSTG* currentReturnStruct = rgelt;
1012 ULONG objectFetched = 0;
1013 DirRef currentSearchNode;
1016 TRACE(
"%p,%u,%p,%p\n", iface, celt, rgelt, pceltFetched);
1018 if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) )
1021 if (
This->parentStorage->reverted)
1023 TRACE(
"<-- STG_E_REVERTED\n");
1031 if (pceltFetched==0)
1032 pceltFetched = &objectFetched;
1040 while ( *pceltFetched < celt )
1046 memset(currentReturnStruct, 0,
sizeof(*currentReturnStruct));
1062 currentReturnStruct,
1070 currentReturnStruct++;
1076 TRACE(
"<-- %08x (asked %u, got %u)\n",
hr, celt, *pceltFetched);
1087 ULONG objectFetched = 0;
1088 DirRef currentSearchNode;
1091 TRACE(
"%p,%u\n", iface, celt);
1093 if (
This->parentStorage->reverted)
1095 TRACE(
"<-- STG_E_REVERTED\n");
1099 while ( (objectFetched < celt) )
1121 TRACE(
"%p\n", iface);
1123 if (
This->parentStorage->reverted)
1125 TRACE(
"<-- STG_E_REVERTED\n");
1143 TRACE(
"%p,%p\n", iface, ppenum);
1145 if (
This->parentStorage->reverted)
1147 TRACE(
"<-- STG_E_REVERTED\n");
1155 This->storageDirEntry);
1198 newEnumeration->
ref = 1;
1199 newEnumeration->
name[0] = 0;
1211 return newEnumeration;
1262 TRACE(
"<-- E_NOINTERFACE\n");
1266 IStorage_AddRef(iface);
1322 SNB snbExclude,
IStorage *pstgDest);
1326 SNB snbExclude,
IStorage *pstgDest)
1345 WCHAR **snb = snbExclude;
1357 if (
data.stgType == STGTY_STORAGE && !skip_storage)
1362 hr = IStorage_CreateStorage( pstgDest,
data.name,
1372 hr = IStorage_OpenStorage( pstgDest,
data.name,
NULL,
1374 NULL, 0, &pstgTmp );
1380 skip_stream,
NULL, pstgTmp );
1382 IStorage_Release(pstgTmp);
1385 else if (
data.stgType == STGTY_STREAM && !skip_stream)
1391 hr = IStorage_CreateStream( pstgDest,
data.name,
1407 IStream_AddRef(pstrChild);
1421 IStream_Stat( pstrChild, &strStat, STATFLAG_NONAME );
1426 IStream_SetSize(pstrTmp, strStat.cbSize);
1431 hr = IStream_CopyTo( pstrChild, pstrTmp, strStat.cbSize,
1434 IStream_Release( pstrChild );
1437 IStream_Release( pstrTmp );
1444 skip_stream, snbExclude, pstgDest );
1448 skip_stream, snbExclude, pstgDest );
1458 TRACE(
"%p,%d\n", stg, streamEntry);
1475 TRACE(
"%p,%d\n", stg, storageEntry);
1479 if (childstg->
base.storageDirEntry == storageEntry)
1509 TRACE(
"(%p, %s, %p, %x, %d, %p)\n",
1512 if ( (pwcsName==
NULL) || (ppstm==0) )
1559 This->storageDirEntry,
1567 (currentEntry.
stgType==STGTY_STREAM) )
1583 IStream_AddRef(*ppstm);
1597 TRACE(
"<-- IStream %p\n", *ppstm);
1625 TRACE(
"(%p, %s, %p, %x, %p, %d, %p)\n",
1627 grfMode, snbExclude,
reserved, ppstg);
1629 if ((pwcsName==
NULL) || (ppstg==0) )
1642 if (snbExclude !=
NULL)
1684 This->storageDirEntry,
1689 (currentEntry.
stgType==STGTY_STORAGE) )
1703 if (newStorage != 0)
1719 *ppstg = &newStorage->
base.IStorage_iface;
1757 TRACE(
"(%p, %d, %p, %d, %p)\n",
1768 This->storageDirEntry);
1795 TRACE(
"(%p, %p, %x)\n",
1796 iface, pstatstg, grfStatFlag);
1812 This->storageDirEntry,
1823 pstatstg->grfMode =
This->openFlags;
1824 pstatstg->grfStateBits =
This->stateBits;
1830 TRACE(
"<-- STATSTG: pwcsName: %s, type: %d, cbSize.Low/High: %d/%d, grfMode: %08x, grfLocksSupported: %d, grfStateBits: %08x\n",
debugstr_w(pstatstg->pwcsName), pstatstg->type, pstatstg->cbSize.u.LowPart, pstatstg->cbSize.u.HighPart, pstatstg->grfMode, pstatstg->grfLocksSupported, pstatstg->grfStateBits);
1852 TRACE(
"(%p, %s, %s)\n",
1859 This->storageDirEntry,
1875 This->storageDirEntry,
1884 WARN(
"Element is already open; cannot rename.\n");
1934 DirEntry currentEntry, newStreamEntry;
1935 DirRef currentEntryRef, newStreamEntryRef;
1938 TRACE(
"(%p, %s, %x, %d, %d, %p)\n",
1987 This->storageDirEntry,
1998 IStorage_DestroyElement(iface, pwcsName);
2017 newStreamEntry.
stgType = STGTY_STREAM;
2019 newStreamEntry.
size.
u.LowPart = 0;
2020 newStreamEntry.
size.
u.HighPart = 0;
2045 This->storageDirEntry,
2061 IStream_AddRef(*ppstm);
2093 This->storageDirEntry,
2100 This->storageDirEntry,
2133 TRACE(
"(%p, %s, %x, %d, %d, %p)\n",
2153 WARN(
"bad grfMode: 0x%x\n", grfMode);
2166 WARN(
"access denied\n");
2171 This->storageDirEntry,
2184 hr = IStorage_DestroyElement(iface, pwcsName);
2190 WARN(
"file already exists\n");
2197 WARN(
"read-only storage\n");
2207 FIXME(
"name too long\n");
2213 newEntry.
stgType = STGTY_STORAGE;
2215 newEntry.
size.
u.LowPart = 0;
2216 newEntry.
size.
u.HighPart = 0;
2241 This->storageDirEntry,
2252 hr = IStorage_OpenStorage(iface, pwcsName, 0, grfMode, 0, 0, ppstg);
2267 SNB snbExclude,
IStorage *pstgDest)
2275 hr = IStorage_SetClass( pstgDest, &
data.clsid );
2279 skip_stream, snbExclude, pstgDest );
2291 const IID* rgiidExclude,
2300 TRACE(
"(%p, %d, %p, %p, %p)\n",
2301 iface, ciidExclude, rgiidExclude,
2302 snbExclude, pstgDest);
2304 if ( pstgDest == 0 )
2307 for(
i = 0;
i < ciidExclude; ++
i)
2310 skip_storage =
TRUE;
2322 IStorage *pstgDestAncestor = pstgDest;
2326 while (pstgDestAncestor != iface) {
2327 pstgDestAncestorChild = pstgDest;
2333 pstgDestAncestor = &
snapshot->transactedParent->IStorage_iface;
2339 pstgDestAncestor = &
internal->parentStorage->IStorage_iface;
2345 if (pstgDestAncestor == iface)
2349 if (pstgDestAncestorChild && snbExclude)
2353 WCHAR **snb = snbExclude;
2357 while ( *snb !=
NULL && fail )
2371 skip_storage, skip_stream, snbExclude, pstgDest );
2384 FIXME(
"(%p %s %p %s %u): stub\n", iface,
2400 DWORD grfCommitFlags)
2403 TRACE(
"(%p %d)\n", iface, grfCommitFlags);
2415 TRACE(
"(%p)\n", iface);
2433 STATSTG currentElement;
2438 TRACE(
"%p,%d\n", parentStorage, indexToDelete);
2443 if (stg->
base.storageDirEntry == indexToDelete)
2452 hr = IStorage_OpenStorage(
2454 entryDataToDelete.
name,
2470 hr = IStorage_EnumElements(childStorage, 0, 0, 0, &elements);
2473 IStorage_Release(childStorage);
2483 hr = IEnumSTATSTG_Next(elements, 1, ¤tElement,
NULL);
2486 destroyHr = IStorage_DestroyElement(childStorage, currentElement.pwcsName);
2495 IEnumSTATSTG_Reset(elements);
2497 }
while ((
hr ==
S_OK) && (destroyHr ==
S_OK));
2499 IStorage_Release(childStorage);
2500 IEnumSTATSTG_Release(elements);
2526 if (strm->
dirEntry == indexToDelete)
2528 TRACE(
"Stream deleted %p\n", strm);
2534 size.u.HighPart = 0;
2549 hr = IStream_SetSize(pis,
size);
2560 IStream_Release(pis);
2601 This->storageDirEntry,
2607 TRACE(
"<-- STG_E_FILENOTFOUND\n");
2611 if ( entryToDelete.
stgType == STGTY_STORAGE )
2618 else if ( entryToDelete.
stgType == STGTY_STREAM )
2637 This->storageDirEntry,
2661 TRACE(
"Streams invalidated (stg=%p strm=%p next=%p prev=%p)\n", stg,strm,
cur->next,
cur->prev);
2706 This->stateBits = (
This->stateBits & ~grfMask) | (grfStateBits & grfMask);
2716 TRACE(
"Stream added (stg=%p strm=%p)\n", stg, strm);
2722 TRACE(
"Stream removed (stg=%p strm=%p)\n", stg,strm);
2734 ULONG bytestocopy, bytesread, byteswritten;
2753 data, &byteswritten);
2757 bytes_copied.
QuadPart += byteswritten;
2782 has_stream = (
data.stgType == STGTY_STREAM &&
data.size.QuadPart != 0);
2784 data.size.QuadPart = 0;
2934 &
This->bigBlockSizeBits);
2939 &
This->smallBlockSizeBits);
2944 &
This->bigBlockDepotCount);
2949 &
This->rootStartBlock);
2954 &
This->transactionSig);
2959 &
This->smallBlockLimit);
2964 &
This->smallBlockDepotStart);
2969 &
This->extBigBlockDepotStart);
2974 &
This->extBigBlockDepotCount);
2987 This->bigBlockSize = 0x000000001 << (
DWORD)
This->bigBlockSizeBits;
2988 This->smallBlockSize = 0x000000001 << (
DWORD)
This->smallBlockSizeBits;
2998 FIXME(
"Broken OLE storage file? bigblock=0x%x, smallblock=0x%x, sblimit=0x%x\n",
2999 This->bigBlockSize,
This->smallBlockSize,
This->smallBlockLimit);
3021 DWORD bytes_read, bytes_written;
3022 DWORD major_version, dirsectorcount;
3033 if (
This->bigBlockSizeBits == 0x9)
3035 else if (
This->bigBlockSizeBits == 0xc)
3039 ERR(
"invalid big block shift 0x%x\n",
This->bigBlockSizeBits);
3080 This->bigBlockSizeBits);
3085 This->smallBlockSizeBits);
3087 if (major_version >= 4)
3089 if (
This->rootBlockChain)
3107 This->bigBlockDepotCount);
3112 This->rootStartBlock);
3117 This->transactionSig);
3122 This->smallBlockLimit);
3127 This->smallBlockDepotStart);
3132 This->smallBlockDepotChain ?
3138 This->extBigBlockDepotStart);
3143 This->extBigBlockDepotCount);
3180 This->rootBlockChain,
3207 This->rootBlockChain,
3303 newData->
size.
u.LowPart);
3308 newData->
size.
u.HighPart);
3323 ULONG currentEntryIndex = 0;
3327 WORD sizeOfNameString;
3342 if (sizeOfNameString == 0)
3347 newEntryIndex = currentEntryIndex;
3355 newEntryIndex = currentEntryIndex;
3357 currentEntryIndex++;
3369 ULONG lastEntry = 0;
3370 ULONG blockCount = 0;
3400 entryIndex = newEntryIndex + 1;
3401 entryIndex < lastEntry;
3418 *
index = newEntryIndex;
3452 &
buffer->sizeOfNameString);
3477 &
buffer->ctime.dwLowDateTime);
3482 &
buffer->ctime.dwHighDateTime);
3487 &
buffer->mtime.dwLowDateTime);
3492 &
buffer->mtime.dwHighDateTime);
3502 &
buffer->size.u.LowPart);
3504 if (
This->bigBlockSize < 4096)
3507 buffer->size.u.HighPart = 0;
3514 &
buffer->size.u.HighPart);
3566 if (out_read) *out_read =
read;
3600 return (wrote ==
This->bigBlockSize);
3617 return (wrote ==
sizeof(
DWORD));
3632 ULONG cbRead, cbWritten;
3650 if(!bbTempChain)
return NULL;
3689 offset.u.LowPart += cbRead;
3699 size.u.HighPart = 0;
3704 ERR(
"conversion failed: resRead = 0x%08x, resWrite = 0x%08x\n", resRead, resWrite);
3713 streamEntryRef = (*ppsbChain)->ownerDirEntry;
3737 return bigBlockChain;
3789 cbRead,
buffer, &cbWritten);
3794 offset.u.LowPart += cbRead;
3804 size.u.HighPart = 0;
3809 ERR(
"conversion failed: resRead = 0x%08x, resWrite = 0x%08x\n", resRead, resWrite);
3816 streamEntryRef = (*ppbbChain)->ownerDirEntry;
3840 ULONG rangeLockDepot = rangeLockIndex / blocksPerDepot;
3848 if (depotIndex == rangeLockDepot)
3865 ULONG depotBlocksPerExtBlock = (
This->bigBlockSize /
sizeof(
ULONG)) - 1;
3867 ULONG extBlockCount = numExtBlocks / depotBlocksPerExtBlock;
3868 ULONG extBlockOffset = numExtBlocks % depotBlocksPerExtBlock;
3870 ULONG extBlockIndex;
3876 if (extBlockCount >=
This->extBigBlockDepotCount)
3879 if (
This->indexExtBlockDepotCached != extBlockCount)
3881 extBlockIndex =
This->extBigBlockDepotLocations[extBlockCount];
3890 This->extBlockDepotCached[
index] = blockIndex;
3893 This->indexExtBlockDepotCached = extBlockCount;
3896 blockIndex =
This->extBlockDepotCached[extBlockOffset];
3910 ULONG depotBlocksPerExtBlock = (
This->bigBlockSize /
sizeof(
ULONG)) - 1;
3912 ULONG extBlockCount = numExtBlocks / depotBlocksPerExtBlock;
3913 ULONG extBlockOffset = numExtBlocks % depotBlocksPerExtBlock;
3914 ULONG extBlockIndex;
3918 assert(extBlockCount < This->extBigBlockDepotCount);
3920 extBlockIndex =
This->extBigBlockDepotLocations[extBlockCount];
3925 extBlockOffset *
sizeof(
ULONG),
3929 if (
This->indexExtBlockDepotCached == extBlockCount)
3931 This->extBlockDepotCached[extBlockOffset] = blockIndex;
3942 ULONG numExtBlocks =
This->extBigBlockDepotCount;
3943 ULONG nextExtBlock =
This->extBigBlockDepotStart;
3948 ULONG depotBlocksPerExtBlock = blocksPerDepotBlock - 1;
3951 blocksPerDepotBlock;
3965 nextExtBlock =
This->extBigBlockDepotLocations[
This->extBigBlockDepotCount-1];
3981 if (
This->extBigBlockDepotLocationsSize == numExtBlocks)
3983 ULONG new_cache_size = (
This->extBigBlockDepotLocationsSize+1)*2;
3986 memcpy(new_cache,
This->extBigBlockDepotLocations,
sizeof(
ULONG) *
This->extBigBlockDepotLocationsSize);
3989 This->extBigBlockDepotLocations = new_cache;
3990 This->extBigBlockDepotLocationsSize = new_cache_size;
3992 This->extBigBlockDepotLocations[numExtBlocks] =
index;
4024 ULONG* nextBlockIndex)
4026 ULONG offsetInDepot = blockIndex *
sizeof (
ULONG);
4027 ULONG depotBlockCount = offsetInDepot /
This->bigBlockSize;
4028 ULONG depotBlockOffset = offsetInDepot %
This->bigBlockSize;
4031 ULONG depotBlockIndexPos;
4036 if(depotBlockCount >=
This->bigBlockDepotCount)
4038 WARN(
"depotBlockCount %d, bigBlockDepotCount %d\n", depotBlockCount,
4039 This->bigBlockDepotCount);
4046 if (depotBlockCount !=
This->indexBlockDepotCached)
4048 This->indexBlockDepotCached = depotBlockCount;
4052 depotBlockIndexPos =
This->bigBlockDepotStart[depotBlockCount];
4072 This->blockDepotCached[
index] = *nextBlockIndex;
4076 *nextBlockIndex =
This->blockDepotCached[depotBlockOffset/
sizeof(
ULONG)];
4104 return nextBlockIndex;
4126 ULONG offsetInDepot = blockIndex *
sizeof (
ULONG);
4127 ULONG depotBlockCount = offsetInDepot /
This->bigBlockSize;
4128 ULONG depotBlockOffset = offsetInDepot %
This->bigBlockSize;
4129 ULONG depotBlockIndexPos;
4131 assert(depotBlockCount < This->bigBlockDepotCount);
4132 assert(blockIndex != nextBlock);
4139 ERR(
"Using range lock page\n");
4143 depotBlockIndexPos =
This->bigBlockDepotStart[depotBlockCount];
4158 if (depotBlockCount ==
This->indexBlockDepotCached)
4160 This->blockDepotCached[depotBlockOffset/
sizeof(
ULONG)] = nextBlock;
4174 ULONG depotBlockIndexPos;
4176 ULONG depotBlockOffset;
4185 depotIndex =
This->prevFreeBlock / blocksPerDepot;
4186 depotBlockOffset = (
This->prevFreeBlock % blocksPerDepot) *
sizeof(
ULONG);
4195 depotBlockIndexPos =
This->bigBlockDepotStart[depotIndex];
4202 depotBlockIndexPos = depotIndex*blocksPerDepot;
4208 This->bigBlockDepotCount++;
4209 This->bigBlockDepotStart[depotIndex] = depotBlockIndexPos;
4234 ULONG extBlockOffset = numExtBlocks % (blocksPerDepot - 1);
4236 if (extBlockOffset == 0)
4241 This->extBigBlockDepotCount++;
4242 depotBlockIndexPos = extIndex + 1;
4245 depotBlockIndexPos = depotIndex * blocksPerDepot;
4251 This->bigBlockDepotCount++;
4275 while ( ( (depotBlockOffset/
sizeof(
ULONG) ) < blocksPerDepot) &&
4282 freeBlock = (depotIndex * blocksPerDepot) +
4283 (depotBlockOffset/
sizeof(
ULONG));
4286 depotBlockOffset +=
sizeof(
ULONG);
4291 depotBlockOffset = 0;
4299 ILockBytes_Stat(
This->lockBytes, &statstg, STATFLAG_NONAME);
4301 if (neededSize.
QuadPart > statstg.cbSize.QuadPart)
4302 ILockBytes_SetSize(
This->lockBytes, neededSize);
4304 This->prevFreeBlock = freeBlock;
4320 if (blockIndex < This->prevFreeBlock)
4321 This->prevFreeBlock = blockIndex;
4345 if (!
This->blockChainCache[
i])
4347 return &
This->blockChainCache[
i];
4351 i =
This->blockChainToEvict;
4356 This->blockChainToEvict++;
4358 This->blockChainToEvict = 0;
4360 return &
This->blockChainCache[
i];
4366 int i, free_index=-1;
4370 if (!
This->blockChainCache[
i])
4372 if (free_index == -1) free_index =
i;
4374 else if (
This->blockChainCache[
i]->ownerDirEntry ==
index)
4376 return &
This->blockChainCache[
i];
4380 if (free_index == -1)
4382 free_index =
This->blockChainToEvict;
4385 This->blockChainCache[free_index] =
NULL;
4387 This->blockChainToEvict++;
4389 This->blockChainToEvict = 0;
4393 return &
This->blockChainCache[free_index];
4402 if (
This->blockChainCache[
i] &&
This->blockChainCache[
i]->ownerDirEntry ==
index)
4422 if (
data.size.QuadPart == 0)
4430 bytesToRead =
data.size.QuadPart -
offset.QuadPart;
4483 if (
data.size.QuadPart == 0)
4493 bigblock = *pbigblock;
4505 bigblock = *pbigblock;
4520 *pbigblock = bigblock;
4544 data.size = newsize;
4637 ILockBytes_SetSize(
This->lockBytes,
size);
4647 sizeof(
This->bigBlockDepotStart));
4649 This->bigBlockDepotCount = 1;
4650 This->bigBlockDepotStart[0] = 0;
4651 This->rootStartBlock = 1;
4654 if (
This->bigBlockSize == 4096)
4660 This->extBigBlockDepotCount = 0;
4667 size.u.HighPart = 0;
4668 size.u.LowPart =
This->bigBlockSize * 3;
4669 ILockBytes_SetSize(
This->lockBytes,
size);
4695 This->indexBlockDepotCached = 0xFFFFFFFF;
4696 This->indexExtBlockDepotCached = 0xFFFFFFFF;
4701 This->prevFreeBlock = 0;
4703 This->firstFreeSmallBlock = 0;
4706 if (
This->extBigBlockDepotCount != 0)
4708 ULONG current_block =
This->extBigBlockDepotStart;
4709 ULONG cache_size =
This->extBigBlockDepotCount * 2;
4713 if (!
This->extBigBlockDepotLocations)
4718 This->extBigBlockDepotLocationsSize = cache_size;
4720 for (
i=0;
i<
This->extBigBlockDepotCount;
i++)
4724 WARN(
"File has too few extended big block depot blocks.\n");
4727 This->extBigBlockDepotLocations[
i] = current_block;
4733 This->extBigBlockDepotLocations =
NULL;
4734 This->extBigBlockDepotLocationsSize = 0;
4740 if(!(blockChainStream =
4747 This->rootBlockChain = blockChainStream;
4749 if(!(blockChainStream =
4757 This->smallBlockDepotChain = blockChainStream;
4764 static const WCHAR rootentryW[] = {
'R',
'o',
'o',
't',
' ',
'E',
'n',
't',
'r',
'y',0};
4769 memset(&rootEntry, 0,
sizeof(rootEntry));
4777 rootEntry.
size.
u.HighPart = 0;
4778 rootEntry.
size.
u.LowPart = 0;
4786 currentEntryRef = 0;
4800 This->base.storageDirEntry = currentEntryRef;
4816 if(!(blockChainStream =
4823 This->smallBlockRootChain = blockChainStream;
4843 DWORD oldTransactionSig =
This->transactionSig;
4859 if (oldTransactionSig !=
This->transactionSig)
4862 TRACE(
"signature changed\n");
4868 This->transactionSig = oldTransactionSig;
4891 if ((dwLockType &
This->locks_supported) == 0)
4893 if (supported) *supported =
FALSE;
4897 if (supported) *supported =
TRUE;
4898 return ILockBytes_LockRegion(
This->lockBytes,
offset,
cb, dwLockType);
4904 if ((dwLockType &
This->locks_supported) == 0)
4907 return ILockBytes_UnlockRegion(
This->lockBytes,
offset,
cb, dwLockType);
4917 DWORD last_sanity_check = start_time;
4930 if (current_time - start_time >= 20000)
4935 if (current_time - last_sanity_check >= 500)
4954 last_sanity_check = current_time;
4957 if (delay < 150) delay++;
5016 hr = ILockBytes_Stat(
This->lockBytes, &statstg, 0);
5018 *
result = statstg.pwcsName;
5061 if (
This->locked_bytes[
j] == 0)
5063 This->locked_bytes[
j] =
i;
5093 if (!supported)
return S_OK;
5168 if (
This->blockChainCache[
i])
5172 hr = ILockBytes_Flush(
This->lockBytes);
5209 if (
This->locked_bytes[
i] != 0)
5216 if (
This->lockBytes)
5217 ILockBytes_Release(
This->lockBytes);
5299 This->base.openFlags = (openFlags & ~STGM_CREATE);
5321 This->lockBytes = pLkbyt;
5322 ILockBytes_AddRef(pLkbyt);
5326 hr = ILockBytes_Stat(
This->lockBytes, &
stat, STATFLAG_NONAME);
5330 This->locks_supported =
stat.grfLocksSupported;
5333 This->locks_supported &= ~WINE_LOCK_READ;
5343 IStorage_Release(&
This->base.IStorage_iface);
5364 if (!
This->base.reverted)
5366 TRACE(
"Storage invalidated (stg=%p)\n",
This);
5502 DWORD grfCommitFlags)
5505 TRACE(
"(%p,%x)\n", iface, grfCommitFlags);
5517 FIXME(
"(%p): stub\n", iface);
5587 newStorage->
base.openFlags = (openFlags & ~STGM_CREATE);
5591 newStorage->
base.ref = 1;
5598 newStorage->
base.storageDirEntry = storageDirEntry;
5617 while (result < This->entries_size &&
This->entries[
result].inuse)
5631 This->entries = new_entries;
5654 entry->newTransactedParentEntry =
entry->transactedParentEntry = parentEntryRef;
5659 return stubEntryRef;
5671 This->entries[
entry].transactedParentEntry,
5718 new_entrydata.
name[0] =
'S';
5720 new_entrydata.
stgType = STGTY_STREAM;
5733 This->transactedParent,
This->entries[
entry].transactedParentEntry);
5750 This->entries[delete_ref].deleted =
TRUE;
5775 entry->parent = prev;
5782 entry->parent = prev;
5789 entry->parent = prev;
5831 This->entries[
entry].newTransactedParentEntry !=
This->entries[
entry].transactedParentEntry;
5844 if (!
This->entries[
This->base.storageDirEntry].read)
5847 cursor =
This->entries[
This->base.storageDirEntry].data.dirRootEntry;
5860 if (
entry->stream_dirty)
5865 entry->newTransactedParentEntry);
5867 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5884 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5902 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5922 &
entry->newTransactedParentEntry);
5929 if (
entry->stream_dirty)
5932 This->transactedParent,
entry->newTransactedParentEntry,
5935 else if (
entry->data.size.QuadPart)
5938 This->transactedParent,
entry->newTransactedParentEntry,
5939 entry->transactedParentEntry);
5959 DWORD grfCommitFlags)
5967 ULONG transactionSig;
5971 TRACE(
"(%p,%x)\n", iface, grfCommitFlags);
5984 if (transactionSig !=
This->lastTransactionSig)
5986 ERR(
"file was externally modified\n");
5992 This->lastTransactionSig = transactionSig+1;
6007 root_entry = &
This->entries[
This->base.storageDirEntry];
6009 if (!root_entry->
read)
6029 data.dirRootEntry = dir_root_ref;
6046 for (
i=0;
i<
This->entries_size;
i++)
6056 entry->transactedParentEntry);
6060 else if (
entry->read &&
entry->transactedParentEntry !=
entry->newTransactedParentEntry)
6064 entry->transactedParentEntry);
6065 if (
entry->stream_dirty)
6072 entry->transactedParentEntry =
entry->newTransactedParentEntry;
6099 TRACE(
"(%p)\n", iface);
6106 for (
i=0;
i<
This->entries_size;
i++)
6108 if (
This->entries[
i].stream_dirty)
6119 This->firstFreeEntry = 0;
6127 if (!
This->reverted)
6129 TRACE(
"Storage invalidated (stg=%p)\n",
This);
6141 IStorage_Revert(&
This->base.IStorage_iface);
6142 IStorage_Release(&
This->transactedParent->IStorage_iface);
6143 IStorage_Release(&
This->scratch->IStorage_iface);
6172 new_entry = &
This->entries[new_ref];
6203 if (
index !=
This->base.storageDirEntry)
6207 if (
data->size.QuadPart == 0 &&
6216 This->entries[delete_ref].deleted =
TRUE;
6221 TRACE(
"<-- S_OK\n");
6251 This->entries[
index].data.size.QuadPart != 0)
6316 This->entries[
index].data.size.QuadPart,
6358 This->entries[delete_ref].deleted =
TRUE;
6369 This->entries[
index].stream_entry, newsize);
6373 This->entries[
index].data.size = newsize;
6401 src_entry = &
This->entries[
src];
6494 list_init(&(*result)->base.storageHead);
6496 (*result)->base.ref = 1;
6498 (*result)->base.openFlags = parentStorage->
openFlags;
6510 ULONG num_entries = 20;
6513 (*result)->entries_size = num_entries;
6514 (*result)->firstFreeEntry = 0;
6516 if ((*result)->entries)
6519 (*result)->transactedParent = parentStorage;
6527 IStorage_Release(scratch);
6548 if (!
This->reverted)
6550 TRACE(
"Storage invalidated (stg=%p)\n",
This);
6563 IStorage_Release(&
This->transactedParent->IStorage_iface);
6564 IStorage_Release(&
This->scratch->base.IStorage_iface);
6677 DWORD grfCommitFlags)
6680 DirRef new_storage_ref, prev_storage_ref;
6683 ULONG transactionSig;
6685 TRACE(
"(%p,%x)\n", iface, grfCommitFlags);
6698 if ((grfCommitFlags & STGC_ONLYIFCURRENT) && transactionSig !=
This->lastTransactionSig)
6746 hr = IStorage_Commit(&
This->scratch->base.IStorage_iface, STGC_DEFAULT);
6750 This->lastTransactionSig = transactionSig+1;
6762 TRACE(
"(%p)\n", iface);
6767 return IStorage_Revert(&
This->scratch->base.IStorage_iface);
6830 list_init(&(*result)->base.storageHead);
6832 (*result)->base.ref = 1;
6834 (*result)->base.openFlags = parentStorage->
openFlags;
6862 hr = IStorage_Commit(scratch, STGC_DEFAULT);
6864 (*result)->base.storageDirEntry = (*result)->scratch->base.storageDirEntry;
6865 (*result)->transactedParent = parentStorage;
6869 IStorage_Release(scratch);
6888 if (parentStorage->
openFlags & fixme_flags)
6890 fixme_flags &= ~parentStorage->openFlags;
6927 IStorage_Release(&newStorage->
base.IStorage_iface);
6929 *
result = newTransactedStorage;
6974#ifdef WORDS_BIGENDIAN
6988#ifdef WORDS_BIGENDIAN
7019 STATSTG* destination,
7029 destination->pwcsName = 0;
7032 else if( ((statFlags & STATFLAG_NONAME) != 0) ||
7035 destination->pwcsName = 0;
7039 destination->pwcsName =
7049 destination->type = STGTY_STORAGE;
7052 destination->type = STGTY_STREAM;
7055 destination->type = STGTY_STREAM;
7059 destination->cbSize =
source->size;
7065 destination->grfMode = 0;
7066 destination->grfLocksSupported = 0;
7067 destination->clsid =
source->clsid;
7068 destination->grfStateBits = 0;
7069 destination->reserved = 0;
7090 if (
This->headOfStreamPlaceHolder != 0)
7091 return *(
This->headOfStreamPlaceHolder);
7096 This->parentStorage,
7097 This->ownerDirEntry,
7110 ULONG next_sector, next_offset;
7114 if (
This->indexCacheLen == 0)
7122 last_run = &
This->indexCache[
This->indexCacheLen-1];
7135 if (
This->indexCacheSize == 0)
7139 This->indexCacheSize = 16;
7141 else if (
This->indexCacheSize ==
This->indexCacheLen)
7152 This->indexCache = new_cache;
7156 This->indexCacheLen++;
7157 last_run = &
This->indexCache[
This->indexCacheLen-1];
7170 if (
This->indexCacheLen)
7178 This->numBlocks = 0;
7187 ULONG min_offset = 0, max_offset =
This->numBlocks-1;
7188 ULONG min_run = 0, max_run =
This->indexCacheLen-1;
7193 while (min_run < max_run)
7195 ULONG run_to_check = min_run + (
offset - min_offset) * (max_run - min_run) / (max_offset - min_offset);
7196 if (offset < This->indexCache[run_to_check].
firstOffset)
7198 max_offset =
This->indexCache[run_to_check].firstOffset-1;
7199 max_run = run_to_check-1;
7201 else if (
offset >
This->indexCache[run_to_check].lastOffset)
7203 min_offset =
This->indexCache[run_to_check].lastOffset+1;
7204 min_run = run_to_check+1;
7208 min_run = max_run = run_to_check;
7211 return This->indexCache[min_run].firstSector +
offset -
This->indexCache[min_run].firstOffset;
7234 if (
This->cachedBlocks[0].index == 0xffffffff)
7236 else if (
This->cachedBlocks[1].index == 0xffffffff)
7241 if (
This->blockToEvict == 2)
7242 This->blockToEvict = 0;
7263 ULONG* headOfStreamPlaceHolder,
7300 if (
This->cachedBlocks[
i].dirty)
7336 numBlocks = newSize.
QuadPart /
This->parentStorage->bigBlockSize;
7338 if ((newSize.
QuadPart %
This->parentStorage->bigBlockSize) != 0)
7350 This->parentStorage,
7354 This->tailIndex = blockIndex;
7358 if (
This->headOfStreamPlaceHolder != 0)
7368 This->parentStorage,
7369 This->ownerDirEntry,
7375 This->parentStorage,
7376 This->ownerDirEntry,
7383 This->numBlocks = numBlocks;
7388 while (
This->indexCacheLen &&
This->indexCache[
This->indexCacheLen-1].lastOffset >= numBlocks)
7394 This->indexCacheLen--;
7404 if (
This->cachedBlocks[
i].index >= numBlocks)
7406 This->cachedBlocks[
i].index = 0xffffffff;
7422 ULONG blockIndex, currentBlock;
7424 ULONG oldNumBlocks = 0;
7438 if (
This->headOfStreamPlaceHolder != 0)
7440 *(
This->headOfStreamPlaceHolder) = blockIndex;
7448 This->parentStorage,
7449 This->ownerDirEntry,
7455 This->parentStorage,
7456 This->ownerDirEntry,
7460 This->tailIndex = blockIndex;
7461 This->numBlocks = 1;
7467 newNumBlocks = newSize.
QuadPart /
This->parentStorage->bigBlockSize;
7469 if ((newSize.
QuadPart %
This->parentStorage->bigBlockSize) != 0)
7477 currentBlock = blockIndex;
7482 currentBlock = blockIndex;
7489 This->tailIndex = currentBlock;
7492 currentBlock =
This->tailIndex;
7493 oldNumBlocks =
This->numBlocks;
7498 if (oldNumBlocks < newNumBlocks)
7500 while (oldNumBlocks < newNumBlocks)
7505 This->parentStorage,
7510 This->parentStorage,
7514 currentBlock = blockIndex;
7518 This->tailIndex = blockIndex;
7519 This->numBlocks = newNumBlocks;
7539 if(
This->headOfStreamPlaceHolder ==
NULL)
7545 This->parentStorage,
7546 This->ownerDirEntry,
7549 return chainEntry.
size;
7561 This->parentStorage->bigBlockSize;
7611 ULONG blockNoInSequence =
offset.QuadPart /
This->parentStorage->bigBlockSize;
7612 ULONG offsetInBlock =
offset.QuadPart %
This->parentStorage->bigBlockSize;
7613 ULONG bytesToReadInBuffer;
7648 bytesToReadInBuffer =
7649 min(
This->parentStorage->bigBlockSize - offsetInBlock,
size);
7665 bytesToReadInBuffer,
7670 if (!cachedBlock->
read)
7679 memcpy(bufferWalker, cachedBlock->
data+offsetInBlock, bytesToReadInBuffer);
7680 bytesReadAt = bytesToReadInBuffer;
7683 blockNoInSequence++;
7684 bufferWalker += bytesReadAt;
7685 size -= bytesReadAt;
7686 *bytesRead += bytesReadAt;
7689 if (bytesToReadInBuffer != bytesReadAt)
7708 ULONG blockNoInSequence =
offset.QuadPart /
This->parentStorage->bigBlockSize;
7709 ULONG offsetInBlock =
offset.QuadPart %
This->parentStorage->bigBlockSize;
7712 const BYTE* bufferWalker;
7722 DWORD bytesWrittenAt;
7728 min(
This->parentStorage->bigBlockSize - offsetInBlock,
size);
7736 ERR(
"not enough blocks in chain to write data\n");
7754 if (!cachedBlock->
read && bytesToWrite !=
This->parentStorage->bigBlockSize)
7761 memcpy(cachedBlock->
data+offsetInBlock, bufferWalker, bytesToWrite);
7762 bytesWrittenAt = bytesToWrite;
7767 blockNoInSequence++;
7768 bufferWalker += bytesWrittenAt;
7769 size -= bytesWrittenAt;
7773 if (bytesWrittenAt != bytesToWrite)
7787 ULONG* headOfStreamPlaceHolder,
7818 if (
This->headOfStreamPlaceHolder !=
NULL)
7819 return *(
This->headOfStreamPlaceHolder);
7821 if (
This->ownerDirEntry)
7824 This->parentStorage,
7825 This->ownerDirEntry,
7847 ULONG* nextBlockInChain)
7862 This->parentStorage->smallBlockDepotChain,
7863 offsetOfBlockInDepot,
7905 This->parentStorage->smallBlockDepotChain,
7906 offsetOfBlockInDepot,
7937 ULONG blockIndex =
This->parentStorage->firstFreeSmallBlock;
7940 ULONG smallBlocksPerBigBlock;
7942 ULONG blocksRequired;
7945 offsetOfBlockInDepot.
u.HighPart = 0;
7955 This->parentStorage->smallBlockDepotChain,
7956 offsetOfBlockInDepot,
7995 This->parentStorage->firstFreeSmallBlock = blockIndex+1;
7997 smallBlocksPerBigBlock =
7998 This->parentStorage->bigBlockSize /
This->parentStorage->smallBlockSize;
8003 blocksRequired = (blockIndex / smallBlocksPerBigBlock) + 1;
8012 This->parentStorage->smallBlockRootChain,
8016 This->parentStorage,
8017 This->parentStorage->base.storageDirEntry,
8020 rootEntry.
size = size_required;
8023 This->parentStorage,
8024 This->parentStorage->base.storageDirEntry,
8047 ULONG blockNoInSequence =
8048 offset.
u.LowPart /
This->parentStorage->smallBlockSize;
8050 ULONG offsetInBlock =
offset.u.LowPart %
This->parentStorage->smallBlockSize;
8051 ULONG bytesToReadInBuffer;
8053 ULONG bytesReadFromBigBlockFile;
8080 blockNoInSequence--;
8093 bytesToReadInBuffer =
8094 min(
This->parentStorage->smallBlockSize - offsetInBlock,
size);
8100 (
ULONGLONG)blockIndex *
This->parentStorage->smallBlockSize;
8102 offsetInBigBlockFile.
QuadPart += offsetInBlock;
8110 offsetInBigBlockFile,
8111 bytesToReadInBuffer,
8113 &bytesReadFromBigBlockFile);
8118 if (!bytesReadFromBigBlockFile)
8128 bufferWalker += bytesReadFromBigBlockFile;
8129 size -= bytesReadFromBigBlockFile;
8130 *bytesRead += bytesReadFromBigBlockFile;
8131 offsetInBlock = (offsetInBlock + bytesReadFromBigBlockFile) %
This->parentStorage->smallBlockSize;
8151 ULONG blockNoInSequence =
8152 offset.
u.LowPart /
This->parentStorage->smallBlockSize;
8154 ULONG offsetInBlock =
offset.u.LowPart %
This->parentStorage->smallBlockSize;
8155 ULONG bytesToWriteInBuffer;
8157 ULONG bytesWrittenToBigBlockFile;
8158 const BYTE* bufferWalker;
8175 blockNoInSequence--;
8188 bytesToWriteInBuffer =
8189 min(
This->parentStorage->smallBlockSize - offsetInBlock,
size);
8195 (
ULONGLONG)blockIndex *
This->parentStorage->smallBlockSize;
8197 offsetInBigBlockFile.
QuadPart += offsetInBlock;
8203 This->parentStorage->smallBlockRootChain,
8204 offsetInBigBlockFile,
8205 bytesToWriteInBuffer,
8207 &bytesWrittenToBigBlockFile);
8217 bufferWalker += bytesWrittenToBigBlockFile;
8218 size -= bytesWrittenToBigBlockFile;
8220 offsetInBlock = (offsetInBlock + bytesWrittenToBigBlockFile) %
This->parentStorage->smallBlockSize;
8235 ULONG blockIndex, extraBlock;
8239 numBlocks = newSize.
u.LowPart /
This->parentStorage->smallBlockSize;
8241 if ((newSize.
u.LowPart %
This->parentStorage->smallBlockSize) != 0)
8249 while (
count < numBlocks)
8266 This->ownerDirEntry,
8272 This->ownerDirEntry,
8278 extraBlock = blockIndex;
8303 This->parentStorage->firstFreeSmallBlock =
min(
This->parentStorage->firstFreeSmallBlock, extraBlock);
8304 extraBlock = blockIndex;
8319 ULONG blockIndex, currentBlock;
8321 ULONG oldNumBlocks = 0;
8336 if (
This->headOfStreamPlaceHolder !=
NULL)
8338 *(
This->headOfStreamPlaceHolder) = blockIndex;
8354 currentBlock = blockIndex;
8359 newNumBlocks = newSize.
u.LowPart /
This->parentStorage->smallBlockSize;
8361 if ((newSize.
u.LowPart %
This->parentStorage->smallBlockSize) != 0)
8370 currentBlock = blockIndex;
8378 while (oldNumBlocks < newNumBlocks)
8388 currentBlock = blockIndex;
8411 if (newSize.
u.LowPart ==
size.u.LowPart)
8414 if (newSize.
u.LowPart <
size.u.LowPart)
8445 blockIndex, &blockIndex)))
8461 if(
This->headOfStreamPlaceHolder !=
NULL)
8467 This->parentStorage->smallBlockSize;
8473 This->parentStorage,
8474 This->ownerDirEntry,
8477 return chainEntry.
size;
8499 DWORD fileAttributes;
8537 static const WCHAR prefix[] = {
'S',
'T',
'O', 0 };
8539 memset(tempPath, 0,
sizeof(tempPath));
8540 memset(tempFileName, 0,
sizeof(tempFileName));
8546 pwcsName = tempFileName;
8612 TRACE(
"<-- %p r = %08x\n", *ppstgOpen,
hr);
8644 TRACE(
"(%s, %x, %d, %p)\n",
8653 return create_storagefile(pwcsName, grfMode, 0, &stgoptions, &IID_IStorage, (
void**)ppstgOpen);
8662 grfMode, stgfmt, grfAttrs, pStgOptions,
reserved,
riid, ppObjectOpen);
8666 ERR(
"grfAttrs must be 0 if stgfmt != STGFMT_FILE\n");
8672 ERR(
"grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_FILE\n");
8678 ERR(
"Cannot use STGFMT_FILE - this is NTFS only\n");
8686 if (!pStgOptions) pStgOptions = &defaultOptions;
8691 ERR(
"Invalid stgfmt argument\n");
8705 return IStorage_QueryInterface(pstg, &IID_IPropertySetStorage, (
void**)propset);
8714 grfMode, stgfmt, grfAttrs, pStgOptions,
reserved,
riid, ppObjectOpen);
8718 ERR(
"grfAttrs must be 0 if stgfmt != STGFMT_DOCFILE\n");
8725 ERR(
"Cannot use STGFMT_FILE - this is NTFS only\n");
8734 ERR(
"grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_DOCFILE\n");
8737 FIXME(
"Stub: calling StgOpenStorage, but ignoring pStgOptions and grfAttrs\n");
8741 WARN(
"STGFMT_ANY assuming storage\n");
8770 TRACE(
"(%s, %p, %x, %p, %d, %p)\n",
8938 if (pstgPriority) IStorage_Release(pstgPriority);
8939 TRACE(
"<-- %08x, IStorage %p\n",
hr, ppstgOpen ? *ppstgOpen :
NULL);
8955 if ((ppstgOpen == 0) || (plkbyt == 0))
8995 if ((plkbyt == 0) || (ppstgOpen == 0))
9044 r = IStorage_SetElementTimes(stg,
NULL, pctime, patime, pmtime);
9045 IStorage_Release(stg);
9065 ILockBytes_ReadAt(plkbyt,
offset, sig,
sizeof(sig), &
read);
9086 return IStorage_SetClass(pStg, rclsid);
9108 TRACE(
"(%p, %p)\n", pstg, pclsid);
9110 if(!pstg || !pclsid)
9116 hRes=IStorage_Stat(pstg,&pstatstg,STATFLAG_NONAME);
9119 *pclsid=pstatstg.clsid;
9145 IUnknown_Release((
IUnknown*)*ppvObj);
9148 res=IPersistStream_Load(xstm,pStm);
9149 IPersistStream_Release(xstm);
9170 TRACE(
"(%p,%p)\n",pPStm,pStm);
9172 res=IPersistStream_GetClassID(pPStm,&
clsid);
9180 res=IPersistStream_Save(pPStm,pStm,
TRUE);
9183 TRACE(
"Finished Save\n");
9209 static const WCHAR stream_1oleW[] = {1,
'O',
'l',
'e',0};
9210 static const DWORD version_magic = 0x02000001;
9217 struct empty_1ole_stream {
9218 DWORD version_magic;
9220 DWORD update_options;
9222 DWORD mon_stream_size;
9314 static const WCHAR szwStreamName[] = {1,
'C',
'o',
'm',
'p',
'O',
'b',
'j', 0};
9316 static const BYTE unknown1[12] =
9317 { 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
9318 0xFF, 0xFF, 0xFF, 0xFF};
9319 static const BYTE unknown2[16] =
9320 { 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
9321 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
9328 r = IStorage_CreateStream(pstg, szwStreamName,
9334 r = IStream_Write(pstm, unknown1,
sizeof(unknown1),
NULL);
9346 r = IStream_Write(pstm, unknown2,
sizeof(unknown2),
NULL);
9348 IStream_Release( pstm );
9361 WCHAR szwClipName[0x40];
9377 r = IStorage_Stat(pstg, &
stat, STATFLAG_NONAME);
9388 cf ? szwClipName :
NULL, wstrProgID );
9403 static const WCHAR szCompObj[] = { 1,
'C',
'o',
'm',
'p',
'O',
'b',
'j', 0 };
9404 unsigned char unknown1[12];
9405 unsigned char unknown2[16];
9410 TRACE(
"(%p,%p,%p)\n", pstg, pcf, lplpszUserType);
9412 r = IStorage_OpenStream( pstg, szCompObj,
NULL,
9416 WARN(
"Failed to open stream r = %08x\n",
r);
9421 r = IStream_Read( stm, unknown1,
sizeof(unknown1), &
count );
9440 r = IStream_Read( stm, unknown2,
sizeof(unknown2), &
count );
9448 if( lplpszUserType )
9450 *lplpszUserType = szCLSIDName;
9458 IStream_Release( stm );
9491 WARN(
" unable to read file\n");
9498 if (bytes_read != 8) {
9499 TRACE(
" too short\n");
9508 TRACE(
" -> Invalid header.\n");
9527 TRACE(
"(%p,%p)\n",pStm,rclsid);
9529 if (!pStm || !rclsid)
9532 return IStream_Write(pStm,rclsid,
sizeof(
CLSID),
NULL);
9553 TRACE(
"(%p,%p)\n",pStm,pclsid);
9555 if (!pStm || !pclsid)
9561 res = IStream_Read(pStm, pclsid,
sizeof(
CLSID), &nbByte);
9566 if (nbByte !=
sizeof(
CLSID))
9577#define OLESTREAM_ID 0x501
9578#define OLESTREAM_MAX_STR_LEN 255
9650 for( nTryCnt=0;nTryCnt < max_try; nTryCnt++)
9680 if(
pData->dwTypeID != 0)
9683 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *) &(
pData->dwOleTypeNameLength),
sizeof(
pData->dwOleTypeNameLength));
9691 if(
pData->dwOleTypeNameLength > 0)
9703 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwOleObjFileNameLength),
sizeof(
pData->dwOleObjFileNameLength));
9704 if(
dwSize !=
sizeof(
pData->dwOleObjFileNameLength))
9710 if(
pData->dwOleObjFileNameLength < 1)
9711 pData->dwOleObjFileNameLength =
sizeof(
pData->dwOleObjFileNameLength);
9713 if(
pData->pstrOleObjFileName)
9728 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwMetaFileWidth),
sizeof(
pData->dwMetaFileWidth));
9736 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwMetaFileHeight),
sizeof(
pData->dwMetaFileHeight));
9746 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwDataLength),
sizeof(
pData->dwDataLength));
9757 pData->dwDataLength -= 8;
9767 if(
pData->dwDataLength > 0)
9834 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwOleTypeNameLength),
sizeof(
pData->dwOleTypeNameLength));
9842 if(
pData->dwOleTypeNameLength > 0)
9856 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwMetaFileWidth),
sizeof(
pData->dwMetaFileWidth));
9866 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwMetaFileHeight),
sizeof(
pData->dwMetaFileHeight));
9876 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwDataLength),
sizeof(
pData->dwDataLength));
9885 if(
pData->dwDataLength > 0)
9924 DWORD dwNumOfBytesWritten;
9926 static const WCHAR wstrPrefix[] = {
's',
'i',
's', 0};
9943 hRes = IStorage_CopyTo(pTempStorage, 0,
NULL,
NULL, pDestStorage);
9944 IStorage_Release(pTempStorage);
9973 DWORD nDataLength = 0;
9976 static const WCHAR wstrPrefix[] = {
's',
'i',
's', 0};
9988 IStorage_CopyTo(pStorage, 0,
NULL,
NULL, pTempStorage);
9989 IStorage_Release(pTempStorage);
10002 return nDataLength;
10033 static const WCHAR wstrStreamName[] = {1,
'C',
'o',
'm',
'p',
'O',
'b',
'j', 0};
10036 static const BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
10037 static const BYTE pCompObjUnknown2[] = {0xF4, 0x39, 0xB2, 0x71};
10040 memset(&IStorageCompObj, 0,
sizeof(IStorageCompObj));
10041 memcpy(IStorageCompObj.
byUnknown1, pCompObjUnknown1,
sizeof(pCompObjUnknown1));
10042 memcpy(IStorageCompObj.
byUnknown2, pCompObjUnknown2,
sizeof(pCompObjUnknown2));
10046 hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName,
10048 if(hStorageRes ==
S_OK)
10104 IStream_Release(pStream);
10134 static const WCHAR wstrStreamName[] = {2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
'0',
'0',
'0', 0};
10135 static const BYTE pOlePresStreamHeader[] =
10137 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
10138 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
10139 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
10140 0x00, 0x00, 0x00, 0x00
10143 static const BYTE pOlePresStreamHeaderEmpty[] =
10145 0x00, 0x00, 0x00, 0x00,
10146 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
10147 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
10148 0x00, 0x00, 0x00, 0x00
10152 hRes = IStorage_CreateStream(pStorage, wstrStreamName,
10160 memset(&OlePres, 0,
sizeof(OlePres));
10162 if(dwDataLength > 0)
10164 memcpy(OlePres.
byUnknown1, pOlePresStreamHeader,
sizeof(pOlePresStreamHeader));
10165 nHeaderSize =
sizeof(pOlePresStreamHeader);
10169 memcpy(OlePres.
byUnknown1, pOlePresStreamHeaderEmpty,
sizeof(pOlePresStreamHeaderEmpty));
10170 nHeaderSize =
sizeof(pOlePresStreamHeaderEmpty);
10183 hRes = IStream_Write(pStream, OlePres.
byUnknown1, nHeaderSize,
NULL);
10186 hRes = IStream_Write(pStream, &(OlePres.
dwSize),
sizeof(OlePres.
dwSize),
NULL);
10191 IStream_Release(pStream);
10218 static const WCHAR wstrStreamName[] = {1,
'O',
'l',
'e',
'1',
'0',
'N',
'a',
't',
'i',
'v',
'e', 0};
10221 hRes = IStorage_CreateStream(pStorage, wstrStreamName,
10227 hRes = IStream_Write(pStream, &dwDataLength,
sizeof(dwDataLength),
NULL);
10228 hRes = IStream_Write(pStream,
pData, dwDataLength,
NULL);
10229 IStream_Release(pStream);
10259 static const WCHAR wstrStreamName[] = {1,
'C',
'o',
'm',
'p',
'O',
'b',
'j', 0};
10262 hRes = IStorage_OpenStream(pStorage, wstrStreamName,
NULL,
10269 iSeekPos.
u.HighPart = 0;
10271 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_SET,
NULL);
10274 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_CUR ,
NULL);
10277 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_CUR ,
NULL);
10282 IStream_Read(pStream, strProgID, *
dwSize,
NULL);
10284 IStream_Release(pStream);
10293 IStorage_Stat(pStorage, &
stat, STATFLAG_NONAME);
10329 static const WCHAR wstrStreamName[] = {1,
'O',
'l',
'e',
'1',
'0',
'N',
'a',
't',
'i',
'v',
'e', 0};
10342 hRes = IStorage_OpenStream(pStorage, wstrStreamName,
NULL,
10354 IStream_Release(pStream);
10382 static const WCHAR wstrStreamName[] = {2,
'O',
'l',
'e',
'P',
'r',
'e',
's',
'0',
'0',
'0', 0};
10401 hRes = IStorage_OpenStream(pStorage, wstrStreamName,
NULL,
10407 static const char strMetafilePictName[] =
"METAFILEPICT";
10414 strcpy(pOleStreamData[1].strOleTypeName, strMetafilePictName);
10416 iSeekPos.
u.HighPart = 0;
10417 iSeekPos.
u.LowPart =
sizeof(olePress.
byUnknown1);
10420 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_SET,
NULL);
10434 MetaFilePict.
mm = 8;
10437 MetaFilePict.
hMF = 0;
10441 memcpy(pOleStreamData[1].
pData, &MetaFilePict,
sizeof(MetaFilePict));
10442 IStream_Read(pStream, &(pOleStreamData[1].
pData[
sizeof(MetaFilePict)]), pOleStreamData[1].dwDataLength-
sizeof(
METAFILEPICT16),
NULL);
10444 IStream_Release(pStream);
10463 const DVTARGETDEVICE*
ptd)
10469 TRACE(
"%p %p %p\n", pOleStream, pstg,
ptd);
10471 memset(pOleStreamData, 0,
sizeof(pOleStreamData));
10475 FIXME(
"DVTARGETDEVICE is not NULL, unhandled parameter\n");
10478 if(pstg ==
NULL || pOleStream ==
NULL)
10529 for(
i=0;
i < 2;
i++)
10559 static const WCHAR wstrStreamName[] = {1,
'O',
'l',
'e',
'1',
'0',
'N',
'a',
't',
'i',
'v',
'e', 0};
10561 TRACE(
"%p %p\n", pstg, pOleStream);
10563 memset(pOleStreamData, 0,
sizeof(pOleStreamData));
10565 if(pstg ==
NULL || pOleStream ==
NULL)
10581 IStream_Release(pStream);
10601 for(
i=0;
i < 2;
i++)
10619 static const WCHAR stream_1oleW[] = {1,
'O',
'l',
'e',0};
10620 static const DWORD version_magic = 0x02000001;
10625 TRACE(
"%p\n", stg);
10633 IStream_Release(
stream);
10636 if (
header[0] != version_magic)
10638 ERR(
"got wrong version magic for 1Ole stream, 0x%08x\n",
header[0]);
10650 static const WCHAR stream_1oleW[] = {1,
'O',
'l',
'e',0};
10670 IStream_Release(
stream);
10688 IStream_Release(
stream);
10695 IStream_Release(
stream);
ios_base &_STLP_CALL internal(ios_base &__s)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define RegCloseKey(hKey)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
static __inline const char * debugstr_an(const char *s, int n)
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
#define ERROR_ACCESS_DENIED
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetTickCount(VOID)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
static HRESULT StorageBaseImpl_DupStorageTree(StorageBaseImpl *dst, DirRef *dst_entry, StorageBaseImpl *src, DirRef src_entry)
static HRESULT WINAPI StorageBaseImpl_DestroyElement(IStorage *iface, const OLECHAR *pwcsName)
static HRESULT StorageInternalImpl_GetFilename(StorageBaseImpl *iface, LPWSTR *result)
static HRESULT WINAPI directwriterlock_QueryInterface(IDirectWriterLock *iface, REFIID riid, void **obj)
static HRESULT StorageInternalImpl_GetTransactionSig(StorageBaseImpl *base, ULONG *result, BOOL refresh)
static HRESULT WINAPI TransactedSharedImpl_Revert(IStorage *iface)
static void Storage32Impl_AddBlockDepot(StorageImpl *This, ULONG blockIndex, ULONG depotIndex)
static StorageBaseImpl * impl_from_IStorage(IStorage *iface)
static const StorageBaseImplVtbl TransactedSnapshotImpl_BaseVtbl
HRESULT WINAPI StgOpenStorage(const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
static HRESULT StorageInternalImpl_LockTransaction(StorageBaseImpl *base, BOOL write)
static void StorageImpl_DeleteCachedBlockChainStream(StorageImpl *This, DirRef index)
static BOOL SmallBlockChainStream_Enlarge(SmallBlockChainStream *This, ULARGE_INTEGER newSize)
HRESULT WINAPI OleConvertIStorageToOLESTREAM(LPSTORAGE pstg, LPOLESTREAM pOleStream)
static HRESULT StorageInternalImpl_Flush(StorageBaseImpl *iface)
static HRESULT StorageImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static ULONG Storage32Impl_AddExtBlockDepot(StorageImpl *This)
static HRESULT SmallBlockChainStream_ReadAt(SmallBlockChainStream *, ULARGE_INTEGER, ULONG, void *, ULONG *)
static HRESULT StorageImpl_BaseReadDirEntry(StorageBaseImpl *base, DirRef index, DirEntry *data)
static ULONG StorageImpl_GetNextFreeBigBlock(StorageImpl *This)
static HRESULT Storage_Construct(HANDLE hFile, LPCOLESTR pwcsName, ILockBytes *pLkbyt, DWORD openFlags, BOOL fileBased, BOOL create, ULONG sector_size, StorageBaseImpl **result)
static HRESULT WINAPI TransactedSnapshotImpl_Commit(IStorage *iface, DWORD grfCommitFlags)
HRESULT WINAPI ReadClassStg(IStorage *pstg, CLSID *pclsid)
static HRESULT StorageImpl_BaseWriteDirEntry(StorageBaseImpl *base, DirRef index, const DirEntry *data)
static HRESULT StorageImpl_SetTransactionSig(StorageBaseImpl *base, ULONG value)
static HRESULT StorageInternalImpl_StreamLink(StorageBaseImpl *base, DirRef dst, DirRef src)
HRESULT WINAPI StgSetTimes(OLECHAR const *str, FILETIME const *pctime, FILETIME const *patime, FILETIME const *pmtime)
static HRESULT WINAPI StorageBaseImpl_Revert(IStorage *iface)
static HRESULT TransactedSharedImpl_StreamLink(StorageBaseImpl *base, DirRef dst, DirRef src)
void StorageUtl_ReadGUID(const BYTE *buffer, ULONG offset, GUID *value)
static HRESULT TransactedSharedImpl_DestroyDirEntry(StorageBaseImpl *base, DirRef index)
static void TransactedSnapshotImpl_DestroyTemporaryCopy(TransactedSnapshotImpl *This, DirRef stop)
static IEnumSTATSTGImpl * impl_from_IEnumSTATSTG(IEnumSTATSTG *iface)
static HRESULT WINAPI directwriterlock_HaveWriteAccess(IDirectWriterLock *iface)
static ULONG WINAPI IEnumSTATSTGImpl_AddRef(IEnumSTATSTG *iface)
static HRESULT TransactedSnapshotImpl_EnsureReadEntry(TransactedSnapshotImpl *This, DirRef entry)
static HRESULT BlockChainStream_Flush(BlockChainStream *)
static HRESULT StorageInternalImpl_SetTransactionSig(StorageBaseImpl *base, ULONG value)
static BOOL StorageImpl_WriteDWordToBigBlock(StorageImpl *This, ULONG blockIndex, ULONG offset, DWORD value)
static StorageBaseImpl * impl_from_IDirectWriterLock(IDirectWriterLock *iface)
static BlockChainStream * Storage32Impl_SmallBlocksToBigBlocks(StorageImpl *This, SmallBlockChainStream **ppsbChain)
static void StorageImpl_FreeBigBlock(StorageImpl *This, ULONG blockIndex)
static HRESULT SmallBlockChainStream_WriteAt(SmallBlockChainStream *, ULARGE_INTEGER, ULONG, const void *, ULONG *)
HRESULT WINAPI WriteClassStm(IStream *pStm, REFCLSID rclsid)
static DWORD GetCreationModeFromSTGM(DWORD stgm)
void StorageUtl_WriteWord(BYTE *buffer, ULONG offset, WORD value)
static BOOL StorageImpl_WriteBigBlock(StorageImpl *This, ULONG blockIndex, const void *buffer)
const IPropertySetStorageVtbl IPropertySetStorage_Vtbl
static HRESULT WINAPI StorageBaseImpl_CreateStream(IStorage *iface, const OLECHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm)
static HRESULT WINAPI StorageBaseImpl_MoveElementTo(IStorage *iface, const OLECHAR *pwcsName, IStorage *pstgDest, const OLECHAR *pwcsNewName, DWORD grfFlags)
static void OLECONVERT_CreateOle10NativeStream(LPSTORAGE pStorage, const BYTE *pData, DWORD dwDataLength)
static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags)
static BOOL SmallBlockChainStream_Shrink(SmallBlockChainStream *This, ULARGE_INTEGER newSize)
static HRESULT SmallBlockChainStream_GetNextBlockInChain(SmallBlockChainStream *This, ULONG blockIndex, ULONG *nextBlockInChain)
static HRESULT TransactedSnapshotImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
static HRESULT StorageImpl_WriteAt(StorageImpl *This, ULARGE_INTEGER offset, const void *buffer, const ULONG size, ULONG *bytesWritten)
static HRESULT TransactedSharedImpl_GetFilename(StorageBaseImpl *iface, LPWSTR *result)
static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offset, ULARGE_INTEGER cb, DWORD dwLockType, BOOL *supported)
static SmallBlockChainStream * Storage32Impl_BigBlocksToSmallBlocks(StorageImpl *This, BlockChainStream **ppbbChain, ULARGE_INTEGER newSize)
static BOOL BlockChainStream_SetSize(BlockChainStream *, ULARGE_INTEGER)
static void StorageInternalImpl_Invalidate(StorageBaseImpl *base)
static void StorageImpl_SaveFileHeader(StorageImpl *This)
static void StorageBaseImpl_DeleteAll(StorageBaseImpl *stg)
static HRESULT WINAPI TransactedSnapshotImpl_Revert(IStorage *iface)
HRESULT WINAPI StgIsStorageFile(LPCOLESTR fn)
static void StorageImpl_Invalidate(StorageBaseImpl *iface)
static const StorageBaseImplVtbl StorageImpl_BaseVtbl
static HRESULT BlockChainStream_ReadAt(BlockChainStream *, ULARGE_INTEGER, ULONG, void *, ULONG *)
static HRESULT WINAPI TransactedSharedImpl_Commit(IStorage *iface, DWORD grfCommitFlags)
static HRESULT TransactedSnapshotImpl_Construct(StorageBaseImpl *parentStorage, TransactedSnapshotImpl **result)
void StorageUtl_ReadWord(const BYTE *buffer, ULONG offset, WORD *value)
static const StorageBaseImplVtbl StorageInternalImpl_BaseVtbl
static HRESULT StorageImpl_DestroyDirEntry(StorageBaseImpl *base, DirRef index)
void StorageUtl_ReadULargeInteger(const BYTE *buffer, ULONG offset, ULARGE_INTEGER *value)
static const IStorageVtbl StorageImpl_Vtbl
static HRESULT BlockChainStream_GetBlockAtOffset(BlockChainStream *This, ULONG index, BlockChainBlock **block, ULONG *sector, BOOL create)
static HRESULT WINAPI StorageBaseImpl_OpenStorage(IStorage *iface, const OLECHAR *pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg)
static ULONG SmallBlockChainStream_GetCount(SmallBlockChainStream *This)
static ULONG WINAPI StorageBaseImpl_AddRef(IStorage *iface)
static DWORD OLECONVERT_WriteOLE20ToBuffer(LPSTORAGE pStorage, BYTE **pData)
static HRESULT WINAPI directwriterlock_ReleaseWriteAccess(IDirectWriterLock *iface)
static void OLECONVERT_GetOle10PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
static void TransactedSnapshotImpl_Invalidate(StorageBaseImpl *This)
void StorageBaseImpl_RemoveStream(StorageBaseImpl *stg, StgStreamImpl *strm)
static DirRef TransactedSnapshotImpl_FindFirstChild(TransactedSnapshotImpl *This, DirRef parent)
HRESULT WINAPI ReadFmtUserTypeStg(LPSTORAGE pstg, CLIPFORMAT *pcf, LPOLESTR *lplpszUserType)
static BOOL StorageImpl_ReadDWordFromBigBlock(StorageImpl *This, ULONG blockIndex, ULONG offset, DWORD *value)
static void TransactedSharedImpl_Destroy(StorageBaseImpl *iface)
HRESULT OLECONVERT_CreateCompObjStream(LPSTORAGE pStorage, LPCSTR strOleTypeName)
static HRESULT StorageImpl_Flush(StorageBaseImpl *storage)
static void Storage32Impl_SetExtDepotBlock(StorageImpl *This, ULONG depotIndex, ULONG blockIndex)
static HRESULT WINAPI StorageBaseImpl_EnumElements(IStorage *iface, DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum)
static ULONG SmallBlockChainStream_GetNextFreeBlock(SmallBlockChainStream *This)
static HRESULT TransactedSnapshotImpl_GetTransactionSig(StorageBaseImpl *base, ULONG *result, BOOL refresh)
static HRESULT TransactedSharedImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER newsize)
static HRESULT TransactedSnapshotImpl_DestroyDirEntry(StorageBaseImpl *base, DirRef index)
static HRESULT StorageImpl_ReadAt(StorageImpl *This, ULARGE_INTEGER offset, void *buffer, ULONG size, ULONG *bytesRead)
HRESULT WINAPI OleLoadFromStream(IStream *pStm, REFIID iidInterface, void **ppvObj)
static void SmallBlockChainStream_Destroy(SmallBlockChainStream *)
static HRESULT StorageBaseImpl_CopyStorageTree(StorageBaseImpl *dst, DirRef dst_entry, StorageBaseImpl *src, DirRef src_entry)
static BlockChainStream ** StorageImpl_GetCachedBlockChainStream(StorageImpl *This, DirRef index)
static ULARGE_INTEGER SmallBlockChainStream_GetSize(SmallBlockChainStream *)
static HRESULT StorageImpl_LockTransaction(StorageBaseImpl *base, BOOL write)
static HRESULT WINAPI IEnumSTATSTGImpl_Skip(IEnumSTATSTG *iface, ULONG celt)
static HRESULT StorageImpl_Refresh(StorageImpl *This, BOOL new_object, BOOL create)
static StorageInternalImpl * StorageInternalImpl_Construct(StorageBaseImpl *, DWORD, DirRef)
static DirRef TransactedSnapshotImpl_FindNextChild(TransactedSnapshotImpl *This, DirRef current)
static HRESULT OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStrem1)
static HRESULT WINAPI StorageInternalImpl_Revert(IStorage *iface)
HRESULT WINAPI StgCreateDocfileOnILockBytes(ILockBytes *plkbyt, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
static void StorageInternalImpl_Destroy(StorageBaseImpl *iface)
static ULONGLONG StorageImpl_GetBigBlockOffset(StorageImpl *This, ULONG index)
void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage, STATSTG *destination, const DirEntry *source, int statFlags)
static const IDirectWriterLockVtbl DirectWriterLockVtbl
static const IStorageVtbl StorageInternalImpl_Vtbl
static HRESULT deleteStreamContents(StorageBaseImpl *parentStorage, DirRef indexToDelete, DirEntry entryDataToDelete)
static ULONG WINAPI IEnumSTATSTGImpl_Release(IEnumSTATSTG *iface)
static ULONG BlockChainStream_GetSectorOfOffset(BlockChainStream *This, ULONG offset)
static ULONG Storage32Impl_GetNextExtendedBlock(StorageImpl *This, ULONG blockIndex)
static HRESULT Storage_ConstructTransacted(StorageBaseImpl *, BOOL, StorageBaseImpl **)
static const BYTE STORAGE_magic[8]
static const StorageBaseImplVtbl TransactedSharedImpl_BaseVtbl
static DWORD GetAccessModeFromSTGM(DWORD stgm)
static HRESULT TransactedSharedImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static HRESULT TransactedSnapshotImpl_SetTransactionSig(StorageBaseImpl *base, ULONG value)
static void setEntryLink(DirEntry *entry, ULONG relation, DirRef new_target)
static HRESULT TransactedSnapshotImpl_WriteDirEntry(StorageBaseImpl *base, DirRef index, const DirEntry *data)
static HRESULT StorageImpl_StreamLink(StorageBaseImpl *base, DirRef dst, DirRef src)
static ULONG Storage32Impl_GetExtDepotBlock(StorageImpl *This, ULONG depotIndex)
static HRESULT StorageImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER newsize)
static HRESULT TransactedSharedImpl_UnlockTransaction(StorageBaseImpl *base, BOOL write)
static HRESULT create_storagefile(LPCOLESTR pwcsName, DWORD grfMode, DWORD grfAttrs, STGOPTIONS *pStgOptions, REFIID riid, void **ppstgOpen)
static void SmallBlockChainStream_FreeBlock(SmallBlockChainStream *This, ULONG blockIndex)
static HRESULT StorageImpl_ReadRawDirEntry(StorageImpl *This, ULONG index, BYTE *buffer)
HRESULT WINAPI OleSaveToStream(IPersistStream *pPStm, IStream *pStm)
static HRESULT BlockChainStream_WriteAt(BlockChainStream *, ULARGE_INTEGER, ULONG, const void *, ULONG *)
static ULARGE_INTEGER BlockChainStream_GetSize(BlockChainStream *)
static HRESULT TransactedSnapshotImpl_MakeStreamDirty(TransactedSnapshotImpl *This, DirRef entry)
static HRESULT StorageImpl_UnlockTransaction(StorageBaseImpl *base, BOOL write)
static void StorageImpl_Destroy(StorageBaseImpl *iface)
HRESULT WINAPI StgCreateDocfile(LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved, IStorage **ppstgOpen)
static BOOL SmallBlockChainStream_SetSize(SmallBlockChainStream *, ULARGE_INTEGER)
static ULONG WINAPI StorageBaseImpl_Release(IStorage *iface)
static HRESULT WINAPI IEnumSTATSTGImpl_QueryInterface(IEnumSTATSTG *iface, REFIID riid, void **ppvObject)
static void SmallBlockChainStream_SetNextBlockInChain(SmallBlockChainStream *This, ULONG blockIndex, ULONG nextBlock)
static HRESULT StorageImpl_WriteRawDirEntry(StorageImpl *This, ULONG index, const BYTE *buffer)
static void StorageImpl_SetNextBlockInChain(StorageImpl *This, ULONG blockIndex, ULONG nextBlock)
static HRESULT StorageImpl_LoadFileHeader(StorageImpl *This)
static HRESULT WINAPI StorageBaseImpl_RenameElement(IStorage *iface, const OLECHAR *pwcsOldName, const OLECHAR *pwcsNewName)
void StorageBaseImpl_AddStream(StorageBaseImpl *stg, StgStreamImpl *strm)
static HRESULT removeFromTree(StorageBaseImpl *This, DirRef parentStorageIndex, DirRef deletedIndex)
static HRESULT STORAGE_WriteCompObj(LPSTORAGE pstg, CLSID *clsid, LPCWSTR lpszUserType, LPCWSTR szClipName, LPCWSTR szProgIDName)
static HRESULT StorageImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
static HRESULT STREAM_ReadString(IStream *stm, LPWSTR *string)
static void UpdateRawDirEntry(BYTE *buffer, const DirEntry *newData)
static HRESULT WINAPI StorageBaseImpl_Commit(IStorage *iface, DWORD grfCommitFlags)
static HRESULT StorageImpl_Construct(HANDLE hFile, LPCOLESTR pwcsName, ILockBytes *pLkbyt, DWORD openFlags, BOOL fileBased, BOOL create, ULONG sector_size, StorageImpl **result)
static void BlockChainStream_Destroy(BlockChainStream *)
static HRESULT TransactedSharedImpl_LockTransaction(StorageBaseImpl *base, BOOL write)
static HRESULT StorageImpl_CheckLockRange(StorageImpl *This, ULONG start, ULONG end, HRESULT fail_hr)
static HRESULT OLECONVERT_SaveOLE10(OLECONVERT_OLESTREAM_DATA *pData, LPOLESTREAM pOleStream)
static void OLECONVERT_GetOle20PresData(LPSTORAGE pStorage, OLECONVERT_OLESTREAM_DATA *pOleStreamData)
static HRESULT WINAPI directwriterlock_WaitForWriteAccess(IDirectWriterLock *iface, DWORD timeout)
static HRESULT TransactedSharedImpl_Flush(StorageBaseImpl *iface)
static const IStorageVtbl TransactedSharedImpl_Vtbl
static HRESULT WINAPI StorageBaseImpl_CreateStorage(IStorage *iface, const OLECHAR *pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStorage **ppstg)
static HRESULT TransactedSharedImpl_GetTransactionSig(StorageBaseImpl *base, ULONG *result, BOOL refresh)
HRESULT WINAPI OleConvertOLESTREAMToIStorage(LPOLESTREAM pOleStream, LPSTORAGE pstg, const DVTARGETDEVICE *ptd)
static HRESULT WINAPI StorageBaseImpl_OpenStream(IStorage *iface, const OLECHAR *pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm)
static HRESULT StorageInternalImpl_ReadDirEntry(StorageBaseImpl *base, DirRef index, DirEntry *data)
static HRESULT IEnumSTATSTGImpl_GetNextRef(IEnumSTATSTGImpl *This, DirRef *ref)
static HRESULT TransactedSnapshotImpl_UnlockTransaction(StorageBaseImpl *base, BOOL write)
static HRESULT StorageInternalImpl_WriteDirEntry(StorageBaseImpl *base, DirRef index, const DirEntry *data)
void StorageUtl_WriteDWord(BYTE *buffer, ULONG offset, DWORD value)
static HRESULT StorageBaseImpl_DeleteStorageTree(StorageBaseImpl *This, DirRef entry, BOOL include_siblings)
static ULONG SmallBlockChainStream_GetHeadOfChain(SmallBlockChainStream *This)
static HRESULT TransactedSnapshotImpl_StreamLink(StorageBaseImpl *base, DirRef dst, DirRef src)
static IEnumSTATSTGImpl * IEnumSTATSTGImpl_Construct(StorageBaseImpl *, DirRef)
static HRESULT TransactedSharedImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
static HRESULT TransactedSnapshotImpl_GetFilename(StorageBaseImpl *iface, LPWSTR *result)
static DirRef TransactedSnapshotImpl_CreateStubEntry(TransactedSnapshotImpl *This, DirRef parentEntryRef)
static BOOL BlockChainStream_Shrink(BlockChainStream *This, ULARGE_INTEGER newSize)
static BOOL BlockChainStream_Enlarge(BlockChainStream *This, ULARGE_INTEGER newSize)
static HRESULT StorageImpl_GetFilename(StorageBaseImpl *iface, LPWSTR *result)
HRESULT WINAPI ReadClassStm(IStream *pStm, CLSID *pclsid)
static HRESULT findTreeParent(StorageBaseImpl *storage, DirRef storageEntry, const OLECHAR *childName, DirEntry *parentData, DirRef *parentEntry, ULONG *relation)
void StorageUtl_WriteULargeInteger(BYTE *buffer, ULONG offset, const ULARGE_INTEGER *value)
HRESULT WINAPI GetConvertStg(IStorage *stg)
static HRESULT StorageImpl_WriteDirEntry(StorageImpl *This, DirRef index, const DirEntry *buffer)
static HRESULT StorageImpl_CreateDirEntry(StorageBaseImpl *base, const DirEntry *newData, DirRef *index)
static void TransactedSharedImpl_Invalidate(StorageBaseImpl *This)
static LONG entryNameCmp(const OLECHAR *name1, const OLECHAR *name2)
static HRESULT TransactedSnapshotImpl_ReadDirEntry(StorageBaseImpl *base, DirRef index, DirEntry *data)
static HRESULT WINAPI IEnumSTATSTGImpl_Clone(IEnumSTATSTG *iface, IEnumSTATSTG **ppenum)
static HRESULT TransactedSnapshotImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static HRESULT WINAPI IEnumSTATSTGImpl_Reset(IEnumSTATSTG *iface)
static BOOL StorageBaseImpl_IsStreamOpen(StorageBaseImpl *stg, DirRef streamEntry)
static HRESULT StorageBaseImpl_CopyStorageEntryTo(StorageBaseImpl *This, DirRef srcEntry, BOOL skip_storage, BOOL skip_stream, SNB snbExclude, IStorage *pstgDest)
static DirRef TransactedSnapshotImpl_FindFreeEntry(TransactedSnapshotImpl *This)
static HRESULT WINAPI StorageBaseImpl_SetClass(IStorage *iface, REFCLSID clsid)
static void OLECONVERT_GetOLE20FromOLE10(LPSTORAGE pDestStorage, const BYTE *pBuffer, DWORD nBufferLength)
static HRESULT STREAM_WriteString(IStream *stm, LPCWSTR string)
static HRESULT OLECONVERT_GetOLE10ProgID(LPSTORAGE pStorage, char *strProgID, DWORD *dwSize)
HRESULT WINAPI StgCreatePropSetStg(IStorage *pstg, DWORD reserved, IPropertySetStorage **propset)
static HRESULT TransactedSharedImpl_CreateDirEntry(StorageBaseImpl *base, const DirEntry *newData, DirRef *index)
HRESULT STORAGE_CreateOleStream(IStorage *storage, DWORD flags)
static BOOL TransactedSnapshotImpl_MadeCopy(TransactedSnapshotImpl *This, DirRef entry)
static HRESULT TransactedSnapshotImpl_CopyTree(TransactedSnapshotImpl *This)
static HRESULT BlockChainStream_UpdateIndexCache(BlockChainStream *This)
static void TransactedSnapshotImpl_Destroy(StorageBaseImpl *iface)
static HRESULT StorageImpl_GetNextBlockInChain(StorageImpl *This, ULONG blockIndex, ULONG *nextBlockIndex)
static HRESULT WINAPI StorageInternalImpl_Commit(IStorage *iface, DWORD grfCommitFlags)
static HRESULT TransactedSnapshotImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER newsize)
static HRESULT StorageImpl_LockOne(StorageImpl *This, ULONG start, ULONG end)
static HRESULT WINAPI IEnumSTATSTGImpl_Next(IEnumSTATSTG *iface, ULONG celt, STATSTG *rgelt, ULONG *pceltFetched)
static HRESULT StorageImpl_GetTransactionSig(StorageBaseImpl *base, ULONG *result, BOOL refresh)
static SmallBlockChainStream * SmallBlockChainStream_Construct(StorageImpl *, ULONG *, DirRef)
static HRESULT WINAPI StorageBaseImpl_SetElementTimes(IStorage *iface, const OLECHAR *pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime)
static HRESULT validateSTGM(DWORD stgm)
static void OLECONVERT_CreateOlePresStream(LPSTORAGE pStorage, DWORD dwExtentX, DWORD dwExtentY, BYTE *pData, DWORD dwDataLength)
HRESULT WINAPI StgIsStorageILockBytes(ILockBytes *plkbyt)
HRESULT WINAPI WriteClassStg(IStorage *pStg, REFCLSID rclsid)
static HRESULT TransactedSharedImpl_SetTransactionSig(StorageBaseImpl *base, ULONG value)
static HRESULT StorageImpl_LockRegion(StorageImpl *This, ULARGE_INTEGER offset, ULARGE_INTEGER cb, DWORD dwLockType, BOOL *supported)
static DWORD GetShareModeFromSTGM(DWORD stgm)
static HRESULT StorageImpl_ReadBigBlock(StorageImpl *This, ULONG blockIndex, void *buffer, ULONG *out_read)
static HRESULT TransactedSnapshotImpl_Flush(StorageBaseImpl *iface)
static HRESULT StorageInternalImpl_CreateDirEntry(StorageBaseImpl *base, const DirEntry *newData, DirRef *index)
static HRESULT TransactedSnapshotImpl_LockTransaction(StorageBaseImpl *base, BOOL write)
static ULONG WINAPI directwriterlock_Release(IDirectWriterLock *iface)
static ULONG WINAPI directwriterlock_AddRef(IDirectWriterLock *iface)
static HRESULT StorageImpl_UnlockRegion(StorageImpl *This, ULARGE_INTEGER offset, ULARGE_INTEGER cb, DWORD dwLockType)
static HRESULT StorageBaseImpl_CopyStream(StorageBaseImpl *dst, DirRef dst_entry, StorageBaseImpl *src, DirRef src_entry)
static HRESULT StorageInternalImpl_StreamWriteAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
static HRESULT StorageImpl_ReadDirEntry(StorageImpl *This, DirRef index, DirEntry *buffer)
HRESULT WINAPI StgOpenStorageEx(const WCHAR *pwcsName, DWORD grfMode, DWORD stgfmt, DWORD grfAttrs, STGOPTIONS *pStgOptions, void *reserved, REFIID riid, void **ppObjectOpen)
static HRESULT WINAPI StorageBaseImpl_Stat(IStorage *iface, STATSTG *pstatstg, DWORD grfStatFlag)
static HRESULT WINAPI StorageBaseImpl_CopyTo(IStorage *iface, DWORD ciidExclude, const IID *rgiidExclude, SNB snbExclude, IStorage *pstgDest)
static HRESULT TransactedSharedImpl_Construct(StorageBaseImpl *parentStorage, TransactedSharedImpl **result)
static const BYTE STORAGE_oldmagic[8]
static const IEnumSTATSTGVtbl IEnumSTATSTGImpl_Vtbl
static HRESULT StorageInternalImpl_DestroyDirEntry(StorageBaseImpl *base, DirRef index)
void StorageUtl_WriteGUID(BYTE *buffer, ULONG offset, const GUID *value)
HRESULT WINAPI WriteFmtUserTypeStg(LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType)
static BlockChainStream ** StorageImpl_GetFreeBlockChainCacheEntry(StorageImpl *This)
static HRESULT deleteStorageContents(StorageBaseImpl *parentStorage, DirRef indexToDelete, DirEntry entryDataToDelete)
static DirRef findElement(StorageBaseImpl *storage, DirRef storageEntry, const OLECHAR *name, DirEntry *data)
static HRESULT WINAPI StorageBaseImpl_SetStateBits(IStorage *iface, DWORD grfStateBits, DWORD grfMask)
static BlockChainStream * BlockChainStream_Construct(StorageImpl *, ULONG *, DirRef)
static HRESULT StorageInternalImpl_UnlockTransaction(StorageBaseImpl *base, BOOL write)
static HRESULT insertIntoTree(StorageBaseImpl *This, DirRef parentStorageIndex, DirRef newEntryIndex)
static HRESULT TransactedSharedImpl_ReadDirEntry(StorageBaseImpl *base, DirRef index, DirEntry *data)
HRESULT WINAPI StgCreateStorageEx(const WCHAR *pwcsName, DWORD grfMode, DWORD stgfmt, DWORD grfAttrs, STGOPTIONS *pStgOptions, void *reserved, REFIID riid, void **ppObjectOpen)
static HRESULT StorageInternalImpl_StreamSetSize(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER newsize)
static HRESULT TransactedSnapshotImpl_CreateDirEntry(StorageBaseImpl *base, const DirEntry *newData, DirRef *index)
void StorageUtl_ReadDWord(const BYTE *buffer, ULONG offset, DWORD *value)
static HRESULT StorageBaseImpl_CopyChildEntryTo(StorageBaseImpl *This, DirRef srcEntry, BOOL skip_storage, BOOL skip_stream, SNB snbExclude, IStorage *pstgDest)
#define OLESTREAM_MAX_STR_LEN
static HRESULT TransactedSharedImpl_WriteDirEntry(StorageBaseImpl *base, DirRef index, const DirEntry *data)
HRESULT WINAPI SetConvertStg(IStorage *storage, BOOL convert)
HRESULT WINAPI StgOpenStorageOnILockBytes(ILockBytes *plkbyt, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstgOpen)
static BOOL StorageBaseImpl_IsStorageOpen(StorageBaseImpl *stg, DirRef storageEntry)
static HRESULT StorageInternalImpl_StreamReadAt(StorageBaseImpl *base, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static ULONG BlockChainStream_GetCount(BlockChainStream *This)
static void IEnumSTATSTGImpl_Destroy(IEnumSTATSTGImpl *This)
static const IStorageVtbl TransactedSnapshotImpl_Vtbl
static HRESULT WINAPI StorageBaseImpl_QueryInterface(IStorage *iface, REFIID riid, void **ppvObject)
static ULONG BlockChainStream_GetHeadOfChain(BlockChainStream *This)
HCRYPTKEY new_object(struct handle_table *lpTable, size_t cbSize, DWORD dwType, DESTRUCTOR destructor, OBJECTHDR **ppObject)
HRESULT FileLockBytesImpl_Construct(HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes)
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum GLsizei GLuint GLint * bytesWritten
GLuint GLint GLboolean GLint GLenum access
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
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
JBLOCKROW JDIMENSION num_blocks
#define memcpy(s1, s2, n)
struct task_struct * current
#define TRUNCATE_EXISTING
#define FILE_FLAG_NO_BUFFERING
#define FILE_FLAG_RANDOM_ACCESS
#define FILE_FLAG_DELETE_ON_CLOSE
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static HMODULE MODULEINFO DWORD cb
static const char stream_data[]
static const struct access_res create[16]
#define cmp(status, error)
#define FILE_SHARE_DELETE
#define STGM_SHARE_DENY_NONE
#define STGM_SHARE_EXCLUSIVE
#define STGM_DELETEONRELEASE
#define STGM_SHARE_DENY_WRITE
#define STGM_SHARE_DENY_READ
interface IPersistStream * LPPERSISTSTREAM
interface IStorage * LPSTORAGE
const GUID IID_IEnumSTATSTG
const GUID IID_IPersistStream
#define IsEqualGUID(rguid1, rguid2)
static unsigned __int64 next
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
int const char int stream_size
StgStreamImpl * StgStreamImpl_Construct(StorageBaseImpl *parentStorage, DWORD grfMode, DirRef dirEntry)
static HRESULT StorageBaseImpl_DestroyDirEntry(StorageBaseImpl *This, DirRef index)
static HRESULT StorageBaseImpl_GetFilename(StorageBaseImpl *This, LPWSTR *result)
static const WORD MIN_BIG_BLOCK_SIZE_BITS
static const ULONG OFFSET_BIGBLOCKSIZEBITS
#define DIRENTRY_NAME_BUFFER_LEN
static HRESULT StorageBaseImpl_StreamSetSize(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER newsize)
static const ULONG OFFSET_MAJORVERSION
static const ULONG OFFSET_PS_CTIMELOW
#define RANGELOCK_PRIORITY2_FIRST
static const ULONG OFFSET_MINORVERSION
#define RANGELOCK_CHECKLOCKS
static HRESULT StorageBaseImpl_CreateDirEntry(StorageBaseImpl *This, const DirEntry *newData, DirRef *index)
#define RANGELOCK_UNK1_LAST
static const ULONG OFFSET_PS_STGTYPE
#define MIN_BIG_BLOCK_SIZE
#define RANGELOCK_READ_FIRST
#define DIRENTRY_RELATION_PREVIOUS
#define DIRENTRY_RELATION_NEXT
#define RANGELOCK_DENY_WRITE_LAST
static const ULONG OFFSET_DIRSECTORCOUNT
static void StorageBaseImpl_Invalidate(StorageBaseImpl *This)
#define STGM_CREATE_MODE(stgm)
static HRESULT StorageBaseImpl_WriteDirEntry(StorageBaseImpl *This, DirRef index, const DirEntry *data)
static const ULONG OFFSET_PS_LEFTCHILD
#define RANGELOCK_NOSNAPSHOT_LAST
static const ULONG OFFSET_SMALLBLOCKLIMIT
static HRESULT StorageBaseImpl_StreamLink(StorageBaseImpl *This, DirRef dst, DirRef src)
static HRESULT StorageBaseImpl_LockTransaction(StorageBaseImpl *This, BOOL write)
static const ULONG OFFSET_PS_MTIMELOW
static HRESULT StorageBaseImpl_StreamReadAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, void *buffer, ULONG *bytesRead)
static HRESULT StorageBaseImpl_StreamWriteAt(StorageBaseImpl *This, DirRef index, ULARGE_INTEGER offset, ULONG size, const void *buffer, ULONG *bytesWritten)
static const ULONG OFFSET_EXTBBDEPOTCOUNT
static const WORD DEF_SMALL_BLOCK_SIZE_BITS
static const ULONG BLOCK_UNUSED
static const ULONG DIRENTRY_NULL
#define DIRENTRY_NAME_MAX_LEN
static const ULONG OFFSET_SBDEPOTSTART
static const ULONG OFFSET_PS_MTIMEHIGH
#define RANGELOCK_TRANSACTION_LAST
#define STGM_SHARE_MODE(stgm)
#define RANGELOCK_NOSNAPSHOT_FIRST
#define RAW_DIRENTRY_SIZE
static const ULONG OFFSET_BBDEPOTSTART
#define LIMIT_TO_USE_SMALL_BLOCK
#define STGM_ACCESS_MODE(stgm)
#define MAX_BIG_BLOCK_SIZE
#define RANGELOCK_WRITE_LAST
static const ULONG OFFSET_ROOTSTARTBLOCK
static const ULONG BLOCK_EXTBBDEPOT
static const ULONG OFFSET_EXTBBDEPOTSTART
#define RANGELOCK_READ_LAST
#define BLOCKCHAIN_CACHE_SIZE
static void StorageBaseImpl_Destroy(StorageBaseImpl *This)
static const ULONG OFFSET_PS_CTIMEHIGH
#define DIRENTRY_RELATION_DIR
#define RANGELOCK_DENY_READ_FIRST
#define RANGELOCK_DENY_READ_LAST
#define RANGELOCK_PRIORITY1_FIRST
#define RANGELOCK_PRIORITY2_LAST
static const ULONG BLOCK_SPECIAL
static const ULONG OFFSET_PS_SIZE_HIGH
static const WORD DEF_SMALL_BLOCK_SIZE
static const ULONG OFFSET_PS_DIRROOT
static const ULONG OFFSET_TRANSACTIONSIG
static const ULONG OFFSET_PS_NAME
#define RANGELOCK_WRITE_FIRST
static const ULONG OFFSET_SMALLBLOCKSIZEBITS
#define RANGELOCK_DENY_WRITE_FIRST
static HRESULT StorageBaseImpl_GetTransactionSig(StorageBaseImpl *This, ULONG *result, BOOL refresh)
static HRESULT StorageBaseImpl_Flush(StorageBaseImpl *This)
static const ULONG OFFSET_BBDEPOTCOUNT
#define RANGELOCK_UNK1_FIRST
static HRESULT StorageBaseImpl_SetTransactionSig(StorageBaseImpl *This, ULONG value)
static const ULONG BLOCK_END_OF_CHAIN
static const ULONG OFFSET_PS_NAMELENGTH
static const ULONG OFFSET_SBDEPOTCOUNT
#define RANGELOCK_TRANSACTION_FIRST
static const WORD MAX_BIG_BLOCK_SIZE_BITS
static const ULONG OFFSET_PS_SIZE
static const ULONG BLOCK_FIRST_SPECIAL
static HRESULT StorageBaseImpl_ReadDirEntry(StorageBaseImpl *This, DirRef index, DirEntry *data)
#define RANGELOCK_PRIORITY1_LAST
static const ULONG OFFSET_BYTEORDERMARKER
static HRESULT StorageBaseImpl_UnlockTransaction(StorageBaseImpl *This, BOOL write)
static const ULONG OFFSET_PS_RIGHTCHILD
#define COUNT_BBDEPOTINHEADER
static const ULONG OFFSET_PS_STARTBLOCK
static const ULONG OFFSET_PS_GUID
BYTE data[MAX_BIG_BLOCK_SIZE]
StorageImpl * parentStorage
struct BlockChainRun * indexCache
ULONG * headOfStreamPlaceHolder
BlockChainBlock cachedBlocks[2]
WCHAR name[DIRENTRY_NAME_MAX_LEN]
IEnumSTATSTG IEnumSTATSTG_iface
StorageBaseImpl * parentStorage
WCHAR name[DIRENTRY_NAME_MAX_LEN]
CHAR strCLSIDName[OLESTREAM_MAX_STR_LEN]
DWORD dwOleTypeNameLength
CHAR strOleTypeName[OLESTREAM_MAX_STR_LEN]
CHAR strProgIDName[OLESTREAM_MAX_STR_LEN]
DWORD dwOleTypeNameLength
CHAR strOleTypeName[OLESTREAM_MAX_STR_LEN]
CHAR * pstrOleObjFileName
DWORD dwOleObjFileNameLength
ULONG * headOfStreamPlaceHolder
StorageImpl * parentStorage
struct list StrmListEntry
StorageBaseImpl * parentStorage
IPropertySetStorage IPropertySetStorage_iface
StorageBaseImpl * transactedChild
struct StorageBaseImpl base
StorageBaseImpl * parentStorage
struct StorageBaseImpl base
struct list ParentListEntry
DirRef transactedParentEntry
DirRef newTransactedParentEntry
StorageBaseImpl * transactedParent
TransactedSnapshotImpl * scratch
TransactedDirEntry * entries
StorageBaseImpl * scratch
StorageBaseImpl * transactedParent
struct _ULARGE_INTEGER::@4266 u
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Character const *const prefix
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define CONTAINING_RECORD(address, type, field)
struct _LARGE_INTEGER::@2379 u
static GLenum _GLUfuncptr fn
DWORD WINAPI GetLastError(void)
_In_ LPCSTR _In_opt_ LPCSTR _In_ DWORD nBufferLength
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
#define STG_E_SHAREVIOLATION
#define CONVERT10_E_OLESTREAM_GET
#define STG_E_INVALIDPOINTER
#define STG_E_PATHNOTFOUND
#define ERROR_SHARING_VIOLATION
#define STG_E_LOCKVIOLATION
#define STG_E_INVALIDNAME
#define STG_E_INVALIDHEADER
#define ERROR_PATH_NOT_FOUND
#define ERROR_WRITE_PROTECT
#define STG_E_FILEALREADYEXISTS
#define STG_E_DOCFILECORRUPT
#define STG_E_FILENOTFOUND
#define ERROR_FILE_EXISTS
#define STG_E_ACCESSDENIED
#define STG_E_INVALIDPARAMETER
#define STG_E_INVALIDFLAG
#define CONVERT10_E_OLESTREAM_PUT
#define STG_E_INVALIDFUNCTION
#define STG_E_INSUFFICIENTMEMORY
#define CONVERT10_E_OLESTREAM_FMT
#define HKEY_CLASSES_ROOT
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
int WINAPI GetClipboardFormatNameW(_In_ UINT format, _Out_writes_(cchMaxCount) LPWSTR lpszFormatName, _In_ int cchMaxCount)
static unsigned int block