Skip to content

Commit 706c5f3

Browse files
author
Sir Richard
committed
[PSDK]: Add missing SEC_XXX definitions for Server 2003 (Vista ones still missing).
[KERNEL32]: NtCreateSection should not be called with merely SEC_FILE: this says nothing about what kind of operation should be done (a commit, a reserve, etc?). Use SEC_COMMIT instead to specify correct operation. This works in ReactOS as of now, but would've failed after the NtSection* API rewrite. [KERNEL32]: CreateFileMappingW should also accept/allow SEC_LARGE_PAGES, even if we don't suppport it yet. svn path=/trunk/; revision=48958
1 parent 93a1ceb commit 706c5f3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

reactos/dll/win32/kernel32/mem/section.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ CreateFileMappingW(HANDLE hFile,
8787
DesiredAccess = STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ;
8888

8989
/* Get the attributes for the actual allocation and cleanup flProtect */
90-
Attributes = flProtect & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT);
90+
Attributes = flProtect & (SEC_FILE | SEC_IMAGE | SEC_RESERVE | SEC_NOCACHE | SEC_COMMIT | SEC_LARGE_PAGES);
9191
flProtect ^= Attributes;
9292

9393
/* If the caller didn't say anything, assume SEC_COMMIT */

reactos/dll/win32/kernel32/misc/nls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ IntGetCodePageEntry(UINT CodePage)
282282
&ObjectAttributes,
283283
NULL,
284284
PAGE_READONLY,
285-
SEC_FILE,
285+
SEC_COMMIT,
286286
FileHandle);
287287

288288
/* HACK: Check if another process was faster

reactos/include/psdk/winnt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,8 @@ typedef enum {
13051305
#define SEC_RESERVE 0x04000000
13061306
#define SEC_COMMIT 0x08000000
13071307
#define SEC_NOCACHE 0x10000000
1308+
#define SEC_WRITECOMBINE 0x40000000
1309+
#define SEC_LARGE_PAGES 0x80000000
13081310
#define SECTION_EXTEND_SIZE 16
13091311
#define SECTION_MAP_READ 4
13101312
#define SECTION_MAP_WRITE 2

0 commit comments

Comments
 (0)