mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 19:27:00 +00:00
[CMAKE]
Sync with trunk. (r49792) svn path=/branches/cmake-bringup/; revision=49803
This commit is contained in:
commit
f1283c58c6
111 changed files with 4097 additions and 2327 deletions
|
@ -2,13 +2,13 @@
|
|||
|
||||
[Section]
|
||||
Name = 7-Zip
|
||||
Version = 4.65
|
||||
Version = 9.20
|
||||
Licence = LGPL
|
||||
Description = Utility to create and open 7zip, zip, tar, rar and other archive files.
|
||||
Size = 0.9M
|
||||
Size = 1.0M
|
||||
Category = 12
|
||||
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
|
||||
|
||||
[Section.0407]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[Section]
|
||||
Name = LibreOffice
|
||||
Version = 3.3.0 Beta 2
|
||||
Version = 3.3.0 Beta 3
|
||||
Licence = LGPL
|
||||
Description = Former called OpenOffice. Open Source Office Suite.
|
||||
Size = 318.0MB
|
||||
Size = 300.0MB
|
||||
Category = 6
|
||||
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
|
||||
|
||||
[Section.0407]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[Section]
|
||||
Name = Miranda IM
|
||||
Version = 0.9.10
|
||||
Version = 0.9.11
|
||||
Licence = GPL
|
||||
Description = Open source multiprotocol instant messaging application - May not work completely.
|
||||
Size = 3.0MB
|
||||
Category = 5
|
||||
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
|
||||
|
||||
[Section.0407]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[Section]
|
||||
Name = Mono .net Development Framework
|
||||
Version = 2.8
|
||||
Version = 2.8.1
|
||||
Licence = Unknown
|
||||
Description = Open Source .net Framework.
|
||||
Size = 78MB
|
||||
Size = 77MB
|
||||
Category = 14
|
||||
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
|
||||
|
||||
[Section.0415]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
[Section]
|
||||
Name = OpenTTD
|
||||
Version = 1.0.4
|
||||
Version = 1.0.5
|
||||
Licence = GPL v2
|
||||
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.
|
||||
Size = 3.4MB
|
||||
Category = 4
|
||||
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
|
||||
|
||||
[Section.0407]
|
||||
|
|
|
@ -834,8 +834,8 @@ DWORD RQueryServiceObjectSecurity(
|
|||
return ERROR_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (dwSecurityInformation & (DACL_SECURITY_INFORMATION ||
|
||||
GROUP_SECURITY_INFORMATION ||
|
||||
if (dwSecurityInformation & (DACL_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION |
|
||||
OWNER_SECURITY_INFORMATION))
|
||||
DesiredAccess |= READ_CONTROL;
|
||||
|
||||
|
|
|
@ -9,6 +9,12 @@ CreateBootSectorTarget(isobtrt ${CMAKE_CURRENT_SOURCE_DIR}/freeldr/bootsect/isob
|
|||
include_directories(BEFORE freeldr/freeldr/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(MSVC)
|
||||
list(APPEND FREELDR_BASE64K_SOURCE
|
||||
|
@ -90,7 +96,6 @@ list(APPEND FREELDR_BASE_SOURCE
|
|||
freeldr/freeldr/video/palette.c
|
||||
freeldr/freeldr/video/video.c
|
||||
freeldr/freeldr/windows/conversion.c
|
||||
freeldr/freeldr/windows/headless.c
|
||||
freeldr/freeldr/windows/peloader.c
|
||||
freeldr/freeldr/windows/winldr.c
|
||||
freeldr/freeldr/windows/wlmemory.c
|
||||
|
@ -105,7 +110,9 @@ list(APPEND FREELDR_BASE_SOURCE
|
|||
freeldr/freeldr/oslist.c)
|
||||
|
||||
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)
|
||||
|
||||
set_source_files_properties(${FREELDR_BASE_SOURCE} PROPERTIES COMPILE_DEFINITIONS "_NTHAL_;_BLDR_;_NTSYSTEM_")
|
||||
|
|
|
@ -13,15 +13,47 @@
|
|||
NESTED_ENTRY _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.
|
||||
* Second word is load address of program. Since DDR is not initialized,
|
||||
* we load to SDRAM at 40200000h. Max 64K.
|
||||
*/
|
||||
.word 0x8000
|
||||
.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
|
||||
|
||||
/* Load C entrypoint and setup LLB stack */
|
||||
|
@ -31,8 +63,14 @@
|
|||
ENTRY_END _start
|
||||
|
||||
L_BootStackEnd:
|
||||
#ifdef _BEAGLE_ // This is only used for TI BootROM on Beagle/Emulator for now
|
||||
.long 0x00010000
|
||||
|
||||
#elif _ZOOM2_ // On ZOOM2 RAM starts at 0x80000000, not 0
|
||||
.long 0x81014000
|
||||
#else
|
||||
#error Stack Address Not Defined
|
||||
#endif
|
||||
|
||||
L_LlbStartup:
|
||||
.long LlbStartup
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ int printf(const char *fmt, ...)
|
|||
return puts(printbuffer);
|
||||
}
|
||||
|
||||
VOID
|
||||
ULONG
|
||||
DbgPrint(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -52,6 +52,7 @@ DbgPrint(const char *fmt, ...)
|
|||
va_end(args);
|
||||
|
||||
for (j = 0; j < i; j++) LlbSerialPutChar(Buffer[j]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -9,10 +9,11 @@
|
|||
#include "precomp.h"
|
||||
|
||||
ULONG LlbEnvHwPageSize;
|
||||
ULONG LlbEnvHwMemStart;
|
||||
ULONG LlbEnvHwMemSize;
|
||||
ULONG LlbEnvRamDiskStart;
|
||||
ULONG LlbEnvRamDiskSize;
|
||||
ULONG LlbEnvHwMemStart = 0;
|
||||
ULONG LlbEnvHwMemSize = 0;
|
||||
ULONG LlbEnvRamDiskStart = 0;
|
||||
ULONG LlbEnvRamDiskSize = 0;
|
||||
ULONG LlbEnvHwRevision;
|
||||
CHAR LlbEnvCmdLine[256];
|
||||
CHAR LlbValueData[32];
|
||||
|
||||
|
@ -35,11 +36,17 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
LlbEnvHwPageSize = Atag->u.Core.PageSize;
|
||||
break;
|
||||
|
||||
case ATAG_REVISION:
|
||||
|
||||
/* Save page size */
|
||||
LlbEnvHwRevision = Atag->u.Revision.Rev;
|
||||
break;
|
||||
|
||||
case ATAG_MEM:
|
||||
|
||||
/* Save RAM start and size */
|
||||
LlbEnvHwMemStart = Atag->u.Mem.Start;
|
||||
LlbEnvHwMemSize = Atag->u.Mem.Size;
|
||||
if (!LlbEnvHwMemStart) LlbEnvHwMemStart = Atag->u.Mem.Start;
|
||||
LlbEnvHwMemSize += Atag->u.Mem.Size;
|
||||
break;
|
||||
|
||||
case ATAG_INITRD2:
|
||||
|
@ -48,6 +55,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
LlbEnvRamDiskStart = Atag->u.InitRd2.Start;
|
||||
LlbEnvRamDiskSize = Atag->u.InitRd2.Size;
|
||||
|
||||
#ifdef _BEAGLE_
|
||||
/* Make sure it's 16MB-aligned */
|
||||
LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
|
||||
&~ ((16 * 1024 * 1024) - 1);
|
||||
|
@ -55,6 +63,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
/* The RAMDISK actually starts 16MB later */
|
||||
LlbEnvRamDiskStart += 16 * 1024 * 1024;
|
||||
LlbEnvRamDiskSize -= 16 * 1024 * 1024;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ATAG_CMDLINE:
|
||||
|
@ -68,7 +77,7 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
/* Nothing left to handle */
|
||||
case ATAG_NONE:
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Next tag */
|
||||
|
@ -76,8 +85,11 @@ LlbEnvParseArguments(IN PATAG Arguments)
|
|||
}
|
||||
|
||||
/* For debugging */
|
||||
DbgPrint("[BOOTROM] PageSize: %dKB RAM: %dMB CMDLINE: %s\n",
|
||||
LlbEnvHwPageSize / 1024, LlbEnvHwMemSize / 1024 / 1024, LlbEnvCmdLine);
|
||||
DbgPrint("[BOOTROM] Board Revision: %lx PageSize: %dKB RAM: %dMB CMDLINE: %s\n"
|
||||
"[RAMDISK] Base: %lx Size: %dMB\n",
|
||||
LlbEnvHwRevision,
|
||||
LlbEnvHwPageSize / 1024, LlbEnvHwMemSize / 1024 / 1024, LlbEnvCmdLine,
|
||||
LlbEnvRamDiskStart, LlbEnvRamDiskSize / 1024 / 1024);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -49,7 +49,11 @@ INT
|
|||
LlbFwGetCh(VOID)
|
||||
{
|
||||
/* Return the key pressed */
|
||||
#ifdef _ZOOM2_
|
||||
return LlbKeypadGetChar();
|
||||
#else
|
||||
return LlbKeyboardGetChar();
|
||||
#endif
|
||||
}
|
||||
|
||||
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
|
||||
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
||||
* FILE: boot/armllb/hw/omap3/hwinit.c
|
||||
* PURPOSE: LLB Hardware Initialization Routines for OMAP3
|
||||
* FILE: boot/armllb/hw/omap3-beagle/hwinit.c
|
||||
* PURPOSE: LLB Hardware Initialization Routines for OMAP3 Beagle
|
||||
* PROGRAMMERS: ReactOS Portable Systems Group
|
||||
*/
|
||||
|
||||
|
@ -12,7 +12,7 @@ VOID
|
|||
NTAPI
|
||||
LlbHwInitialize(VOID)
|
||||
{
|
||||
|
||||
while (TRUE);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
|
||||
UCHAR LlbDaysInMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
#ifndef _ZOOM2_
|
||||
TIMEINFO LlbTime;
|
||||
#else
|
||||
extern TIMEINFO LlbTime;
|
||||
#endif
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
|
@ -82,9 +87,10 @@ LlbGetTime(VOID)
|
|||
|
||||
/* Read RTC time */
|
||||
RtcTime = LlbHwRtcRead();
|
||||
|
||||
#ifndef _ZOOM2_
|
||||
/* Convert it */
|
||||
LlbConvertRtcTime(RtcTime, &LlbTime);
|
||||
#endif
|
||||
return &LlbTime;
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,11 @@ LlbVideoClearScreen(IN BOOLEAN OsLoader)
|
|||
else
|
||||
{
|
||||
/* Deep blue */
|
||||
#ifdef BLUE_SCREEN
|
||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||
#else
|
||||
BackColor = LlbHwVideoCreateColor(0, 0, 0);
|
||||
#endif
|
||||
BackColor = (BackColor << 16) | BackColor;
|
||||
}
|
||||
|
||||
|
@ -346,8 +350,12 @@ LlbVideoPutChar(IN UCHAR c)
|
|||
{
|
||||
ULONG cx, cy, CharsPerLine, BackColor, ScreenWidth;
|
||||
|
||||
/* Forecolor on this machine */
|
||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||
/* Backcolor on this machine */
|
||||
#ifdef BLUE_SCREEN
|
||||
BackColor = LlbHwVideoCreateColor(14, 0, 82);
|
||||
#else
|
||||
BackColor = LlbHwVideoCreateColor(0, 0, 0);
|
||||
#endif
|
||||
|
||||
/* Amount of characters in a line */
|
||||
ScreenWidth = LlbHwGetScreenWidth();
|
||||
|
|
|
@ -25,6 +25,11 @@ typedef struct _ATAG_MEM
|
|||
ULONG Start;
|
||||
} ATAG_MEM, *PATAG_MEM;
|
||||
|
||||
typedef struct _ATAG_REVISION
|
||||
{
|
||||
ULONG Rev;
|
||||
} ATAG_REVISION, *PATAG_REVISION;
|
||||
|
||||
typedef struct _ATAG_INITRD2
|
||||
{
|
||||
ULONG Start;
|
||||
|
@ -43,6 +48,7 @@ typedef struct _ATAG
|
|||
{
|
||||
ATAG_CORE Core;
|
||||
ATAG_MEM Mem;
|
||||
ATAG_REVISION Revision;
|
||||
ATAG_INITRD2 InitRd2;
|
||||
ATAG_CMDLINE CmdLine;
|
||||
} u;
|
||||
|
|
|
@ -12,4 +12,10 @@ LlbKeyboardGetChar(
|
|||
VOID
|
||||
);
|
||||
|
||||
CHAR
|
||||
NTAPI
|
||||
LlbKeypadGetChar(
|
||||
VOID
|
||||
);
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -24,4 +24,9 @@
|
|||
//
|
||||
#define MACH_TYPE_OMAP3_BEAGLE 1546
|
||||
|
||||
//
|
||||
// LogicPD ZOOM-II MDK Board, OMAP3530 SoC
|
||||
//
|
||||
#define MACH_TYPE_OMAP_ZOOM2 1967
|
||||
|
||||
/* 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 "keyboard.h"
|
||||
#include "envir.h"
|
||||
|
||||
VOID
|
||||
DbgPrint(
|
||||
const char *fmt,
|
||||
...
|
||||
);
|
||||
#include "../../freeldr/freeldr/include/keycodes.h"
|
||||
#include "debug.h"
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -16,17 +16,17 @@ LlbStartup(IN ULONG Reserved,
|
|||
/* Make sure we are booting on the correct kind of machine */
|
||||
if (BoardInfo != LlbHwGetBoardType()) while (TRUE);
|
||||
|
||||
/* Either QEMU or U-Boot itself should send this information */
|
||||
LlbEnvParseArguments(Arguments);
|
||||
|
||||
/* Initialize hardware components */
|
||||
LlbHwInitialize();
|
||||
|
||||
/* Either QEMU or U-Boot itself should send this information */
|
||||
LlbEnvParseArguments(Arguments);
|
||||
|
||||
/* Clean up the screen */
|
||||
LlbVideoClearScreen(FALSE);
|
||||
|
||||
/* 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 */
|
||||
LlbBoot();
|
||||
|
|
|
@ -91,6 +91,38 @@ LlbBuildMemoryMap(VOID)
|
|||
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
|
||||
NTAPI
|
||||
LlbLoadOsLoader(VOID)
|
||||
|
@ -118,6 +150,11 @@ LlbLoadOsLoader(VOID)
|
|||
{
|
||||
//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);
|
||||
}
|
||||
|
||||
|
@ -133,7 +170,7 @@ LlbBoot(VOID)
|
|||
|
||||
/* Load the OS loader */
|
||||
LlbLoadOsLoader();
|
||||
|
||||
|
||||
/* Jump to the OS Loader (FreeLDR in this case) */
|
||||
LoaderInit(&ArmBlock);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
.title "ARM FreeLDR Entry Point"
|
||||
.include "ntoskrnl/include/internal/arm/kxarm.h"
|
||||
.include "ntoskrnl/include/internal/arm/ksarm.h"
|
||||
.section .init
|
||||
|
||||
NESTED_ENTRY _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 */
|
||||
ASSERT((ArmBoardBlock->BoardType == MACH_TYPE_FEROCEON) ||
|
||||
(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 */
|
||||
BootMain(ArmBoardBlock->CommandLine);
|
||||
|
@ -156,6 +157,16 @@ ArmMemGetMemoryMap(OUT PBIOS_MEMORY_MAP BiosMemoryMap,
|
|||
VOID
|
||||
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 */
|
||||
switch (ArmBoardBlock->BoardType)
|
||||
{
|
||||
|
@ -164,29 +175,24 @@ MachInit(IN PCCH CommandLine)
|
|||
TuiPrintf("Not implemented\n");
|
||||
while (TRUE);
|
||||
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 */
|
||||
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 */
|
||||
gDiskReadBuffer = 0x00090000;
|
||||
gFileSysBuffer = 0x00090000;
|
||||
break;
|
||||
|
||||
/*
|
||||
* Check for TI OMAP3 boards
|
||||
* For now that means only Beagle, but ZOOM and others should be ok too
|
||||
*/
|
||||
/* Check for TI OMAP3 Beagleboard */
|
||||
case MACH_TYPE_OMAP3_BEAGLE:
|
||||
TuiPrintf("Not implemented\n");
|
||||
while (TRUE);
|
||||
|
@ -195,7 +201,7 @@ MachInit(IN PCCH CommandLine)
|
|||
default:
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/* Setup generic ARM routines for all boards */
|
||||
MachVtbl.PrepareForReactOS = ArmPrepareForReactOS;
|
||||
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_BACKSPACE 0x08
|
||||
#define KEY_SPACE 0x20
|
||||
#define KEY_LEFTSHIFT 0x2A
|
||||
#define KEY_HOME 0x47
|
||||
#define KEY_UP 0x48
|
||||
#define KEY_DOWN 0x50
|
||||
#define KEY_LEFT 0x4B
|
||||
#define KEY_RIGHT 0x4D
|
||||
#define KEY_ESC 0x1B
|
||||
#define KEY_CAPS_LOCK 0x3A
|
||||
#define KEY_F1 0x3B
|
||||
#define KEY_F2 0x3C
|
||||
#define KEY_F3 0x3D
|
||||
|
@ -38,4 +41,7 @@
|
|||
#define KEY_F7 0x41
|
||||
#define KEY_F8 0x42
|
||||
#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 Result;
|
||||
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
||||
|
||||
if (MemorySize > MM_PAGE_SIZE)
|
||||
{
|
||||
|
@ -99,13 +98,17 @@ PVOID MmHeapAlloc(ULONG MemorySize)
|
|||
{
|
||||
DPRINTM(DPRINT_MEMORY, "Heap allocation for %d bytes failed\n", MemorySize);
|
||||
}
|
||||
#if MM_DBG
|
||||
{
|
||||
LONG CurAlloc, TotalFree, MaxFree, NumberOfGets, NumberOfRels;
|
||||
|
||||
// Gather some stats
|
||||
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);
|
||||
// Gather some stats
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
|
|
@ -407,6 +407,7 @@
|
|||
all buffers allocated are a
|
||||
multiple of this size. This
|
||||
MUST be a power of two. */
|
||||
#ifdef MM_DBG
|
||||
|
||||
#define BufDump 1 /* Define this symbol to enable the
|
||||
bpoold() function which dumps the
|
||||
|
@ -442,6 +443,8 @@
|
|||
#define BECtl 1 /* Define this symbol to enable the
|
||||
bectl() function for automatic
|
||||
pool space control. */
|
||||
#else
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -19,17 +19,32 @@
|
|||
#define PTE_BASE 0xC0000000
|
||||
#define PDE_BASE 0xC0400000
|
||||
#define PDR_BASE 0xFFD00000
|
||||
#define MMIO_BASE 0x10000000
|
||||
#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 StartupPtePageTableIndex (PTE_BASE >> PDE_SHIFT)
|
||||
#define StartupPdePageTableIndex (PDE_BASE >> PDE_SHIFT)
|
||||
#define MmioPageTableIndex (MMIO_BASE >> PDE_SHIFT)
|
||||
#define PdrPageTableIndex (PDR_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 */
|
||||
#define PaToPfn(p) ((p) >> PFN_SHIFT)
|
||||
#define PaToLargePfn(p) ((p) >> LARGE_PFN_SHIFT)
|
||||
|
@ -185,18 +200,21 @@ MempAllocatePageTables(VOID)
|
|||
PFN_NUMBER Pfn;
|
||||
|
||||
/* 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 */
|
||||
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) */
|
||||
LargePte = &PdrPage->PageDir.Pte[LowMemPageTableIndex];
|
||||
TempLargePte.PageFrameNumber = PaToLargePfn(IDMAP_BASE);
|
||||
*LargePte = TempLargePte;
|
||||
|
||||
/* Setup the MMIO PDE as two identity mapped large pages -- the kernel will blow these away later */
|
||||
LargePte = &PdrPage->PageDir.Pte[MmioPageTableIndex];
|
||||
Pfn = PaToLargePfn(0x10000000);
|
||||
Pfn = PaToLargePfn(MMIO_BASE);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
TempLargePte.PageFrameNumber = Pfn++;
|
||||
|
@ -215,13 +233,13 @@ MempAllocatePageTables(VOID)
|
|||
|
||||
/* Setup the Kernel PTEs */
|
||||
PointerPte = PdrPage->KernelPageTable[0].Pte;
|
||||
Pfn = 0;
|
||||
Pfn = PaPtrToPfn(MempKernelBaseAddress);
|
||||
for (i = 0; i < 3072; i++)
|
||||
{
|
||||
TempPte.PageFrameNumber = Pfn++;
|
||||
*PointerPte++ = TempPte;
|
||||
}
|
||||
|
||||
|
||||
/* Done */
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
/* FUNCTIONS **************************************************************/
|
||||
|
||||
#ifndef _ZOOM2_
|
||||
/* Arch-specific addresses translation implementation */
|
||||
PVOID
|
||||
VaToPa(PVOID Va)
|
||||
|
@ -27,6 +28,19 @@ PaToVa(PVOID Pa)
|
|||
{
|
||||
return (PVOID)((ULONG_PTR)Pa | KSEG0_BASE);
|
||||
}
|
||||
#else
|
||||
PVOID
|
||||
VaToPa(PVOID Va)
|
||||
{
|
||||
return Va;
|
||||
}
|
||||
|
||||
PVOID
|
||||
PaToVa(PVOID Pa)
|
||||
{
|
||||
return Pa;
|
||||
}
|
||||
#endif
|
||||
|
||||
VOID
|
||||
List_PaToVa(LIST_ENTRY *ListEntry)
|
||||
|
|
|
@ -209,6 +209,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
Extension->AcpiTable = (PVOID)1;
|
||||
}
|
||||
|
||||
#ifndef _M_ARM
|
||||
/* Set headless block pointer */
|
||||
if (WinLdrTerminalConnected)
|
||||
{
|
||||
|
@ -225,7 +226,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
sizeof(HEADLESS_LOADER_BLOCK));
|
||||
Extension->HeadlessLoaderBlock = PaToVa(Extension->HeadlessLoaderBlock);
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Load drivers database */
|
||||
strcpy(MiscFiles, BootPath);
|
||||
strcat(MiscFiles, "AppPatch\\drvmain.sdb");
|
||||
|
@ -537,9 +538,10 @@ LoadAndBootWindows(PCSTR OperatingSystemName,
|
|||
/* Allocate and minimalistic-initialize LPB */
|
||||
AllocateAndInitLPB(&LoaderBlock);
|
||||
|
||||
#ifndef _M_ARM
|
||||
/* Setup redirection support */
|
||||
WinLdrSetupEms(BootOptions);
|
||||
|
||||
#endif
|
||||
/* Detect hardware */
|
||||
UseRealHeap = TRUE;
|
||||
LoaderBlock->ConfigurationRoot = MachHwDetect();
|
||||
|
|
|
@ -88,7 +88,7 @@ WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
}
|
||||
|
||||
/* Convert address to virtual */
|
||||
HiveDataVirtual = (PVOID)(KSEG0_BASE | HiveDataPhysical);
|
||||
HiveDataVirtual = PaToVa((PVOID)HiveDataPhysical);
|
||||
|
||||
/* Fill LoaderBlock's entries */
|
||||
LoaderBlock->RegistryLength = HiveFileSize;
|
||||
|
@ -379,7 +379,7 @@ WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
if (NlsDataBase == 0)
|
||||
goto Failure;
|
||||
|
||||
NlsVirtual = (PVOID)(KSEG0_BASE | NlsDataBase);
|
||||
NlsVirtual = PaToVa((PVOID)NlsDataBase);
|
||||
LoaderBlock->NlsData->AnsiCodePageData = NlsVirtual;
|
||||
LoaderBlock->NlsData->OemCodePageData = (PVOID)((PUCHAR)NlsVirtual +
|
||||
(MM_SIZE_TO_PAGES(AnsiFileSize) << MM_PAGE_SHIFT));
|
||||
|
|
|
@ -3236,9 +3236,9 @@ LdrpGetResidentSize(PIMAGE_NT_HEADERS NTHeaders)
|
|||
*/
|
||||
NTSTATUS NTAPI
|
||||
LdrVerifyImageMatchesChecksum (IN HANDLE FileHandle,
|
||||
ULONG Unknown1,
|
||||
ULONG Unknown2,
|
||||
ULONG Unknown3)
|
||||
IN PLDR_CALLBACK Callback,
|
||||
IN PVOID CallbackContext,
|
||||
OUT PUSHORT ImageCharacterstics)
|
||||
{
|
||||
FILE_STANDARD_INFORMATION FileInfo;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
|
|
|
@ -255,7 +255,7 @@ GetViewportExtEx(
|
|||
|
||||
if ((Dc_Attr->flXform & PAGE_EXTENTS_CHANGED) && (Dc_Attr->iMapMode == MM_ISOTROPIC))
|
||||
// Something was updated, go to kernel.
|
||||
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (LPPOINT) lpSize );
|
||||
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (PPOINTL) lpSize );
|
||||
else
|
||||
{
|
||||
lpSize->cx = Dc_Attr->szlViewportExt.cx;
|
||||
|
|
|
@ -746,7 +746,7 @@ GetAspectRatioFilterEx(
|
|||
LPSIZE lpAspectRatio
|
||||
)
|
||||
{
|
||||
return NtGdiGetDCPoint( hdc, GdiGetAspectRatioFilter, (LPPOINT) lpAspectRatio );
|
||||
return NtGdiGetDCPoint( hdc, GdiGetAspectRatioFilter, (PPOINTL) lpAspectRatio );
|
||||
}
|
||||
|
||||
|
||||
|
@ -760,7 +760,7 @@ GetDCOrgEx(
|
|||
LPPOINT lpPoint
|
||||
)
|
||||
{
|
||||
return NtGdiGetDCPoint( hdc, GdiGetDCOrg, lpPoint );
|
||||
return NtGdiGetDCPoint( hdc, GdiGetDCOrg, (PPOINTL)lpPoint );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <debug.h>
|
||||
DEBUG_CHANNEL(kernel32file);
|
||||
|
||||
#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
|
||||
/* 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
|
||||
*/
|
||||
|
@ -448,6 +458,95 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
|
|||
/* Success */
|
||||
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
|
||||
#include <debug.h>
|
||||
|
||||
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
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
|
||||
NpfsOpenRootDirectory(PNPFS_FCB Fcb,
|
||||
PFILE_OBJECT FileObject,
|
||||
|
@ -146,6 +177,9 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
PNPFS_VCB Vcb;
|
||||
ACCESS_MASK DesiredAccess;
|
||||
NTSTATUS Status;
|
||||
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
BOOLEAN SpecialAccess;
|
||||
#endif
|
||||
|
||||
DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||
|
||||
|
@ -161,6 +195,32 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
|
||||
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)
|
||||
{
|
||||
DPRINT("Open the root directory\n");
|
||||
|
@ -217,8 +277,11 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
ClientCcb->Fcb = Fcb;
|
||||
ClientCcb->PipeEnd = FILE_PIPE_CLIENT_END;
|
||||
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;
|
||||
#endif
|
||||
InitializeListHead(&ClientCcb->ReadRequestListHead);
|
||||
|
||||
DPRINT("CCB: %p\n", ClientCcb);
|
||||
|
@ -256,10 +319,10 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
/*
|
||||
* Step 3. Search for listening server CCB.
|
||||
*/
|
||||
/*
|
||||
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
if (!SpecialAccess)
|
||||
{
|
||||
*/
|
||||
#endif
|
||||
/*
|
||||
* 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
|
||||
|
@ -315,7 +378,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
/* FIXME: Merge this with the NpfsFindListeningServerInstance routine. */
|
||||
NpfsSignalAndRemoveListeningServerInstance(Fcb, ServerCcb);
|
||||
}
|
||||
/*
|
||||
#ifndef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
}
|
||||
else if (IsListEmpty(&Fcb->ServerCcbListHead))
|
||||
{
|
||||
|
@ -333,7 +396,7 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
DPRINT("Cleanup the root directory!\n");
|
||||
|
@ -790,6 +862,20 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
|
|||
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)
|
||||
{
|
||||
DPRINT("Closing the root directory!\n");
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
//#define USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static DRIVER_CANCEL NpfsListeningCancelRoutine;
|
||||
|
@ -293,18 +295,21 @@ NpfsWaitPipe(PIRP Irp,
|
|||
PNPFS_CCB Ccb)
|
||||
{
|
||||
PLIST_ENTRY current_entry;
|
||||
PNPFS_VCB Vcb;
|
||||
PNPFS_FCB Fcb;
|
||||
PNPFS_CCB ServerCcb;
|
||||
PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
|
||||
LARGE_INTEGER TimeOut;
|
||||
UNICODE_STRING PipeName;
|
||||
NTSTATUS Status;
|
||||
#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
|
||||
PNPFS_VCB Vcb;
|
||||
UNICODE_STRING PipeName;
|
||||
#endif
|
||||
|
||||
DPRINT("NpfsWaitPipe\n");
|
||||
|
||||
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 */
|
||||
if (Ccb->Type != CCB_DIRECTORY)
|
||||
return STATUS_ILLEGAL_FUNCTION;
|
||||
|
@ -352,6 +357,15 @@ NpfsWaitPipe(PIRP Irp,
|
|||
}
|
||||
|
||||
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 */
|
||||
current_entry = Fcb->ServerCcbListHead.Flink;
|
||||
|
|
|
@ -85,12 +85,16 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
|
|||
Vcb->DefaultQuota = 8 * 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->Type = FCB_DIRECTORY;
|
||||
Fcb->Vcb = Vcb;
|
||||
|
||||
|
||||
|
||||
Vcb->RootFcb = Fcb;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
|
|
@ -28,6 +28,7 @@ typedef struct _NPFS_VCB
|
|||
ULONG MinQuota;
|
||||
ULONG DefaultQuota;
|
||||
ULONG MaxQuota;
|
||||
struct _NPFS_FCB *DeviceFcb;
|
||||
struct _NPFS_FCB *RootFcb;
|
||||
} 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)
|
||||
{
|
||||
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)
|
||||
|
|
|
@ -129,6 +129,15 @@ extern "C" {
|
|||
SETJMP_FLOAT128 Xmm15;
|
||||
} _JUMP_BUFFER;
|
||||
|
||||
#elif defined(_M_ARM)
|
||||
|
||||
#define _JBLEN 11
|
||||
#define _JBTYPE int
|
||||
|
||||
#else
|
||||
|
||||
#error Define Setjmp for this architecture!
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _JMP_BUF_DEFINED
|
||||
|
|
|
@ -366,20 +366,13 @@ typedef __WCHAR_TYPE__ wchar_t;
|
|||
#endif /* __sys_stdtypes_h */
|
||||
|
||||
/* A null pointer constant. */
|
||||
|
||||
#if defined (_STDDEF_H) || defined (__need_NULL)
|
||||
#undef NULL /* in case <stdio.h> has defined it. */
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else /* G++ */
|
||||
#ifndef __cplusplus
|
||||
#define NULL ((void *)0)
|
||||
#else /* C++ */
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
#endif /* C++ */
|
||||
#endif /* G++ */
|
||||
#endif /* NULL not defined and <stddef.h> or need NULL. */
|
||||
#undef __need_NULL
|
||||
#else
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef offsetof
|
||||
|
||||
|
|
|
@ -9726,7 +9726,7 @@ KeQuerySystemTime(
|
|||
OUT PLARGE_INTEGER CurrentTime);
|
||||
#endif /* !_M_AMD64 */
|
||||
|
||||
#if !defined(_X86_)
|
||||
#if !defined(_X86_) && !defined(_M_ARM)
|
||||
NTKERNELAPI
|
||||
KIRQL
|
||||
NTAPI
|
||||
|
|
|
@ -473,8 +473,13 @@ typedef struct _KIPCR
|
|||
ULONG StallScaleFactor;
|
||||
UCHAR SpareUnused;
|
||||
UCHAR Number;
|
||||
UCHAR Spare0;
|
||||
UCHAR SecondLevelCacheAssociativity;
|
||||
ULONG VdmAlert;
|
||||
ULONG KernelReserved[14];
|
||||
ULONG SecondLevelCacheSize;
|
||||
ULONG HalReserved[16];
|
||||
// arm part
|
||||
UCHAR Spare0[2];
|
||||
UCHAR IrqlMask[32];
|
||||
ULONG IrqlTable[32];
|
||||
PKINTERRUPT_ROUTINE InterruptRoutine[32];
|
||||
|
|
|
@ -68,7 +68,7 @@ typedef struct _HARDWARE_LARGE_PTE_ARMV6
|
|||
ULONG NoExecute:1;
|
||||
ULONG Domain:4;
|
||||
ULONG Ecc:1;
|
||||
ULONG Accessed:1;
|
||||
ULONG Sbo:1;
|
||||
ULONG Owner:1;
|
||||
ULONG CacheAttributes:3;
|
||||
ULONG ReadOnly:1;
|
||||
|
@ -85,7 +85,7 @@ typedef struct _HARDWARE_PTE_ARMV6
|
|||
ULONG Valid:1;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG Accessed:1;
|
||||
ULONG Sbo:1;
|
||||
ULONG Owner:1;
|
||||
ULONG CacheAttributes:3;
|
||||
ULONG ReadOnly:1;
|
||||
|
@ -100,9 +100,9 @@ C_ASSERT(sizeof(HARDWARE_PTE_ARMV6) == sizeof(ULONG));
|
|||
|
||||
typedef struct _MMPTE_SOFTWARE
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG Valid:2;
|
||||
ULONG PageFileLow:4;
|
||||
ULONG Protection:5;
|
||||
ULONG Protection:4;
|
||||
ULONG Prototype:1;
|
||||
ULONG Transition:1;
|
||||
ULONG PageFileHigh:20;
|
||||
|
@ -110,12 +110,12 @@ typedef struct _MMPTE_SOFTWARE
|
|||
|
||||
typedef struct _MMPTE_TRANSITION
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG Write:1;
|
||||
ULONG Valid:2;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG Owner:1;
|
||||
ULONG WriteThrough:1;
|
||||
ULONG CacheDisable:1;
|
||||
ULONG Protection:5;
|
||||
ULONG Protection:4;
|
||||
ULONG ReadOnly:1;
|
||||
ULONG Prototype:1;
|
||||
ULONG Transition:1;
|
||||
ULONG PageFrameNumber:20;
|
||||
|
@ -123,19 +123,18 @@ typedef struct _MMPTE_TRANSITION
|
|||
|
||||
typedef struct _MMPTE_PROTOTYPE
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG Valid:2;
|
||||
ULONG ProtoAddressLow:7;
|
||||
ULONG ReadOnly:1;
|
||||
ULONG WhichPool:1;
|
||||
ULONG Prototype:1;
|
||||
ULONG ProtoAddressHigh:21;
|
||||
} MMPTE_PROTOTYPE;
|
||||
|
||||
typedef struct _MMPTE_SUBSECTION
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG Valid:2;
|
||||
ULONG SubsectionAddressLow:4;
|
||||
ULONG Protection:5;
|
||||
ULONG Protection:4;
|
||||
ULONG Prototype:1;
|
||||
ULONG SubsectionAddressHigh:20;
|
||||
ULONG WhichPool:1;
|
||||
|
@ -143,47 +142,38 @@ typedef struct _MMPTE_SUBSECTION
|
|||
|
||||
typedef struct _MMPTE_LIST
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG Valid:2;
|
||||
ULONG OneEntry:1;
|
||||
ULONG filler0:8;
|
||||
ULONG NextEntry:20;
|
||||
ULONG Prototype:1;
|
||||
ULONG filler1:1;
|
||||
} MMPTE_LIST;
|
||||
|
||||
typedef union _MMPTE_HARDWARE
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG NoExecute:1;
|
||||
ULONG Valid:1;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG Access:1;
|
||||
ULONG Owner:1;
|
||||
ULONG CacheAttributes:3;
|
||||
ULONG ReadOnly:1;
|
||||
ULONG Shared:1;
|
||||
ULONG NonGlobal:1;
|
||||
ULONG PageFrameNumber:20;
|
||||
};
|
||||
ULONG AsUlong;
|
||||
ULONG NoExecute:1;
|
||||
ULONG Valid:1;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG Sbo:1;
|
||||
ULONG Owner:1;
|
||||
ULONG CacheAttributes:3;
|
||||
ULONG ReadOnly:1;
|
||||
ULONG Prototype:1;
|
||||
ULONG NonGlobal:1;
|
||||
ULONG PageFrameNumber:20;
|
||||
} MMPTE_HARDWARE, *PMMPTE_HARDWARE;
|
||||
|
||||
typedef union _MMPDE_HARDWARE
|
||||
{
|
||||
struct
|
||||
{
|
||||
ULONG Valid:1;
|
||||
ULONG LargePage:1;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG NoExecute:1;
|
||||
ULONG Domain:4;
|
||||
ULONG Ecc:1;
|
||||
ULONG PageFrameNumber:22;
|
||||
};
|
||||
ULONG AsUlong;
|
||||
ULONG Valid:1;
|
||||
ULONG LargePage:1;
|
||||
ULONG Buffered:1;
|
||||
ULONG Cached:1;
|
||||
ULONG NoExecute:1;
|
||||
ULONG Domain:4;
|
||||
ULONG Ecc:1;
|
||||
ULONG PageFrameNumber:22;
|
||||
} MMPDE_HARDWARE, *PMMPDE_HARDWARE;
|
||||
|
||||
typedef struct _MMPDE
|
||||
|
|
|
@ -296,13 +296,14 @@ LdrUnloadDll(
|
|||
IN PVOID BaseAddress
|
||||
);
|
||||
|
||||
typedef VOID NTAPI (*PLDR_CALLBACK)(PVOID CallbackContext, PVOID Name);
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
LdrVerifyImageMatchesChecksum(
|
||||
IN HANDLE FileHandle,
|
||||
ULONG Unknown1,
|
||||
ULONG Unknown2,
|
||||
ULONG Unknown3
|
||||
IN PLDR_CALLBACK Callback,
|
||||
IN PVOID CallbackContext,
|
||||
OUT PUSHORT ImageCharacterstics
|
||||
);
|
||||
|
||||
#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
|
||||
#if !defined(__ROS_LONG64__)
|
||||
|
@ -9,62 +21,68 @@
|
|||
#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
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4255)
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0502
|
||||
#endif
|
||||
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0400
|
||||
/*
|
||||
* If you need Win32 API features newer the Win95 and WinNT then you must
|
||||
* define WINVER before including windows.h or any other method of including
|
||||
* the windef.h header.
|
||||
*/
|
||||
#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
|
||||
#ifndef BASETYPES
|
||||
#define BASETYPES
|
||||
#ifndef __ROS_LONG64__
|
||||
typedef unsigned long ULONG;
|
||||
#else
|
||||
typedef unsigned int ULONG;
|
||||
#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
|
||||
#define MAX_PATH 260
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#ifndef _WIN64
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void*)0)
|
||||
#define NULL 0LL
|
||||
#endif /* W64 */
|
||||
#else
|
||||
#define NULL ((void *)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef _NO_W32_PSEUDO_MODIFIERS
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#endif
|
||||
|
@ -74,6 +92,307 @@ extern "C" {
|
|||
#ifndef OPTIONAL
|
||||
#define OPTIONAL
|
||||
#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 */
|
||||
#ifdef __WINESRC__
|
||||
|
@ -98,26 +417,41 @@ extern "C" {
|
|||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||
#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__
|
||||
#define PACKED __attribute__((packed))
|
||||
#ifndef _fastcall
|
||||
#define _fastcall __attribute__((fastcall))
|
||||
#endif
|
||||
#ifndef __fastcall
|
||||
#define __fastcall __attribute__((fastcall))
|
||||
#endif
|
||||
#ifndef _stdcall
|
||||
#define _stdcall __attribute__((stdcall))
|
||||
#endif
|
||||
#ifndef __stdcall
|
||||
#define __stdcall __attribute__((stdcall))
|
||||
#endif
|
||||
#ifndef _cdecl
|
||||
#define _cdecl __attribute__((cdecl))
|
||||
#endif
|
||||
#ifndef __cdecl
|
||||
#define __cdecl __attribute__((cdecl))
|
||||
#endif
|
||||
//#ifndef _fastcall
|
||||
//#define _fastcall __attribute__((fastcall))
|
||||
//#endif
|
||||
//#ifndef __fastcall
|
||||
//#define __fastcall __attribute__((fastcall))
|
||||
//#endif
|
||||
//#ifndef _stdcall
|
||||
//#define _stdcall __attribute__((stdcall))
|
||||
//#endif
|
||||
//#ifndef __stdcall
|
||||
//#define __stdcall __attribute__((stdcall))
|
||||
//#endif
|
||||
//#ifndef _cdecl
|
||||
//#define _cdecl __attribute__((cdecl))
|
||||
//#endif
|
||||
//#ifndef __cdecl
|
||||
//#define __cdecl __attribute__((cdecl))
|
||||
//#endif
|
||||
#ifndef __declspec
|
||||
#define __declspec(e) __attribute__((e))
|
||||
#endif
|
||||
|
@ -131,186 +465,9 @@ extern "C" {
|
|||
#define _cdecl
|
||||
#define __cdecl
|
||||
#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
|
||||
|
||||
#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
|
||||
#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;
|
||||
|
||||
#if 1 // needed by shlwapi.h
|
||||
#ifndef __ms_va_list
|
||||
# if defined(__x86_64__) && defined (__GNUC__)
|
||||
# define __ms_va_list __builtin_ms_va_list
|
||||
|
@ -322,115 +479,7 @@ typedef void *LPVOID;
|
|||
# define __ms_va_end(list) va_end(list)
|
||||
# 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
|
||||
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
|
||||
#pragma warning(pop)
|
||||
|
@ -439,4 +488,6 @@ typedef struct tagPOINTS {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _WINDEF_ */
|
||||
|
||||
|
|
|
@ -11,6 +11,62 @@
|
|||
#include <msvctarget.h>
|
||||
#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
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
|
||||
# define DECLSPEC_ALIGN(x) __declspec(align(x))
|
||||
|
@ -5209,12 +5265,24 @@ MemoryBarrier(VOID)
|
|||
#endif
|
||||
|
||||
#if defined(_M_IX86)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma intrinsic(__int2c)
|
||||
#pragma intrinsic(_mm_pause)
|
||||
#define YieldProcessor _mm_pause
|
||||
#else
|
||||
#define YieldProcessor() __asm__ __volatile__("pause");
|
||||
#define __int2c() __asm__ __volatile__("int $0x2c");
|
||||
#endif
|
||||
|
||||
|
||||
FORCEINLINE
|
||||
VOID
|
||||
DbgRaiseAssertionFailure(VOID)
|
||||
{
|
||||
__int2c();
|
||||
}
|
||||
|
||||
#elif defined (_M_AMD64)
|
||||
#ifdef _MSC_VER
|
||||
#pragma intrinsic(_mm_pause)
|
||||
|
|
|
@ -173,6 +173,12 @@ typedef struct _KPCR
|
|||
ULONG StallScaleFactor;
|
||||
UCHAR SpareUnused;
|
||||
UCHAR Number;
|
||||
UCHAR Spare0;
|
||||
UCHAR SecondLevelCacheAssociativity;
|
||||
ULONG VdmAlert;
|
||||
ULONG KernelReserved[14];
|
||||
ULONG SecondLevelCacheSize;
|
||||
ULONG HalReserved[16];
|
||||
} KPCR, *PKPCR;
|
||||
|
||||
//
|
||||
|
@ -246,6 +252,35 @@ KeRaiseIrqlToDpcLevel(
|
|||
#define KeLowerIrql(NewIrql) KfLowerIrql(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
|
||||
//
|
||||
|
@ -258,6 +293,26 @@ VOID
|
|||
HalSweepIcache(
|
||||
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
|
||||
|
||||
//
|
||||
|
|
|
@ -83,7 +83,7 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGIST
|
|||
#else
|
||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||
frame->Prev = teb->ExceptionList;
|
||||
teb->ExceptionList = frame;
|
||||
teb->ExceptionList = (PVOID)frame;
|
||||
return frame->Prev;
|
||||
#endif
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTR
|
|||
#else
|
||||
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
|
||||
frame->Prev = teb->ExceptionList;
|
||||
teb->ExceptionList = frame;
|
||||
teb->ExceptionList = (PVOID)frame;
|
||||
return frame->Prev;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -67,6 +67,6 @@ void _assert(const char *exp, const char *file, unsigned line)
|
|||
/* Does the user want to debug? */
|
||||
if (iResult == IDRETRY)
|
||||
{
|
||||
__debugbreak();
|
||||
DbgRaiseAssertionFailure();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ FsRtlDissectDbcs(IN ANSI_STRING Name,
|
|||
{
|
||||
ULONG FirstPosition, i;
|
||||
ULONG SkipFirstSlash = 0;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Zero the strings before continuing */
|
||||
RtlZeroMemory(FirstPart, sizeof(ANSI_STRING));
|
||||
|
@ -116,6 +117,7 @@ NTAPI
|
|||
FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
||||
{
|
||||
ULONG i;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Check every character */
|
||||
for (i = 0; i < Name->Length; i++)
|
||||
|
@ -138,7 +140,7 @@ FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name)
|
|||
|
||||
/*++
|
||||
* @name FsRtlIsDbcsInExpression
|
||||
* @implemented
|
||||
* @halfplemented
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @remarks None
|
||||
* @remarks Implementation should be fixed to handle wildcards
|
||||
*
|
||||
*--*/
|
||||
BOOLEAN
|
||||
|
@ -159,7 +161,10 @@ FsRtlIsDbcsInExpression(IN PANSI_STRING Expression,
|
|||
IN PANSI_STRING Name)
|
||||
{
|
||||
ULONG ExpressionPosition, NamePosition, MatchingChars = 0;
|
||||
PAGED_CODE();
|
||||
|
||||
ASSERT(Name->Length);
|
||||
ASSERT(Expression->Length);
|
||||
ASSERT(!FsRtlDoesDbcsContainWildCards(Name));
|
||||
|
||||
/* One can't be null, both can be */
|
||||
|
@ -242,6 +247,7 @@ FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName,
|
|||
ANSI_STRING FirstPart, RemainingPart, Name;
|
||||
BOOLEAN LastDot;
|
||||
ULONG i;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Just quit if the string is empty */
|
||||
if (!DbcsName.Length)
|
||||
|
@ -378,6 +384,7 @@ FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName,
|
|||
{
|
||||
ANSI_STRING FirstPart, RemainingPart, Name;
|
||||
ULONG i;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Just quit if the string is empty */
|
||||
if (!DbcsName.Length)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: ntoskrnl/fsrtl/filtrctx.c
|
||||
* PURPOSE: File Stream Filter Context support for File System Drivers
|
||||
* PROGRAMMERS: None.
|
||||
* PROGRAMMERS: Pierre Schweitzer (pierre.schweitzer@reactos.org)
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
@ -12,11 +12,42 @@
|
|||
#define NDEBUG
|
||||
#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 **********************************************************/
|
||||
|
||||
/*++
|
||||
* @name FsRtlIsPagingFile
|
||||
* @implemented NT 4.0
|
||||
* @implemented NT 5.2
|
||||
*
|
||||
* The FsRtlIsPagingFile routine checks if the FileObject is a Paging File.
|
||||
*
|
||||
|
@ -32,25 +63,11 @@ LOGICAL
|
|||
NTAPI
|
||||
FsRtlIsPagingFile(IN PFILE_OBJECT FileObject)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return FALSE;
|
||||
return MmIsFileObjectAPagingFile(FileObject);
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
*/
|
||||
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
|
||||
* @implemented
|
||||
*/
|
||||
PFSRTL_PER_FILEOBJECT_CONTEXT
|
||||
NTAPI
|
||||
|
@ -58,67 +75,335 @@ FsRtlLookupPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
|||
IN PVOID OwnerId OPTIONAL,
|
||||
IN PVOID InstanceId OPTIONAL)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return FALSE;
|
||||
PLIST_ENTRY NextEntry;
|
||||
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
|
||||
*/
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
FsRtlInsertPerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER PerStreamContext,
|
||||
IN PFSRTL_PER_STREAM_CONTEXT Ptr)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
PFSRTL_PER_STREAM_CONTEXT
|
||||
NTAPI
|
||||
FsRtlRemovePerStreamContext(IN PFSRTL_ADVANCED_FCB_HEADER StreamContext,
|
||||
IN PVOID OwnerId OPTIONAL,
|
||||
IN PVOID InstanceId OPTIONAL)
|
||||
FsRtlLookupPerStreamContextInternal(IN PFSRTL_ADVANCED_FCB_HEADER AdvFcbHeader,
|
||||
IN PVOID OwnerId OPTIONAL,
|
||||
IN PVOID InstanceId OPTIONAL)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return NULL;
|
||||
PLIST_ENTRY NextEntry;
|
||||
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
|
||||
NTAPI
|
||||
FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||
IN PFSRTL_PER_FILEOBJECT_CONTEXT Ptr)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
PFILE_OBJECT_FILTER_CONTEXTS FOContext = NULL;
|
||||
|
||||
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
|
||||
NTAPI
|
||||
FsRtlRemovePerFileObjectContext(IN PFILE_OBJECT PerFileObjectContext,
|
||||
FsRtlRemovePerFileObjectContext(IN PFILE_OBJECT FileObject,
|
||||
IN PVOID OwnerId OPTIONAL,
|
||||
IN PVOID InstanceId OPTIONAL)
|
||||
{
|
||||
KeBugCheck(FILE_SYSTEM);
|
||||
return NULL;
|
||||
PLIST_ENTRY NextEntry;
|
||||
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
|
||||
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)
|
||||
{
|
||||
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))
|
||||
{
|
||||
|
@ -119,6 +120,7 @@ FsRtlAreNamesEqual(IN PCUNICODE_STRING Name1,
|
|||
BOOLEAN StringsAreEqual, MemoryAllocated = FALSE;
|
||||
ULONG i;
|
||||
NTSTATUS Status;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Well, first check their size */
|
||||
if (Name1->Length != Name2->Length) return FALSE;
|
||||
|
@ -210,6 +212,7 @@ FsRtlDissectName(IN UNICODE_STRING Name,
|
|||
{
|
||||
ULONG FirstPosition, i;
|
||||
ULONG SkipFirstSlash = 0;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Zero the strings before continuing */
|
||||
RtlZeroMemory(FirstPart, sizeof(UNICODE_STRING));
|
||||
|
@ -272,6 +275,7 @@ NTAPI
|
|||
FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
|
||||
{
|
||||
PWCHAR Ptr;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Loop through every character */
|
||||
if (Name->Length)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
.macro TEXTAREA
|
||||
.section text, "rx"
|
||||
.section .text, "rx"
|
||||
.align 2
|
||||
.endm
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#define _MI_PAGING_LEVELS 2
|
||||
|
||||
#define PDE_SHIFT 20
|
||||
|
||||
//
|
||||
|
@ -20,6 +22,7 @@
|
|||
#define PTE_BASE 0xC0000000
|
||||
#define PTE_TOP 0xC03FFFFF
|
||||
#define PDE_BASE 0xC0400000
|
||||
#define PDE_TOP 0xC04FFFFF
|
||||
#define HYPER_SPACE 0xC0500000
|
||||
|
||||
#if 0
|
||||
|
@ -106,6 +109,7 @@ PULONG MmGetPageDirectory(VOID);
|
|||
|
||||
#define MI_MAKE_LOCAL_PAGE(x) ((x)->u.Hard.NonGlobal = 1)
|
||||
#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_WRITE_PAGE(x) ((x)->u.Hard.ReadOnly = 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_COPY_ON_WRITE(x)FALSE
|
||||
#define MI_IS_PAGE_DIRTY(x) TRUE
|
||||
#define MI_IS_PAGE_LARGE(x) FALSE
|
||||
|
||||
/* Easy accessing PFN in PTE */
|
||||
#define PFN_FROM_PTE(v) ((v)->u.Hard.PageFrameNumber)
|
||||
|
@ -129,6 +134,12 @@ PULONG MmGetPageDirectory(VOID);
|
|||
MI_HYPERSPACE_PTES * PAGE_SIZE)
|
||||
#define MI_ZERO_PTE (PMMPTE)(MI_MAPPING_RANGE_END + \
|
||||
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 */
|
||||
#define MiGetPdeAddress(x) ((PMMPDE)(PDE_BASE + (((ULONG)(x) >> 20) << 2)))
|
||||
|
@ -139,8 +150,10 @@ PULONG MmGetPageDirectory(VOID);
|
|||
#define MiAddressToPte(x) MiGetPteAddress(x)
|
||||
|
||||
/* 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 */
|
||||
#define MiPteToAddress(x) ((PVOID)((ULONG)(x) << 10))
|
||||
#define MiPdeToAddress(x) ((PVOID)((ULONG)(x) << 18))
|
||||
|
|
|
@ -53,6 +53,15 @@ FsRtlInitSystem(
|
|||
VOID
|
||||
);
|
||||
|
||||
//
|
||||
// File contexts Routines
|
||||
//
|
||||
VOID
|
||||
NTAPI
|
||||
FsRtlPTeardownPerFileObjectContexts(
|
||||
IN PFILE_OBJECT FileObject
|
||||
);
|
||||
|
||||
//
|
||||
// Global data inside the File System Runtime Library
|
||||
//
|
||||
|
|
|
@ -39,6 +39,7 @@ PULONG MmGetPageDirectory(VOID);
|
|||
// Convert a PTE into a corresponding address
|
||||
//
|
||||
#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_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_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_WRITE_THROUGH(x) ((x)->u.Hard.WriteThrough = 1)
|
||||
#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)
|
||||
#define MI_IS_PAGE_WRITEABLE(x) ((x)->u.Hard.Write == 1)
|
||||
#else
|
||||
|
@ -83,13 +86,13 @@ PULONG MmGetPageDirectory(VOID);
|
|||
#define MI_ZERO_PTES (32)
|
||||
#define MI_MAPPING_RANGE_START (ULONG)HYPER_SPACE
|
||||
#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 + \
|
||||
PAGE_SIZE)
|
||||
PAGE_SIZE)
|
||||
#define MI_VAD_BITMAP (PMMPTE)(MI_DUMMY_PTE + \
|
||||
PAGE_SIZE)
|
||||
PAGE_SIZE)
|
||||
#define MI_WORKING_SET_LIST (PMMPTE)(MI_VAD_BITMAP + \
|
||||
PAGE_SIZE)
|
||||
PAGE_SIZE)
|
||||
|
||||
/* On x86, these two are the same */
|
||||
#define MMPDE MMPTE
|
||||
|
|
|
@ -1155,6 +1155,20 @@ IopCloseFile(
|
|||
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
|
||||
//
|
||||
|
|
|
@ -486,7 +486,7 @@ typedef struct _MM_PAGED_POOL_INFO
|
|||
PRTL_BITMAP EndOfPagedPoolBitmap;
|
||||
PMMPTE FirstPteForPagedPool;
|
||||
PMMPTE LastPteForPagedPool;
|
||||
PMMPTE NextPdeForPagedPoolExpansion;
|
||||
PMMPDE NextPdeForPagedPoolExpansion;
|
||||
ULONG PagedPoolHint;
|
||||
SIZE_T PagedPoolCommit;
|
||||
SIZE_T AllocatedPagedPool;
|
||||
|
@ -778,6 +778,10 @@ VOID
|
|||
NTAPI
|
||||
MmInitPagingFile(VOID);
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmReadFromSwapPage(
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
|
||||
#ifdef __GNUC__
|
||||
#define INIT_FUNCTION PLACE_IN_SECTION("INIT")
|
||||
#define INIT_FUNCTION
|
||||
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
|
||||
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
|
||||
#else
|
||||
|
|
|
@ -63,7 +63,11 @@ IoCreateController(IN ULONG Size)
|
|||
PAGED_CODE();
|
||||
|
||||
/* Initialize an empty OBA */
|
||||
InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL);
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
NULL,
|
||||
OBJ_KERNEL_HANDLE,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* Create the Object */
|
||||
Status = ObCreateObject(KernelMode,
|
||||
|
@ -87,7 +91,7 @@ IoCreateController(IN ULONG Size)
|
|||
if (!NT_SUCCESS(Status)) return NULL;
|
||||
|
||||
/* Close the dummy handle */
|
||||
NtClose(Handle);
|
||||
ObCloseHandle(Handle, KernelMode);
|
||||
|
||||
/* Zero the Object and set its data */
|
||||
RtlZeroMemory(Controller, sizeof(CONTROLLER_OBJECT) + Size);
|
||||
|
|
|
@ -1049,6 +1049,13 @@ IopDeleteFile(IN PVOID ObjectBody)
|
|||
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 */
|
||||
if (!DereferenceDone)
|
||||
{
|
||||
|
@ -1610,6 +1617,36 @@ IopQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|||
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 *****************************************************************/
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,7 +15,10 @@
|
|||
PROLOG_END KiSystemStartup
|
||||
|
||||
/* 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]
|
||||
|
||||
/* Repeat for IRQ mode */
|
||||
|
|
|
@ -57,6 +57,15 @@ KeFlushCurrentTb(VOID)
|
|||
KeFlushTb();
|
||||
}
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KeZeroPages(IN PVOID Address,
|
||||
IN ULONG Size)
|
||||
{
|
||||
/* Not using XMMI in this routine */
|
||||
RtlZeroMemory(Address, Size);
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KiSaveProcessorControlState(OUT PKPROCESSOR_STATE ProcessorState)
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
TEXTAREA
|
||||
NESTED_ENTRY KiSwapContext
|
||||
PROLOG_END KiSwapContext
|
||||
|
||||
// BUSTEDDDD
|
||||
b .
|
||||
|
||||
//
|
||||
// a1 = Old Thread
|
||||
// a2 = New Thread
|
||||
|
@ -104,3 +108,19 @@
|
|||
b .
|
||||
|
||||
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 ********************************************************************/
|
||||
|
||||
typedef struct _KSWITCHFRAME
|
||||
{
|
||||
PVOID ExceptionList;
|
||||
BOOLEAN ApcBypassDisable;
|
||||
PVOID RetAddr;
|
||||
} KSWITCHFRAME, *PKSWITCHFRAME;
|
||||
|
||||
typedef struct _KUINIT_FRAME
|
||||
{
|
||||
KEXCEPTION_FRAME CtxSwitchFrame;
|
||||
|
@ -32,6 +39,15 @@ VOID
|
|||
NTAPI
|
||||
KiThreadStartup(VOID);
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KiSwitchThreads(
|
||||
IN PKTHREAD OldThread,
|
||||
IN PKTHREAD NewThread
|
||||
);
|
||||
|
||||
|
||||
/* FIXME: THIS IS TOTALLY BUSTED NOW */
|
||||
VOID
|
||||
NTAPI
|
||||
KiInitializeContextThread(IN PKTHREAD Thread,
|
||||
|
@ -131,3 +147,217 @@ KiInitializeContextThread(IN PKTHREAD Thread,
|
|||
//
|
||||
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 ******************************************************************/
|
||||
|
||||
#if 0
|
||||
VOID
|
||||
KiIdleLoop(VOID)
|
||||
{
|
||||
|
@ -89,6 +90,7 @@ KiIdleLoop(VOID)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -116,6 +118,7 @@ KiSwapProcess(IN PKPROCESS NewProcess,
|
|||
while (TRUE);
|
||||
}
|
||||
|
||||
#if 0
|
||||
BOOLEAN
|
||||
KiSwapContextInternal(IN PKTHREAD OldThread,
|
||||
IN PKTHREAD NewThread)
|
||||
|
@ -220,6 +223,7 @@ KiSwapContextInternal(IN PKTHREAD OldThread,
|
|||
//
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
VOID
|
||||
KiApcInterrupt(VOID)
|
||||
|
@ -262,6 +266,7 @@ KiApcInterrupt(VOID)
|
|||
KiDeliverApc(PreviousMode, &ExceptionFrame, TrapFrame);
|
||||
}
|
||||
|
||||
#if 0
|
||||
VOID
|
||||
KiDispatchInterrupt(VOID)
|
||||
{
|
||||
|
@ -343,6 +348,7 @@ KiDispatchInterrupt(VOID)
|
|||
KiSwapContext(OldThread, NewThread);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
VOID
|
||||
KiInterruptHandler(IN PKTRAP_FRAME TrapFrame,
|
||||
|
@ -523,7 +529,7 @@ KiDataAbortHandler(IN PKTRAP_FRAME TrapFrame)
|
|||
Address,
|
||||
KiGetPreviousMode(TrapFrame),
|
||||
TrapFrame);
|
||||
if (Status == STATUS_SUCCESS) return Status;
|
||||
if (NT_SUCCESS(Status)) return Status;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -24,10 +24,7 @@ ULONG MmMaximumNonPagedPoolInBytes;
|
|||
PVOID MmNonPagedSystemStart;
|
||||
PVOID MmNonPagedPoolStart;
|
||||
PVOID MmNonPagedPoolExpansionStart;
|
||||
PVOID MmNonPagedPoolEnd = MI_NONPAGED_POOL_END;
|
||||
PVOID MmPagedPoolStart = MI_PAGED_POOL_START;
|
||||
PVOID MmPagedPoolEnd;
|
||||
ULONG MmSizeOfPagedPoolInBytes = MI_MIN_INIT_PAGED_POOLSIZE;
|
||||
PVOID MiSessionSpaceEnd;
|
||||
PVOID MiSessionImageEnd;
|
||||
PVOID MiSessionImageStart;
|
||||
|
@ -42,14 +39,14 @@ ULONG MmSessionImageSize;
|
|||
PVOID MiSystemViewStart;
|
||||
ULONG MmSystemViewSize;
|
||||
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
||||
PMMPTE MmSystemPagePtes;
|
||||
PMMPDE MmSystemPagePtes;
|
||||
ULONG MmNumberOfSystemPtes;
|
||||
ULONG MxPfnAllocation;
|
||||
RTL_BITMAP MiPfnBitMap;
|
||||
PPHYSICAL_MEMORY_DESCRIPTOR MmPhysicalMemoryBlock;
|
||||
PMEMORY_ALLOCATION_DESCRIPTOR MxFreeDescriptor;
|
||||
MEMORY_ALLOCATION_DESCRIPTOR MxOldFreeDescriptor;
|
||||
ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage, MmLowestPhysicalPage = -1;
|
||||
ULONG MmNumberOfPhysicalPages, MmHighestPhysicalPage;
|
||||
ULONG MmBootImageSize;
|
||||
ULONG MmUserProbeAddress;
|
||||
PVOID MmHighestUserAddress;
|
||||
|
@ -63,8 +60,8 @@ PVOID MmHyperSpaceEnd;
|
|||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MmArmInitSystem(IN ULONG Phase,
|
||||
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
INIT_FUNCTION
|
||||
MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
||||
{
|
||||
//
|
||||
// Always return success for now
|
||||
|
|
|
@ -271,7 +271,7 @@ MmFreePagesFromMdl(IN PMDL Mdl)
|
|||
//
|
||||
Pfn1->u3.e1.StartOfAllocation = 0;
|
||||
Pfn1->u3.e1.EndOfAllocation = 0;
|
||||
Pfn1->u2.ShareCount == 0;
|
||||
Pfn1->u2.ShareCount = 0;
|
||||
|
||||
//
|
||||
// Dereference it
|
||||
|
|
|
@ -130,12 +130,12 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE);
|
|||
//
|
||||
// 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_READ 0 // Not worrying about NX yet
|
||||
#define PTE_READWRITE 0x2
|
||||
#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_PROTOTYPE 0x400
|
||||
|
||||
|
@ -153,6 +153,20 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE);
|
|||
#define PTE_DISABLE_CACHE 0x10
|
||||
#define PTE_WRITECOMBINED_CACHE 0x10
|
||||
#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
|
||||
#error Define these please!
|
||||
#endif
|
||||
|
@ -187,7 +201,7 @@ extern const ULONG MmProtectToValue[32];
|
|||
#ifdef _M_IX86
|
||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
||||
#elif _M_ARM
|
||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 6
|
||||
#elif _M_AMD64
|
||||
#define MM_PTE_SOFTWARE_PROTECTION_BITS 5
|
||||
#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_PROCESS_COLOR(x) (MI_GET_PAGE_COLOR(++(x)->NextPageColor))
|
||||
|
||||
#ifdef _M_IX86
|
||||
#ifndef _M_AMD64
|
||||
//
|
||||
// Decodes a Prototype PTE into the underlying PTE
|
||||
//
|
||||
|
@ -470,7 +484,7 @@ extern PMMPTE MiSessionImagePteEnd;
|
|||
extern PMMPTE MiSessionBasePte;
|
||||
extern PMMPTE MiSessionLastPte;
|
||||
extern SIZE_T MmSizeOfPagedPoolInBytes;
|
||||
extern PMMPTE MmSystemPagePtes;
|
||||
extern PMMPDE MmSystemPagePtes;
|
||||
extern PVOID MmSystemCacheStart;
|
||||
extern PVOID MmSystemCacheEnd;
|
||||
extern MMSUPPORT MmSystemCacheWs;
|
||||
|
@ -528,7 +542,7 @@ extern PMMWSL MmWorkingSetList;
|
|||
//
|
||||
ULONG
|
||||
FORCEINLINE
|
||||
MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
|
||||
MiDetermineUserGlobalPteMask(IN PVOID PointerPte)
|
||||
{
|
||||
MMPTE TempPte;
|
||||
|
||||
|
@ -537,14 +551,15 @@ MiDetermineUserGlobalPteMask(IN PMMPTE PointerPte)
|
|||
|
||||
/* Make it valid and accessed */
|
||||
TempPte.u.Hard.Valid = TRUE;
|
||||
TempPte.u.Hard.Accessed = TRUE;
|
||||
MI_MAKE_ACCESSED_PAGE(&TempPte);
|
||||
|
||||
/* Is this for user-mode? */
|
||||
if ((PointerPte <= MiHighestUserPte) ||
|
||||
((PointerPte >= MiAddressToPde(NULL)) && (PointerPte <= MiHighestUserPde)))
|
||||
if ((PointerPte <= (PVOID)MiHighestUserPte) ||
|
||||
((PointerPte >= (PVOID)MiAddressToPde(NULL)) &&
|
||||
(PointerPte <= (PVOID)MiHighestUserPde)))
|
||||
{
|
||||
/* Set the owner bit */
|
||||
TempPte.u.Hard.Owner = TRUE;
|
||||
MI_MAKE_OWNER_PAGE(&TempPte);
|
||||
}
|
||||
|
||||
/* 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];
|
||||
}
|
||||
|
||||
#ifdef _M_IX86
|
||||
#ifndef _M_AMD64
|
||||
//
|
||||
// Builds a Prototype PTE for the address of the PTE
|
||||
//
|
||||
|
@ -684,6 +699,33 @@ MI_WRITE_INVALID_PTE(IN PMMPTE PointerPte,
|
|||
*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
|
||||
//
|
||||
|
|
|
@ -161,7 +161,7 @@ SIZE_T MmSystemViewSize;
|
|||
// address.
|
||||
//
|
||||
PFN_NUMBER MmSystemPageDirectory[PD_COUNT];
|
||||
PMMPTE MmSystemPagePtes;
|
||||
PMMPDE MmSystemPagePtes;
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -679,7 +679,7 @@ MiBuildPfnDatabaseFromPages(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
/* Yes we do, set it up */
|
||||
Pfn1 = MiGetPfnEntry(PageFrameIndex);
|
||||
Pfn1->u4.PteFrame = StartupPdIndex;
|
||||
Pfn1->PteAddress = PointerPde;
|
||||
Pfn1->PteAddress = (PMMPTE)PointerPde;
|
||||
Pfn1->u2.ShareCount++;
|
||||
Pfn1->u3.e2.ReferenceCount = 1;
|
||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||
|
@ -771,7 +771,7 @@ MiBuildPfnDatabaseZeroPage(VOID)
|
|||
/* Make it a bogus page to catch errors */
|
||||
PointerPde = MiAddressToPde(0xFFFFFFFF);
|
||||
Pfn1->u4.PteFrame = PFN_FROM_PTE(PointerPde);
|
||||
Pfn1->PteAddress = PointerPde;
|
||||
Pfn1->PteAddress = (PMMPTE)PointerPde;
|
||||
Pfn1->u2.ShareCount++;
|
||||
Pfn1->u3.e2.ReferenceCount = 0xFFF0;
|
||||
Pfn1->u3.e1.PageLocation = ActiveAndValid;
|
||||
|
@ -1192,7 +1192,7 @@ INIT_FUNCTION
|
|||
MiAddHalIoMappings(VOID)
|
||||
{
|
||||
PVOID BaseAddress;
|
||||
PMMPTE PointerPde;
|
||||
PMMPDE PointerPde;
|
||||
PMMPTE PointerPte;
|
||||
ULONG i, j, PdeCount;
|
||||
PFN_NUMBER PageFrameIndex;
|
||||
|
@ -1203,12 +1203,12 @@ MiAddHalIoMappings(VOID)
|
|||
|
||||
/* Check how many PDEs the heap has */
|
||||
PointerPde = MiAddressToPde(BaseAddress);
|
||||
PdeCount = PDE_COUNT - ADDR_TO_PDE_OFFSET(BaseAddress);
|
||||
PdeCount = PDE_COUNT - MiGetPdeOffset(BaseAddress);
|
||||
for (i = 0; i < PdeCount; i++)
|
||||
{
|
||||
/* Does the HAL own this mapping? */
|
||||
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 */
|
||||
PointerPte = MiAddressToPte(BaseAddress);
|
||||
|
@ -1556,8 +1556,10 @@ NTAPI
|
|||
INIT_FUNCTION
|
||||
MiBuildPagedPool(VOID)
|
||||
{
|
||||
PMMPTE PointerPte, PointerPde;
|
||||
PMMPTE PointerPte;
|
||||
PMMPDE PointerPde;
|
||||
MMPTE TempPte = ValidKernelPte;
|
||||
MMPDE TempPde = ValidKernelPde;
|
||||
PFN_NUMBER PageFrameIndex;
|
||||
KIRQL OldIrql;
|
||||
ULONG Size, BitMapSize;
|
||||
|
@ -1648,7 +1650,7 @@ MiBuildPagedPool(VOID)
|
|||
#endif
|
||||
|
||||
RtlZeroMemory(PointerPde,
|
||||
(1 + MiAddressToPde(MmPagedPoolEnd) - PointerPde) * sizeof(MMPTE));
|
||||
(1 + MiAddressToPde(MmPagedPoolEnd) - PointerPde) * sizeof(MMPDE));
|
||||
|
||||
//
|
||||
// Next, get the first and last PTE
|
||||
|
@ -1666,8 +1668,8 @@ MiBuildPagedPool(VOID)
|
|||
MI_SET_USAGE(MI_USAGE_PAGED_POOL);
|
||||
MI_SET_PROCESS2("Kernel");
|
||||
PageFrameIndex = MiRemoveZeroPage(0);
|
||||
TempPte.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
MI_WRITE_VALID_PTE(PointerPde, TempPte);
|
||||
TempPde.u.Hard.PageFrameNumber = PageFrameIndex;
|
||||
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||
#if (_MI_PAGING_LEVELS >= 3)
|
||||
/* Use the PPE of MmPagedPoolStart that was setup above */
|
||||
// Bla = PFN_FROM_PTE(PpeAddress(MmPagedPool...));
|
||||
|
@ -1678,8 +1680,8 @@ MiBuildPagedPool(VOID)
|
|||
|
||||
/* Initialize the PFN entry for it */
|
||||
MiInitializePfnForOtherProcess(PageFrameIndex,
|
||||
PointerPde,
|
||||
MmSystemPageDirectory[(PointerPde - (PMMPTE)PDE_BASE) / PDE_COUNT]);
|
||||
(PMMPTE)PointerPde,
|
||||
MmSystemPageDirectory[(PointerPde - (PMMPDE)PDE_BASE) / PDE_COUNT]);
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
@ -325,7 +325,7 @@ MiResolveDemandZeroFault(IN PVOID Address,
|
|||
}
|
||||
|
||||
/* 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 */
|
||||
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
||||
|
@ -899,7 +899,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
ASSERT(ProtectionCode != MM_NOACCESS);
|
||||
|
||||
/* 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 */
|
||||
#if MI_TRACE_PFNS
|
||||
|
@ -907,7 +907,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
#endif
|
||||
Status = MiDispatchFault(TRUE,
|
||||
PointerPte,
|
||||
PointerPde,
|
||||
(PMMPTE)PointerPde,
|
||||
NULL,
|
||||
FALSE,
|
||||
PsGetCurrentProcess(),
|
||||
|
@ -1058,7 +1058,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
|
|||
}
|
||||
|
||||
/* 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 */
|
||||
MI_WRITE_VALID_PTE(PointerPte, TempPte);
|
||||
|
|
|
@ -375,7 +375,7 @@ NTAPI
|
|||
MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
||||
IN SIZE_T SizeInBytes)
|
||||
{
|
||||
PFN_NUMBER SizeInPages, PageFrameNumber;
|
||||
PFN_NUMBER SizeInPages, PageFrameNumber, PageTableCount;
|
||||
ULONG i;
|
||||
KIRQL OldIrql;
|
||||
PLIST_ENTRY NextEntry, NextHead, LastHead;
|
||||
|
@ -422,7 +422,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
|||
// Check if there is enougn paged pool expansion space left
|
||||
//
|
||||
if (MmPagedPoolInfo.NextPdeForPagedPoolExpansion >
|
||||
MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||
{
|
||||
//
|
||||
// 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
|
||||
//
|
||||
if (((i - 1) + MmPagedPoolInfo.NextPdeForPagedPoolExpansion) >
|
||||
MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool))
|
||||
{
|
||||
//
|
||||
// We can only support this much then
|
||||
//
|
||||
SizeInPages = MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool) -
|
||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion +
|
||||
1;
|
||||
ASSERT(SizeInPages < i);
|
||||
i = SizeInPages;
|
||||
PageTableCount = (PMMPDE)MiAddressToPte(MmPagedPoolInfo.LastPteForPagedPool) -
|
||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion +
|
||||
1;
|
||||
ASSERT(PageTableCount < i);
|
||||
i = PageTableCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// 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
|
||||
//
|
||||
PointerPde = MmPagedPoolInfo.NextPdeForPagedPoolExpansion;
|
||||
BaseVa = MiPteToAddress(PointerPde);
|
||||
BaseVa = MiPdeToAddress(PointerPde);
|
||||
BaseVaStart = BaseVa;
|
||||
|
||||
//
|
||||
|
@ -494,11 +494,11 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType,
|
|||
|
||||
/* Initialize the PFN */
|
||||
MiInitializePfnForOtherProcess(PageFrameNumber,
|
||||
PointerPde,
|
||||
(PMMPTE)PointerPde,
|
||||
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
||||
|
||||
/* Write the actual PDE now */
|
||||
MI_WRITE_VALID_PTE(PointerPde, TempPde);
|
||||
MI_WRITE_VALID_PDE(PointerPde, TempPde);
|
||||
#endif
|
||||
//
|
||||
// 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
|
||||
//
|
||||
EndAllocation = (MmPagedPoolInfo.NextPdeForPagedPoolExpansion -
|
||||
MiAddressToPte(MmPagedPoolInfo.FirstPteForPagedPool)) *
|
||||
(PMMPDE)MiAddressToPte(MmPagedPoolInfo.FirstPteForPagedPool)) *
|
||||
PTE_COUNT;
|
||||
RtlClearBits(MmPagedPoolInfo.PagedPoolAllocationMap,
|
||||
EndAllocation,
|
||||
SizeInPages * PTE_COUNT);
|
||||
PageTableCount * PTE_COUNT);
|
||||
|
||||
//
|
||||
// Update the next expansion location
|
||||
//
|
||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion += SizeInPages;
|
||||
MmPagedPoolInfo.NextPdeForPagedPoolExpansion += PageTableCount;
|
||||
|
||||
//
|
||||
// Zero out the newly available memory
|
||||
//
|
||||
RtlZeroMemory(BaseVaStart, SizeInPages * PAGE_SIZE);
|
||||
RtlZeroMemory(BaseVaStart, PageTableCount * PAGE_SIZE);
|
||||
|
||||
//
|
||||
// Now try consuming the pages again
|
||||
//
|
||||
SizeInPages = BYTES_TO_PAGES(SizeInBytes);
|
||||
i = RtlFindClearBitsAndSet(MmPagedPoolInfo.PagedPoolAllocationMap,
|
||||
SizeInPages,
|
||||
0);
|
||||
|
|
|
@ -971,7 +971,7 @@ MmInitializeProcessAddressSpace(IN PEPROCESS Process,
|
|||
/* Do the same for hyperspace */
|
||||
PointerPde = MiAddressToPde(HYPER_SPACE);
|
||||
PageFrameNumber = PFN_FROM_PTE(PointerPde);
|
||||
MiInitializePfn(PageFrameNumber, PointerPde, TRUE);
|
||||
MiInitializePfn(PageFrameNumber, (PMMPTE)PointerPde, TRUE);
|
||||
|
||||
/* Setup the PFN for the PTE for the working set */
|
||||
PointerPte = MiAddressToPte(MI_WORKING_SET_LIST);
|
||||
|
@ -1195,7 +1195,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
|||
HyperIndex);
|
||||
|
||||
/* Set it dirty and map it */
|
||||
PdePte.u.Hard.Dirty = TRUE;
|
||||
MI_MAKE_DIRTY_PAGE(&PdePte);
|
||||
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
||||
|
||||
/* Now get hyperspace's page table */
|
||||
|
@ -1228,7 +1228,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
|||
PdeIndex);
|
||||
|
||||
/* Set it dirty and map it */
|
||||
PdePte.u.Hard.Dirty = TRUE;
|
||||
MI_MAKE_DIRTY_PAGE(&PdePte);
|
||||
MI_WRITE_VALID_PTE(PointerPte, PdePte);
|
||||
|
||||
/* 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 */
|
||||
MiInitializePfnForOtherProcess(PageFrameIndex,
|
||||
PointerPde,
|
||||
(PMMPTE)PointerPde,
|
||||
MmSystemPageDirectory[(PointerPde - MiAddressToPde(NULL)) / PDE_COUNT]);
|
||||
|
||||
/* 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 */
|
||||
if (PointerPde->u.Hard.Valid == 0)
|
||||
{
|
||||
/* 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);
|
||||
|
||||
/* Actual valid, legitimate, pages */
|
||||
if (ValidPages) *ValidPages++;
|
||||
if (ValidPages) (*ValidPages)++;
|
||||
|
||||
/* Get the page table entry */
|
||||
PageTableIndex = Pfn1->u4.PteFrame;
|
||||
|
@ -305,7 +305,8 @@ MiDeleteVirtualAddresses(IN ULONG_PTR Va,
|
|||
IN ULONG_PTR EndingAddress,
|
||||
IN PMMVAD Vad)
|
||||
{
|
||||
PMMPTE PointerPte, PointerPde, PrototypePte, LastPrototypePte;
|
||||
PMMPTE PointerPte, PrototypePte, LastPrototypePte;
|
||||
PMMPDE PointerPde;
|
||||
MMPTE TempPte;
|
||||
PEPROCESS CurrentProcess;
|
||||
KIRQL OldIrql;
|
||||
|
@ -1099,7 +1100,8 @@ MiQueryAddressState(IN PVOID Va,
|
|||
OUT PVOID *NextVa)
|
||||
{
|
||||
|
||||
PMMPTE PointerPte, PointerPde;
|
||||
PMMPTE PointerPte;
|
||||
PMMPDE PointerPde;
|
||||
MMPTE TempPte;
|
||||
BOOLEAN DemandZeroPte = TRUE, ValidPte = FALSE;
|
||||
ULONG State = MEM_RESERVE, Protect = 0, LockChange;
|
||||
|
|
|
@ -752,9 +752,7 @@ MiBuildPagedPool_x(VOID)
|
|||
/* Save the first and last paged pool PTE */
|
||||
MmPagedPoolInfo.FirstPteForPagedPool = MiAddressToPte(MmPagedPoolStart);
|
||||
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
|
||||
// have to be (make sure to align our page count such that it fits nicely
|
||||
|
|
|
@ -12,10 +12,111 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#line 15 "ARM³::ARMPAGE"
|
||||
#define MODULE_INVOLVED_IN_ARM3
|
||||
#include "../ARM3/miarm.h"
|
||||
|
||||
/* 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];
|
||||
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 **********************************************************/
|
||||
|
||||
|
@ -49,25 +150,6 @@ MmUpdatePageDir(IN PEPROCESS Process,
|
|||
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
|
||||
NTAPI
|
||||
MmGetPageDirectory(VOID)
|
||||
|
@ -246,16 +328,7 @@ MmInitGlobalKernelPageDirectory(VOID)
|
|||
{
|
||||
ULONG i;
|
||||
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 */
|
||||
for (i = MiGetPdeOffset(MmSystemRangeStart); i < 2048; i++)
|
||||
|
|
|
@ -367,18 +367,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
MmUpdatePageDir(IN PEPROCESS Process,
|
||||
IN PVOID Address,
|
||||
IN ULONG Size)
|
||||
{
|
||||
//
|
||||
// Nothing to do
|
||||
//
|
||||
return;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
||||
|
@ -391,30 +379,6 @@ Mmi386ReleaseMmInfo(IN PEPROCESS Process)
|
|||
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
|
||||
NTAPI
|
||||
MmGetPageDirectory(VOID)
|
||||
|
|
|
@ -132,7 +132,7 @@ MmBuildMdlFromPages(PMDL Mdl, PPFN_NUMBER Pages)
|
|||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
MmIsFileAPagingFile(PFILE_OBJECT FileObject)
|
||||
MmIsFileObjectAPagingFile(PFILE_OBJECT FileObject)
|
||||
{
|
||||
ULONG i;
|
||||
|
||||
|
|
|
@ -102,9 +102,9 @@
|
|||
@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr)
|
||||
@ fastcall -arch=i386,arm ExInterlockedAddLargeStatistic(ptr long)
|
||||
@ stdcall ExInterlockedAddUlong(ptr long ptr)
|
||||
@ fastcall -arch=i386,arm ExInterlockedCompareExchange64(ptr ptr ptr ptr)
|
||||
@ stdcall -arch=i386,arm ExInterlockedDecrementLong(ptr ptr)
|
||||
@ stdcall -arch=i386,arm ExInterlockedExchangeUlong(ptr long ptr)
|
||||
@ fastcall -arch=i386 ExInterlockedCompareExchange64(ptr ptr ptr ptr)
|
||||
@ stdcall -arch=i386 ExInterlockedDecrementLong(ptr ptr)
|
||||
@ stdcall -arch=i386 ExInterlockedExchangeUlong(ptr long ptr)
|
||||
@ stdcall ExInterlockedExtendZone(ptr ptr long ptr)
|
||||
@ fastcall -arch=i386,arm ExInterlockedFlushSList(ptr)
|
||||
@ stdcall -arch=i386,arm ExInterlockedIncrementLong(ptr ptr)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "initguid.h"
|
||||
#include <ntoskrnl.h>
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
|
|
@ -58,8 +58,12 @@ typedef struct _USER_MESSAGE_QUEUE
|
|||
LIST_ENTRY HardwareMessagesListHead;
|
||||
/* Lock for the hardware message list. */
|
||||
KMUTEX HardwareLock;
|
||||
/* Pointer to the current WM_MOUSEMOVE message */
|
||||
PUSER_MESSAGE MouseMoveMsg;
|
||||
/* True if a WM_MOUSEMOVE is pending */
|
||||
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. */
|
||||
BOOLEAN QuitPosted;
|
||||
/* The quit exit code. */
|
||||
|
@ -122,18 +126,25 @@ VOID FASTCALL
|
|||
MsqPostQuitMessage(PUSER_MESSAGE_QUEUE MessageQueue, ULONG ExitCode);
|
||||
BOOLEAN APIENTRY
|
||||
MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
||||
IN BOOLEAN Remove,
|
||||
IN PWND Window,
|
||||
IN UINT MsgFilterLow,
|
||||
IN UINT MsgFilterHigh,
|
||||
OUT PMSG Message);
|
||||
IN BOOLEAN Remove,
|
||||
IN PWND Window,
|
||||
IN UINT MsgFilterLow,
|
||||
IN UINT MsgFilterHigh,
|
||||
OUT PMSG Message);
|
||||
BOOL APIENTRY
|
||||
co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
||||
IN BOOL Remove,
|
||||
IN PWND Window,
|
||||
IN UINT MsgFilterLow,
|
||||
IN UINT MsgFilterHigh,
|
||||
OUT MSG* pMsg);
|
||||
IN BOOL Remove,
|
||||
IN PWND Window,
|
||||
IN UINT MsgFilterLow,
|
||||
IN UINT MsgFilterHigh,
|
||||
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
|
||||
MsqInitializeMessageQueue(struct _ETHREAD *Thread, PUSER_MESSAGE_QUEUE MessageQueue);
|
||||
VOID FASTCALL
|
||||
|
@ -154,9 +165,6 @@ NTSTATUS FASTCALL
|
|||
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
|
||||
UINT MsgFilterMin, UINT MsgFilterMax);
|
||||
VOID FASTCALL
|
||||
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
|
||||
PUSER_SENT_MESSAGE_NOTIFY NotifyMessage);
|
||||
VOID FASTCALL
|
||||
MsqIncPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||
VOID FASTCALL
|
||||
MsqDecPaintCountQueue(PUSER_MESSAGE_QUEUE Queue);
|
||||
|
|
|
@ -27,9 +27,8 @@ BOOLEAN FASTCALL
|
|||
co_WinPosShowWindow(PWND Window, INT Cmd);
|
||||
void FASTCALL
|
||||
co_WinPosSendSizeMove(PWND Window);
|
||||
USHORT FASTCALL
|
||||
co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
|
||||
PWND* Window);
|
||||
PWND FASTCALL
|
||||
co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest);
|
||||
VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
|
||||
|
||||
VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
|
||||
|
|
|
@ -1198,33 +1198,4 @@ NtUserGetClipboardSequenceNumber(VOID)
|
|||
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 */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue