Author: pschweitzer Date: Sat Nov 12 12:23:15 2011 New Revision: 54360
URL: http://svn.reactos.org/svn/reactos?rev=54360&view=rev Log: [BLUE] "Remove" dependencies with user-mode without breaking CSRSS.
Modified: trunk/reactos/drivers/setup/blue/blue.h trunk/reactos/drivers/setup/blue/font.c trunk/reactos/include/reactos/drivers/blue/ntddblue.h
Modified: trunk/reactos/drivers/setup/blue/blue.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/setup/blue/blue.h?r... ============================================================================== --- trunk/reactos/drivers/setup/blue/blue.h [iso-8859-1] (original) +++ trunk/reactos/drivers/setup/blue/blue.h [iso-8859-1] Sat Nov 12 12:23:15 2011 @@ -9,17 +9,42 @@ /* DEFINITIONS ***************************************************************/
#include <ntddk.h> -#include <windef.h>
typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES; -#include <wincon.h> + +// Define material that normally comes from PSDK +// This is mandatory to prevent any inclusion of +// user-mode stuff. +typedef struct tagCOORD { + SHORT X; + SHORT Y; +} COORD, *PCOORD; + +typedef struct tagSMALL_RECT { + SHORT Left; + SHORT Top; + SHORT Right; + SHORT Bottom; +} SMALL_RECT; + +typedef struct tagCONSOLE_SCREEN_BUFFER_INFO { + COORD dwSize; + COORD dwCursorPosition; + USHORT wAttributes; + SMALL_RECT srWindow; + COORD dwMaximumWindowSize; +} CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO; + +typedef struct tagCONSOLE_CURSOR_INFO { + ULONG dwSize; + BOOLEAN bVisible; +} CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO; + +#define ENABLE_PROCESSED_OUTPUT 0x0001 +#define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
#include <blue/ntddblue.h> #include <ndk/inbvfuncs.h> - -#include <string.h> -#include <stdio.h> -#include <stdlib.h>
#define TAG_BLUE 'EULB'
@@ -89,6 +114,8 @@
#define TAB_WIDTH 8
+#define MAX_PATH 260 + #define MISC (PUCHAR)0x3c2 #define SEQ (PUCHAR)0x3c4 #define SEQDATA (PUCHAR)0x3c5
Modified: trunk/reactos/drivers/setup/blue/font.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/setup/blue/font.c?r... ============================================================================== --- trunk/reactos/drivers/setup/blue/font.c [iso-8859-1] (original) +++ trunk/reactos/drivers/setup/blue/font.c [iso-8859-1] Sat Nov 12 12:23:15 2011 @@ -68,7 +68,8 @@ CFFILE CabFile; ULONG CabFileOffset = 0; LARGE_INTEGER ByteOffset; - WCHAR SourceBuffer[_MAX_PATH] = {L'\0'}; + WCHAR SourceBuffer[MAX_PATH] = {L'\0'}; + ULONG ReadCP;
if(KeGetCurrentIrql() != PASSIVE_LEVEL) return STATUS_INVALID_DEVICE_STATE; @@ -90,7 +91,7 @@ return(Status);
SourceName.Length = 0; - SourceName.MaximumLength = _MAX_PATH * sizeof(WCHAR); + SourceName.MaximumLength = MAX_PATH * sizeof(WCHAR); SourceName.Buffer = SourceBuffer;
Status = ZwQuerySymbolicLinkObject(Handle, @@ -143,12 +144,16 @@
if(NT_SUCCESS(Status)) { - if(!bFoundFile && (UINT32)atoi(FileName) == CodePage) + if(!bFoundFile) { - // We got the correct file. - // Save the offset and loop through the rest of the file table to find the position, where the actual data starts. - CabFileOffset = CabFile.FileOffset; - bFoundFile = TRUE; + Status = RtlCharToInteger(FileName, 0, &ReadCP); + if (NT_SUCCESS(Status) && ReadCP == CodePage) + { + // We got the correct file. + // Save the offset and loop through the rest of the file table to find the position, where the actual data starts. + CabFileOffset = CabFile.FileOffset; + bFoundFile = TRUE; + } }
ByteOffset.LowPart += strlen(FileName) + 1;
Modified: trunk/reactos/include/reactos/drivers/blue/ntddblue.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/blu... ============================================================================== --- trunk/reactos/include/reactos/drivers/blue/ntddblue.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/drivers/blue/ntddblue.h [iso-8859-1] Sat Nov 12 12:23:15 2011 @@ -29,36 +29,36 @@
typedef struct tagCONSOLE_MODE { - DWORD dwMode; + ULONG dwMode; } CONSOLE_MODE, *PCONSOLE_MODE;
typedef struct tagOUTPUT_ATTRIBUTE { - WORD wAttribute; - DWORD nLength; - COORD dwCoord; - DWORD dwTransfered; + USHORT wAttribute; + ULONG nLength; + COORD dwCoord; + ULONG dwTransfered; } OUTPUT_ATTRIBUTE, *POUTPUT_ATTRIBUTE;
typedef struct tagOUTPUT_CHARACTER { CHAR cCharacter; - DWORD nLength; + ULONG nLength; COORD dwCoord; - DWORD dwTransfered; + ULONG dwTransfered; } OUTPUT_CHARACTER, *POUTPUT_CHARACTER;
typedef struct tagCONSOLE_DRAW { - UINT X; /* Origin */ - UINT Y; - UINT SizeX; /* Size of the screen buffer (chars) */ - UINT SizeY; - UINT CursorX; /* New cursor position (screen-relative) */ - UINT CursorY; + ULONG X; /* Origin */ + ULONG Y; + ULONG SizeX; /* Size of the screen buffer (chars) */ + ULONG SizeY; + ULONG CursorX; /* New cursor position (screen-relative) */ + ULONG CursorY; /* Followed by screen buffer in char/attrib format */ } CONSOLE_DRAW, *PCONSOLE_DRAW;