Commit e9d334d0 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix more incorrect uses of STGM_ enumerations.

parent f3324120
...@@ -866,8 +866,11 @@ static void BIGBLOCKFILE_RemapAllMappedPages(LPBIGBLOCKFILE This) ...@@ -866,8 +866,11 @@ static void BIGBLOCKFILE_RemapAllMappedPages(LPBIGBLOCKFILE This)
*/ */
static DWORD BIGBLOCKFILE_GetProtectMode(DWORD openFlags) static DWORD BIGBLOCKFILE_GetProtectMode(DWORD openFlags)
{ {
if (openFlags & (STGM_WRITE | STGM_READWRITE)) switch(STGM_ACCESS_MODE(openFlags))
return PAGE_READWRITE; {
else case STGM_WRITE:
return PAGE_READONLY; case STGM_READWRITE:
return PAGE_READWRITE;
}
return PAGE_READONLY;
} }
...@@ -443,7 +443,12 @@ HRESULT WINAPI StgStreamImpl_Write( ...@@ -443,7 +443,12 @@ HRESULT WINAPI StgStreamImpl_Write(
/* /*
* Do we have permission to write to this stream? * 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; return STG_E_ACCESSDENIED;
} }
......
...@@ -52,14 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage); ...@@ -52,14 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(storage);
#define FILE_BEGIN 0 #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 */ /* Used for OleConvertIStorageToOLESTREAM and OleConvertOLESTREAMToIStorage */
#define OLESTREAM_ID 0x501 #define OLESTREAM_ID 0x501
#define OLESTREAM_MAX_STR_LEN 255 #define OLESTREAM_MAX_STR_LEN 255
......
...@@ -100,6 +100,14 @@ static const ULONG PROPERTY_NULL = 0xFFFFFFFF; ...@@ -100,6 +100,14 @@ static const ULONG PROPERTY_NULL = 0xFFFFFFFF;
#define LIMIT_TO_USE_SMALL_BLOCK 0x1000 #define LIMIT_TO_USE_SMALL_BLOCK 0x1000
#define NUM_BLOCKS_PER_DEPOT_BLOCK 128 #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. * These are signatures to detect the type of Document file.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment