ReactOS  0.4.13-dev-100-gc8611ae
storage32.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "objbase.h"
#include "winreg.h"
#include "winternl.h"
#include "wine/list.h"
Include dependency graph for storage32.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DirEntry
 
struct  StorageBaseImpl
 
struct  StorageBaseImplVtbl
 
struct  StorageImpl
 
struct  StgStreamImpl
 

Macros

#define DIRENTRY_NAME_MAX_LEN   0x20
 
#define DIRENTRY_NAME_BUFFER_LEN   0x40
 
#define RAW_DIRENTRY_SIZE   0x00000080
 
#define HEADER_SIZE   512
 
#define MIN_BIG_BLOCK_SIZE   0x200
 
#define MAX_BIG_BLOCK_SIZE   0x1000
 
#define DIRENTRY_RELATION_PREVIOUS   0
 
#define DIRENTRY_RELATION_NEXT   1
 
#define DIRENTRY_RELATION_DIR   2
 
#define STGTY_ROOT   0x05
 
#define COUNT_BBDEPOTINHEADER   109
 
#define LIMIT_TO_USE_SMALL_BLOCK   0x1000
 
#define STGM_ACCESS_MODE(stgm)   ((stgm)&0x0000f)
 
#define STGM_SHARE_MODE(stgm)   ((stgm)&0x000f0)
 
#define STGM_CREATE_MODE(stgm)   ((stgm)&0x0f000)
 
#define STGM_KNOWN_FLAGS
 
#define BLOCKCHAIN_CACHE_SIZE   4
 
#define RANGELOCK_UNK1_FIRST   0x7ffffe00
 
#define RANGELOCK_UNK1_LAST   0x7fffff57
 
#define RANGELOCK_PRIORITY1_FIRST   0x7fffff58
 
#define RANGELOCK_PRIORITY1_LAST   0x7fffff6b
 
#define RANGELOCK_NOSNAPSHOT_FIRST   0x7fffff6c
 
#define RANGELOCK_NOSNAPSHOT_LAST   0x7fffff7f
 
#define RANGELOCK_COMMIT   0x7fffff80
 
#define RANGELOCK_PRIORITY2_FIRST   0x7fffff81
 
#define RANGELOCK_PRIORITY2_LAST   0x7fffff91
 
#define RANGELOCK_CHECKLOCKS   0x7fffff92
 
#define RANGELOCK_READ_FIRST   0x7fffff93
 
#define RANGELOCK_READ_LAST   0x7fffffa6
 
#define RANGELOCK_WRITE_FIRST   0x7fffffa7
 
#define RANGELOCK_WRITE_LAST   0x7fffffba
 
#define RANGELOCK_DENY_READ_FIRST   0x7fffffbb
 
#define RANGELOCK_DENY_READ_LAST   0x7fffffce
 
#define RANGELOCK_DENY_WRITE_FIRST   0x7fffffcf
 
#define RANGELOCK_DENY_WRITE_LAST   0x7fffffe2
 
#define RANGELOCK_UNK2_FIRST   0x7fffffe3
 
#define RANGELOCK_UNK2_LAST   0x7fffffff
 
#define RANGELOCK_TRANSACTION_FIRST   RANGELOCK_COMMIT
 
#define RANGELOCK_TRANSACTION_LAST   RANGELOCK_CHECKLOCKS
 
#define RANGELOCK_FIRST   RANGELOCK_UNK1_FIRST
 
#define RANGELOCK_LAST   RANGELOCK_UNK2_LAST
 
#define WINE_LOCK_READ   0x80000000
 
#define htole32(x)   (x)
 
#define htole16(x)   (x)
 
#define lendian32toh(x)   (x)
 
#define lendian16toh(x)   (x)
 

Typedefs

typedef struct StorageBaseImpl StorageBaseImpl
 
typedef struct StorageBaseImplVtbl StorageBaseImplVtbl
 
typedef struct StorageImpl StorageImpl
 
typedef struct BlockChainStream BlockChainStream
 
typedef struct SmallBlockChainStream SmallBlockChainStream
 
typedef struct IEnumSTATSTGImpl IEnumSTATSTGImpl
 
typedef struct DirEntry DirEntry
 
typedef struct StgStreamImpl StgStreamImpl
 
typedef ULONG DirRef
 

Enumerations

enum  swmr_mode { SWMR_None, SWMR_Writer, SWMR_Reader }
 

Functions

HRESULT FileLockBytesImpl_Construct (HANDLE hFile, DWORD openFlags, LPCWSTR pwcsName, ILockBytes **pLockBytes) DECLSPEC_HIDDEN
 
HRESULT STORAGE_CreateOleStream (IStorage *, DWORD) DECLSPEC_HIDDEN
 
HRESULT OLECONVERT_CreateCompObjStream (LPSTORAGE pStorage, LPCSTR strOleTypeName) DECLSPEC_HIDDEN
 
static void StorageBaseImpl_Destroy (StorageBaseImpl *This)
 
static void StorageBaseImpl_Invalidate (StorageBaseImpl *This)
 
static HRESULT StorageBaseImpl_Flush (StorageBaseImpl *This)
 
static HRESULT StorageBaseImpl_GetFilename (StorageBaseImpl *This, LPWSTR *result)
 
static HRESULT StorageBaseImpl_CreateDirEntry (StorageBaseImpl *This, const DirEntry *newData, DirRef *index)
 
static HRESULT StorageBaseImpl_WriteDirEntry (StorageBaseImpl *This, DirRef index, const DirEntry *data)
 
static HRESULT StorageBaseImpl_ReadDirEntry (StorageBaseImpl *This, DirRef index, DirEntry *data)
 
static HRESULT StorageBaseImpl_DestroyDirEntry (StorageBaseImpl *This, DirRef index)
 
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 HRESULT StorageBaseImpl_StreamSetSize (StorageBaseImpl *This, DirRef index, ULARGE_INTEGER newsize)
 
static HRESULT StorageBaseImpl_StreamLink (StorageBaseImpl *This, DirRef dst, DirRef src)
 
static HRESULT StorageBaseImpl_GetTransactionSig (StorageBaseImpl *This, ULONG *result, BOOL refresh)
 
static HRESULT StorageBaseImpl_SetTransactionSig (StorageBaseImpl *This, ULONG value)
 
static HRESULT StorageBaseImpl_LockTransaction (StorageBaseImpl *This, BOOL write)
 
static HRESULT StorageBaseImpl_UnlockTransaction (StorageBaseImpl *This, BOOL write)
 
void StorageBaseImpl_AddStream (StorageBaseImpl *stg, StgStreamImpl *strm) DECLSPEC_HIDDEN
 
void StorageBaseImpl_RemoveStream (StorageBaseImpl *stg, StgStreamImpl *strm) DECLSPEC_HIDDEN
 
static StgStreamImplimpl_from_IStream (IStream *iface)
 
StgStreamImplStgStreamImpl_Construct (StorageBaseImpl *parentStorage, DWORD grfMode, DirRef dirEntry) DECLSPEC_HIDDEN
 
void StorageUtl_ReadWord (const BYTE *buffer, ULONG offset, WORD *value) DECLSPEC_HIDDEN
 
void StorageUtl_WriteWord (BYTE *buffer, ULONG offset, WORD value) DECLSPEC_HIDDEN
 
void StorageUtl_ReadDWord (const BYTE *buffer, ULONG offset, DWORD *value) DECLSPEC_HIDDEN
 
void StorageUtl_WriteDWord (BYTE *buffer, ULONG offset, DWORD value) DECLSPEC_HIDDEN
 
void StorageUtl_ReadULargeInteger (const BYTE *buffer, ULONG offset, ULARGE_INTEGER *value) DECLSPEC_HIDDEN
 
void StorageUtl_WriteULargeInteger (BYTE *buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN
 
void StorageUtl_ReadGUID (const BYTE *buffer, ULONG offset, GUID *value) DECLSPEC_HIDDEN
 
void StorageUtl_WriteGUID (BYTE *buffer, ULONG offset, const GUID *value) DECLSPEC_HIDDEN
 
void StorageUtl_CopyDirEntryToSTATSTG (StorageBaseImpl *storage, STATSTG *destination, const DirEntry *source, int statFlags) DECLSPEC_HIDDEN
 

Variables

static const ULONG OFFSET_MINORVERSION = 0x00000018
 
static const ULONG OFFSET_MAJORVERSION = 0x0000001a
 
static const ULONG OFFSET_BYTEORDERMARKER = 0x0000001c
 
static const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e
 
static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020
 
static const ULONG OFFSET_DIRSECTORCOUNT = 0x00000028
 
static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C
 
static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030
 
static const ULONG OFFSET_TRANSACTIONSIG = 0x00000034
 
static const ULONG OFFSET_SMALLBLOCKLIMIT = 0x00000038
 
static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C
 
static const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040
 
static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044
 
static const ULONG OFFSET_EXTBBDEPOTCOUNT = 0x00000048
 
static const ULONG OFFSET_BBDEPOTSTART = 0x0000004C
 
static const ULONG OFFSET_PS_NAME = 0x00000000
 
static const ULONG OFFSET_PS_NAMELENGTH = 0x00000040
 
static const ULONG OFFSET_PS_STGTYPE = 0x00000042
 
static const ULONG OFFSET_PS_LEFTCHILD = 0x00000044
 
static const ULONG OFFSET_PS_RIGHTCHILD = 0x00000048
 
static const ULONG OFFSET_PS_DIRROOT = 0x0000004C
 
static const ULONG OFFSET_PS_GUID = 0x00000050
 
static const ULONG OFFSET_PS_CTIMELOW = 0x00000064
 
static const ULONG OFFSET_PS_CTIMEHIGH = 0x00000068
 
static const ULONG OFFSET_PS_MTIMELOW = 0x0000006C
 
static const ULONG OFFSET_PS_MTIMEHIGH = 0x00000070
 
static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074
 
static const ULONG OFFSET_PS_SIZE = 0x00000078
 
static const ULONG OFFSET_PS_SIZE_HIGH = 0x0000007C
 
static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009
 
static const WORD MIN_BIG_BLOCK_SIZE_BITS = 0x0009
 
static const WORD MAX_BIG_BLOCK_SIZE_BITS = 0x000c
 
static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006
 
static const WORD DEF_BIG_BLOCK_SIZE = 0x0200
 
static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040
 
static const ULONG BLOCK_FIRST_SPECIAL = 0xFFFFFFFB
 
static const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC
 
static const ULONG BLOCK_SPECIAL = 0xFFFFFFFD
 
static const ULONG BLOCK_END_OF_CHAIN = 0xFFFFFFFE
 
static const ULONG BLOCK_UNUSED = 0xFFFFFFFF
 
static const ULONG DIRENTRY_NULL = 0xFFFFFFFF
 

Macro Definition Documentation

◆ BLOCKCHAIN_CACHE_SIZE

#define BLOCKCHAIN_CACHE_SIZE   4

Definition at line 363 of file storage32.h.

◆ COUNT_BBDEPOTINHEADER

#define COUNT_BBDEPOTINHEADER   109

Definition at line 110 of file storage32.h.

◆ DIRENTRY_NAME_BUFFER_LEN

#define DIRENTRY_NAME_BUFFER_LEN   0x40

Definition at line 89 of file storage32.h.

◆ DIRENTRY_NAME_MAX_LEN

#define DIRENTRY_NAME_MAX_LEN   0x20

Definition at line 88 of file storage32.h.

◆ DIRENTRY_RELATION_DIR

#define DIRENTRY_RELATION_DIR   2

Definition at line 103 of file storage32.h.

◆ DIRENTRY_RELATION_NEXT

#define DIRENTRY_RELATION_NEXT   1

Definition at line 102 of file storage32.h.

◆ DIRENTRY_RELATION_PREVIOUS

#define DIRENTRY_RELATION_PREVIOUS   0

Definition at line 101 of file storage32.h.

◆ HEADER_SIZE

#define HEADER_SIZE   512

Definition at line 93 of file storage32.h.

◆ htole16

#define htole16 (   x)    (x)

Definition at line 546 of file storage32.h.

◆ htole32

#define htole32 (   x)    (x)

Definition at line 543 of file storage32.h.

◆ lendian16toh

#define lendian16toh (   x)    (x)

Definition at line 549 of file storage32.h.

◆ lendian32toh

#define lendian32toh (   x)    (x)

Definition at line 548 of file storage32.h.

◆ LIMIT_TO_USE_SMALL_BLOCK

#define LIMIT_TO_USE_SMALL_BLOCK   0x1000

Definition at line 113 of file storage32.h.

◆ MAX_BIG_BLOCK_SIZE

#define MAX_BIG_BLOCK_SIZE   0x1000

Definition at line 96 of file storage32.h.

◆ MIN_BIG_BLOCK_SIZE

#define MIN_BIG_BLOCK_SIZE   0x200

Definition at line 95 of file storage32.h.

◆ RANGELOCK_CHECKLOCKS

#define RANGELOCK_CHECKLOCKS   0x7fffff92

Definition at line 506 of file storage32.h.

◆ RANGELOCK_COMMIT

#define RANGELOCK_COMMIT   0x7fffff80

Definition at line 503 of file storage32.h.

◆ RANGELOCK_DENY_READ_FIRST

#define RANGELOCK_DENY_READ_FIRST   0x7fffffbb

Definition at line 511 of file storage32.h.

◆ RANGELOCK_DENY_READ_LAST

#define RANGELOCK_DENY_READ_LAST   0x7fffffce

Definition at line 512 of file storage32.h.

◆ RANGELOCK_DENY_WRITE_FIRST

#define RANGELOCK_DENY_WRITE_FIRST   0x7fffffcf

Definition at line 513 of file storage32.h.

◆ RANGELOCK_DENY_WRITE_LAST

#define RANGELOCK_DENY_WRITE_LAST   0x7fffffe2

Definition at line 514 of file storage32.h.

◆ RANGELOCK_FIRST

#define RANGELOCK_FIRST   RANGELOCK_UNK1_FIRST

Definition at line 519 of file storage32.h.

◆ RANGELOCK_LAST

#define RANGELOCK_LAST   RANGELOCK_UNK2_LAST

Definition at line 520 of file storage32.h.

◆ RANGELOCK_NOSNAPSHOT_FIRST

#define RANGELOCK_NOSNAPSHOT_FIRST   0x7fffff6c

Definition at line 501 of file storage32.h.

◆ RANGELOCK_NOSNAPSHOT_LAST

#define RANGELOCK_NOSNAPSHOT_LAST   0x7fffff7f

Definition at line 502 of file storage32.h.

◆ RANGELOCK_PRIORITY1_FIRST

#define RANGELOCK_PRIORITY1_FIRST   0x7fffff58

Definition at line 499 of file storage32.h.

◆ RANGELOCK_PRIORITY1_LAST

#define RANGELOCK_PRIORITY1_LAST   0x7fffff6b

Definition at line 500 of file storage32.h.

◆ RANGELOCK_PRIORITY2_FIRST

#define RANGELOCK_PRIORITY2_FIRST   0x7fffff81

Definition at line 504 of file storage32.h.

◆ RANGELOCK_PRIORITY2_LAST

#define RANGELOCK_PRIORITY2_LAST   0x7fffff91

Definition at line 505 of file storage32.h.

◆ RANGELOCK_READ_FIRST

#define RANGELOCK_READ_FIRST   0x7fffff93

Definition at line 507 of file storage32.h.

◆ RANGELOCK_READ_LAST

#define RANGELOCK_READ_LAST   0x7fffffa6

Definition at line 508 of file storage32.h.

◆ RANGELOCK_TRANSACTION_FIRST

#define RANGELOCK_TRANSACTION_FIRST   RANGELOCK_COMMIT

Definition at line 517 of file storage32.h.

◆ RANGELOCK_TRANSACTION_LAST

#define RANGELOCK_TRANSACTION_LAST   RANGELOCK_CHECKLOCKS

Definition at line 518 of file storage32.h.

◆ RANGELOCK_UNK1_FIRST

#define RANGELOCK_UNK1_FIRST   0x7ffffe00

Definition at line 497 of file storage32.h.

◆ RANGELOCK_UNK1_LAST

#define RANGELOCK_UNK1_LAST   0x7fffff57

Definition at line 498 of file storage32.h.

◆ RANGELOCK_UNK2_FIRST

#define RANGELOCK_UNK2_FIRST   0x7fffffe3

Definition at line 515 of file storage32.h.

◆ RANGELOCK_UNK2_LAST

#define RANGELOCK_UNK2_LAST   0x7fffffff

Definition at line 516 of file storage32.h.

◆ RANGELOCK_WRITE_FIRST

#define RANGELOCK_WRITE_FIRST   0x7fffffa7

Definition at line 509 of file storage32.h.

◆ RANGELOCK_WRITE_LAST

#define RANGELOCK_WRITE_LAST   0x7fffffba

Definition at line 510 of file storage32.h.

◆ RAW_DIRENTRY_SIZE

#define RAW_DIRENTRY_SIZE   0x00000080

Definition at line 91 of file storage32.h.

◆ STGM_ACCESS_MODE

#define STGM_ACCESS_MODE (   stgm)    ((stgm)&0x0000f)

Definition at line 115 of file storage32.h.

◆ STGM_CREATE_MODE

#define STGM_CREATE_MODE (   stgm)    ((stgm)&0x0f000)

Definition at line 117 of file storage32.h.

◆ STGM_KNOWN_FLAGS

#define STGM_KNOWN_FLAGS
Value:
(0xf0ff | \
STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
#define STGM_DELETEONRELEASE
Definition: objbase.h:924
#define STGM_CONVERT
Definition: objbase.h:926
#define STGM_DIRECT_SWMR
Definition: objbase.h:930
#define STGM_PRIORITY
Definition: objbase.h:923
#define STGM_NOSCRATCH
Definition: objbase.h:928
#define STGM_SIMPLE
Definition: objbase.h:915

Definition at line 119 of file storage32.h.

◆ STGM_SHARE_MODE

#define STGM_SHARE_MODE (   stgm)    ((stgm)&0x000f0)

Definition at line 116 of file storage32.h.

◆ STGTY_ROOT

#define STGTY_ROOT   0x05

Definition at line 108 of file storage32.h.

◆ WINE_LOCK_READ

#define WINE_LOCK_READ   0x80000000

Definition at line 523 of file storage32.h.

Typedef Documentation

◆ BlockChainStream

Definition at line 130 of file storage32.h.

◆ DirEntry

Definition at line 133 of file storage32.h.

◆ DirRef

typedef ULONG DirRef

Definition at line 139 of file storage32.h.

◆ IEnumSTATSTGImpl

Definition at line 132 of file storage32.h.

◆ SmallBlockChainStream

Definition at line 131 of file storage32.h.

◆ StgStreamImpl

Definition at line 134 of file storage32.h.

◆ StorageBaseImpl

Definition at line 127 of file storage32.h.

◆ StorageBaseImplVtbl

Definition at line 128 of file storage32.h.

◆ StorageImpl

Definition at line 129 of file storage32.h.

Enumeration Type Documentation

◆ swmr_mode

Enumerator
SWMR_None 
SWMR_Writer 
SWMR_Reader 

Definition at line 169 of file storage32.h.

170 {
171  SWMR_None,
172  SWMR_Writer,
174 };

Function Documentation

◆ FileLockBytesImpl_Construct()

HRESULT FileLockBytesImpl_Construct ( HANDLE  hFile,
DWORD  openFlags,
LPCWSTR  pwcsName,
ILockBytes **  pLockBytes 
)

Definition at line 90 of file filelockbytes.c.

91 {
93  WCHAR fullpath[MAX_PATH];
94 
96  return E_FAIL;
97 
99 
100  if (!This)
101  return E_OUTOFMEMORY;
102 
103  This->ILockBytes_iface.lpVtbl = &FileLockBytesImpl_Vtbl;
104  This->ref = 1;
105  This->hfile = hFile;
106  This->flProtect = GetProtectMode(openFlags);
107 
108  if(pwcsName) {
109  if (!GetFullPathNameW(pwcsName, MAX_PATH, fullpath, NULL))
110  {
111  lstrcpynW(fullpath, pwcsName, MAX_PATH);
112  }
113  This->pwcsName = HeapAlloc(GetProcessHeap(), 0,
114  (lstrlenW(fullpath)+1)*sizeof(WCHAR));
115  if (!This->pwcsName)
116  {
118  return E_OUTOFMEMORY;
119  }
120  strcpyW(This->pwcsName, fullpath);
121  }
122  else
123  This->pwcsName = NULL;
124 
125  *pLockBytes = &This->ILockBytes_iface;
126 
127  return S_OK;
128 }
static DWORD GetProtectMode(DWORD openFlags)
Definition: filelockbytes.c:74
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
#define lstrlenW
Definition: compat.h:407
#define E_FAIL
Definition: ddrawi.h:102
#define lstrcpynW
Definition: compat.h:397
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
_In_ HANDLE hFile
Definition: mswsock.h:90
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
static const ILockBytesVtbl FileLockBytesImpl_Vtbl
Definition: filelockbytes.c:57
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by StorageImpl_Construct().

◆ impl_from_IStream()

static StgStreamImpl* impl_from_IStream ( IStream iface)
inlinestatic

Definition at line 458 of file storage32.h.

459 {
460  return CONTAINING_RECORD(iface, StgStreamImpl, IStream_iface);
461 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

◆ OLECONVERT_CreateCompObjStream()

HRESULT OLECONVERT_CreateCompObjStream ( LPSTORAGE  pStorage,
LPCSTR  strOleTypeName 
)

Definition at line 10029 of file storage32.c.

10030 {
10031  IStream *pStream;
10032  HRESULT hStorageRes, hRes = S_OK;
10033  OLECONVERT_ISTORAGE_COMPOBJ IStorageCompObj;
10034  static const WCHAR wstrStreamName[] = {1,'C', 'o', 'm', 'p', 'O', 'b', 'j', 0};
10035  WCHAR bufferW[OLESTREAM_MAX_STR_LEN];
10036 
10037  static const BYTE pCompObjUnknown1[] = {0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};
10038  static const BYTE pCompObjUnknown2[] = {0xF4, 0x39, 0xB2, 0x71};
10039 
10040  /* Initialize the CompObj structure */
10041  memset(&IStorageCompObj, 0, sizeof(IStorageCompObj));
10042  memcpy(IStorageCompObj.byUnknown1, pCompObjUnknown1, sizeof(pCompObjUnknown1));
10043  memcpy(IStorageCompObj.byUnknown2, pCompObjUnknown2, sizeof(pCompObjUnknown2));
10044 
10045 
10046  /* Create a CompObj stream if it doesn't exist */
10047  hStorageRes = IStorage_CreateStream(pStorage, wstrStreamName,
10048  STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream );
10049  if(hStorageRes == S_OK)
10050  {
10051  /* copy the OleTypeName to the compobj struct */
10052  IStorageCompObj.dwOleTypeNameLength = strlen(strOleTypeName)+1;
10053  strcpy(IStorageCompObj.strOleTypeName, strOleTypeName);
10054 
10055  /* copy the OleTypeName to the compobj struct */
10056  /* Note: in the test made, these were Identical */
10057  IStorageCompObj.dwProgIDNameLength = strlen(strOleTypeName)+1;
10058  strcpy(IStorageCompObj.strProgIDName, strOleTypeName);
10059 
10060  /* Get the CLSID */
10061  MultiByteToWideChar( CP_ACP, 0, IStorageCompObj.strProgIDName, -1,
10062  bufferW, OLESTREAM_MAX_STR_LEN );
10063  hRes = CLSIDFromProgID(bufferW, &(IStorageCompObj.clsid));
10064 
10065  if(hRes == S_OK)
10066  {
10067  HKEY hKey;
10068  LONG hErr;
10069  /* Get the CLSID Default Name from the Registry */
10070  hErr = open_classes_key(HKEY_CLASSES_ROOT, bufferW, MAXIMUM_ALLOWED, &hKey);
10071  if(hErr == ERROR_SUCCESS)
10072  {
10073  char strTemp[OLESTREAM_MAX_STR_LEN];
10074  IStorageCompObj.dwCLSIDNameLength = OLESTREAM_MAX_STR_LEN;
10075  hErr = RegQueryValueA(hKey, NULL, strTemp, (LONG*) &(IStorageCompObj.dwCLSIDNameLength));
10076  if(hErr == ERROR_SUCCESS)
10077  {
10078  strcpy(IStorageCompObj.strCLSIDName, strTemp);
10079  }
10080  RegCloseKey(hKey);
10081  }
10082  }
10083 
10084  /* Write CompObj Structure to stream */
10085  hRes = IStream_Write(pStream, IStorageCompObj.byUnknown1, sizeof(IStorageCompObj.byUnknown1), NULL);
10086 
10087  WriteClassStm(pStream,&(IStorageCompObj.clsid));
10088 
10089  hRes = IStream_Write(pStream, &(IStorageCompObj.dwCLSIDNameLength), sizeof(IStorageCompObj.dwCLSIDNameLength), NULL);
10090  if(IStorageCompObj.dwCLSIDNameLength > 0)
10091  {
10092  hRes = IStream_Write(pStream, IStorageCompObj.strCLSIDName, IStorageCompObj.dwCLSIDNameLength, NULL);
10093  }
10094  hRes = IStream_Write(pStream, &(IStorageCompObj.dwOleTypeNameLength) , sizeof(IStorageCompObj.dwOleTypeNameLength), NULL);
10095  if(IStorageCompObj.dwOleTypeNameLength > 0)
10096  {
10097  hRes = IStream_Write(pStream, IStorageCompObj.strOleTypeName , IStorageCompObj.dwOleTypeNameLength, NULL);
10098  }
10099  hRes = IStream_Write(pStream, &(IStorageCompObj.dwProgIDNameLength) , sizeof(IStorageCompObj.dwProgIDNameLength), NULL);
10100  if(IStorageCompObj.dwProgIDNameLength > 0)
10101  {
10102  hRes = IStream_Write(pStream, IStorageCompObj.strProgIDName , IStorageCompObj.dwProgIDNameLength, NULL);
10103  }
10104  hRes = IStream_Write(pStream, IStorageCompObj.byUnknown2 , sizeof(IStorageCompObj.byUnknown2), NULL);
10105  IStream_Release(pStream);
10106  }
10107  return hRes;
10108 }
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
LSTATUS WINAPI RegQueryValueA(HKEY hkey, LPCSTR name, LPSTR data, LPLONG count)
Definition: reg.c:4243
#define ERROR_SUCCESS
Definition: deptool.c:10
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CP_ACP
Definition: compat.h:99
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2511
CHAR strProgIDName[OLESTREAM_MAX_STR_LEN]
Definition: storage32.c:9607
CHAR strCLSIDName[OLESTREAM_MAX_STR_LEN]
Definition: storage32.c:9603
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
CHAR strOleTypeName[OLESTREAM_MAX_STR_LEN]
Definition: storage32.c:9605
#define OLESTREAM_MAX_STR_LEN
Definition: storage32.c:9579
HRESULT WINAPI WriteClassStm(IStream *pStm, REFCLSID rclsid)
Definition: storage32.c:9526
smooth NULL
Definition: ftsmooth.c:416
#define STGM_WRITE
Definition: objbase.h:917
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
LSTATUS open_classes_key(HKEY hkey, const WCHAR *name, REGSAM access, HKEY *retkey)
Definition: compobj.c:423
#define MultiByteToWideChar
Definition: compat.h:100
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define memset(x, y, z)
Definition: compat.h:39

Referenced by OleConvertOLESTREAMToIStorage(), and render_embed_source_hack().

◆ StgStreamImpl_Construct()

StgStreamImpl* StgStreamImpl_Construct ( StorageBaseImpl parentStorage,
DWORD  grfMode,
DirRef  dirEntry 
)

Definition at line 666 of file stg_stream.c.

670 {
671  StgStreamImpl* newStream;
672 
673  newStream = HeapAlloc(GetProcessHeap(), 0, sizeof(StgStreamImpl));
674 
675  if (newStream)
676  {
677  /*
678  * Set-up the virtual function table and reference count.
679  */
680  newStream->IStream_iface.lpVtbl = &StgStreamVtbl;
681  newStream->ref = 0;
682 
683  newStream->parentStorage = parentStorage;
684 
685  /*
686  * We want to nail-down the reference to the storage in case the
687  * stream out-lives the storage in the client application.
688  *
689  * -- IStorage_AddRef(&newStream->parentStorage->IStorage_iface);
690  *
691  * No, don't do this. Some apps call IStorage_Release without
692  * calling IStream_Release first. If we grab a reference the
693  * file is not closed, and the app fails when it tries to
694  * reopen the file (Easy-PC, for example)
695  */
696 
697  newStream->grfMode = grfMode;
698  newStream->dirEntry = dirEntry;
699 
700  /*
701  * Start the stream at the beginning.
702  */
703  newStream->currentPosition.u.HighPart = 0;
704  newStream->currentPosition.u.LowPart = 0;
705 
706  /* add us to the storage's list of active streams */
707  StorageBaseImpl_AddStream(parentStorage, newStream);
708  }
709 
710  return newStream;
711 }
ULARGE_INTEGER currentPosition
Definition: storage32.h:455
DWORD grfMode
Definition: storage32.h:445
static const IStreamVtbl StgStreamVtbl
Definition: stg_stream.c:637
DirRef dirEntry
Definition: storage32.h:450
struct _ULARGE_INTEGER::@3737 u
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
StorageBaseImpl * parentStorage
Definition: storage32.h:440
void StorageBaseImpl_AddStream(StorageBaseImpl *stg, StgStreamImpl *strm)
Definition: storage32.c:2715
IStream IStream_iface
Definition: storage32.h:429

Referenced by StgStreamImpl_Clone(), StorageBaseImpl_CopyChildEntryTo(), StorageBaseImpl_CreateStream(), and StorageBaseImpl_OpenStream().

◆ STORAGE_CreateOleStream()

HRESULT STORAGE_CreateOleStream ( IStorage ,
DWORD   
)

Definition at line 9208 of file storage32.c.

9209 {
9210  static const WCHAR stream_1oleW[] = {1,'O','l','e',0};
9211  static const DWORD version_magic = 0x02000001;
9212  IStream *stream;
9213  HRESULT hr;
9214 
9215  hr = IStorage_CreateStream(storage, stream_1oleW, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream);
9216  if (hr == S_OK)
9217  {
9218  struct empty_1ole_stream {
9219  DWORD version_magic;
9220  DWORD flags;
9221  DWORD update_options;
9222  DWORD reserved;
9223  DWORD mon_stream_size;
9224  };
9225  struct empty_1ole_stream stream_data;
9226 
9227  stream_data.version_magic = version_magic;
9228  stream_data.flags = flags;
9229  stream_data.update_options = 0;
9230  stream_data.reserved = 0;
9231  stream_data.mon_stream_size = 0;
9232 
9233  hr = IStream_Write(stream, &stream_data, sizeof(stream_data), NULL);
9234  IStream_Release(stream);
9235  }
9236 
9237  return hr;
9238 }
HRESULT hr
Definition: shlfolder.c:183
#define STGM_SHARE_EXCLUSIVE
Definition: objbase.h:922
r reserved
Definition: btrfs.c:2655
smooth NULL
Definition: ftsmooth.c:416
#define STGM_WRITE
Definition: objbase.h:917
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define S_OK
Definition: intsafe.h:59
static const char stream_data[]
Definition: mlang.c:2327

Referenced by DefaultHandler_IPersistStorage_InitNew(), load_ole_stream(), OleConvertOLESTREAMToIStorage(), render_embed_source_hack(), and SetConvertStg().

◆ StorageBaseImpl_AddStream()

void StorageBaseImpl_AddStream ( StorageBaseImpl stg,
StgStreamImpl strm 
)

Definition at line 2715 of file storage32.c.

2716 {
2717  TRACE("Stream added (stg=%p strm=%p)\n", stg, strm);
2718  list_add_tail(&stg->strmHead,&strm->StrmListEntry);
2719 }
struct list strmHead
Definition: storage32.h:196
struct list StrmListEntry
Definition: storage32.h:435
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by StgStreamImpl_Construct().

◆ StorageBaseImpl_CreateDirEntry()

static HRESULT StorageBaseImpl_CreateDirEntry ( StorageBaseImpl This,
const DirEntry newData,
DirRef index 
)
inlinestatic

◆ StorageBaseImpl_Destroy()

static void StorageBaseImpl_Destroy ( StorageBaseImpl This)
inlinestatic

Definition at line 258 of file storage32.h.

259 {
260  This->baseVtbl->Destroy(This);
261 }

Referenced by StorageBaseImpl_Release().

◆ StorageBaseImpl_DestroyDirEntry()

◆ StorageBaseImpl_Flush()

◆ StorageBaseImpl_GetFilename()

static HRESULT StorageBaseImpl_GetFilename ( StorageBaseImpl This,
LPWSTR result 
)
inlinestatic

Definition at line 273 of file storage32.h.

274 {
275  return This->baseVtbl->GetFilename(This, result);
276 }
GLuint64EXT * result
Definition: glext.h:11304

Referenced by StgOpenStorage(), StorageInternalImpl_GetFilename(), StorageUtl_CopyDirEntryToSTATSTG(), TransactedSharedImpl_GetFilename(), and TransactedSnapshotImpl_GetFilename().

◆ StorageBaseImpl_GetTransactionSig()

static HRESULT StorageBaseImpl_GetTransactionSig ( StorageBaseImpl This,
ULONG result,
BOOL  refresh 
)
inlinestatic

Definition at line 333 of file storage32.h.

335 {
336  return This->baseVtbl->GetTransactionSig(This, result, refresh);
337 }
GLuint64EXT * result
Definition: glext.h:11304

Referenced by TransactedSharedImpl_Commit(), TransactedSharedImpl_Construct(), TransactedSnapshotImpl_Commit(), and TransactedSnapshotImpl_Construct().

◆ StorageBaseImpl_Invalidate()

static void StorageBaseImpl_Invalidate ( StorageBaseImpl This)
inlinestatic

Definition at line 263 of file storage32.h.

264 {
265  This->baseVtbl->Invalidate(This);
266 }

Referenced by deleteStorageContents(), and StorageBaseImpl_DeleteAll().

◆ StorageBaseImpl_LockTransaction()

static HRESULT StorageBaseImpl_LockTransaction ( StorageBaseImpl This,
BOOL  write 
)
inlinestatic

Definition at line 345 of file storage32.h.

346 {
347  return This->baseVtbl->LockTransaction(This, write);
348 }
#define write
Definition: acwin.h:73

Referenced by TransactedSharedImpl_Commit(), TransactedSharedImpl_Construct(), and TransactedSnapshotImpl_Commit().

◆ StorageBaseImpl_ReadDirEntry()

◆ StorageBaseImpl_RemoveStream()

void StorageBaseImpl_RemoveStream ( StorageBaseImpl stg,
StgStreamImpl strm 
)

Definition at line 2721 of file storage32.c.

2722 {
2723  TRACE("Stream removed (stg=%p strm=%p)\n", stg,strm);
2724  list_remove(&(strm->StrmListEntry));
2725 }
struct list StrmListEntry
Definition: storage32.h:435
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by StgStreamImpl_Release().

◆ StorageBaseImpl_SetTransactionSig()

static HRESULT StorageBaseImpl_SetTransactionSig ( StorageBaseImpl This,
ULONG  value 
)
inlinestatic

Definition at line 339 of file storage32.h.

341 {
342  return This->baseVtbl->SetTransactionSig(This, value);
343 }

Referenced by TransactedSharedImpl_Commit(), and TransactedSnapshotImpl_Commit().

◆ StorageBaseImpl_StreamLink()

static HRESULT StorageBaseImpl_StreamLink ( StorageBaseImpl This,
DirRef  dst,
DirRef  src 
)
inlinestatic

Definition at line 327 of file storage32.h.

329 {
330  return This->baseVtbl->StreamLink(This, dst, src);
331 }
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

Referenced by StorageInternalImpl_StreamLink(), TransactedSharedImpl_StreamLink(), and TransactedSnapshotImpl_CopyTree().

◆ StorageBaseImpl_StreamReadAt()

static HRESULT StorageBaseImpl_StreamReadAt ( StorageBaseImpl This,
DirRef  index,
ULARGE_INTEGER  offset,
ULONG  size,
void buffer,
ULONG bytesRead 
)
inlinestatic

Definition at line 303 of file storage32.h.

305 {
306  return This->baseVtbl->StreamReadAt(This, index, offset, size, buffer, bytesRead);
307 }
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLsizeiptr size
Definition: glext.h:5919

Referenced by StgStreamImpl_Read(), StorageBaseImpl_CopyStream(), StorageInternalImpl_StreamReadAt(), TransactedSharedImpl_StreamReadAt(), and TransactedSnapshotImpl_StreamReadAt().

◆ StorageBaseImpl_StreamSetSize()

◆ StorageBaseImpl_StreamWriteAt()

static HRESULT StorageBaseImpl_StreamWriteAt ( StorageBaseImpl This,
DirRef  index,
ULARGE_INTEGER  offset,
ULONG  size,
const void buffer,
ULONG bytesWritten 
)
inlinestatic

Definition at line 311 of file storage32.h.

313 {
314  return This->baseVtbl->StreamWriteAt(This, index, offset, size, buffer, bytesWritten);
315 }
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
GLuint index
Definition: glext.h:6031
GLsizeiptr size
Definition: glext.h:5919
GLenum GLsizei GLuint GLint * bytesWritten
Definition: glext.h:11123

Referenced by StgStreamImpl_Write(), StorageBaseImpl_CopyStream(), StorageInternalImpl_StreamWriteAt(), TransactedSharedImpl_StreamWriteAt(), and TransactedSnapshotImpl_StreamWriteAt().

◆ StorageBaseImpl_UnlockTransaction()

static HRESULT StorageBaseImpl_UnlockTransaction ( StorageBaseImpl This,
BOOL  write 
)
inlinestatic

Definition at line 350 of file storage32.h.

351 {
352  return This->baseVtbl->UnlockTransaction(This, write);
353 }
#define write
Definition: acwin.h:73

Referenced by TransactedSharedImpl_Commit(), TransactedSharedImpl_Construct(), and TransactedSnapshotImpl_Commit().

◆ StorageBaseImpl_WriteDirEntry()

static HRESULT StorageBaseImpl_WriteDirEntry ( StorageBaseImpl This,
DirRef  index,
const DirEntry data 
)
inlinestatic

Definition at line 284 of file storage32.h.

286 {
287  return This->baseVtbl->WriteDirEntry(This, index, data);
288 }
GLuint index
Definition: glext.h:6031
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by insertIntoTree(), removeFromTree(), StorageBaseImpl_CopyStorageTree(), StorageBaseImpl_RenameElement(), StorageBaseImpl_SetClass(), StorageInternalImpl_WriteDirEntry(), TransactedSharedImpl_Commit(), TransactedSharedImpl_WriteDirEntry(), and TransactedSnapshotImpl_Commit().

◆ StorageUtl_CopyDirEntryToSTATSTG()

void StorageUtl_CopyDirEntryToSTATSTG ( StorageBaseImpl storage,
STATSTG *  destination,
const DirEntry source,
int  statFlags 
)

Definition at line 7018 of file storage32.c.

7023 {
7024  /*
7025  * The copy of the string occurs only when the flag is not set
7026  */
7027  if (!(statFlags & STATFLAG_NONAME) && source->stgType == STGTY_ROOT)
7028  {
7029  /* Use the filename for the root storage. */
7030  destination->pwcsName = 0;
7031  StorageBaseImpl_GetFilename(storage, &destination->pwcsName);
7032  }
7033  else if( ((statFlags & STATFLAG_NONAME) != 0) ||
7034  (source->name[0] == 0) )
7035  {
7036  destination->pwcsName = 0;
7037  }
7038  else
7039  {
7040  destination->pwcsName =
7041  CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR));
7042 
7043  strcpyW(destination->pwcsName, source->name);
7044  }
7045 
7046  switch (source->stgType)
7047  {
7048  case STGTY_STORAGE:
7049  case STGTY_ROOT:
7050  destination->type = STGTY_STORAGE;
7051  break;
7052  case STGTY_STREAM:
7053  destination->type = STGTY_STREAM;
7054  break;
7055  default:
7056  destination->type = STGTY_STREAM;
7057  break;
7058  }
7059 
7060  destination->cbSize = source->size;
7061 /*
7062  currentReturnStruct->mtime = {0}; TODO
7063  currentReturnStruct->ctime = {0};
7064  currentReturnStruct->atime = {0};
7065 */
7066  destination->grfMode = 0;
7067  destination->grfLocksSupported = 0;
7068  destination->clsid = source->clsid;
7069  destination->grfStateBits = 0;
7070  destination->reserved = 0;
7071 }
#define lstrlenW
Definition: compat.h:407
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HRESULT StorageBaseImpl_GetFilename(StorageBaseImpl *This, LPWSTR *result)
Definition: storage32.h:273
#define STGTY_ROOT
Definition: storage32.h:108
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by IEnumSTATSTGImpl_Next(), StgStreamImpl_Stat(), and StorageBaseImpl_Stat().

◆ StorageUtl_ReadDWord()

◆ StorageUtl_ReadGUID()

void StorageUtl_ReadGUID ( const BYTE buffer,
ULONG  offset,
GUID value 
)

Definition at line 7000 of file storage32.c.

7001 {
7002  StorageUtl_ReadDWord(buffer, offset, &(value->Data1));
7003  StorageUtl_ReadWord(buffer, offset+4, &(value->Data2));
7004  StorageUtl_ReadWord(buffer, offset+6, &(value->Data3));
7005 
7006  memcpy(value->Data4, buffer+offset+8, sizeof(value->Data4));
7007 }
void StorageUtl_ReadWord(const BYTE *buffer, ULONG offset, WORD *value)
Definition: storage32.c:6944
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void StorageUtl_ReadDWord(const BYTE *buffer, ULONG offset, DWORD *value)
Definition: storage32.c:6958

Referenced by PropertyStorage_ReadFmtIdOffsetFromStream(), PropertyStorage_ReadHeaderFromStream(), and StorageImpl_ReadDirEntry().

◆ StorageUtl_ReadULargeInteger()

void StorageUtl_ReadULargeInteger ( const BYTE buffer,
ULONG  offset,
ULARGE_INTEGER value 
)

Definition at line 6972 of file storage32.c.

6974 {
6975 #ifdef WORDS_BIGENDIAN
6976  ULARGE_INTEGER tmp;
6977 
6978  memcpy(&tmp, buffer + offset, sizeof(ULARGE_INTEGER));
6979  value->u.LowPart = htole32(tmp.u.HighPart);
6980  value->u.HighPart = htole32(tmp.u.LowPart);
6981 #else
6982  memcpy(value, buffer + offset, sizeof(ULARGE_INTEGER));
6983 #endif
6984 }
union value::@475 u
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
#define htole32(x)
Definition: storage32.h:543
struct _ULARGE_INTEGER::@3737 u
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by PropertyStorage_ReadProperty().

◆ StorageUtl_ReadWord()

void StorageUtl_ReadWord ( const BYTE buffer,
ULONG  offset,
WORD value 
)

Definition at line 6944 of file storage32.c.

6945 {
6946  WORD tmp;
6947 
6948  memcpy(&tmp, buffer+offset, sizeof(WORD));
6949  *value = lendian16toh(tmp);
6950 }
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
#define lendian16toh(x)
Definition: storage32.h:549
unsigned short WORD
Definition: ntddk_ex.h:93
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by PropertyStorage_ReadHeaderFromStream(), PropertyStorage_ReadProperty(), StorageImpl_CreateDirEntry(), StorageImpl_LoadFileHeader(), StorageImpl_ReadDirEntry(), and StorageUtl_ReadGUID().

◆ StorageUtl_WriteDWord()

◆ StorageUtl_WriteGUID()

void StorageUtl_WriteGUID ( BYTE buffer,
ULONG  offset,
const GUID value 
)

Definition at line 7009 of file storage32.c.

7010 {
7014 
7015  memcpy(buffer+offset+8, value->Data4, sizeof(value->Data4));
7016 }
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
void StorageUtl_WriteWord(BYTE *buffer, ULONG offset, WORD value)
Definition: storage32.c:6952
void StorageUtl_WriteDWord(BYTE *buffer, ULONG offset, DWORD value)
Definition: storage32.c:6966

Referenced by PropertyStorage_MakeFmtIdOffset(), PropertyStorage_MakeHeader(), PropertyStorage_WritePropertyToStream(), and UpdateRawDirEntry().

◆ StorageUtl_WriteULargeInteger()

void StorageUtl_WriteULargeInteger ( BYTE buffer,
ULONG  offset,
const ULARGE_INTEGER value 
)

Definition at line 6986 of file storage32.c.

6988 {
6989 #ifdef WORDS_BIGENDIAN
6990  ULARGE_INTEGER tmp;
6991 
6992  tmp.u.LowPart = htole32(value->u.HighPart);
6993  tmp.u.HighPart = htole32(value->u.LowPart);
6994  memcpy(buffer + offset, &tmp, sizeof(ULARGE_INTEGER));
6995 #else
6996  memcpy(buffer + offset, value, sizeof(ULARGE_INTEGER));
6997 #endif
6998 }
union value::@475 u
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
#define htole32(x)
Definition: storage32.h:543
struct _ULARGE_INTEGER::@3737 u
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by PropertyStorage_WritePropertyToStream().

◆ StorageUtl_WriteWord()

void StorageUtl_WriteWord ( BYTE buffer,
ULONG  offset,
WORD  value 
)

Definition at line 6952 of file storage32.c.

6953 {
6954  value = htole16(value);
6955  memcpy(buffer+offset, &value, sizeof(WORD));
6956 }
GLintptr offset
Definition: glext.h:5920
#define htole16(x)
Definition: storage32.h:546
GLuint buffer
Definition: glext.h:5915
unsigned short WORD
Definition: ntddk_ex.h:93
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by PropertyStorage_MakeHeader(), PropertyStorage_WritePropertyToStream(), StorageImpl_SaveFileHeader(), StorageUtl_WriteGUID(), and UpdateRawDirEntry().

Variable Documentation

◆ BLOCK_END_OF_CHAIN

◆ BLOCK_EXTBBDEPOT

const ULONG BLOCK_EXTBBDEPOT = 0xFFFFFFFC
static

Definition at line 82 of file storage32.h.

Referenced by StorageImpl_GetNextFreeBigBlock().

◆ BLOCK_FIRST_SPECIAL

const ULONG BLOCK_FIRST_SPECIAL = 0xFFFFFFFB
static

◆ BLOCK_SPECIAL

◆ BLOCK_UNUSED

◆ DEF_BIG_BLOCK_SIZE

const WORD DEF_BIG_BLOCK_SIZE = 0x0200
static

Definition at line 79 of file storage32.h.

◆ DEF_BIG_BLOCK_SIZE_BITS

const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009
static

Definition at line 75 of file storage32.h.

◆ DEF_SMALL_BLOCK_SIZE

const WORD DEF_SMALL_BLOCK_SIZE = 0x0040
static

◆ DEF_SMALL_BLOCK_SIZE_BITS

const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006
static

Definition at line 78 of file storage32.h.

Referenced by StorageImpl_Refresh().

◆ DIRENTRY_NULL

◆ MAX_BIG_BLOCK_SIZE_BITS

const WORD MAX_BIG_BLOCK_SIZE_BITS = 0x000c
static

Definition at line 77 of file storage32.h.

Referenced by StorageImpl_Refresh().

◆ MIN_BIG_BLOCK_SIZE_BITS

const WORD MIN_BIG_BLOCK_SIZE_BITS = 0x0009
static

Definition at line 76 of file storage32.h.

Referenced by StorageImpl_Refresh().

◆ OFFSET_BBDEPOTCOUNT

const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C
static

Definition at line 52 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_BBDEPOTSTART

const ULONG OFFSET_BBDEPOTSTART = 0x0000004C
static

Definition at line 60 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_BIGBLOCKSIZEBITS

const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e
static

Definition at line 49 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_BYTEORDERMARKER

const ULONG OFFSET_BYTEORDERMARKER = 0x0000001c
static

Definition at line 48 of file storage32.h.

Referenced by StorageImpl_SaveFileHeader().

◆ OFFSET_DIRSECTORCOUNT

const ULONG OFFSET_DIRSECTORCOUNT = 0x00000028
static

Definition at line 51 of file storage32.h.

Referenced by StorageImpl_SaveFileHeader().

◆ OFFSET_EXTBBDEPOTCOUNT

const ULONG OFFSET_EXTBBDEPOTCOUNT = 0x00000048
static

Definition at line 59 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_EXTBBDEPOTSTART

const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044
static

Definition at line 58 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_MAJORVERSION

const ULONG OFFSET_MAJORVERSION = 0x0000001a
static

Definition at line 47 of file storage32.h.

Referenced by StorageImpl_SaveFileHeader().

◆ OFFSET_MINORVERSION

const ULONG OFFSET_MINORVERSION = 0x00000018
static

Definition at line 46 of file storage32.h.

Referenced by StorageImpl_SaveFileHeader().

◆ OFFSET_PS_CTIMEHIGH

const ULONG OFFSET_PS_CTIMEHIGH = 0x00000068
static

Definition at line 69 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_CTIMELOW

const ULONG OFFSET_PS_CTIMELOW = 0x00000064
static

Definition at line 68 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_DIRROOT

const ULONG OFFSET_PS_DIRROOT = 0x0000004C
static

Definition at line 66 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_GUID

const ULONG OFFSET_PS_GUID = 0x00000050
static

Definition at line 67 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_LEFTCHILD

const ULONG OFFSET_PS_LEFTCHILD = 0x00000044
static

Definition at line 64 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_MTIMEHIGH

const ULONG OFFSET_PS_MTIMEHIGH = 0x00000070
static

Definition at line 71 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_MTIMELOW

const ULONG OFFSET_PS_MTIMELOW = 0x0000006C
static

Definition at line 70 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_NAME

const ULONG OFFSET_PS_NAME = 0x00000000
static

Definition at line 61 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_NAMELENGTH

const ULONG OFFSET_PS_NAMELENGTH = 0x00000040
static

◆ OFFSET_PS_RIGHTCHILD

const ULONG OFFSET_PS_RIGHTCHILD = 0x00000048
static

Definition at line 65 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_SIZE

const ULONG OFFSET_PS_SIZE = 0x00000078
static

Definition at line 73 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_SIZE_HIGH

const ULONG OFFSET_PS_SIZE_HIGH = 0x0000007C
static

Definition at line 74 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_STARTBLOCK

const ULONG OFFSET_PS_STARTBLOCK = 0x00000074
static

Definition at line 72 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_PS_STGTYPE

const ULONG OFFSET_PS_STGTYPE = 0x00000042
static

Definition at line 63 of file storage32.h.

Referenced by StorageImpl_ReadDirEntry(), and UpdateRawDirEntry().

◆ OFFSET_ROOTSTARTBLOCK

const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030
static

Definition at line 53 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_SBDEPOTCOUNT

const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040
static

Definition at line 57 of file storage32.h.

Referenced by StorageImpl_SaveFileHeader().

◆ OFFSET_SBDEPOTSTART

const ULONG OFFSET_SBDEPOTSTART = 0x0000003C
static

Definition at line 56 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_SMALLBLOCKLIMIT

const ULONG OFFSET_SMALLBLOCKLIMIT = 0x00000038
static

Definition at line 55 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_SMALLBLOCKSIZEBITS

const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020
static

Definition at line 50 of file storage32.h.

Referenced by StorageImpl_LoadFileHeader(), and StorageImpl_SaveFileHeader().

◆ OFFSET_TRANSACTIONSIG

const ULONG OFFSET_TRANSACTIONSIG = 0x00000034
static