218 return This->numBlocks;
293 ERR(
"unknown flags %#lx\n", stgm);
384 ERR(
"Invalid share mode!\n");
405 ERR(
"Invalid access mode!\n");
423 FIXME(
"STGM_CONVERT not implemented!\n");
428 ERR(
"Invalid create mode!\n");
446 return IStorage_QueryInterface(&
This->IStorage_iface,
riid,
obj);
452 return IStorage_AddRef(&
This->IStorage_iface);
458 return IStorage_Release(&
This->IStorage_iface);
514 while (diff == 0 && *
name1 != 0)
539 currentEntry =
data->dirRootEntry;
554 currentEntry =
data->leftChild;
557 currentEntry =
data->rightChild;
582 *parentEntry = storageEntry;
601 *parentData = childData;
602 *parentEntry = childEntry;
610 *parentData = childData;
611 *parentEntry = childEntry;
629 entry->leftChild = new_target;
632 entry->rightChild = new_target;
635 entry->dirRootEntry = new_target;
650 DirRef parentStorageIndex,
771 DirRef parentStorageIndex,
777 ULONG typeOfRelation;
789 &parentEntry, &parentEntryRef, &typeOfRelation);
825 &newRightChildParentEntry);
832 newRightChildParent = newRightChildParentEntry.
rightChild;
840 &newRightChildParentEntry);
897 IStorage_Release(&
This->parentStorage->IStorage_iface);
918 *ppvObject = &
This->IEnumSTATSTG_iface;
919 IEnumSTATSTG_AddRef(&
This->IEnumSTATSTG_iface);
920 TRACE(
"<-- %p\n", *ppvObject);
924 TRACE(
"<-- E_NOINTERFACE\n");
965 This->parentStorage->storageDirEntry, &
entry);
966 searchNode =
entry.dirRootEntry;
978 searchNode =
entry.rightChild;
983 memcpy(result_name,
entry.name,
sizeof(result_name));
984 searchNode =
entry.leftChild;
993 memcpy(
This->name, result_name,
sizeof(result_name));
1004 ULONG* pceltFetched)
1009 STATSTG* currentReturnStruct = rgelt;
1010 ULONG objectFetched = 0;
1011 DirRef currentSearchNode;
1014 TRACE(
"%p, %lu, %p, %p.\n", iface, celt, rgelt, pceltFetched);
1016 if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) )
1019 if (
This->parentStorage->reverted)
1021 TRACE(
"<-- STG_E_REVERTED\n");
1029 if (pceltFetched==0)
1030 pceltFetched = &objectFetched;
1038 while ( *pceltFetched < celt )
1044 memset(currentReturnStruct, 0,
sizeof(*currentReturnStruct));
1060 currentReturnStruct,
1068 currentReturnStruct++;
1074 TRACE(
"<-- %#lx (asked %lu, got %lu)\n",
hr, celt, *pceltFetched);
1085 ULONG objectFetched = 0;
1086 DirRef currentSearchNode;
1089 TRACE(
"%p, %lu.\n", iface, celt);
1091 if (
This->parentStorage->reverted)
1093 TRACE(
"<-- STG_E_REVERTED\n");
1097 while ( (objectFetched < celt) )
1119 TRACE(
"%p\n", iface);
1121 if (
This->parentStorage->reverted)
1123 TRACE(
"<-- STG_E_REVERTED\n");
1141 TRACE(
"%p,%p\n", iface, ppenum);
1143 if (
This->parentStorage->reverted)
1145 TRACE(
"<-- STG_E_REVERTED\n");
1153 This->storageDirEntry);
1196 newEnumeration->
ref = 1;
1197 newEnumeration->
name[0] = 0;
1209 return newEnumeration;
1247 *ppvObject = &
This->IStorage_iface;
1251 *ppvObject = &
This->IPropertySetStorage_iface;
1256 *ppvObject = &
This->IDirectWriterLock_iface;
1260 TRACE(
"<-- E_NOINTERFACE\n");
1264 IStorage_AddRef(iface);
1265 TRACE(
"<-- %p\n", *ppvObject);
1283 TRACE(
"%p, refcount %lu.\n", iface,
ref);
1303 TRACE(
"%p, refcount %lu.\n", iface,
ref);
1320 SNB snbExclude,
IStorage *pstgDest);
1324 SNB snbExclude,
IStorage *pstgDest)
1343 WCHAR **snb = snbExclude;
1355 if (
data.stgType == STGTY_STORAGE && !skip_storage)
1360 hr = IStorage_CreateStorage( pstgDest,
data.name,
1370 hr = IStorage_OpenStorage( pstgDest,
data.name,
NULL,
1372 NULL, 0, &pstgTmp );
1378 skip_stream,
NULL, pstgTmp );
1380 IStorage_Release(pstgTmp);
1383 else if (
data.stgType == STGTY_STREAM && !skip_stream)
1389 hr = IStorage_CreateStream( pstgDest,
data.name,
1405 IStream_AddRef(pstrChild);
1419 IStream_Stat( pstrChild, &strStat, STATFLAG_NONAME );
1424 IStream_SetSize(pstrTmp, strStat.cbSize);
1429 hr = IStream_CopyTo( pstrChild, pstrTmp, strStat.cbSize,
1432 IStream_Release( pstrChild );
1435 IStream_Release( pstrTmp );
1442 skip_stream, snbExclude, pstgDest );
1446 skip_stream, snbExclude, pstgDest );
1456 TRACE(
"%p, %ld.\n", stg, streamEntry);
1473 TRACE(
"%p, %ld.\n", stg, storageEntry);
1477 if (childstg->
base.storageDirEntry == storageEntry)
1507 TRACE(
"%p, %s, %p, %#lx, %ld, %p.\n", iface,
debugstr_w(pwcsName), reserved1, grfMode,
reserved2, ppstm);
1509 if ( (pwcsName==
NULL) || (ppstm==0) )
1556 This->storageDirEntry,
1564 (currentEntry.
stgType==STGTY_STREAM) )
1580 IStream_AddRef(*ppstm);
1594 TRACE(
"<-- IStream %p\n", *ppstm);
1622 TRACE(
"%p, %s, %p, %#lx, %p, %ld, %p.\n", iface,
debugstr_w(pwcsName), pstgPriority,
1623 grfMode, snbExclude,
reserved, ppstg);
1625 if ((pwcsName==
NULL) || (ppstg==0) )
1638 if (snbExclude !=
NULL)
1680 This->storageDirEntry,
1685 (currentEntry.
stgType==STGTY_STORAGE) )
1699 if (newStorage != 0)
1715 *ppstg = &newStorage->
base.IStorage_iface;
1763 This->storageDirEntry);
1790 TRACE(
"%p, %p, %#lx.\n", iface, pstatstg, grfStatFlag);
1806 This->storageDirEntry,
1817 pstatstg->grfMode =
This->openFlags;
1818 pstatstg->grfStateBits =
This->stateBits;
1824 TRACE(
"<-- STATSTG: pwcsName: %s, type: %ld, cbSize.Low/High: %ld/%ld, grfMode: %#lx, grfLocksSupported: %ld, grfStateBits: %#lx\n",
debugstr_w(pstatstg->pwcsName), pstatstg->type, pstatstg->cbSize.LowPart, pstatstg->cbSize.HighPart, pstatstg->grfMode, pstatstg->grfLocksSupported, pstatstg->grfStateBits);
1846 TRACE(
"(%p, %s, %s)\n",
1853 This->storageDirEntry,
1869 This->storageDirEntry,
1878 WARN(
"Element is already open; cannot rename.\n");
1928 DirEntry currentEntry, newStreamEntry;
1929 DirRef currentEntryRef, newStreamEntryRef;
1932 TRACE(
"%p, %s, %#lx, %ld, %ld, %p.\n", iface,
debugstr_w(pwcsName), grfMode, reserved1,
reserved2, ppstm);
1979 This->storageDirEntry,
1990 IStorage_DestroyElement(iface, pwcsName);
2009 newStreamEntry.
stgType = STGTY_STREAM;
2037 This->storageDirEntry,
2053 IStream_AddRef(*ppstm);
2085 This->storageDirEntry,
2092 This->storageDirEntry,
2125 TRACE(
"%p, %s, %#lx, %ld, %ld, %p.\n", iface,
debugstr_w(pwcsName), grfMode,
2144 WARN(
"bad grfMode: %#lx\n", grfMode);
2157 WARN(
"access denied\n");
2162 This->storageDirEntry,
2175 hr = IStorage_DestroyElement(iface, pwcsName);
2181 WARN(
"file already exists\n");
2188 WARN(
"read-only storage\n");
2198 FIXME(
"name too long\n");
2204 newEntry.
stgType = STGTY_STORAGE;
2232 This->storageDirEntry,
2243 hr = IStorage_OpenStorage(iface, pwcsName, 0, grfMode, 0, 0, ppstg);
2258 SNB snbExclude,
IStorage *pstgDest)
2266 hr = IStorage_SetClass( pstgDest, &
data.clsid );
2270 skip_stream, snbExclude, pstgDest );
2282 const IID* rgiidExclude,
2291 TRACE(
"%p, %ld, %p, %p, %p.\n", iface, ciidExclude, rgiidExclude, snbExclude, pstgDest);
2293 if ( pstgDest == 0 )
2296 for(
i = 0;
i < ciidExclude; ++
i)
2299 skip_storage =
TRUE;
2311 IStorage *pstgDestAncestor = pstgDest;
2315 while (pstgDestAncestor != iface) {
2316 pstgDestAncestorChild = pstgDest;
2322 pstgDestAncestor = &
snapshot->transactedParent->IStorage_iface;
2328 pstgDestAncestor = &
internal->parentStorage->IStorage_iface;
2334 if (pstgDestAncestor == iface)
2338 if (pstgDestAncestorChild && snbExclude)
2342 WCHAR **snb = snbExclude;
2346 while ( *snb !=
NULL && fail )
2360 skip_storage, skip_stream, snbExclude, pstgDest );
2373 FIXME(
"%p, %s, %p, %s, %#lx: stub\n", iface,
debugstr_w(pwcsName), pstgDest,
2388 DWORD grfCommitFlags)
2391 TRACE(
"%p, %#lx.\n", iface, grfCommitFlags);
2403 TRACE(
"(%p)\n", iface);
2421 STATSTG currentElement;
2426 TRACE(
"%p, %ld.\n", parentStorage, indexToDelete);
2431 if (stg->
base.storageDirEntry == indexToDelete)
2440 hr = IStorage_OpenStorage(
2442 entryDataToDelete.
name,
2458 hr = IStorage_EnumElements(childStorage, 0, 0, 0, &elements);
2461 IStorage_Release(childStorage);
2471 hr = IEnumSTATSTG_Next(elements, 1, ¤tElement,
NULL);
2474 destroyHr = IStorage_DestroyElement(childStorage, currentElement.pwcsName);
2483 IEnumSTATSTG_Reset(elements);
2485 }
while ((
hr ==
S_OK) && (destroyHr ==
S_OK));
2487 IStorage_Release(childStorage);
2488 IEnumSTATSTG_Release(elements);
2514 if (strm->
dirEntry == indexToDelete)
2516 TRACE(
"Stream deleted %p\n", strm);
2537 hr = IStream_SetSize(pis,
size);
2548 IStream_Release(pis);
2589 This->storageDirEntry,
2595 TRACE(
"<-- STG_E_FILENOTFOUND\n");
2599 if ( entryToDelete.
stgType == STGTY_STORAGE )
2606 else if ( entryToDelete.
stgType == STGTY_STREAM )
2625 This->storageDirEntry,
2649 TRACE(
"Streams invalidated (stg=%p strm=%p next=%p prev=%p)\n", stg,strm,
cur->next,
cur->prev);
2694 This->stateBits = (
This->stateBits & ~grfMask) | (grfStateBits & grfMask);
2704 TRACE(
"Stream added (stg=%p strm=%p)\n", stg, strm);
2710 TRACE(
"Stream removed (stg=%p strm=%p)\n", stg,strm);
2722 ULONG bytestocopy, bytesread, byteswritten;
2741 data, &byteswritten);
2745 bytes_copied.
QuadPart += byteswritten;
2770 has_stream = (
data.stgType == STGTY_STREAM &&
data.size.QuadPart != 0);
2772 data.size.QuadPart = 0;
2922 &
This->bigBlockSizeBits);
2927 &
This->smallBlockSizeBits);
2932 &
This->bigBlockDepotCount);
2937 &
This->rootStartBlock);
2942 &
This->transactionSig);
2947 &
This->smallBlockLimit);
2952 &
This->smallBlockDepotStart);
2957 &
This->extBigBlockDepotStart);
2962 &
This->extBigBlockDepotCount);
2975 This->bigBlockSize = 0x000000001 << (
DWORD)
This->bigBlockSizeBits;
2976 This->smallBlockSize = 0x000000001 << (
DWORD)
This->smallBlockSizeBits;
2986 FIXME(
"Broken OLE storage file? bigblock=%#lx, smallblock=%#lx, sblimit=%#lx\n",
2987 This->bigBlockSize,
This->smallBlockSize,
This->smallBlockLimit);
3008 DWORD bytes_written;
3009 DWORD major_version, dirsectorcount;
3011 if (
This->bigBlockSizeBits == 0x9)
3013 else if (
This->bigBlockSizeBits == 0xc)
3017 ERR(
"invalid big block shift 0x%x\n",
This->bigBlockSizeBits);
3045 This->bigBlockSizeBits);
3050 This->smallBlockSizeBits);
3052 if (major_version >= 4)
3054 if (
This->rootBlockChain)
3072 This->bigBlockDepotCount);
3077 This->rootStartBlock);
3082 This->transactionSig);
3087 This->smallBlockLimit);
3092 This->smallBlockDepotStart);
3097 This->smallBlockDepotChain ?
3103 This->extBigBlockDepotStart);
3108 This->extBigBlockDepotCount);
3143 This->rootBlockChain,
3170 This->rootBlockChain,
3286 ULONG currentEntryIndex = 0;
3290 WORD sizeOfNameString;
3305 if (sizeOfNameString == 0)
3310 newEntryIndex = currentEntryIndex;
3318 newEntryIndex = currentEntryIndex;
3320 currentEntryIndex++;
3332 ULONG lastEntry = 0;
3333 ULONG blockCount = 0;
3363 entryIndex = newEntryIndex + 1;
3364 entryIndex < lastEntry;
3381 *
index = newEntryIndex;
3415 &
buffer->sizeOfNameString);
3440 &
buffer->ctime.dwLowDateTime);
3445 &
buffer->ctime.dwHighDateTime);
3450 &
buffer->mtime.dwLowDateTime);
3455 &
buffer->mtime.dwHighDateTime);
3467 if (
This->bigBlockSize < 4096)
3470 buffer->size.HighPart = 0;
3529 if (out_read) *out_read =
read;
3563 return (wrote ==
This->bigBlockSize);
3580 return (wrote ==
sizeof(
DWORD));
3595 ULONG cbRead, cbWritten;
3613 if(!bbTempChain)
return NULL;
3652 offset.LowPart += cbRead;
3667 ERR(
"conversion failed: resRead = %#lx, resWrite = %#lx\n", resRead, resWrite);
3676 streamEntryRef = (*ppsbChain)->ownerDirEntry;
3700 return bigBlockChain;
3752 cbRead,
buffer, &cbWritten);
3757 offset.LowPart += cbRead;
3772 ERR(
"conversion failed: resRead = %#lx, resWrite = %#lx\n", resRead, resWrite);
3779 streamEntryRef = (*ppbbChain)->ownerDirEntry;
3803 ULONG rangeLockDepot = rangeLockIndex / blocksPerDepot;
3811 if (depotIndex == rangeLockDepot)
3828 ULONG depotBlocksPerExtBlock = (
This->bigBlockSize /
sizeof(
ULONG)) - 1;
3830 ULONG extBlockCount = numExtBlocks / depotBlocksPerExtBlock;
3831 ULONG extBlockOffset = numExtBlocks % depotBlocksPerExtBlock;
3833 ULONG extBlockIndex;
3839 if (extBlockCount >=
This->extBigBlockDepotCount)
3842 if (
This->indexExtBlockDepotCached != extBlockCount)
3844 extBlockIndex =
This->extBigBlockDepotLocations[extBlockCount];
3853 This->extBlockDepotCached[
index] = blockIndex;
3856 This->indexExtBlockDepotCached = extBlockCount;
3859 blockIndex =
This->extBlockDepotCached[extBlockOffset];
3873 ULONG depotBlocksPerExtBlock = (
This->bigBlockSize /
sizeof(
ULONG)) - 1;
3875 ULONG extBlockCount = numExtBlocks / depotBlocksPerExtBlock;
3876 ULONG extBlockOffset = numExtBlocks % depotBlocksPerExtBlock;
3877 ULONG extBlockIndex;
3881 assert(extBlockCount < This->extBigBlockDepotCount);
3883 extBlockIndex =
This->extBigBlockDepotLocations[extBlockCount];
3888 extBlockOffset *
sizeof(
ULONG),
3892 if (
This->indexExtBlockDepotCached == extBlockCount)
3894 This->extBlockDepotCached[extBlockOffset] = blockIndex;
3905 ULONG numExtBlocks =
This->extBigBlockDepotCount;
3906 ULONG nextExtBlock =
This->extBigBlockDepotStart;
3911 ULONG depotBlocksPerExtBlock = blocksPerDepotBlock - 1;
3914 blocksPerDepotBlock;
3928 nextExtBlock =
This->extBigBlockDepotLocations[
This->extBigBlockDepotCount-1];
3944 if (
This->extBigBlockDepotLocationsSize == numExtBlocks)
3946 ULONG new_cache_size = (
This->extBigBlockDepotLocationsSize+1)*2;
3949 memcpy(new_cache,
This->extBigBlockDepotLocations,
sizeof(
ULONG) *
This->extBigBlockDepotLocationsSize);
3952 This->extBigBlockDepotLocations = new_cache;
3953 This->extBigBlockDepotLocationsSize = new_cache_size;
3955 This->extBigBlockDepotLocations[numExtBlocks] =
index;
3987 ULONG* nextBlockIndex)
3989 ULONG offsetInDepot = blockIndex *
sizeof (
ULONG);
3990 ULONG depotBlockCount = offsetInDepot /
This->bigBlockSize;
3991 ULONG depotBlockOffset = offsetInDepot %
This->bigBlockSize;
3994 ULONG depotBlockIndexPos;
3999 if(depotBlockCount >=
This->bigBlockDepotCount)
4001 WARN(
"depotBlockCount %ld, bigBlockDepotCount %ld\n", depotBlockCount,
This->bigBlockDepotCount);
4008 if (depotBlockCount !=
This->indexBlockDepotCached)
4010 This->indexBlockDepotCached = depotBlockCount;
4014 depotBlockIndexPos =
This->bigBlockDepotStart[depotBlockCount];
4034 This->blockDepotCached[
index] = *nextBlockIndex;
4038 *nextBlockIndex =
This->blockDepotCached[depotBlockOffset/
sizeof(
ULONG)];
4066 return nextBlockIndex;
4088 ULONG offsetInDepot = blockIndex *
sizeof (
ULONG);
4089 ULONG depotBlockCount = offsetInDepot /
This->bigBlockSize;
4090 ULONG depotBlockOffset = offsetInDepot %
This->bigBlockSize;
4091 ULONG depotBlockIndexPos;
4093 assert(depotBlockCount < This->bigBlockDepotCount);
4094 assert(blockIndex != nextBlock);
4101 ERR(
"Using range lock page\n");
4105 depotBlockIndexPos =
This->bigBlockDepotStart[depotBlockCount];
4120 if (depotBlockCount ==
This->indexBlockDepotCached)
4122 This->blockDepotCached[depotBlockOffset/
sizeof(
ULONG)] = nextBlock;
4136 ULONG depotBlockIndexPos;
4138 ULONG depotBlockOffset;
4147 depotIndex =
This->prevFreeBlock / blocksPerDepot;
4148 depotBlockOffset = (
This->prevFreeBlock % blocksPerDepot) *
sizeof(
ULONG);
4157 depotBlockIndexPos =
This->bigBlockDepotStart[depotIndex];
4164 depotBlockIndexPos = depotIndex*blocksPerDepot;
4170 This->bigBlockDepotCount++;
4171 This->bigBlockDepotStart[depotIndex] = depotBlockIndexPos;
4196 ULONG extBlockOffset = numExtBlocks % (blocksPerDepot - 1);
4198 if (extBlockOffset == 0)
4203 This->extBigBlockDepotCount++;
4204 depotBlockIndexPos = extIndex + 1;
4207 depotBlockIndexPos = depotIndex * blocksPerDepot;
4213 This->bigBlockDepotCount++;
4237 while ( ( (depotBlockOffset/
sizeof(
ULONG) ) < blocksPerDepot) &&
4244 freeBlock = (depotIndex * blocksPerDepot) +
4245 (depotBlockOffset/
sizeof(
ULONG));
4248 depotBlockOffset +=
sizeof(
ULONG);
4253 depotBlockOffset = 0;
4261 ILockBytes_Stat(
This->lockBytes, &statstg, STATFLAG_NONAME);
4263 if (neededSize.
QuadPart > statstg.cbSize.QuadPart)
4264 ILockBytes_SetSize(
This->lockBytes, neededSize);
4266 This->prevFreeBlock = freeBlock;
4282 if (blockIndex < This->prevFreeBlock)
4283 This->prevFreeBlock = blockIndex;
4307 if (!
This->blockChainCache[
i])
4309 return &
This->blockChainCache[
i];
4313 i =
This->blockChainToEvict;
4318 This->blockChainToEvict++;
4320 This->blockChainToEvict = 0;
4322 return &
This->blockChainCache[
i];
4328 int i, free_index=-1;
4332 if (!
This->blockChainCache[
i])
4334 if (free_index == -1) free_index =
i;
4336 else if (
This->blockChainCache[
i]->ownerDirEntry ==
index)
4338 return &
This->blockChainCache[
i];
4342 if (free_index == -1)
4344 free_index =
This->blockChainToEvict;
4347 This->blockChainCache[free_index] =
NULL;
4349 This->blockChainToEvict++;
4351 This->blockChainToEvict = 0;
4355 return &
This->blockChainCache[free_index];
4364 if (
This->blockChainCache[
i] &&
This->blockChainCache[
i]->ownerDirEntry ==
index)
4384 if (
data.size.QuadPart == 0)
4392 bytesToRead =
data.size.QuadPart -
offset.QuadPart;
4445 if (
data.size.QuadPart == 0)
4455 bigblock = *pbigblock;
4467 bigblock = *pbigblock;
4482 *pbigblock = bigblock;
4506 data.size = newsize;
4599 ILockBytes_SetSize(
This->lockBytes,
size);
4609 sizeof(
This->bigBlockDepotStart));
4611 This->bigBlockDepotCount = 1;
4612 This->bigBlockDepotStart[0] = 0;
4613 This->rootStartBlock = 1;
4616 if (
This->bigBlockSize == 4096)
4622 This->extBigBlockDepotCount = 0;
4630 size.LowPart =
This->bigBlockSize * 3;
4631 ILockBytes_SetSize(
This->lockBytes,
size);
4657 This->indexBlockDepotCached = 0xFFFFFFFF;
4658 This->indexExtBlockDepotCached = 0xFFFFFFFF;
4663 This->prevFreeBlock = 0;
4665 This->firstFreeSmallBlock = 0;
4668 if (
This->extBigBlockDepotCount != 0)
4670 ULONG current_block =
This->extBigBlockDepotStart;
4671 ULONG cache_size =
This->extBigBlockDepotCount * 2;
4675 if (!
This->extBigBlockDepotLocations)
4680 This->extBigBlockDepotLocationsSize = cache_size;
4682 for (
i=0;
i<
This->extBigBlockDepotCount;
i++)
4686 WARN(
"File has too few extended big block depot blocks.\n");
4689 This->extBigBlockDepotLocations[
i] = current_block;
4695 This->extBigBlockDepotLocations =
NULL;
4696 This->extBigBlockDepotLocationsSize = 0;
4702 if(!(blockChainStream =
4709 This->rootBlockChain = blockChainStream;
4711 if(!(blockChainStream =
4719 This->smallBlockDepotChain = blockChainStream;
4730 memset(&rootEntry, 0,
sizeof(rootEntry));
4747 currentEntryRef = 0;
4761 This->base.storageDirEntry = currentEntryRef;
4777 if(!(blockChainStream =
4784 This->smallBlockRootChain = blockChainStream;
4804 DWORD oldTransactionSig =
This->transactionSig;
4820 if (oldTransactionSig !=
This->transactionSig)
4823 TRACE(
"signature changed\n");
4829 This->transactionSig = oldTransactionSig;
4852 if ((dwLockType &
This->locks_supported) == 0)
4854 if (supported) *supported =
FALSE;
4858 if (supported) *supported =
TRUE;
4859 return ILockBytes_LockRegion(
This->lockBytes,
offset,
cb, dwLockType);
4865 if ((dwLockType &
This->locks_supported) == 0)
4868 return ILockBytes_UnlockRegion(
This->lockBytes,
offset,
cb, dwLockType);
4878 DWORD last_sanity_check = start_time;
4891 if (current_time - start_time >= 20000)
4896 if (current_time - last_sanity_check >= 500)
4915 last_sanity_check = current_time;
4918 if (delay < 150) delay++;
4977 hr = ILockBytes_Stat(
This->lockBytes, &statstg, 0);
4979 *
result = statstg.pwcsName;
5022 if (
This->locked_bytes[
j] == 0)
5024 This->locked_bytes[
j] =
i;
5039 BOOL supported, ro_denyw;
5056 if (!supported)
return S_OK;
5131 if (
This->blockChainCache[
i])
5135 hr = ILockBytes_Flush(
This->lockBytes);
5172 if (
This->locked_bytes[
i] != 0)
5179 if (
This->lockBytes)
5180 ILockBytes_Release(
This->lockBytes);
5262 This->base.openFlags = (openFlags & ~STGM_CREATE);
5284 This->lockBytes = pLkbyt;
5285 ILockBytes_AddRef(pLkbyt);
5289 hr = ILockBytes_Stat(
This->lockBytes, &
stat, STATFLAG_NONAME);
5293 This->locks_supported =
stat.grfLocksSupported;
5296 This->locks_supported &= ~WINE_LOCK_READ;
5306 IStorage_Release(&
This->base.IStorage_iface);
5327 if (!
This->base.reverted)
5329 TRACE(
"Storage invalidated (stg=%p)\n",
This);
5465 DWORD grfCommitFlags)
5468 TRACE(
"%p, %#lx.\n", iface, grfCommitFlags);
5480 FIXME(
"(%p): stub\n", iface);
5550 newStorage->
base.openFlags = (openFlags & ~STGM_CREATE);
5554 newStorage->
base.ref = 1;
5561 newStorage->
base.storageDirEntry = storageDirEntry;
5580 while (result < This->entries_size &&
This->entries[
result].inuse)
5594 This->entries = new_entries;
5617 entry->newTransactedParentEntry =
entry->transactedParentEntry = parentEntryRef;
5622 return stubEntryRef;
5634 This->entries[
entry].transactedParentEntry,
5681 new_entrydata.
name[0] =
'S';
5683 new_entrydata.
stgType = STGTY_STREAM;
5696 This->transactedParent,
This->entries[
entry].transactedParentEntry);
5713 This->entries[delete_ref].deleted =
TRUE;
5738 entry->parent = prev;
5745 entry->parent = prev;
5752 entry->parent = prev;
5794 This->entries[
entry].newTransactedParentEntry !=
This->entries[
entry].transactedParentEntry;
5807 if (!
This->entries[
This->base.storageDirEntry].read)
5810 cursor =
This->entries[
This->base.storageDirEntry].data.dirRootEntry;
5823 if (
entry->stream_dirty)
5828 entry->newTransactedParentEntry);
5830 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5847 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5865 entry->newTransactedParentEntry =
entry->transactedParentEntry;
5885 &
entry->newTransactedParentEntry);
5892 if (
entry->stream_dirty)
5895 This->transactedParent,
entry->newTransactedParentEntry,
5898 else if (
entry->data.size.QuadPart)
5901 This->transactedParent,
entry->newTransactedParentEntry,
5902 entry->transactedParentEntry);
5922 DWORD grfCommitFlags)
5930 ULONG transactionSig;
5934 TRACE(
"%p, %#lx.\n", iface, grfCommitFlags);
5947 if (transactionSig !=
This->lastTransactionSig)
5949 ERR(
"file was externally modified\n");
5955 This->lastTransactionSig = transactionSig+1;
5970 root_entry = &
This->entries[
This->base.storageDirEntry];
5972 if (!root_entry->
read)
5992 data.dirRootEntry = dir_root_ref;
6009 for (
i=0;
i<
This->entries_size;
i++)
6019 entry->transactedParentEntry);
6023 else if (
entry->read &&
entry->transactedParentEntry !=
entry->newTransactedParentEntry)
6027 entry->transactedParentEntry);
6028 if (
entry->stream_dirty)
6035 entry->transactedParentEntry =
entry->newTransactedParentEntry;
6062 TRACE(
"(%p)\n", iface);
6069 for (
i=0;
i<
This->entries_size;
i++)
6071 if (
This->entries[
i].stream_dirty)
6082 This->firstFreeEntry = 0;
6090 if (!
This->reverted)
6092 TRACE(
"Storage invalidated (stg=%p)\n",
This);
6104 IStorage_Revert(&
This->base.IStorage_iface);
6105 IStorage_Release(&
This->transactedParent->IStorage_iface);
6106 IStorage_Release(&
This->scratch->IStorage_iface);
6135 new_entry = &
This->entries[new_ref];
6166 if (
index !=
This->base.storageDirEntry)
6170 if (
data->size.QuadPart == 0 &&
6179 This->entries[delete_ref].deleted =
TRUE;
6184 TRACE(
"<-- S_OK\n");
6214 This->entries[
index].data.size.QuadPart != 0)
6279 This->entries[
index].data.size.QuadPart,
6321 This->entries[delete_ref].deleted =
TRUE;
6332 This->entries[
index].stream_entry, newsize);
6336 This->entries[
index].data.size = newsize;
6364 src_entry = &
This->entries[
src];
6457 list_init(&(*result)->base.storageHead);
6459 (*result)->base.ref = 1;
6461 (*result)->base.openFlags = parentStorage->
openFlags;
6473 ULONG num_entries = 20;
6476 (*result)->entries_size = num_entries;
6477 (*result)->firstFreeEntry = 0;
6479 if ((*result)->entries)
6482 (*result)->transactedParent = parentStorage;
6490 IStorage_Release(scratch);
6511 if (!
This->reverted)
6513 TRACE(
"Storage invalidated (stg=%p)\n",
This);
6526 IStorage_Release(&
This->transactedParent->IStorage_iface);
6527 IStorage_Release(&
This->scratch->base.IStorage_iface);
6640 DWORD grfCommitFlags)
6643 DirRef new_storage_ref, prev_storage_ref;
6646 ULONG transactionSig;
6648 TRACE(
"%p, %#lx\n", iface, grfCommitFlags);
6661 if ((grfCommitFlags & STGC_ONLYIFCURRENT) && transactionSig !=
This->lastTransactionSig)
6709 hr = IStorage_Commit(&
This->scratch->base.IStorage_iface, STGC_DEFAULT);
6713 This->lastTransactionSig = transactionSig+1;
6725 TRACE(
"(%p)\n", iface);
6730 return IStorage_Revert(&
This->scratch->base.IStorage_iface);
6793 list_init(&(*result)->base.storageHead);
6795 (*result)->base.ref = 1;
6797 (*result)->base.openFlags = parentStorage->
openFlags;
6825 hr = IStorage_Commit(scratch, STGC_DEFAULT);
6827 (*result)->base.storageDirEntry = (*result)->scratch->base.storageDirEntry;
6828 (*result)->transactedParent = parentStorage;
6832 IStorage_Release(scratch);
6851 if (parentStorage->
openFlags & fixme_flags)
6853 fixme_flags &= ~parentStorage->openFlags;
6890 IStorage_Release(&newStorage->
base.IStorage_iface);
6892 *
result = newTransactedStorage;
6937#ifdef WORDS_BIGENDIAN
6950#ifdef WORDS_BIGENDIAN
6981 STATSTG* destination,
6991 destination->pwcsName = 0;
6994 else if( ((statFlags & STATFLAG_NONAME) != 0) ||
6997 destination->pwcsName = 0;
7001 destination->pwcsName =
7011 destination->type = STGTY_STORAGE;
7014 destination->type = STGTY_STREAM;
7017 destination->type = STGTY_STREAM;
7021 destination->cbSize =
source->size;
7027 destination->grfMode = 0;
7028 destination->grfLocksSupported = 0;
7029 destination->clsid =
source->clsid;
7030 destination->grfStateBits = 0;
7031 destination->reserved = 0;
7052 if (
This->headOfStreamPlaceHolder != 0)
7053 return *(
This->headOfStreamPlaceHolder);
7058 This->parentStorage,
7059 This->ownerDirEntry,
7072 ULONG next_sector, next_offset;
7076 if (
This->indexCacheLen == 0)
7084 last_run = &
This->indexCache[
This->indexCacheLen-1];
7097 if (
This->indexCacheSize == 0)
7101 This->indexCacheSize = 16;
7103 else if (
This->indexCacheSize ==
This->indexCacheLen)
7114 This->indexCache = new_cache;
7118 This->indexCacheLen++;
7119 last_run = &
This->indexCache[
This->indexCacheLen-1];
7132 if (
This->indexCacheLen)
7140 This->numBlocks = 0;
7149 ULONG min_offset = 0, max_offset =
This->numBlocks-1;
7150 ULONG min_run = 0, max_run =
This->indexCacheLen-1;
7155 while (min_run < max_run)
7157 ULONG run_to_check = min_run + (
offset - min_offset) * (max_run - min_run) / (max_offset - min_offset);
7158 if (offset < This->indexCache[run_to_check].
firstOffset)
7160 max_offset =
This->indexCache[run_to_check].firstOffset-1;
7161 max_run = run_to_check-1;
7163 else if (
offset >
This->indexCache[run_to_check].lastOffset)
7165 min_offset =
This->indexCache[run_to_check].lastOffset+1;
7166 min_run = run_to_check+1;
7170 min_run = max_run = run_to_check;
7173 return This->indexCache[min_run].firstSector +
offset -
This->indexCache[min_run].firstOffset;
7196 if (
This->cachedBlocks[0].index == 0xffffffff)
7198 else if (
This->cachedBlocks[1].index == 0xffffffff)
7203 if (
This->blockToEvict == 2)
7204 This->blockToEvict = 0;
7225 ULONG* headOfStreamPlaceHolder,
7262 if (
This->cachedBlocks[
i].dirty)
7298 numBlocks = newSize.
QuadPart /
This->parentStorage->bigBlockSize;
7300 if ((newSize.
QuadPart %
This->parentStorage->bigBlockSize) != 0)
7312 This->parentStorage,
7316 This->tailIndex = blockIndex;
7320 if (
This->headOfStreamPlaceHolder != 0)
7330 This->parentStorage,
7331 This->ownerDirEntry,
7337 This->parentStorage,
7338 This->ownerDirEntry,
7345 This->numBlocks = numBlocks;
7350 while (
This->indexCacheLen &&
This->indexCache[
This->indexCacheLen-1].lastOffset >= numBlocks)
7356 This->indexCacheLen--;
7366 if (
This->cachedBlocks[
i].index >= numBlocks)
7368 This->cachedBlocks[
i].index = 0xffffffff;
7384 ULONG blockIndex, currentBlock;
7386 ULONG oldNumBlocks = 0;
7400 if (
This->headOfStreamPlaceHolder != 0)
7402 *(
This->headOfStreamPlaceHolder) = blockIndex;
7410 This->parentStorage,
7411 This->ownerDirEntry,
7417 This->parentStorage,
7418 This->ownerDirEntry,
7422 This->tailIndex = blockIndex;
7423 This->numBlocks = 1;
7429 newNumBlocks = newSize.
QuadPart /
This->parentStorage->bigBlockSize;
7431 if ((newSize.
QuadPart %
This->parentStorage->bigBlockSize) != 0)
7439 currentBlock = blockIndex;
7444 currentBlock = blockIndex;
7451 This->tailIndex = currentBlock;
7454 currentBlock =
This->tailIndex;
7455 oldNumBlocks =
This->numBlocks;
7460 if (oldNumBlocks < newNumBlocks)
7462 while (oldNumBlocks < newNumBlocks)
7467 This->parentStorage,
7472 This->parentStorage,
7476 currentBlock = blockIndex;
7480 This->tailIndex = blockIndex;
7481 This->numBlocks = newNumBlocks;
7501 if(
This->headOfStreamPlaceHolder ==
NULL)
7507 This->parentStorage,
7508 This->ownerDirEntry,
7511 return chainEntry.
size;
7523 This->parentStorage->bigBlockSize;
7573 ULONG blockNoInSequence =
offset.QuadPart /
This->parentStorage->bigBlockSize;
7574 ULONG offsetInBlock =
offset.QuadPart %
This->parentStorage->bigBlockSize;
7575 ULONG bytesToReadInBuffer;
7610 bytesToReadInBuffer =
7611 min(
This->parentStorage->bigBlockSize - offsetInBlock,
size);
7627 bytesToReadInBuffer,
7632 if (!cachedBlock->
read)
7641 memcpy(bufferWalker, cachedBlock->
data+offsetInBlock, bytesToReadInBuffer);
7642 bytesReadAt = bytesToReadInBuffer;
7645 blockNoInSequence++;
7646 bufferWalker += bytesReadAt;
7647 size -= bytesReadAt;
7648 *bytesRead += bytesReadAt;
7651 if (bytesToReadInBuffer != bytesReadAt)
7670 ULONG blockNoInSequence =
offset.QuadPart /
This->parentStorage->bigBlockSize;
7671 ULONG offsetInBlock =
offset.QuadPart %
This->parentStorage->bigBlockSize;
7674 const BYTE* bufferWalker;
7684 DWORD bytesWrittenAt;
7690 min(
This->parentStorage->bigBlockSize - offsetInBlock,
size);
7698 ERR(
"not enough blocks in chain to write data\n");
7716 if (!cachedBlock->
read && bytesToWrite !=
This->parentStorage->bigBlockSize)
7723 memcpy(cachedBlock->
data+offsetInBlock, bufferWalker, bytesToWrite);
7724 bytesWrittenAt = bytesToWrite;
7729 blockNoInSequence++;
7730 bufferWalker += bytesWrittenAt;
7731 size -= bytesWrittenAt;
7735 if (bytesWrittenAt != bytesToWrite)
7749 ULONG* headOfStreamPlaceHolder,
7780 if (
This->headOfStreamPlaceHolder !=
NULL)
7781 return *(
This->headOfStreamPlaceHolder);
7783 if (
This->ownerDirEntry)
7786 This->parentStorage,
7787 This->ownerDirEntry,
7809 ULONG* nextBlockInChain)
7824 This->parentStorage->smallBlockDepotChain,
7825 offsetOfBlockInDepot,
7867 This->parentStorage->smallBlockDepotChain,
7868 offsetOfBlockInDepot,
7899 ULONG blockIndex =
This->parentStorage->firstFreeSmallBlock;
7902 ULONG smallBlocksPerBigBlock;
7904 ULONG blocksRequired;
7917 This->parentStorage->smallBlockDepotChain,
7918 offsetOfBlockInDepot,
7957 This->parentStorage->firstFreeSmallBlock = blockIndex+1;
7959 smallBlocksPerBigBlock =
7960 This->parentStorage->bigBlockSize /
This->parentStorage->smallBlockSize;
7965 blocksRequired = (blockIndex / smallBlocksPerBigBlock) + 1;
7974 This->parentStorage->smallBlockRootChain,
7978 This->parentStorage,
7979 This->parentStorage->base.storageDirEntry,
7982 rootEntry.
size = size_required;
7985 This->parentStorage,
7986 This->parentStorage->base.storageDirEntry,
8009 ULONG blockNoInSequence =
8012 ULONG offsetInBlock =
offset.LowPart %
This->parentStorage->smallBlockSize;
8013 ULONG bytesToReadInBuffer;
8015 ULONG bytesReadFromBigBlockFile;
8042 blockNoInSequence--;
8055 bytesToReadInBuffer =
8056 min(
This->parentStorage->smallBlockSize - offsetInBlock,
size);
8062 (
ULONGLONG)blockIndex *
This->parentStorage->smallBlockSize;
8064 offsetInBigBlockFile.
QuadPart += offsetInBlock;
8072 offsetInBigBlockFile,
8073 bytesToReadInBuffer,
8075 &bytesReadFromBigBlockFile);
8080 if (!bytesReadFromBigBlockFile)
8090 bufferWalker += bytesReadFromBigBlockFile;
8091 size -= bytesReadFromBigBlockFile;
8092 *bytesRead += bytesReadFromBigBlockFile;
8093 offsetInBlock = (offsetInBlock + bytesReadFromBigBlockFile) %
This->parentStorage->smallBlockSize;
8113 ULONG blockNoInSequence =
8116 ULONG offsetInBlock =
offset.LowPart %
This->parentStorage->smallBlockSize;
8117 ULONG bytesToWriteInBuffer;
8119 ULONG bytesWrittenToBigBlockFile;
8120 const BYTE* bufferWalker;
8137 blockNoInSequence--;
8150 bytesToWriteInBuffer =
8151 min(
This->parentStorage->smallBlockSize - offsetInBlock,
size);
8157 (
ULONGLONG)blockIndex *
This->parentStorage->smallBlockSize;
8159 offsetInBigBlockFile.
QuadPart += offsetInBlock;
8165 This->parentStorage->smallBlockRootChain,
8166 offsetInBigBlockFile,
8167 bytesToWriteInBuffer,
8169 &bytesWrittenToBigBlockFile);
8179 bufferWalker += bytesWrittenToBigBlockFile;
8180 size -= bytesWrittenToBigBlockFile;
8182 offsetInBlock = (offsetInBlock + bytesWrittenToBigBlockFile) %
This->parentStorage->smallBlockSize;
8197 ULONG blockIndex, extraBlock;
8201 numBlocks = newSize.
LowPart /
This->parentStorage->smallBlockSize;
8203 if ((newSize.
LowPart %
This->parentStorage->smallBlockSize) != 0)
8211 while (
count < numBlocks)
8228 This->ownerDirEntry,
8234 This->ownerDirEntry,
8240 extraBlock = blockIndex;
8265 This->parentStorage->firstFreeSmallBlock =
min(
This->parentStorage->firstFreeSmallBlock, extraBlock);
8266 extraBlock = blockIndex;
8281 ULONG blockIndex, currentBlock;
8283 ULONG oldNumBlocks = 0;
8298 if (
This->headOfStreamPlaceHolder !=
NULL)
8300 *(
This->headOfStreamPlaceHolder) = blockIndex;
8316 currentBlock = blockIndex;
8321 newNumBlocks = newSize.
LowPart /
This->parentStorage->smallBlockSize;
8323 if ((newSize.
LowPart %
This->parentStorage->smallBlockSize) != 0)
8332 currentBlock = blockIndex;
8340 while (oldNumBlocks < newNumBlocks)
8350 currentBlock = blockIndex;
8407 blockIndex, &blockIndex)))
8423 if(
This->headOfStreamPlaceHolder !=
NULL)
8429 This->parentStorage->smallBlockSize;
8435 This->parentStorage,
8436 This->ownerDirEntry,
8439 return chainEntry.
size;
8461 DWORD fileAttributes;
8500 memset(tempPath, 0,
sizeof(tempPath));
8501 memset(tempFileName, 0,
sizeof(tempFileName));
8507 pwcsName = tempFileName;
8573 TRACE(
"<-- %p r = %#lx\n", *ppstgOpen,
hr);
8612 return create_storagefile(pwcsName, grfMode, 0, &stgoptions, &IID_IStorage, (
void**)ppstgOpen);
8620 TRACE(
"%s, %#lx, %#lx, %#lx, %p, %p, %p, %p.\n",
debugstr_w(pwcsName),
8621 grfMode, stgfmt, grfAttrs, pStgOptions,
reserved,
riid, ppObjectOpen);
8625 ERR(
"grfAttrs must be 0 if stgfmt != STGFMT_FILE\n");
8631 ERR(
"grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_FILE\n");
8637 ERR(
"Cannot use STGFMT_FILE - this is NTFS only\n");
8645 if (!pStgOptions) pStgOptions = &defaultOptions;
8650 ERR(
"Invalid stgfmt argument\n");
8659 TRACE(
"%s, %#lx, %#lx, %#lx, %p, %p, %p, %p.\n",
debugstr_w(pwcsName),
8660 grfMode, stgfmt, grfAttrs, pStgOptions,
reserved,
riid, ppObjectOpen);
8664 ERR(
"grfAttrs must be 0 if stgfmt != STGFMT_DOCFILE\n");
8671 ERR(
"Cannot use STGFMT_FILE - this is NTFS only\n");
8680 ERR(
"grfAttrs must be 0 or FILE_FLAG_NO_BUFFERING if stgfmt == STGFMT_DOCFILE\n");
8683 FIXME(
"Stub: calling StgOpenStorage, but ignoring pStgOptions and grfAttrs\n");
8687 WARN(
"STGFMT_ANY assuming storage\n");
8716 TRACE(
"%s, %p, %#lx, %p, %ld, %p.\n",
debugstr_w(pwcsName), pstgPriority, grfMode,
8724 pwcsName = temp_name;
8883 if (pstgPriority) IStorage_Release(pstgPriority);
8884 TRACE(
"<-- %#lx, IStorage %p\n",
hr, ppstgOpen ? *ppstgOpen :
NULL);
8900 if ((ppstgOpen == 0) || (plkbyt == 0))
8940 if ((plkbyt == 0) || (ppstgOpen == 0))
8989 r = IStorage_SetElementTimes(stg,
NULL, pctime, patime, pmtime);
8990 IStorage_Release(stg);
9017 IUnknown_Release((
IUnknown*)*ppvObj);
9020 res=IPersistStream_Load(xstm,pStm);
9021 IPersistStream_Release(xstm);
9042 TRACE(
"(%p,%p)\n",pPStm,pStm);
9044 res=IPersistStream_GetClassID(pPStm,&
clsid);
9052 res=IPersistStream_Save(pPStm,pStm,
TRUE);
9055 TRACE(
"Finished Save\n");
9081 static const DWORD version_magic = 0x02000001;
9088 struct empty_1ole_stream {
9089 DWORD version_magic;
9091 DWORD update_options;
9093 DWORD mon_stream_size;
9186 static const BYTE unknown1[12] =
9187 { 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
9188 0xFF, 0xFF, 0xFF, 0xFF};
9189 static const BYTE unknown2[16] =
9190 { 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
9191 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
9198 r = IStorage_CreateStream(pstg,
L"\1CompObj",
9204 r = IStream_Write(pstm, unknown1,
sizeof(unknown1),
NULL);
9216 r = IStream_Write(pstm, unknown2,
sizeof(unknown2),
NULL);
9218 IStream_Release( pstm );
9231 WCHAR szwClipName[0x40];
9247 r = IStorage_Stat(pstg, &
stat, STATFLAG_NONAME);
9258 cf ? szwClipName :
NULL, wstrProgID );
9273 unsigned char unknown1[12];
9274 unsigned char unknown2[16];
9279 TRACE(
"(%p,%p,%p)\n", pstg, pcf, lplpszUserType);
9284 WARN(
"Failed to open stream r = %#lx\n",
r);
9289 r = IStream_Read( stm, unknown1,
sizeof(unknown1), &
count );
9308 r = IStream_Read( stm, unknown2,
sizeof(unknown2), &
count );
9316 if( lplpszUserType )
9318 *lplpszUserType = szCLSIDName;
9326 IStream_Release( stm );
9335#define OLESTREAM_ID 0x501
9336#define OLESTREAM_MAX_STR_LEN 255
9408 for( nTryCnt=0;nTryCnt < max_try; nTryCnt++)
9438 if(
pData->dwTypeID != 0)
9441 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *) &(
pData->dwOleTypeNameLength),
sizeof(
pData->dwOleTypeNameLength));
9449 if(
pData->dwOleTypeNameLength > 0)
9461 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwOleObjFileNameLength),
sizeof(
pData->dwOleObjFileNameLength));
9462 if(
dwSize !=
sizeof(
pData->dwOleObjFileNameLength))
9468 if(
pData->dwOleObjFileNameLength < 1)
9469 pData->dwOleObjFileNameLength =
sizeof(
pData->dwOleObjFileNameLength);
9471 if(
pData->pstrOleObjFileName)
9486 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwMetaFileWidth),
sizeof(
pData->dwMetaFileWidth));
9494 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwMetaFileHeight),
sizeof(
pData->dwMetaFileHeight));
9504 dwSize = pOleStream->
lpstbl->Get(pOleStream, (
void *)&(
pData->dwDataLength),
sizeof(
pData->dwDataLength));
9515 pData->dwDataLength -= 8;
9525 if(
pData->dwDataLength > 0)
9592 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwOleTypeNameLength),
sizeof(
pData->dwOleTypeNameLength));
9600 if(
pData->dwOleTypeNameLength > 0)
9614 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwMetaFileWidth),
sizeof(
pData->dwMetaFileWidth));
9624 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwMetaFileHeight),
sizeof(
pData->dwMetaFileHeight));
9634 dwSize = pOleStream->
lpstbl->Put(pOleStream, (
void *)&(
pData->dwDataLength),
sizeof(
pData->dwDataLength));
9643 if(
pData->dwDataLength > 0)
9682 DWORD dwNumOfBytesWritten;
9700 hRes = IStorage_CopyTo(pTempStorage, 0,
NULL,
NULL, pDestStorage);
9701 IStorage_Release(pTempStorage);
9730 DWORD nDataLength = 0;
9744 IStorage_CopyTo(pStorage, 0,
NULL,
NULL, pTempStorage);
9745 IStorage_Release(pTempStorage);
9791 static const BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
9792 static const BYTE pCompObjUnknown2[] = {0xF4, 0x39, 0xB2, 0x71};
9795 memset(&IStorageCompObj, 0,
sizeof(IStorageCompObj));
9796 memcpy(IStorageCompObj.
byUnknown1, pCompObjUnknown1,
sizeof(pCompObjUnknown1));
9797 memcpy(IStorageCompObj.
byUnknown2, pCompObjUnknown2,
sizeof(pCompObjUnknown2));
9801 hStorageRes = IStorage_CreateStream(pStorage,
L"\1CompObj",
9803 if(hStorageRes ==
S_OK)
9859 IStream_Release(pStream);
9889 static const BYTE pOlePresStreamHeader[] =
9891 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00,
9892 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
9893 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
9894 0x00, 0x00, 0x00, 0x00
9897 static const BYTE pOlePresStreamHeaderEmpty[] =
9899 0x00, 0x00, 0x00, 0x00,
9900 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
9901 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
9902 0x00, 0x00, 0x00, 0x00
9906 hRes = IStorage_CreateStream(pStorage,
L"\2OlePres000",
9914 memset(&OlePres, 0,
sizeof(OlePres));
9916 if(dwDataLength > 0)
9918 memcpy(OlePres.
byUnknown1, pOlePresStreamHeader,
sizeof(pOlePresStreamHeader));
9919 nHeaderSize =
sizeof(pOlePresStreamHeader);
9923 memcpy(OlePres.
byUnknown1, pOlePresStreamHeaderEmpty,
sizeof(pOlePresStreamHeaderEmpty));
9924 nHeaderSize =
sizeof(pOlePresStreamHeaderEmpty);
9937 hRes = IStream_Write(pStream, OlePres.
byUnknown1, nHeaderSize,
NULL);
9940 hRes = IStream_Write(pStream, &(OlePres.
dwSize),
sizeof(OlePres.
dwSize),
NULL);
9945 IStream_Release(pStream);
9974 hRes = IStorage_CreateStream(pStorage,
L"\1Ole10Native",
9980 hRes = IStream_Write(pStream, &dwDataLength,
sizeof(dwDataLength),
NULL);
9981 hRes = IStream_Write(pStream,
pData, dwDataLength,
NULL);
9982 IStream_Release(pStream);
10014 hRes = IStorage_OpenStream(pStorage,
L"\1CompObj",
NULL,
10023 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_SET,
NULL);
10026 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_CUR ,
NULL);
10029 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_CUR ,
NULL);
10034 IStream_Read(pStream, strProgID, *
dwSize,
NULL);
10036 IStream_Release(pStream);
10045 IStorage_Stat(pStorage, &
stat, STATFLAG_NONAME);
10093 hRes = IStorage_OpenStream(pStorage,
L"\1Ole10Native",
NULL,
10105 IStream_Release(pStream);
10151 hRes = IStorage_OpenStream(pStorage,
L"\2OlePres000",
NULL,
10157 static const char strMetafilePictName[] =
"METAFILEPICT";
10164 strcpy(pOleStreamData[1].strOleTypeName, strMetafilePictName);
10170 IStream_Seek(pStream, iSeekPos, STREAM_SEEK_SET,
NULL);
10184 MetaFilePict.
mm = 8;
10187 MetaFilePict.
hMF = 0;
10191 memcpy(pOleStreamData[1].
pData, &MetaFilePict,
sizeof(MetaFilePict));
10192 IStream_Read(pStream, &(pOleStreamData[1].
pData[
sizeof(MetaFilePict)]), pOleStreamData[1].dwDataLength-
sizeof(
METAFILEPICT16),
NULL);
10194 IStream_Release(pStream);
10213 const DVTARGETDEVICE*
ptd)
10219 TRACE(
"%p %p %p\n", pOleStream, pstg,
ptd);
10221 memset(pOleStreamData, 0,
sizeof(pOleStreamData));
10225 FIXME(
"DVTARGETDEVICE is not NULL, unhandled parameter\n");
10228 if(pstg ==
NULL || pOleStream ==
NULL)
10279 for(
i=0;
i < 2;
i++)
10310 TRACE(
"%p %p\n", pstg, pOleStream);
10312 memset(pOleStreamData, 0,
sizeof(pOleStreamData));
10314 if(pstg ==
NULL || pOleStream ==
NULL)
10330 IStream_Release(pStream);
10350 for(
i=0;
i < 2;
i++)
10369 FIXME(
"%p, %x, %ld, %ld, %ld, %p, %p: stub\n", stg,
cf,
width,
height,
size, medium, olestream);
10398 IStream_Release(
stream);
10416 IStream_Release(
stream);
10423 IStream_Release(
stream);
ios_base &_STLP_CALL internal(ios_base &__s)
#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)
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, CLSID *clsid)
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progid)
static LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
HRESULT WINAPI WriteClassStm(IStream *pStm, REFCLSID rclsid)
static const BYTE STORAGE_magic[8]
HRESULT WINAPI ReadClassStm(IStream *pStm, CLSID *pclsid)
#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)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP size_t __cdecl strlen(const char *)
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 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)
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 *)
static DWORD GetCreationModeFromSTGM(DWORD stgm)
void StorageUtl_WriteDWord(void *buffer, ULONG offset, DWORD 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)
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 ULONG StorageImpl_GetNextFreeBigBlock(StorageImpl *This, ULONG neededAddNumBlocks)
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 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
HRESULT WINAPI OleConvertIStorageToOLESTREAMEx(LPSTORAGE stg, CLIPFORMAT cf, LONG width, LONG height, DWORD size, LPSTGMEDIUM medium, LPOLESTREAM olestream)
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 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)
void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID *value)
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 OLECONVERT_LoadOLE10(LPOLESTREAM pOleStream, OLECONVERT_OLESTREAM_DATA *pData, BOOL bStream1)
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)
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)
static HRESULT findTreeParent(StorageBaseImpl *storage, DirRef storageEntry, const OLECHAR *childName, DirEntry *parentData, DirRef *parentEntry, ULONG *relation)
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)
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)
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)
void StorageUtl_WriteWord(void *buffer, ULONG offset, WORD value)
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)
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)
void StorageUtl_WriteULargeInteger(void *buffer, ULONG offset, const ULARGE_INTEGER *value)
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
GLint GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
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
JBLOCKROW JDIMENSION num_blocks
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
#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 const char stream_data[]
static const struct access_res create[16]
#define cmp(status, error)
#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
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
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define CONTAINING_RECORD(address, type, field)
DWORD WINAPI GetLastError(void)
_In_ LPCSTR _In_opt_ LPCSTR _In_ DWORD nBufferLength
#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