mirror of
https://github.com/reactos/reactos.git
synced 2024-08-03 18:10:54 +00:00
[CMAKE]
Sync with trunk. (r49792) svn path=/branches/cmake-bringup/; revision=49803
This commit is contained in:
commit
f1283c58c6
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = 7-Zip
|
Name = 7-Zip
|
||||||
Version = 4.65
|
Version = 9.20
|
||||||
Licence = LGPL
|
Licence = LGPL
|
||||||
Description = Utility to create and open 7zip, zip, tar, rar and other archive files.
|
Description = Utility to create and open 7zip, zip, tar, rar and other archive files.
|
||||||
Size = 0.9M
|
Size = 1.0M
|
||||||
Category = 12
|
Category = 12
|
||||||
URLSite = http://www.7-zip.org/
|
URLSite = http://www.7-zip.org/
|
||||||
URLDownload = http://ovh.dl.sourceforge.net/project/sevenzip/7-Zip/4.65/7z465.exe
|
URLDownload = http://ovh.dl.sourceforge.net/project/sevenzip/7-Zip/9.20/7z920.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = LibreOffice
|
Name = LibreOffice
|
||||||
Version = 3.3.0 Beta 2
|
Version = 3.3.0 Beta 3
|
||||||
Licence = LGPL
|
Licence = LGPL
|
||||||
Description = Former called OpenOffice. Open Source Office Suite.
|
Description = Former called OpenOffice. Open Source Office Suite.
|
||||||
Size = 318.0MB
|
Size = 300.0MB
|
||||||
Category = 6
|
Category = 6
|
||||||
URLSite = http://www.documentfoundation.org/
|
URLSite = http://www.documentfoundation.org/
|
||||||
URLDownload = http://download.documentfoundation.org/libreoffice/testing/3.3.0-beta2/win/x86/LibO_3.3.0_beta2_Win_x86_install_multi.exe
|
URLDownload = http://download.documentfoundation.org/libreoffice/testing/3.3.0-beta3/win/x86/LibO_3.3.0_Win_x86_install_multi.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = Miranda IM
|
Name = Miranda IM
|
||||||
Version = 0.9.10
|
Version = 0.9.11
|
||||||
Licence = GPL
|
Licence = GPL
|
||||||
Description = Open source multiprotocol instant messaging application - May not work completely.
|
Description = Open source multiprotocol instant messaging application - May not work completely.
|
||||||
Size = 3.0MB
|
Size = 3.0MB
|
||||||
Category = 5
|
Category = 5
|
||||||
URLSite = http://www.miranda-im.org/
|
URLSite = http://www.miranda-im.org/
|
||||||
URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.9.10-unicode.exe
|
URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.9.11-unicode.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = Mono .net Development Framework
|
Name = Mono .net Development Framework
|
||||||
Version = 2.8
|
Version = 2.8.1
|
||||||
Licence = Unknown
|
Licence = Unknown
|
||||||
Description = Open Source .net Framework.
|
Description = Open Source .net Framework.
|
||||||
Size = 78MB
|
Size = 77MB
|
||||||
Category = 14
|
Category = 14
|
||||||
URLSite = http://www.mono-project.com/Main_Page
|
URLSite = http://www.mono-project.com/Main_Page
|
||||||
URLDownload = http://ftp.novell.com/pub/mono/archive/2.8/windows-installer/9/mono-2.8-gtksharp-2.12.10-win32-9.exe
|
URLDownload = http://ftp.novell.com/pub/mono/archive/2.8.1/windows-installer/3/mono-2.8.1-gtksharp-2.12.10-win32-3.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0415]
|
[Section.0415]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
[Section]
|
[Section]
|
||||||
Name = OpenTTD
|
Name = OpenTTD
|
||||||
Version = 1.0.4
|
Version = 1.0.5
|
||||||
Licence = GPL v2
|
Licence = GPL v2
|
||||||
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.
|
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.
|
||||||
Size = 3.4MB
|
Size = 3.4MB
|
||||||
Category = 4
|
Category = 4
|
||||||
URLSite = http://www.openttd.org/
|
URLSite = http://www.openttd.org/
|
||||||
URLDownload = http://cz.binaries.openttd.org/openttd/binaries/releases/1.0.4/openttd-1.0.4-windows-win32.exe
|
URLDownload = http://cz.binaries.openttd.org/openttd/binaries/releases/1.0.5/openttd-1.0.5-windows-win32.exe
|
||||||
CDPath = none
|
CDPath = none
|
||||||
|
|
||||||
[Section.0407]
|
[Section.0407]
|
||||||
|
|
|
@ -834,8 +834,8 @@ DWORD RQueryServiceObjectSecurity(
|
||||||
return ERROR_INVALID_HANDLE;
|
return ERROR_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwSecurityInformation & (DACL_SECURITY_INFORMATION ||
|
if (dwSecurityInformation & (DACL_SECURITY_INFORMATION |
|
||||||
GROUP_SECURITY_INFORMATION ||
|
GROUP_SECURITY_INFORMATION |
|
||||||
OWNER_SECURITY_INFORMATION))
|
OWNER_SECURITY_INFORMATION))
|
||||||
DesiredAccess |= READ_CONTROL;
|
DesiredAccess |= READ_CONTROL;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/freeldr/bootsect/isob
|
||||||
include_directories(BEFORE freeldr/freeldr/include)
|
include_directories(BEFORE freeldr/freeldr/include)
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
|
include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
|
||||||
|
|
||||||
|
if(ARCH MATCHES arm)
|
||||||
|
if(SARCH MATCHES omap-zoom2)
|
||||||
|
add_definitions(-D_ZOOM2_)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ARCH MATCHES i386)
|
if(ARCH MATCHES i386)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
list(APPEND FREELDR_BASE64K_SOURCE
|
list(APPEND FREELDR_BASE64K_SOURCE
|
||||||
|
@ -90,7 +96,6 @@ list(APPEND FREELDR_BASE_SOURCE
|
||||||
freeldr/freeldr/video/palette.c
|
freeldr/freeldr/video/palette.c
|
||||||
freeldr/freeldr/video/video.c
|
freeldr/freeldr/video/video.c
|
||||||
freeldr/freeldr/windows/conversion.c
|
freeldr/freeldr/windows/conversion.c
|
||||||
freeldr/freeldr/windows/headless.c
|
|
||||||
freeldr/freeldr/windows/peloader.c
|
freeldr/freeldr/windows/peloader.c
|
||||||
freeldr/freeldr/windows/winldr.c
|
freeldr/freeldr/windows/winldr.c
|
||||||
freeldr/freeldr/windows/wlmemory.c
|
freeldr/freeldr/windows/wlmemory.c
|
||||||
|
@ -105,7 +110,9 @@ list(APPEND FREELDR_BASE_SOURCE
|
||||||
freeldr/freeldr/oslist.c)
|
freeldr/freeldr/oslist.c)
|
||||||
|
|
||||||
if(ARCH MATCHES i386)
|
if(ARCH MATCHES i386)
|
||||||
list(APPEND FREELDR_BASE_SOURCE freeldr/freeldr/disk/scsiport.c)
|
list(APPEND FREELDR_BASE_SOURCE
|
||||||
|
freeldr/freeldr/windows/headless.c
|
||||||
|
freeldr/freeldr/disk/scsiport.c)
|
||||||
endif(ARCH MATCHES i386)
|
endif(ARCH MATCHES i386)
|
||||||
|
|
||||||
set_source_files_properties(${FREELDR_BASE_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_")
|
set_source_files_properties(${FREELDR_BASE_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_")
|
||||||
|
|
|
@ -13,15 +13,47 @@
|
||||||
NESTED_ENTRY _start
|
NESTED_ENTRY _start
|
||||||
PROLOG_END _start
|
PROLOG_END _start
|
||||||
|
|
||||||
#ifdef _OMAP3_
|
#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
|
||||||
/*
|
/*
|
||||||
* On OMAP3, the boot is directly from TI BootROM that reads NAND flash.
|
* On Beagle, the boot is directly from TI BootROM that reads NAND flash.
|
||||||
* First word is size of program to load.
|
* First word is size of program to load.
|
||||||
* Second word is load address of program. Since DDR is not initialized,
|
* Second word is load address of program. Since DDR is not initialized,
|
||||||
* we load to SDRAM at 40200000h. Max 64K.
|
* we load to SDRAM at 40200000h. Max 64K.
|
||||||
*/
|
*/
|
||||||
.word 0x8000
|
.word 0x8000
|
||||||
.word 0x40200000
|
.word 0x40200000
|
||||||
|
#elif _ZOOM2_
|
||||||
|
/*
|
||||||
|
* On ZOOM2, we currently load from u-boot to make bring-up easier.
|
||||||
|
*
|
||||||
|
* In order to get ATAG and all that goodness, we have to fool u-boot into
|
||||||
|
* thinking we are a Linux ARM kernel.
|
||||||
|
*
|
||||||
|
* So this is a 'fake' uImage-format header, which will make u-boot grok our
|
||||||
|
* image and correctly execute it.
|
||||||
|
*
|
||||||
|
* Note that a data checksum is in the header, but thankfully we can disable
|
||||||
|
* the check.
|
||||||
|
*
|
||||||
|
* There's also a header checksum, but as long as there's no need to modify
|
||||||
|
* this header, we can leave it static.
|
||||||
|
*
|
||||||
|
* Finally, note that the "Image String" is sized as a 32-byte array in the
|
||||||
|
* uImage header format. The string chosen below is not only accurate, but
|
||||||
|
* also happens to fit exactly in 32 bytes, meaning we don't need to pad.
|
||||||
|
*/
|
||||||
|
.word 0x56190527 // Header Magic
|
||||||
|
.word 0x5E4B8444 // Checksum
|
||||||
|
.word 0x483BE54C // Timestamp
|
||||||
|
.word 0x0CA10000 // Image size (64K)
|
||||||
|
.word 0x00000081 // Load address
|
||||||
|
.word 0x40000081 // Entrypoint
|
||||||
|
.word 0x90873DD8 // Data Checksum ('setenv verify n' must be set!)
|
||||||
|
.byte 5 // Linux OS
|
||||||
|
.byte 2 // ARM
|
||||||
|
.byte 2 // Kernel
|
||||||
|
.byte 0 // No compression
|
||||||
|
.ascii "ReactOS ARM Low-Level Bootloader"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Load C entrypoint and setup LLB stack */
|
/* Load C entrypoint and setup LLB stack */
|
||||||
|
@ -31,8 +63,14 @@
|
||||||
ENTRY_END _start
|
ENTRY_END _start
|
||||||
|
|
||||||
L_BootStackEnd:
|
L_BootStackEnd:
|
||||||
|
#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
|
||||||
.long 0x00010000
|
.long 0x00010000
|
||||||
|
#elif _ZOOM2_ // On ZOOM2 RAM starts at 0x80000000, not 0
|
||||||
|
.long 0x81014000
|
||||||
|
#else
|
||||||
|
#error Stack Address Not Defined
|
||||||
|
#endif
|
||||||
|
|
||||||
L_LlbStartup:
|
L_LlbStartup:
|
||||||
.long LlbStartup
|
.long LlbStartup
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ int printf(const char *fmt, ...)
|
||||||
return puts(printbuffer);
|
return puts(printbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
ULONG
|
||||||
DbgPrint(const char *fmt, ...)
|
DbgPrint(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
@ -52,6 +52,7 @@ DbgPrint(const char *fmt, ...)
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
|
for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
ULONG LlbEnvHwPageSize;
|
ULONG LlbEnvHwPageSize;
|
||||||
ULONG LlbEnvHwMemStart;
|
ULONG LlbEnvHwMemStart = 0;
|
||||||
ULONG LlbEnvHwMemSize;
|
ULONG LlbEnvHwMemSize = 0;
|
||||||
ULONG LlbEnvRamDiskStart;
|
ULONG LlbEnvRamDiskStart = 0;
|
||||||
ULONG LlbEnvRamDiskSize;
|
ULONG LlbEnvRamDiskSize = 0;
|
||||||
|
ULONG LlbEnvHwRevision;
|
||||||
CHAR LlbEnvCmdLine[256];
|
CHAR LlbEnvCmdLine[256];
|
||||||
CHAR LlbValueData[32];
|
CHAR LlbValueData[32];
|
||||||
|
|
||||||
|
@ -35,11 +36,17 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
||||||
LlbEnvHwPageSize = Atag->u.Core.PageSize;
|
LlbEnvHwPageSize = Atag->u.Core.PageSize;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ATAG_REVISION:
|
||||||
|
|
||||||
|
/* Save page size */
|
||||||
|
LlbEnvHwRevision = Atag->u.Revision.Rev;
|
||||||
|
break;
|
||||||
|
|
||||||
case ATAG_MEM:
|
case ATAG_MEM:
|
||||||
|
|
||||||
/* Save RAM start and size */
|
/* Save RAM start and size */
|
||||||
LlbEnvHwMemStart = Atag->u.Mem.Start;
|
if (!LlbEnvHwMemStart) LlbEnvHwMemStart = Atag->u.Mem.Start;
|
||||||
LlbEnvHwMemSize = Atag->u.Mem.Size;
|
LlbEnvHwMemSize += Atag->u.Mem.Size;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ATAG_INITRD2:
|
case ATAG_INITRD2:
|
||||||
|
@ -48,6 +55,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
||||||
LlbEnvRamDiskStart = Atag->u.InitRd2.Start;
|
LlbEnvRamDiskStart = Atag->u.InitRd2.Start;
|
||||||
LlbEnvRamDiskSize = Atag->u.InitRd2.Size;
|
LlbEnvRamDiskSize = Atag->u.InitRd2.Size;
|
||||||
|
|
||||||
|
#ifdef _BEAGLE_
|
||||||
/* Make sure it's 16MB-aligned */
|
/* Make sure it's 16MB-aligned */
|
||||||
LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
|
LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
|
||||||
&~ ((16 * 1024 * 1024) - 1);
|
&~ ((16 * 1024 * 1024) - 1);
|
||||||
|
@ -55,6 +63,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
||||||
/* The RAMDISK actually starts 16MB later */
|
/* The RAMDISK actually starts 16MB later */
|
||||||
LlbEnvRamDiskStart += 16 * 1024 * 1024;
|
LlbEnvRamDiskStart += 16 * 1024 * 1024;
|
||||||
LlbEnvRamDiskSize -= 16 * 1024 * 1024;
|
LlbEnvRamDiskSize -= 16 * 1024 * 1024;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ATAG_CMDLINE:
|
case ATAG_CMDLINE:
|
||||||
|
@ -68,7 +77,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
||||||
/* Nothing left to handle */
|
/* Nothing left to handle */
|
||||||
case ATAG_NONE:
|
case ATAG_NONE:
|
||||||
default:
|
default:
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Next tag */
|
/* Next tag */
|
||||||
|
@ -76,8 +85,11 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For debugging */
|
/* For debugging */
|
||||||
DbgPrint("[BOOTROM] PageSize: %dKB RAM: %dMB CMDLINE: %s\n",
|
DbgPrint("[BOOTROM] Board Revision: %lx PageSize: %dKB RAM: %dMB CMDLINE: %s\n"
|
||||||
LlbEnvHwPageSize / 1024, LlbEnvHwMemSize / 1024 / 1024, LlbEnvCmdLine);
|
"[RAMDISK] Base: %lx Size: %dMB\n",
|
||||||
|
LlbEnvHwRevision,
|
||||||
|
LlbEnvHwPageSize / 1024, LlbEnvHwMemSize / 1024 / 1024, LlbEnvCmdLine,
|
||||||
|
LlbEnvRamDiskStart, LlbEnvRamDiskSize / 1024 / 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -49,7 +49,11 @@ INT
|
||||||
LlbFwGetCh(VOID)
|
LlbFwGetCh(VOID)
|
||||||
{
|
{
|
||||||
/* Return the key pressed */
|
/* Return the key pressed */
|
||||||
|
#ifdef _ZOOM2_
|
||||||
|
return LlbKeypadGetChar();
|
||||||
|
#else
|
||||||
return LlbKeyboardGetChar();
|
return LlbKeyboardGetChar();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
|
|
42
boot/armllb/hw/matrix.c
Executable file
42
boot/armllb/hw/matrix.c
Executable file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/matrix.c
|
||||||
|
* PURPOSE: LLB Matrix Keypad Routines
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/* SYNPATICS KEYPAD MATRIX ****************************************************/
|
||||||
|
|
||||||
|
UCHAR KeyMatrix[8][8] =
|
||||||
|
{
|
||||||
|
{'e', 'r', 't', KEY_HOME, 0, 0, 'i', KEY_LEFTSHIFT},
|
||||||
|
{'d', 'f', 'g', KEY_SEND, 0, 0, 'k', KEY_ENTER},
|
||||||
|
{'x', 'c', 'v', KEY_END, 0, 0, '.', KEY_CAPS_LOCK},
|
||||||
|
{'z', '+', 'b', KEY_F1, 0, 0, 'o', KEY_SPACE},
|
||||||
|
{'w', 'y', 'u', KEY_F2, 0, 0, 'l', KEY_LEFT},
|
||||||
|
{'s', 'h', 'j', KEY_F3, 0, 0, 'm', KEY_RIGHT},
|
||||||
|
{'q', 'a', 'n', KEY_BACKSPACE, 0, 0, 'p', KEY_UP},
|
||||||
|
{0, 0, 0, 0, 0, 0, KEY_ENTER, KEY_DOWN}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
CHAR
|
||||||
|
NTAPI
|
||||||
|
LlbKeypadGetChar(VOID)
|
||||||
|
{
|
||||||
|
UCHAR ScanCode;
|
||||||
|
UCHAR Col, Row;
|
||||||
|
|
||||||
|
ScanCode = LlbHwKbdRead();
|
||||||
|
Col = ScanCode >> 4;
|
||||||
|
Row = ScanCode & 0xF;
|
||||||
|
|
||||||
|
/* Return the ASCII character */
|
||||||
|
return KeyMatrix[Col][Row];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
137
boot/armllb/hw/omap3-beagle/hwinfo.c
Executable file
137
boot/armllb/hw/omap3-beagle/hwinfo.c
Executable file
|
@ -0,0 +1,137 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-beagle/hwinfo.c
|
||||||
|
* PURPOSE: LLB Hardware Info Routines for OMAP3 Beagle
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetBoardType(VOID)
|
||||||
|
{
|
||||||
|
return MACH_TYPE_OMAP3_BEAGLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetPClk(VOID)
|
||||||
|
{
|
||||||
|
return 48000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetTmr0Base(VOID)
|
||||||
|
{
|
||||||
|
return 0x48318000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetSerialUart(VOID)
|
||||||
|
{
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwKbdSend(IN ULONG Value)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
LlbHwKbdReady(VOID)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT
|
||||||
|
NTAPI
|
||||||
|
LlbHwKbdRead(VOID)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetScreenWidth(VOID)
|
||||||
|
{
|
||||||
|
return 1280;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetScreenHeight(VOID)
|
||||||
|
{
|
||||||
|
return 720;
|
||||||
|
}
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetFrameBuffer(VOID)
|
||||||
|
{
|
||||||
|
return (PVOID)0x80500000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwVideoCreateColor(IN ULONG Red,
|
||||||
|
IN ULONG Green,
|
||||||
|
IN ULONG Blue)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// OMAP3 Memory Map
|
||||||
|
//
|
||||||
|
BIOS_MEMORY_MAP LlbHwOmap3MemoryMap[] =
|
||||||
|
{
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
||||||
|
{
|
||||||
|
PBIOS_MEMORY_MAP MapEntry;
|
||||||
|
ULONG Base, Size, FsBase, FsSize;
|
||||||
|
|
||||||
|
/* Parse hardware memory map */
|
||||||
|
MapEntry = LlbHwOmap3MemoryMap;
|
||||||
|
while (MapEntry->Length)
|
||||||
|
{
|
||||||
|
/* Add this entry */
|
||||||
|
LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
|
||||||
|
|
||||||
|
/* Move to the next one */
|
||||||
|
MapEntry++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Query memory and RAMDISK information */
|
||||||
|
LlbEnvGetMemoryInformation(&Base, &Size);
|
||||||
|
LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
|
||||||
|
|
||||||
|
/* Add-in the size of the ramdisk */
|
||||||
|
Base = FsBase + FsSize;
|
||||||
|
|
||||||
|
/* Subtract size of ramdisk and anything else before it */
|
||||||
|
Size -= Base;
|
||||||
|
|
||||||
|
/* Allocate an entry for it */
|
||||||
|
LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
LlbHwRtcRead(VOID)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS Boot Loader
|
* PROJECT: ReactOS Boot Loader
|
||||||
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
* FILE: boot/armllb/hw/omap3/hwinit.c
|
* FILE: boot/armllb/hw/omap3-beagle/hwinit.c
|
||||||
* PURPOSE: LLB Hardware Initialization Routines for OMAP3
|
* PURPOSE: LLB Hardware Initialization Routines for OMAP3 Beagle
|
||||||
* PROGRAMMERS: ReactOS Portable Systems Group
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
LlbHwInitialize(VOID)
|
LlbHwInitialize(VOID)
|
||||||
{
|
{
|
||||||
|
while (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
54
boot/armllb/hw/omap3-beagle/hwuart.c
Executable file
54
boot/armllb/hw/omap3-beagle/hwuart.c
Executable file
|
@ -0,0 +1,54 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-beagle/hwuart.c
|
||||||
|
* PURPOSE: LLB UART Initialization Routines for OMAP3 Beagle
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3UartInitialize(VOID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwUartSendChar(IN CHAR Char)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
LlbHwUartTxReady(VOID)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetUartBase(IN ULONG Port)
|
||||||
|
{
|
||||||
|
if (Port == 1)
|
||||||
|
{
|
||||||
|
return 0x4806A000;
|
||||||
|
}
|
||||||
|
else if (Port == 2)
|
||||||
|
{
|
||||||
|
return 0x4806C000;
|
||||||
|
}
|
||||||
|
else if (Port == 3)
|
||||||
|
{
|
||||||
|
return 0x49020000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
60
boot/armllb/hw/omap3-zoom2/hwinfo.c
Executable file
60
boot/armllb/hw/omap3-zoom2/hwinfo.c
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwuart.c
|
||||||
|
* PURPOSE: LLB Hardware Info Routines for OMAP3 ZOOM2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
TIMEINFO LlbTime;
|
||||||
|
|
||||||
|
#define BCD_INT(bcd) (((bcd & 0xf0) >> 4) * 10 + (bcd &0x0f))
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetBoardType(VOID)
|
||||||
|
{
|
||||||
|
return MACH_TYPE_OMAP_ZOOM2;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetPClk(VOID)
|
||||||
|
{
|
||||||
|
return 48000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetTmr0Base(VOID)
|
||||||
|
{
|
||||||
|
return 0x48318000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetSerialUart(VOID)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
LlbHwRtcRead(VOID)
|
||||||
|
{
|
||||||
|
/* Issue the GET_TIME request on the RTC control register */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4B, 0x29, 0x41);
|
||||||
|
|
||||||
|
/* Read the BCD registers and convert them */
|
||||||
|
LlbTime.Second = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1C));
|
||||||
|
LlbTime.Minute = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1D));
|
||||||
|
LlbTime.Hour = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1E));
|
||||||
|
LlbTime.Day = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x1F));
|
||||||
|
LlbTime.Month = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x20));
|
||||||
|
LlbTime.Year = BCD_INT(LlbHwOmap3TwlRead1(0x4B, 0x21));
|
||||||
|
LlbTime.Year += (LlbTime.Year > 80) ? 1900 : 2000;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
106
boot/armllb/hw/omap3-zoom2/hwinit.c
Executable file
106
boot/armllb/hw/omap3-zoom2/hwinit.c
Executable file
|
@ -0,0 +1,106 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwinit.c
|
||||||
|
* PURPOSE: LLB UART Initialization Routines for OMAP3 ZOOM2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// OMAP3 Memory Map
|
||||||
|
//
|
||||||
|
// 0x00000000 - 0x3FFFFFFF GPMC [ 1 GB]
|
||||||
|
// 0x40000000 - 0x47FFFFFF On-Chip Memory (ROM/SRAM Address Space) [128 MB]
|
||||||
|
// 0x48000000 - 0x4FFFFFFF L4 Interconnects (All system peripherals)[128 MB]
|
||||||
|
// 0x50000000 - 0x53FFFFFF SGX Graphics Accelerator Slave Port [ 64 MB]
|
||||||
|
// 0x54000000 - 0x57FFFFFF L4 Emulation [128 MB]
|
||||||
|
// 0x58000000 - 0x58FFFFFF Reserved [ 64 MB]
|
||||||
|
// 0x5C000000 - 0x5FFFFFFF IVA2.2 Subsystem [ 64 MB]
|
||||||
|
// 0x60000000 - 0x67FFFFFF Reserved [128 MB]
|
||||||
|
// 0x68000000 - 0x6FFFFFFF L3 Interconnect (Control Registers) [128 MB]
|
||||||
|
// 0x70000000 - 0x7FFFFFFF SDRC/SMS Virtual Address Space 0 [256 MB]
|
||||||
|
// 0x80000000 - 0x9FFFFFFF SDRC/SMS CS0 SDRAM [512 MB]
|
||||||
|
// 0x80000000 - 0x80FFFFFF KERNEL, HAL, BOOT DRIVERS [ 16 MB]
|
||||||
|
// THIS IS THE x86-STYLE "LOW 1MB" THAT IS IDENTITY MAPPED
|
||||||
|
// 0x81000000 - 0x8100FFFF ARM LLB [ 64 KB]
|
||||||
|
// 0x81010000 - 0x81013FFF ARM BOOT STACK [ 16 KB]
|
||||||
|
// 0x81014000 - 0x81073FFF ARM FRAMEBUFFER [384 KB]
|
||||||
|
// 0x81070000 - 0x81093FFF ARM OS LOADER [128 KB]
|
||||||
|
// 0x81094000 - 0x810FFFFF RESERVED FOR BOOT LOADER EXPANSION [432 KB]
|
||||||
|
// END OF THE x86-STYLE "LOW 1MB" THAT IS IDENTITY MAPPED
|
||||||
|
// 0x81100000 - 0x8FFFFFFF FREE RAM [ 15 MB]
|
||||||
|
// 0x82000000 - 0x83FFFFFF ARM RAMDISK [ 32 MB]
|
||||||
|
// 0x84000000 - 0x8FFFFFFF FREE RAM [192 MB]
|
||||||
|
// 0x90000000 - 0x9FFFFFFF FREE RAM IF > 256MB INSTALLED [256 MB]
|
||||||
|
// 0xA0000000 - 0xBFFFFFFF SDRC/SMS CS1 SDRAM [512 MB]
|
||||||
|
// 0xA0000000 - 0xAFFFFFFF FREE RAM IF > 512MB INSTALLED [256 MB]
|
||||||
|
// 0xB0000000 - 0xBFFFFFFF FREE RAM IF > 768MB INSTALLED [256 MB]
|
||||||
|
// 0xC0000000 - 0xDFFFFFFF Reserved [512 MB]
|
||||||
|
// 0xE0000000 - 0xFFFFFFFF SDRC/SMS Virtual Address Space 1 [512 MB]
|
||||||
|
BIOS_MEMORY_MAP LlbHwOmap3MemoryMap[] =
|
||||||
|
{
|
||||||
|
{0x00000000, 0x80000000, BiosMemoryReserved, 0}, /* Device Registers */
|
||||||
|
{0x80000000, 0x01000000, BiosMemoryUsable, 0}, /* 16 MB RAM for Kernel map */
|
||||||
|
{0x81000000, 0x00010000, BiosMemoryBootLoader, 0}, /* Arm LLB */
|
||||||
|
{0x81010000, 0x00004000, BiosMemoryBootStrap, 0}, // LLB Stack
|
||||||
|
{0x81014000, 0x00060000, BiosMemoryBootLoader, 0}, /* Kernel Framebuffer */
|
||||||
|
{0x81070000, 0x00020000, BiosMemoryBootStrap, 0}, /* ARM OS Loader */
|
||||||
|
{0x81094000, 0x0006C000, BiosMemoryBootStrap, 0}, /* ARM OS Loader Expansion */
|
||||||
|
{0x81100000, 0x00F00000, BiosMemoryUsable, 0}, /* 15 MB Free RAM */
|
||||||
|
{0x82000000, 0x02000000, BiosMemoryBootStrap, 0}, /* 32MB RAMDISK */
|
||||||
|
{0x84000000, 0x0C000000, BiosMemoryUsable, 0}, /* 192 MB Free RAM */
|
||||||
|
{0x90000000, 0x70000000, BiosMemoryReserved, 0},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwBuildMemoryMap(IN PBIOS_MEMORY_MAP MemoryMap)
|
||||||
|
{
|
||||||
|
PBIOS_MEMORY_MAP MapEntry;
|
||||||
|
ULONG Base, Size, FsBase, FsSize;
|
||||||
|
|
||||||
|
/* Parse hardware memory map */
|
||||||
|
MapEntry = LlbHwOmap3MemoryMap;
|
||||||
|
while (MapEntry->Length)
|
||||||
|
{
|
||||||
|
/* Add this entry */
|
||||||
|
LlbAllocateMemoryEntry(MapEntry->Type, MapEntry->BaseAddress, MapEntry->Length);
|
||||||
|
|
||||||
|
/* Move to the next one */
|
||||||
|
MapEntry++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Query memory and RAMDISK information */
|
||||||
|
LlbEnvGetMemoryInformation(&Base, &Size);
|
||||||
|
LlbEnvGetRamDiskInformation(&FsBase, &FsSize);
|
||||||
|
if (!FsSize) return;
|
||||||
|
#ifdef _BEAGLE_
|
||||||
|
/* Add-in the size of the ramdisk */
|
||||||
|
Base = FsBase + FsSize;
|
||||||
|
|
||||||
|
/* Subtract size of ramdisk and anything else before it */
|
||||||
|
Size -= Base;
|
||||||
|
|
||||||
|
/* Allocate an entry for it */
|
||||||
|
LlbAllocateMemoryEntry(BiosMemoryUsable, Base, Size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwInitialize(VOID)
|
||||||
|
{
|
||||||
|
/* Setup the UART (NS16550) */
|
||||||
|
LlbHwOmap3UartInitialize();
|
||||||
|
|
||||||
|
/* Setup the NEC WVGA LCD Panel and the Display Controller */
|
||||||
|
LlbHwOmap3LcdInitialize();
|
||||||
|
|
||||||
|
/* Setup the keyboard */
|
||||||
|
LlbHwOmap3SynKpdInitialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
129
boot/armllb/hw/omap3-zoom2/hwlcd.c
Executable file
129
boot/armllb/hw/omap3-zoom2/hwlcd.c
Executable file
|
@ -0,0 +1,129 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwlcd.c
|
||||||
|
* PURPOSE: LLB LCD Routines for OMAP3 ZOOM2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
PUSHORT LlbHwVideoBuffer;
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3LcdInitialize(VOID)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* N.B. The following initialization sequence took about 12 months to figure
|
||||||
|
* out.
|
||||||
|
* This means if you are glancing at it and have no idea what on Earth
|
||||||
|
* could possibly be going on, this is *normal*.
|
||||||
|
* Just trust that this turns on the LCD.
|
||||||
|
* And be thankful all you ever have to worry about is Java and HTML.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Turn on the functional and interface clocks in the entire PER domain */
|
||||||
|
WRITE_REGISTER_ULONG(0x48005000, 0x3ffff); /* Functional clocks */
|
||||||
|
WRITE_REGISTER_ULONG(0x48005010, 0x3ffff); /* Interface clocks */
|
||||||
|
|
||||||
|
/* Now that GPIO Module 3 is on, send a reset to the LCD panel on GPIO 96 */
|
||||||
|
WRITE_REGISTER_ULONG(0x49054034, 0); /* FIXME: Enable all as output */
|
||||||
|
WRITE_REGISTER_ULONG(0x49054094, 0xffffffff); /* FIXME: Output on all gpios */
|
||||||
|
|
||||||
|
/* Now turn on the functional and interface clocks in the CORE domain */
|
||||||
|
WRITE_REGISTER_ULONG(0x48004a00, 0x03fffe29); /* Functional clocks */
|
||||||
|
WRITE_REGISTER_ULONG(0x48004a10, 0x3ffffffb); /* Interface clocks */
|
||||||
|
|
||||||
|
/* The HS I2C interface is now on, configure it */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070024, 0x0); /* Disable I2c */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070030, 0x17); /* Configure clock divider */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070034, 0xd); /* Configure clock scaler */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070038, 0xf); /* Configure clock scaler */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070020, 0x215); /* Configure clocks and idle */
|
||||||
|
WRITE_REGISTER_USHORT(0x4807000c, 0x636f); /* Select wakeup bits */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070014, 0x4343); /* Disable DMA */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070024, 0x8000); /* Enable I2C */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the VPLL2 to cover all device groups instead of just P3.
|
||||||
|
* This essentially enables the VRRTC to power up the LCD panel.
|
||||||
|
*/
|
||||||
|
LlbHwOmap3TwlWrite1(0x4B, 0x8E, 0xE0);
|
||||||
|
|
||||||
|
/* VPLL2 runs at 1.2V by default, so we need to reprogram to 1.8V for DVI */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4B, 0x91, 0x05);
|
||||||
|
|
||||||
|
/* Set GPIO pin 7 on the TWL4030 as an output pin */
|
||||||
|
LlbHwOmap3TwlWrite1(0x49, 0x9B, 0x80);
|
||||||
|
|
||||||
|
/* Set GPIO pin 7 signal on the TWL4030 ON. This powers the LCD backlight */
|
||||||
|
LlbHwOmap3TwlWrite1(0x49, 0xA4, 0x80);
|
||||||
|
|
||||||
|
/* Now go on the McSPI interface and program it on for the channel */
|
||||||
|
WRITE_REGISTER_ULONG(0x48098010, 0x15);
|
||||||
|
WRITE_REGISTER_ULONG(0x48098020, 0x1);
|
||||||
|
WRITE_REGISTER_ULONG(0x48098028, 0x1);
|
||||||
|
WRITE_REGISTER_ULONG(0x4809802c, 0x112fdc);
|
||||||
|
|
||||||
|
/* Send the reset signal (R2 = 00h) to the NEC WVGA LCD Panel */
|
||||||
|
WRITE_REGISTER_ULONG(0x48098034, 0x1);
|
||||||
|
WRITE_REGISTER_ULONG(0x48098038, 0x20100);
|
||||||
|
WRITE_REGISTER_ULONG(0x48098034, 0x0);
|
||||||
|
|
||||||
|
/* Turn on the functional and interface clocks in the DSS domain */
|
||||||
|
WRITE_REGISTER_ULONG(0x48004e00, 0x5);
|
||||||
|
WRITE_REGISTER_ULONG(0x48004e10, 0x1);
|
||||||
|
|
||||||
|
/* Reset the Display Controller (DISPC) */
|
||||||
|
WRITE_REGISTER_ULONG(0x48050410, 0x00000005); // DISPC_SYSCONFIG
|
||||||
|
|
||||||
|
/* Set the frame buffer address */
|
||||||
|
WRITE_REGISTER_ULONG(0x48050480, 0x800A0000); // DISPC_GFX_BA0
|
||||||
|
|
||||||
|
/* Set resolution and RGB16 color mode */
|
||||||
|
WRITE_REGISTER_ULONG(0x4805048c, 0x01df031f); // DISPC_GFX_SIZE
|
||||||
|
WRITE_REGISTER_ULONG(0x480504a0, 0x0000000d); // DISPC_GFX_ATTRIBUTES
|
||||||
|
|
||||||
|
/* Set LCD timings (VSync and HSync), pixel clock, and LCD size */
|
||||||
|
WRITE_REGISTER_ULONG(0x4805046c, 0x00003000); // DISPC_POL_FREQ
|
||||||
|
WRITE_REGISTER_ULONG(0x48050470, 0x00010004); // DISPC_DIVISOR
|
||||||
|
WRITE_REGISTER_ULONG(0x48050464, 0x00300500); // DISPC_TIMING_H
|
||||||
|
WRITE_REGISTER_ULONG(0x48050468, 0x00400300); // DISPC_TIMING_V
|
||||||
|
WRITE_REGISTER_ULONG(0x4805047c, 0x01df031f); // DISPC_SIZE_LCD
|
||||||
|
|
||||||
|
/* Turn the LCD on */
|
||||||
|
WRITE_REGISTER_ULONG(0x48050440, 0x00018309); // DISPC_CONTROL
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetScreenWidth(VOID)
|
||||||
|
{
|
||||||
|
return 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetScreenHeight(VOID)
|
||||||
|
{
|
||||||
|
return 480;
|
||||||
|
}
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetFrameBuffer(VOID)
|
||||||
|
{
|
||||||
|
return (PVOID)0x800A0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwVideoCreateColor(IN ULONG Red,
|
||||||
|
IN ULONG Green,
|
||||||
|
IN ULONG Blue)
|
||||||
|
{
|
||||||
|
return (((Red >> 3) << 11)| ((Green >> 2) << 5)| ((Blue >> 3) << 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
83
boot/armllb/hw/omap3-zoom2/hwsynkp.c
Executable file
83
boot/armllb/hw/omap3-zoom2/hwsynkp.c
Executable file
|
@ -0,0 +1,83 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwsynkpd.c
|
||||||
|
* PURPOSE: LLB Synpatics Keypad Support for OMAP3 ZOOM 2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3SynKpdInitialize(VOID)
|
||||||
|
{
|
||||||
|
/* Set GPIO pin 8 on the TWL4030 as an output pin */
|
||||||
|
LlbHwOmap3TwlWrite1(0x49, 0x9B, 0xC0);
|
||||||
|
|
||||||
|
/* Set GPIO pin 8 signal on the TWL4030 ON. This powers the keypad backlight */
|
||||||
|
LlbHwOmap3TwlWrite1(0x49, 0xA4, 0xC0);
|
||||||
|
|
||||||
|
/* Set PENDDIS and COR on the the keypad interrupt controller */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4A, 0xE9, 0x06);
|
||||||
|
|
||||||
|
/* Only falling edge detection for key pressed */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4A, 0xE8, 0x01);
|
||||||
|
|
||||||
|
/* Unmask key-pressed events */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4A, 0xE4, 0x0E);
|
||||||
|
|
||||||
|
/* Set the keypad control register to turn hardware sequencing and turn it on */
|
||||||
|
LlbHwOmap3TwlWrite1(0x4A, 0xD2, 0x0);
|
||||||
|
LlbHwOmap3TwlRead1(0x4A, 0xE3);
|
||||||
|
LlbHwOmap3TwlWrite1(0x4A, 0xD2, 0x43);
|
||||||
|
}
|
||||||
|
|
||||||
|
UCHAR KeyboardMatrixStatus[8];
|
||||||
|
BOOLEAN LastState = FALSE;
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
LlbHwKbdReady(VOID)
|
||||||
|
{
|
||||||
|
UCHAR Value;
|
||||||
|
|
||||||
|
Value = LlbHwOmap3TwlRead1(0x4A, 0xE3);
|
||||||
|
if (!Value) return FALSE;
|
||||||
|
|
||||||
|
LastState ^= 1;
|
||||||
|
if (!LastState) return FALSE;
|
||||||
|
|
||||||
|
/* Return whether or not an interrupt is pending */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT
|
||||||
|
NTAPI
|
||||||
|
LlbHwKbdRead(VOID)
|
||||||
|
{
|
||||||
|
UCHAR ActiveCol = 0, ActiveRow = 0, col, coldata, row;
|
||||||
|
|
||||||
|
for (col = 0; col < 8; col++)
|
||||||
|
{
|
||||||
|
coldata = LlbHwOmap3TwlRead1(0x4A, 0xDB + col);
|
||||||
|
if (coldata)
|
||||||
|
{
|
||||||
|
for (row = 0; row < 8; row++)
|
||||||
|
{
|
||||||
|
if (coldata == (1 << row))
|
||||||
|
{
|
||||||
|
ActiveRow = row;
|
||||||
|
ActiveCol = col;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((ActiveCol << 4) | ActiveRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
69
boot/armllb/hw/omap3-zoom2/hwtwl40x.c
Executable file
69
boot/armllb/hw/omap3-zoom2/hwtwl40x.c
Executable file
|
@ -0,0 +1,69 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwsynkpd.c
|
||||||
|
* PURPOSE: LLB Synpatics Keypad Support for OMAP3 ZOOM 2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
UCHAR
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlRead1(IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress)
|
||||||
|
{
|
||||||
|
volatile int i = 1000;
|
||||||
|
|
||||||
|
/* Select the register */
|
||||||
|
LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 0, NULL);
|
||||||
|
|
||||||
|
/* Now read it */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070024, 0x8401);
|
||||||
|
for (i = 1000; i > 0; i--);
|
||||||
|
return READ_REGISTER_USHORT(0x4807001c);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlWrite(IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress,
|
||||||
|
IN UCHAR Length,
|
||||||
|
IN PUCHAR Values)
|
||||||
|
{
|
||||||
|
volatile int i = 1000;
|
||||||
|
ULONG j;
|
||||||
|
|
||||||
|
/* Select chip address */
|
||||||
|
WRITE_REGISTER_USHORT(0x4807002c, ChipAddress);
|
||||||
|
WRITE_REGISTER_USHORT(0x48070018, Length + 1);
|
||||||
|
|
||||||
|
/* Enable master transmit mode */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070024, 0x8601);
|
||||||
|
WRITE_REGISTER_USHORT(0x4807001c, RegisterAddress);
|
||||||
|
|
||||||
|
/* Loop each byte */
|
||||||
|
for (j = 0; j < Length; j++)
|
||||||
|
{
|
||||||
|
/* Write the data */
|
||||||
|
WRITE_REGISTER_USHORT(0x4807001c, Values[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Issue stop command */
|
||||||
|
WRITE_REGISTER_USHORT(0x48070024, 0x8602);
|
||||||
|
for (i = 1000; i > 0; i--);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress,
|
||||||
|
IN UCHAR Value)
|
||||||
|
{
|
||||||
|
/* Do the actual write */
|
||||||
|
LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 1, &Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
62
boot/armllb/hw/omap3-zoom2/hwuart.c
Executable file
62
boot/armllb/hw/omap3-zoom2/hwuart.c
Executable file
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/hw/omap3-zoom2/hwuart.c
|
||||||
|
* PURPOSE: LLB UART Initialization Routines for OMAP3 ZOOM2
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
#define SERIAL_REGISTER_STRIDE 2
|
||||||
|
#include "lib/cportlib/cport.c"
|
||||||
|
|
||||||
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
#define SERIAL_TL16CP754C_QUAD0_BASE (PVOID)0x10000000
|
||||||
|
|
||||||
|
CPPORT LlbHwOmap3UartPorts[4] =
|
||||||
|
{
|
||||||
|
{NULL, 0, 0},
|
||||||
|
{NULL, 0, 0},
|
||||||
|
{NULL, 0, 0},
|
||||||
|
{NULL, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3UartInitialize(VOID)
|
||||||
|
{
|
||||||
|
CpInitialize(&LlbHwOmap3UartPorts[0], SERIAL_TL16CP754C_QUAD0_BASE, 115200);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwUartSendChar(IN CHAR Char)
|
||||||
|
{
|
||||||
|
/* Send the character */
|
||||||
|
CpPutByte(&LlbHwOmap3UartPorts[0], Char);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
LlbHwUartTxReady(VOID)
|
||||||
|
{
|
||||||
|
/* TX output buffer is ready? */
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
LlbHwGetUartBase(IN ULONG Port)
|
||||||
|
{
|
||||||
|
if (Port == 0)
|
||||||
|
{
|
||||||
|
return 0x10000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* PROJECT: ReactOS Boot Loader
|
|
||||||
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
||||||
* FILE: boot/armllb/hw/omap3/hwinfo.c
|
|
||||||
* PURPOSE: LLB Hardware Info Routines for OMAP3
|
|
||||||
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "precomp.h"
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetScreenWidth(VOID)
|
|
||||||
{
|
|
||||||
return 1280;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetScreenHeight(VOID)
|
|
||||||
{
|
|
||||||
return 720;
|
|
||||||
}
|
|
||||||
|
|
||||||
PVOID
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetFrameBuffer(VOID)
|
|
||||||
{
|
|
||||||
return (PVOID)0x80500000;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetBoardType(VOID)
|
|
||||||
{
|
|
||||||
return MACH_TYPE_OMAP3_BEAGLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetPClk(VOID)
|
|
||||||
{
|
|
||||||
return 48000000;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetTmr0Base(VOID)
|
|
||||||
{
|
|
||||||
return 0x48318000;
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetUartBase(IN ULONG Port)
|
|
||||||
{
|
|
||||||
if (Port == 1)
|
|
||||||
{
|
|
||||||
return 0x4806A000;
|
|
||||||
}
|
|
||||||
else if (Port == 2)
|
|
||||||
{
|
|
||||||
return 0x4806C000;
|
|
||||||
}
|
|
||||||
else if (Port == 3)
|
|
||||||
{
|
|
||||||
return 0x49020000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ULONG
|
|
||||||
NTAPI
|
|
||||||
LlbHwGetSerialUart(VOID)
|
|
||||||
{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
|
@ -11,7 +11,12 @@
|
||||||
#define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400)
|
#define LEAPS_THRU_END_OF(y) ((y)/4 - (y)/100 + (y)/400)
|
||||||
|
|
||||||
UCHAR LlbDaysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
UCHAR LlbDaysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||||
|
|
||||||
|
#ifndef _ZOOM2_
|
||||||
TIMEINFO LlbTime;
|
TIMEINFO LlbTime;
|
||||||
|
#else
|
||||||
|
extern TIMEINFO LlbTime;
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -82,9 +87,10 @@ LlbGetTime(VOID)
|
||||||
|
|
||||||
/* Read RTC time */
|
/* Read RTC time */
|
||||||
RtcTime = LlbHwRtcRead();
|
RtcTime = LlbHwRtcRead();
|
||||||
|
#ifndef _ZOOM2_
|
||||||
/* Convert it */
|
/* Convert it */
|
||||||
LlbConvertRtcTime(RtcTime, &LlbTime);
|
LlbConvertRtcTime(RtcTime, &LlbTime);
|
||||||
|
#endif
|
||||||
return &LlbTime;
|
return &LlbTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,11 @@ LlbVideoClearScreen(IN BOOLEAN OsLoader)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Deep blue */
|
/* Deep blue */
|
||||||
|
#ifdef BLUE_SCREEN
|
||||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||||
|
#else
|
||||||
|
BackColor = LlbHwVideoCreateColor(0, 0, 0);
|
||||||
|
#endif
|
||||||
BackColor = (BackColor << 16) | BackColor;
|
BackColor = (BackColor << 16) | BackColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,8 +350,12 @@ LlbVideoPutChar(IN UCHAR c)
|
||||||
{
|
{
|
||||||
ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
|
ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
|
||||||
|
|
||||||
/* Forecolor on this machine */
|
/* Backcolor on this machine */
|
||||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
#ifdef BLUE_SCREEN
|
||||||
|
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||||
|
#else
|
||||||
|
BackColor = LlbHwVideoCreateColor(0, 0, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Amount of characters in a line */
|
/* Amount of characters in a line */
|
||||||
ScreenWidth = LlbHwGetScreenWidth();
|
ScreenWidth = LlbHwGetScreenWidth();
|
||||||
|
|
|
@ -25,6 +25,11 @@ typedef struct _ATAG_MEM
|
||||||
ULONG Start;
|
ULONG Start;
|
||||||
} ATAG_MEM, *PATAG_MEM;
|
} ATAG_MEM, *PATAG_MEM;
|
||||||
|
|
||||||
|
typedef struct _ATAG_REVISION
|
||||||
|
{
|
||||||
|
ULONG Rev;
|
||||||
|
} ATAG_REVISION, *PATAG_REVISION;
|
||||||
|
|
||||||
typedef struct _ATAG_INITRD2
|
typedef struct _ATAG_INITRD2
|
||||||
{
|
{
|
||||||
ULONG Start;
|
ULONG Start;
|
||||||
|
@ -43,6 +48,7 @@ typedef struct _ATAG
|
||||||
{
|
{
|
||||||
ATAG_CORE Core;
|
ATAG_CORE Core;
|
||||||
ATAG_MEM Mem;
|
ATAG_MEM Mem;
|
||||||
|
ATAG_REVISION Revision;
|
||||||
ATAG_INITRD2 InitRd2;
|
ATAG_INITRD2 InitRd2;
|
||||||
ATAG_CMDLINE CmdLine;
|
ATAG_CMDLINE CmdLine;
|
||||||
} u;
|
} u;
|
||||||
|
|
|
@ -12,4 +12,10 @@ LlbKeyboardGetChar(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CHAR
|
||||||
|
NTAPI
|
||||||
|
LlbKeypadGetChar(
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -24,4 +24,9 @@
|
||||||
//
|
//
|
||||||
#define MACH_TYPE_OMAP3_BEAGLE 1546
|
#define MACH_TYPE_OMAP3_BEAGLE 1546
|
||||||
|
|
||||||
|
//
|
||||||
|
// LogicPD ZOOM-II MDK Board, OMAP3530 SoC
|
||||||
|
//
|
||||||
|
#define MACH_TYPE_OMAP_ZOOM2 1967
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
51
boot/armllb/inc/omap3.h
Executable file
51
boot/armllb/inc/omap3.h
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS Boot Loader
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: boot/armllb/inc/omap3.h
|
||||||
|
* PURPOSE: LLB Board-Specific Hardware Functions for OMAP3
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3UartInitialize(
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3LcdInitialize(
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
UCHAR
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlRead1(
|
||||||
|
IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlWrite(
|
||||||
|
IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress,
|
||||||
|
IN UCHAR Length,
|
||||||
|
IN PUCHAR Values
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3TwlWrite1(
|
||||||
|
IN UCHAR ChipAddress,
|
||||||
|
IN UCHAR RegisterAddress,
|
||||||
|
IN UCHAR Value
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
LlbHwOmap3SynKpdInitialize(
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -17,11 +17,7 @@
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "envir.h"
|
#include "envir.h"
|
||||||
|
#include "../../freeldr/freeldr/include/keycodes.h"
|
||||||
VOID
|
#include "debug.h"
|
||||||
DbgPrint(
|
|
||||||
const char *fmt,
|
|
||||||
...
|
|
||||||
);
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -16,17 +16,17 @@ LlbStartup(IN ULONG Reserved,
|
||||||
/* Make sure we are booting on the correct kind of machine */
|
/* Make sure we are booting on the correct kind of machine */
|
||||||
if (BoardInfo != LlbHwGetBoardType()) while (TRUE);
|
if (BoardInfo != LlbHwGetBoardType()) while (TRUE);
|
||||||
|
|
||||||
/* Either QEMU or U-Boot itself should send this information */
|
|
||||||
LlbEnvParseArguments(Arguments);
|
|
||||||
|
|
||||||
/* Initialize hardware components */
|
/* Initialize hardware components */
|
||||||
LlbHwInitialize();
|
LlbHwInitialize();
|
||||||
|
|
||||||
|
/* Either QEMU or U-Boot itself should send this information */
|
||||||
|
LlbEnvParseArguments(Arguments);
|
||||||
|
|
||||||
/* Clean up the screen */
|
/* Clean up the screen */
|
||||||
LlbVideoClearScreen(FALSE);
|
LlbVideoClearScreen(FALSE);
|
||||||
|
|
||||||
/* Print header */
|
/* Print header */
|
||||||
printf("ReactOS ARM Low-Level Boot Loader [" __DATE__ " "__TIME__ "]\n");
|
printf("\nReactOS ARM Low-Level Boot Loader [" __DATE__ " "__TIME__ "]\n");
|
||||||
|
|
||||||
/* Boot the OS Loader */
|
/* Boot the OS Loader */
|
||||||
LlbBoot();
|
LlbBoot();
|
||||||
|
|
|
@ -91,6 +91,38 @@ LlbBuildMemoryMap(VOID)
|
||||||
LlbHwBuildMemoryMap(MemoryMap);
|
LlbHwBuildMemoryMap(MemoryMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Should go to hwdev.c
|
||||||
|
//
|
||||||
|
POSLOADER_INIT
|
||||||
|
NTAPI
|
||||||
|
LlbHwLoadOsLoaderFromRam(VOID)
|
||||||
|
{
|
||||||
|
ULONG Base, RootFs, Size;
|
||||||
|
PCHAR Offset;
|
||||||
|
CHAR CommandLine[64];
|
||||||
|
|
||||||
|
/* On versatile we load the RAMDISK with initrd */
|
||||||
|
LlbEnvGetRamDiskInformation(&RootFs, &Size);
|
||||||
|
DbgPrint("Root fs: %lx, size: %lx\n", RootFs, Size);
|
||||||
|
|
||||||
|
/* The OS Loader is at 0x20000, always */
|
||||||
|
Base = 0x20000;
|
||||||
|
|
||||||
|
/* Read image offset */
|
||||||
|
Offset = LlbEnvRead("rdoffset");
|
||||||
|
|
||||||
|
/* Set parameters for the OS loader */
|
||||||
|
snprintf(CommandLine,
|
||||||
|
sizeof(CommandLine),
|
||||||
|
"rdbase=0x%x rdsize=0x%x rdoffset=%s",
|
||||||
|
RootFs, Size, Offset);
|
||||||
|
LlbSetCommandLine(CommandLine);
|
||||||
|
|
||||||
|
/* Return the OS loader base address */
|
||||||
|
return (POSLOADER_INIT)Base;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
LlbLoadOsLoader(VOID)
|
LlbLoadOsLoader(VOID)
|
||||||
|
@ -118,6 +150,11 @@ LlbLoadOsLoader(VOID)
|
||||||
{
|
{
|
||||||
//todo
|
//todo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoaderInit = (PVOID)0x80000000;
|
||||||
|
#ifdef _ZOOM2_ // need something better than this...
|
||||||
|
LoaderInit = (PVOID)0x81070000;
|
||||||
|
#endif
|
||||||
printf("OS Loader loaded at 0x%p...JUMP!\n\n\n\n\n", LoaderInit);
|
printf("OS Loader loaded at 0x%p...JUMP!\n\n\n\n\n", LoaderInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +170,7 @@ LlbBoot(VOID)
|
||||||
|
|
||||||
/* Load the OS loader */
|
/* Load the OS loader */
|
||||||
LlbLoadOsLoader();
|
LlbLoadOsLoader();
|
||||||
|
|
||||||
/* Jump to the OS Loader (FreeLDR in this case) */
|
/* Jump to the OS Loader (FreeLDR in this case) */
|
||||||
LoaderInit(&ArmBlock);
|
LoaderInit(&ArmBlock);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
.title "ARM FreeLDR Entry Point"
|
.title "ARM FreeLDR Entry Point"
|
||||||
.include "ntoskrnl/include/internal/arm/kxarm.h"
|
.include "ntoskrnl/include/internal/arm/kxarm.h"
|
||||||
.include "ntoskrnl/include/internal/arm/ksarm.h"
|
.include "ntoskrnl/include/internal/arm/ksarm.h"
|
||||||
|
.section .init
|
||||||
|
|
||||||
NESTED_ENTRY _start
|
NESTED_ENTRY _start
|
||||||
PROLOG_END _start
|
PROLOG_END _start
|
||||||
|
|
|
@ -74,7 +74,8 @@ ArmInit(IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
|
||||||
/* This should probably go away once we support more boards */
|
/* This should probably go away once we support more boards */
|
||||||
ASSERT((ArmBoardBlock->BoardType == MACH_TYPE_FEROCEON) ||
|
ASSERT((ArmBoardBlock->BoardType == MACH_TYPE_FEROCEON) ||
|
||||||
(ArmBoardBlock->BoardType == MACH_TYPE_VERSATILE_PB) ||
|
(ArmBoardBlock->BoardType == MACH_TYPE_VERSATILE_PB) ||
|
||||||
(ArmBoardBlock->BoardType == MACH_TYPE_OMAP3_BEAGLE));
|
(ArmBoardBlock->BoardType == MACH_TYPE_OMAP3_BEAGLE) ||
|
||||||
|
(ArmBoardBlock->BoardType == MACH_TYPE_OMAP_ZOOM2));
|
||||||
|
|
||||||
/* Call FreeLDR's portable entrypoint with our command-line */
|
/* Call FreeLDR's portable entrypoint with our command-line */
|
||||||
BootMain(ArmBoardBlock->CommandLine);
|
BootMain(ArmBoardBlock->CommandLine);
|
||||||
|
@ -156,6 +157,16 @@ ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap,
|
||||||
VOID
|
VOID
|
||||||
MachInit(IN PCCH CommandLine)
|
MachInit(IN PCCH CommandLine)
|
||||||
{
|
{
|
||||||
|
/* Copy Machine Routines from Firmware Table */
|
||||||
|
MachVtbl.ConsPutChar = ArmBoardBlock->ConsPutChar;
|
||||||
|
MachVtbl.ConsKbHit = ArmBoardBlock->ConsKbHit;
|
||||||
|
MachVtbl.ConsGetCh = ArmBoardBlock->ConsGetCh;
|
||||||
|
MachVtbl.VideoClearScreen = ArmBoardBlock->VideoClearScreen;
|
||||||
|
MachVtbl.VideoSetDisplayMode = ArmBoardBlock->VideoSetDisplayMode;
|
||||||
|
MachVtbl.VideoGetDisplaySize = ArmBoardBlock->VideoGetDisplaySize;
|
||||||
|
MachVtbl.VideoPutChar = ArmBoardBlock->VideoPutChar;
|
||||||
|
MachVtbl.GetTime = ArmBoardBlock->GetTime;
|
||||||
|
|
||||||
/* Setup board-specific ARM routines */
|
/* Setup board-specific ARM routines */
|
||||||
switch (ArmBoardBlock->BoardType)
|
switch (ArmBoardBlock->BoardType)
|
||||||
{
|
{
|
||||||
|
@ -164,29 +175,24 @@ MachInit(IN PCCH CommandLine)
|
||||||
TuiPrintf("Not implemented\n");
|
TuiPrintf("Not implemented\n");
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Check for TI OMAP3 ZOOM-II MDK */
|
||||||
|
case MACH_TYPE_OMAP_ZOOM2:
|
||||||
|
|
||||||
|
/* Setup the disk and file system buffers */
|
||||||
|
gDiskReadBuffer = 0x81094000;
|
||||||
|
gFileSysBuffer = 0x81094000;
|
||||||
|
break;
|
||||||
|
|
||||||
/* Check for ARM Versatile PB boards */
|
/* Check for ARM Versatile PB boards */
|
||||||
case MACH_TYPE_VERSATILE_PB:
|
case MACH_TYPE_VERSATILE_PB:
|
||||||
|
|
||||||
/* Copy Machine Routines from Firmware Table */
|
|
||||||
MachVtbl.ConsPutChar = ArmBoardBlock->ConsPutChar;
|
|
||||||
MachVtbl.ConsKbHit = ArmBoardBlock->ConsKbHit;
|
|
||||||
MachVtbl.ConsGetCh = ArmBoardBlock->ConsGetCh;
|
|
||||||
MachVtbl.VideoClearScreen = ArmBoardBlock->VideoClearScreen;
|
|
||||||
MachVtbl.VideoSetDisplayMode = ArmBoardBlock->VideoSetDisplayMode;
|
|
||||||
MachVtbl.VideoGetDisplaySize = ArmBoardBlock->VideoGetDisplaySize;
|
|
||||||
MachVtbl.VideoPutChar = ArmBoardBlock->VideoPutChar;
|
|
||||||
MachVtbl.GetTime = ArmBoardBlock->GetTime;
|
|
||||||
|
|
||||||
/* Setup the disk and file system buffers */
|
/* Setup the disk and file system buffers */
|
||||||
gDiskReadBuffer = 0x00090000;
|
gDiskReadBuffer = 0x00090000;
|
||||||
gFileSysBuffer = 0x00090000;
|
gFileSysBuffer = 0x00090000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/* Check for TI OMAP3 Beagleboard */
|
||||||
* Check for TI OMAP3 boards
|
|
||||||
* For now that means only Beagle, but ZOOM and others should be ok too
|
|
||||||
*/
|
|
||||||
case MACH_TYPE_OMAP3_BEAGLE:
|
case MACH_TYPE_OMAP3_BEAGLE:
|
||||||
TuiPrintf("Not implemented\n");
|
TuiPrintf("Not implemented\n");
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
|
@ -195,7 +201,7 @@ MachInit(IN PCCH CommandLine)
|
||||||
default:
|
default:
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup generic ARM routines for all boards */
|
/* Setup generic ARM routines for all boards */
|
||||||
MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
|
MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
|
||||||
MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
|
MachVtbl.GetMemoryMap = ArmMemGetMemoryMap;
|
||||||
|
|
54
boot/freeldr/freeldr/freeldr_arm.lnk
Normal file
54
boot/freeldr/freeldr/freeldr_arm.lnk
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
OUTPUT_FORMAT(pei-arm-wince-little)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text __image_base__ + __section_alignment__ :
|
||||||
|
{
|
||||||
|
__text_start__ = .;
|
||||||
|
*(.init)
|
||||||
|
*(.text)
|
||||||
|
*(SORT(.text$*))
|
||||||
|
*(.glue_7t)
|
||||||
|
*(.glue_7)
|
||||||
|
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
|
||||||
|
LONG (-1); *(.ctors); *(.ctor); LONG (0);
|
||||||
|
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
|
||||||
|
LONG (-1); *(.dtors); *(.dtor); LONG (0);
|
||||||
|
*(.fini)
|
||||||
|
/* ??? Why is .gcc_exc here? */
|
||||||
|
*(.gcc_exc)
|
||||||
|
__text_end__ = .;
|
||||||
|
*(.gcc_except_table)
|
||||||
|
}
|
||||||
|
init BLOCK(__section_alignment__) :
|
||||||
|
{
|
||||||
|
__init_start__ = . ;
|
||||||
|
*(init)
|
||||||
|
__init_end__ = . ;
|
||||||
|
}
|
||||||
|
.data BLOCK(__section_alignment__) :
|
||||||
|
{
|
||||||
|
__data_start__ = . ;
|
||||||
|
*(.data)
|
||||||
|
*(.data2)
|
||||||
|
*(SORT(.data$*))
|
||||||
|
__data_end__ = . ;
|
||||||
|
__bss_start__ = . ;
|
||||||
|
*(.bss)
|
||||||
|
*(COMMON)
|
||||||
|
__bss_end__ = . ;
|
||||||
|
}
|
||||||
|
.rdata BLOCK(__section_alignment__) :
|
||||||
|
{
|
||||||
|
*(.rdata)
|
||||||
|
*(SORT(.rdata$*))
|
||||||
|
*(.eh_frame)
|
||||||
|
}
|
||||||
|
/DISCARD/ :
|
||||||
|
{
|
||||||
|
[ .stab ]
|
||||||
|
[ .stabstr ]
|
||||||
|
*(.reloc)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -24,11 +24,14 @@
|
||||||
#define KEY_ENTER 0x0D
|
#define KEY_ENTER 0x0D
|
||||||
#define KEY_BACKSPACE 0x08
|
#define KEY_BACKSPACE 0x08
|
||||||
#define KEY_SPACE 0x20
|
#define KEY_SPACE 0x20
|
||||||
|
#define KEY_LEFTSHIFT 0x2A
|
||||||
|
#define KEY_HOME 0x47
|
||||||
#define KEY_UP 0x48
|
#define KEY_UP 0x48
|
||||||
#define KEY_DOWN 0x50
|
#define KEY_DOWN 0x50
|
||||||
#define KEY_LEFT 0x4B
|
#define KEY_LEFT 0x4B
|
||||||
#define KEY_RIGHT 0x4D
|
#define KEY_RIGHT 0x4D
|
||||||
#define KEY_ESC 0x1B
|
#define KEY_ESC 0x1B
|
||||||
|
#define KEY_CAPS_LOCK 0x3A
|
||||||
#define KEY_F1 0x3B
|
#define KEY_F1 0x3B
|
||||||
#define KEY_F2 0x3C
|
#define KEY_F2 0x3C
|
||||||
#define KEY_F3 0x3D
|
#define KEY_F3 0x3D
|
||||||
|
@ -38,4 +41,7 @@
|
||||||
#define KEY_F7 0x41
|
#define KEY_F7 0x41
|
||||||
#define KEY_F8 0x42
|
#define KEY_F8 0x42
|
||||||
#define KEY_F9 0x43
|
#define KEY_F9 0x43
|
||||||
#define KEY_F10 0x44
|
#define KEY_F10 0x44
|
||||||
|
#define KEY_KEYPAD_PLUS 0x4e
|
||||||
|
#define KEY_END 0x4f
|
||||||
|
#define KEY_SEND 0xE7
|
||||||
|
|
|
@ -85,7 +85,6 @@ PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType)
|
||||||
PVOID MmHeapAlloc(ULONG MemorySize)
|
PVOID MmHeapAlloc(ULONG MemorySize)
|
||||||
{
|
{
|
||||||
PVOID Result;
|
PVOID Result;
|
||||||
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
|
||||||
|
|
||||||
if (MemorySize > MM_PAGE_SIZE)
|
if (MemorySize > MM_PAGE_SIZE)
|
||||||
{
|
{
|
||||||
|
@ -99,13 +98,17 @@ PVOID MmHeapAlloc(ULONG MemorySize)
|
||||||
{
|
{
|
||||||
DPRINTM(DPRINT_MEMORY, "Heap allocation for %d bytes failed\n", MemorySize);
|
DPRINTM(DPRINT_MEMORY, "Heap allocation for %d bytes failed\n", MemorySize);
|
||||||
}
|
}
|
||||||
|
#if MM_DBG
|
||||||
|
{
|
||||||
|
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
||||||
|
|
||||||
// Gather some stats
|
// Gather some stats
|
||||||
bstats(&CurAlloc, &TotalFree, &MaxFree, &NumberOfGets, &NumberOfRels);
|
bstats(&CurAlloc, &TotalFree, &MaxFree, &NumberOfGets, &NumberOfRels);
|
||||||
|
|
||||||
DPRINTM(DPRINT_MEMORY, "Current alloced %d bytes, free %d bytes, allocs %d, frees %d\n",
|
|
||||||
CurAlloc, TotalFree, NumberOfGets, NumberOfRels);
|
|
||||||
|
|
||||||
|
DPRINTM(DPRINT_MEMORY, "Current alloced %d bytes, free %d bytes, allocs %d, frees %d\n",
|
||||||
|
CurAlloc, TotalFree, NumberOfGets, NumberOfRels);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -407,6 +407,7 @@
|
||||||
all buffers allocated are a
|
all buffers allocated are a
|
||||||
multiple of this size. This
|
multiple of this size. This
|
||||||
MUST be a power of two. */
|
MUST be a power of two. */
|
||||||
|
#ifdef MM_DBG
|
||||||
|
|
||||||
#define BufDump 1 /* Define this symbol to enable the
|
#define BufDump 1 /* Define this symbol to enable the
|
||||||
bpoold() function which dumps the
|
bpoold() function which dumps the
|
||||||
|
@ -442,6 +443,8 @@
|
||||||
#define BECtl 1 /* Define this symbol to enable the
|
#define BECtl 1 /* Define this symbol to enable the
|
||||||
bectl() function for automatic
|
bectl() function for automatic
|
||||||
pool space control. */
|
pool space control. */
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
|
@ -19,17 +19,32 @@
|
||||||
#define PTE_BASE 0xC0000000
|
#define PTE_BASE 0xC0000000
|
||||||
#define PDE_BASE 0xC0400000
|
#define PDE_BASE 0xC0400000
|
||||||
#define PDR_BASE 0xFFD00000
|
#define PDR_BASE 0xFFD00000
|
||||||
#define MMIO_BASE 0x10000000
|
|
||||||
#define VECTOR_BASE 0xFFFF0000
|
#define VECTOR_BASE 0xFFFF0000
|
||||||
|
|
||||||
#define LowMemPageTableIndex 0
|
#ifdef _ZOOM2_
|
||||||
|
#define IDMAP_BASE 0x81000000
|
||||||
|
#define MMIO_BASE 0x10000000
|
||||||
|
#else
|
||||||
|
#define IDMAP_BASE 0x00000000
|
||||||
|
#define MMIO_BASE 0x10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LowMemPageTableIndex (IDMAP_BASE >> PDE_SHIFT)
|
||||||
|
#define MmioPageTableIndex (MMIO_BASE >> PDE_SHIFT)
|
||||||
#define KernelPageTableIndex (KSEG0_BASE >> PDE_SHIFT)
|
#define KernelPageTableIndex (KSEG0_BASE >> PDE_SHIFT)
|
||||||
#define StartupPtePageTableIndex (PTE_BASE >> PDE_SHIFT)
|
#define StartupPtePageTableIndex (PTE_BASE >> PDE_SHIFT)
|
||||||
#define StartupPdePageTableIndex (PDE_BASE >> PDE_SHIFT)
|
#define StartupPdePageTableIndex (PDE_BASE >> PDE_SHIFT)
|
||||||
#define MmioPageTableIndex (MMIO_BASE >> PDE_SHIFT)
|
|
||||||
#define PdrPageTableIndex (PDR_BASE >> PDE_SHIFT)
|
#define PdrPageTableIndex (PDR_BASE >> PDE_SHIFT)
|
||||||
#define VectorPageTableIndex (VECTOR_BASE >> PDE_SHIFT)
|
#define VectorPageTableIndex (VECTOR_BASE >> PDE_SHIFT)
|
||||||
|
|
||||||
|
#ifndef _ZOOM2_
|
||||||
|
PVOID MempPdrBaseAddress = (PVOID)0x70000;
|
||||||
|
PVOID MempKernelBaseAddress = (PVOID)0;
|
||||||
|
#else
|
||||||
|
PVOID MempPdrBaseAddress = (PVOID)0x81100000;
|
||||||
|
PVOID MempKernelBaseAddress = (PVOID)0x80000000;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Converts a Physical Address into a Page Frame Number */
|
/* Converts a Physical Address into a Page Frame Number */
|
||||||
#define PaToPfn(p) ((p) >> PFN_SHIFT)
|
#define PaToPfn(p) ((p) >> PFN_SHIFT)
|
||||||
#define PaToLargePfn(p) ((p) >> LARGE_PFN_SHIFT)
|
#define PaToLargePfn(p) ((p) >> LARGE_PFN_SHIFT)
|
||||||
|
@ -185,18 +200,21 @@ MempAllocatePageTables(VOID)
|
||||||
PFN_NUMBER Pfn;
|
PFN_NUMBER Pfn;
|
||||||
|
|
||||||
/* Setup templates */
|
/* Setup templates */
|
||||||
TempPte.Accessed = TempPte.Valid = TempLargePte.LargePage = TempLargePte.Accessed = TempPde.Valid = 1;
|
TempPte.Sbo = TempPte.Valid = TempLargePte.LargePage = TempLargePte.Sbo = TempPde.Valid = 1;
|
||||||
|
|
||||||
/* Allocate the 1MB "PDR" (Processor Data Region). Must be 1MB aligned */
|
/* Allocate the 1MB "PDR" (Processor Data Region). Must be 1MB aligned */
|
||||||
PdrPage = MmAllocateMemoryAtAddress(sizeof(KPDR_PAGE), (PVOID)0x700000, LoaderMemoryData);
|
PdrPage = MmAllocateMemoryAtAddress(sizeof(KPDR_PAGE),
|
||||||
|
MempPdrBaseAddress,
|
||||||
|
LoaderMemoryData);
|
||||||
|
|
||||||
/* Setup the Low Memory PDE as an identity-mapped Large Page (1MB) */
|
/* Setup the Low Memory PDE as an identity-mapped Large Page (1MB) */
|
||||||
LargePte = &PdrPage->PageDir.Pte[LowMemPageTableIndex];
|
LargePte = &PdrPage->PageDir.Pte[LowMemPageTableIndex];
|
||||||
|
TempLargePte.PageFrameNumber = PaToLargePfn(IDMAP_BASE);
|
||||||
*LargePte = TempLargePte;
|
*LargePte = TempLargePte;
|
||||||
|
|
||||||
/* Setup the MMIO PDE as two identity mapped large pages -- the kernel will blow these away later */
|
/* Setup the MMIO PDE as two identity mapped large pages -- the kernel will blow these away later */
|
||||||
LargePte = &PdrPage->PageDir.Pte[MmioPageTableIndex];
|
LargePte = &PdrPage->PageDir.Pte[MmioPageTableIndex];
|
||||||
Pfn = PaToLargePfn(0x10000000);
|
Pfn = PaToLargePfn(MMIO_BASE);
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
TempLargePte.PageFrameNumber = Pfn++;
|
TempLargePte.PageFrameNumber = Pfn++;
|
||||||
|
@ -215,13 +233,13 @@ MempAllocatePageTables(VOID)
|
||||||
|
|
||||||
/* Setup the Kernel PTEs */
|
/* Setup the Kernel PTEs */
|
||||||
PointerPte = PdrPage->KernelPageTable[0].Pte;
|
PointerPte = PdrPage->KernelPageTable[0].Pte;
|
||||||
Pfn = 0;
|
Pfn = PaPtrToPfn(MempKernelBaseAddress);
|
||||||
for (i = 0; i < 3072; i++)
|
for (i = 0; i < 3072; i++)
|
||||||
{
|
{
|
||||||
TempPte.PageFrameNumber = Pfn++;
|
TempPte.PageFrameNumber = Pfn++;
|
||||||
*PointerPte++ = TempPte;
|
*PointerPte++ = TempPte;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Done */
|
/* Done */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
/* FUNCTIONS **************************************************************/
|
/* FUNCTIONS **************************************************************/
|
||||||
|
|
||||||
|
#ifndef _ZOOM2_
|
||||||
/* Arch-specific addresses translation implementation */
|
/* Arch-specific addresses translation implementation */
|
||||||
PVOID
|
PVOID
|
||||||
VaToPa(PVOID Va)
|
VaToPa(PVOID Va)
|
||||||
|
@ -27,6 +28,19 @@ PaToVa(PVOID Pa)
|
||||||
{
|
{
|
||||||
return (PVOID)((ULONG_PTR)Pa | KSEG0_BASE);
|
return (PVOID)((ULONG_PTR)Pa | KSEG0_BASE);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
PVOID
|
||||||
|
VaToPa(PVOID Va)
|
||||||
|
{
|
||||||
|
return Va;
|
||||||
|
}
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
PaToVa(PVOID Pa)
|
||||||
|
{
|
||||||
|
return Pa;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
List_PaToVa(LIST_ENTRY *ListEntry)
|
List_PaToVa(LIST_ENTRY *ListEntry)
|
||||||
|
|
|
@ -209,6 +209,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
Extension->AcpiTable = (PVOID)1;
|
Extension->AcpiTable = (PVOID)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _M_ARM
|
||||||
/* Set headless block pointer */
|
/* Set headless block pointer */
|
||||||
if (WinLdrTerminalConnected)
|
if (WinLdrTerminalConnected)
|
||||||
{
|
{
|
||||||
|
@ -225,7 +226,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
sizeof(HEADLESS_LOADER_BLOCK));
|
sizeof(HEADLESS_LOADER_BLOCK));
|
||||||
Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock);
|
Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* Load drivers database */
|
/* Load drivers database */
|
||||||
strcpy(MiscFiles, BootPath);
|
strcpy(MiscFiles, BootPath);
|
||||||
strcat(MiscFiles, "AppPatch\\drvmain.sdb");
|
strcat(MiscFiles, "AppPatch\\drvmain.sdb");
|
||||||
|
@ -537,9 +538,10 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
|
||||||
/* Allocate and minimalistic-initialize LPB */
|
/* Allocate and minimalistic-initialize LPB */
|
||||||
AllocateAndInitLPB(&LoaderBlock);
|
AllocateAndInitLPB(&LoaderBlock);
|
||||||
|
|
||||||
|
#ifndef _M_ARM
|
||||||
/* Setup redirection support */
|
/* Setup redirection support */
|
||||||
WinLdrSetupEms(BootOptions);
|
WinLdrSetupEms(BootOptions);
|
||||||
|
#endif
|
||||||
/* Detect hardware */
|
/* Detect hardware */
|
||||||
UseRealHeap = TRUE;
|
UseRealHeap = TRUE;
|
||||||
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
||||||
|
|
|
@ -88,7 +88,7 @@ WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert address to virtual */
|
/* Convert address to virtual */
|
||||||
HiveDataVirtual = (PVOID)(KSEG0_BASE | HiveDataPhysical);
|
HiveDataVirtual = PaToVa((PVOID)HiveDataPhysical);
|
||||||
|
|
||||||
/* Fill LoaderBlock's entries */
|
/* Fill LoaderBlock's entries */
|
||||||
LoaderBlock->RegistryLength = HiveFileSize;
|
LoaderBlock->RegistryLength = HiveFileSize;
|
||||||
|
@ -379,7 +379,7 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||||
if (NlsDataBase == 0)
|
if (NlsDataBase == 0)
|
||||||
goto Failure;
|
goto Failure;
|
||||||
|
|
||||||
NlsVirtual = (PVOID)(KSEG0_BASE | NlsDataBase);
|
NlsVirtual = PaToVa((PVOID)NlsDataBase);
|
||||||
LoaderBlock->NlsData->AnsiCodePageData = NlsVirtual;
|
LoaderBlock->NlsData->AnsiCodePageData = NlsVirtual;
|
||||||
LoaderBlock->NlsData->OemCodePageData = (PVOID)((PUCHAR)NlsVirtual +
|
LoaderBlock->NlsData->OemCodePageData = (PVOID)((PUCHAR)NlsVirtual +
|
||||||
(MM_SIZE_TO_PAGES(AnsiFileSize) << MM_PAGE_SHIFT));
|
(MM_SIZE_TO_PAGES(AnsiFileSize) << MM_PAGE_SHIFT));
|
||||||
|
|
|
@ -3236,9 +3236,9 @@ LdrpGetResidentSize(PIMAGE_NT_HEADERS NTHeaders)
|
||||||
*/
|
*/
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
LdrVerifyImageMatchesChecksum (IN HANDLE FileHandle,
|
LdrVerifyImageMatchesChecksum (IN HANDLE FileHandle,
|
||||||
ULONG Unknown1,
|
IN PLDR_CALLBACK Callback,
|
||||||
ULONG Unknown2,
|
IN PVOID CallbackContext,
|
||||||
ULONG Unknown3)
|
OUT PUSHORT ImageCharacterstics)
|
||||||
{
|
{
|
||||||
FILE_STANDARD_INFORMATION FileInfo;
|
FILE_STANDARD_INFORMATION FileInfo;
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
|
|
|
@ -255,7 +255,7 @@ GetViewportExtEx(
|
||||||
|
|
||||||
if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC))
|
if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC))
|
||||||
// Something was updated, go to kernel.
|
// Something was updated, go to kernel.
|
||||||
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (LPPOINT) lpSize );
|
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (PPOINTL) lpSize );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lpSize->cx = Dc_Attr->szlViewportExt.cx;
|
lpSize->cx = Dc_Attr->szlViewportExt.cx;
|
||||||
|
|
|
@ -746,7 +746,7 @@ GetAspectRatioFilterEx(
|
||||||
LPSIZE lpAspectRatio
|
LPSIZE lpAspectRatio
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return NtGdiGetDCPoint( hdc, GdiGetAspectRatioFilter, (LPPOINT) lpAspectRatio );
|
return NtGdiGetDCPoint( hdc, GdiGetAspectRatioFilter, (PPOINTL) lpAspectRatio );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -760,7 +760,7 @@ GetDCOrgEx(
|
||||||
LPPOINT lpPoint
|
LPPOINT lpPoint
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return NtGdiGetDCPoint( hdc, GdiGetDCOrg, lpPoint );
|
return NtGdiGetDCPoint( hdc, GdiGetDCOrg, (PPOINTL)lpPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
DEBUG_CHANNEL(kernel32file);
|
DEBUG_CHANNEL(kernel32file);
|
||||||
|
|
||||||
#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
@ -264,6 +264,16 @@ WaitNamedPipeA(LPCSTR lpNamedPipeName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When NPFS will work properly, use this code instead. It is compatible with
|
||||||
|
* Microsoft's NPFS.SYS. The main difference is that:
|
||||||
|
* - This code actually respects the timeout instead of ignoring it!
|
||||||
|
* - This code validates and creates the proper names for both UNC and local pipes
|
||||||
|
* - On NT, you open the *root* pipe directory (either \DosDevices\Pipe or
|
||||||
|
* \DosDevices\Unc\Server\Pipe) and then send the pipe to wait on in the
|
||||||
|
* FILE_PIPE_WAIT_FOR_BUFFER structure.
|
||||||
|
*/
|
||||||
|
#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
@ -448,6 +458,95 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
|
||||||
/* Success */
|
/* Success */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
WINAPI
|
||||||
|
WaitNamedPipeW(LPCWSTR lpNamedPipeName,
|
||||||
|
DWORD nTimeOut)
|
||||||
|
{
|
||||||
|
UNICODE_STRING NamedPipeName;
|
||||||
|
NTSTATUS Status;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
FILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
|
||||||
|
HANDLE FileHandle;
|
||||||
|
IO_STATUS_BLOCK Iosb;
|
||||||
|
|
||||||
|
if (RtlDosPathNameToNtPathName_U(lpNamedPipeName,
|
||||||
|
&NamedPipeName,
|
||||||
|
NULL,
|
||||||
|
NULL) == FALSE)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&NamedPipeName,
|
||||||
|
OBJ_CASE_INSENSITIVE,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
Status = NtOpenFile(&FileHandle,
|
||||||
|
FILE_READ_ATTRIBUTES | SYNCHRONIZE,
|
||||||
|
&ObjectAttributes,
|
||||||
|
&Iosb,
|
||||||
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
|
FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastErrorByStatus(Status);
|
||||||
|
RtlFreeUnicodeString(&NamedPipeName);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check what timeout we got */
|
||||||
|
if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
|
||||||
|
{
|
||||||
|
/* Don't use a timeout */
|
||||||
|
WaitPipe.TimeoutSpecified = FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Check if we should wait forever */
|
||||||
|
if (nTimeOut == NMPWAIT_WAIT_FOREVER)
|
||||||
|
{
|
||||||
|
/* Set the max */
|
||||||
|
WaitPipe.Timeout.LowPart = 0;
|
||||||
|
WaitPipe.Timeout.HighPart = 0x80000000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Convert to NT format */
|
||||||
|
WaitPipe.Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* In both cases, we do have a timeout */
|
||||||
|
WaitPipe.TimeoutSpecified = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = NtFsControlFile(FileHandle,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&Iosb,
|
||||||
|
FSCTL_PIPE_WAIT,
|
||||||
|
&WaitPipe,
|
||||||
|
sizeof(WaitPipe),
|
||||||
|
NULL,
|
||||||
|
0);
|
||||||
|
NtClose(FileHandle);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
SetLastErrorByStatus(Status);
|
||||||
|
RtlFreeUnicodeString(&NamedPipeName);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlFreeUnicodeString(&NamedPipeName);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
PNPFS_FCB
|
PNPFS_FCB
|
||||||
|
@ -103,6 +105,35 @@ NpfsSignalAndRemoveListeningServerInstance(PNPFS_FCB Fcb,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
NpfsOpenFileSystem(PNPFS_FCB Fcb,
|
||||||
|
PFILE_OBJECT FileObject,
|
||||||
|
PIO_STATUS_BLOCK IoStatus)
|
||||||
|
{
|
||||||
|
PNPFS_CCB Ccb;
|
||||||
|
|
||||||
|
DPRINT("NpfsOpenFileSystem()\n");
|
||||||
|
|
||||||
|
Ccb = ExAllocatePool(NonPagedPool, sizeof(NPFS_CCB));
|
||||||
|
if (Ccb == NULL)
|
||||||
|
{
|
||||||
|
IoStatus->Status = STATUS_NO_MEMORY;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ccb->Type = CCB_DEVICE;
|
||||||
|
Ccb->Fcb = Fcb;
|
||||||
|
|
||||||
|
FileObject->FsContext = Fcb;
|
||||||
|
FileObject->FsContext2 = Ccb;
|
||||||
|
|
||||||
|
IoStatus->Information = FILE_OPENED;
|
||||||
|
IoStatus->Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
NpfsOpenRootDirectory(PNPFS_FCB Fcb,
|
NpfsOpenRootDirectory(PNPFS_FCB Fcb,
|
||||||
PFILE_OBJECT FileObject,
|
PFILE_OBJECT FileObject,
|
||||||
|
@ -146,6 +177,9 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
PNPFS_VCB Vcb;
|
PNPFS_VCB Vcb;
|
||||||
ACCESS_MASK DesiredAccess;
|
ACCESS_MASK DesiredAccess;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
BOOLEAN SpecialAccess;
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||||
|
|
||||||
|
@ -161,6 +195,32 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
|
||||||
|
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
SpecialAccess = ((DesiredAccess & SPECIFIC_RIGHTS_ALL) == FILE_READ_ATTRIBUTES);
|
||||||
|
if (SpecialAccess)
|
||||||
|
{
|
||||||
|
DPRINT("NpfsCreate() open client end for special use!\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DPRINT("FileName->Length: %hu RelatedFileObject: %p\n", FileName->Length, RelatedFileObject);
|
||||||
|
|
||||||
|
/* Open the file system */
|
||||||
|
if (FileName->Length == 0 &&
|
||||||
|
(RelatedFileObject == NULL || ((PNPFS_CCB)RelatedFileObject->FsContext2)->Type == CCB_DEVICE))
|
||||||
|
{
|
||||||
|
DPRINT("Open the file system\n");
|
||||||
|
|
||||||
|
NpfsOpenFileSystem(Vcb->DeviceFcb,
|
||||||
|
FileObject,
|
||||||
|
&Irp->IoStatus);
|
||||||
|
|
||||||
|
Status = Irp->IoStatus.Status;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Open the root directory */
|
||||||
if (FileName->Length == 2 && FileName->Buffer[0] == L'\\' && RelatedFileObject == NULL)
|
if (FileName->Length == 2 && FileName->Buffer[0] == L'\\' && RelatedFileObject == NULL)
|
||||||
{
|
{
|
||||||
DPRINT("Open the root directory\n");
|
DPRINT("Open the root directory\n");
|
||||||
|
@ -217,8 +277,11 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
ClientCcb->Fcb = Fcb;
|
ClientCcb->Fcb = Fcb;
|
||||||
ClientCcb->PipeEnd = FILE_PIPE_CLIENT_END;
|
ClientCcb->PipeEnd = FILE_PIPE_CLIENT_END;
|
||||||
ClientCcb->OtherSide = NULL;
|
ClientCcb->OtherSide = NULL;
|
||||||
// ClientCcb->PipeState = SpecialAccess ? 0 : FILE_PIPE_DISCONNECTED_STATE;
|
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
ClientCcb->PipeState = SpecialAccess ? 0 : FILE_PIPE_DISCONNECTED_STATE;
|
||||||
|
#else
|
||||||
ClientCcb->PipeState = FILE_PIPE_DISCONNECTED_STATE;
|
ClientCcb->PipeState = FILE_PIPE_DISCONNECTED_STATE;
|
||||||
|
#endif
|
||||||
InitializeListHead(&ClientCcb->ReadRequestListHead);
|
InitializeListHead(&ClientCcb->ReadRequestListHead);
|
||||||
|
|
||||||
DPRINT("CCB: %p\n", ClientCcb);
|
DPRINT("CCB: %p\n", ClientCcb);
|
||||||
|
@ -256,10 +319,10 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
/*
|
/*
|
||||||
* Step 3. Search for listening server CCB.
|
* Step 3. Search for listening server CCB.
|
||||||
*/
|
*/
|
||||||
/*
|
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
if (!SpecialAccess)
|
if (!SpecialAccess)
|
||||||
{
|
{
|
||||||
*/
|
#endif
|
||||||
/*
|
/*
|
||||||
* WARNING: Point of no return! Once we get the server CCB it's
|
* WARNING: Point of no return! Once we get the server CCB it's
|
||||||
* possible that we completed a wait request and so we have to
|
* possible that we completed a wait request and so we have to
|
||||||
|
@ -315,7 +378,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
/* FIXME: Merge this with the NpfsFindListeningServerInstance routine. */
|
/* FIXME: Merge this with the NpfsFindListeningServerInstance routine. */
|
||||||
NpfsSignalAndRemoveListeningServerInstance(Fcb, ServerCcb);
|
NpfsSignalAndRemoveListeningServerInstance(Fcb, ServerCcb);
|
||||||
}
|
}
|
||||||
/*
|
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
}
|
}
|
||||||
else if (IsListEmpty(&Fcb->ServerCcbListHead))
|
else if (IsListEmpty(&Fcb->ServerCcbListHead))
|
||||||
{
|
{
|
||||||
|
@ -333,7 +396,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
*/
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 4. Add the client CCB to a list and connect it if possible.
|
* Step 4. Add the client CCB to a list and connect it if possible.
|
||||||
|
@ -646,6 +709,15 @@ NpfsCleanup(PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Ccb->Type == CCB_DEVICE)
|
||||||
|
{
|
||||||
|
DPRINT("Cleanup the file system!\n");
|
||||||
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
Irp->IoStatus.Information = 0;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (Ccb->Type == CCB_DIRECTORY)
|
if (Ccb->Type == CCB_DIRECTORY)
|
||||||
{
|
{
|
||||||
DPRINT("Cleanup the root directory!\n");
|
DPRINT("Cleanup the root directory!\n");
|
||||||
|
@ -790,6 +862,20 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Ccb->Type == CCB_DEVICE)
|
||||||
|
{
|
||||||
|
DPRINT("Closing the file system!\n");
|
||||||
|
|
||||||
|
ExFreePool(Ccb);
|
||||||
|
FileObject->FsContext = NULL;
|
||||||
|
FileObject->FsContext2 = NULL;
|
||||||
|
|
||||||
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
Irp->IoStatus.Information = 0;
|
||||||
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (Ccb->Type == CCB_DIRECTORY)
|
if (Ccb->Type == CCB_DIRECTORY)
|
||||||
{
|
{
|
||||||
DPRINT("Closing the root directory!\n");
|
DPRINT("Closing the root directory!\n");
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
static DRIVER_CANCEL NpfsListeningCancelRoutine;
|
static DRIVER_CANCEL NpfsListeningCancelRoutine;
|
||||||
|
@ -293,18 +295,21 @@ NpfsWaitPipe(PIRP Irp,
|
||||||
PNPFS_CCB Ccb)
|
PNPFS_CCB Ccb)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY current_entry;
|
PLIST_ENTRY current_entry;
|
||||||
PNPFS_VCB Vcb;
|
|
||||||
PNPFS_FCB Fcb;
|
PNPFS_FCB Fcb;
|
||||||
PNPFS_CCB ServerCcb;
|
PNPFS_CCB ServerCcb;
|
||||||
PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
|
PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
|
||||||
LARGE_INTEGER TimeOut;
|
LARGE_INTEGER TimeOut;
|
||||||
UNICODE_STRING PipeName;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
|
PNPFS_VCB Vcb;
|
||||||
|
UNICODE_STRING PipeName;
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINT("NpfsWaitPipe\n");
|
DPRINT("NpfsWaitPipe\n");
|
||||||
|
|
||||||
WaitPipe = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer;
|
WaitPipe = (PFILE_PIPE_WAIT_FOR_BUFFER)Irp->AssociatedIrp.SystemBuffer;
|
||||||
|
|
||||||
|
#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||||
/* Fail, if the CCB does not represent the root directory */
|
/* Fail, if the CCB does not represent the root directory */
|
||||||
if (Ccb->Type != CCB_DIRECTORY)
|
if (Ccb->Type != CCB_DIRECTORY)
|
||||||
return STATUS_ILLEGAL_FUNCTION;
|
return STATUS_ILLEGAL_FUNCTION;
|
||||||
|
@ -352,6 +357,15 @@ NpfsWaitPipe(PIRP Irp,
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Fcb %p\n", Fcb);
|
DPRINT("Fcb %p\n", Fcb);
|
||||||
|
#else
|
||||||
|
Fcb = Ccb->Fcb;
|
||||||
|
|
||||||
|
if (Ccb->PipeState != 0)
|
||||||
|
{
|
||||||
|
DPRINT("Pipe is not in passive (waiting) state!\n");
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* search for listening server */
|
/* search for listening server */
|
||||||
current_entry = Fcb->ServerCcbListHead.Flink;
|
current_entry = Fcb->ServerCcbListHead.Flink;
|
||||||
|
|
|
@ -85,12 +85,16 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
|
||||||
Vcb->DefaultQuota = 8 * PAGE_SIZE;
|
Vcb->DefaultQuota = 8 * PAGE_SIZE;
|
||||||
Vcb->MaxQuota = 64 * PAGE_SIZE;
|
Vcb->MaxQuota = 64 * PAGE_SIZE;
|
||||||
|
|
||||||
|
/* Create the device FCB */
|
||||||
|
Fcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
|
||||||
|
Fcb->Type = FCB_DEVICE;
|
||||||
|
Fcb->Vcb = Vcb;
|
||||||
|
Vcb->DeviceFcb = Fcb;
|
||||||
|
|
||||||
|
/* Create the root directory FCB */
|
||||||
Fcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
|
Fcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
|
||||||
Fcb->Type = FCB_DIRECTORY;
|
Fcb->Type = FCB_DIRECTORY;
|
||||||
Fcb->Vcb = Vcb;
|
Fcb->Vcb = Vcb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Vcb->RootFcb = Fcb;
|
Vcb->RootFcb = Fcb;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -28,6 +28,7 @@ typedef struct _NPFS_VCB
|
||||||
ULONG MinQuota;
|
ULONG MinQuota;
|
||||||
ULONG DefaultQuota;
|
ULONG DefaultQuota;
|
||||||
ULONG MaxQuota;
|
ULONG MaxQuota;
|
||||||
|
struct _NPFS_FCB *DeviceFcb;
|
||||||
struct _NPFS_FCB *RootFcb;
|
struct _NPFS_FCB *RootFcb;
|
||||||
} NPFS_VCB, *PNPFS_VCB;
|
} NPFS_VCB, *PNPFS_VCB;
|
||||||
|
|
||||||
|
|
31
hal/halarm/omap3/halinit_up.c
Normal file
31
hal/halarm/omap3/halinit_up.c
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactOS HAL
|
||||||
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||||
|
* FILE: hal/halarm/omap3/halinit_up.c
|
||||||
|
* PURPOSE: OMAP3 Board-Specific HAL Initialization
|
||||||
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INCLUDES *******************************************************************/
|
||||||
|
|
||||||
|
#include <hal.h>
|
||||||
|
#define NDEBUG
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
|
VOID
|
||||||
|
HalpInitPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
HalpInitPhase1(VOID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
16
hal/halarm/omap3/halup.rbuild
Normal file
16
hal/halarm/omap3/halup.rbuild
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||||
|
<module name="hal" type="kernelmodedll" entrypoint="HalInitSystem" installbase="system32" installname="hal.dll">
|
||||||
|
<importlibrary base="hal" definition="../hal.pspec" />
|
||||||
|
<bootstrap installbase="$(CDOUTPUT)" nameoncd="hal.dll" />
|
||||||
|
<include base="hal">include</include>
|
||||||
|
<include base="ntoskrnl">include</include>
|
||||||
|
<define name="_NTHAL_" />
|
||||||
|
<library>hal_generic</library>
|
||||||
|
<library>ntoskrnl</library>
|
||||||
|
<library>kdcom</library>
|
||||||
|
<directory name="omap3">
|
||||||
|
<file>halinit_up.c</file>
|
||||||
|
<file>halup.rc</file>
|
||||||
|
</directory>
|
||||||
|
</module>
|
5
hal/halarm/omap3/halup.rc
Normal file
5
hal/halarm/omap3/halup.rc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#define REACTOS_VERSION_DLL
|
||||||
|
#define REACTOS_STR_FILE_DESCRIPTION "X86 Uniprocessor Hardware Abstraction Layer\0"
|
||||||
|
#define REACTOS_STR_INTERNAL_NAME "halup\0"
|
||||||
|
#define REACTOS_STR_ORIGINAL_FILENAME "halup.dll\0"
|
||||||
|
#include <reactos/version.rc>
|
|
@ -67,12 +67,40 @@ __INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destinat
|
||||||
|
|
||||||
__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
|
__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
|
||||||
{
|
{
|
||||||
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
|
short a, b;
|
||||||
|
|
||||||
|
__asm__ __volatile__ ( "0:\n\t"
|
||||||
|
"ldr %1, [%2]\n\t"
|
||||||
|
"cmp %1, %4\n\t"
|
||||||
|
"bne 1f\n\t"
|
||||||
|
"swp %0, %3, [%2]\n\t"
|
||||||
|
"cmp %0, %1\n\t"
|
||||||
|
"swpne %3, %0, [%2]\n\t"
|
||||||
|
"bne 0b\n\t"
|
||||||
|
"1:"
|
||||||
|
: "=&r" (a), "=&r" (b)
|
||||||
|
: "r" (Destination), "r" (Exchange), "r" (Comperand)
|
||||||
|
: "cc", "memory");
|
||||||
|
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
|
__INTRIN_INLINE short _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
|
||||||
{
|
{
|
||||||
return __sync_fetch_and_add(Addend, Value);
|
short a, b, c;
|
||||||
|
|
||||||
|
__asm__ __volatile__ ( "0:\n\t"
|
||||||
|
"ldr %0, [%3]\n\t"
|
||||||
|
"add %1, %0, %4\n\t"
|
||||||
|
"swp %2, %1, [%3]\n\t"
|
||||||
|
"cmp %0, %2\n\t"
|
||||||
|
"swpne %1, %2, [%3]\n\t"
|
||||||
|
"bne 0b"
|
||||||
|
: "=&r" (a), "=&r" (b), "=&r" (c)
|
||||||
|
: "r" (Value), "r" (Addend)
|
||||||
|
: "cc", "memory");
|
||||||
|
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
|
__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
|
||||||
|
|
|
@ -129,6 +129,15 @@ extern "C" {
|
||||||
SETJMP_FLOAT128 Xmm15;
|
SETJMP_FLOAT128 Xmm15;
|
||||||
} _JUMP_BUFFER;
|
} _JUMP_BUFFER;
|
||||||
|
|
||||||
|
#elif defined(_M_ARM)
|
||||||
|
|
||||||
|
#define _JBLEN 11
|
||||||
|
#define _JBTYPE int
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#error Define Setjmp for this architecture!
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _JMP_BUF_DEFINED
|
#ifndef _JMP_BUF_DEFINED
|
||||||
|
|
|
@ -366,20 +366,13 @@ typedef __WCHAR_TYPE__ wchar_t;
|
||||||
#endif /* __sys_stdtypes_h */
|
#endif /* __sys_stdtypes_h */
|
||||||
|
|
||||||
/* A null pointer constant. */
|
/* A null pointer constant. */
|
||||||
|
#ifndef NULL
|
||||||
#if defined (_STDDEF_H) || defined (__need_NULL)
|
#ifdef __cplusplus
|
||||||
#undef NULL /* in case <stdio.h> has defined it. */
|
|
||||||
#ifdef __GNUG__
|
|
||||||
#define NULL __null
|
|
||||||
#else /* G++ */
|
|
||||||
#ifndef __cplusplus
|
|
||||||
#define NULL ((void *)0)
|
|
||||||
#else /* C++ */
|
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif /* C++ */
|
#else
|
||||||
#endif /* G++ */
|
#define NULL ((void*)0)
|
||||||
#endif /* NULL not defined and <stddef.h> or need NULL. */
|
#endif
|
||||||
#undef __need_NULL
|
#endif
|
||||||
|
|
||||||
#ifndef offsetof
|
#ifndef offsetof
|
||||||
|
|
||||||
|
|
|
@ -9726,7 +9726,7 @@ KeQuerySystemTime(
|
||||||
OUT PLARGE_INTEGER CurrentTime);
|
OUT PLARGE_INTEGER CurrentTime);
|
||||||
#endif /* !_M_AMD64 */
|
#endif /* !_M_AMD64 */
|
||||||
|
|
||||||
#if !defined(_X86_)
|
#if !defined(_X86_) && !defined(_M_ARM)
|
||||||
NTKERNELAPI
|
NTKERNELAPI
|
||||||
KIRQL
|
KIRQL
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
|
@ -473,8 +473,13 @@ typedef struct _KIPCR
|
||||||
ULONG StallScaleFactor;
|
ULONG StallScaleFactor;
|
||||||
UCHAR SpareUnused;
|
UCHAR SpareUnused;
|
||||||
UCHAR Number;
|
UCHAR Number;
|
||||||
|
UCHAR Spare0;
|
||||||
|
UCHAR SecondLevelCacheAssociativity;
|
||||||
|
ULONG VdmAlert;
|
||||||
|
ULONG KernelReserved[14];
|
||||||
|
ULONG SecondLevelCacheSize;
|
||||||
|
ULONG HalReserved[16];
|
||||||
// arm part
|
// arm part
|
||||||
UCHAR Spare0[2];
|
|
||||||
UCHAR IrqlMask[32];
|
UCHAR IrqlMask[32];
|
||||||
ULONG IrqlTable[32];
|
ULONG IrqlTable[32];
|
||||||
PKINTERRUPT_ROUTINE InterruptRoutine[32];
|
PKINTERRUPT_ROUTINE InterruptRoutine[32];
|
||||||
|
|
|
@ -68,7 +68,7 @@ typedef struct _HARDWARE_LARGE_PTE_ARMV6
|
||||||
ULONG NoExecute:1;
|
ULONG NoExecute:1;
|
||||||
ULONG Domain:4;
|
ULONG Domain:4;
|
||||||
ULONG Ecc:1;
|
ULONG Ecc:1;
|
||||||
ULONG Accessed:1;
|
ULONG Sbo:1;
|
||||||
ULONG Owner:1;
|
ULONG Owner:1;
|
||||||
ULONG CacheAttributes:3;
|
ULONG CacheAttributes:3;
|
||||||
ULONG ReadOnly:1;
|
ULONG ReadOnly:1;
|
||||||
|
@ -85,7 +85,7 @@ typedef struct _HARDWARE_PTE_ARMV6
|
||||||
ULONG Valid:1;
|
ULONG Valid:1;
|
||||||
ULONG Buffered:1;
|
ULONG Buffered:1;
|
||||||
ULONG Cached:1;
|
ULONG Cached:1;
|
||||||
ULONG Accessed:1;
|
ULONG Sbo:1;
|
||||||
ULONG Owner:1;
|
ULONG Owner:1;
|
||||||
ULONG CacheAttributes:3;
|
ULONG CacheAttributes:3;
|
||||||
ULONG ReadOnly:1;
|
ULONG ReadOnly:1;
|
||||||
|
@ -100,9 +100,9 @@ C_ASSERT(sizeof(HARDWARE_PTE_ARMV6) == sizeof(ULONG));
|
||||||
|
|
||||||
typedef struct _MMPTE_SOFTWARE
|
typedef struct _MMPTE_SOFTWARE
|
||||||
{
|
{
|
||||||
ULONG Valid:1;
|
ULONG Valid:2;
|
||||||
ULONG PageFileLow:4;
|
ULONG PageFileLow:4;
|
||||||
ULONG Protection:5;
|
ULONG Protection:4;
|
||||||
ULONG Prototype:1;
|
ULONG Prototype:1;
|
||||||
ULONG Transition:1;
|
ULONG Transition:1;
|
||||||
ULONG PageFileHigh:20;
|
ULONG PageFileHigh:20;
|
||||||
|
@ -110,12 +110,12 @@ typedef struct _MMPTE_SOFTWARE
|
||||||
|
|
||||||
typedef struct _MMPTE_TRANSITION
|
typedef struct _MMPTE_TRANSITION
|
||||||
{
|
{
|
||||||
ULONG Valid:1;
|
ULONG Valid:2;
|
||||||
ULONG Write:1;
|
ULONG Buffered:1;
|
||||||
|
ULONG Cached:1;
|
||||||
ULONG Owner:1;
|
ULONG Owner:1;
|
||||||
ULONG WriteThrough:1;
|
ULONG Protection:4;
|
||||||
ULONG CacheDisable:1;
|
ULONG ReadOnly:1;
|
||||||
ULONG Protection:5;
|
|
||||||
ULONG Prototype:1;
|
ULONG Prototype:1;
|
||||||
ULONG Transition:1;
|
ULONG Transition:1;
|
||||||
ULONG PageFrameNumber:20;
|
ULONG PageFrameNumber:20;
|
||||||
|
@ -123,19 +123,18 @@ typedef struct _MMPTE_TRANSITION
|
||||||
|
|
||||||
typedef struct _MMPTE_PROTOTYPE
|
typedef struct _MMPTE_PROTOTYPE
|
||||||
{
|
{
|
||||||
ULONG Valid:1;
|
ULONG Valid:2;
|
||||||
ULONG ProtoAddressLow:7;
|
ULONG ProtoAddressLow:7;
|
||||||
ULONG ReadOnly:1;
|
ULONG ReadOnly:1;
|
||||||
ULONG WhichPool:1;
|
|
||||||
ULONG Prototype:1;
|
ULONG Prototype:1;
|
||||||
ULONG ProtoAddressHigh:21;
|
ULONG ProtoAddressHigh:21;
|
||||||
} MMPTE_PROTOTYPE;
|
} MMPTE_PROTOTYPE;
|
||||||
|
|
||||||
typedef struct _MMPTE_SUBSECTION
|
typedef struct _MMPTE_SUBSECTION
|
||||||
{
|
{
|
||||||
ULONG Valid:1;
|
ULONG Valid:2;
|
||||||
ULONG SubsectionAddressLow:4;
|
ULONG SubsectionAddressLow:4;
|
||||||
ULONG Protection:5;
|
ULONG Protection:4;
|
||||||
ULONG Prototype:1;
|
ULONG Prototype:1;
|
||||||
ULONG SubsectionAddressHigh:20;
|
ULONG SubsectionAddressHigh:20;
|
||||||
ULONG WhichPool:1;
|
ULONG WhichPool:1;
|
||||||
|
@ -143,47 +142,38 @@ typedef struct _MMPTE_SUBSECTION
|
||||||
|
|
||||||
typedef struct _MMPTE_LIST
|
typedef struct _MMPTE_LIST
|
||||||
{
|
{
|
||||||
ULONG Valid:1;
|
ULONG Valid:2;
|
||||||
ULONG OneEntry:1;
|
ULONG OneEntry:1;
|
||||||
ULONG filler0:8;
|
ULONG filler0:8;
|
||||||
ULONG NextEntry:20;
|
ULONG NextEntry:20;
|
||||||
ULONG Prototype:1;
|
ULONG Prototype:1;
|
||||||
ULONG filler1:1;
|
|
||||||
} MMPTE_LIST;
|
} MMPTE_LIST;
|
||||||
|
|
||||||
typedef union _MMPTE_HARDWARE
|
typedef union _MMPTE_HARDWARE
|
||||||
{
|
{
|
||||||
struct
|
ULONG NoExecute:1;
|
||||||
{
|
ULONG Valid:1;
|
||||||
ULONG NoExecute:1;
|
ULONG Buffered:1;
|
||||||
ULONG Valid:1;
|
ULONG Cached:1;
|
||||||
ULONG Buffered:1;
|
ULONG Sbo:1;
|
||||||
ULONG Cached:1;
|
ULONG Owner:1;
|
||||||
ULONG Access:1;
|
ULONG CacheAttributes:3;
|
||||||
ULONG Owner:1;
|
ULONG ReadOnly:1;
|
||||||
ULONG CacheAttributes:3;
|
ULONG Prototype:1;
|
||||||
ULONG ReadOnly:1;
|
ULONG NonGlobal:1;
|
||||||
ULONG Shared:1;
|
ULONG PageFrameNumber:20;
|
||||||
ULONG NonGlobal:1;
|
|
||||||
ULONG PageFrameNumber:20;
|
|
||||||
};
|
|
||||||
ULONG AsUlong;
|
|
||||||
} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
|
} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
|
||||||
|
|
||||||
typedef union _MMPDE_HARDWARE
|
typedef union _MMPDE_HARDWARE
|
||||||
{
|
{
|
||||||
struct
|
ULONG Valid:1;
|
||||||
{
|
ULONG LargePage:1;
|
||||||
ULONG Valid:1;
|
ULONG Buffered:1;
|
||||||
ULONG LargePage:1;
|
ULONG Cached:1;
|
||||||
ULONG Buffered:1;
|
ULONG NoExecute:1;
|
||||||
ULONG Cached:1;
|
ULONG Domain:4;
|
||||||
ULONG NoExecute:1;
|
ULONG Ecc:1;
|
||||||
ULONG Domain:4;
|
ULONG PageFrameNumber:22;
|
||||||
ULONG Ecc:1;
|
|
||||||
ULONG PageFrameNumber:22;
|
|
||||||
};
|
|
||||||
ULONG AsUlong;
|
|
||||||
} MMPDE_HARDWARE, *PMMPDE_HARDWARE;
|
} MMPDE_HARDWARE, *PMMPDE_HARDWARE;
|
||||||
|
|
||||||
typedef struct _MMPDE
|
typedef struct _MMPDE
|
||||||
|
|
|
@ -296,13 +296,14 @@ LdrUnloadDll(
|
||||||
IN PVOID BaseAddress
|
IN PVOID BaseAddress
|
||||||
);
|
);
|
||||||
|
|
||||||
|
typedef VOID NTAPI (*PLDR_CALLBACK)(PVOID CallbackContext, PVOID Name);
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
LdrVerifyImageMatchesChecksum(
|
LdrVerifyImageMatchesChecksum(
|
||||||
IN HANDLE FileHandle,
|
IN HANDLE FileHandle,
|
||||||
ULONG Unknown1,
|
IN PLDR_CALLBACK Callback,
|
||||||
ULONG Unknown2,
|
IN PVOID CallbackContext,
|
||||||
ULONG Unknown3
|
OUT PUSHORT ImageCharacterstics
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
278
include/psdk/specstrings.h
Normal file
278
include/psdk/specstrings.h
Normal file
|
@ -0,0 +1,278 @@
|
||||||
|
/**
|
||||||
|
* This file has no copyright assigned and is placed in the Public Domain.
|
||||||
|
* This file is part of the w64 mingw-runtime package.
|
||||||
|
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||||
|
*/
|
||||||
|
#define __specstrings
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#ifndef __nothrow
|
||||||
|
#define __nothrow __declspec(nothrow)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#ifndef __nothrow
|
||||||
|
#define __nothrow
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __deref_in
|
||||||
|
#define __deref_in_ecount(size)
|
||||||
|
#define __deref_in_bcount(size)
|
||||||
|
#define __deref_in_opt
|
||||||
|
#define __deref_in_ecount_opt(size)
|
||||||
|
#define __deref_in_bcount_opt(size)
|
||||||
|
#define __deref_opt_in
|
||||||
|
#define __deref_opt_in_ecount(size)
|
||||||
|
#define __deref_opt_in_bcount(size)
|
||||||
|
#define __deref_opt_in_opt
|
||||||
|
#define __deref_opt_in_ecount_opt(size)
|
||||||
|
#define __deref_opt_in_bcount_opt(size)
|
||||||
|
#define __out_awcount(expr,size)
|
||||||
|
#define __in_awcount(expr,size)
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#define __null
|
||||||
|
#endif
|
||||||
|
#define __notnull
|
||||||
|
#define __maybenull
|
||||||
|
#define __readonly
|
||||||
|
#define __notreadonly
|
||||||
|
#define __maybereadonly
|
||||||
|
#define __valid
|
||||||
|
#define __notvalid
|
||||||
|
#define __maybevalid
|
||||||
|
#define __readableTo(extent)
|
||||||
|
#define __elem_readableTo(size)
|
||||||
|
#define __byte_readableTo(size)
|
||||||
|
#define __writableTo(size)
|
||||||
|
#define __elem_writableTo(size)
|
||||||
|
#define __byte_writableTo(size)
|
||||||
|
#define __deref
|
||||||
|
#define __pre
|
||||||
|
#define __post
|
||||||
|
#define __precond(expr)
|
||||||
|
#define __postcond(expr)
|
||||||
|
#define __exceptthat
|
||||||
|
#define __execeptthat
|
||||||
|
#define __inner_success(expr)
|
||||||
|
#define __inner_checkReturn
|
||||||
|
#define __inner_typefix(ctype)
|
||||||
|
#define __inner_override
|
||||||
|
#define __inner_callback
|
||||||
|
#define __inner_blocksOn(resource)
|
||||||
|
#define __inner_fallthrough_dec
|
||||||
|
#define __inner_fallthrough
|
||||||
|
#define __refparam
|
||||||
|
#define __inner_control_entrypoint(category)
|
||||||
|
#define __inner_data_entrypoint(category)
|
||||||
|
#define __ecount(size)
|
||||||
|
#define __bcount(size)
|
||||||
|
#ifndef __cplusplus
|
||||||
|
#define __in
|
||||||
|
#endif
|
||||||
|
#define __in_opt
|
||||||
|
#define __in_nz
|
||||||
|
#define __in_nz_opt
|
||||||
|
#define __in_z
|
||||||
|
#define __in_z_opt
|
||||||
|
#define __in_ecount(size)
|
||||||
|
#define __in_ecount_nz(size)
|
||||||
|
#define __in_ecount_z(size)
|
||||||
|
#define __in_bcount(size)
|
||||||
|
#define __in_bcount_z(size)
|
||||||
|
#define __in_bcount_nz(size)
|
||||||
|
#define __in_ecount_opt(size)
|
||||||
|
#define __in_bcount_opt(size)
|
||||||
|
#define __in_ecount_z_opt(size)
|
||||||
|
#define __in_bcount_z_opt(size)
|
||||||
|
#define __in_ecount_nz_opt(size)
|
||||||
|
#define __in_bcount_nz_opt(size)
|
||||||
|
#define __out
|
||||||
|
#define __out_ecount(size)
|
||||||
|
#define __out_z
|
||||||
|
#define __out_nz
|
||||||
|
#define __out_nz_opt
|
||||||
|
#define __out_z_opt
|
||||||
|
#define __out_ecount_part(size,length)
|
||||||
|
#define __out_ecount_full(size)
|
||||||
|
#define __out_ecount_nz(size)
|
||||||
|
#define __out_ecount_z(size)
|
||||||
|
#define __out_ecount_part_z(size,length)
|
||||||
|
#define __out_ecount_full_z(size)
|
||||||
|
#define __out_bcount(size)
|
||||||
|
#define __out_bcount_part(size,length)
|
||||||
|
#define __out_bcount_full(size)
|
||||||
|
#define __out_bcount_z(size)
|
||||||
|
#define __out_bcount_part_z(size,length)
|
||||||
|
#define __out_bcount_full_z(size)
|
||||||
|
#define __out_bcount_nz(size)
|
||||||
|
#define __inout
|
||||||
|
#define __inout_ecount(size)
|
||||||
|
#define __inout_bcount(size)
|
||||||
|
#define __inout_ecount_part(size,length)
|
||||||
|
#define __inout_bcount_part(size,length)
|
||||||
|
#define __inout_ecount_full(size)
|
||||||
|
#define __inout_bcount_full(size)
|
||||||
|
#define __inout_z
|
||||||
|
#define __inout_ecount_z(size)
|
||||||
|
#define __inout_bcount_z(size)
|
||||||
|
#define __inout_nz
|
||||||
|
#define __inout_ecount_nz(size)
|
||||||
|
#define __inout_bcount_nz(size)
|
||||||
|
#define __ecount_opt(size)
|
||||||
|
#define __bcount_opt(size)
|
||||||
|
#define __out_opt
|
||||||
|
#define __out_ecount_opt(size)
|
||||||
|
#define __out_bcount_opt(size)
|
||||||
|
#define __out_ecount_part_opt(size,length)
|
||||||
|
#define __out_bcount_part_opt(size,length)
|
||||||
|
#define __out_ecount_full_opt(size)
|
||||||
|
#define __out_bcount_full_opt(size)
|
||||||
|
#define __out_ecount_z_opt(size)
|
||||||
|
#define __out_bcount_z_opt(size)
|
||||||
|
#define __out_ecount_part_z_opt(size,length)
|
||||||
|
#define __out_bcount_part_z_opt(size,length)
|
||||||
|
#define __out_ecount_full_z_opt(size)
|
||||||
|
#define __out_bcount_full_z_opt(size)
|
||||||
|
#define __out_ecount_nz_opt(size)
|
||||||
|
#define __out_bcount_nz_opt(size)
|
||||||
|
#define __inout_opt
|
||||||
|
#define __inout_ecount_opt(size)
|
||||||
|
#define __inout_bcount_opt(size)
|
||||||
|
#define __inout_ecount_part_opt(size,length)
|
||||||
|
#define __inout_bcount_part_opt(size,length)
|
||||||
|
#define __inout_ecount_full_opt(size)
|
||||||
|
#define __inout_bcount_full_opt(size)
|
||||||
|
#define __inout_z_opt
|
||||||
|
#define __inout_ecount_z_opt(size)
|
||||||
|
#define __inout_bcount_z_opt(size)
|
||||||
|
#define __inout_nz_opt
|
||||||
|
#define __inout_ecount_nz_opt(size)
|
||||||
|
#define __inout_bcount_nz_opt(size)
|
||||||
|
#define __deref_ecount(size)
|
||||||
|
#define __deref_bcount(size)
|
||||||
|
#define __deref_out
|
||||||
|
#define __deref_out_ecount(size)
|
||||||
|
#define __deref_out_bcount(size)
|
||||||
|
#define __deref_out_ecount_part(size,length)
|
||||||
|
#define __deref_out_bcount_part(size,length)
|
||||||
|
#define __deref_out_ecount_full(size)
|
||||||
|
#define __deref_out_bcount_full(size)
|
||||||
|
#define __deref_out_z
|
||||||
|
#define __deref_out_ecount_z(size)
|
||||||
|
#define __deref_out_bcount_z(size)
|
||||||
|
#define __deref_out_nz
|
||||||
|
#define __deref_out_ecount_nz(size)
|
||||||
|
#define __deref_out_bcount_nz(size)
|
||||||
|
#define __deref_inout
|
||||||
|
#define __deref_inout_ecount(size)
|
||||||
|
#define __deref_inout_bcount(size)
|
||||||
|
#define __deref_inout_ecount_part(size,length)
|
||||||
|
#define __deref_inout_bcount_part(size,length)
|
||||||
|
#define __deref_inout_ecount_full(size)
|
||||||
|
#define __deref_inout_bcount_full(size)
|
||||||
|
#define __deref_inout_z
|
||||||
|
#define __deref_inout_ecount_z(size)
|
||||||
|
#define __deref_inout_bcount_z(size)
|
||||||
|
#define __deref_inout_nz
|
||||||
|
#define __deref_inout_ecount_nz(size)
|
||||||
|
#define __deref_inout_bcount_nz(size)
|
||||||
|
#define __deref_ecount_opt(size)
|
||||||
|
#define __deref_bcount_opt(size)
|
||||||
|
#define __deref_out_opt
|
||||||
|
#define __deref_out_ecount_opt(size)
|
||||||
|
#define __deref_out_bcount_opt(size)
|
||||||
|
#define __deref_out_ecount_part_opt(size,length)
|
||||||
|
#define __deref_out_bcount_part_opt(size,length)
|
||||||
|
#define __deref_out_ecount_full_opt(size)
|
||||||
|
#define __deref_out_bcount_full_opt(size)
|
||||||
|
#define __deref_out_z_opt
|
||||||
|
#define __deref_out_ecount_z_opt(size)
|
||||||
|
#define __deref_out_bcount_z_opt(size)
|
||||||
|
#define __deref_out_nz_opt
|
||||||
|
#define __deref_out_ecount_nz_opt(size)
|
||||||
|
#define __deref_out_bcount_nz_opt(size)
|
||||||
|
#define __deref_inout_opt
|
||||||
|
#define __deref_inout_ecount_opt(size)
|
||||||
|
#define __deref_inout_bcount_opt(size)
|
||||||
|
#define __deref_inout_ecount_part_opt(size,length)
|
||||||
|
#define __deref_inout_bcount_part_opt(size,length)
|
||||||
|
#define __deref_inout_ecount_full_opt(size)
|
||||||
|
#define __deref_inout_bcount_full_opt(size)
|
||||||
|
#define __deref_inout_z_opt
|
||||||
|
#define __deref_inout_ecount_z_opt(size)
|
||||||
|
#define __deref_inout_bcount_z_opt(size)
|
||||||
|
#define __deref_inout_nz_opt
|
||||||
|
#define __deref_inout_ecount_nz_opt(size)
|
||||||
|
#define __deref_inout_bcount_nz_opt(size)
|
||||||
|
#define __deref_opt_ecount(size)
|
||||||
|
#define __deref_opt_bcount(size)
|
||||||
|
#define __deref_opt_out
|
||||||
|
#define __deref_opt_out_z
|
||||||
|
#define __deref_opt_out_ecount(size)
|
||||||
|
#define __deref_opt_out_bcount(size)
|
||||||
|
#define __deref_opt_out_ecount_part(size,length)
|
||||||
|
#define __deref_opt_out_bcount_part(size,length)
|
||||||
|
#define __deref_opt_out_ecount_full(size)
|
||||||
|
#define __deref_opt_out_bcount_full(size)
|
||||||
|
#define __deref_opt_inout
|
||||||
|
#define __deref_opt_inout_ecount(size)
|
||||||
|
#define __deref_opt_inout_bcount(size)
|
||||||
|
#define __deref_opt_inout_ecount_part(size,length)
|
||||||
|
#define __deref_opt_inout_bcount_part(size,length)
|
||||||
|
#define __deref_opt_inout_ecount_full(size)
|
||||||
|
#define __deref_opt_inout_bcount_full(size)
|
||||||
|
#define __deref_opt_inout_z
|
||||||
|
#define __deref_opt_inout_ecount_z(size)
|
||||||
|
#define __deref_opt_inout_bcount_z(size)
|
||||||
|
#define __deref_opt_inout_nz
|
||||||
|
#define __deref_opt_inout_ecount_nz(size)
|
||||||
|
#define __deref_opt_inout_bcount_nz(size)
|
||||||
|
#define __deref_opt_ecount_opt(size)
|
||||||
|
#define __deref_opt_bcount_opt(size)
|
||||||
|
#define __deref_opt_out_opt
|
||||||
|
#define __deref_opt_out_ecount_opt(size)
|
||||||
|
#define __deref_opt_out_bcount_opt(size)
|
||||||
|
#define __deref_opt_out_ecount_part_opt(size,length)
|
||||||
|
#define __deref_opt_out_bcount_part_opt(size,length)
|
||||||
|
#define __deref_opt_out_ecount_full_opt(size)
|
||||||
|
#define __deref_opt_out_bcount_full_opt(size)
|
||||||
|
#define __deref_opt_out_z_opt
|
||||||
|
#define __deref_opt_out_ecount_z_opt(size)
|
||||||
|
#define __deref_opt_out_bcount_z_opt(size)
|
||||||
|
#define __deref_opt_out_nz_opt
|
||||||
|
#define __deref_opt_out_ecount_nz_opt(size)
|
||||||
|
#define __deref_opt_out_bcount_nz_opt(size)
|
||||||
|
#define __deref_opt_inout_opt
|
||||||
|
#define __deref_opt_inout_ecount_opt(size)
|
||||||
|
#define __deref_opt_inout_bcount_opt(size)
|
||||||
|
#define __deref_opt_inout_ecount_part_opt(size,length)
|
||||||
|
#define __deref_opt_inout_bcount_part_opt(size,length)
|
||||||
|
#define __deref_opt_inout_ecount_full_opt(size)
|
||||||
|
#define __deref_opt_inout_bcount_full_opt(size)
|
||||||
|
#define __deref_opt_inout_z_opt
|
||||||
|
#define __deref_opt_inout_ecount_z_opt(size)
|
||||||
|
#define __deref_opt_inout_bcount_z_opt(size)
|
||||||
|
#define __deref_opt_inout_nz_opt
|
||||||
|
#define __deref_opt_inout_ecount_nz_opt(size)
|
||||||
|
#define __deref_opt_inout_bcount_nz_opt(size)
|
||||||
|
#define __success(expr)
|
||||||
|
#define __nullterminated
|
||||||
|
#define __nullnullterminated
|
||||||
|
#define __reserved
|
||||||
|
#define __checkReturn
|
||||||
|
#define __typefix(ctype)
|
||||||
|
#define __override
|
||||||
|
#define __callback
|
||||||
|
#define __format_string
|
||||||
|
#define __blocksOn(resource)
|
||||||
|
#define __control_entrypoint(category)
|
||||||
|
#define __data_entrypoint(category)
|
||||||
|
#ifndef __fallthrough
|
||||||
|
#define __fallthrough
|
||||||
|
#endif
|
||||||
|
#ifndef __analysis_assume
|
||||||
|
#define __analysis_assume(expr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#endif
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
#ifndef _WINDEF_H
|
/**
|
||||||
#define _WINDEF_H
|
* This file has no copyright assigned and is placed in the Public Domain.
|
||||||
|
* This file is part of the w64 mingw-runtime package.
|
||||||
|
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||||
|
*/
|
||||||
|
#ifndef _WINDEF_
|
||||||
|
#define _WINDEF_
|
||||||
|
|
||||||
|
#define _WINDEF_H // wine ...
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4255)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _M_AMD64
|
#ifndef _M_AMD64
|
||||||
#if !defined(__ROS_LONG64__)
|
#if !defined(__ROS_LONG64__)
|
||||||
|
@ -9,62 +21,68 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_STRICT
|
||||||
|
#ifndef STRICT
|
||||||
|
#define STRICT 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#define WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MAC) && !defined(_WIN32)
|
||||||
|
#define _WIN32
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifndef WINVER
|
||||||
#pragma warning(push)
|
#define WINVER 0x0502
|
||||||
#pragma warning(disable:4255)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WINVER
|
#ifndef BASETYPES
|
||||||
#define WINVER 0x0400
|
#define BASETYPES
|
||||||
/*
|
#ifndef __ROS_LONG64__
|
||||||
* If you need Win32 API features newer the Win95 and WinNT then you must
|
typedef unsigned long ULONG;
|
||||||
* define WINVER before including windows.h or any other method of including
|
#else
|
||||||
* the windef.h header.
|
typedef unsigned int ULONG;
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#ifndef _WIN32_WINNT
|
|
||||||
#define _WIN32_WINNT WINVER
|
|
||||||
/*
|
|
||||||
* There may be the need to define _WIN32_WINNT to a value different from
|
|
||||||
* the value of WINVER. I don't have any example of why you would do that.
|
|
||||||
* However, if you must then define _WIN32_WINNT to the value required before
|
|
||||||
* including windows.h or any other method of including the windef.h header.
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#ifndef WIN32
|
|
||||||
#define WIN32
|
|
||||||
#endif
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define _WIN32
|
|
||||||
#endif
|
|
||||||
#define FAR
|
|
||||||
#define far
|
|
||||||
#define NEAR
|
|
||||||
#define near
|
|
||||||
#ifndef CONST
|
|
||||||
#define CONST const
|
|
||||||
#endif
|
#endif
|
||||||
|
typedef ULONG *PULONG;
|
||||||
|
typedef unsigned short USHORT;
|
||||||
|
typedef USHORT *PUSHORT;
|
||||||
|
typedef unsigned char UCHAR;
|
||||||
|
typedef UCHAR *PUCHAR;
|
||||||
|
typedef char *PSZ;
|
||||||
|
typedef int INT;
|
||||||
|
#endif /* BASETYPES */
|
||||||
|
|
||||||
#undef MAX_PATH
|
#undef MAX_PATH
|
||||||
#define MAX_PATH 260
|
#define MAX_PATH 260
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
#ifndef _WIN64
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#else
|
#else
|
||||||
#define NULL ((void*)0)
|
#define NULL 0LL
|
||||||
|
#endif /* W64 */
|
||||||
|
#else
|
||||||
|
#define NULL ((void *)0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _NO_W32_PSEUDO_MODIFIERS
|
||||||
#ifndef IN
|
#ifndef IN
|
||||||
#define IN
|
#define IN
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,6 +92,307 @@ extern "C" {
|
||||||
#ifndef OPTIONAL
|
#ifndef OPTIONAL
|
||||||
#define OPTIONAL
|
#define OPTIONAL
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define PACKED __attribute__((packed))
|
||||||
|
#ifndef __declspec
|
||||||
|
#define __declspec(e) __attribute__((e))
|
||||||
|
#endif
|
||||||
|
#ifndef _declspec
|
||||||
|
#define _declspec(e) __attribute__((e))
|
||||||
|
#endif
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
#define PACKED
|
||||||
|
#else
|
||||||
|
#define PACKED
|
||||||
|
#define _cdecl
|
||||||
|
#define __cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define DECLSPEC_NORETURN __declspec(noreturn)
|
||||||
|
#define DECLARE_STDCALL_P( type ) __stdcall type
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
#define DECLSPEC_NORETURN
|
||||||
|
#define DECLARE_STDCALL_P( type ) type __stdcall
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define DECLSPEC_NORETURN __declspec(noreturn)
|
||||||
|
#define DECLARE_STDCALL_P( type ) type __stdcall
|
||||||
|
#endif /* __GNUC__/__WATCOMC__ */
|
||||||
|
|
||||||
|
#define DECLSPEC_IMPORT __declspec(dllimport)
|
||||||
|
#define DECLSPEC_EXPORT __declspec(dllexport)
|
||||||
|
#ifndef DECLSPEC_NOINLINE
|
||||||
|
#if (_MSC_VER >= 1300)
|
||||||
|
#define DECLSPEC_NOINLINE __declspec(noinline)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define DECLSPEC_NOINLINE __attribute__((noinline))
|
||||||
|
#else
|
||||||
|
#define DECLSPEC_NOINLINE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef far
|
||||||
|
#undef near
|
||||||
|
#undef pascal
|
||||||
|
|
||||||
|
#define far
|
||||||
|
#define near
|
||||||
|
#define pascal __stdcall
|
||||||
|
|
||||||
|
//#define cdecl _cdecl
|
||||||
|
#ifndef CDECL
|
||||||
|
#define CDECL _cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
|
||||||
|
#ifndef CALLBACK
|
||||||
|
#define CALLBACK __stdcall
|
||||||
|
#endif
|
||||||
|
#ifndef WINAPI
|
||||||
|
#define WINAPI __stdcall
|
||||||
|
#endif
|
||||||
|
#define WINAPIV __cdecl
|
||||||
|
#define APIENTRY WINAPI
|
||||||
|
#define APIPRIVATE WINAPI
|
||||||
|
#define PASCAL WINAPI
|
||||||
|
#else
|
||||||
|
#define CALLBACK
|
||||||
|
#define WINAPI
|
||||||
|
#define WINAPIV
|
||||||
|
#define APIENTRY WINAPI
|
||||||
|
#define APIPRIVATE
|
||||||
|
#define PASCAL pascal
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef FAR
|
||||||
|
#undef NEAR
|
||||||
|
#define FAR
|
||||||
|
#define NEAR
|
||||||
|
|
||||||
|
#ifndef CONST
|
||||||
|
#define CONST const
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _DEF_WINBOOL_
|
||||||
|
#define _DEF_WINBOOL_
|
||||||
|
typedef int WINBOOL;
|
||||||
|
#pragma push_macro("BOOL")
|
||||||
|
#undef BOOL
|
||||||
|
#if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU)
|
||||||
|
typedef int BOOL;
|
||||||
|
#endif
|
||||||
|
#define BOOL WINBOOL
|
||||||
|
typedef BOOL *PBOOL;
|
||||||
|
typedef BOOL *LPBOOL;
|
||||||
|
#pragma pop_macro("BOOL")
|
||||||
|
#endif /* _DEF_WINBOOL_ */
|
||||||
|
|
||||||
|
typedef unsigned char BYTE;
|
||||||
|
typedef unsigned short WORD;
|
||||||
|
#ifndef __ROS_LONG64__
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
#else
|
||||||
|
typedef unsigned int DWORD;
|
||||||
|
#endif
|
||||||
|
typedef float FLOAT;
|
||||||
|
typedef FLOAT *PFLOAT;
|
||||||
|
typedef BYTE *PBYTE;
|
||||||
|
typedef BYTE *LPBYTE;
|
||||||
|
typedef int *PINT;
|
||||||
|
typedef int *LPINT;
|
||||||
|
typedef WORD *PWORD;
|
||||||
|
typedef WORD *LPWORD;
|
||||||
|
#ifndef __ROS_LONG64__
|
||||||
|
typedef long *LPLONG;
|
||||||
|
#else
|
||||||
|
typedef int *LPLONG;
|
||||||
|
#endif
|
||||||
|
typedef DWORD *PDWORD;
|
||||||
|
typedef DWORD *LPDWORD;
|
||||||
|
typedef void *LPVOID;
|
||||||
|
#ifndef _LPCVOID_DEFINED
|
||||||
|
#define _LPCVOID_DEFINED
|
||||||
|
typedef CONST void *LPCVOID;
|
||||||
|
#endif
|
||||||
|
//typedef int INT;
|
||||||
|
typedef unsigned int UINT;
|
||||||
|
typedef unsigned int *PUINT;
|
||||||
|
typedef unsigned int *LPUINT;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NT_INCLUDED
|
||||||
|
#include <winnt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//#include <specstrings.h>
|
||||||
|
|
||||||
|
typedef UINT_PTR WPARAM;
|
||||||
|
typedef LONG_PTR LPARAM;
|
||||||
|
typedef LONG_PTR LRESULT;
|
||||||
|
#ifndef _HRESULT_DEFINED
|
||||||
|
typedef LONG HRESULT;
|
||||||
|
#define _HRESULT_DEFINED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NOMINMAX
|
||||||
|
#ifndef max
|
||||||
|
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||||
|
#endif
|
||||||
|
#ifndef min
|
||||||
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MAKEWORD(a,b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xff)) | ((WORD)((BYTE)((DWORD_PTR)(b) & 0xff))) << 8))
|
||||||
|
#define MAKELONG(a,b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | ((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16))
|
||||||
|
#define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff))
|
||||||
|
#define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16))
|
||||||
|
#define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff))
|
||||||
|
#define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8))
|
||||||
|
|
||||||
|
#ifndef WIN_INTERNAL
|
||||||
|
DECLARE_HANDLE (HWND);
|
||||||
|
//DECLARE_HANDLE (HHOOK);
|
||||||
|
#ifdef WINABLE
|
||||||
|
DECLARE_HANDLE (HEVENT);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef WORD ATOM;
|
||||||
|
|
||||||
|
typedef HANDLE *SPHANDLE;
|
||||||
|
typedef HANDLE *LPHANDLE;
|
||||||
|
typedef HANDLE HGLOBAL;
|
||||||
|
typedef HANDLE HLOCAL;
|
||||||
|
typedef HANDLE GLOBALHANDLE;
|
||||||
|
typedef HANDLE LOCALHANDLE;
|
||||||
|
#ifdef _WIN64
|
||||||
|
typedef INT_PTR (WINAPI *FARPROC)();
|
||||||
|
typedef INT_PTR (WINAPI *NEARPROC)();
|
||||||
|
typedef INT_PTR (WINAPI *PROC)();
|
||||||
|
#else
|
||||||
|
typedef int (WINAPI *FARPROC)();
|
||||||
|
typedef int (WINAPI *NEARPROC)();
|
||||||
|
typedef int (WINAPI *PROC)();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef void *HGDIOBJ;
|
||||||
|
|
||||||
|
DECLARE_HANDLE(HKEY);
|
||||||
|
typedef HKEY *PHKEY;
|
||||||
|
|
||||||
|
DECLARE_HANDLE(HACCEL);
|
||||||
|
DECLARE_HANDLE(HBITMAP);
|
||||||
|
DECLARE_HANDLE(HBRUSH);
|
||||||
|
DECLARE_HANDLE(HCOLORSPACE);
|
||||||
|
DECLARE_HANDLE(HDC);
|
||||||
|
DECLARE_HANDLE(HGLRC);
|
||||||
|
DECLARE_HANDLE(HDESK);
|
||||||
|
DECLARE_HANDLE(HENHMETAFILE);
|
||||||
|
DECLARE_HANDLE(HFONT);
|
||||||
|
DECLARE_HANDLE(HICON);
|
||||||
|
DECLARE_HANDLE(HMENU);
|
||||||
|
DECLARE_HANDLE(HMETAFILE);
|
||||||
|
DECLARE_HANDLE(HINSTANCE);
|
||||||
|
typedef HINSTANCE HMODULE;
|
||||||
|
DECLARE_HANDLE(HPALETTE);
|
||||||
|
DECLARE_HANDLE(HPEN);
|
||||||
|
DECLARE_HANDLE(HRGN);
|
||||||
|
DECLARE_HANDLE(HRSRC);
|
||||||
|
DECLARE_HANDLE(HSTR);
|
||||||
|
DECLARE_HANDLE(HTASK);
|
||||||
|
DECLARE_HANDLE(HWINSTA);
|
||||||
|
DECLARE_HANDLE(HKL);
|
||||||
|
DECLARE_HANDLE(HMONITOR);
|
||||||
|
DECLARE_HANDLE(HWINEVENTHOOK);
|
||||||
|
DECLARE_HANDLE(HUMPD);
|
||||||
|
|
||||||
|
typedef int HFILE;
|
||||||
|
typedef HICON HCURSOR;
|
||||||
|
typedef DWORD COLORREF;
|
||||||
|
typedef DWORD *LPCOLORREF;
|
||||||
|
|
||||||
|
#define HFILE_ERROR ((HFILE)-1)
|
||||||
|
|
||||||
|
typedef struct tagRECT {
|
||||||
|
LONG left;
|
||||||
|
LONG top;
|
||||||
|
LONG right;
|
||||||
|
LONG bottom;
|
||||||
|
} RECT,*PRECT,*NPRECT,*LPRECT;
|
||||||
|
|
||||||
|
typedef const RECT *LPCRECT;
|
||||||
|
|
||||||
|
typedef struct _RECTL {
|
||||||
|
LONG left;
|
||||||
|
LONG top;
|
||||||
|
LONG right;
|
||||||
|
LONG bottom;
|
||||||
|
} RECTL,*PRECTL,*LPRECTL;
|
||||||
|
|
||||||
|
typedef const RECTL *LPCRECTL;
|
||||||
|
|
||||||
|
typedef struct tagPOINT {
|
||||||
|
LONG x;
|
||||||
|
LONG y;
|
||||||
|
} POINT,*PPOINT,*NPPOINT,*LPPOINT;
|
||||||
|
|
||||||
|
typedef struct _POINTL {
|
||||||
|
LONG x;
|
||||||
|
LONG y;
|
||||||
|
} POINTL,*PPOINTL;
|
||||||
|
|
||||||
|
typedef struct tagSIZE {
|
||||||
|
LONG cx;
|
||||||
|
LONG cy;
|
||||||
|
} SIZE,*PSIZE,*LPSIZE;
|
||||||
|
|
||||||
|
typedef SIZE SIZEL;
|
||||||
|
typedef SIZE *PSIZEL,*LPSIZEL;
|
||||||
|
|
||||||
|
typedef struct tagPOINTS {
|
||||||
|
SHORT x;
|
||||||
|
SHORT y;
|
||||||
|
} POINTS,*PPOINTS,*LPPOINTS;
|
||||||
|
|
||||||
|
typedef struct _FILETIME {
|
||||||
|
DWORD dwLowDateTime;
|
||||||
|
DWORD dwHighDateTime;
|
||||||
|
} FILETIME,*PFILETIME,*LPFILETIME;
|
||||||
|
#define _FILETIME_
|
||||||
|
|
||||||
|
#define DM_UPDATE 1
|
||||||
|
#define DM_COPY 2
|
||||||
|
#define DM_PROMPT 4
|
||||||
|
#define DM_MODIFY 8
|
||||||
|
|
||||||
|
#define DM_IN_BUFFER DM_MODIFY
|
||||||
|
#define DM_IN_PROMPT DM_PROMPT
|
||||||
|
#define DM_OUT_BUFFER DM_COPY
|
||||||
|
#define DM_OUT_DEFAULT DM_UPDATE
|
||||||
|
|
||||||
|
#define DC_FIELDS 1
|
||||||
|
#define DC_PAPERS 2
|
||||||
|
#define DC_PAPERSIZE 3
|
||||||
|
#define DC_MINEXTENT 4
|
||||||
|
#define DC_MAXEXTENT 5
|
||||||
|
#define DC_BINS 6
|
||||||
|
#define DC_DUPLEX 7
|
||||||
|
#define DC_SIZE 8
|
||||||
|
#define DC_EXTRA 9
|
||||||
|
#define DC_VERSION 10
|
||||||
|
#define DC_DRIVER 11
|
||||||
|
#define DC_BINNAMES 12
|
||||||
|
#define DC_ENUMRESOLUTIONS 13
|
||||||
|
#define DC_FILEDEPENDENCIES 14
|
||||||
|
#define DC_TRUETYPE 15
|
||||||
|
#define DC_PAPERNAMES 16
|
||||||
|
#define DC_ORIENTATION 17
|
||||||
|
#define DC_COPIES 18
|
||||||
|
|
||||||
/* needed by header files generated by WIDL */
|
/* needed by header files generated by WIDL */
|
||||||
#ifdef __WINESRC__
|
#ifdef __WINESRC__
|
||||||
|
@ -98,26 +417,41 @@ extern "C" {
|
||||||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
|
||||||
|
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
|
||||||
|
#define DBG_UNREFERENCED_PARAMETER(P)
|
||||||
|
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
|
||||||
|
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
#ifndef _export
|
||||||
|
#define _export
|
||||||
|
#endif
|
||||||
|
#ifndef __export
|
||||||
|
#define __export
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define PACKED __attribute__((packed))
|
#define PACKED __attribute__((packed))
|
||||||
#ifndef _fastcall
|
//#ifndef _fastcall
|
||||||
#define _fastcall __attribute__((fastcall))
|
//#define _fastcall __attribute__((fastcall))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef __fastcall
|
//#ifndef __fastcall
|
||||||
#define __fastcall __attribute__((fastcall))
|
//#define __fastcall __attribute__((fastcall))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef _stdcall
|
//#ifndef _stdcall
|
||||||
#define _stdcall __attribute__((stdcall))
|
//#define _stdcall __attribute__((stdcall))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef __stdcall
|
//#ifndef __stdcall
|
||||||
#define __stdcall __attribute__((stdcall))
|
//#define __stdcall __attribute__((stdcall))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef _cdecl
|
//#ifndef _cdecl
|
||||||
#define _cdecl __attribute__((cdecl))
|
//#define _cdecl __attribute__((cdecl))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef __cdecl
|
//#ifndef __cdecl
|
||||||
#define __cdecl __attribute__((cdecl))
|
//#define __cdecl __attribute__((cdecl))
|
||||||
#endif
|
//#endif
|
||||||
#ifndef __declspec
|
#ifndef __declspec
|
||||||
#define __declspec(e) __attribute__((e))
|
#define __declspec(e) __attribute__((e))
|
||||||
#endif
|
#endif
|
||||||
|
@ -131,186 +465,9 @@ extern "C" {
|
||||||
#define _cdecl
|
#define _cdecl
|
||||||
#define __cdecl
|
#define __cdecl
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef pascal
|
|
||||||
#undef _pascal
|
|
||||||
#undef __pascal
|
|
||||||
#define pascal __stdcall
|
|
||||||
#define _pascal __stdcall
|
|
||||||
#define __pascal __stdcall
|
|
||||||
|
|
||||||
#define CDECL _cdecl
|
|
||||||
|
|
||||||
#if !defined(__x86_64__) //defined(_STDCALL_SUPPORTED)
|
|
||||||
#define CALLBACK __stdcall
|
|
||||||
#define WINAPI __stdcall
|
|
||||||
#define WINAPIV __cdecl
|
|
||||||
#define APIENTRY WINAPI
|
|
||||||
#define APIPRIVATE __stdcall
|
|
||||||
#define PASCAL __stdcall
|
|
||||||
#else
|
|
||||||
#define CALLBACK
|
|
||||||
#define WINAPI
|
|
||||||
#define WINAPIV
|
|
||||||
#define APIENTRY WINAPI
|
|
||||||
#define APIPRIVATE
|
|
||||||
#define PASCAL pascal
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DECLSPEC_IMPORT __declspec(dllimport)
|
#if 1 // needed by shlwapi.h
|
||||||
#define DECLSPEC_EXPORT __declspec(dllexport)
|
|
||||||
#ifndef DECLSPEC_NOINLINE
|
|
||||||
#if (_MSC_VER >= 1300)
|
|
||||||
#define DECLSPEC_NOINLINE __declspec(noinline)
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
#define DECLSPEC_NOINLINE __attribute__((noinline))
|
|
||||||
#else
|
|
||||||
#define DECLSPEC_NOINLINE
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define DECLSPEC_NORETURN __declspec(noreturn)
|
|
||||||
#define DECLARE_STDCALL_P( type ) __stdcall type
|
|
||||||
#elif defined(__WATCOMC__)
|
|
||||||
#define DECLSPEC_NORETURN
|
|
||||||
#define DECLARE_STDCALL_P( type ) type __stdcall
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define DECLSPEC_NORETURN __declspec(noreturn)
|
|
||||||
#define DECLARE_STDCALL_P( type ) type __stdcall
|
|
||||||
#endif /* __GNUC__/__WATCOMC__ */
|
|
||||||
#define MAKEWORD(a,b) ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))
|
|
||||||
#define MAKELONG(a,b) ((LONG)(((WORD)(a))|(((DWORD)((WORD)(b)))<<16)))
|
|
||||||
#define LOWORD(l) ((WORD)((DWORD_PTR)(l)))
|
|
||||||
#define HIWORD(l) ((WORD)(((DWORD_PTR)(l)>>16)&0xFFFF))
|
|
||||||
#define LOBYTE(w) ((BYTE)(w))
|
|
||||||
#define HIBYTE(w) ((BYTE)(((WORD)(w)>>8)&0xFF))
|
|
||||||
|
|
||||||
#ifndef __WATCOMC__
|
|
||||||
#ifndef _export
|
|
||||||
#define _export
|
|
||||||
#endif
|
|
||||||
#ifndef __export
|
|
||||||
#define __export
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef NOMINMAX
|
|
||||||
#ifndef max
|
|
||||||
#define max(a,b) ((a)>(b)?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef min
|
|
||||||
#define min(a,b) ((a)<(b)?(a):(b))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define UNREFERENCED_PARAMETER(P) {(P)=(P);}
|
|
||||||
#define UNREFERENCED_LOCAL_VARIABLE(L) {(L)=(L);}
|
|
||||||
#define DBG_UNREFERENCED_PARAMETER(P)
|
|
||||||
#define DBG_UNREFERENCED_LOCAL_VARIABLE(L)
|
|
||||||
|
|
||||||
#ifndef __ANONYMOUS_DEFINED
|
|
||||||
#define __ANONYMOUS_DEFINED
|
|
||||||
|
|
||||||
#ifndef NONAMELESSUNION
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define _ANONYMOUS_UNION __extension__
|
|
||||||
#define _ANONYMOUS_STRUCT __extension__
|
|
||||||
#elif defined(__WATCOMC__) || defined(_MSC_VER)
|
|
||||||
#define _ANONYMOUS_UNION
|
|
||||||
#define _ANONYMOUS_STRUCT
|
|
||||||
#endif /* __GNUC__/__WATCOMC__ */
|
|
||||||
#endif /* NONAMELESSUNION */
|
|
||||||
|
|
||||||
#ifndef _ANONYMOUS_UNION
|
|
||||||
#define _ANONYMOUS_UNION
|
|
||||||
#define _UNION_NAME(x) x
|
|
||||||
#define DUMMYUNIONNAME u
|
|
||||||
#define DUMMYUNIONNAME1 u1
|
|
||||||
#define DUMMYUNIONNAME2 u2
|
|
||||||
#define DUMMYUNIONNAME3 u3
|
|
||||||
#define DUMMYUNIONNAME4 u4
|
|
||||||
#define DUMMYUNIONNAME5 u5
|
|
||||||
#define DUMMYUNIONNAME6 u6
|
|
||||||
#define DUMMYUNIONNAME7 u7
|
|
||||||
#define DUMMYUNIONNAME8 u8
|
|
||||||
#else
|
|
||||||
#define _UNION_NAME(x)
|
|
||||||
#define DUMMYUNIONNAME
|
|
||||||
#define DUMMYUNIONNAME1
|
|
||||||
#define DUMMYUNIONNAME2
|
|
||||||
#define DUMMYUNIONNAME3
|
|
||||||
#define DUMMYUNIONNAME4
|
|
||||||
#define DUMMYUNIONNAME5
|
|
||||||
#define DUMMYUNIONNAME6
|
|
||||||
#define DUMMYUNIONNAME7
|
|
||||||
#define DUMMYUNIONNAME8
|
|
||||||
#endif
|
|
||||||
#ifndef _ANONYMOUS_STRUCT
|
|
||||||
#define _ANONYMOUS_STRUCT
|
|
||||||
#define _STRUCT_NAME(x) x
|
|
||||||
#define DUMMYSTRUCTNAME s
|
|
||||||
#define DUMMYSTRUCTNAME1 s1
|
|
||||||
#define DUMMYSTRUCTNAME2 s2
|
|
||||||
#define DUMMYSTRUCTNAME3 s3
|
|
||||||
#define DUMMYSTRUCTNAME4 s4
|
|
||||||
#define DUMMYSTRUCTNAME5 s5
|
|
||||||
#else
|
|
||||||
#define _STRUCT_NAME(x)
|
|
||||||
#define DUMMYSTRUCTNAME
|
|
||||||
#define DUMMYSTRUCTNAME1
|
|
||||||
#define DUMMYSTRUCTNAME2
|
|
||||||
#define DUMMYSTRUCTNAME3
|
|
||||||
#define DUMMYSTRUCTNAME4
|
|
||||||
#define DUMMYSTRUCTNAME5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __ANONYMOUS_DEFINED */
|
|
||||||
|
|
||||||
#ifndef NO_STRICT
|
|
||||||
#ifndef STRICT
|
|
||||||
#define STRICT 1
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DWORD_DEFINED
|
|
||||||
#define DWORD_DEFINED
|
|
||||||
#ifndef __ROS_LONG64__
|
|
||||||
typedef unsigned long DWORD;
|
|
||||||
#else
|
|
||||||
typedef unsigned int DWORD;
|
|
||||||
#endif
|
|
||||||
#endif//DWORD_DEFINED
|
|
||||||
|
|
||||||
typedef int WINBOOL,*PWINBOOL,*LPWINBOOL;
|
|
||||||
/* FIXME: Is there a good solution to this? */
|
|
||||||
#ifndef XFree86Server
|
|
||||||
#ifndef __OBJC__
|
|
||||||
typedef WINBOOL BOOL;
|
|
||||||
#else
|
|
||||||
#define BOOL WINBOOL
|
|
||||||
#endif
|
|
||||||
typedef unsigned char BYTE;
|
|
||||||
#endif /* ndef XFree86Server */
|
|
||||||
typedef BOOL *PBOOL,*LPBOOL;
|
|
||||||
typedef unsigned short WORD;
|
|
||||||
typedef float FLOAT;
|
|
||||||
typedef FLOAT *PFLOAT;
|
|
||||||
typedef BYTE *PBYTE,*LPBYTE;
|
|
||||||
typedef int *PINT,*LPINT;
|
|
||||||
typedef WORD *PWORD,*LPWORD;
|
|
||||||
#ifndef __ROS_LONG64__
|
|
||||||
typedef long *LPLONG;
|
|
||||||
#else
|
|
||||||
typedef int *LPLONG;
|
|
||||||
#endif
|
|
||||||
typedef DWORD *PDWORD,*LPDWORD;
|
|
||||||
typedef CONST void *LPCVOID;
|
|
||||||
|
|
||||||
typedef unsigned int UINT,*PUINT,*LPUINT;
|
|
||||||
|
|
||||||
typedef void *LPVOID;
|
|
||||||
|
|
||||||
#ifndef __ms_va_list
|
#ifndef __ms_va_list
|
||||||
# if defined(__x86_64__) && defined (__GNUC__)
|
# if defined(__x86_64__) && defined (__GNUC__)
|
||||||
# define __ms_va_list __builtin_ms_va_list
|
# define __ms_va_list __builtin_ms_va_list
|
||||||
|
@ -322,115 +479,7 @@ typedef void *LPVOID;
|
||||||
# define __ms_va_end(list) va_end(list)
|
# define __ms_va_end(list) va_end(list)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
|
||||||
// Check if ntdef.h already defined these for us
|
|
||||||
//
|
|
||||||
#ifndef BASETYPES
|
|
||||||
#define BASETYPES
|
|
||||||
#ifndef __ROS_LONG64__
|
|
||||||
typedef unsigned long ULONG, *PULONG;
|
|
||||||
#else
|
|
||||||
typedef unsigned int ULONG, *PULONG;
|
|
||||||
#endif
|
#endif
|
||||||
typedef unsigned short USHORT, *PUSHORT;
|
|
||||||
typedef unsigned char UCHAR, *PUCHAR;
|
|
||||||
typedef char *PSZ;
|
|
||||||
typedef int INT;
|
|
||||||
#endif /* BASETYPES */
|
|
||||||
|
|
||||||
#ifndef NT_INCLUDED
|
|
||||||
#include <winnt.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef HANDLE *LPHANDLE;
|
|
||||||
typedef UINT_PTR WPARAM;
|
|
||||||
typedef LONG_PTR LPARAM;
|
|
||||||
typedef LONG_PTR LRESULT;
|
|
||||||
#ifndef _HRESULT_DEFINED
|
|
||||||
typedef LONG HRESULT;
|
|
||||||
#define _HRESULT_DEFINED
|
|
||||||
#endif
|
|
||||||
#ifndef XFree86Server
|
|
||||||
typedef WORD ATOM;
|
|
||||||
#endif /* XFree86Server */
|
|
||||||
typedef HANDLE HGLOBAL;
|
|
||||||
typedef HANDLE HLOCAL;
|
|
||||||
typedef HANDLE GLOBALHANDLE;
|
|
||||||
typedef HANDLE LOCALHANDLE;
|
|
||||||
typedef void *HGDIOBJ;
|
|
||||||
DECLARE_HANDLE(HACCEL);
|
|
||||||
DECLARE_HANDLE(HBITMAP);
|
|
||||||
DECLARE_HANDLE(HBRUSH);
|
|
||||||
DECLARE_HANDLE(HCOLORSPACE);
|
|
||||||
DECLARE_HANDLE(HDC);
|
|
||||||
DECLARE_HANDLE(HGLRC);
|
|
||||||
DECLARE_HANDLE(HDESK);
|
|
||||||
DECLARE_HANDLE(HENHMETAFILE);
|
|
||||||
DECLARE_HANDLE(HFONT);
|
|
||||||
DECLARE_HANDLE(HICON);
|
|
||||||
DECLARE_HANDLE(HKEY);
|
|
||||||
/* FIXME: How to handle these. SM_CMONITORS etc in winuser.h also. */
|
|
||||||
/* #if (WINVER >= 0x0500) */
|
|
||||||
DECLARE_HANDLE(HMONITOR);
|
|
||||||
DECLARE_HANDLE(HUMPD);
|
|
||||||
#define HMONITOR_DECLARED 1
|
|
||||||
DECLARE_HANDLE(HTERMINAL);
|
|
||||||
DECLARE_HANDLE(HWINEVENTHOOK);
|
|
||||||
/* #endif */
|
|
||||||
typedef HKEY *PHKEY;
|
|
||||||
DECLARE_HANDLE(HMENU);
|
|
||||||
DECLARE_HANDLE(HMETAFILE);
|
|
||||||
DECLARE_HANDLE(HINSTANCE);
|
|
||||||
typedef HINSTANCE HMODULE;
|
|
||||||
DECLARE_HANDLE(HPALETTE);
|
|
||||||
DECLARE_HANDLE(HPEN);
|
|
||||||
DECLARE_HANDLE(HRGN);
|
|
||||||
DECLARE_HANDLE(HRSRC);
|
|
||||||
DECLARE_HANDLE(HSTR);
|
|
||||||
DECLARE_HANDLE(HTASK);
|
|
||||||
DECLARE_HANDLE(HWND);
|
|
||||||
DECLARE_HANDLE(HWINSTA);
|
|
||||||
DECLARE_HANDLE(HKL);
|
|
||||||
typedef int HFILE;
|
|
||||||
typedef HICON HCURSOR;
|
|
||||||
typedef DWORD COLORREF;
|
|
||||||
typedef DWORD* LPCOLORREF;
|
|
||||||
#ifdef _WIN64
|
|
||||||
typedef INT_PTR (FAR WINAPI *FARPROC)();
|
|
||||||
typedef INT_PTR (NEAR WINAPI *NEARPROC)();
|
|
||||||
typedef INT_PTR (WINAPI *PROC)();
|
|
||||||
#else
|
|
||||||
typedef int (FAR WINAPI *FARPROC)();
|
|
||||||
typedef int (NEAR WINAPI *NEARPROC)();
|
|
||||||
typedef int (WINAPI *PROC)();
|
|
||||||
#endif
|
|
||||||
typedef struct tagRECT {
|
|
||||||
LONG left;
|
|
||||||
LONG top;
|
|
||||||
LONG right;
|
|
||||||
LONG bottom;
|
|
||||||
} RECT,*PRECT,*LPRECT;
|
|
||||||
typedef const RECT *LPCRECT;
|
|
||||||
typedef struct tagRECTL {
|
|
||||||
LONG left;
|
|
||||||
LONG top;
|
|
||||||
LONG right;
|
|
||||||
LONG bottom;
|
|
||||||
} RECTL,*PRECTL,*LPRECTL;
|
|
||||||
typedef const RECTL *LPCRECTL;
|
|
||||||
typedef struct tagPOINT {
|
|
||||||
LONG x;
|
|
||||||
LONG y;
|
|
||||||
} POINT,POINTL,*PPOINT,*LPPOINT,*PPOINTL,*LPPOINTL;
|
|
||||||
typedef struct tagSIZE {
|
|
||||||
LONG cx;
|
|
||||||
LONG cy;
|
|
||||||
} SIZE,SIZEL,*PSIZE,*LPSIZE,*PSIZEL,*LPSIZEL;
|
|
||||||
typedef struct tagPOINTS {
|
|
||||||
SHORT x;
|
|
||||||
SHORT y;
|
|
||||||
} POINTS,*PPOINTS,*LPPOINTS;
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
|
@ -439,4 +488,6 @@ typedef struct tagPOINTS {
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
#endif /* _WINDEF_ */
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,62 @@
|
||||||
#include <msvctarget.h>
|
#include <msvctarget.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ANONYMOUS_DEFINED
|
||||||
|
#define __ANONYMOUS_DEFINED
|
||||||
|
#ifndef NONAMELESSUNION
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define _ANONYMOUS_UNION __extension__
|
||||||
|
#define _ANONYMOUS_STRUCT __extension__
|
||||||
|
#elif defined(__WATCOMC__) || defined(_MSC_VER)
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#endif /* __GNUC__/__WATCOMC__ */
|
||||||
|
#endif /* NONAMELESSUNION */
|
||||||
|
#ifndef _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _UNION_NAME(x) x
|
||||||
|
#define DUMMYUNIONNAME u
|
||||||
|
#define DUMMYUNIONNAME1 u1
|
||||||
|
#define DUMMYUNIONNAME2 u2
|
||||||
|
#define DUMMYUNIONNAME3 u3
|
||||||
|
#define DUMMYUNIONNAME4 u4
|
||||||
|
#define DUMMYUNIONNAME5 u5
|
||||||
|
#define DUMMYUNIONNAME6 u6
|
||||||
|
#define DUMMYUNIONNAME7 u7
|
||||||
|
#define DUMMYUNIONNAME8 u8
|
||||||
|
#else
|
||||||
|
#define _UNION_NAME(x)
|
||||||
|
#define DUMMYUNIONNAME
|
||||||
|
#define DUMMYUNIONNAME1
|
||||||
|
#define DUMMYUNIONNAME2
|
||||||
|
#define DUMMYUNIONNAME3
|
||||||
|
#define DUMMYUNIONNAME4
|
||||||
|
#define DUMMYUNIONNAME5
|
||||||
|
#define DUMMYUNIONNAME6
|
||||||
|
#define DUMMYUNIONNAME7
|
||||||
|
#define DUMMYUNIONNAME8
|
||||||
|
#endif
|
||||||
|
#ifndef _ANONYMOUS_STRUCT
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#define _STRUCT_NAME(x) x
|
||||||
|
#define DUMMYSTRUCTNAME s
|
||||||
|
#define DUMMYSTRUCTNAME1 s1
|
||||||
|
#define DUMMYSTRUCTNAME2 s2
|
||||||
|
#define DUMMYSTRUCTNAME3 s3
|
||||||
|
#define DUMMYSTRUCTNAME4 s4
|
||||||
|
#define DUMMYSTRUCTNAME5 s5
|
||||||
|
#else
|
||||||
|
#define _STRUCT_NAME(x)
|
||||||
|
#define DUMMYSTRUCTNAME
|
||||||
|
#define DUMMYSTRUCTNAME1
|
||||||
|
#define DUMMYSTRUCTNAME2
|
||||||
|
#define DUMMYSTRUCTNAME3
|
||||||
|
#define DUMMYSTRUCTNAME4
|
||||||
|
#define DUMMYSTRUCTNAME5
|
||||||
|
#endif
|
||||||
|
#endif /* __ANONYMOUS_DEFINED */
|
||||||
|
|
||||||
|
|
||||||
#ifndef DECLSPEC_ALIGN
|
#ifndef DECLSPEC_ALIGN
|
||||||
# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
|
# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
|
||||||
# define DECLSPEC_ALIGN(x) __declspec(align(x))
|
# define DECLSPEC_ALIGN(x) __declspec(align(x))
|
||||||
|
@ -5209,12 +5265,24 @@ MemoryBarrier(VOID)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_M_IX86)
|
#if defined(_M_IX86)
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#pragma intrinsic(__int2c)
|
||||||
#pragma intrinsic(_mm_pause)
|
#pragma intrinsic(_mm_pause)
|
||||||
#define YieldProcessor _mm_pause
|
#define YieldProcessor _mm_pause
|
||||||
#else
|
#else
|
||||||
#define YieldProcessor() __asm__ __volatile__("pause");
|
#define YieldProcessor() __asm__ __volatile__("pause");
|
||||||
|
#define __int2c() __asm__ __volatile__("int $0x2c");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
DbgRaiseAssertionFailure(VOID)
|
||||||
|
{
|
||||||
|
__int2c();
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined (_M_AMD64)
|
#elif defined (_M_AMD64)
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma intrinsic(_mm_pause)
|
#pragma intrinsic(_mm_pause)
|
||||||
|
|
|
@ -173,6 +173,12 @@ typedef struct _KPCR
|
||||||
ULONG StallScaleFactor;
|
ULONG StallScaleFactor;
|
||||||
UCHAR SpareUnused;
|
UCHAR SpareUnused;
|
||||||
UCHAR Number;
|
UCHAR Number;
|
||||||
|
UCHAR Spare0;
|
||||||
|
UCHAR SecondLevelCacheAssociativity;
|
||||||
|
ULONG VdmAlert;
|
||||||
|
ULONG KernelReserved[14];
|
||||||
|
ULONG SecondLevelCacheSize;
|
||||||
|
ULONG HalReserved[16];
|
||||||
} KPCR, *PKPCR;
|
} KPCR, *PKPCR;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -246,6 +252,35 @@ KeRaiseIrqlToDpcLevel(
|
||||||
#define KeLowerIrql(NewIrql) KfLowerIrql(NewIrql)
|
#define KeLowerIrql(NewIrql) KfLowerIrql(NewIrql)
|
||||||
#define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KfRaiseIrql(NewIrql)
|
#define KeRaiseIrql(NewIrql, OldIrql) *(OldIrql) = KfRaiseIrql(NewIrql)
|
||||||
|
|
||||||
|
NTHALAPI
|
||||||
|
KIRQL
|
||||||
|
FASTCALL
|
||||||
|
KfAcquireSpinLock(
|
||||||
|
IN OUT PKSPIN_LOCK SpinLock);
|
||||||
|
#define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a)
|
||||||
|
|
||||||
|
NTHALAPI
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KfReleaseSpinLock(
|
||||||
|
IN OUT PKSPIN_LOCK SpinLock,
|
||||||
|
IN KIRQL NewIrql);
|
||||||
|
#define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b)
|
||||||
|
|
||||||
|
NTKERNELAPI
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KefAcquireSpinLockAtDpcLevel(
|
||||||
|
IN OUT PKSPIN_LOCK SpinLock);
|
||||||
|
#define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
|
||||||
|
|
||||||
|
NTKERNELAPI
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KefReleaseSpinLockFromDpcLevel(
|
||||||
|
IN OUT PKSPIN_LOCK SpinLock);
|
||||||
|
#define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cache clean and flush
|
// Cache clean and flush
|
||||||
//
|
//
|
||||||
|
@ -258,6 +293,26 @@ VOID
|
||||||
HalSweepIcache(
|
HalSweepIcache(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
FORCEINLINE
|
||||||
|
VOID
|
||||||
|
_KeQueryTickCount(
|
||||||
|
OUT PLARGE_INTEGER CurrentCount)
|
||||||
|
{
|
||||||
|
for (;;) {
|
||||||
|
#ifdef NONAMELESSUNION
|
||||||
|
CurrentCount->s.HighPart = KeTickCount.High1Time;
|
||||||
|
CurrentCount->s.LowPart = KeTickCount.LowPart;
|
||||||
|
if (CurrentCount->s.HighPart == KeTickCount.High2Time) break;
|
||||||
|
#else
|
||||||
|
CurrentCount->HighPart = KeTickCount.High1Time;
|
||||||
|
CurrentCount->LowPart = KeTickCount.LowPart;
|
||||||
|
if (CurrentCount->HighPart == KeTickCount.High2Time) break;
|
||||||
|
#endif
|
||||||
|
YieldProcessor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#define KeQueryTickCount(CurrentCount) _KeQueryTickCount(CurrentCount)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -83,7 +83,7 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGIST
|
||||||
#else
|
#else
|
||||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||||
frame->Prev = teb->ExceptionList;
|
frame->Prev = teb->ExceptionList;
|
||||||
teb->ExceptionList = frame;
|
teb->ExceptionList = (PVOID)frame;
|
||||||
return frame->Prev;
|
return frame->Prev;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTR
|
||||||
#else
|
#else
|
||||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||||
frame->Prev = teb->ExceptionList;
|
frame->Prev = teb->ExceptionList;
|
||||||
teb->ExceptionList = frame;
|
teb->ExceptionList = (PVOID)frame;
|
||||||
return frame->Prev;
|
return frame->Prev;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,6 @@ void _assert(const char *exp, const char *file, unsigned line)
|
||||||
/* Does the user want to debug? */
|
/* Does the user want to debug? */
|
||||||
if (iResult == IDRETRY)
|
if (iResult == IDRETRY)
|
||||||
{
|
{
|
||||||
__debugbreak();
|
DbgRaiseAssertionFailure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ FsRtlDissectDbcs(IN ANSI_STRING Name,
|
||||||
{
|
{
|
||||||
ULONG FirstPosition, i;
|
ULONG FirstPosition, i;
|
||||||
ULONG SkipFirstSlash = 0;
|
ULONG SkipFirstSlash = 0;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Zero the strings before continuing */
|
/* Zero the strings before continuing */
|
||||||
RtlZeroMemory(FirstPart, sizeof(ANSI_STRING));
|
RtlZeroMemory(FirstPart, sizeof(ANSI_STRING));
|
||||||
|
@ -116,6 +117,7 @@ NTAPI
|
||||||
FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check every character */
|
/* Check every character */
|
||||||
for (i = 0; i < Name->Length; i++)
|
for (i = 0; i < Name->Length; i++)
|
||||||
|
@ -138,7 +140,7 @@ FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
* @name FsRtlIsDbcsInExpression
|
* @name FsRtlIsDbcsInExpression
|
||||||
* @implemented
|
* @halfplemented
|
||||||
*
|
*
|
||||||
* Check if the Name string is in the Expression string.
|
* Check if the Name string is in the Expression string.
|
||||||
*
|
*
|
||||||
|
@ -150,7 +152,7 @@ FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
||||||
*
|
*
|
||||||
* @return TRUE if Name is found in Expression, FALSE otherwise
|
* @return TRUE if Name is found in Expression, FALSE otherwise
|
||||||
*
|
*
|
||||||
* @remarks None
|
* @remarks Implementation should be fixed to handle wildcards
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
@ -159,7 +161,10 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
||||||
IN PANSI_STRING Name)
|
IN PANSI_STRING Name)
|
||||||
{
|
{
|
||||||
ULONG ExpressionPosition, NamePosition, MatchingChars = 0;
|
ULONG ExpressionPosition, NamePosition, MatchingChars = 0;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
ASSERT(Name->Length);
|
||||||
|
ASSERT(Expression->Length);
|
||||||
ASSERT(!FsRtlDoesDbcsContainWildCards(Name));
|
ASSERT(!FsRtlDoesDbcsContainWildCards(Name));
|
||||||
|
|
||||||
/* One can't be null, both can be */
|
/* One can't be null, both can be */
|
||||||
|
@ -242,6 +247,7 @@ FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName,
|
||||||
ANSI_STRING FirstPart, RemainingPart, Name;
|
ANSI_STRING FirstPart, RemainingPart, Name;
|
||||||
BOOLEAN LastDot;
|
BOOLEAN LastDot;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Just quit if the string is empty */
|
/* Just quit if the string is empty */
|
||||||
if (!DbcsName.Length)
|
if (!DbcsName.Length)
|
||||||
|
@ -378,6 +384,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName,
|
||||||
{
|
{
|
||||||
ANSI_STRING FirstPart, RemainingPart, Name;
|
ANSI_STRING FirstPart, RemainingPart, Name;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Just quit if the string is empty */
|
/* Just quit if the string is empty */
|
||||||
if (!DbcsName.Length)
|
if (!DbcsName.Length)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: ntoskrnl/fsrtl/filtrctx.c
|
* FILE: ntoskrnl/fsrtl/filtrctx.c
|
||||||
* PURPOSE: File Stream Filter Context support for File System Drivers
|
* PURPOSE: File Stream Filter Context support for File System Drivers
|
||||||
* PROGRAMMERS: None.
|
* PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
@ -12,11 +12,42 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
/* PRIVATE FUNCTIONS *********************************************************/
|
||||||
|
|
||||||
|
typedef struct _FILE_OBJECT_FILTER_CONTEXTS
|
||||||
|
{
|
||||||
|
FAST_MUTEX FilterContextsMutex;
|
||||||
|
LIST_ENTRY FilterContexts;
|
||||||
|
} FILE_OBJECT_FILTER_CONTEXTS, *PFILE_OBJECT_FILTER_CONTEXTS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
FsRtlPTeardownPerFileObjectContexts(IN PFILE_OBJECT FileObject)
|
||||||
|
{
|
||||||
|
PFILE_OBJECT_FILTER_CONTEXTS FOContext = NULL;
|
||||||
|
|
||||||
|
ASSERT(FileObject);
|
||||||
|
|
||||||
|
if (!(FOContext = IoGetFileObjectFilterContext(FileObject)))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASSERT(IoChangeFileObjectFilterContext(FileObject, FOContext, FALSE) == STATUS_SUCCESS);
|
||||||
|
ASSERT(IsListEmpty(&(FOContext->FilterContexts)));
|
||||||
|
|
||||||
|
ExFreePoolWithTag(FOContext, 'FOCX');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* PUBLIC FUNCTIONS **********************************************************/
|
/* PUBLIC FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
* @name FsRtlIsPagingFile
|
* @name FsRtlIsPagingFile
|
||||||
* @implemented NT 4.0
|
* @implemented NT 5.2
|
||||||
*
|
*
|
||||||
* The FsRtlIsPagingFile routine checks if the FileObject is a Paging File.
|
* The FsRtlIsPagingFile routine checks if the FileObject is a Paging File.
|
||||||
*
|
*
|
||||||
|
@ -32,25 +63,11 @@ LOGICAL
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlIsPagingFile(IN PFILE_OBJECT FileObject)
|
FsRtlIsPagingFile(IN PFILE_OBJECT FileObject)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
return MmIsFileObjectAPagingFile(FileObject);
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
|
||||||
PFSRTL_PER_STREAM_CONTEXT
|
|
||||||
NTAPI
|
|
||||||
FsRtlLookupPerStreamContextInternal(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
|
|
||||||
IN PVOID OwnerId OPTIONAL,
|
|
||||||
IN PVOID InstanceId OPTIONAL)
|
|
||||||
{
|
|
||||||
KeBugCheck(FILE_SYSTEM);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
*/
|
||||||
PFSRTL_PER_FILEOBJECT_CONTEXT
|
PFSRTL_PER_FILEOBJECT_CONTEXT
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -58,67 +75,335 @@ FsRtlLookupPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||||
IN PVOID OwnerId OPTIONAL,
|
IN PVOID OwnerId OPTIONAL,
|
||||||
IN PVOID InstanceId OPTIONAL)
|
IN PVOID InstanceId OPTIONAL)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
PLIST_ENTRY NextEntry;
|
||||||
return FALSE;
|
PFILE_OBJECT_FILTER_CONTEXTS FOContext = NULL;
|
||||||
|
PFSRTL_PER_FILEOBJECT_CONTEXT TmpPerFOContext, PerFOContext = NULL;
|
||||||
|
|
||||||
|
if (!FileObject || !(FOContext = IoGetFileObjectFilterContext(FileObject)))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
||||||
|
/* If list is empty, no need to browse it */
|
||||||
|
if (!IsListEmpty(&(FOContext->FilterContexts)))
|
||||||
|
{
|
||||||
|
for (NextEntry = FOContext->FilterContexts.Flink;
|
||||||
|
NextEntry != &(FOContext->FilterContexts);
|
||||||
|
NextEntry = NextEntry->Flink)
|
||||||
|
{
|
||||||
|
/* If we don't have any criteria for search, first entry will be enough */
|
||||||
|
if (!OwnerId && !InstanceId)
|
||||||
|
{
|
||||||
|
PerFOContext = (PFSRTL_PER_FILEOBJECT_CONTEXT)NextEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Else, we've to find something that matches with the parameters. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TmpPerFOContext = CONTAINING_RECORD(NextEntry, FSRTL_PER_FILEOBJECT_CONTEXT, Links);
|
||||||
|
if ((InstanceId && TmpPerFOContext->InstanceId == InstanceId && TmpPerFOContext->OwnerId == OwnerId) ||
|
||||||
|
(OwnerId && TmpPerFOContext->OwnerId == OwnerId))
|
||||||
|
{
|
||||||
|
PerFOContext = TmpPerFOContext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
||||||
|
return PerFOContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
FsRtlInsertPerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER PerStreamContext,
|
|
||||||
IN PFSRTL_PER_STREAM_CONTEXT Ptr)
|
|
||||||
{
|
|
||||||
KeBugCheck(FILE_SYSTEM);
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
*/
|
||||||
PFSRTL_PER_STREAM_CONTEXT
|
PFSRTL_PER_STREAM_CONTEXT
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlRemovePerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
|
FsRtlLookupPerStreamContextInternal(IN PFSRTL_ADVANCED_FCB_HEADER AdvFcbHeader,
|
||||||
IN PVOID OwnerId OPTIONAL,
|
IN PVOID OwnerId OPTIONAL,
|
||||||
IN PVOID InstanceId OPTIONAL)
|
IN PVOID InstanceId OPTIONAL)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
PLIST_ENTRY NextEntry;
|
||||||
return NULL;
|
PFSRTL_PER_STREAM_CONTEXT TmpPerStreamContext, PerStreamContext = NULL;
|
||||||
|
|
||||||
|
ASSERT(AdvFcbHeader);
|
||||||
|
ASSERT(FlagOn(AdvFcbHeader->Flags2, FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS));
|
||||||
|
|
||||||
|
ExAcquireFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
|
||||||
|
/* If list is empty, no need to browse it */
|
||||||
|
if (!IsListEmpty(&(AdvFcbHeader->FilterContexts)))
|
||||||
|
{
|
||||||
|
for (NextEntry = AdvFcbHeader->FilterContexts.Flink;
|
||||||
|
NextEntry != &(AdvFcbHeader->FilterContexts);
|
||||||
|
NextEntry = NextEntry->Flink)
|
||||||
|
{
|
||||||
|
/* If we don't have any criteria for search, first entry will be enough */
|
||||||
|
if (!OwnerId && !InstanceId)
|
||||||
|
{
|
||||||
|
PerStreamContext = (PFSRTL_PER_STREAM_CONTEXT)NextEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Else, we've to find something that matches with the parameters. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TmpPerStreamContext = CONTAINING_RECORD(NextEntry, FSRTL_PER_STREAM_CONTEXT, Links);
|
||||||
|
if ((InstanceId && TmpPerStreamContext->InstanceId == InstanceId && TmpPerStreamContext->OwnerId == OwnerId) ||
|
||||||
|
(OwnerId && TmpPerStreamContext->OwnerId == OwnerId))
|
||||||
|
{
|
||||||
|
PerStreamContext = TmpPerStreamContext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ExReleaseFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
|
||||||
|
return PerStreamContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||||
IN PFSRTL_PER_FILEOBJECT_CONTEXT Ptr)
|
IN PFSRTL_PER_FILEOBJECT_CONTEXT Ptr)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
PFILE_OBJECT_FILTER_CONTEXTS FOContext = NULL;
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
|
||||||
|
if (!FileObject)
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(FileObject->Flags & FO_FILE_OBJECT_HAS_EXTENSION))
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get filter contexts */
|
||||||
|
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||||
|
if (!FOContext)
|
||||||
|
{
|
||||||
|
/* If there's none, allocate new structure */
|
||||||
|
FOContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(FILE_OBJECT_FILTER_CONTEXTS), 'FOCX');
|
||||||
|
if (!FOContext)
|
||||||
|
{
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize it */
|
||||||
|
ExInitializeFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
InitializeListHead(&(FOContext->FilterContexts));
|
||||||
|
|
||||||
|
/* Set it */
|
||||||
|
if (!IoChangeFileObjectFilterContext(FileObject, FOContext, TRUE))
|
||||||
|
{
|
||||||
|
/* If it fails, it means that someone else has set it in the meanwhile */
|
||||||
|
ExFreePoolWithTag(FOContext, 'FOCX');
|
||||||
|
|
||||||
|
/* So, we can get it */
|
||||||
|
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||||
|
if (!FOContext)
|
||||||
|
{
|
||||||
|
/* If we fall down here, something went very bad. This shouldn't happen */
|
||||||
|
ASSERT(FALSE);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finally, insert */
|
||||||
|
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
InsertHeadList(&(FOContext->FilterContexts), &(Ptr->Links));
|
||||||
|
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
|
*/
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
FsRtlInsertPerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER AdvFcbHeader,
|
||||||
|
IN PFSRTL_PER_STREAM_CONTEXT PerStreamContext)
|
||||||
|
{
|
||||||
|
if (!(AdvFcbHeader) || !(AdvFcbHeader->Flags2 & FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS))
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExAcquireFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
InsertHeadList(&(AdvFcbHeader->FilterContexts), &(PerStreamContext->Links));
|
||||||
|
ExReleaseFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
*/
|
*/
|
||||||
PFSRTL_PER_FILEOBJECT_CONTEXT
|
PFSRTL_PER_FILEOBJECT_CONTEXT
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlRemovePerFileObjectContext(IN PFILE_OBJECT PerFileObjectContext,
|
FsRtlRemovePerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||||
IN PVOID OwnerId OPTIONAL,
|
IN PVOID OwnerId OPTIONAL,
|
||||||
IN PVOID InstanceId OPTIONAL)
|
IN PVOID InstanceId OPTIONAL)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
PLIST_ENTRY NextEntry;
|
||||||
return NULL;
|
PFILE_OBJECT_FILTER_CONTEXTS FOContext = NULL;
|
||||||
|
PFSRTL_PER_FILEOBJECT_CONTEXT TmpPerFOContext, PerFOContext = NULL;
|
||||||
|
|
||||||
|
if (!FileObject || !(FOContext = IoGetFileObjectFilterContext(FileObject)))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
||||||
|
/* If list is empty, no need to browse it */
|
||||||
|
if (!IsListEmpty(&(FOContext->FilterContexts)))
|
||||||
|
{
|
||||||
|
for (NextEntry = FOContext->FilterContexts.Flink;
|
||||||
|
NextEntry != &(FOContext->FilterContexts);
|
||||||
|
NextEntry = NextEntry->Flink)
|
||||||
|
{
|
||||||
|
/* If we don't have any criteria for search, first entry will be enough */
|
||||||
|
if (!OwnerId && !InstanceId)
|
||||||
|
{
|
||||||
|
PerFOContext = (PFSRTL_PER_FILEOBJECT_CONTEXT)NextEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Else, we've to find something that matches with the parameters. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TmpPerFOContext = CONTAINING_RECORD(NextEntry, FSRTL_PER_FILEOBJECT_CONTEXT, Links);
|
||||||
|
if ((InstanceId && TmpPerFOContext->InstanceId == InstanceId && TmpPerFOContext->OwnerId == OwnerId) ||
|
||||||
|
(OwnerId && TmpPerFOContext->OwnerId == OwnerId))
|
||||||
|
{
|
||||||
|
PerFOContext = TmpPerFOContext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finally remove entry from list */
|
||||||
|
if (PerFOContext)
|
||||||
|
{
|
||||||
|
RemoveEntryList(&(PerFOContext->Links));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
||||||
|
return PerFOContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @implemented
|
||||||
|
*/
|
||||||
|
PFSRTL_PER_STREAM_CONTEXT
|
||||||
|
NTAPI
|
||||||
|
FsRtlRemovePerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER AdvFcbHeader,
|
||||||
|
IN PVOID OwnerId OPTIONAL,
|
||||||
|
IN PVOID InstanceId OPTIONAL)
|
||||||
|
{
|
||||||
|
PLIST_ENTRY NextEntry;
|
||||||
|
PFSRTL_PER_STREAM_CONTEXT TmpPerStreamContext, PerStreamContext = NULL;
|
||||||
|
|
||||||
|
if (!(AdvFcbHeader) || !(AdvFcbHeader->Flags2 & FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS))
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExAcquireFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
/* If list is empty, no need to browse it */
|
||||||
|
if (!IsListEmpty(&(AdvFcbHeader->FilterContexts)))
|
||||||
|
{
|
||||||
|
for (NextEntry = AdvFcbHeader->FilterContexts.Flink;
|
||||||
|
NextEntry != &(AdvFcbHeader->FilterContexts);
|
||||||
|
NextEntry = NextEntry->Flink)
|
||||||
|
{
|
||||||
|
/* If we don't have any criteria for search, first entry will be enough */
|
||||||
|
if (!OwnerId && !InstanceId)
|
||||||
|
{
|
||||||
|
PerStreamContext = (PFSRTL_PER_STREAM_CONTEXT)NextEntry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Else, we've to find something that matches with the parameters. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TmpPerStreamContext = CONTAINING_RECORD(NextEntry, FSRTL_PER_STREAM_CONTEXT, Links);
|
||||||
|
if ((InstanceId && TmpPerStreamContext->InstanceId == InstanceId && TmpPerStreamContext->OwnerId == OwnerId) ||
|
||||||
|
(OwnerId && TmpPerStreamContext->OwnerId == OwnerId))
|
||||||
|
{
|
||||||
|
PerStreamContext = TmpPerStreamContext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Finally remove entry from list */
|
||||||
|
if (PerStreamContext)
|
||||||
|
{
|
||||||
|
RemoveEntryList(&(PerStreamContext->Links));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExReleaseFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
|
||||||
|
return PerStreamContext;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
FsRtlTeardownPerStreamContexts(IN PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader)
|
FsRtlTeardownPerStreamContexts(IN PFSRTL_ADVANCED_FCB_HEADER AdvFcbHeader)
|
||||||
{
|
{
|
||||||
KeBugCheck(FILE_SYSTEM);
|
PLIST_ENTRY NextEntry;
|
||||||
}
|
BOOLEAN IsMutexLocked = FALSE;
|
||||||
|
PFSRTL_PER_STREAM_CONTEXT PerStreamContext;
|
||||||
|
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
/* Acquire mutex to deal with the list */
|
||||||
|
ExAcquireFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
IsMutexLocked = TRUE;
|
||||||
|
|
||||||
|
/* While there are items... */
|
||||||
|
while (!IsListEmpty(&(AdvFcbHeader->FilterContexts)))
|
||||||
|
{
|
||||||
|
/* ...remove one */
|
||||||
|
NextEntry = RemoveHeadList(&(AdvFcbHeader->FilterContexts));
|
||||||
|
PerStreamContext = CONTAINING_RECORD(NextEntry, FSRTL_PER_STREAM_CONTEXT, Links);
|
||||||
|
|
||||||
|
/* Release mutex before calling callback */
|
||||||
|
ExReleaseFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
IsMutexLocked = FALSE;
|
||||||
|
|
||||||
|
/* Call the callback */
|
||||||
|
ASSERT(PerStreamContext->FreeCallback);
|
||||||
|
(*PerStreamContext->FreeCallback)(PerStreamContext);
|
||||||
|
|
||||||
|
/* Relock the list to continue */
|
||||||
|
ExAcquireFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
IsMutexLocked = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH2_FINALLY
|
||||||
|
{
|
||||||
|
/* If mutex was locked, release */
|
||||||
|
if (IsMutexLocked)
|
||||||
|
{
|
||||||
|
ExReleaseFastMutex(AdvFcbHeader->FastMutex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
}
|
||||||
|
|
|
@ -23,8 +23,9 @@ FsRtlIsNameInExpressionPrivate(IN PUNICODE_STRING Expression,
|
||||||
IN PWCHAR UpcaseTable OPTIONAL)
|
IN PWCHAR UpcaseTable OPTIONAL)
|
||||||
{
|
{
|
||||||
ULONG i = 0, j, k = 0;
|
ULONG i = 0, j, k = 0;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
ASSERT(!FsRtlDoesNameContainWildCards(Name));
|
ASSERT(!IgnoreCase || UpcaseTable);
|
||||||
|
|
||||||
while (i < Name->Length / sizeof(WCHAR) && k < Expression->Length / sizeof(WCHAR))
|
while (i < Name->Length / sizeof(WCHAR) && k < Expression->Length / sizeof(WCHAR))
|
||||||
{
|
{
|
||||||
|
@ -119,6 +120,7 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1,
|
||||||
BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
|
BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Well, first check their size */
|
/* Well, first check their size */
|
||||||
if (Name1->Length != Name2->Length) return FALSE;
|
if (Name1->Length != Name2->Length) return FALSE;
|
||||||
|
@ -210,6 +212,7 @@ FsRtlDissectName(IN UNICODE_STRING Name,
|
||||||
{
|
{
|
||||||
ULONG FirstPosition, i;
|
ULONG FirstPosition, i;
|
||||||
ULONG SkipFirstSlash = 0;
|
ULONG SkipFirstSlash = 0;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Zero the strings before continuing */
|
/* Zero the strings before continuing */
|
||||||
RtlZeroMemory(FirstPart, sizeof(UNICODE_STRING));
|
RtlZeroMemory(FirstPart, sizeof(UNICODE_STRING));
|
||||||
|
@ -272,6 +275,7 @@ NTAPI
|
||||||
FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
|
FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
|
||||||
{
|
{
|
||||||
PWCHAR Ptr;
|
PWCHAR Ptr;
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Loop through every character */
|
/* Loop through every character */
|
||||||
if (Name->Length)
|
if (Name->Length)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
.macro TEXTAREA
|
.macro TEXTAREA
|
||||||
.section text, "rx"
|
.section .text, "rx"
|
||||||
.align 2
|
.align 2
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define _MI_PAGING_LEVELS 2
|
||||||
|
|
||||||
#define PDE_SHIFT 20
|
#define PDE_SHIFT 20
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -20,6 +22,7 @@
|
||||||
#define PTE_BASE 0xC0000000
|
#define PTE_BASE 0xC0000000
|
||||||
#define PTE_TOP 0xC03FFFFF
|
#define PTE_TOP 0xC03FFFFF
|
||||||
#define PDE_BASE 0xC0400000
|
#define PDE_BASE 0xC0400000
|
||||||
|
#define PDE_TOP 0xC04FFFFF
|
||||||
#define HYPER_SPACE 0xC0500000
|
#define HYPER_SPACE 0xC0500000
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -106,6 +109,7 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
|
|
||||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.NonGlobal = 1)
|
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.NonGlobal = 1)
|
||||||
#define MI_MAKE_DIRTY_PAGE(x)
|
#define MI_MAKE_DIRTY_PAGE(x)
|
||||||
|
#define MI_MAKE_ACCESSED_PAGE(x)
|
||||||
#define MI_MAKE_OWNER_PAGE(x) ((x)->u.Hard.Owner = 1)
|
#define MI_MAKE_OWNER_PAGE(x) ((x)->u.Hard.Owner = 1)
|
||||||
#define MI_MAKE_WRITE_PAGE(x) ((x)->u.Hard.ReadOnly = 0)
|
#define MI_MAKE_WRITE_PAGE(x) ((x)->u.Hard.ReadOnly = 0)
|
||||||
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.Cached = 0)
|
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.Cached = 0)
|
||||||
|
@ -114,6 +118,7 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.ReadOnly == 0)
|
#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.ReadOnly == 0)
|
||||||
#define MI_IS_PAGE_COPY_ON_WRITE(x)FALSE
|
#define MI_IS_PAGE_COPY_ON_WRITE(x)FALSE
|
||||||
#define MI_IS_PAGE_DIRTY(x) TRUE
|
#define MI_IS_PAGE_DIRTY(x) TRUE
|
||||||
|
#define MI_IS_PAGE_LARGE(x) FALSE
|
||||||
|
|
||||||
/* Easy accessing PFN in PTE */
|
/* Easy accessing PFN in PTE */
|
||||||
#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
|
#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
|
||||||
|
@ -129,6 +134,12 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
MI_HYPERSPACE_PTES * PAGE_SIZE)
|
MI_HYPERSPACE_PTES * PAGE_SIZE)
|
||||||
#define MI_ZERO_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
#define MI_ZERO_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
||||||
PAGE_SIZE)
|
PAGE_SIZE)
|
||||||
|
#define MI_DUMMY_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
||||||
|
PAGE_SIZE)
|
||||||
|
#define MI_VAD_BITMAP (PMMPTE)(MI_DUMMY_PTE + \
|
||||||
|
PAGE_SIZE)
|
||||||
|
#define MI_WORKING_SET_LIST (PMMPTE)(MI_VAD_BITMAP + \
|
||||||
|
PAGE_SIZE)
|
||||||
|
|
||||||
/* Retrives the PDE entry for the given VA */
|
/* Retrives the PDE entry for the given VA */
|
||||||
#define MiGetPdeAddress(x) ((PMMPDE)(PDE_BASE + (((ULONG)(x) >> 20) << 2)))
|
#define MiGetPdeAddress(x) ((PMMPDE)(PDE_BASE + (((ULONG)(x) >> 20) << 2)))
|
||||||
|
@ -139,8 +150,10 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
#define MiAddressToPte(x) MiGetPteAddress(x)
|
#define MiAddressToPte(x) MiGetPteAddress(x)
|
||||||
|
|
||||||
/* Retrives the PDE offset for the given VA */
|
/* Retrives the PDE offset for the given VA */
|
||||||
#define MiGetPdeOffset(x) (((ULONG)(x)) >> 20)
|
#define MiGetPdeOffset(x) (((ULONG)(x)) >> 20)
|
||||||
|
#define MiGetPteOffset(x) ((((ULONG)(x)) << 12) >> 24)
|
||||||
|
#define MiAddressToPteOffset(x) MiGetPteOffset(x)
|
||||||
|
|
||||||
/* Convert a PTE into a corresponding address */
|
/* Convert a PTE into a corresponding address */
|
||||||
#define MiPteToAddress(x) ((PVOID)((ULONG)(x) << 10))
|
#define MiPteToAddress(x) ((PVOID)((ULONG)(x) << 10))
|
||||||
#define MiPdeToAddress(x) ((PVOID)((ULONG)(x) << 18))
|
#define MiPdeToAddress(x) ((PVOID)((ULONG)(x) << 18))
|
||||||
|
|
|
@ -53,6 +53,15 @@ FsRtlInitSystem(
|
||||||
VOID
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// File contexts Routines
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
FsRtlPTeardownPerFileObjectContexts(
|
||||||
|
IN PFILE_OBJECT FileObject
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Global data inside the File System Runtime Library
|
// Global data inside the File System Runtime Library
|
||||||
//
|
//
|
||||||
|
|
|
@ -39,6 +39,7 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
// Convert a PTE into a corresponding address
|
// Convert a PTE into a corresponding address
|
||||||
//
|
//
|
||||||
#define MiPteToAddress(PTE) ((PVOID)((ULONG)(PTE) << 10))
|
#define MiPteToAddress(PTE) ((PVOID)((ULONG)(PTE) << 10))
|
||||||
|
#define MiPdeToAddress(PDE) ((PVOID)((ULONG)(PDE) << 10))
|
||||||
|
|
||||||
#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE))
|
#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE))
|
||||||
#define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE)))
|
#define ADDR_TO_PDE_OFFSET(v) ((((ULONG)(v)) / (1024 * PAGE_SIZE)))
|
||||||
|
@ -51,9 +52,11 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
|
|
||||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.Global = 0)
|
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.Global = 0)
|
||||||
#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
|
#define MI_MAKE_DIRTY_PAGE(x) ((x)->u.Hard.Dirty = 1)
|
||||||
|
#define MI_MAKE_ACCESSED_PAGE(x) ((x)->u.Hard.Accessed = 1)
|
||||||
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.CacheDisable = 1)
|
#define MI_PAGE_DISABLE_CACHE(x) ((x)->u.Hard.CacheDisable = 1)
|
||||||
#define MI_PAGE_WRITE_THROUGH(x) ((x)->u.Hard.WriteThrough = 1)
|
#define MI_PAGE_WRITE_THROUGH(x) ((x)->u.Hard.WriteThrough = 1)
|
||||||
#define MI_PAGE_WRITE_COMBINED(x) ((x)->u.Hard.WriteThrough = 0)
|
#define MI_PAGE_WRITE_COMBINED(x) ((x)->u.Hard.WriteThrough = 0)
|
||||||
|
#define MI_IS_PAGE_LARGE(x) ((x)->u.Hard.LargePage == 1)
|
||||||
#if !defined(CONFIG_SMP)
|
#if !defined(CONFIG_SMP)
|
||||||
#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.Write == 1)
|
#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.Write == 1)
|
||||||
#else
|
#else
|
||||||
|
@ -83,13 +86,13 @@ PULONG MmGetPageDirectory(VOID);
|
||||||
#define MI_ZERO_PTES (32)
|
#define MI_ZERO_PTES (32)
|
||||||
#define MI_MAPPING_RANGE_START (ULONG)HYPER_SPACE
|
#define MI_MAPPING_RANGE_START (ULONG)HYPER_SPACE
|
||||||
#define MI_MAPPING_RANGE_END (MI_MAPPING_RANGE_START + \
|
#define MI_MAPPING_RANGE_END (MI_MAPPING_RANGE_START + \
|
||||||
MI_HYPERSPACE_PTES * PAGE_SIZE)
|
MI_HYPERSPACE_PTES * PAGE_SIZE)
|
||||||
#define MI_DUMMY_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
#define MI_DUMMY_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
||||||
PAGE_SIZE)
|
PAGE_SIZE)
|
||||||
#define MI_VAD_BITMAP (PMMPTE)(MI_DUMMY_PTE + \
|
#define MI_VAD_BITMAP (PMMPTE)(MI_DUMMY_PTE + \
|
||||||
PAGE_SIZE)
|
PAGE_SIZE)
|
||||||
#define MI_WORKING_SET_LIST (PMMPTE)(MI_VAD_BITMAP + \
|
#define MI_WORKING_SET_LIST (PMMPTE)(MI_VAD_BITMAP + \
|
||||||
PAGE_SIZE)
|
PAGE_SIZE)
|
||||||
|
|
||||||
/* On x86, these two are the same */
|
/* On x86, these two are the same */
|
||||||
#define MMPDE MMPTE
|
#define MMPDE MMPTE
|
||||||
|
|
|
@ -1155,6 +1155,20 @@ IopCloseFile(
|
||||||
IN ULONG SystemHandleCount
|
IN ULONG SystemHandleCount
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
IoGetFileObjectFilterContext(
|
||||||
|
IN PFILE_OBJECT FileObject
|
||||||
|
);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
IoChangeFileObjectFilterContext(
|
||||||
|
IN PFILE_OBJECT FileObject,
|
||||||
|
IN PVOID FilterContext,
|
||||||
|
IN BOOLEAN Define
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// I/O Timer Routines
|
// I/O Timer Routines
|
||||||
//
|
//
|
||||||
|
|
|
@ -486,7 +486,7 @@ typedef struct _MM_PAGED_POOL_INFO
|
||||||
PRTL_BITMAP EndOfPagedPoolBitmap;
|
PRTL_BITMAP EndOfPagedPoolBitmap;
|
||||||
PMMPTE FirstPteForPagedPool;
|
PMMPTE FirstPteForPagedPool;
|
||||||
PMMPTE LastPteForPagedPool;
|
PMMPTE LastPteForPagedPool;
|
||||||
PMMPTE NextPdeForPagedPoolExpansion;
|
PMMPDE NextPdeForPagedPoolExpansion;
|
||||||
ULONG PagedPoolHint;
|
ULONG PagedPoolHint;
|
||||||
SIZE_T PagedPoolCommit;
|
SIZE_T PagedPoolCommit;
|
||||||
SIZE_T AllocatedPagedPool;
|
SIZE_T AllocatedPagedPool;
|
||||||
|
@ -778,6 +778,10 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
MmInitPagingFile(VOID);
|
MmInitPagingFile(VOID);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmReadFromSwapPage(
|
MmReadFromSwapPage(
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
|
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define INIT_FUNCTION PLACE_IN_SECTION("INIT")
|
#define INIT_FUNCTION
|
||||||
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
|
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
|
||||||
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
|
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -63,7 +63,11 @@ IoCreateController(IN ULONG Size)
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Initialize an empty OBA */
|
/* Initialize an empty OBA */
|
||||||
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
NULL,
|
||||||
|
OBJ_KERNEL_HANDLE,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
/* Create the Object */
|
/* Create the Object */
|
||||||
Status = ObCreateObject(KernelMode,
|
Status = ObCreateObject(KernelMode,
|
||||||
|
@ -87,7 +91,7 @@ IoCreateController(IN ULONG Size)
|
||||||
if (!NT_SUCCESS(Status)) return NULL;
|
if (!NT_SUCCESS(Status)) return NULL;
|
||||||
|
|
||||||
/* Close the dummy handle */
|
/* Close the dummy handle */
|
||||||
NtClose(Handle);
|
ObCloseHandle(Handle, KernelMode);
|
||||||
|
|
||||||
/* Zero the Object and set its data */
|
/* Zero the Object and set its data */
|
||||||
RtlZeroMemory(Controller, sizeof(CONTROLLER_OBJECT) + Size);
|
RtlZeroMemory(Controller, sizeof(CONTROLLER_OBJECT) + Size);
|
||||||
|
|
|
@ -1049,6 +1049,13 @@ IopDeleteFile(IN PVOID ObjectBody)
|
||||||
ExFreePool(FileObject->CompletionContext);
|
ExFreePool(FileObject->CompletionContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if the FO had extension */
|
||||||
|
if (FileObject->Flags & FO_FILE_OBJECT_HAS_EXTENSION)
|
||||||
|
{
|
||||||
|
/* Release filter context structure if any */
|
||||||
|
FsRtlPTeardownPerFileObjectContexts(FileObject);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if dereference has been done yet */
|
/* Check if dereference has been done yet */
|
||||||
if (!DereferenceDone)
|
if (!DereferenceDone)
|
||||||
{
|
{
|
||||||
|
@ -1610,6 +1617,36 @@ IopQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
IoGetFileObjectFilterContext(IN PFILE_OBJECT FileObject)
|
||||||
|
{
|
||||||
|
if (FileObject->Flags & FO_FILE_OBJECT_HAS_EXTENSION)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
/* FIXME: return NULL for the moment ~ */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
IoChangeFileObjectFilterContext(IN PFILE_OBJECT FileObject,
|
||||||
|
IN PVOID FilterContext,
|
||||||
|
IN BOOLEAN Define)
|
||||||
|
{
|
||||||
|
if (!(FileObject->Flags & FO_FILE_OBJECT_HAS_EXTENSION))
|
||||||
|
{
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -15,7 +15,10 @@
|
||||||
PROLOG_END KiSystemStartup
|
PROLOG_END KiSystemStartup
|
||||||
|
|
||||||
/* Put us in FIQ mode, set IRQ stack */
|
/* Put us in FIQ mode, set IRQ stack */
|
||||||
msr cpsr_c, #CPSR_FIQ_MODE
|
b .
|
||||||
|
mrs r3, cpsr
|
||||||
|
orr r3, r1, #CPSR_FIQ_MODE
|
||||||
|
msr cpsr, r3
|
||||||
ldr sp, [a1, #LpbInterruptStack]
|
ldr sp, [a1, #LpbInterruptStack]
|
||||||
|
|
||||||
/* Repeat for IRQ mode */
|
/* Repeat for IRQ mode */
|
||||||
|
|
|
@ -57,6 +57,15 @@ KeFlushCurrentTb(VOID)
|
||||||
KeFlushTb();
|
KeFlushTb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KeZeroPages(IN PVOID Address,
|
||||||
|
IN ULONG Size)
|
||||||
|
{
|
||||||
|
/* Not using XMMI in this routine */
|
||||||
|
RtlZeroMemory(Address, Size);
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
TEXTAREA
|
TEXTAREA
|
||||||
NESTED_ENTRY KiSwapContext
|
NESTED_ENTRY KiSwapContext
|
||||||
PROLOG_END KiSwapContext
|
PROLOG_END KiSwapContext
|
||||||
|
|
||||||
|
// BUSTEDDDD
|
||||||
|
b .
|
||||||
|
|
||||||
//
|
//
|
||||||
// a1 = Old Thread
|
// a1 = Old Thread
|
||||||
// a2 = New Thread
|
// a2 = New Thread
|
||||||
|
@ -104,3 +108,19 @@
|
||||||
b .
|
b .
|
||||||
|
|
||||||
ENTRY_END KiThreadStartup
|
ENTRY_END KiThreadStartup
|
||||||
|
|
||||||
|
NESTED_ENTRY KiSwitchThreads
|
||||||
|
PROLOG_END KiSwitchThreads
|
||||||
|
|
||||||
|
// BUSTEDDDD
|
||||||
|
b .
|
||||||
|
|
||||||
|
ENTRY_END KiSwitchThreads
|
||||||
|
|
||||||
|
NESTED_ENTRY KiSwapContextInternal
|
||||||
|
PROLOG_END KiSwapContextInternal
|
||||||
|
|
||||||
|
// BUSTEDDDD
|
||||||
|
b .
|
||||||
|
|
||||||
|
ENTRY_END KiSwapContextInternal
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
|
|
||||||
/* GLOBALS ********************************************************************/
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
typedef struct _KSWITCHFRAME
|
||||||
|
{
|
||||||
|
PVOID ExceptionList;
|
||||||
|
BOOLEAN ApcBypassDisable;
|
||||||
|
PVOID RetAddr;
|
||||||
|
} KSWITCHFRAME, *PKSWITCHFRAME;
|
||||||
|
|
||||||
typedef struct _KUINIT_FRAME
|
typedef struct _KUINIT_FRAME
|
||||||
{
|
{
|
||||||
KEXCEPTION_FRAME CtxSwitchFrame;
|
KEXCEPTION_FRAME CtxSwitchFrame;
|
||||||
|
@ -32,6 +39,15 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiThreadStartup(VOID);
|
KiThreadStartup(VOID);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KiSwitchThreads(
|
||||||
|
IN PKTHREAD OldThread,
|
||||||
|
IN PKTHREAD NewThread
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/* FIXME: THIS IS TOTALLY BUSTED NOW */
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
KiInitializeContextThread(IN PKTHREAD Thread,
|
KiInitializeContextThread(IN PKTHREAD Thread,
|
||||||
|
@ -131,3 +147,217 @@ KiInitializeContextThread(IN PKTHREAD Thread,
|
||||||
//
|
//
|
||||||
Thread->KernelStack = (PVOID)CtxSwitchFrame;
|
Thread->KernelStack = (PVOID)CtxSwitchFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KiIdleLoop(VOID)
|
||||||
|
{
|
||||||
|
PKPRCB Prcb = KeGetCurrentPrcb();
|
||||||
|
PKTHREAD OldThread, NewThread;
|
||||||
|
|
||||||
|
/* Initialize the idle loop: disable interrupts */
|
||||||
|
_enable();
|
||||||
|
YieldProcessor();
|
||||||
|
YieldProcessor();
|
||||||
|
_disable();
|
||||||
|
|
||||||
|
/* Now loop forever */
|
||||||
|
while (TRUE)
|
||||||
|
{
|
||||||
|
/* Check for pending timers, pending DPCs, or pending ready threads */
|
||||||
|
if ((Prcb->DpcData[0].DpcQueueDepth) ||
|
||||||
|
(Prcb->TimerRequest) ||
|
||||||
|
(Prcb->DeferredReadyListHead.Next))
|
||||||
|
{
|
||||||
|
/* Quiesce the DPC software interrupt */
|
||||||
|
HalClearSoftwareInterrupt(DISPATCH_LEVEL);
|
||||||
|
|
||||||
|
/* Handle it */
|
||||||
|
KiRetireDpcList(Prcb);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if a new thread is scheduled for execution */
|
||||||
|
if (Prcb->NextThread)
|
||||||
|
{
|
||||||
|
/* Enable interupts */
|
||||||
|
_enable();
|
||||||
|
|
||||||
|
/* Capture current thread data */
|
||||||
|
OldThread = Prcb->CurrentThread;
|
||||||
|
NewThread = Prcb->NextThread;
|
||||||
|
|
||||||
|
/* Set new thread data */
|
||||||
|
Prcb->NextThread = NULL;
|
||||||
|
Prcb->CurrentThread = NewThread;
|
||||||
|
|
||||||
|
/* The thread is now running */
|
||||||
|
NewThread->State = Running;
|
||||||
|
|
||||||
|
/* Switch away from the idle thread */
|
||||||
|
KiSwapContext(APC_LEVEL, OldThread);
|
||||||
|
|
||||||
|
/* We are back in the idle thread -- disable interrupts again */
|
||||||
|
_enable();
|
||||||
|
YieldProcessor();
|
||||||
|
YieldProcessor();
|
||||||
|
_disable();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Continue staying idle. Note the HAL returns with interrupts on */
|
||||||
|
Prcb->PowerState.IdleFunction(&Prcb->PowerState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
FASTCALL
|
||||||
|
KiSwapContextExit(IN PKTHREAD OldThread,
|
||||||
|
IN PKSWITCHFRAME SwitchFrame)
|
||||||
|
{
|
||||||
|
PKIPCR Pcr = (PKIPCR)KeGetPcr();
|
||||||
|
PKPROCESS OldProcess, NewProcess;
|
||||||
|
PKTHREAD NewThread;
|
||||||
|
ARM_TTB_REGISTER TtbRegister;
|
||||||
|
|
||||||
|
/* We are on the new thread stack now */
|
||||||
|
NewThread = Pcr->PrcbData.CurrentThread;
|
||||||
|
|
||||||
|
/* Now we are the new thread. Check if it's in a new process */
|
||||||
|
OldProcess = OldThread->ApcState.Process;
|
||||||
|
NewProcess = NewThread->ApcState.Process;
|
||||||
|
if (OldProcess != NewProcess)
|
||||||
|
{
|
||||||
|
TtbRegister.AsUlong = NewProcess->DirectoryTableBase[0];
|
||||||
|
ASSERT(TtbRegister.Reserved == 0);
|
||||||
|
KeArmTranslationTableRegisterSet(TtbRegister);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Increase thread context switches */
|
||||||
|
NewThread->ContextSwitches++;
|
||||||
|
|
||||||
|
/* Load data from switch frame */
|
||||||
|
Pcr->NtTib.ExceptionList = SwitchFrame->ExceptionList;
|
||||||
|
|
||||||
|
/* DPCs shouldn't be active */
|
||||||
|
if (Pcr->PrcbData.DpcRoutineActive)
|
||||||
|
{
|
||||||
|
/* Crash the machine */
|
||||||
|
KeBugCheckEx(ATTEMPTED_SWITCH_FROM_DPC,
|
||||||
|
(ULONG_PTR)OldThread,
|
||||||
|
(ULONG_PTR)NewThread,
|
||||||
|
(ULONG_PTR)OldThread->InitialStack,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Kernel APCs may be pending */
|
||||||
|
if (NewThread->ApcState.KernelApcPending)
|
||||||
|
{
|
||||||
|
/* Are APCs enabled? */
|
||||||
|
if (!NewThread->SpecialApcDisable)
|
||||||
|
{
|
||||||
|
/* Request APC delivery */
|
||||||
|
if (SwitchFrame->ApcBypassDisable) HalRequestSoftwareInterrupt(APC_LEVEL);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
FASTCALL
|
||||||
|
KiSwapContextEntry(IN PKSWITCHFRAME SwitchFrame,
|
||||||
|
IN ULONG_PTR OldThreadAndApcFlag)
|
||||||
|
{
|
||||||
|
PKIPCR Pcr = (PKIPCR)KeGetPcr();
|
||||||
|
PKTHREAD OldThread, NewThread;
|
||||||
|
|
||||||
|
/* Save APC bypass disable */
|
||||||
|
SwitchFrame->ApcBypassDisable = OldThreadAndApcFlag & 3;
|
||||||
|
SwitchFrame->ExceptionList = Pcr->NtTib.ExceptionList;
|
||||||
|
|
||||||
|
/* Increase context switch count and check if tracing is enabled */
|
||||||
|
Pcr->ContextSwitches++;
|
||||||
|
if (Pcr->PerfGlobalGroupMask)
|
||||||
|
{
|
||||||
|
/* We don't support this yet on x86 either */
|
||||||
|
DPRINT1("WMI Tracing not supported\n");
|
||||||
|
ASSERT(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get thread pointers */
|
||||||
|
OldThread = (PKTHREAD)(OldThreadAndApcFlag & ~3);
|
||||||
|
NewThread = Pcr->PrcbData.CurrentThread;
|
||||||
|
|
||||||
|
/* Get the old thread and set its kernel stack */
|
||||||
|
OldThread->KernelStack = SwitchFrame;
|
||||||
|
|
||||||
|
/* Do the switch */
|
||||||
|
KiSwitchThreads(OldThread, NewThread->KernelStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
KiDispatchInterrupt(VOID)
|
||||||
|
{
|
||||||
|
PKIPCR Pcr = (PKIPCR)KeGetPcr();
|
||||||
|
PKPRCB Prcb = &Pcr->PrcbData;
|
||||||
|
PVOID OldHandler;
|
||||||
|
PKTHREAD NewThread, OldThread;
|
||||||
|
|
||||||
|
/* Disable interrupts */
|
||||||
|
_disable();
|
||||||
|
|
||||||
|
/* Check for pending timers, pending DPCs, or pending ready threads */
|
||||||
|
if ((Prcb->DpcData[0].DpcQueueDepth) ||
|
||||||
|
(Prcb->TimerRequest) ||
|
||||||
|
(Prcb->DeferredReadyListHead.Next))
|
||||||
|
{
|
||||||
|
/* Switch to safe execution context */
|
||||||
|
OldHandler = Pcr->NtTib.ExceptionList;
|
||||||
|
Pcr->NtTib.ExceptionList = EXCEPTION_CHAIN_END;
|
||||||
|
|
||||||
|
/* Retire DPCs while under the DPC stack */
|
||||||
|
//KiRetireDpcListInDpcStack(Prcb, Prcb->DpcStack);
|
||||||
|
// FIXME!!! //
|
||||||
|
KiRetireDpcList(Prcb);
|
||||||
|
|
||||||
|
/* Restore context */
|
||||||
|
Pcr->NtTib.ExceptionList = OldHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Re-enable interrupts */
|
||||||
|
_enable();
|
||||||
|
|
||||||
|
/* Check for quantum end */
|
||||||
|
if (Prcb->QuantumEnd)
|
||||||
|
{
|
||||||
|
/* Handle quantum end */
|
||||||
|
Prcb->QuantumEnd = FALSE;
|
||||||
|
KiQuantumEnd();
|
||||||
|
}
|
||||||
|
else if (Prcb->NextThread)
|
||||||
|
{
|
||||||
|
/* Capture current thread data */
|
||||||
|
OldThread = Prcb->CurrentThread;
|
||||||
|
NewThread = Prcb->NextThread;
|
||||||
|
|
||||||
|
/* Set new thread data */
|
||||||
|
Prcb->NextThread = NULL;
|
||||||
|
Prcb->CurrentThread = NewThread;
|
||||||
|
|
||||||
|
/* The thread is now running */
|
||||||
|
NewThread->State = Running;
|
||||||
|
OldThread->WaitReason = WrDispatchInt;
|
||||||
|
|
||||||
|
/* Make the old thread ready */
|
||||||
|
KxQueueReadyThread(OldThread, Prcb);
|
||||||
|
|
||||||
|
/* Swap to the new thread */
|
||||||
|
KiSwapContext(APC_LEVEL, OldThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
/* FUNCTIONS ******************************************************************/
|
/* FUNCTIONS ******************************************************************/
|
||||||
|
|
||||||
|
#if 0
|
||||||
VOID
|
VOID
|
||||||
KiIdleLoop(VOID)
|
KiIdleLoop(VOID)
|
||||||
{
|
{
|
||||||
|
@ -89,6 +90,7 @@ KiIdleLoop(VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -116,6 +118,7 @@ KiSwapProcess(IN PKPROCESS NewProcess,
|
||||||
while (TRUE);
|
while (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
KiSwapContextInternal(IN PKTHREAD OldThread,
|
KiSwapContextInternal(IN PKTHREAD OldThread,
|
||||||
IN PKTHREAD NewThread)
|
IN PKTHREAD NewThread)
|
||||||
|
@ -220,6 +223,7 @@ KiSwapContextInternal(IN PKTHREAD OldThread,
|
||||||
//
|
//
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
KiApcInterrupt(VOID)
|
KiApcInterrupt(VOID)
|
||||||
|
@ -262,6 +266,7 @@ KiApcInterrupt(VOID)
|
||||||
KiDeliverApc(PreviousMode, &ExceptionFrame, TrapFrame);
|
KiDeliverApc(PreviousMode, &ExceptionFrame, TrapFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
VOID
|
VOID
|
||||||
KiDispatchInterrupt(VOID)
|
KiDispatchInterrupt(VOID)
|
||||||
{
|
{
|
||||||
|
@ -343,6 +348,7 @@ KiDispatchInterrupt(VOID)
|
||||||
KiSwapContext(OldThread, NewThread);
|
KiSwapContext(OldThread, NewThread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
KiInterruptHandler(IN PKTRAP_FRAME TrapFrame,
|
KiInterruptHandler(IN PKTRAP_FRAME TrapFrame,
|
||||||
|
@ -523,7 +529,7 @@ KiDataAbortHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
Address,
|
Address,
|
||||||
KiGetPreviousMode(TrapFrame),
|
KiGetPreviousMode(TrapFrame),
|
||||||
TrapFrame);
|
TrapFrame);
|
||||||
if (Status == STATUS_SUCCESS) return Status;
|
if (NT_SUCCESS(Status)) return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -24,10 +24,7 @@ ULONG MmMaximumNonPagedPoolInBytes;
|
||||||
PVOID MmNonPagedSystemStart;
|
PVOID MmNonPagedSystemStart;
|
||||||
PVOID MmNonPagedPoolStart;
|
PVOID MmNonPagedPoolStart;
|
||||||
PVOID MmNonPagedPoolExpansionStart;
|
PVOID MmNonPagedPoolExpansionStart;
|
||||||
PVOID MmNonPagedPoolEnd = MI_NONPAGED_POOL_END;
|
|
||||||
PVOID MmPagedPoolStart = MI_PAGED_POOL_START;
|
|
||||||
PVOID MmPagedPoolEnd;
|
PVOID MmPagedPoolEnd;
|
||||||
ULONG MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE;
|
|
||||||
PVOID MiSessionSpaceEnd;
|
PVOID MiSessionSpaceEnd;
|
||||||
PVOID MiSessionImageEnd;
|
PVOID MiSessionImageEnd;
|
||||||
PVOID MiSessionImageStart;
|
PVOID MiSessionImageStart;
|
||||||
|
@ -42,14 +39,14 @@ ULONG MmSessionImageSize;
|
||||||
PVOID MiSystemViewStart;
|
PVOID MiSystemViewStart;
|
||||||
ULONG MmSystemViewSize;
|
ULONG MmSystemViewSize;
|
||||||
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
||||||
PMMPTE MmSystemPagePtes;
|
PMMPDE MmSystemPagePtes;
|
||||||
ULONG MmNumberOfSystemPtes;
|
ULONG MmNumberOfSystemPtes;
|
||||||
ULONG MxPfnAllocation;
|
ULONG MxPfnAllocation;
|
||||||
RTL_BITMAP MiPfnBitMap;
|
RTL_BITMAP MiPfnBitMap;
|
||||||
PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock;
|
PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock;
|
||||||
PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor;
|
PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor;
|
||||||
MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor;
|
MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor;
|
||||||
ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1;
|
ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage;
|
||||||
ULONG MmBootImageSize;
|
ULONG MmBootImageSize;
|
||||||
ULONG MmUserProbeAddress;
|
ULONG MmUserProbeAddress;
|
||||||
PVOID MmHighestUserAddress;
|
PVOID MmHighestUserAddress;
|
||||||
|
@ -63,8 +60,8 @@ PVOID MmHyperSpaceEnd;
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmArmInitSystem(IN ULONG Phase,
|
INIT_FUNCTION
|
||||||
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Always return success for now
|
// Always return success for now
|
||||||
|
|
|
@ -271,7 +271,7 @@ MmFreePagesFromMdl(IN PMDL Mdl)
|
||||||
//
|
//
|
||||||
Pfn1->u3.e1.StartOfAllocation = 0;
|
Pfn1->u3.e1.StartOfAllocation = 0;
|
||||||
Pfn1->u3.e1.EndOfAllocation = 0;
|
Pfn1->u3.e1.EndOfAllocation = 0;
|
||||||
Pfn1->u2.ShareCount == 0;
|
Pfn1->u2.ShareCount = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dereference it
|
// Dereference it
|
||||||
|
|
|
@ -130,12 +130,12 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE);
|
||||||
//
|
//
|
||||||
// Access Flags
|
// Access Flags
|
||||||
//
|
//
|
||||||
#define PTE_READONLY 0
|
#define PTE_READONLY 0 // Doesn't exist on x86
|
||||||
#define PTE_EXECUTE 0 // Not worrying about NX yet
|
#define PTE_EXECUTE 0 // Not worrying about NX yet
|
||||||
#define PTE_EXECUTE_READ 0 // Not worrying about NX yet
|
#define PTE_EXECUTE_READ 0 // Not worrying about NX yet
|
||||||
#define PTE_READWRITE 0x2
|
#define PTE_READWRITE 0x2
|
||||||
#define PTE_WRITECOPY 0x200
|
#define PTE_WRITECOPY 0x200
|
||||||
#define PTE_EXECUTE_READWRITE 0x0
|
#define PTE_EXECUTE_READWRITE 0x2 // Not worrying about NX yet
|
||||||
#define PTE_EXECUTE_WRITECOPY 0x200
|
#define PTE_EXECUTE_WRITECOPY 0x200
|
||||||
#define PTE_PROTOTYPE 0x400
|
#define PTE_PROTOTYPE 0x400
|
||||||
|
|
||||||
|
@ -153,6 +153,20 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE);
|
||||||
#define PTE_DISABLE_CACHE 0x10
|
#define PTE_DISABLE_CACHE 0x10
|
||||||
#define PTE_WRITECOMBINED_CACHE 0x10
|
#define PTE_WRITECOMBINED_CACHE 0x10
|
||||||
#elif defined(_M_ARM)
|
#elif defined(_M_ARM)
|
||||||
|
#define PTE_READONLY 0x200
|
||||||
|
#define PTE_EXECUTE 0 // Not worrying about NX yet
|
||||||
|
#define PTE_EXECUTE_READ 0 // Not worrying about NX yet
|
||||||
|
#define PTE_READWRITE 0 // Doesn't exist on ARM
|
||||||
|
#define PTE_WRITECOPY 0 // Doesn't exist on ARM
|
||||||
|
#define PTE_EXECUTE_READWRITE 0 // Not worrying about NX yet
|
||||||
|
#define PTE_EXECUTE_WRITECOPY 0 // Not worrying about NX yet
|
||||||
|
#define PTE_PROTOTYPE 0x400 // Using the Shared bit
|
||||||
|
//
|
||||||
|
// Cache flags
|
||||||
|
//
|
||||||
|
#define PTE_ENABLE_CACHE 0
|
||||||
|
#define PTE_DISABLE_CACHE 0x10
|
||||||
|
#define PTE_WRITECOMBINED_CACHE 0x10
|
||||||
#else
|
#else
|
||||||
#error Define these please!
|
#error Define these please!
|
||||||
#endif
|
#endif
|
||||||
|
@ -187,7 +201,7 @@ extern const ULONG MmProtectToValue[32];
|
||||||
#ifdef _M_IX86
|
#ifdef _M_IX86
|
||||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
||||||
#elif _M_ARM
|
#elif _M_ARM
|
||||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
#define MM_PTE_SOFTWARE_PROTECTION_BITS 6
|
||||||
#elif _M_AMD64
|
#elif _M_AMD64
|
||||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
||||||
#else
|
#else
|
||||||
|
@ -243,7 +257,7 @@ extern const ULONG MmProtectToValue[32];
|
||||||
#define MI_GET_NEXT_COLOR(x) (MI_GET_PAGE_COLOR(++MmSystemPageColor))
|
#define MI_GET_NEXT_COLOR(x) (MI_GET_PAGE_COLOR(++MmSystemPageColor))
|
||||||
#define MI_GET_NEXT_PROCESS_COLOR(x) (MI_GET_PAGE_COLOR(++(x)->NextPageColor))
|
#define MI_GET_NEXT_PROCESS_COLOR(x) (MI_GET_PAGE_COLOR(++(x)->NextPageColor))
|
||||||
|
|
||||||
#ifdef _M_IX86
|
#ifndef _M_AMD64
|
||||||
//
|
//
|
||||||
// Decodes a Prototype PTE into the underlying PTE
|
// Decodes a Prototype PTE into the underlying PTE
|
||||||
//
|
//
|
||||||
|
@ -470,7 +484,7 @@ extern PMMPTE MiSessionImagePteEnd;
|
||||||
extern PMMPTE MiSessionBasePte;
|
extern PMMPTE MiSessionBasePte;
|
||||||
extern PMMPTE MiSessionLastPte;
|
extern PMMPTE MiSessionLastPte;
|
||||||
extern SIZE_T MmSizeOfPagedPoolInBytes;
|
extern SIZE_T MmSizeOfPagedPoolInBytes;
|
||||||
extern PMMPTE MmSystemPagePtes;
|
extern PMMPDE MmSystemPagePtes;
|
||||||
extern PVOID MmSystemCacheStart;
|
extern PVOID MmSystemCacheStart;
|
||||||
extern PVOID MmSystemCacheEnd;
|
extern PVOID MmSystemCacheEnd;
|
||||||
extern MMSUPPORT MmSystemCacheWs;
|
extern MMSUPPORT MmSystemCacheWs;
|
||||||
|
@ -528,7 +542,7 @@ extern PMMWSL MmWorkingSetList;
|
||||||
//
|
//
|
||||||
ULONG
|
ULONG
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
|
MiDetermineUserGlobalPteMask(IN PVOID PointerPte)
|
||||||
{
|
{
|
||||||
MMPTE TempPte;
|
MMPTE TempPte;
|
||||||
|
|
||||||
|
@ -537,14 +551,15 @@ MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
|
||||||
|
|
||||||
/* Make it valid and accessed */
|
/* Make it valid and accessed */
|
||||||
TempPte.u.Hard.Valid = TRUE;
|
TempPte.u.Hard.Valid = TRUE;
|
||||||
TempPte.u.Hard.Accessed = TRUE;
|
MI_MAKE_ACCESSED_PAGE(&TempPte);
|
||||||
|
|
||||||
/* Is this for user-mode? */
|
/* Is this for user-mode? */
|
||||||
if ((PointerPte <= MiHighestUserPte) ||
|
if ((PointerPte <= (PVOID)MiHighestUserPte) ||
|
||||||
((PointerPte >= MiAddressToPde(NULL)) && (PointerPte <= MiHighestUserPde)))
|
((PointerPte >= (PVOID)MiAddressToPde(NULL)) &&
|
||||||
|
(PointerPte <= (PVOID)MiHighestUserPde)))
|
||||||
{
|
{
|
||||||
/* Set the owner bit */
|
/* Set the owner bit */
|
||||||
TempPte.u.Hard.Owner = TRUE;
|
MI_MAKE_OWNER_PAGE(&TempPte);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: We should also set the global bit */
|
/* FIXME: We should also set the global bit */
|
||||||
|
@ -614,7 +629,7 @@ MI_MAKE_HARDWARE_PTE_USER(IN PMMPTE NewPte,
|
||||||
NewPte->u.Long |= MmProtectToPteMask[ProtectionMask];
|
NewPte->u.Long |= MmProtectToPteMask[ProtectionMask];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _M_IX86
|
#ifndef _M_AMD64
|
||||||
//
|
//
|
||||||
// Builds a Prototype PTE for the address of the PTE
|
// Builds a Prototype PTE for the address of the PTE
|
||||||
//
|
//
|
||||||
|
@ -684,6 +699,33 @@ MI_WRITE_INVALID_PTE(IN PMMPTE PointerPte,
|
||||||
*PointerPte = InvalidPte;
|
*PointerPte = InvalidPte;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Writes a valid PDE
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
FORCEINLINE
|
||||||
|
MI_WRITE_VALID_PDE(IN PMMPDE PointerPde,
|
||||||
|
IN MMPDE TempPde)
|
||||||
|
{
|
||||||
|
/* Write the valid PDE */
|
||||||
|
ASSERT(PointerPde->u.Hard.Valid == 0);
|
||||||
|
ASSERT(TempPde.u.Hard.Valid == 1);
|
||||||
|
*PointerPde = TempPde;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Writes an invalid PDE
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
FORCEINLINE
|
||||||
|
MI_WRITE_INVALID_PDE(IN PMMPDE PointerPde,
|
||||||
|
IN MMPDE InvalidPde)
|
||||||
|
{
|
||||||
|
/* Write the invalid PDE */
|
||||||
|
ASSERT(InvalidPde.u.Hard.Valid == 0);
|
||||||
|
*PointerPde = InvalidPde;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checks if the thread already owns a working set
|
// Checks if the thread already owns a working set
|
||||||
//
|
//
|
||||||
|
|
|
@ -161,7 +161,7 @@ SIZE_T MmSystemViewSize;
|
||||||
// address.
|
// address.
|
||||||
//
|
//
|
||||||
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
||||||
PMMPTE MmSystemPagePtes;
|
PMMPDE MmSystemPagePtes;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -679,7 +679,7 @@ MiBuildPfnDatabaseFromPages(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||||
/* Yes we do, set it up */
|
/* Yes we do, set it up */
|
||||||
Pfn1 = MiGetPfnEntry(PageFrameIndex);
|
Pfn1 = MiGetPfnEntry(PageFrameIndex);
|
||||||
Pfn1->u4.PteFrame = StartupPdIndex;
|
Pfn1->u4.PteFrame = StartupPdIndex;
|
||||||
Pfn1->PteAddress = PointerPde;
|
Pfn1->PteAddress = (PMMPTE)PointerPde;
|
||||||
Pfn1->u2.ShareCount++;
|
Pfn1->u2.ShareCount++;
|
||||||
Pfn1->u3.e2.ReferenceCount = 1;
|
Pfn1->u3.e2.ReferenceCount = 1;
|
||||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||||
|
@ -771,7 +771,7 @@ MiBuildPfnDatabaseZeroPage(VOID)
|
||||||
/* Make it a bogus page to catch errors */
|
/* Make it a bogus page to catch errors */
|
||||||
PointerPde = MiAddressToPde(0xFFFFFFFF);
|
PointerPde = MiAddressToPde(0xFFFFFFFF);
|
||||||
Pfn1->u4.PteFrame = PFN_FROM_PTE(PointerPde);
|
Pfn1->u4.PteFrame = PFN_FROM_PTE(PointerPde);
|
||||||
Pfn1->PteAddress = PointerPde;
|
Pfn1->PteAddress = (PMMPTE)PointerPde;
|
||||||
Pfn1->u2.ShareCount++;
|
Pfn1->u2.ShareCount++;
|
||||||
Pfn1->u3.e2.ReferenceCount = 0xFFF0;
|
Pfn1->u3.e2.ReferenceCount = 0xFFF0;
|
||||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||||
|
@ -1192,7 +1192,7 @@ INIT_FUNCTION
|
||||||
MiAddHalIoMappings(VOID)
|
MiAddHalIoMappings(VOID)
|
||||||
{
|
{
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
PMMPTE PointerPde;
|
PMMPDE PointerPde;
|
||||||
PMMPTE PointerPte;
|
PMMPTE PointerPte;
|
||||||
ULONG i, j, PdeCount;
|
ULONG i, j, PdeCount;
|
||||||
PFN_NUMBER PageFrameIndex;
|
PFN_NUMBER PageFrameIndex;
|
||||||
|
@ -1203,12 +1203,12 @@ MiAddHalIoMappings(VOID)
|
||||||
|
|
||||||
/* Check how many PDEs the heap has */
|
/* Check how many PDEs the heap has */
|
||||||
PointerPde = MiAddressToPde(BaseAddress);
|
PointerPde = MiAddressToPde(BaseAddress);
|
||||||
PdeCount = PDE_COUNT - ADDR_TO_PDE_OFFSET(BaseAddress);
|
PdeCount = PDE_COUNT - MiGetPdeOffset(BaseAddress);
|
||||||
for (i = 0; i < PdeCount; i++)
|
for (i = 0; i < PdeCount; i++)
|
||||||
{
|
{
|
||||||
/* Does the HAL own this mapping? */
|
/* Does the HAL own this mapping? */
|
||||||
if ((PointerPde->u.Hard.Valid == 1) &&
|
if ((PointerPde->u.Hard.Valid == 1) &&
|
||||||
(PointerPde->u.Hard.LargePage == 0))
|
(MI_IS_PAGE_LARGE(PointerPde) == FALSE))
|
||||||
{
|
{
|
||||||
/* Get the PTE for it and scan each page */
|
/* Get the PTE for it and scan each page */
|
||||||
PointerPte = MiAddressToPte(BaseAddress);
|
PointerPte = MiAddressToPte(BaseAddress);
|
||||||
|
@ -1556,8 +1556,10 @@ NTAPI
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
MiBuildPagedPool(VOID)
|
MiBuildPagedPool(VOID)
|
||||||
{
|
{
|
||||||
PMMPTE PointerPte, PointerPde;
|
PMMPTE PointerPte;
|
||||||
|
PMMPDE PointerPde;
|
||||||
MMPTE TempPte = ValidKernelPte;
|
MMPTE TempPte = ValidKernelPte;
|
||||||
|
MMPDE TempPde = ValidKernelPde;
|
||||||
PFN_NUMBER PageFrameIndex;
|
PFN_NUMBER PageFrameIndex;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
ULONG Size, BitMapSize;
|
ULONG Size, BitMapSize;
|
||||||
|
@ -1648,7 +1650,7 @@ MiBuildPagedPool(VOID)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RtlZeroMemory(PointerPde,
|
RtlZeroMemory(PointerPde,
|
||||||
(1 + MiAddressToPde(MmPagedPoolEnd) - PointerPde) * sizeof(MMPTE));
|
(1 + MiAddressToPde(MmPagedPoolEnd) - PointerPde) * sizeof(MMPDE));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Next, get the first and last PTE
|
// Next, get the first and last PTE
|
||||||
|
@ -1666,8 +1668,8 @@ MiBuildPagedPool(VOID)
|
||||||
MI_SET_USAGE(MI_USAGE_PAGED_POOL);
|
MI_SET_USAGE(MI_USAGE_PAGED_POOL);
|
||||||
MI_SET_PROCESS2("Kernel");
|
MI_SET_PROCESS2("Kernel");
|
||||||
PageFrameIndex = MiRemoveZeroPage(0);
|
PageFrameIndex = MiRemoveZeroPage(0);
|
||||||
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
|
TempPde.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||||
MI_WRITE_VALID_PTE(PointerPde, TempPte);
|
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||||
#if (_MI_PAGING_LEVELS >= 3)
|
#if (_MI_PAGING_LEVELS >= 3)
|
||||||
/* Use the PPE of MmPagedPoolStart that was setup above */
|
/* Use the PPE of MmPagedPoolStart that was setup above */
|
||||||
// Bla = PFN_FROM_PTE(PpeAddress(MmPagedPool...));
|
// Bla = PFN_FROM_PTE(PpeAddress(MmPagedPool...));
|
||||||
|
@ -1678,8 +1680,8 @@ MiBuildPagedPool(VOID)
|
||||||
|
|
||||||
/* Initialize the PFN entry for it */
|
/* Initialize the PFN entry for it */
|
||||||
MiInitializePfnForOtherProcess(PageFrameIndex,
|
MiInitializePfnForOtherProcess(PageFrameIndex,
|
||||||
PointerPde,
|
(PMMPTE)PointerPde,
|
||||||
MmSystemPageDirectory[(PointerPde - (PMMPTE)PDE_BASE) / PDE_COUNT]);
|
MmSystemPageDirectory[(PointerPde - (PMMPDE)PDE_BASE) / PDE_COUNT]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -325,7 +325,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set it dirty if it's a writable page */
|
/* Set it dirty if it's a writable page */
|
||||||
if (TempPte.u.Hard.Write) TempPte.u.Hard.Dirty = TRUE;
|
if (MI_IS_PAGE_WRITEABLE(&TempPte)) MI_MAKE_DIRTY_PAGE(&TempPte);
|
||||||
|
|
||||||
/* Write it */
|
/* Write it */
|
||||||
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
||||||
|
@ -899,7 +899,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
ASSERT(ProtectionCode != MM_NOACCESS);
|
ASSERT(ProtectionCode != MM_NOACCESS);
|
||||||
|
|
||||||
/* Make the PDE demand-zero */
|
/* Make the PDE demand-zero */
|
||||||
MI_WRITE_INVALID_PTE(PointerPde, DemandZeroPde);
|
MI_WRITE_INVALID_PDE(PointerPde, DemandZeroPde);
|
||||||
|
|
||||||
/* And go dispatch the fault on the PDE. This should handle the demand-zero */
|
/* And go dispatch the fault on the PDE. This should handle the demand-zero */
|
||||||
#if MI_TRACE_PFNS
|
#if MI_TRACE_PFNS
|
||||||
|
@ -907,7 +907,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
#endif
|
#endif
|
||||||
Status = MiDispatchFault(TRUE,
|
Status = MiDispatchFault(TRUE,
|
||||||
PointerPte,
|
PointerPte,
|
||||||
PointerPde,
|
(PMMPTE)PointerPde,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
PsGetCurrentProcess(),
|
PsGetCurrentProcess(),
|
||||||
|
@ -1058,7 +1058,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the dirty bit for writeable pages */
|
/* Write the dirty bit for writeable pages */
|
||||||
if (TempPte.u.Hard.Write) TempPte.u.Hard.Dirty = TRUE;
|
if (MI_IS_PAGE_WRITEABLE(&TempPte)) MI_MAKE_DIRTY_PAGE(&TempPte);
|
||||||
|
|
||||||
/* And now write down the PTE, making the address valid */
|
/* And now write down the PTE, making the address valid */
|
||||||
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
||||||
|
|
|
@ -375,7 +375,7 @@ NTAPI
|
||||||
MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
IN SIZE_T SizeInBytes)
|
IN SIZE_T SizeInBytes)
|
||||||
{
|
{
|
||||||
PFN_NUMBER SizeInPages, PageFrameNumber;
|
PFN_NUMBER SizeInPages, PageFrameNumber, PageTableCount;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
PLIST_ENTRY NextEntry, NextHead, LastHead;
|
PLIST_ENTRY NextEntry, NextHead, LastHead;
|
||||||
|
@ -422,7 +422,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
// Check if there is enougn paged pool expansion space left
|
// Check if there is enougn paged pool expansion space left
|
||||||
//
|
//
|
||||||
if (MmPagedPoolInfo.NextPdeForPagedPoolExpansion >
|
if (MmPagedPoolInfo.NextPdeForPagedPoolExpansion >
|
||||||
MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Out of memory!
|
// Out of memory!
|
||||||
|
@ -436,23 +436,23 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
// Check if we'll have to expand past the last PTE we have available
|
// Check if we'll have to expand past the last PTE we have available
|
||||||
//
|
//
|
||||||
if (((i - 1) + MmPagedPoolInfo.NextPdeForPagedPoolExpansion) >
|
if (((i - 1) + MmPagedPoolInfo.NextPdeForPagedPoolExpansion) >
|
||||||
MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// We can only support this much then
|
// We can only support this much then
|
||||||
//
|
//
|
||||||
SizeInPages = MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool) -
|
PageTableCount = (PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool) -
|
||||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion +
|
MmPagedPoolInfo.NextPdeForPagedPoolExpansion +
|
||||||
1;
|
1;
|
||||||
ASSERT(SizeInPages < i);
|
ASSERT(PageTableCount < i);
|
||||||
i = SizeInPages;
|
i = PageTableCount;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Otherwise, there is plenty of space left for this expansion
|
// Otherwise, there is plenty of space left for this expansion
|
||||||
//
|
//
|
||||||
SizeInPages = i;
|
PageTableCount = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -464,7 +464,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
// Get the first PTE in expansion space
|
// Get the first PTE in expansion space
|
||||||
//
|
//
|
||||||
PointerPde = MmPagedPoolInfo.NextPdeForPagedPoolExpansion;
|
PointerPde = MmPagedPoolInfo.NextPdeForPagedPoolExpansion;
|
||||||
BaseVa = MiPteToAddress(PointerPde);
|
BaseVa = MiPdeToAddress(PointerPde);
|
||||||
BaseVaStart = BaseVa;
|
BaseVaStart = BaseVa;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -494,11 +494,11 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
|
|
||||||
/* Initialize the PFN */
|
/* Initialize the PFN */
|
||||||
MiInitializePfnForOtherProcess(PageFrameNumber,
|
MiInitializePfnForOtherProcess(PageFrameNumber,
|
||||||
PointerPde,
|
(PMMPTE)PointerPde,
|
||||||
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
||||||
|
|
||||||
/* Write the actual PDE now */
|
/* Write the actual PDE now */
|
||||||
MI_WRITE_VALID_PTE(PointerPde, TempPde);
|
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||||
#endif
|
#endif
|
||||||
//
|
//
|
||||||
// Move on to the next expansion address
|
// Move on to the next expansion address
|
||||||
|
@ -517,26 +517,25 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||||
// These pages are now available, clear their availablity bits
|
// These pages are now available, clear their availablity bits
|
||||||
//
|
//
|
||||||
EndAllocation = (MmPagedPoolInfo.NextPdeForPagedPoolExpansion -
|
EndAllocation = (MmPagedPoolInfo.NextPdeForPagedPoolExpansion -
|
||||||
MiAddressToPte(MmPagedPoolInfo.FirstPteForPagedPool)) *
|
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.FirstPteForPagedPool)) *
|
||||||
PTE_COUNT;
|
PTE_COUNT;
|
||||||
RtlClearBits(MmPagedPoolInfo.PagedPoolAllocationMap,
|
RtlClearBits(MmPagedPoolInfo.PagedPoolAllocationMap,
|
||||||
EndAllocation,
|
EndAllocation,
|
||||||
SizeInPages * PTE_COUNT);
|
PageTableCount * PTE_COUNT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Update the next expansion location
|
// Update the next expansion location
|
||||||
//
|
//
|
||||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion += SizeInPages;
|
MmPagedPoolInfo.NextPdeForPagedPoolExpansion += PageTableCount;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Zero out the newly available memory
|
// Zero out the newly available memory
|
||||||
//
|
//
|
||||||
RtlZeroMemory(BaseVaStart, SizeInPages * PAGE_SIZE);
|
RtlZeroMemory(BaseVaStart, PageTableCount * PAGE_SIZE);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now try consuming the pages again
|
// Now try consuming the pages again
|
||||||
//
|
//
|
||||||
SizeInPages = BYTES_TO_PAGES(SizeInBytes);
|
|
||||||
i = RtlFindClearBitsAndSet(MmPagedPoolInfo.PagedPoolAllocationMap,
|
i = RtlFindClearBitsAndSet(MmPagedPoolInfo.PagedPoolAllocationMap,
|
||||||
SizeInPages,
|
SizeInPages,
|
||||||
0);
|
0);
|
||||||
|
|
|
@ -971,7 +971,7 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process,
|
||||||
/* Do the same for hyperspace */
|
/* Do the same for hyperspace */
|
||||||
PointerPde = MiAddressToPde(HYPER_SPACE);
|
PointerPde = MiAddressToPde(HYPER_SPACE);
|
||||||
PageFrameNumber = PFN_FROM_PTE(PointerPde);
|
PageFrameNumber = PFN_FROM_PTE(PointerPde);
|
||||||
MiInitializePfn(PageFrameNumber, PointerPde, TRUE);
|
MiInitializePfn(PageFrameNumber, (PMMPTE)PointerPde, TRUE);
|
||||||
|
|
||||||
/* Setup the PFN for the PTE for the working set */
|
/* Setup the PFN for the PTE for the working set */
|
||||||
PointerPte = MiAddressToPte(MI_WORKING_SET_LIST);
|
PointerPte = MiAddressToPte(MI_WORKING_SET_LIST);
|
||||||
|
@ -1195,7 +1195,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
||||||
HyperIndex);
|
HyperIndex);
|
||||||
|
|
||||||
/* Set it dirty and map it */
|
/* Set it dirty and map it */
|
||||||
PdePte.u.Hard.Dirty = TRUE;
|
MI_MAKE_DIRTY_PAGE(&PdePte);
|
||||||
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
||||||
|
|
||||||
/* Now get hyperspace's page table */
|
/* Now get hyperspace's page table */
|
||||||
|
@ -1228,7 +1228,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
||||||
PdeIndex);
|
PdeIndex);
|
||||||
|
|
||||||
/* Set it dirty and map it */
|
/* Set it dirty and map it */
|
||||||
PdePte.u.Hard.Dirty = TRUE;
|
MI_MAKE_DIRTY_PAGE(&PdePte);
|
||||||
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
||||||
|
|
||||||
/* Now get the page directory (which we'll double map, so call it a page table */
|
/* Now get the page directory (which we'll double map, so call it a page table */
|
||||||
|
|
|
@ -347,17 +347,17 @@ MiFillSystemPageDirectory(IN PVOID Base,
|
||||||
|
|
||||||
/* Initialize its PFN entry, with the parent system page directory page table */
|
/* Initialize its PFN entry, with the parent system page directory page table */
|
||||||
MiInitializePfnForOtherProcess(PageFrameIndex,
|
MiInitializePfnForOtherProcess(PageFrameIndex,
|
||||||
PointerPde,
|
(PMMPTE)PointerPde,
|
||||||
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
||||||
|
|
||||||
/* Make the system PDE entry valid */
|
/* Make the system PDE entry valid */
|
||||||
MI_WRITE_VALID_PTE(SystemMapPde, TempPde);
|
MI_WRITE_VALID_PDE(SystemMapPde, TempPde);
|
||||||
|
|
||||||
/* The system PDE entry might be the PDE itself, so check for this */
|
/* The system PDE entry might be the PDE itself, so check for this */
|
||||||
if (PointerPde->u.Hard.Valid == 0)
|
if (PointerPde->u.Hard.Valid == 0)
|
||||||
{
|
{
|
||||||
/* It's different, so make the real PDE valid too */
|
/* It's different, so make the real PDE valid too */
|
||||||
MI_WRITE_VALID_PTE(PointerPde, TempPde);
|
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ MiDeleteSystemPageableVm(IN PMMPTE PointerPte,
|
||||||
ASSERT(Pfn1->u1.WsIndex == 0);
|
ASSERT(Pfn1->u1.WsIndex == 0);
|
||||||
|
|
||||||
/* Actual valid, legitimate, pages */
|
/* Actual valid, legitimate, pages */
|
||||||
if (ValidPages) *ValidPages++;
|
if (ValidPages) (*ValidPages)++;
|
||||||
|
|
||||||
/* Get the page table entry */
|
/* Get the page table entry */
|
||||||
PageTableIndex = Pfn1->u4.PteFrame;
|
PageTableIndex = Pfn1->u4.PteFrame;
|
||||||
|
@ -305,7 +305,8 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
|
||||||
IN ULONG_PTR EndingAddress,
|
IN ULONG_PTR EndingAddress,
|
||||||
IN PMMVAD Vad)
|
IN PMMVAD Vad)
|
||||||
{
|
{
|
||||||
PMMPTE PointerPte, PointerPde, PrototypePte, LastPrototypePte;
|
PMMPTE PointerPte, PrototypePte, LastPrototypePte;
|
||||||
|
PMMPDE PointerPde;
|
||||||
MMPTE TempPte;
|
MMPTE TempPte;
|
||||||
PEPROCESS CurrentProcess;
|
PEPROCESS CurrentProcess;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
|
@ -1099,7 +1100,8 @@ MiQueryAddressState(IN PVOID Va,
|
||||||
OUT PVOID *NextVa)
|
OUT PVOID *NextVa)
|
||||||
{
|
{
|
||||||
|
|
||||||
PMMPTE PointerPte, PointerPde;
|
PMMPTE PointerPte;
|
||||||
|
PMMPDE PointerPde;
|
||||||
MMPTE TempPte;
|
MMPTE TempPte;
|
||||||
BOOLEAN DemandZeroPte = TRUE, ValidPte = FALSE;
|
BOOLEAN DemandZeroPte = TRUE, ValidPte = FALSE;
|
||||||
ULONG State = MEM_RESERVE, Protect = 0, LockChange;
|
ULONG State = MEM_RESERVE, Protect = 0, LockChange;
|
||||||
|
|
|
@ -752,9 +752,7 @@ MiBuildPagedPool_x(VOID)
|
||||||
/* Save the first and last paged pool PTE */
|
/* Save the first and last paged pool PTE */
|
||||||
MmPagedPoolInfo.FirstPteForPagedPool = MiAddressToPte(MmPagedPoolStart);
|
MmPagedPoolInfo.FirstPteForPagedPool = MiAddressToPte(MmPagedPoolStart);
|
||||||
MmPagedPoolInfo.LastPteForPagedPool = MiAddressToPte(MmPagedPoolEnd);
|
MmPagedPoolInfo.LastPteForPagedPool = MiAddressToPte(MmPagedPoolEnd);
|
||||||
|
MmPagedPoolInfo.NextPdeForPagedPoolExpansion = MiAddressToPde(MmPagedPoolStart) + 1;
|
||||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion =
|
|
||||||
MiAddressToPde(MmPagedPoolStart) + 1;
|
|
||||||
|
|
||||||
// We keep track of each page via a bit, so check how big the bitmap will
|
// We keep track of each page via a bit, so check how big the bitmap will
|
||||||
// have to be (make sure to align our page count such that it fits nicely
|
// have to be (make sure to align our page count such that it fits nicely
|
||||||
|
|
|
@ -12,10 +12,111 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#line 15 "ARM³::ARMPAGE"
|
||||||
|
#define MODULE_INVOLVED_IN_ARM3
|
||||||
|
#include "../ARM3/miarm.h"
|
||||||
|
|
||||||
/* GLOBALS ********************************************************************/
|
/* GLOBALS ********************************************************************/
|
||||||
|
|
||||||
|
const
|
||||||
|
ULONG
|
||||||
|
MmProtectToPteMask[32] =
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// These are the base MM_ protection flags
|
||||||
|
//
|
||||||
|
0,
|
||||||
|
PTE_READONLY | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
|
||||||
|
PTE_READWRITE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_WRITECOPY | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
|
||||||
|
//
|
||||||
|
// These OR in the MM_NOCACHE flag
|
||||||
|
//
|
||||||
|
0,
|
||||||
|
PTE_READONLY | PTE_DISABLE_CACHE,
|
||||||
|
PTE_EXECUTE | PTE_DISABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READ | PTE_DISABLE_CACHE,
|
||||||
|
PTE_READWRITE | PTE_DISABLE_CACHE,
|
||||||
|
PTE_WRITECOPY | PTE_DISABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READWRITE | PTE_DISABLE_CACHE,
|
||||||
|
PTE_EXECUTE_WRITECOPY | PTE_DISABLE_CACHE,
|
||||||
|
//
|
||||||
|
// These OR in the MM_DECOMMIT flag, which doesn't seem supported on x86/64/ARM
|
||||||
|
//
|
||||||
|
0,
|
||||||
|
PTE_READONLY | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
|
||||||
|
PTE_READWRITE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_WRITECOPY | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
|
||||||
|
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
|
||||||
|
//
|
||||||
|
// These OR in the MM_NOACCESS flag, which seems to enable WriteCombining?
|
||||||
|
//
|
||||||
|
0,
|
||||||
|
PTE_READONLY | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_EXECUTE | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_EXECUTE_READ | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_READWRITE | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_EXECUTE_READWRITE | PTE_WRITECOMBINED_CACHE,
|
||||||
|
PTE_EXECUTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
|
||||||
|
};
|
||||||
|
|
||||||
|
const
|
||||||
|
ULONG MmProtectToValue[32] =
|
||||||
|
{
|
||||||
|
PAGE_NOACCESS,
|
||||||
|
PAGE_READONLY,
|
||||||
|
PAGE_EXECUTE,
|
||||||
|
PAGE_EXECUTE_READ,
|
||||||
|
PAGE_READWRITE,
|
||||||
|
PAGE_WRITECOPY,
|
||||||
|
PAGE_EXECUTE_READWRITE,
|
||||||
|
PAGE_EXECUTE_WRITECOPY,
|
||||||
|
PAGE_NOACCESS,
|
||||||
|
PAGE_NOCACHE | PAGE_READONLY,
|
||||||
|
PAGE_NOCACHE | PAGE_EXECUTE,
|
||||||
|
PAGE_NOCACHE | PAGE_EXECUTE_READ,
|
||||||
|
PAGE_NOCACHE | PAGE_READWRITE,
|
||||||
|
PAGE_NOCACHE | PAGE_WRITECOPY,
|
||||||
|
PAGE_NOCACHE | PAGE_EXECUTE_READWRITE,
|
||||||
|
PAGE_NOCACHE | PAGE_EXECUTE_WRITECOPY,
|
||||||
|
PAGE_NOACCESS,
|
||||||
|
PAGE_GUARD | PAGE_READONLY,
|
||||||
|
PAGE_GUARD | PAGE_EXECUTE,
|
||||||
|
PAGE_GUARD | PAGE_EXECUTE_READ,
|
||||||
|
PAGE_GUARD | PAGE_READWRITE,
|
||||||
|
PAGE_GUARD | PAGE_WRITECOPY,
|
||||||
|
PAGE_GUARD | PAGE_EXECUTE_READWRITE,
|
||||||
|
PAGE_GUARD | PAGE_EXECUTE_WRITECOPY,
|
||||||
|
PAGE_NOACCESS,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_READONLY,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_EXECUTE,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_EXECUTE_READ,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_READWRITE,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_WRITECOPY,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_EXECUTE_READWRITE,
|
||||||
|
PAGE_WRITECOMBINE | PAGE_EXECUTE_WRITECOPY
|
||||||
|
};
|
||||||
|
|
||||||
ULONG MmGlobalKernelPageDirectory[4096];
|
ULONG MmGlobalKernelPageDirectory[4096];
|
||||||
MMPDE HyperTemplatePde;
|
|
||||||
|
/* Template PTE and PDE for a kernel page */
|
||||||
|
MMPDE ValidKernelPde = {.u.Hard.Valid = 1};
|
||||||
|
MMPTE ValidKernelPte = {.u.Hard.Valid = 1, .u.Hard.Sbo = 1};
|
||||||
|
|
||||||
|
/* Template PDE for a demand-zero page */
|
||||||
|
MMPDE DemandZeroPde = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS)};
|
||||||
|
MMPTE DemandZeroPte = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS)};
|
||||||
|
|
||||||
|
/* Template PTE for prototype page */
|
||||||
|
MMPTE PrototypePte = {.u.Long = (MM_READWRITE << MM_PTE_SOFTWARE_PROTECTION_BITS) | PTE_PROTOTYPE | (MI_PTE_LOOKUP_NEEDED << PAGE_SHIFT)};
|
||||||
|
|
||||||
/* PRIVATE FUNCTIONS **********************************************************/
|
/* PRIVATE FUNCTIONS **********************************************************/
|
||||||
|
|
||||||
|
@ -49,25 +150,6 @@ MmUpdatePageDir(IN PEPROCESS Process,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
while (TRUE);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmInitializeHandBuiltProcess(IN PEPROCESS Process,
|
|
||||||
IN PULONG DirectoryTableBase)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
while (TRUE);
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
PULONG
|
PULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
MmGetPageDirectory(VOID)
|
MmGetPageDirectory(VOID)
|
||||||
|
@ -246,16 +328,7 @@ MmInitGlobalKernelPageDirectory(VOID)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PULONG CurrentPageDirectory = (PULONG)PDE_BASE;
|
PULONG CurrentPageDirectory = (PULONG)PDE_BASE;
|
||||||
extern MMPTE HyperTemplatePte;
|
|
||||||
|
|
||||||
/* Setup PTE template */
|
|
||||||
HyperTemplatePte.u.Long = 0;
|
|
||||||
HyperTemplatePte.u.Hard.Valid = 1;
|
|
||||||
HyperTemplatePte.u.Hard.Access = 1;
|
|
||||||
|
|
||||||
/* Setup PDE template */
|
|
||||||
HyperTemplatePde.u.Long = 0;
|
|
||||||
HyperTemplatePde.u.Hard.Valid = 1;
|
|
||||||
|
|
||||||
/* Loop the 2GB of address space which belong to the kernel */
|
/* Loop the 2GB of address space which belong to the kernel */
|
||||||
for (i = MiGetPdeOffset(MmSystemRangeStart); i < 2048; i++)
|
for (i = MiGetPdeOffset(MmSystemRangeStart); i < 2048; i++)
|
||||||
|
|
|
@ -367,18 +367,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
|
||||||
NTAPI
|
|
||||||
MmUpdatePageDir(IN PEPROCESS Process,
|
|
||||||
IN PVOID Address,
|
|
||||||
IN ULONG Size)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Nothing to do
|
|
||||||
//
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
||||||
|
@ -391,30 +379,6 @@ Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
|
||||||
NTAPI
|
|
||||||
MmInitializeHandBuiltProcess(IN PEPROCESS Process,
|
|
||||||
IN PULONG DirectoryTableBase)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Share the directory base with the idle process
|
|
||||||
//
|
|
||||||
DirectoryTableBase[0] = PsGetCurrentProcess()->Pcb.DirectoryTableBase[0];
|
|
||||||
DirectoryTableBase[1] = PsGetCurrentProcess()->Pcb.DirectoryTableBase[1];
|
|
||||||
|
|
||||||
//
|
|
||||||
// Initialize the Addresss Space
|
|
||||||
//
|
|
||||||
KeInitializeGuardedMutex(&Process->AddressCreationLock);
|
|
||||||
Process->VadRoot.BalancedRoot.u1.Parent = NULL;
|
|
||||||
|
|
||||||
//
|
|
||||||
// The process now has an address space
|
|
||||||
//
|
|
||||||
Process->HasAddressSpace = TRUE;
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
PULONG
|
PULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
MmGetPageDirectory(VOID)
|
MmGetPageDirectory(VOID)
|
||||||
|
|
|
@ -132,7 +132,7 @@ MmBuildMdlFromPages(PMDL Mdl, PPFN_NUMBER Pages)
|
||||||
|
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
MmIsFileAPagingFile(PFILE_OBJECT FileObject)
|
MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
|
|
|
@ -102,9 +102,9 @@
|
||||||
@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr)
|
@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr)
|
||||||
@ fastcall -arch=i386,arm ExInterlockedAddLargeStatistic(ptr long)
|
@ fastcall -arch=i386,arm ExInterlockedAddLargeStatistic(ptr long)
|
||||||
@ stdcall ExInterlockedAddUlong(ptr long ptr)
|
@ stdcall ExInterlockedAddUlong(ptr long ptr)
|
||||||
@ fastcall -arch=i386,arm ExInterlockedCompareExchange64(ptr ptr ptr ptr)
|
@ fastcall -arch=i386 ExInterlockedCompareExchange64(ptr ptr ptr ptr)
|
||||||
@ stdcall -arch=i386,arm ExInterlockedDecrementLong(ptr ptr)
|
@ stdcall -arch=i386 ExInterlockedDecrementLong(ptr ptr)
|
||||||
@ stdcall -arch=i386,arm ExInterlockedExchangeUlong(ptr long ptr)
|
@ stdcall -arch=i386 ExInterlockedExchangeUlong(ptr long ptr)
|
||||||
@ stdcall ExInterlockedExtendZone(ptr ptr long ptr)
|
@ stdcall ExInterlockedExtendZone(ptr ptr long ptr)
|
||||||
@ fastcall -arch=i386,arm ExInterlockedFlushSList(ptr)
|
@ fastcall -arch=i386,arm ExInterlockedFlushSList(ptr)
|
||||||
@ stdcall -arch=i386,arm ExInterlockedIncrementLong(ptr ptr)
|
@ stdcall -arch=i386,arm ExInterlockedIncrementLong(ptr ptr)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
|
#include "initguid.h"
|
||||||
#include <ntoskrnl.h>
|
#include <ntoskrnl.h>
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
|
@ -58,8 +58,12 @@ typedef struct _USER_MESSAGE_QUEUE
|
||||||
LIST_ENTRY HardwareMessagesListHead;
|
LIST_ENTRY HardwareMessagesListHead;
|
||||||
/* Lock for the hardware message list. */
|
/* Lock for the hardware message list. */
|
||||||
KMUTEX HardwareLock;
|
KMUTEX HardwareLock;
|
||||||
/* Pointer to the current WM_MOUSEMOVE message */
|
/* True if a WM_MOUSEMOVE is pending */
|
||||||
PUSER_MESSAGE MouseMoveMsg;
|
BOOLEAN MouseMoved;
|
||||||
|
/* Current WM_MOUSEMOVE message */
|
||||||
|
MSG MouseMoveMsg;
|
||||||
|
/* Last click message for translating double clicks */
|
||||||
|
MSG msgDblClk;
|
||||||
/* True if a WM_QUIT message is pending. */
|
/* True if a WM_QUIT message is pending. */
|
||||||
BOOLEAN QuitPosted;
|
BOOLEAN QuitPosted;
|
||||||
/* The quit exit code. */
|
/* The quit exit code. */
|
||||||
|
@ -122,18 +126,25 @@ VOID FASTCALL
|
||||||
MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
|
MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
|
||||||
BOOLEAN APIENTRY
|
BOOLEAN APIENTRY
|
||||||
MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
IN BOOLEAN Remove,
|
IN BOOLEAN Remove,
|
||||||
IN PWND Window,
|
IN PWND Window,
|
||||||
IN UINT MsgFilterLow,
|
IN UINT MsgFilterLow,
|
||||||
IN UINT MsgFilterHigh,
|
IN UINT MsgFilterHigh,
|
||||||
OUT PMSG Message);
|
OUT PMSG Message);
|
||||||
BOOL APIENTRY
|
BOOL APIENTRY
|
||||||
co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
IN BOOL Remove,
|
IN BOOL Remove,
|
||||||
IN PWND Window,
|
IN PWND Window,
|
||||||
IN UINT MsgFilterLow,
|
IN UINT MsgFilterLow,
|
||||||
IN UINT MsgFilterHigh,
|
IN UINT MsgFilterHigh,
|
||||||
OUT MSG* pMsg);
|
OUT MSG* pMsg);
|
||||||
|
BOOL APIENTRY
|
||||||
|
co_MsqPeekMouseMove(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
||||||
|
IN BOOL Remove,
|
||||||
|
IN PWND Window,
|
||||||
|
IN UINT MsgFilterLow,
|
||||||
|
IN UINT MsgFilterHigh,
|
||||||
|
OUT MSG* pMsg);
|
||||||
BOOLEAN FASTCALL
|
BOOLEAN FASTCALL
|
||||||
MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue);
|
MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue);
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
|
@ -154,9 +165,6 @@ NTSTATUS FASTCALL
|
||||||
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
|
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
|
||||||
UINT MsgFilterMin, UINT MsgFilterMax);
|
UINT MsgFilterMin, UINT MsgFilterMax);
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
|
||||||
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
|
|
||||||
VOID FASTCALL
|
|
||||||
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||||
|
|
|
@ -27,9 +27,8 @@ BOOLEAN FASTCALL
|
||||||
co_WinPosShowWindow(PWND Window, INT Cmd);
|
co_WinPosShowWindow(PWND Window, INT Cmd);
|
||||||
void FASTCALL
|
void FASTCALL
|
||||||
co_WinPosSendSizeMove(PWND Window);
|
co_WinPosSendSizeMove(PWND Window);
|
||||||
USHORT FASTCALL
|
PWND FASTCALL
|
||||||
co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
|
co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest);
|
||||||
PWND* Window);
|
|
||||||
VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
|
VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
|
||||||
|
|
||||||
VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
|
VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
|
||||||
|
|
|
@ -1198,33 +1198,4 @@ NtUserGetClipboardSequenceNumber(VOID)
|
||||||
return sn;
|
return sn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************** VISTA FUNCTIONS******************/
|
|
||||||
|
|
||||||
BOOL APIENTRY NtUserAddClipboardFormatListener(
|
|
||||||
HWND hwnd
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL APIENTRY NtUserRemoveClipboardFormatListener(
|
|
||||||
HWND hwnd
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL APIENTRY NtUserGetUpdatedClipboardFormats(
|
|
||||||
PUINT lpuiFormats,
|
|
||||||
UINT cFormats,
|
|
||||||
PUINT pcFormatsOut
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue