Fix more incorrect uses of STGM_ enumerations.

This commit is contained in:
Mike McCormack 2005-03-07 12:24:42 +00:00 committed by Alexandre Julliard
parent f332412092
commit e9d334d0c9
4 changed files with 21 additions and 13 deletions

View File

@ -866,8 +866,11 @@ static void BIGBLOCKFILE_RemapAllMappedPages(LPBIGBLOCKFILE This)
*/
static DWORD BIGBLOCKFILE_GetProtectMode(DWORD openFlags)
{
if (openFlags & (STGM_WRITE | STGM_READWRITE))
return PAGE_READWRITE;
else
return PAGE_READONLY;
switch(STGM_ACCESS_MODE(openFlags))
{
case STGM_WRITE:
case STGM_READWRITE:
return PAGE_READWRITE;
}
return PAGE_READONLY;
}

View File

@ -443,7 +443,12 @@ HRESULT WINAPI StgStreamImpl_Write(
/*
* Do we have permission to write to this stream?
*/
if (!(This->grfMode & (STGM_WRITE | STGM_READWRITE))) {
switch(STGM_ACCESS_MODE(This->grfMode))
{
case STGM_WRITE:
case STGM_READWRITE:
break;
default:
return STG_E_ACCESSDENIED;
}

View File

@ -52,14 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage);
#define FILE_BEGIN 0
#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 (0xf0ff | \
STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE)
/* Used for OleConvertIStorageToOLESTREAM and OleConvertOLESTREAMToIStorage */
#define OLESTREAM_ID 0x501
#define OLESTREAM_MAX_STR_LEN 255

View File

@ -100,6 +100,14 @@ static const ULONG PROPERTY_NULL = 0xFFFFFFFF;
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128
#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 (0xf0ff | \
STGM_TRANSACTED | STGM_CONVERT | STGM_PRIORITY | STGM_NOSCRATCH | \
STGM_NOSNAPSHOT | STGM_DIRECT_SWMR | STGM_DELETEONRELEASE | STGM_SIMPLE)
/*
* These are signatures to detect the type of Document file.
*/