File Index Symbol Index

//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: coml2api.h
//
// Contents: Structured storage, property sets, and related APIs.
//
//----------------------------------------------------------------------------
#if !defined(_COML2API_H_)
#define _COML2API_H_
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#include <apiset.h>
#include <apisetcconv.h>
#include <combaseapi.h> #include <objidl.h> #include <propidlbase.h>
#pragma region Application Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
//
// Common typedefs for paramaters used in Storage API's, gleamed from storage.h
// Also contains Storage error codes, which should be moved into the storage
// idl files.
//
#define CWCSTORAGENAME 32
/* Storage instantiation modes */
#define STGM_DIRECT 0x00000000L
#define STGM_TRANSACTED 0x00010000L
#define STGM_SIMPLE 0x08000000L
#define STGM_READ 0x00000000L
#define STGM_WRITE 0x00000001L
#define STGM_READWRITE 0x00000002L
#define STGM_SHARE_DENY_NONE 0x00000040L
#define STGM_SHARE_DENY_READ 0x00000030L
#define STGM_SHARE_DENY_WRITE 0x00000020L
#define STGM_SHARE_EXCLUSIVE 0x00000010L
#define STGM_PRIORITY 0x00040000L
#define STGM_DELETEONRELEASE 0x04000000L
#if (WINVER >= 400)
#define STGM_NOSCRATCH 0x00100000L #endif /* WINVER */
#define STGM_CREATE 0x00001000L
#define STGM_CONVERT 0x00020000L
#define STGM_FAILIFTHERE 0x00000000L
#define STGM_NOSNAPSHOT 0x00200000L
#if (_WIN32_WINNT >= 0x0500)
#define STGM_DIRECT_SWMR 0x00400000L #endif
typedef
DWORD
STGFMT
;
#define STGFMT_STORAGE 0
#define STGFMT_NATIVE 1
#define STGFMT_FILE 3
#define STGFMT_ANY 4
#define STGFMT_DOCFILE 5
// This is a legacy define to allow old component to builds
#define STGFMT_DOCUMENT 0
// Structured storage APIs
_Check_return_
StgCreateDocfile
( );
_Check_return_
StgCreateDocfileOnILockBytes
( );
_Check_return_
StgOpenStorage
( );
_Check_return_
StgOpenStorageOnILockBytes
( );
_Check_return_
StgIsStorageFile
( );
_Check_return_
StgIsStorageILockBytes
( );
_Check_return_
StgSetTimes
( );
// STG initialization options for StgCreateStorageEx and StgOpenStorageEx
#if _WIN32_WINNT == 0x500
#define STGOPTIONS_VERSION 1 #elif _WIN32_WINNT > 0x500
#define STGOPTIONS_VERSION 2
#else
#define STGOPTIONS_VERSION 0 #endif
typedef
struct
tagSTGOPTIONS
{
USHORT
usVersion
;
// Versions 1 and 2 supported
USHORT
reserved
;
// must be 0 for padding
ULONG
ulSectorSize
;
// docfile header sector size (512)
#if STGOPTIONS_VERSION >= 2
const
WCHAR
*
pwcsTemplateFile
;
// version 2 or above
#endif
}
STGOPTIONS
;
_Check_return_
StgCreateStorageEx
( );
_Check_return_
StgOpenStorageEx
( );
#ifndef _STGCREATEPROPSTG_DEFINED_
_Check_return_
StgCreatePropStg
( );
_Check_return_
StgOpenPropStg
( );
_Check_return_
StgCreatePropSetStg
( );
#define CCH_MAX_PROPSTG_NAME 31
_Check_return_
FmtIdToPropStgName
( );
_Check_return_
PropStgNameToFmtId
( );
#endif // _STGCREATEPROPSTG_DEFINED_
// Helper functions
ReadClassStg
( );
WriteClassStg
( );
ReadClassStm
( );
WriteClassStm
( );
// Storage utility APIs
_Check_return_
GetHGlobalFromILockBytes
( );
_Check_return_
CreateILockBytesOnHGlobal
( );
// ConvertTo APIs
GetConvertStg
( );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
#pragma endregion
#endif // __COML2API_H__