sync with trunk head (34904)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 15:52:00 +0000 (15:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 15:52:00 +0000 (15:52 +0000)
svn path=/branches/ros-amd64-bringup/; revision=34910

138 files changed:
reactos/ReactOS-arm.rbuild
reactos/base/services/tcpsvcs/chargen.c
reactos/base/shell/cmd/chcp.c
reactos/base/shell/cmd/choice.c
reactos/base/shell/cmd/cmd.c
reactos/base/shell/cmd/cmd.h
reactos/base/shell/cmd/color.c
reactos/base/shell/cmd/console.c
reactos/base/shell/cmd/copy.c
reactos/base/shell/cmd/date.c
reactos/base/shell/cmd/del.c
reactos/base/shell/cmd/echo.c
reactos/base/shell/cmd/error.c
reactos/base/shell/cmd/free.c
reactos/base/shell/cmd/goto.c
reactos/base/shell/cmd/internal.c
reactos/base/shell/cmd/label.c
reactos/base/shell/cmd/memory.c
reactos/base/shell/cmd/misc.c
reactos/base/shell/cmd/move.c
reactos/base/shell/cmd/path.c
reactos/base/shell/cmd/ren.c
reactos/base/shell/cmd/replace.c
reactos/base/shell/cmd/set.c
reactos/base/shell/cmd/timer.c
reactos/base/shell/cmd/type.c
reactos/base/shell/cmd/ver.c
reactos/base/shell/cmd/verify.c
reactos/base/shell/cmd/vol.c
reactos/base/system/winlogon/winlogon.c
reactos/base/system/winlogon/winlogon.h
reactos/boot/bootdata/txtsetup.sif
reactos/boot/freeldr/freeldr/arch/arm/loader.c
reactos/config-arm.template.rbuild
reactos/config-ppc.template.rbuild
reactos/config.template.rbuild
reactos/dll/ntdll/def/ntdll_arm.def
reactos/dll/win32/advapi32/advapi32.rbuild
reactos/dll/win32/gdi32/gdi32.rbuild
reactos/dll/win32/kernel32/misc/console.c
reactos/dll/win32/msgina/gui.c
reactos/dll/win32/msgina/msgina.h
reactos/dll/win32/msvcrt/msvcrt.def
reactos/dll/win32/rpcrt4/rpcrt4.rbuild
reactos/dll/win32/shell32/drive.c
reactos/dll/win32/shell32/fprop.c
reactos/dll/win32/user32/user32.rbuild
reactos/drivers/bus/pci/pci.c
reactos/drivers/filesystems/npfs/create.c
reactos/drivers/input/kbdclass/kbdclass.c
reactos/drivers/input/kbdclass/kbdclass.h
reactos/drivers/input/kbdclass/misc.c
reactos/drivers/input/mouclass/misc.c
reactos/drivers/input/mouclass/mouclass.c
reactos/drivers/input/mouclass/mouclass.h
reactos/drivers/storage/class/ramdisk/ramdisk.c
reactos/drivers/storage/scsiport/scsiport.c
reactos/hal/hal/hal.c
reactos/hal/hal/hal.rbuild
reactos/hal/hal/hal.rc
reactos/hal/hal/hal.spec [new file with mode: 0644]
reactos/hal/halx86/halmp.rbuild
reactos/hal/halx86/halup.rbuild
reactos/hal/halx86/halxbox.rbuild
reactos/include/ddk/hidclass.h
reactos/include/psdk/windows.h
reactos/include/psdk/winnt.h
reactos/include/reactos/msvctarget.h [new file with mode: 0644]
reactos/lib/recyclebin/recyclebin.h
reactos/lib/rtl/process.c
reactos/lib/sdk/crt/locale/locale.c
reactos/lib/sdk/crt/stdio/file.c
reactos/lib/sdk/nt/entry_point.c
reactos/ntoskrnl/include/internal/arm/mm.h
reactos/ntoskrnl/include/internal/kd.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/include/internal/ob_x.h
reactos/ntoskrnl/io/iomgr/irp.c
reactos/ntoskrnl/kd/i386/kdmemsup.c [new file with mode: 0644]
reactos/ntoskrnl/kd/kdinit.c
reactos/ntoskrnl/kd/wrappers/gdbstub.c
reactos/ntoskrnl/kdbg/kdb.c
reactos/ntoskrnl/ke/procobj.c
reactos/ntoskrnl/mm/anonmem.c
reactos/ntoskrnl/mm/arm/stubs.c
reactos/ntoskrnl/mm/aspace.c
reactos/ntoskrnl/mm/i386/page.c
reactos/ntoskrnl/mm/marea.c
reactos/ntoskrnl/mm/mdlsup.c
reactos/ntoskrnl/mm/mm.c
reactos/ntoskrnl/mm/mminit.c
reactos/ntoskrnl/mm/procsup.c
reactos/ntoskrnl/mm/region.c
reactos/ntoskrnl/mm/rmap.c
reactos/ntoskrnl/mm/section.c
reactos/ntoskrnl/mm/virtual.c
reactos/ntoskrnl/ntoskrnl-generic.rbuild
reactos/ntoskrnl/ob/oblife.c
reactos/ntoskrnl/ob/oblink.c
reactos/ntoskrnl/vdm/vdmmain.c
reactos/subsystems/win32/csrss/api/process.c
reactos/subsystems/win32/csrss/csrss.rbuild
reactos/subsystems/win32/csrss/include/api.h
reactos/subsystems/win32/csrss/include/conio.h
reactos/subsystems/win32/csrss/init.c
reactos/subsystems/win32/csrss/win32csr/alias.c [moved from reactos/subsystems/win32/csrss/api/alias.c with 76% similarity]
reactos/subsystems/win32/csrss/win32csr/conio.c
reactos/subsystems/win32/csrss/win32csr/dllmain.c
reactos/subsystems/win32/csrss/win32csr/guiconsole.c
reactos/subsystems/win32/csrss/win32csr/tuiconsole.c
reactos/subsystems/win32/csrss/win32csr/win32csr.rbuild
reactos/subsystems/win32/win32k/include/hook.h
reactos/subsystems/win32/win32k/ntuser/callback.c
reactos/subsystems/win32/win32k/ntuser/defwnd.c
reactos/subsystems/win32/win32k/ntuser/hook.c
reactos/subsystems/win32/win32k/ntuser/message.c
reactos/tools/buildno/buildno.cpp
reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h
reactos/tools/rbuild/backend/msbuild/msbuild.cpp
reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/project.cpp
reactos/tools/rbuild/rbuild.h
reactos/tools/rbuild/testsupportcode.cpp
reactos/tools/sysreg/namedpipe_reader.cpp
reactos/tools/sysreg/os_support.cpp
reactos/tools/sysreg/os_support.h
reactos/tools/sysreg/rosboot_test.cpp
reactos/tools/sysreg/rosboot_test.h
reactos/tools/sysreg/sysreg.rbuild
reactos/tools/sysreg/user_types.h
reactos/tools/winebuild/build.h
reactos/tools/winebuild/parser.c
reactos/tools/winebuild/spec32.c

index a75411a..b073d42 100644 (file)
@@ -65,6 +65,7 @@
                <compilerflag>-O3</compilerflag>
        </if>
 
+       <define name="__MSVCRT__"/>
        <compilerflag>-Wno-attributes</compilerflag>
        <compilerflag>-fno-strict-aliasing</compilerflag>
        <linkerflag>-s</linkerflag>
                                <xi:include href="lib/sdk/crt/crt.rbuild" />
                                <xi:include href="lib/sdk/crt/libcntpr.rbuild" />
                        </directory>
+                       <directory name="nt">
+                               <xi:include href="lib/sdk/nt/nt.rbuild" />
+                       </directory>
                        <directory name="wdmguid">
                                <xi:include href="lib/sdk/wdmguid/wdmguid.rbuild" />
                        </directory>
                <directory name="ntdllsys">
                        <xi:include href="lib/ntdllsys/ntdllsys.rbuild" />
                </directory>
+               <directory name="smlib">
+                       <xi:include href="lib/smlib/smlib.rbuild" />
+               </directory>
        </directory>
        <directory name="include">
                <xi:include href="include/directory.rbuild" />
                        <xi:include href="dll/ntdll/ntdll.rbuild" />
                </directory>    
        </directory>
+       <directory name="base">
+               <directory name="system">
+            <directory name="smss">
+                <xi:include href="base/system/smss/smss.rbuild" />
+            </directory>       
+               </directory>    
+       </directory>
 </project>
index 7d7d829..2f2b171 100644 (file)
@@ -74,7 +74,7 @@ GenerateChars(SOCKET sock)
             line[i] = chars[charIndex];
 
             /* if we hit the end char, reset it */
-            if (chars[charIndex] == chars[NUM_CHARS])
+            if (chars[charIndex] == chars[NUM_CHARS - 1])
                 charIndex = 0;
             else
                 charIndex++;
index 272a981..2133f9a 100644 (file)
@@ -19,7 +19,6 @@
 
 INT CommandChcp (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        LPTSTR *arg;
        INT    args;
        UINT uNewCodePage;
@@ -39,8 +38,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
        if (args == 0)
        {
                /* display active code page number */
-               LoadString(CMD_ModuleHandle, STRING_CHCP_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg, InputCodePage);
+               ConErrResPrintf(STRING_CHCP_ERROR1, InputCodePage);
                freep (arg);
                return 0;
        }
@@ -48,8 +46,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
        if (args >= 2)
        {
                /* too many parameters */
-               LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg, param);
+               ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT, param);
                nErrorLevel = 1;
                freep (arg);
                return 1;
@@ -59,8 +56,7 @@ INT CommandChcp (LPTSTR cmd, LPTSTR param)
 
        if (uNewCodePage == 0)
        {
-               LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg, arg[0]);
+               ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT, arg[0]);
                freep (arg);
                nErrorLevel = 1;
                return 1;
index 8d8ab02..bf43b8f 100644 (file)
@@ -102,7 +102,6 @@ IsKeyInString (LPTSTR lpString, TCHAR cKey, BOOL bCaseSensitive)
 INT
 CommandChoice (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        LPTSTR lpOptions;
        TCHAR Options[6];
        LPTSTR lpText    = NULL;
@@ -208,8 +207,7 @@ CommandChoice (LPTSTR cmd, LPTSTR param)
                        }
                        else if (arg[i][0] == _T('/'))
                        {
-                               LoadString(CMD_ModuleHandle, STRING_CHOICE_ERROR_OPTION, szMsg, RC_STRING_MAX_SIZE);
-                               ConErrPrintf(szMsg, arg[i]);
+                               ConErrResPrintf(STRING_CHOICE_ERROR_OPTION, arg[i]);
                                freep (arg);
                                return 1;
                        }
index 2f98850..8dd6a60 100644 (file)
@@ -687,7 +687,6 @@ DoCommand (LPTSTR line)
 
 VOID ParseCommandLine (LPTSTR cmd)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR cmdline[CMDLINE_LENGTH];
        LPTSTR s;
 #ifdef FEATURE_REDIRECTION
@@ -786,15 +785,13 @@ VOID ParseCommandLine (LPTSTR cmd)
                                    FILE_ATTRIBUTE_NORMAL, NULL);
                if (hFile == INVALID_HANDLE_VALUE)
                {
-                       LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg, in);
+                       ConErrResPrintf(STRING_CMD_ERROR1, in);
                        return;
                }
 
                if (!SetStdHandle (STD_INPUT_HANDLE, hFile))
                {
-                       LoadString(CMD_ModuleHandle, STRING_CMD_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg, in);
+                       ConErrResPrintf(STRING_CMD_ERROR1, in);
                        return;
                }
                TRACE ("Input redirected from: %s\n", debugstr_aw(in));
@@ -820,8 +817,7 @@ VOID ParseCommandLine (LPTSTR cmd)
 
                if (hFile[1] == INVALID_HANDLE_VALUE)
                {
-                       LoadString(CMD_ModuleHandle, STRING_CMD_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg);
+                       ConErrResPrintf(STRING_CMD_ERROR2);
                        return;
                }
 
@@ -884,8 +880,7 @@ VOID ParseCommandLine (LPTSTR cmd)
 
                        if (out[size] != _T(':'))
                        {
-                               LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                               ConErrPrintf(szMsg, out);
+                               ConErrResPrintf(STRING_CMD_ERROR3, out);
                                return;
                        }
 
@@ -896,8 +891,7 @@ VOID ParseCommandLine (LPTSTR cmd)
 
                        if (hFile == INVALID_HANDLE_VALUE)
                        {
-                               LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                               ConErrPrintf(szMsg, out);
+                               ConErrResPrintf(STRING_CMD_ERROR3, out);
                                return;
                        }
 
@@ -905,8 +899,7 @@ VOID ParseCommandLine (LPTSTR cmd)
 
                if (!SetStdHandle (STD_OUTPUT_HANDLE, hFile))
                {
-                       LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg, out);
+                       ConErrResPrintf(STRING_CMD_ERROR3, out);
                        return;
                }
 
@@ -955,16 +948,14 @@ VOID ParseCommandLine (LPTSTR cmd)
                                            NULL);
                        if (hFile == INVALID_HANDLE_VALUE)
                        {
-                               LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                               ConErrPrintf(szMsg, err);
+                               ConErrResPrintf(STRING_CMD_ERROR3, err);
                                return;
                        }
                }
 
                if (!SetStdHandle (STD_ERROR_HANDLE, hFile))
                {
-                       LoadString(CMD_ModuleHandle, STRING_CMD_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg, err);
+                       ConErrResPrintf(STRING_CMD_ERROR3, err);
                        return;
                }
 
index 2beb44e..2d7f685 100644 (file)
@@ -161,6 +161,8 @@ VOID SetCursorType (BOOL, BOOL);
 
 VOID ConOutResPuts (UINT resID);
 VOID ConErrResPuts (UINT resID);
+VOID ConOutResPrintf (UINT resID, ...);
+VOID ConErrResPrintf (UINT resID, ...);
 VOID ConOutResPaging(BOOL NewPage, UINT resID);
 
 /* Prototypes for COPY.C */
@@ -311,8 +313,8 @@ VOID   GetPathCase(TCHAR *, TCHAR *);
 #define PROMPT_BREAK 3
 
 INT PagePrompt (VOID);
-INT FilePromptYN (LPTSTR, ...);
-INT FilePromptYNA (LPTSTR, ...);
+INT FilePromptYN (UINT);
+INT FilePromptYNA (UINT);
 
 
 /* Prototypes for MOVE.C */
index a2d22cd..2ee1f44 100644 (file)
@@ -65,8 +65,6 @@ VOID SetScreenColor (WORD wColor, BOOL bNoFill)
  */
 INT CommandColor (LPTSTR first, LPTSTR rest)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
        if (_tcsncmp (rest, _T("/?"), 2) == 0)
        {
                ConOutResPaging(TRUE,STRING_COLOR_HELP1);
@@ -115,14 +113,12 @@ INT CommandColor (LPTSTR first, LPTSTR rest)
 
        if (((bc) && (bc->bEcho)) || !bc)
        {
-               LoadString(CMD_ModuleHandle, STRING_COLOR_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg, wColor);
+               ConErrResPrintf(STRING_COLOR_ERROR3, wColor);
        }
 
        if ((wColor & 0xF) == (wColor &0xF0) >> 4)
        {
-               LoadString(CMD_ModuleHandle, STRING_COLOR_ERROR4, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg, wColor);
+               ConErrResPrintf(STRING_COLOR_ERROR4, wColor);
                nErrorLevel = 1;
                return 1;
        }
index a910367..eac2a8e 100644 (file)
@@ -236,10 +236,10 @@ VOID ConPrintf(LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
 INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHandle)
 {
        INT len;
-       PCHAR pBuf;
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        TCHAR szOut[OUTPUT_BUFFER_SIZE];
        DWORD dwWritten;
+       HANDLE hOutput = GetStdHandle(nStdHandle);
 
        /* used to count number of lines since last pause */
        static int LineCount = 0;
@@ -247,13 +247,10 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
        /* used to see how big the screen is */
        int ScreenLines = 0;
 
-       /* the number of chars in a roow */
-       int ScreenCol = 0;
-
        /* chars since start of line */
-       int CharSL = 0;
+       int CharSL;
 
-       int i = 0;
+       int from = 0, i = 0;
 
        if(NewPage == TRUE)
                LineCount = 0;
@@ -264,7 +261,7 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
 
 
        //get the size of the visual screen that can be printed too
-       if (!GetConsoleScreenBufferInfo(hConsole, &csbi))
+       if (!GetConsoleScreenBufferInfo(hOutput, &csbi))
        {
                // we assuming its a file handle
                ConPrintf(szFormat, arg_ptr, nStdHandle);
@@ -272,7 +269,7 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
        }
        //subtract 2 to account for "press any key..." and for the blank line at the end of PagePrompt()
        ScreenLines = (csbi.srWindow.Bottom  - csbi.srWindow.Top) - 4;
-       ScreenCol = (csbi.srWindow.Right - csbi.srWindow.Left) + 1;
+       CharSL = csbi.dwCursorPosition.X;
 
        //make sure they didnt make the screen to small
        if(ScreenLines<4)
@@ -282,45 +279,32 @@ INT ConPrintfPaging(BOOL NewPage, LPTSTR szFormat, va_list arg_ptr, DWORD nStdHa
        }
 
        len = _vstprintf (szOut, szFormat, arg_ptr);
-#ifdef _UNICODE
-       pBuf = cmd_alloc(len + 1);
-       len = WideCharToMultiByte( OutputCodePage, 0, szOut, len + 1, pBuf, len + 1, NULL, NULL) - 1;
-#else
-       pBuf = szOut;
-#endif
 
-       for(i = 0; i < len; i++)
+       while (i < len)
        {
-               // search 'end of string' '\n' or 'end of screen line'
-               for(; (i < len) && (pBuf[i] != _T('\n') && (CharSL<ScreenCol)) ; i++)
-                       CharSL++;
+               // Search until the end of a line is reached
+               if (szOut[i++] != _T('\n') && ++CharSL < csbi.dwSize.X)
+                       continue;
 
-               WriteFile (GetStdHandle (nStdHandle),&pBuf[i-CharSL],sizeof(CHAR)*(CharSL+1),&dwWritten,NULL);
                LineCount++;
                CharSL=0;
 
                if(LineCount >= ScreenLines)
                {
-                       if(_strnicmp(&pBuf[i], "\n", 2)!=0)
-                               WriteFile (GetStdHandle (nStdHandle),_T("\n"),sizeof(CHAR),&dwWritten,NULL);
+                       WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL);
+                       from = i;
 
                        if(PagePrompt() != PROMPT_YES)
                        {
-#ifdef _UNICODE
-                               cmd_free(pBuf);
-#endif
                                return 1;
                        }
                        //reset the number of lines being printed
                        LineCount = 0;
-                       CharSL=0;
                }
-
        }
 
-#ifdef _UNICODE
-       cmd_free(pBuf);
-#endif
+       WriteConsole(hOutput, &szOut[from], i-from, &dwWritten, NULL);
+
        return 0;
 }
 
@@ -382,6 +366,17 @@ VOID ConOutFormatMessage (DWORD MessageId, ...)
        }
 }
 
+VOID ConOutResPrintf (UINT resID, ...)
+{
+       TCHAR szMsg[RC_STRING_MAX_SIZE];
+       va_list arg_ptr;
+
+       va_start (arg_ptr, resID);
+       LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
+       ConPrintf(szMsg, arg_ptr, STD_OUTPUT_HANDLE);
+       va_end (arg_ptr);
+}
+
 VOID ConOutPrintf (LPTSTR szFormat, ...)
 {
        va_list arg_ptr;
@@ -421,6 +416,17 @@ VOID ConErrPuts (LPTSTR szText)
 }
 
 
+VOID ConErrResPrintf (UINT resID, ...)
+{
+       TCHAR szMsg[RC_STRING_MAX_SIZE];
+       va_list arg_ptr;
+
+       va_start (arg_ptr, resID);
+       LoadString(CMD_ModuleHandle, resID, szMsg, RC_STRING_MAX_SIZE);
+       ConPrintf(szMsg, arg_ptr, STD_ERROR_HANDLE);
+       va_end (arg_ptr);
+}
+
 VOID ConErrPrintf (LPTSTR szFormat, ...)
 {
        va_list arg_ptr;
index b0e563d..8526b43 100644 (file)
@@ -54,7 +54,6 @@ copy (TCHAR source[MAX_PATH],
       DWORD lpdwFlags,
       BOOL bTouch)
 {
-    TCHAR szMsg[RC_STRING_MAX_SIZE];
     FILETIME srctime,NewFileTime;
     HANDLE hFileSrc;
     HANDLE hFileDest;
@@ -80,8 +79,7 @@ copy (TCHAR source[MAX_PATH],
             NULL, OPEN_EXISTING, 0, NULL);
         if (hFileSrc == INVALID_HANDLE_VALUE)
         {
-            LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-            ConOutPrintf(szMsg, source);
+            ConOutResPrintf(STRING_COPY_ERROR1, source);
             nErrorLevel = 1;
             return 0;
         }
@@ -108,8 +106,7 @@ copy (TCHAR source[MAX_PATH],
         NULL, OPEN_EXISTING, 0, NULL);
     if (hFileSrc == INVALID_HANDLE_VALUE)
     {
-        LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-        ConOutPrintf(szMsg, source);
+        ConOutResPrintf(STRING_COPY_ERROR1, source);
         nErrorLevel = 1;
         return 0;
     }
@@ -286,18 +283,15 @@ copy (TCHAR source[MAX_PATH],
 static INT CopyOverwrite (LPTSTR fn)
 {
     /*ask the user if they want to override*/
-    TCHAR szMsg[RC_STRING_MAX_SIZE];
     INT res;
-    LoadString(CMD_ModuleHandle, STRING_COPY_HELP1, szMsg, RC_STRING_MAX_SIZE);
-    ConOutPrintf(szMsg,fn);
-    res = FilePromptYNA (_T(""));
+    ConOutResPrintf(STRING_COPY_HELP1, fn);
+    res = FilePromptYNA (0);
     return res;
 }
 
 
 INT cmd_copy (LPTSTR cmd, LPTSTR param)
 {
-    TCHAR szMsg[RC_STRING_MAX_SIZE];
     LPTSTR *arg;
     INT argc, i, nFiles, nOverwrite = 0, nSrc = -1, nDes = -1;
     /* this is the path up to the folder of the src and dest ie C:\windows\ */
@@ -462,8 +456,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
 
                     default:
                         /* Invalid switch */
-                        LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE);
-                        ConOutPrintf(szMsg, _totupper(arg[i][1]));
+                        ConOutResPrintf(STRING_ERROR_INVALID_SWITCH, _totupper(arg[i][1]));
                         nErrorLevel = 1;
                         freep (arg);
                         return 1;
@@ -524,8 +517,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
     if(nFiles > 2)
     {
         /* There are too many file names in command */
-        LoadString(CMD_ModuleHandle, STRING_ERROR_TOO_MANY_PARAMETERS, szMsg, RC_STRING_MAX_SIZE);
-        ConErrPrintf(szMsg,_T(""));
+        ConErrResPrintf(STRING_ERROR_TOO_MANY_PARAMETERS,_T(""));
         nErrorLevel = 1;
         freep (arg);
         return 1;
@@ -604,8 +596,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
                 szTouch = _tcsstr (arg[nSrc], _T("+"));
                 if(_tcsncmp (szTouch,_T("+,,\0"),4) || nDes != -1)
                 {
-                    LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_PARAM_FORMAT, szMsg, RC_STRING_MAX_SIZE);
-                    ConErrPrintf(szMsg,arg[nSrc]);
+                    ConErrResPrintf(STRING_ERROR_INVALID_PARAM_FORMAT,arg[nSrc]);
                     nErrorLevel = 1;
                     freep (arg);
                     return 1;
@@ -794,8 +785,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
             /* Check to see if the file is the same file */
             if(!bTouch && !_tcscmp (tmpSrcPath, tmpDestPath))
             {
-                LoadString(CMD_ModuleHandle, STRING_COPY_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-                ConOutPrintf(szMsg);
+                ConOutResPrintf(STRING_COPY_ERROR2);
 
                 nErrorLevel = 1;
                 break;
@@ -821,8 +811,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
             else
             {
                 /* print out the error message */
-                LoadString(CMD_ModuleHandle, STRING_COPY_ERROR3, szMsg, RC_STRING_MAX_SIZE);
-                ConOutPrintf(szMsg);
+                ConOutResPrintf(STRING_COPY_ERROR3);
                 ConOutFormatMessage (GetLastError(), szSrcPath);
                 nErrorLevel = 1;
             }
@@ -834,8 +823,7 @@ INT cmd_copy (LPTSTR cmd, LPTSTR param)
     } while(!bDone);
 
     /* print out the number of files copied */
-    LoadString(CMD_ModuleHandle, STRING_COPY_FILE, szMsg, RC_STRING_MAX_SIZE);
-    ConOutPrintf(szMsg, nFiles);
+    ConOutResPrintf(STRING_COPY_FILE, nFiles);
 
     FindClose(hFile);
 
index a4b04f8..53a4b5b 100644 (file)
@@ -46,24 +46,19 @@ static WORD awMonths[2][13] =
 static VOID
 PrintDateString (VOID)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
        switch (nDateFormat)
        {
                case 0: /* mmddyy */
                default:
-                       LoadString(CMD_ModuleHandle, STRING_DATE_HELP1, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+                       ConOutResPrintf(STRING_DATE_HELP1, cDateSeparator, cDateSeparator);
                        break;
 
                case 1: /* ddmmyy */
-                       LoadString(CMD_ModuleHandle, STRING_DATE_HELP2, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+                       ConOutResPrintf(STRING_DATE_HELP2, cDateSeparator, cDateSeparator);
                        break;
 
                case 2: /* yymmdd */
-                       LoadString(CMD_ModuleHandle, STRING_DATE_HELP3, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, cDateSeparator, cDateSeparator);
+                       ConOutResPrintf(STRING_DATE_HELP3, cDateSeparator, cDateSeparator);
                        break;
        }
 }
index b72c76a..3785fc0 100644 (file)
@@ -77,12 +77,6 @@ enum
 };
 
 static TCHAR szDeleteWipe[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp2[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp3[RC_STRING_MAX_SIZE];
-static TCHAR szDelHelp4[RC_STRING_MAX_SIZE];
-static TCHAR szDelError5[RC_STRING_MAX_SIZE];
-static TCHAR szDelError6[RC_STRING_MAX_SIZE];
-static TCHAR szDelError7[RC_STRING_MAX_SIZE];
 static TCHAR CMDPath[MAX_PATH];
 
 static BOOLEAN StringsLoaded = FALSE;
@@ -90,12 +84,6 @@ static BOOLEAN StringsLoaded = FALSE;
 static VOID LoadStrings(VOID)
 {
         LoadString( CMD_ModuleHandle, STRING_DELETE_WIPE, szDeleteWipe, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szDelHelp2, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_HELP3, szDelHelp3, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_HELP4, szDelHelp4, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_ERROR5, szDelError5, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_ERROR6, szDelError6, RC_STRING_MAX_SIZE);
-        LoadString( CMD_ModuleHandle, STRING_DEL_ERROR7, szDelError7, RC_STRING_MAX_SIZE);
         GetModuleFileName(NULL, CMDPath, MAX_PATH);
         StringsLoaded = TRUE;
 }
@@ -193,7 +181,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags)
 
                if (!((*dwFlags & DEL_YES) || (*dwFlags & DEL_QUIET) || (*dwFlags & DEL_PROMPT)))
                {
-                       res = FilePromptYNA (szDelHelp2);
+                       res = FilePromptYNA (STRING_DEL_HELP2);
                        if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
                                return 0x80000000;
                        if(res == PROMPT_ALL)
@@ -256,9 +244,9 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags)
                        /* ask for deleting */
                        if (*dwFlags & DEL_PROMPT)
                        {
-                               ConErrPrintf(szDelError5, szFullPath);
+                               ConErrResPrintf(STRING_DEL_ERROR5, szFullPath);
 
-                               res = FilePromptYN (szDelError6);
+                               res = FilePromptYN (STRING_DEL_ERROR6);
 
                                if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
                                {
@@ -270,7 +258,7 @@ DeleteFiles(LPTSTR FileName, DWORD* dwFlags, DWORD dwAttrFlags)
                        /*user cant ask it to be quiet and tell you what it did*/
                        if (!(*dwFlags & DEL_QUIET) && !(*dwFlags & DEL_TOTAL))
                        {
-                               ConErrPrintf(szDelError7, szFullPath);
+                               ConErrResPrintf(STRING_DEL_ERROR7, szFullPath);
                        }
 
                        /* delete the file */
@@ -552,11 +540,11 @@ INT CommandDelete (LPTSTR cmd, LPTSTR param)
                 dwFiles &= 0x7fffffff;
                if (dwFiles < 2)
                {
-                        ConOutPrintf(szDelHelp3, dwFiles);
+                        ConOutResPrintf(STRING_DEL_HELP3, dwFiles);
                }
                else
                {
-                       ConOutPrintf(szDelHelp4, dwFiles);
+                       ConOutResPrintf(STRING_DEL_HELP4, dwFiles);
                }
        }
 
index e73f76e..2ec644c 100644 (file)
@@ -31,7 +31,6 @@
 
 INT CommandEcho (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
         LPTSTR p1, p2;
 
        TRACE ("CommandEcho '%s' : '%s'\n", debugstr_aw(cmd), debugstr_aw(param));
@@ -98,8 +97,7 @@ INT CommandEcho (LPTSTR cmd, LPTSTR param)
                }
                else
                {
-                       LoadString(CMD_ModuleHandle, STRING_ECHO_HELP5, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, bEcho ? D_ON : D_OFF);
+                       ConOutResPrintf(STRING_ECHO_HELP5, bEcho ? D_ON : D_OFF);
                }
        }
 
index 7ecb86d..70963bb 100644 (file)
@@ -61,30 +61,21 @@ VOID ErrorMessage (DWORD dwErrorCode, LPTSTR szFormat, ...)
 
 VOID error_parameter_format(TCHAR ch)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
-       LoadString(CMD_ModuleHandle, STRING_ERROR_PARAMETERF_ERROR, szMsg, RC_STRING_MAX_SIZE);
-       ConErrPrintf(szMsg, ch);
+       ConErrResPrintf(STRING_ERROR_PARAMETERF_ERROR, ch);
   nErrorLevel = 1;
 }
 
 
 VOID error_invalid_switch (TCHAR ch)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
-       LoadString(CMD_ModuleHandle, STRING_ERROR_INVALID_SWITCH, szMsg, RC_STRING_MAX_SIZE);
-       ConErrPrintf(szMsg, ch);
+       ConErrResPrintf(STRING_ERROR_INVALID_SWITCH, ch);
   nErrorLevel = 1;
 }
 
 
 VOID error_too_many_parameters (LPTSTR s)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
-       LoadString(CMD_ModuleHandle, STRING_ERROR_TOO_MANY_PARAMETERS, szMsg, RC_STRING_MAX_SIZE);
-       ConErrPrintf(szMsg, s);
+       ConErrResPrintf(STRING_ERROR_TOO_MANY_PARAMETERS, s);
   nErrorLevel = 1;
 }
 
index 7e08dc1..14002e1 100644 (file)
@@ -35,8 +35,7 @@ PrintDiskInfo (LPTSTR szDisk)
 
        if (_tcslen (szDisk) < 2 || szDisk[1] != _T(':'))
        {
-               LoadString(CMD_ModuleHandle, STRING_FREE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg);
+               ConErrResPrintf(STRING_FREE_ERROR1);
                return;
        }
 
@@ -81,8 +80,7 @@ PrintDiskInfo (LPTSTR szDisk)
        ConvertULargeInteger (uliSize, szFree, 40, TRUE);
 
 
-       LoadString(CMD_ModuleHandle, STRING_FREE_HELP1, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg, szDrive, szVolume, szSerial, szTotal, szUsed, szFree);
+       ConOutResPrintf(STRING_FREE_HELP1, szDrive, szVolume, szSerial, szTotal, szUsed, szFree);
 }
 
 
index 7ea7a3a..216a999 100644 (file)
@@ -124,8 +124,7 @@ INT cmd_goto (LPTSTR cmd, LPTSTR param)
 
        }
 
-       LoadString(CMD_ModuleHandle, STRING_GOTO_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-       ConErrPrintf(szMsg, param);
+       ConErrResPrintf(STRING_GOTO_ERROR2, param);
        ExitBatch(NULL);
        return 1;
 }
index 8771b3e..b079e3e 100644 (file)
@@ -277,7 +277,6 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
        TCHAR szFinalPath[MAX_PATH];
        TCHAR * tmpPath;
        TCHAR szCurrent[MAX_PATH];
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        INT i;
 
 
@@ -301,8 +300,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
                if(!tmpPath)
                {
                        /* Didnt find an directories */
-                       LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg);
+                       ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
                        nErrorLevel = 1;
                        return 1;
                }
@@ -368,8 +366,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
                        return 0;
                }
                /* Didnt find an directories */
-               LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf(szMsg);
+               ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
                nErrorLevel = 1;
                return 1;
 
@@ -414,8 +411,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
        }while(FindNextFile (hFile, &f));
 
        /* Didnt find an directories */
-       LoadString(CMD_ModuleHandle, STRING_ERROR_PATH_NOT_FOUND, szMsg, RC_STRING_MAX_SIZE);
-       ConErrPrintf(szMsg);
+       ConErrResPrintf(STRING_ERROR_PATH_NOT_FOUND);
        nErrorLevel = 1;
        return 1;
 }
@@ -439,16 +435,16 @@ MakeFullPath(TCHAR * DirPath)
         p += 2;
     while (*p == _T('\\'))
         p++; /* skip drive root */
-    while ((p = _tcschr(p, _T('\\'))) != NULL)
+    do
     {
-       n = p - DirPath + 1;
+       p = _tcschr(p, _T('\\'));
+       n = p ? p++ - DirPath : _tcslen(DirPath);
        _tcsncpy(path, DirPath, n);
        path[n] = _T('\0');
        if( !CreateDirectory(path, NULL) &&
            (GetLastError() != ERROR_ALREADY_EXISTS))
            return FALSE;
-       p++;
-    }
+    } while (p != NULL);
     if (GetLastError() == ERROR_ALREADY_EXISTS)
        SetLastError(ERROR_SUCCESS);
 
@@ -463,7 +459,7 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
 {
        LPTSTR dir;             /* pointer to the directory to change to */
        LPTSTR place;   /* used to search for the \ when no space is used */
-       LPTSTR new_dir, *p = NULL;
+       LPTSTR *p = NULL;
        INT argc;
        nErrorLevel = 0;
        if (!_tcsncmp (param, _T("/?"), 2))
@@ -516,17 +512,6 @@ INT cmd_mkdir (LPTSTR cmd, LPTSTR param)
                return 1;
        }
 
-       /* Add a \ at the end of the path is there isnt on already */
-       if (dir[_tcslen (dir) - 1] != _T('\\'))
-       {
-               new_dir = cmd_realloc(dir, (_tcslen (dir) + 2) * sizeof(TCHAR));
-               if (new_dir != NULL)
-               {
-                       p[0] = dir = new_dir;
-                       _tcscat(dir,_T("\\"));
-               }
-       }
-
     if (!MakeFullPath(dir))
     {
         if(GetLastError() == ERROR_PATH_NOT_FOUND)
@@ -600,7 +585,6 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
        HANDLE hFile;
        WIN32_FIND_DATA f;
        INT res;
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR szFullPath[MAX_PATH];
 
        if (!_tcsncmp (param, _T("/?"), 2))
@@ -669,8 +653,7 @@ INT cmd_rmdir (LPTSTR cmd, LPTSTR param)
                /* ask if they want to delete evrything in the folder */
                if (!RD_QUIET)
                {
-                       LoadString( CMD_ModuleHandle, STRING_DEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
-                       res = FilePromptYNA (szMsg);
+                       res = FilePromptYNA (STRING_DEL_HELP2);
                        if ((res == PROMPT_NO) || (res == PROMPT_BREAK))
                        {
                                freep(arg);
index 3c03654..f87d294 100644 (file)
@@ -24,7 +24,6 @@
 
 INT cmd_label (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR  szRootPath[] = _T("A:\\");
        TCHAR  szLabel[80];
        TCHAR  szOldLabel[80];
@@ -74,18 +73,15 @@ INT cmd_label (LPTSTR cmd, LPTSTR param)
        /* print drive info */
        if (szOldLabel[0] != _T('\0'))
        {
-               LoadString(CMD_ModuleHandle, STRING_LABEL_HELP2, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, _totupper(szRootPath[0]), szOldLabel);
+               ConOutResPrintf(STRING_LABEL_HELP2, _totupper(szRootPath[0]), szOldLabel);
        }
        else
        {
-               LoadString(CMD_ModuleHandle, STRING_LABEL_HELP3, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, _totupper(szRootPath[0]));
+               ConOutResPrintf(STRING_LABEL_HELP3, _totupper(szRootPath[0]));
        }
 
        /* print the volume serial number */
-       LoadString(CMD_ModuleHandle, STRING_LABEL_HELP4, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
+       ConOutResPrintf(STRING_LABEL_HELP4, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
 
        if (szLabel[0] == _T('\0'))
        {
index 197b1ba..e838f65 100644 (file)
@@ -34,7 +34,6 @@ ConvertDWord (DWORD num, LPTSTR des, INT len, BOOL bSeparator)
 
 INT CommandMemory (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        MEMORYSTATUS ms;
        TCHAR szMemoryLoad[20];
        TCHAR szTotalPhys[20];
@@ -62,10 +61,9 @@ INT CommandMemory (LPTSTR cmd, LPTSTR param)
        ConvertDWord (ms.dwTotalVirtual, szTotalVirtual, 20, TRUE);
        ConvertDWord (ms.dwAvailVirtual, szAvailVirtual, 20, TRUE);
 
-       LoadString(CMD_ModuleHandle, STRING_MEMMORY_HELP2, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg,
-                    szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
-                    szAvailPageFile, szTotalVirtual, szAvailVirtual);
+       ConOutResPrintf(STRING_MEMMORY_HELP2,
+                       szMemoryLoad, szTotalPhys, szAvailPhys, szTotalPageFile,
+                       szAvailPageFile, szTotalVirtual, szAvailVirtual);
 
        return 0;
 }
index f88983d..0a0ad75 100644 (file)
@@ -519,22 +519,17 @@ INT PagePrompt (VOID)
 }
 
 
-INT FilePromptYN (LPTSTR szFormat, ...)
+INT FilePromptYN (UINT resID)
 {
        TCHAR szMsg[RC_STRING_MAX_SIZE];
-       TCHAR szOut[512];
-       va_list arg_ptr;
 //     TCHAR cKey = 0;
 //     LPTSTR szKeys = _T("yna");
 
        TCHAR szIn[10];
        LPTSTR p;
 
-       va_start (arg_ptr, szFormat);
-       _vstprintf (szOut, szFormat, arg_ptr);
-       va_end (arg_ptr);
-
-       ConOutPrintf (szFormat);
+       if (resID != 0)
+               ConOutResPrintf (resID);
 
        /* preliminary fix */
        ConInString (szIn, 10);
@@ -589,22 +584,17 @@ INT FilePromptYN (LPTSTR szFormat, ...)
 }
 
 
-INT FilePromptYNA (LPTSTR szFormat, ...)
+INT FilePromptYNA (UINT resID)
 {
        TCHAR szMsg[RC_STRING_MAX_SIZE];
-       TCHAR szOut[512];
-       va_list arg_ptr;
 //     TCHAR cKey = 0;
 //     LPTSTR szKeys = _T("yna");
 
        TCHAR szIn[10];
        LPTSTR p;
 
-       va_start (arg_ptr, szFormat);
-       _vstprintf (szOut, szFormat, arg_ptr);
-       va_end (arg_ptr);
-
-       ConOutPrintf (szFormat);
+       if (resID != 0)
+               ConOutResPrintf (resID);
 
        /* preliminary fix */
        ConInString (szIn, 10);
index 9c1622c..dc4ec4f 100644 (file)
@@ -55,11 +55,9 @@ enum
 static INT MoveOverwrite (LPTSTR fn)
 {
        /*ask the user if they want to override*/
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        INT res;
-       LoadString(CMD_ModuleHandle, STRING_MOVE_HELP1, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg,fn);
-       res = FilePromptYNA (_T(""));
+       ConOutResPrintf(STRING_MOVE_HELP1, fn);
+       res = FilePromptYNA (0);
        return res;
 }
 
@@ -87,7 +85,6 @@ void GetDirectory (LPTSTR wholepath, LPTSTR directory, BOOL CheckExisting)
 
 INT cmd_move (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        LPTSTR *arg;
        INT argc, i, nFiles;
        TCHAR szDestPath[MAX_PATH];
@@ -519,11 +516,9 @@ INT cmd_move (LPTSTR cmd, LPTSTR param)
                        }
                }
                if (MoveStatus)
-                       LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
+                       ConOutResPrintf(STRING_MOVE_ERROR1);
                else
-                       LoadString(CMD_ModuleHandle, STRING_MOVE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-               
-               ConOutPrintf(szMsg);
+                       ConOutResPrintf(STRING_MOVE_ERROR2);
        }
        while ((!OnlyOneFile || dwMoveStatusFlags & MOVE_SRC_CURRENT_IS_DIR ) &&
                        !(dwMoveStatusFlags & MOVE_SOURCE_IS_DIR) &&
index fd4bb0f..fc112d1 100644 (file)
@@ -49,14 +49,12 @@ INT cmd_path (LPTSTR cmd, LPTSTR param)
        {
                DWORD  dwBuffer;
                LPTSTR pszBuffer;
-               TCHAR szMsg[RC_STRING_MAX_SIZE];
 
                pszBuffer = (LPTSTR)cmd_alloc (ENV_BUFFER_SIZE * sizeof(TCHAR));
                dwBuffer = GetEnvironmentVariable (_T("PATH"), pszBuffer, ENV_BUFFER_SIZE);
                if (dwBuffer == 0)
                {
-                       LoadString(CMD_ModuleHandle, STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
-                   ConOutPrintf(szMsg, _T("PATH"));
+                   ConOutResPrintf(STRING_VOL_HELP2, _T("PATH"));
                        return 0;
                }
                else if (dwBuffer > ENV_BUFFER_SIZE)
index 0aab26b..fb1267c 100644 (file)
@@ -42,7 +42,6 @@ enum
  */
 INT cmd_rename (LPTSTR cmd, LPTSTR param)
 {
-  TCHAR szMsg[RC_STRING_MAX_SIZE];
   LPTSTR *arg = NULL;
   INT args = 0;
   INT nEvalArgs = 0; /* nunber of evaluated arguments */
@@ -232,8 +231,7 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
                {
                  if (!(dwFlags & REN_ERROR))
                  {
-                   LoadString(CMD_ModuleHandle, STRING_REN_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-                   ConErrPrintf(szMsg, GetLastError());
+                   ConErrResPrintf(STRING_REN_ERROR1, GetLastError());
                  }
                }
            }
@@ -245,10 +243,9 @@ INT cmd_rename (LPTSTR cmd, LPTSTR param)
   if (!(dwFlags & REN_QUIET))
   {
     if (dwFiles == 1)
-      LoadString( CMD_ModuleHandle, STRING_REN_HELP2, szMsg, RC_STRING_MAX_SIZE);
+      ConOutResPrintf(STRING_REN_HELP2, dwFiles);
     else
-      LoadString( CMD_ModuleHandle, STRING_REN_HELP3, szMsg, RC_STRING_MAX_SIZE);
-    ConOutPrintf(szMsg,dwFiles);
+      ConOutResPrintf(STRING_REN_HELP3, dwFiles);
   }
 
   freep(arg);
index a2238e4..3c8e6c2 100644 (file)
@@ -29,10 +29,7 @@ enum
 /*just makes a print out if there is a problem with the switches*/
 void invalid_switch(LPTSTR is)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
-       LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg,is);
+       ConOutResPrintf(STRING_REPLACE_ERROR1,is);
        ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
 }
 
@@ -49,7 +46,6 @@ void getPath(TCHAR* out, LPTSTR in)
 /*makes the replace*/
 INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR d[MAX_PATH];
        TCHAR s[MAX_PATH];
        HANDLE hFileSrc, hFileDest;
@@ -71,8 +67,7 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
        hFileSrc = CreateFile (source, GENERIC_READ, FILE_SHARE_READ,NULL, OPEN_EXISTING, 0, NULL);
        if (hFileSrc == INVALID_HANDLE_VALUE)
        {
-               LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, source);
+               ConOutResPrintf(STRING_COPY_ERROR1, source);
                return 0;
        }
 
@@ -99,8 +94,7 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
 
                        if (hFileSrc == INVALID_HANDLE_VALUE)
                        {
-                               LoadString(CMD_ModuleHandle, STRING_COPY_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-                               ConOutPrintf(szMsg, dest);
+                               ConOutResPrintf(STRING_COPY_ERROR1, dest);
                                return 0;
                        }
 
@@ -125,20 +119,18 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
        {
                /* Output depending on add flag */
                if(dwFlags & REPLACE_ADD)
-                       LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP9, szMsg, RC_STRING_MAX_SIZE);
+                       ConOutResPrintf(STRING_REPLACE_HELP9, dest);
                else
-                       LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP10, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, dest);
-               if( !FilePromptYNA (_T("")))
+                       ConOutResPrintf(STRING_REPLACE_HELP10, dest);
+               if( !FilePromptYNA (0))
                        return 0;
        }
 
        /* Output depending on add flag */
        if(dwFlags & REPLACE_ADD)
-               LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP11, szMsg, RC_STRING_MAX_SIZE);
+               ConOutResPrintf(STRING_REPLACE_HELP11, dest);
        else
-               LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP5, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg,dest);
+               ConOutResPrintf(STRING_REPLACE_HELP5, dest);
 
        /* Make sure source and destination is not the same */
        if(!_tcscmp(s, d))
@@ -210,7 +202,7 @@ INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *d
 /* Function to iterate over source files and call replace for each of them */
 INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PATH], BOOL *doMore)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE], tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
+       TCHAR tmpDestPath[MAX_PATH], tmpSrcPath[MAX_PATH];
        INT filesReplaced=0, i;
        DWORD dwAttrib = 0;
        HANDLE hFile;
@@ -269,8 +261,7 @@ INT recReplace(DWORD dwFlags, TCHAR szSrcPath[MAX_PATH], TCHAR szDestPath[MAX_PA
                {
                        if(!(dwFlags & REPLACE_READ_ONLY))
                        {
-                               LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR5, szMsg, RC_STRING_MAX_SIZE);
-                               ConOutPrintf(szMsg, tmpDestPath);
+                               ConOutResPrintf(STRING_REPLACE_ERROR5, tmpDestPath);
                                *doMore = FALSE;
                                break;
                        }
@@ -369,7 +360,6 @@ INT recFindSubDirs(DWORD dwFlags,
 
 INT cmd_replace (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        LPTSTR *arg;
        INT argc, i,filesReplaced = 0, nFiles, srcIndex = -1, destIndex = -1;
        DWORD dwFlags = 0;
@@ -474,8 +464,7 @@ INT cmd_replace (LPTSTR cmd, LPTSTR param)
                        if (_tcschr (arg[destIndex], _T('*')) != NULL ||
                                _tcschr (arg[destIndex], _T('?')) != NULL)
                        {
-                               LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-                               ConOutPrintf(szMsg,arg[destIndex]);
+                               ConOutResPrintf(STRING_REPLACE_ERROR2,arg[destIndex]);
                                ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
                                freep(arg);
                                return 1;
@@ -484,8 +473,7 @@ INT cmd_replace (LPTSTR cmd, LPTSTR param)
                        /* Make sure that destination exists */
                        if(!IsExistingDirectory(szDestPath))
                        {
-                               LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR2, szMsg, RC_STRING_MAX_SIZE);
-                               ConOutPrintf(szMsg, szDestPath);
+                               ConOutResPrintf(STRING_REPLACE_ERROR2, szDestPath);
                                ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
                                freep(arg);
                                return 1;
@@ -511,8 +499,7 @@ INT cmd_replace (LPTSTR cmd, LPTSTR param)
                /* Check so that source is not a directory, because that is not allowed */
                if(IsExistingDirectory(szSrcPath))
                {
-                       LoadString(CMD_ModuleHandle, STRING_REPLACE_ERROR6, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, szSrcPath);
+                       ConOutResPrintf(STRING_REPLACE_ERROR6, szSrcPath);
                        ConOutResPaging(TRUE,STRING_REPLACE_HELP3);
                        freep(arg);
                        return 1;
@@ -563,10 +550,9 @@ INT cmd_replace (LPTSTR cmd, LPTSTR param)
                {
                        /* Add switch dependent output */
                        if(dwFlags & REPLACE_ADD)
-                               LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP8, szMsg, RC_STRING_MAX_SIZE);
+                               ConOutResPrintf(STRING_REPLACE_HELP8, filesReplaced);
                        else
-                               LoadString(CMD_ModuleHandle, STRING_REPLACE_HELP4, szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf(szMsg, filesReplaced);
+                               ConOutResPrintf(STRING_REPLACE_HELP4, filesReplaced);
                }
        }
        /* Return memory */
index 0632e8c..07cb8c2 100644 (file)
@@ -53,7 +53,6 @@ skip_ws ( LPCTSTR p )
 
 INT cmd_set (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        INT i;
        LPTSTR p;
 
@@ -114,8 +113,7 @@ INT cmd_set (LPTSTR cmd, LPTSTR param)
 
        if ( !_tcsnicmp (param, _T("/"), 1) )
        {
-               LoadString(CMD_ModuleHandle, STRING_SYNTAX_COMMAND_INCORRECT, szMsg, RC_STRING_MAX_SIZE);
-               ConErrPrintf (szMsg, param);
+               ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param);
                return 0;
        }
 
@@ -126,8 +124,7 @@ INT cmd_set (LPTSTR cmd, LPTSTR param)
                if (p == param)
                {
                        /* handle set =val case */
-                       LoadString(CMD_ModuleHandle, STRING_SYNTAX_COMMAND_INCORRECT, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf (szMsg, param);
+                       ConErrResPrintf (STRING_SYNTAX_COMMAND_INCORRECT, param);
                        return 0;
                }
 
@@ -149,8 +146,7 @@ INT cmd_set (LPTSTR cmd, LPTSTR param)
                dwBuffer = GetEnvironmentVariable (param, pszBuffer, ENV_BUFFER_SIZE);
                if (dwBuffer == 0)
                {
-                       LoadString(CMD_ModuleHandle, STRING_PATH_ERROR, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf (szMsg, param);
+                       ConErrResPrintf (STRING_PATH_ERROR, param);
                        return 0;
                }
                else if (dwBuffer > ENV_BUFFER_SIZE)
index 4ab6578..db9c509 100644 (file)
@@ -34,7 +34,6 @@
 static VOID
 PrintElapsedTime (DWORD time,INT format)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        DWORD h,m,s,ms;
 
        TRACE ("PrintElapsedTime(%d,%d)",time,format);
@@ -42,8 +41,7 @@ PrintElapsedTime (DWORD time,INT format)
        switch (format)
        {
        case 0:
-               LoadString(CMD_ModuleHandle, STRING_TIMER_HELP1, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, time);
+               ConOutResPrintf(STRING_TIMER_HELP1, time);
                break;
 
        case 1:
@@ -53,11 +51,10 @@ PrintElapsedTime (DWORD time,INT format)
                time /=60;
                m = time % 60;
                h = time / 60;
-               LoadString( CMD_ModuleHandle, STRING_TIMER_HELP2, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg,
-                            h, cTimeSeparator,
-                            m, cTimeSeparator,
-                            s, cDecimalSeparator, ms/10);
+               ConOutResPrintf(STRING_TIMER_HELP2,
+                               h, cTimeSeparator,
+                               m, cTimeSeparator,
+                               s, cDecimalSeparator, ms/10);
                break;
        }
 }
@@ -65,8 +62,6 @@ PrintElapsedTime (DWORD time,INT format)
 
 INT CommandTimer (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
        // all timers are kept
        static DWORD clksT[10];
 
@@ -99,15 +94,12 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
 
        if (_tcsncmp (param, _T("/?"), 2) == 0)
        {
-               LoadString(CMD_ModuleHandle, STRING_TIMER_HELP3, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, cTimeSeparator, cTimeSeparator, cDecimalSeparator);
+               ConOutResPrintf(STRING_TIMER_HELP3, cTimeSeparator, cTimeSeparator, cDecimalSeparator);
                return 0;
        }
 
        nErrorLevel = 0;
 
-       LoadString( CMD_ModuleHandle, STRING_TIMER_TIME, szMsg, RC_STRING_MAX_SIZE);
-
        p = split (param, &argc, FALSE);
 
        //read options
@@ -160,7 +152,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
                cT=GetTickCount();
                cS=TRUE;
 
-        ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+        ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
         PrintTime();
                freep(p);
                return 0;
@@ -170,7 +162,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
        {
                if(cS)
                {
-            ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+            ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
             PrintTime();
                        PrintElapsedTime(GetTickCount()-cT, iFormat);
                        freep(p);
@@ -179,7 +171,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
 
                cT=GetTickCount();
                cS=TRUE;
-               ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+               ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
         PrintTime();
                freep(p);
                return 0;
@@ -190,7 +182,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
                if (cS)
                {
                        cS=FALSE;
-                       ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+                       ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
             PrintTime();
                        PrintElapsedTime(GetTickCount()-cT, iFormat);
                        freep(p);
@@ -199,7 +191,7 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
 
                cT=GetTickCount();
                cS=TRUE;
-               ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+               ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
         PrintTime();
                freep(p);
                return 0;
@@ -211,13 +203,13 @@ INT CommandTimer (LPTSTR cmd, LPTSTR param)
                if (cS)
                {
                        cS=FALSE;
-                       ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+                       ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
             PrintTime();
                        PrintElapsedTime(GetTickCount()-cT, iFormat);
                        freep(p);
                        return 0;
                }
-               ConOutPrintf (szMsg,clk_n,cS?_T("ON"):_T("OFF"));
+               ConOutResPrintf (STRING_TIMER_TIME,clk_n,cS?_T("ON"):_T("OFF"));
         PrintTime();
                freep(p);
                return 0;
index cd0bbba..05ccc7b 100644 (file)
@@ -33,7 +33,6 @@
 
 INT cmd_type (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR  buff[256];
        HANDLE hFile, hConsoleOut;
        BOOL   bRet;
@@ -71,8 +70,7 @@ INT cmd_type (LPTSTR cmd, LPTSTR param)
        {
                if (_T('/') == argv[i][0] && _totupper(argv[i][1]) != _T('P'))
                {
-                       LoadString(CMD_ModuleHandle, STRING_TYPE_ERROR1, szMsg, RC_STRING_MAX_SIZE);
-                       ConErrPrintf(szMsg, argv[i] + 1);
+                       ConErrResPrintf(STRING_TYPE_ERROR1, argv[i] + 1);
                        continue;
                }
 
index d213764..74f3c63 100644 (file)
@@ -29,7 +29,6 @@ VOID ShortVersion (VOID)
        OSVERSIONINFO VersionInfo;
        unsigned RosVersionLen;
        LPTSTR RosVersion;
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
 
        ConOutResPuts (STRING_CMD_SHELLINFO );
        VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -44,8 +43,7 @@ VOID ShortVersion (VOID)
                                (RosVersion - VersionInfo.szCSDVersion);
                if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion, _T("ReactOS"), 7))
                {
-                       LoadString( CMD_ModuleHandle, STRING_VERSION_RUNVER, (LPTSTR) szMsg, RC_STRING_MAX_SIZE);
-                       ConOutPrintf (szMsg, RosVersion);
+                       ConOutResPrintf(STRING_VERSION_RUNVER, RosVersion);
                }
        }
        ConOutPuts (_T("\n"));
index e4a1145..af965cb 100644 (file)
@@ -29,8 +29,6 @@ static BOOL bVerify = FALSE;
 
 INT cmd_verify (LPTSTR cmd, LPTSTR param)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
-
        if (!_tcsncmp (param, _T("/?"), 2))
        {
                ConOutResPaging(TRUE,STRING_VERIFY_HELP1);
@@ -41,8 +39,7 @@ INT cmd_verify (LPTSTR cmd, LPTSTR param)
 
        if (!*param)
        {
-               LoadString(CMD_ModuleHandle, STRING_VERIFY_HELP2, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, bVerify ? D_ON : D_OFF);
+               ConOutResPrintf(STRING_VERIFY_HELP2, bVerify ? D_ON : D_OFF);
        }
        else if (_tcsicmp (param, D_OFF) == 0)
                bVerify = FALSE;
index f50ffa3..7c1b237 100644 (file)
@@ -28,7 +28,6 @@
 static INT
 PrintVolumeHeader (LPTSTR pszRootPath)
 {
-       TCHAR szMsg[RC_STRING_MAX_SIZE];
        TCHAR szVolName[80];
        DWORD dwSerialNr;
 
@@ -49,18 +48,15 @@ PrintVolumeHeader (LPTSTR pszRootPath)
        /* print drive info */
        if (szVolName[0] != '\0')
        {
-               LoadString(CMD_ModuleHandle, STRING_VOL_HELP1, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, pszRootPath[0],szVolName);
+               ConOutResPrintf(STRING_VOL_HELP1, pszRootPath[0],szVolName);
        }
        else
        {
-               LoadString(CMD_ModuleHandle, STRING_VOL_HELP2, szMsg, RC_STRING_MAX_SIZE);
-               ConOutPrintf(szMsg, pszRootPath[0]);
+               ConOutResPrintf(STRING_VOL_HELP2, pszRootPath[0]);
        }
 
        /* print the volume serial number */
-       LoadString(CMD_ModuleHandle, STRING_VOL_HELP3, szMsg, RC_STRING_MAX_SIZE);
-       ConOutPrintf(szMsg, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
+       ConOutResPrintf(STRING_VOL_HELP3, HIWORD(dwSerialNr), LOWORD(dwSerialNr));
        return 0;
 }
 
index f9aebff..bc70d65 100644 (file)
@@ -361,6 +361,10 @@ WinMain(
        else
                PostMessageW(WLSession->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_TIMEOUT, 0);
 
+       /* Tell kernel that CurrentControlSet is good (needed
+        * to support Last good known configuration boot) */
+       NtInitializeRegistry(CM_BOOT_FLAG_ACCEPTED);
+
        /* Message loop for the SAS window */
        while (GetMessageW(&Msg, WLSession->SASWindow, 0, 0))
        {
index 09297bd..1186050 100644 (file)
@@ -32,6 +32,7 @@
 #include <windows.h>
 #include <userenv.h>
 #include <winwlx.h>
+#include <cmfuncs.h>
 #include <rtlfuncs.h>
 #include <exfuncs.h>
 #include <setypes.h>
index 062d357..f4c3c83 100644 (file)
@@ -189,8 +189,8 @@ Default = "XT-, AT- or extended keyboard (83-105 keys)"
 ;0000043E = "Malay (Malaysia)"
 ;0000044E = "Marathi"
 ;00000450 = "Mongolian (Mongolia)"
-;00000414 = "Norwegian (Bokmal)"
-;00000814 = "Norwegian (Nynorsk)"
+00000414 = "Norwegian (Bokmal)"
+00000814 = "Norwegian (Nynorsk)"
 00000415 = "Polish"
 00000816 = "Portuguese (Portugal)"
 00000416 = "Portuguese (Brazil)"
index 7631b80..0287de5 100644 (file)
@@ -82,20 +82,6 @@ ULONG LenBits[] =
 //
 #define UART_VIRTUAL 0xE0000000
 
-#define PTE_BASE     0xC0000000
-#define PDE_BASE     0xC1000000
-#define HYPER_SPACE  0xC1100000
-
-//
-// Take 0x80812345 and extract:
-// PTE_BASE[0x808][0x12]
-//
-#define MiAddressToPte(x)         \
-    (PTE_BASE + (((x) >> 20) << 12) + ((((x) >> 12) & 0xFF) << 2))
-
-#define MiAddressToPde(x)         \
-    (PDE_BASE + (((x) >> 20) << 2))
-
 /* FUNCTIONS ******************************************************************/
 
 PVOID
index 6a0c495..68f7604 100644 (file)
 -->
 <property name="_WINKD_" value="0" />
 
+<!--
+       Whether to compile support for ELF files. Do not enable unless you know what
+       you're doing.
+-->
+<property name="_ELF_" value="0" />
+
 </group>
index f4de967..316bb52 100644 (file)
 -->
 <property name="NSWPAT" value="0" />
 
+<!--
+       Whether to compile support for ELF files. Do not enable unless you know what
+       you're doing.
+-->
+<property name="_ELF_" value="0" />
+
 </group>
index 4db88bb..b751cf9 100644 (file)
 -->
 <property name="_WINKD_" value="0" />
 
+<!--
+       Whether to compile support for ELF files. Do not enable unless you know what
+       you're doing.
+-->
+<property name="_ELF_" value="0" />
+
 </group>
index a5d362d..81c7cb1 100644 (file)
 LIBRARY ntdll.dll
 
 EXPORTS
-CsrAllocateCaptureBuffer@8
-CsrAllocateMessagePointer@12
-CsrCaptureMessageBuffer@16
-CsrCaptureMessageMultiUnicodeStringsInPlace@12
-CsrCaptureMessageString@20
-CsrCaptureTimeout@8
-CsrClientCallServer@16
-CsrClientConnectToServer@20
-CsrFreeCaptureBuffer@4
-CsrGetProcessId@0
-CsrIdentifyAlertableThread@0
-CsrNewThread@0
-CsrProbeForRead@12
-CsrProbeForWrite@12
-CsrSetPriorityClass@8
-DbgBreakPoint@0
+CsrAllocateCaptureBuffer
+CsrAllocateMessagePointer
+CsrCaptureMessageBuffer
+CsrCaptureMessageMultiUnicodeStringsInPlace
+CsrCaptureMessageString
+CsrCaptureTimeout
+CsrClientCallServer
+CsrClientConnectToServer
+CsrFreeCaptureBuffer
+CsrGetProcessId
+CsrIdentifyAlertableThread
+CsrNewThread
+CsrProbeForRead
+CsrProbeForWrite
+CsrSetPriorityClass
+DbgBreakPoint
 DbgPrint
 DbgPrintEx
-DbgPrompt@12
-DbgUiConvertStateChangeStructure@8
-DbgUiDebugActiveProcess@4
-DbgUiConnectToDbg@0
-DbgUiContinue@8
-DbgUiGetThreadDebugObject@0
-DbgUiIssueRemoteBreakin@4
-DbgUiRemoteBreakin@0
-DbgUiSetThreadDebugObject@4
-DbgUiStopDebugging@4
-DbgUiWaitStateChange@8
-DbgUserBreakPoint@0
-KiRaiseUserExceptionDispatcher@0
-KiUserApcDispatcher@16
-KiUserCallbackDispatcher@12
-KiUserExceptionDispatcher@8
-KiIntSystemCall@0
-KiFastSystemCallRet@0
-KiFastSystemCall@0
-LdrAccessResource@16
-LdrAddRefDll@8
-LdrDisableThreadCalloutsForDll@4
-LdrEnumResources@20
-LdrFindEntryForAddress@8
-LdrFindResourceDirectory_U@16
-LdrFindResource_U@16
-LdrGetDllHandle@16
-LdrGetProcedureAddress@16
-LdrInitializeThunk@16
-LdrLoadDll@16
-LdrProcessRelocationBlock@16
-LdrQueryImageFileExecutionOptions@24
-LdrQueryProcessModuleInformation@12
-LdrShutdownProcess@0
-LdrShutdownThread@0
-LdrUnloadDll@4
-LdrVerifyImageMatchesChecksum@16
+DbgPrompt
+DbgUiConvertStateChangeStructure
+DbgUiDebugActiveProcess
+DbgUiConnectToDbg
+DbgUiContinue
+DbgUiGetThreadDebugObject
+DbgUiIssueRemoteBreakin
+DbgUiRemoteBreakin
+DbgUiSetThreadDebugObject
+DbgUiStopDebugging
+DbgUiWaitStateChange
+DbgUserBreakPoint
+KiRaiseUserExceptionDispatcher
+KiUserApcDispatcher
+KiUserCallbackDispatcher
+KiUserExceptionDispatcher
+KiIntSystemCall
+KiFastSystemCallRet
+KiFastSystemCall
+LdrAccessResource
+LdrAddRefDll
+LdrDisableThreadCalloutsForDll
+LdrEnumResources
+LdrFindEntryForAddress
+LdrFindResourceDirectory_U
+LdrFindResource_U
+LdrGetDllHandle
+LdrGetProcedureAddress
+LdrInitializeThunk
+LdrLoadDll
+LdrProcessRelocationBlock
+LdrQueryImageFileExecutionOptions
+LdrQueryProcessModuleInformation
+LdrShutdownProcess
+LdrShutdownThread
+LdrUnloadDll
+LdrVerifyImageMatchesChecksum
 NlsAnsiCodePage DATA
 NlsMbCodePageTag DATA
 NlsMbOemCodePageTag DATA
-NtAcceptConnectPort@24
-NtAccessCheck@32
-NtAccessCheckAndAuditAlarm@44
-NtAddAtom@12
-NtAddBootEntry@8
-NtAdjustGroupsToken@24
-NtAdjustPrivilegesToken@24
-NtAlertResumeThread@8
-NtAlertThread@4
-NtAllocateLocallyUniqueId@4
-NtAllocateUuids@16
-NtAllocateVirtualMemory@24
-NtAssignProcessToJobObject@8
-NtCallbackReturn@12
-NtCancelIoFile@8
-NtCancelTimer@8
-NtClearEvent@4
-NtClose@4
-NtCloseObjectAuditAlarm@12
-NtCompareTokens@12
-NtCompleteConnectPort@4
-NtConnectPort@32
-NtContinue@8
-NtCreateDebugObject@16
-NtCreateDirectoryObject@12
-NtCreateEvent@20
-NtCreateEventPair@12
-NtCreateFile@44
-NtCreateIoCompletion@16
-NtCreateJobObject@12
-NtCreateKey@28
-NtCreateMailslotFile@32
-NtCreateMutant@16
-NtCreateNamedPipeFile@56
-NtCreatePagingFile@16
-NtCreatePort@20
-NtCreateProcess@32
-NtCreateProfile@36
-NtCreateSection@28
-NtCreateSemaphore@20
-NtCreateSymbolicLinkObject@16
-NtCreateThread@32
-NtCreateTimer@16
-NtCreateToken@52
-NtCreateWaitablePort@20
-NtCurrentTeb=_NtCurrentTeb@0
-NtDebugContinue@12
-NtDelayExecution@8
-NtDeleteAtom@4
-NtDeleteFile@4
-NtDeleteKey@4
-NtDeleteObjectAuditAlarm@12
-NtDeleteValueKey@8
-NtDeviceIoControlFile@40
-NtDisplayString@4
-NtDuplicateObject@28
-NtDuplicateToken@24
-NtEnumerateKey@24
-NtEnumerateValueKey@24
-NtExtendSection@8
-NtFindAtom@12
-NtFlushBuffersFile@8
-NtFlushInstructionCache@12
-NtFlushKey@4
-NtFlushVirtualMemory@16
-NtFlushWriteBuffer@0
-NtFreeVirtualMemory@16
-NtFsControlFile@40
-NtGetContextThread@8
-NtGetPlugPlayEvent@16
-NtImpersonateAnonymousToken@4
-NtImpersonateClientOfPort@8
-NtImpersonateThread@12
-NtInitializeRegistry@4
-NtIsProcessInJob@8
-NtListenPort@8
-NtLoadDriver@4
-NtLoadKey@8
-NtLoadKey2@12
-NtLockFile@40
-NtLockVirtualMemory@16
-NtMakeTemporaryObject@4
-NtMapViewOfSection@40
-NtNotifyChangeDirectoryFile@36
-NtNotifyChangeKey@40
-NtOpenDirectoryObject@12
-NtOpenEvent@12
-NtOpenEventPair@12
-NtOpenFile@24
-NtOpenIoCompletion@12
-NtOpenJobObject@12
-NtOpenKey@12
-NtOpenMutant@12
-NtOpenObjectAuditAlarm@48
-NtOpenProcess@16
-NtOpenProcessToken@12
-NtOpenSection@12
-NtOpenSemaphore@12
-NtOpenSymbolicLinkObject@12
-NtOpenThread@16
-NtOpenThreadToken@16
-NtOpenTimer@12
-NtPlugPlayControl@12
-NtPowerInformation@20
-NtPrivilegeCheck@12
-NtPrivilegedServiceAuditAlarm@20
-NtPrivilegeObjectAuditAlarm@24
-NtProtectVirtualMemory@20
-NtPulseEvent@8
-NtQueryAttributesFile@8
-NtQueryDebugFilterState@8
-NtQueryDefaultLocale@8
-NtQueryDefaultUILanguage@4
-NtQueryDirectoryFile@44
-NtQueryDirectoryObject@28
-NtQueryEaFile@36
-NtQueryEvent@20
-NtQueryFullAttributesFile@8
-NtQueryInformationAtom@20
-NtQueryInformationFile@20
-NtQueryInformationJobObject@20
-NtQueryInformationPort@20
-NtQueryInformationProcess@20
-NtQueryInformationThread@20
-NtQueryInformationToken@20
-NtQueryInstallUILanguage@4
-NtQueryIntervalProfile@8
-NtQueryIoCompletion@20
-NtQueryKey@20
-NtQueryMultipleValueKey@24
-NtQueryMutant@20
-NtQueryObject@20
-NtQueryPerformanceCounter@8
-NtQuerySection@20
-NtQuerySecurityObject@20
-NtQuerySemaphore@20
-NtQuerySymbolicLinkObject@12
-NtQuerySystemEnvironmentValue@16
-NtQuerySystemInformation@16
-NtQuerySystemTime@4
-NtQueryTimer@20
-NtQueryTimerResolution@12
-NtQueryValueKey@24
-NtQueryVirtualMemory@24
-NtQueryVolumeInformationFile@20
-NtQueueApcThread@20
-NtRaiseException@12
-NtRaiseHardError@24
-NtReadFile@36
-NtReadFileScatter@36
-NtReadRequestData@24
-NtReadVirtualMemory@20
-NtRegisterThreadTerminatePort@4
-NtReleaseMutant@8
-NtReleaseSemaphore@12
-NtRemoveIoCompletion@20
-NtReplaceKey@12
-NtReplyPort@8
-NtReplyWaitReceivePort@16
-NtReplyWaitReceivePortEx@20
-NtReplyWaitReplyPort@8
-NtRequestPort@8
-NtRequestWaitReplyPort@12
-NtResetEvent@8
-NtRestoreKey@12
-NtResumeProcess@4
-NtResumeThread@8
-NtSaveKey@8
-NtSecureConnectPort@36
-NtSetContextThread@8
-NtSetDebugFilterState@12
-NtSetDefaultHardErrorPort@4
-NtSetDefaultLocale@8
-NtSetDefaultUILanguage@4
-NtSetEaFile@16
-NtSetEvent@8
-NtSetHighEventPair@4
-NtSetHighWaitLowEventPair@4
-NtSetInformationDebugObject@20
-NtSetInformationFile@20
-NtSetInformationJobObject@16
-NtSetInformationKey@16
-NtSetInformationObject@16
-NtSetInformationProcess@16
-NtSetInformationThread@16
-NtSetInformationToken@16
-NtSetIntervalProfile@8
-NtSetIoCompletion@20
-NtSetLdtEntries@24
-NtSetLowEventPair@4
-NtSetLowWaitHighEventPair@4
-NtSetSecurityObject@12
-NtSetSystemEnvironmentValue@8
-NtSetSystemInformation@12
-NtSetSystemPowerState@12
-NtSetSystemTime@8
-NtSetTimer@28
-NtSetTimerResolution@12
-NtSetUuidSeed@4
-NtSetValueKey@24
-NtSetVolumeInformationFile@20
-NtShutdownSystem@4
-NtSignalAndWaitForSingleObject@16
-NtStartProfile@4
-NtStopProfile@4
-NtSuspendProcess@4
-NtSuspendThread@8
-NtSystemDebugControl@24
-NtTerminateJobObject@8
-NtTerminateProcess@8
-NtTerminateThread@8
-NtTestAlert@0
-NtUnloadDriver@4
-NtUnloadKey@4
-NtUnlockFile@20
-NtUnlockVirtualMemory@16
-NtUnmapViewOfSection@8
-NtVdmControl@8
-NtWaitForDebugEvent@16
-NtWaitForMultipleObjects@20
-NtWaitForSingleObject@12
-NtWaitHighEventPair@4
-NtWaitLowEventPair@4
-NtWriteFile@36
-NtWriteFileGather@36
-NtWriteRequestData@24
-NtWriteVirtualMemory@20
-NtYieldExecution@0
+NtAcceptConnectPort
+NtAccessCheck
+NtAccessCheckAndAuditAlarm
+NtAddAtom
+NtAddBootEntry
+NtAdjustGroupsToken
+NtAdjustPrivilegesToken
+NtAlertResumeThread
+NtAlertThread
+NtAllocateLocallyUniqueId
+NtAllocateUuids
+NtAllocateVirtualMemory
+NtAssignProcessToJobObject
+NtCallbackReturn
+NtCancelIoFile
+NtCancelTimer
+NtClearEvent
+NtClose
+NtCloseObjectAuditAlarm
+NtCompareTokens
+NtCompleteConnectPort
+NtConnectPort
+NtContinue
+NtCreateDebugObject
+NtCreateDirectoryObject
+NtCreateEvent
+NtCreateEventPair
+NtCreateFile
+NtCreateIoCompletion
+NtCreateJobObject
+NtCreateKey
+NtCreateMailslotFile
+NtCreateMutant
+NtCreateNamedPipeFile
+NtCreatePagingFile
+NtCreatePort
+NtCreateProcess
+NtCreateProfile
+NtCreateSection
+NtCreateSemaphore
+NtCreateSymbolicLinkObject
+NtCreateThread
+NtCreateTimer
+NtCreateToken
+NtCreateWaitablePort
+NtCurrentTeb=_NtCurrentTeb
+NtDebugContinue
+NtDelayExecution
+NtDeleteAtom
+NtDeleteFile
+NtDeleteKey
+NtDeleteObjectAuditAlarm
+NtDeleteValueKey
+NtDeviceIoControlFile
+NtDisplayString
+NtDuplicateObject
+NtDuplicateToken
+NtEnumerateKey
+NtEnumerateValueKey
+NtExtendSection
+NtFindAtom
+NtFlushBuffersFile
+NtFlushInstructionCache
+NtFlushKey
+NtFlushVirtualMemory
+NtFlushWriteBuffer
+NtFreeVirtualMemory
+NtFsControlFile
+NtGetContextThread
+NtGetPlugPlayEvent
+NtImpersonateAnonymousToken
+NtImpersonateClientOfPort
+NtImpersonateThread
+NtInitializeRegistry
+NtIsProcessInJob
+NtListenPort
+NtLoadDriver
+NtLoadKey
+NtLoadKey2
+NtLockFile
+NtLockVirtualMemory
+NtMakeTemporaryObject
+NtMapViewOfSection
+NtNotifyChangeDirectoryFile
+NtNotifyChangeKey
+NtOpenDirectoryObject
+NtOpenEvent
+NtOpenEventPair
+NtOpenFile
+NtOpenIoCompletion
+NtOpenJobObject
+NtOpenKey
+NtOpenMutant
+NtOpenObjectAuditAlarm
+NtOpenProcess
+NtOpenProcessToken
+NtOpenSection
+NtOpenSemaphore
+NtOpenSymbolicLinkObject
+NtOpenThread
+NtOpenThreadToken
+NtOpenTimer
+NtPlugPlayControl
+NtPowerInformation
+NtPrivilegeCheck
+NtPrivilegedServiceAuditAlarm
+NtPrivilegeObjectAuditAlarm
+NtProtectVirtualMemory
+NtPulseEvent
+NtQueryAttributesFile
+NtQueryDebugFilterState
+NtQueryDefaultLocale
+NtQueryDefaultUILanguage
+NtQueryDirectoryFile
+NtQueryDirectoryObject
+NtQueryEaFile
+NtQueryEvent
+NtQueryFullAttributesFile
+NtQueryInformationAtom
+NtQueryInformationFile
+NtQueryInformationJobObject
+NtQueryInformationPort
+NtQueryInformationProcess
+NtQueryInformationThread
+NtQueryInformationToken
+NtQueryInstallUILanguage
+NtQueryIntervalProfile
+NtQueryIoCompletion
+NtQueryKey
+NtQueryMultipleValueKey
+NtQueryMutant
+NtQueryObject
+NtQueryPerformanceCounter
+NtQuerySection
+NtQuerySecurityObject
+NtQuerySemaphore
+NtQuerySymbolicLinkObject
+NtQuerySystemEnvironmentValue
+NtQuerySystemInformation
+NtQuerySystemTime
+NtQueryTimer
+NtQueryTimerResolution
+NtQueryValueKey
+NtQueryVirtualMemory
+NtQueryVolumeInformationFile
+NtQueueApcThread
+NtRaiseException
+NtRaiseHardError
+NtReadFile
+NtReadFileScatter
+NtReadRequestData
+NtReadVirtualMemory
+NtRegisterThreadTerminatePort
+NtReleaseMutant
+NtReleaseSemaphore
+NtRemoveIoCompletion
+NtReplaceKey
+NtReplyPort
+NtReplyWaitReceivePort
+NtReplyWaitReceivePortEx
+NtReplyWaitReplyPort
+NtRequestPort
+NtRequestWaitReplyPort
+NtResetEvent
+NtRestoreKey
+NtResumeProcess
+NtResumeThread
+NtSaveKey
+NtSecureConnectPort
+NtSetContextThread
+NtSetDebugFilterState
+NtSetDefaultHardErrorPort
+NtSetDefaultLocale
+NtSetDefaultUILanguage
+NtSetEaFile
+NtSetEvent
+NtSetHighEventPair
+NtSetHighWaitLowEventPair
+NtSetInformationDebugObject
+NtSetInformationFile
+NtSetInformationJobObject
+NtSetInformationKey
+NtSetInformationObject
+NtSetInformationProcess
+NtSetInformationThread
+NtSetInformationToken
+NtSetIntervalProfile
+NtSetIoCompletion
+NtSetLdtEntries
+NtSetLowEventPair
+NtSetLowWaitHighEventPair
+NtSetSecurityObject
+NtSetSystemEnvironmentValue
+NtSetSystemInformation
+NtSetSystemPowerState
+NtSetSystemTime
+NtSetTimer
+NtSetTimerResolution
+NtSetUuidSeed
+NtSetValueKey
+NtSetVolumeInformationFile
+NtShutdownSystem
+NtSignalAndWaitForSingleObject
+NtStartProfile
+NtStopProfile
+NtSuspendProcess
+NtSuspendThread
+NtSystemDebugControl
+NtTerminateJobObject
+NtTerminateProcess
+NtTerminateThread
+NtTestAlert
+NtUnloadDriver
+NtUnloadKey
+NtUnlockFile
+NtUnlockVirtualMemory
+NtUnmapViewOfSection
+NtVdmControl
+NtWaitForDebugEvent
+NtWaitForMultipleObjects
+NtWaitForSingleObject
+NtWaitHighEventPair
+NtWaitLowEventPair
+NtWriteFile
+NtWriteFileGather
+NtWriteRequestData
+NtWriteVirtualMemory
+NtYieldExecution
 ;PfxFindPrefix
 ;PfxInitialize
 ;PfxInsertPrefix
@@ -299,672 +299,672 @@ NtYieldExecution@0
 ;PropertyLengthAsVariant
 ;RestoreEm87Context
 ;RtlAbortRXact
-RtlAbsoluteToSelfRelativeSD@12
-RtlAcquirePebLock@0
-RtlAcquireResourceExclusive@8
-RtlAcquireResourceShared@8
-RtlAcquireSRWLockExclusive@4
-RtlAcquireSRWLockShared@4
-RtlAddAccessAllowedAce@16
-RtlAddAccessAllowedAceEx@20
-RtlAddAccessAllowedObjectAce@28
-RtlAddAccessDeniedAce@16
-RtlAddAccessDeniedAceEx@20
-RtlAddAccessDeniedObjectAce@28
-RtlAddAce@20
+RtlAbsoluteToSelfRelativeSD
+RtlAcquirePebLock
+RtlAcquireResourceExclusive
+RtlAcquireResourceShared
+RtlAcquireSRWLockExclusive
+RtlAcquireSRWLockShared
+RtlAddAccessAllowedAce
+RtlAddAccessAllowedAceEx
+RtlAddAccessAllowedObjectAce
+RtlAddAccessDeniedAce
+RtlAddAccessDeniedAceEx
+RtlAddAccessDeniedObjectAce
+RtlAddAce
 ;RtlAddActionToRXact
-RtlAddAtomToAtomTable@12
+RtlAddAtomToAtomTable
 ;RtlAddAttributeActionToRXact
-RtlAddAuditAccessAce@24
-RtlAddAuditAccessAceEx@28
-RtlAddAuditAccessObjectAce@36
+RtlAddAuditAccessAce
+RtlAddAuditAccessAceEx
+RtlAddAuditAccessObjectAce
 ;RtlAddCompoundAce
-RtlAddMandatoryAce@24
-RtlAddRange@36
-RtlAddVectoredExceptionHandler@8
-RtlAdjustPrivilege@16
-RtlAllocateAndInitializeSid@44
-RtlAllocateHandle@8
-RtlAllocateHeap@12
-RtlAnsiCharToUnicodeChar@4
-RtlAnsiStringToUnicodeSize@4=RtlxAnsiStringToUnicodeSize@4
-RtlAnsiStringToUnicodeString@12
-RtlAppendAsciizToString@8
-RtlAppendStringToString@8
-RtlAppendUnicodeStringToString@8
-RtlAppendUnicodeToString@8
+RtlAddMandatoryAce
+RtlAddRange
+RtlAddVectoredExceptionHandler
+RtlAdjustPrivilege
+RtlAllocateAndInitializeSid
+RtlAllocateHandle
+RtlAllocateHeap
+RtlAnsiCharToUnicodeChar
+RtlAnsiStringToUnicodeSize=RtlxAnsiStringToUnicodeSize
+RtlAnsiStringToUnicodeString
+RtlAppendAsciizToString
+RtlAppendStringToString
+RtlAppendUnicodeStringToString
+RtlAppendUnicodeToString
 ;RtlApplyRXact
 ;RtlApplyRXactNoFlush
-RtlAreAllAccessesGranted@8
-RtlAreAnyAccessesGranted@8
-RtlAreBitsClear@12
-RtlAreBitsSet@12
-RtlAssert@16
-RtlCaptureStackBackTrace@16
-RtlCharToInteger@12
-RtlCheckRegistryKey@8
-RtlClearAllBits@4
-RtlClearBits@12
-RtlCompactHeap@8
-RtlCompareMemory@12
-RtlCompareMemoryUlong@12
-RtlCompareString@12
-RtlCompareUnicodeString@12
-RtlCompressBuffer@32
-RtlComputeCrc32@12
+RtlAreAllAccessesGranted
+RtlAreAnyAccessesGranted
+RtlAreBitsClear
+RtlAreBitsSet
+RtlAssert
+RtlCaptureStackBackTrace
+RtlCharToInteger
+RtlCheckRegistryKey
+RtlClearAllBits
+RtlClearBits
+RtlCompactHeap
+RtlCompareMemory
+RtlCompareMemoryUlong
+RtlCompareString
+RtlCompareUnicodeString
+RtlCompressBuffer
+RtlComputeCrc32
 ;RtlConsoleMultiByteToUnicodeN
-RtlConvertExclusiveToShared@4
-RtlConvertLongToLargeInteger@4
-RtlConvertSharedToExclusive@4
-RtlConvertSidToUnicodeString@12
+RtlConvertExclusiveToShared
+RtlConvertLongToLargeInteger
+RtlConvertSharedToExclusive
+RtlConvertSidToUnicodeString
 ;RtlConvertUiListToApiList
-RtlConvertUlongToLargeInteger@4
-RtlCopyLuid@8
-RtlCopyLuidAndAttributesArray@12
-RtlCopyRangeList@8
-RtlCopySecurityDescriptor@8
-RtlCopySid@12
-RtlCopySidAndAttributesArray@28
-RtlCopyString@8
-RtlCopyUnicodeString@8
-RtlCreateAcl@12
+RtlConvertUlongToLargeInteger
+RtlCopyLuid
+RtlCopyLuidAndAttributesArray
+RtlCopyRangeList
+RtlCopySecurityDescriptor
+RtlCopySid
+RtlCopySidAndAttributesArray
+RtlCopyString
+RtlCopyUnicodeString
+RtlCreateAcl
 ;RtlCreateAndSetSD
-RtlCreateAtomTable@8
-RtlCreateEnvironment@8
-RtlCreateHeap@24
-RtlCreateProcessParameters@40
-RtlCreateQueryDebugBuffer@8
-RtlCreateRegistryKey@8
-RtlCreateSecurityDescriptor@8
-RtlCreateTagHeap@16
-RtlCreateTimer@28
-RtlCreateTimerQueue@4
-RtlCreateUnicodeString@8
-RtlCreateUnicodeStringFromAsciiz@8
-RtlCreateUserProcess@40
+RtlCreateAtomTable
+RtlCreateEnvironment
+RtlCreateHeap
+RtlCreateProcessParameters
+RtlCreateQueryDebugBuffer
+RtlCreateRegistryKey
+RtlCreateSecurityDescriptor
+RtlCreateTagHeap
+RtlCreateTimer
+RtlCreateTimerQueue
+RtlCreateUnicodeString
+RtlCreateUnicodeStringFromAsciiz
+RtlCreateUserProcess
 ;RtlCreateUserSecurityObject
-RtlCreateUserThread@40
-RtlCustomCPToUnicodeN@24
-RtlCutoverTimeToSystemTime@16
-RtlDeNormalizeProcessParams@4
-RtlDecodePointer=RtlEncodePointer@4
-RtlDecompressBuffer@24
-RtlDecompressFragment@32
-RtlDelete@4
-RtlDeleteAce@8
-RtlDeleteAtomFromAtomTable@8
-RtlDeleteCriticalSection@4
-RtlDeleteElementGenericTable@8
-RtlDeleteElementGenericTableAvl@8
-RtlDeleteNoSplay@8
-RtlDeleteOwnersRanges@8
-RtlDeleteRange@24
-RtlDeleteRegistryValue@12
-RtlDeleteResource@4
-RtlDeleteSecurityObject@4
-RtlDeleteTimer@12
-RtlDeleteTimerQueue@4
-RtlDeleteTimerQueueEx@8
-RtlDeregisterWait@4
-RtlDeregisterWaitEx@8
-RtlDestroyAtomTable@4
-RtlDestroyEnvironment@4
-RtlDestroyHandleTable@4
-RtlDestroyHeap@4
-RtlDestroyProcessParameters@4
-RtlDestroyQueryDebugBuffer@4
-RtlDetermineDosPathNameType_U@4
-RtlDllShutdownInProgress@0
-RtlDoesFileExists_U@4
-RtlDosPathNameToNtPathName_U@16
-RtlDosPathNameToRelativeNtPathName_U@16
-RtlDosSearchPath_U@24
-RtlDowncaseUnicodeChar@4
-RtlDowncaseUnicodeString@12
-RtlDumpResource@4
-RtlDuplicateUnicodeString@12
-RtlEmptyAtomTable@8
-RtlEncodePointer@4
-RtlEnlargedIntegerMultiply@8
-RtlEnlargedUnsignedDivide@16
-RtlEnlargedUnsignedMultiply@8
-RtlEnterCriticalSection@4
-RtlEnumProcessHeaps@8
-RtlEnumerateGenericTable@8
-RtlEnumerateGenericTableAvl@8
-RtlEnumerateGenericTableLikeADirectory@28
-RtlEnumerateGenericTableWithoutSplaying@8
-RtlEnumerateGenericTableWithoutSplayingAvl@8
-RtlEqualComputerName@8
-RtlEqualDomainName@8
-RtlEqualLuid@8
-RtlEqualPrefixSid@8
-RtlEqualSid@8
-RtlEqualString@12
-RtlEqualUnicodeString@12
-RtlEraseUnicodeString@4
-RtlExitUserThread@4
-RtlExpandEnvironmentStrings_U@16
-RtlExtendHeap@16
-RtlExtendedIntegerMultiply@12
-RtlExtendedLargeIntegerDivide@16
-RtlExtendedMagicDivide@20
-RtlFillMemory@12
-RtlFillMemoryUlong@12
-RtlFindClearBits@12
-RtlFindClearBitsAndSet@12
-RtlFindClearRuns@16
-RtlFindLastBackwardRunClear@12
-RtlFindLeastSignificantBit@8
-RtlFindLongestRunClear@8
-RtlFindLongestRunSet@8
-RtlFindMessage@20
-RtlFindMostSignificantBit@8
-RtlFindNextForwardRunClear@12
-RtlFindRange@48
-RtlFindSetBits@12
-RtlFindSetBitsAndClear@12
-RtlFirstFreeAce@8
-RtlFormatCurrentUserKeyPath@4
-RtlFormatMessage@32
-RtlFreeAnsiString@4
-RtlFreeHandle@8
-RtlFreeHeap@12
-RtlFreeOemString@4
-RtlFreeRangeList@4
-RtlFreeSid@4
-RtlFreeUnicodeString@4
-RtlFreeUserThreadStack@8
-RtlGUIDFromString@8
-RtlGenerate8dot3Name@16
-RtlGetAce@12
+RtlCreateUserThread
+RtlCustomCPToUnicodeN
+RtlCutoverTimeToSystemTime
+RtlDeNormalizeProcessParams
+RtlDecodePointer=RtlEncodePointer
+RtlDecompressBuffer
+RtlDecompressFragment
+RtlDelete
+RtlDeleteAce
+RtlDeleteAtomFromAtomTable
+RtlDeleteCriticalSection
+RtlDeleteElementGenericTable
+RtlDeleteElementGenericTableAvl
+RtlDeleteNoSplay
+RtlDeleteOwnersRanges
+RtlDeleteRange
+RtlDeleteRegistryValue
+RtlDeleteResource
+RtlDeleteSecurityObject
+RtlDeleteTimer
+RtlDeleteTimerQueue
+RtlDeleteTimerQueueEx
+RtlDeregisterWait
+RtlDeregisterWaitEx
+RtlDestroyAtomTable
+RtlDestroyEnvironment
+RtlDestroyHandleTable
+RtlDestroyHeap
+RtlDestroyProcessParameters
+RtlDestroyQueryDebugBuffer
+RtlDetermineDosPathNameType_U
+RtlDllShutdownInProgress
+RtlDoesFileExists_U
+RtlDosPathNameToNtPathName_U
+RtlDosPathNameToRelativeNtPathName_U
+RtlDosSearchPath_U
+RtlDowncaseUnicodeChar
+RtlDowncaseUnicodeString
+RtlDumpResource
+RtlDuplicateUnicodeString
+RtlEmptyAtomTable
+RtlEncodePointer
+RtlEnlargedIntegerMultiply
+RtlEnlargedUnsignedDivide
+RtlEnlargedUnsignedMultiply
+RtlEnterCriticalSection
+RtlEnumProcessHeaps
+RtlEnumerateGenericTable
+RtlEnumerateGenericTableAvl
+RtlEnumerateGenericTableLikeADirectory
+RtlEnumerateGenericTableWithoutSplaying
+RtlEnumerateGenericTableWithoutSplayingAvl
+RtlEqualComputerName
+RtlEqualDomainName
+RtlEqualLuid
+RtlEqualPrefixSid
+RtlEqualSid
+RtlEqualString
+RtlEqualUnicodeString
+RtlEraseUnicodeString
+RtlExitUserThread
+RtlExpandEnvironmentStrings_U
+RtlExtendHeap
+RtlExtendedIntegerMultiply
+RtlExtendedLargeIntegerDivide
+RtlExtendedMagicDivide
+RtlFillMemory
+RtlFillMemoryUlong
+RtlFindClearBits
+RtlFindClearBitsAndSet
+RtlFindClearRuns
+RtlFindLastBackwardRunClear
+RtlFindLeastSignificantBit
+RtlFindLongestRunClear
+RtlFindLongestRunSet
+RtlFindMessage
+RtlFindMostSignificantBit
+RtlFindNextForwardRunClear
+RtlFindRange
+RtlFindSetBits
+RtlFindSetBitsAndClear
+RtlFirstFreeAce
+RtlFormatCurrentUserKeyPath
+RtlFormatMessage
+RtlFreeAnsiString
+RtlFreeHandle
+RtlFreeHeap
+RtlFreeOemString
+RtlFreeRangeList
+RtlFreeSid
+RtlFreeUnicodeString
+RtlFreeUserThreadStack
+RtlGUIDFromString
+RtlGenerate8dot3Name
+RtlGetAce
 ;RtlGetCallersAddress
-RtlGetCompressionWorkSpaceSize@12
-RtlGetControlSecurityDescriptor@12
-RtlGetCurrentDirectory_U@8
-RtlGetDaclSecurityDescriptor@16
-RtlGetElementGenericTable@8
-RtlGetElementGenericTableAvl@8
-RtlGetFirstRange@12
-RtlGetFullPathName_U@16
-RtlGetGroupSecurityDescriptor@12
-RtlGetLastNtStatus@0
-RtlGetLastWin32Error@0
-RtlGetLongestNtPathLength@0
-RtlGetNextRange@12
-RtlGetNtGlobalFlags@0
-RtlGetNtProductType@4
-RtlGetNtVersionNumbers@12
-RtlGetOwnerSecurityDescriptor@12
-RtlGetProcessHeaps@8
-RtlGetSaclSecurityDescriptor@16
-RtlGetSecurityDescriptorRMControl@8
-RtlGetSetBootStatusData@24
-RtlGetUserInfoHeap@20
-RtlGetVersion@4
-RtlHashUnicodeString@16
-RtlIdentifierAuthoritySid@4
-RtlImageDirectoryEntryToData@16
-RtlImageNtHeader@4
-RtlImageRvaToSection@12
-RtlImageRvaToVa@16
-RtlImpersonateSelf@4
-RtlInitAnsiString@8
-RtlInitCodePageTable@8
-RtlInitNlsTables@16
-RtlInitString@8
-RtlInitUnicodeString@8
-RtlInitUnicodeStringEx@8
+RtlGetCompressionWorkSpaceSize
+RtlGetControlSecurityDescriptor
+RtlGetCurrentDirectory_U
+RtlGetDaclSecurityDescriptor
+RtlGetElementGenericTable
+RtlGetElementGenericTableAvl
+RtlGetFirstRange
+RtlGetFullPathName_U
+RtlGetGroupSecurityDescriptor
+RtlGetLastNtStatus
+RtlGetLastWin32Error
+RtlGetLongestNtPathLength
+RtlGetNextRange
+RtlGetNtGlobalFlags
+RtlGetNtProductType
+RtlGetNtVersionNumbers
+RtlGetOwnerSecurityDescriptor
+RtlGetProcessHeaps
+RtlGetSaclSecurityDescriptor
+RtlGetSecurityDescriptorRMControl
+RtlGetSetBootStatusData
+RtlGetUserInfoHeap
+RtlGetVersion
+RtlHashUnicodeString
+RtlIdentifierAuthoritySid
+RtlImageDirectoryEntryToData
+RtlImageNtHeader
+RtlImageRvaToSection
+RtlImageRvaToVa
+RtlImpersonateSelf
+RtlInitAnsiString
+RtlInitCodePageTable
+RtlInitNlsTables
+RtlInitString
+RtlInitUnicodeString
+RtlInitUnicodeStringEx
 ;RtlInitializeAtomPackage
-RtlInitializeBitMap@12
-RtlInitializeConditionVariable@4
-RtlInitializeContext@20
-RtlInitializeCriticalSection@4
-RtlInitializeCriticalSectionAndSpinCount@8
-RtlInitializeGenericTable@20
-RtlInitializeGenericTableAvl@20
-RtlInitializeHandleTable@12
-RtlInitializeRangeList@4
-RtlInitializeResource@4
+RtlInitializeBitMap
+RtlInitializeConditionVariable
+RtlInitializeContext
+RtlInitializeCriticalSection
+RtlInitializeCriticalSectionAndSpinCount
+RtlInitializeGenericTable
+RtlInitializeGenericTableAvl
+RtlInitializeHandleTable
+RtlInitializeRangeList
+RtlInitializeResource
 ;RtlInitializeRXact
-RtlInitializeSid@12
-RtlInitializeSRWLock@4
-RtlInsertElementGenericTable@16
-RtlInsertElementGenericTableAvl@16
-RtlInsertElementGenericTableFull@24
-RtlInsertElementGenericTableFullAvl@24
-RtlInt64ToUnicodeString@16
-RtlIntegerToChar@16
-RtlIntegerToUnicodeString@12
-RtlInvertRangeList@8
-RtlIpv4AddressToStringA@8
-RtlIpv4AddressToStringExA@16
-RtlIpv4AddressToStringExW@16
-RtlIpv4AddressToStringW@8
-RtlIpv4StringToAddressA@16
-RtlIpv4StringToAddressExA@16
-RtlIpv4StringToAddressExW@16
-RtlIpv4StringToAddressW@16
-RtlIpv6AddressToStringA@8
-RtlIpv6AddressToStringExA@20
-RtlIpv6AddressToStringExW@20
-RtlIpv6AddressToStringW@8
-RtlIpv6StringToAddressA@12
-RtlIpv6StringToAddressExA@16
-RtlIpv6StringToAddressExW@16
-RtlIpv6StringToAddressW@12
-RtlIsDosDeviceName_U@4
-RtlIsGenericTableEmpty@4
-RtlIsGenericTableEmptyAvl@4
-RtlIsNameLegalDOS8Dot3@12
-RtlIsRangeAvailable@40
-RtlIsTextUnicode@12
-RtlIsValidHandle@8
-RtlIsValidIndexHandle@12
-RtlLargeIntegerAdd@16
-RtlLargeIntegerArithmeticShift@12
-RtlLargeIntegerDivide@20
-RtlLargeIntegerNegate@8
-RtlLargeIntegerShiftLeft@12
-RtlLargeIntegerShiftRight@12
-RtlLargeIntegerSubtract@16
-RtlLargeIntegerToChar@16
-RtlLeaveCriticalSection@4
-RtlLengthRequiredSid@4
-RtlLengthSecurityDescriptor@4
-RtlLengthSid@4
-RtlLocalTimeToSystemTime@8
-RtlLockBootStatusData@4
-RtlLockHeap@4
-RtlLookupAtomInAtomTable@12
-RtlLookupElementGenericTable@8
-RtlLookupElementGenericTableAvl@8
-RtlLookupElementGenericTableFull@16
-RtlLookupElementGenericTableFullAvl@16
-RtlMakeSelfRelativeSD@12
-RtlMapGenericMask@8
-RtlMergeRangeLists@16
-RtlMoveMemory@12
-RtlMultiByteToUnicodeN@20
-RtlMultiByteToUnicodeSize@12
+RtlInitializeSid
+RtlInitializeSRWLock
+RtlInsertElementGenericTable
+RtlInsertElementGenericTableAvl
+RtlInsertElementGenericTableFull
+RtlInsertElementGenericTableFullAvl
+RtlInt64ToUnicodeString
+RtlIntegerToChar
+RtlIntegerToUnicodeString
+RtlInvertRangeList
+RtlIpv4AddressToStringA
+RtlIpv4AddressToStringExA
+RtlIpv4AddressToStringExW
+RtlIpv4AddressToStringW
+RtlIpv4StringToAddressA
+RtlIpv4StringToAddressExA
+RtlIpv4StringToAddressExW
+RtlIpv4StringToAddressW
+RtlIpv6AddressToStringA
+RtlIpv6AddressToStringExA
+RtlIpv6AddressToStringExW
+RtlIpv6AddressToStringW
+RtlIpv6StringToAddressA
+RtlIpv6StringToAddressExA
+RtlIpv6StringToAddressExW
+RtlIpv6StringToAddressW
+RtlIsDosDeviceName_U
+RtlIsGenericTableEmpty
+RtlIsGenericTableEmptyAvl
+RtlIsNameLegalDOS8Dot3
+RtlIsRangeAvailable
+RtlIsTextUnicode
+RtlIsValidHandle
+RtlIsValidIndexHandle
+RtlLargeIntegerAdd
+RtlLargeIntegerArithmeticShift
+RtlLargeIntegerDivide
+RtlLargeIntegerNegate
+RtlLargeIntegerShiftLeft
+RtlLargeIntegerShiftRight
+RtlLargeIntegerSubtract
+RtlLargeIntegerToChar
+RtlLeaveCriticalSection
+RtlLengthRequiredSid
+RtlLengthSecurityDescriptor
+RtlLengthSid
+RtlLocalTimeToSystemTime
+RtlLockBootStatusData
+RtlLockHeap
+RtlLookupAtomInAtomTable
+RtlLookupElementGenericTable
+RtlLookupElementGenericTableAvl
+RtlLookupElementGenericTableFull
+RtlLookupElementGenericTableFullAvl
+RtlMakeSelfRelativeSD
+RtlMapGenericMask
+RtlMergeRangeLists
+RtlMoveMemory
+RtlMultiByteToUnicodeN
+RtlMultiByteToUnicodeSize
 ;RtlNewInstanceSecurityObject
 ;RtlNewSecurityGrantedAccess
-RtlNewSecurityObject@24
-RtlNormalizeProcessParams@4
-RtlNtPathNameToDosPathName@16
-RtlNtStatusToDosError@4
-RtlNumberGenericTableElements@4
-RtlNumberGenericTableElementsAvl@4
-RtlNumberOfClearBits@4
-RtlNumberOfSetBits@4
-RtlOemStringToUnicodeSize@4=RtlxOemStringToUnicodeSize@4
-RtlOemStringToUnicodeString@12
-RtlOemToUnicodeN@20
-RtlOpenCurrentUser@8
-RtlPcToFileHeader@8
-RtlPinAtomInAtomTable@8
-RtlPrefixString@12
-RtlPrefixUnicodeString@12
+RtlNewSecurityObject
+RtlNormalizeProcessParams
+RtlNtPathNameToDosPathName
+RtlNtStatusToDosError
+RtlNumberGenericTableElements
+RtlNumberGenericTableElementsAvl
+RtlNumberOfClearBits
+RtlNumberOfSetBits
+RtlOemStringToUnicodeSize=RtlxOemStringToUnicodeSize
+RtlOemStringToUnicodeString
+RtlOemToUnicodeN
+RtlOpenCurrentUser
+RtlPcToFileHeader
+RtlPinAtomInAtomTable
+RtlPrefixString
+RtlPrefixUnicodeString
 ;RtlProtectHeap
-RtlQueryAtomInAtomTable@24
-RtlQueryEnvironmentVariable_U@12
-RtlQueryInformationAcl@16
+RtlQueryAtomInAtomTable
+RtlQueryEnvironmentVariable_U
+RtlQueryInformationAcl
 ;RtlQueryProcessBackTraceInformation
-RtlQueryProcessDebugInformation@12
+RtlQueryProcessDebugInformation
 ;RtlQueryProcessHeapInformation
 ;RtlQueryProcessLockInformation
-RtlQueryRegistryValues@20
-RtlQuerySecurityObject@20
-RtlQueryTagHeap@20
-RtlQueryTimeZoneInformation@4
-RtlQueueWorkItem@12
-RtlRaiseException@4
-RtlRaiseStatus@4
-RtlRandom@4
-RtlRandomEx=RtlRandom@4
-RtlReAllocateHeap@16
-RtlRealPredecessor@4
-RtlRealSuccessor@4
-RtlRegisterWait@24
-RtlReleasePebLock@0
-RtlReleaseRelativeName@4
-RtlReleaseResource@4
-RtlReleaseSRWLockExclusive@4
-RtlReleaseSRWLockShared@4
+RtlQueryRegistryValues
+RtlQuerySecurityObject
+RtlQueryTagHeap
+RtlQueryTimeZoneInformation
+RtlQueueWorkItem
+RtlRaiseException
+RtlRaiseStatus
+RtlRandom
+RtlRandomEx=RtlRandom
+RtlReAllocateHeap
+RtlRealPredecessor
+RtlRealSuccessor
+RtlRegisterWait
+RtlReleasePebLock
+RtlReleaseRelativeName
+RtlReleaseResource
+RtlReleaseSRWLockExclusive
+RtlReleaseSRWLockShared
 ;RtlRemoteCall
-RtlRemoveVectoredExceptionHandler@4
-RtlResetRtlTranslations@4
-RtlRestoreLastWin32Error@4=RtlSetLastWin32Error@4
-RtlRunDecodeUnicodeString@8
-RtlRunEncodeUnicodeString@8
-RtlSecondsSince1970ToTime@8
-RtlSecondsSince1980ToTime@8
-RtlSelfRelativeToAbsoluteSD2@8
-RtlSelfRelativeToAbsoluteSD@44
-RtlSetAllBits@4
-RtlSetAttributesSecurityDescriptor@12
-RtlSetBits@12
-RtlSetControlSecurityDescriptor@12
-RtlSetCriticalSectionSpinCount@8
-RtlSetCurrentDirectory_U@4
-RtlSetCurrentEnvironment@8
-RtlSetDaclSecurityDescriptor@16
-RtlSetEnvironmentVariable@12
-RtlSetGroupSecurityDescriptor@12
-RtlSetInformationAcl@16
-RtlSetLastWin32Error@4
-RtlSetLastWin32ErrorAndNtStatusFromNtStatus@4
-RtlSetOwnerSecurityDescriptor@12
-RtlSetProcessIsCritical@12
-RtlSetSaclSecurityDescriptor@16
-RtlSetSecurityDescriptorRMControl@8
-RtlSetSecurityObject@20
-RtlSetTimeZoneInformation@4
+RtlRemoveVectoredExceptionHandler
+RtlResetRtlTranslations
+RtlRestoreLastWin32Error=RtlSetLastWin32Error
+RtlRunDecodeUnicodeString
+RtlRunEncodeUnicodeString
+RtlSecondsSince1970ToTime
+RtlSecondsSince1980ToTime
+RtlSelfRelativeToAbsoluteSD
+RtlSelfRelativeToAbsoluteSD2
+RtlSetAllBits
+RtlSetAttributesSecurityDescriptor
+RtlSetBits
+RtlSetControlSecurityDescriptor
+RtlSetCriticalSectionSpinCount
+RtlSetCurrentDirectory_U
+RtlSetCurrentEnvironment
+RtlSetDaclSecurityDescriptor
+RtlSetEnvironmentVariable
+RtlSetGroupSecurityDescriptor
+RtlSetInformationAcl
+RtlSetLastWin32Error
+RtlSetLastWin32ErrorAndNtStatusFromNtStatus
+RtlSetOwnerSecurityDescriptor
+RtlSetProcessIsCritical
+RtlSetSaclSecurityDescriptor
+RtlSetSecurityDescriptorRMControl
+RtlSetSecurityObject
+RtlSetTimeZoneInformation
 ;RtlSetUnicodeCallouts
-RtlSetUserFlagsHeap@16
-RtlSetUserValueHeap@16
-RtlSizeHeap@12
-RtlSleepConditionVariableCS@12
-RtlSleepConditionVariableSRW@16
-RtlSplay@4
+RtlSetUserFlagsHeap
+RtlSetUserValueHeap
+RtlSizeHeap
+RtlSleepConditionVariableCS
+RtlSleepConditionVariableSRW
+RtlSplay
 ;RtlStartRXact
-RtlStringFromGUID@8
-RtlSubAuthorityCountSid@4
-RtlSubAuthoritySid@8
-RtlSubtreePredecessor@4
-RtlSubtreeSuccessor@4
-RtlSystemTimeToLocalTime@8
-RtlTimeFieldsToTime@8
-RtlTimeToElapsedTimeFields@8
-RtlTimeToSecondsSince1970@8
-RtlTimeToSecondsSince1980@8
-RtlTimeToTimeFields@8
-RtlTryEnterCriticalSection@4
-@RtlUlongByteSwap@4
-@RtlUlonglongByteSwap@8
-RtlUnhandledExceptionFilter@4
-RtlUnicodeStringToAnsiSize@4=RtlxUnicodeStringToAnsiSize@4
-RtlUnicodeStringToAnsiString@12
-RtlUnicodeStringToCountedOemString@12
-RtlUnicodeStringToInteger@12
-RtlUnicodeStringToOemSize@4=RtlxUnicodeStringToOemSize@4
-RtlUnicodeStringToOemString@12
-RtlUnicodeToCustomCPN@24
-RtlUnicodeToMultiByteN@20
-RtlUnicodeToMultiByteSize@12
-RtlUnicodeToOemN@20
-RtlUniform@4
-RtlUnlockBootStatusData@4
-RtlUnlockHeap@4
-RtlUnwind@16
-RtlUpcaseUnicodeChar@4
-RtlUpcaseUnicodeString@12
-RtlUpcaseUnicodeStringToAnsiString@12
-RtlUpcaseUnicodeStringToCountedOemString@12
-RtlUpcaseUnicodeStringToOemString@12
-RtlUpcaseUnicodeToCustomCPN@24
-RtlUpcaseUnicodeToMultiByteN@20
-RtlUpcaseUnicodeToOemN@20
-RtlUpdateTimer@16
-RtlUpperChar@4
-RtlUpperString@8
-RtlUsageHeap@12
-@RtlUshortByteSwap@4
-RtlValidAcl@4
-RtlValidRelativeSecurityDescriptor@12
-RtlValidSecurityDescriptor@4
-RtlValidSid@4
-RtlValidateHeap@12
-RtlValidateProcessHeaps@0
-RtlValidateUnicodeString@8
-RtlVerifyVersionInfo@16
+RtlStringFromGUID
+RtlSubAuthorityCountSid
+RtlSubAuthoritySid
+RtlSubtreePredecessor
+RtlSubtreeSuccessor
+RtlSystemTimeToLocalTime
+RtlTimeFieldsToTime
+RtlTimeToElapsedTimeFields
+RtlTimeToSecondsSince1970
+RtlTimeToSecondsSince1980
+RtlTimeToTimeFields
+RtlTryEnterCriticalSection
+@RtlUlongByteSwap
+@RtlUlonglongByteSwap
+RtlUnhandledExceptionFilter
+RtlUnicodeStringToAnsiSize=RtlxUnicodeStringToAnsiSize
+RtlUnicodeStringToAnsiString
+RtlUnicodeStringToCountedOemString
+RtlUnicodeStringToInteger
+RtlUnicodeStringToOemSize=RtlxUnicodeStringToOemSize
+RtlUnicodeStringToOemString
+RtlUnicodeToCustomCPN
+RtlUnicodeToMultiByteN
+RtlUnicodeToMultiByteSize
+RtlUnicodeToOemN
+RtlUniform
+RtlUnlockBootStatusData
+RtlUnlockHeap
+RtlUnwind
+RtlUpcaseUnicodeChar
+RtlUpcaseUnicodeString
+RtlUpcaseUnicodeStringToAnsiString
+RtlUpcaseUnicodeStringToCountedOemString
+RtlUpcaseUnicodeStringToOemString
+RtlUpcaseUnicodeToCustomCPN
+RtlUpcaseUnicodeToMultiByteN
+RtlUpcaseUnicodeToOemN
+RtlUpdateTimer
+RtlUpperChar
+RtlUpperString
+RtlUsageHeap
+@RtlUshortByteSwap
+RtlValidAcl
+RtlValidRelativeSecurityDescriptor
+RtlValidSecurityDescriptor
+RtlValidSid
+RtlValidateHeap
+RtlValidateProcessHeaps
+RtlValidateUnicodeString
+RtlVerifyVersionInfo
 ;RtlWalkHeap
-RtlWakeAllConditionVariable@4
-RtlWakeConditionVariable@4
-RtlWriteRegistryValue@24
+RtlWakeAllConditionVariable
+RtlWakeConditionVariable
+RtlWriteRegistryValue
 ;RtlZeroHeap
-RtlZeroMemory@8
-RtlpEnsureBufferSize@12
-RtlpNtCreateKey@24
-RtlpNtEnumerateSubKey@16
-RtlpNtMakeTemporaryKey@4
-RtlpNtOpenKey@16
-RtlpNtQueryValueKey@20
-RtlpNtSetValueKey@16
-RtlpUnWaitCriticalSection@4
-RtlpWaitForCriticalSection@4
-RtlxAnsiStringToUnicodeSize@4
-RtlxOemStringToUnicodeSize@4
-RtlxUnicodeStringToAnsiSize@4
-RtlxUnicodeStringToOemSize@4
+RtlZeroMemory
+RtlpEnsureBufferSize
+RtlpNtCreateKey
+RtlpNtEnumerateSubKey
+RtlpNtMakeTemporaryKey
+RtlpNtOpenKey
+RtlpNtQueryValueKey
+RtlpNtSetValueKey
+RtlpUnWaitCriticalSection
+RtlpWaitForCriticalSection
+RtlxAnsiStringToUnicodeSize
+RtlxOemStringToUnicodeSize
+RtlxUnicodeStringToAnsiSize
+RtlxUnicodeStringToOemSize
 ;SaveEm87Context
-VerSetConditionMask@16
-ZwAcceptConnectPort@24
-ZwAccessCheck@32
-ZwAccessCheckAndAuditAlarm@44
-ZwAddAtom@12
-ZwAdjustGroupsToken@24
-ZwAdjustPrivilegesToken@24
-ZwAlertResumeThread@8
-ZwAlertThread@4
-ZwAllocateLocallyUniqueId@4
-ZwAllocateUuids@16
-ZwAllocateVirtualMemory@24
-ZwAssignProcessToJobObject@8
-ZwCallbackReturn@12
-ZwCancelIoFile@8
-ZwCancelTimer@8
-ZwClearEvent@4
-ZwClose@4
-ZwCloseObjectAuditAlarm@12
-ZwCompareTokens@12
-ZwCompleteConnectPort@4
-ZwConnectPort@32
-ZwContinue@8
-ZwCreateDebugObject@16
-ZwCreateDirectoryObject@12
-ZwCreateEvent@20
-ZwCreateEventPair@12
-ZwCreateFile@44
-ZwCreateIoCompletion@16
-ZwCreateJobObject@12
-ZwCreateKey@28
-ZwCreateMailslotFile@32
-ZwCreateMutant@16
-ZwCreateNamedPipeFile@56
-ZwCreatePagingFile@16
-ZwCreatePort@20
-ZwCreateProcess@32
-ZwCreateProfile@36
-ZwCreateSection@28
-ZwCreateSemaphore@20
-ZwCreateSymbolicLinkObject@16
-ZwCreateThread@32
-ZwCreateTimer@16
-ZwCreateToken@52
-ZwCreateWaitablePort@20
-ZwDebugContinue@12
-ZwDelayExecution@8
-ZwDeleteAtom@4
-ZwDeleteFile@4
-ZwDeleteKey@4
-ZwDeleteObjectAuditAlarm@12
-ZwDeleteValueKey@8
-ZwDeviceIoControlFile@40
-ZwDisplayString@4
-ZwDuplicateObject@28
-ZwDuplicateToken@24
-ZwEnumerateKey@24
-ZwEnumerateValueKey@24
-ZwExtendSection@8
-ZwFindAtom@12
-ZwFlushBuffersFile@8
-ZwFlushInstructionCache@12
-ZwFlushKey@4
-ZwFlushVirtualMemory@16
-ZwFlushWriteBuffer@0
-ZwFreeVirtualMemory@16
-ZwFsControlFile@40
-ZwGetContextThread@8
-ZwGetPlugPlayEvent@16
-ZwImpersonateAnonymousToken@4
-ZwImpersonateClientOfPort@8
-ZwImpersonateThread@12
-ZwInitializeRegistry@4
-ZwIsProcessInJob@8
-ZwListenPort@8
-ZwLoadDriver@4
-ZwLoadKey@8
-ZwLoadKey2@12
-ZwLockFile@40
-ZwLockVirtualMemory@16
-ZwMakeTemporaryObject@4
-ZwMapViewOfSection@40
-ZwNotifyChangeDirectoryFile@36
-ZwNotifyChangeKey@40
-ZwOpenDirectoryObject@12
-ZwOpenEvent@12
-ZwOpenEventPair@12
-ZwOpenFile@24
-ZwOpenIoCompletion@12
-ZwOpenJobObject@12
-ZwOpenKey@12
-ZwOpenMutant@12
-ZwOpenObjectAuditAlarm@48
-ZwOpenProcess@16
-ZwOpenProcessToken@12
-ZwOpenSection@12
-ZwOpenSemaphore@12
-ZwOpenSymbolicLinkObject@12
-ZwOpenThread@16
-ZwOpenThreadToken@16
-ZwOpenTimer@12
-ZwPlugPlayControl@12
-ZwPowerInformation@20
-ZwPrivilegeCheck@12
-ZwPrivilegedServiceAuditAlarm@20
-ZwPrivilegeObjectAuditAlarm@24
-ZwProtectVirtualMemory@20
-ZwPulseEvent@8
-ZwQueryAttributesFile@8
-ZwQueryDebugFilterState@8
-ZwQueryDefaultLocale@8
-ZwQueryDefaultUILanguage@4
-ZwQueryDirectoryFile@44
-ZwQueryDirectoryObject@28
-ZwQueryEaFile@36
-ZwQueryEvent@20
-ZwQueryFullAttributesFile@8
-ZwQueryInformationAtom@20
-ZwQueryInformationFile@20
-ZwQueryInformationJobObject@20
-ZwQueryInformationPort@20
-ZwQueryInformationProcess@20
-ZwQueryInformationThread@20
-ZwQueryInformationToken@20
-ZwQueryInstallUILanguage@4
-ZwQueryIntervalProfile@8
-ZwQueryIoCompletion@20
-ZwQueryKey@20
-ZwQueryMultipleValueKey@24
-ZwQueryMutant@20
-ZwQueryObject@20
-ZwQueryPerformanceCounter@8
-ZwQuerySection@20
-ZwQuerySecurityObject@20
-ZwQuerySemaphore@20
-ZwQuerySymbolicLinkObject@12
-ZwQuerySystemEnvironmentValue@16
-ZwQuerySystemInformation@16
-ZwQuerySystemTime@4
-ZwQueryTimer@20
-ZwQueryTimerResolution@12
-ZwQueryValueKey@24
-ZwQueryVirtualMemory@24
-ZwQueryVolumeInformationFile@20
-ZwQueueApcThread@20
-ZwRaiseException@12
-ZwRaiseHardError@24
-ZwReadFile@36
-ZwReadFileScatter@36
-ZwReadRequestData@24
-ZwReadVirtualMemory@20
-ZwRegisterThreadTerminatePort@4
-ZwReleaseMutant@8
-ZwReleaseSemaphore@12
-ZwRemoveIoCompletion@20
-ZwReplaceKey@12
-ZwReplyPort@8
-ZwReplyWaitReceivePort@16
-ZwReplyWaitReceivePortEx@20
-ZwReplyWaitReplyPort@8
-ZwRequestPort@8
-ZwRequestWaitReplyPort@12
-ZwResetEvent@8
-ZwRestoreKey@12
-ZwResumeProcess@4
-ZwResumeThread@8
-ZwSaveKey@8
-ZwSecureConnectPort@36
-ZwSetContextThread@8
-ZwSetDebugFilterState@12
-ZwSetDefaultHardErrorPort@4
-ZwSetDefaultLocale@8
-ZwSetDefaultUILanguage@4
-ZwSetEaFile@16
-ZwSetEvent@8
-ZwSetHighEventPair@4
-ZwSetHighWaitLowEventPair@4
-ZwSetInformationDebugObject@20
-ZwSetInformationFile@20
-ZwSetInformationJobObject@16
-ZwSetInformationKey@16
-ZwSetInformationObject@16
-ZwSetInformationProcess@16
-ZwSetInformationThread@16
-ZwSetInformationToken@16
-ZwSetIntervalProfile@8
-ZwSetIoCompletion@20
-ZwSetLdtEntries@24
-ZwSetLowEventPair@4
-ZwSetLowWaitHighEventPair@4
-ZwSetSecurityObject@12
-ZwSetSystemEnvironmentValue@8
-ZwSetSystemInformation@12
-ZwSetSystemPowerState@12
-ZwSetSystemTime@8
-ZwSetTimer@28
-ZwSetTimerResolution@12
-ZwSetUuidSeed@4
-ZwSetValueKey@24
-ZwSetVolumeInformationFile@20
-ZwShutdownSystem@4
-ZwSignalAndWaitForSingleObject@16
-ZwStartProfile@4
-ZwStopProfile@4
-ZwSuspendProcess@4
-ZwSuspendThread@8
-ZwSystemDebugControl@24
-ZwTerminateJobObject@8
-ZwTerminateProcess@8
-ZwTerminateThread@8
-ZwTestAlert@0
-ZwUnloadDriver@4
-ZwUnloadKey@4
-ZwUnlockFile@20
-ZwUnlockVirtualMemory@16
-ZwUnmapViewOfSection@8
-ZwVdmControl@8
-ZwWaitForDebugEvent@16
-ZwWaitForMultipleObjects@20
-ZwWaitForSingleObject@12
-ZwWaitHighEventPair@4
-ZwWaitLowEventPair@4
-ZwWriteFile@36
-ZwWriteFileGather@36
-ZwWriteRequestData@24
-ZwWriteVirtualMemory@20
-ZwYieldExecution@0
+VerSetConditionMask
+ZwAcceptConnectPort
+ZwAccessCheck
+ZwAccessCheckAndAuditAlarm
+ZwAddAtom
+ZwAdjustGroupsToken
+ZwAdjustPrivilegesToken
+ZwAlertResumeThread
+ZwAlertThread
+ZwAllocateLocallyUniqueId
+ZwAllocateUuids
+ZwAllocateVirtualMemory
+ZwAssignProcessToJobObject
+ZwCallbackReturn
+ZwCancelIoFile
+ZwCancelTimer
+ZwClearEvent
+ZwClose
+ZwCloseObjectAuditAlarm
+ZwCompareTokens
+ZwCompleteConnectPort
+ZwConnectPort
+ZwContinue
+ZwCreateDebugObject
+ZwCreateDirectoryObject
+ZwCreateEvent
+ZwCreateEventPair
+ZwCreateFile
+ZwCreateIoCompletion
+ZwCreateJobObject
+ZwCreateKey
+ZwCreateMailslotFile
+ZwCreateMutant
+ZwCreateNamedPipeFile
+ZwCreatePagingFile
+ZwCreatePort
+ZwCreateProcess
+ZwCreateProfile
+ZwCreateSection
+ZwCreateSemaphore
+ZwCreateSymbolicLinkObject
+ZwCreateThread
+ZwCreateTimer
+ZwCreateToken
+ZwCreateWaitablePort
+ZwDebugContinue
+ZwDelayExecution
+ZwDeleteAtom
+ZwDeleteFile
+ZwDeleteKey
+ZwDeleteObjectAuditAlarm
+ZwDeleteValueKey
+ZwDeviceIoControlFile
+ZwDisplayString
+ZwDuplicateObject
+ZwDuplicateToken
+ZwEnumerateKey
+ZwEnumerateValueKey
+ZwExtendSection
+ZwFindAtom
+ZwFlushBuffersFile
+ZwFlushInstructionCache
+ZwFlushKey
+ZwFlushVirtualMemory
+ZwFlushWriteBuffer
+ZwFreeVirtualMemory
+ZwFsControlFile
+ZwGetContextThread
+ZwGetPlugPlayEvent
+ZwImpersonateAnonymousToken
+ZwImpersonateClientOfPort
+ZwImpersonateThread
+ZwInitializeRegistry
+ZwIsProcessInJob
+ZwListenPort
+ZwLoadDriver
+ZwLoadKey
+ZwLoadKey2
+ZwLockFile
+ZwLockVirtualMemory
+ZwMakeTemporaryObject
+ZwMapViewOfSection
+ZwNotifyChangeDirectoryFile
+ZwNotifyChangeKey
+ZwOpenDirectoryObject
+ZwOpenEvent
+ZwOpenEventPair
+ZwOpenFile
+ZwOpenIoCompletion
+ZwOpenJobObject
+ZwOpenKey
+ZwOpenMutant
+ZwOpenObjectAuditAlarm
+ZwOpenProcess
+ZwOpenProcessToken
+ZwOpenSection
+ZwOpenSemaphore
+ZwOpenSymbolicLinkObject
+ZwOpenThread
+ZwOpenThreadToken
+ZwOpenTimer
+ZwPlugPlayControl
+ZwPowerInformation
+ZwPrivilegeCheck
+ZwPrivilegedServiceAuditAlarm
+ZwPrivilegeObjectAuditAlarm
+ZwProtectVirtualMemory
+ZwPulseEvent
+ZwQueryAttributesFile
+ZwQueryDebugFilterState
+ZwQueryDefaultLocale
+ZwQueryDefaultUILanguage
+ZwQueryDirectoryFile
+ZwQueryDirectoryObject
+ZwQueryEaFile
+ZwQueryEvent
+ZwQueryFullAttributesFile
+ZwQueryInformationAtom
+ZwQueryInformationFile
+ZwQueryInformationJobObject
+ZwQueryInformationPort
+ZwQueryInformationProcess
+ZwQueryInformationThread
+ZwQueryInformationToken
+ZwQueryInstallUILanguage
+ZwQueryIntervalProfile
+ZwQueryIoCompletion
+ZwQueryKey
+ZwQueryMultipleValueKey
+ZwQueryMutant
+ZwQueryObject
+ZwQueryPerformanceCounter
+ZwQuerySection
+ZwQuerySecurityObject
+ZwQuerySemaphore
+ZwQuerySymbolicLinkObject
+ZwQuerySystemEnvironmentValue
+ZwQuerySystemInformation
+ZwQuerySystemTime
+ZwQueryTimer
+ZwQueryTimerResolution
+ZwQueryValueKey
+ZwQueryVirtualMemory
+ZwQueryVolumeInformationFile
+ZwQueueApcThread
+ZwRaiseException
+ZwRaiseHardError
+ZwReadFile
+ZwReadFileScatter
+ZwReadRequestData
+ZwReadVirtualMemory
+ZwRegisterThreadTerminatePort
+ZwReleaseMutant
+ZwReleaseSemaphore
+ZwRemoveIoCompletion
+ZwReplaceKey
+ZwReplyPort
+ZwReplyWaitReceivePort
+ZwReplyWaitReceivePortEx
+ZwReplyWaitReplyPort
+ZwRequestPort
+ZwRequestWaitReplyPort
+ZwResetEvent
+ZwRestoreKey
+ZwResumeProcess
+ZwResumeThread
+ZwSaveKey
+ZwSecureConnectPort
+ZwSetContextThread
+ZwSetDebugFilterState
+ZwSetDefaultHardErrorPort
+ZwSetDefaultLocale
+ZwSetDefaultUILanguage
+ZwSetEaFile
+ZwSetEvent
+ZwSetHighEventPair
+ZwSetHighWaitLowEventPair
+ZwSetInformationDebugObject
+ZwSetInformationFile
+ZwSetInformationJobObject
+ZwSetInformationKey
+ZwSetInformationObject
+ZwSetInformationProcess
+ZwSetInformationThread
+ZwSetInformationToken
+ZwSetIntervalProfile
+ZwSetIoCompletion
+ZwSetLdtEntries
+ZwSetLowEventPair
+ZwSetLowWaitHighEventPair
+ZwSetSecurityObject
+ZwSetSystemEnvironmentValue
+ZwSetSystemInformation
+ZwSetSystemPowerState
+ZwSetSystemTime
+ZwSetTimer
+ZwSetTimerResolution
+ZwSetUuidSeed
+ZwSetValueKey
+ZwSetVolumeInformationFile
+ZwShutdownSystem
+ZwSignalAndWaitForSingleObject
+ZwStartProfile
+ZwStopProfile
+ZwSuspendProcess
+ZwSuspendThread
+ZwSystemDebugControl
+ZwTerminateJobObject
+ZwTerminateProcess
+ZwTerminateThread
+ZwTestAlert
+ZwUnloadDriver
+ZwUnloadKey
+ZwUnlockFile
+ZwUnlockVirtualMemory
+ZwUnmapViewOfSection
+ZwVdmControl
+ZwWaitForDebugEvent
+ZwWaitForMultipleObjects
+ZwWaitForSingleObject
+ZwWaitHighEventPair
+ZwWaitLowEventPair
+ZwWriteFile
+ZwWriteFileGather
+ZwWriteRequestData
+ZwWriteVirtualMemory
+ZwYieldExecution
 __isascii
 __iscsym
 __iscsymf
index 4361ede..2907bed 100644 (file)
        <library>scm_client</library>
        <library>lsa_client</library>
        <library>eventlog_client</library>
-       <library>ntdll</library>
        <library>rpcrt4</library>
        <library>wine</library>
        <library>kernel32</library>
        <library>pseh</library>
+       <library>ntdll</library>
        <pch>advapi32.h</pch>
        <file>advapi32.spec</file>
        <directory name="crypt">
index 4a04b9b..f5037eb 100644 (file)
@@ -5,13 +5,13 @@
        <define name="WINVER">0x0600</define>
        <define name="_WIN32_WINNT">0x0501</define>
        <define name="LANGPACK" />
-       <library>ntdll</library>
        <library>user32</library>
        <library>kernel32</library>
        <library>advapi32</library>
        <library>win32ksys</library>
        <library>pseh</library>
        <library>dxguid</library>
+       <library>ntdll</library>
 
        <directory name="include">
                <pch>precomp.h</pch>
index 4e1c93c..3104e28 100644 (file)
@@ -217,7 +217,7 @@ AddConsoleAliasW (LPCWSTR lpSource,
 
   Request->Data.AddConsoleAlias.TargetLength = TargetLength;
 
-  CsrRequest = MAKE_CSR_API(ADD_CONSOLE_ALIAS, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(ADD_CONSOLE_ALIAS, CSR_CONSOLE);
   Status = CsrClientCallServer(Request,
                    NULL,
                               CsrRequest,
@@ -342,7 +342,7 @@ GetConsoleAliasW (LPWSTR    lpSource,
 
   DPRINT("GetConsoleAliasW entered lpSource %S lpExeName %S\n", lpSource, lpExeName);
 
-  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIAS, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIAS, CSR_CONSOLE);
 
   ExeLength = wcslen(lpExeName) + 1;
   SourceLength = wcslen(lpSource) + 1;
@@ -458,7 +458,7 @@ GetConsoleAliasExesW (LPWSTR lpExeNameBuffer,
     return 0;
   }
 
-  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIASES_EXES, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIASES_EXES, CSR_CONSOLE);
   CsrAllocateMessagePointer(CaptureBuffer,
                             ExeNameBufferLength,
                             (PVOID*)&Request.Data.GetConsoleAliasesExes.ExeNames);
@@ -519,7 +519,7 @@ GetConsoleAliasExesLengthW (VOID)
 
   DPRINT("GetConsoleAliasExesLengthW entered\n");
 
-  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIASES_EXES_LENGTH, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(GET_CONSOLE_ALIASES_EXES_LENGTH, CSR_CONSOLE);
   Request.Data.GetConsoleAliasesExesLength.Length = 0;
 
 
@@ -575,7 +575,7 @@ GetConsoleAliasesW (LPWSTR AliasBuffer,
   if (!dwLength || dwLength > AliasBufferLength)
       return 0;
 
-  CsrRequest = MAKE_CSR_API(GET_ALL_CONSOLE_ALIASES, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(GET_ALL_CONSOLE_ALIASES, CSR_CONSOLE);
   Request.Data.GetAllConsoleAlias.AliasBuffer = AliasBuffer;
   Request.Data.GetAllConsoleAlias.AliasBufferLength = AliasBufferLength;
   Request.Data.GetAllConsoleAlias.lpExeName = ExeName;
@@ -639,7 +639,7 @@ GetConsoleAliasesLengthW (LPWSTR lpExeName)
 
   DPRINT("GetConsoleAliasesLengthW entered\n");
 
-  CsrRequest = MAKE_CSR_API(GET_ALL_CONSOLE_ALIASES_LENGTH, CSR_NATIVE);
+  CsrRequest = MAKE_CSR_API(GET_ALL_CONSOLE_ALIASES_LENGTH, CSR_CONSOLE);
   Request.Data.GetAllConsoleAliasesLength.lpExeName = lpExeName;
   Request.Data.GetAllConsoleAliasesLength.Length = 0;
 
@@ -2046,7 +2046,7 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
 
   /* Allocate space in the Buffer */
   CsrCaptureMessageBuffer(CaptureBuffer,
-                          NULL,
+                          lpBuffer,
                           Size,
                           (PVOID*)&Request.Data.WriteConsoleInputRequest.InputRecord);
 
@@ -2069,12 +2069,6 @@ IntWriteConsoleInput(HANDLE hConsoleInput,
     /* Return the number of events read */
     DPRINT("Events read: %lx\n", Request.Data.WriteConsoleInputRequest.Length);
     *lpNumberOfEventsWritten = Request.Data.WriteConsoleInputRequest.Length;
-
-    /* Copy into the buffer */
-    DPRINT("Copying to buffer\n");
-    RtlCopyMemory(lpBuffer, 
-                  Request.Data.WriteConsoleInputRequest.InputRecord, 
-                  sizeof(INPUT_RECORD) * *lpNumberOfEventsWritten);
   }
   else
   {
index 1a6e256..a617b6f 100644 (file)
@@ -51,11 +51,7 @@ StatusMessageWindowProc(
                        if (msg->pTitle)
                                SetWindowTextW(hwndDlg, msg->pTitle);
                        SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, msg->pMessage);
-                       if (!msg->Context->SignaledStatusWindowCreated)
-                       {
-                               msg->Context->SignaledStatusWindowCreated = TRUE;
-                               SetEvent(msg->StartupEvent);
-                       }
+                       SetEvent(msg->StartupEvent);
                        return TRUE;
                }
        }
@@ -140,7 +136,7 @@ GUIDisplayStatusMessage(
                return FALSE;
        }
 
-       if(pTitle)
+       if (pTitle)
                SetWindowTextW(pgContext->hStatusWindow, pTitle);
 
        SetDlgItemTextW(pgContext->hStatusWindow, IDC_STATUSLABEL, pMessage);
@@ -155,8 +151,7 @@ GUIRemoveStatusMessage(
        if (pgContext->hStatusWindow)
        {
                EndDialog(pgContext->hStatusWindow, 0);
-               pgContext->hStatusWindow = 0;
-               pgContext->SignaledStatusWindowCreated = FALSE;
+               pgContext->hStatusWindow = NULL;
        }
 
        return TRUE;
index 19a2d2a..c6207fa 100644 (file)
@@ -18,7 +18,6 @@ typedef struct
        PWLX_DISPATCH_VERSION_1_3 pWlxFuncs;
        HANDLE hDllInstance;
        HWND hStatusWindow;
-       BOOL SignaledStatusWindowCreated;
        DWORD AutoLogonState;
 
        /* Informations to be filled during logon */
index dc1530a..9774772 100644 (file)
@@ -104,8 +104,8 @@ EXPORTS
 ;  ___lc_collate_cp_func @99
 ;  ___lc_handle_func @100
 ;  ___mb_cur_max_func @101
-;  ___setlc_active_func @102
-;  ___unguarded_readlc_active_add_func @103
+  ___setlc_active_func @102
+  ___unguarded_readlc_active_add_func @103
   __argc @104 DATA
   __argv @105 DATA
   __badioinfo @106 DATA
index 66a771e..092e9f1 100644 (file)
        <define name="MSWMSG" />
        <library>wine</library>
        <library>uuid</library>
-       <library>ntdll</library>
        <library>kernel32</library>
        <library>user32</library>
        <library>advapi32</library>
        <library>secur32</library>
        <library>iphlpapi</library>
        <library>ws2_32</library>
+       <library>ntdll</library>
        <file>cproxy.c</file>
        <file>cpsf.c</file>
        <file>cstub.c</file>
index 1fd5c52..2956c27 100644 (file)
@@ -229,12 +229,13 @@ DriveGeneralDlg(
 )\r
 {\r
     LPPROPSHEETPAGEW ppsp;\r
-       LPDRAWITEMSTRUCT drawItem;\r
+    LPDRAWITEMSTRUCT drawItem;\r
     STARTUPINFOW si;\r
     PROCESS_INFORMATION pi;\r
     WCHAR * lpstr;\r
     WCHAR szPath[MAX_PATH];\r
     UINT length;\r
+    LPPSHNOTIFY lppsn;\r
 \r
     switch(uMsg)\r
     {\r
@@ -246,11 +247,11 @@ DriveGeneralDlg(
         SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr);\r
         InitializeGeneralDriveDialog(hwndDlg, lpstr);\r
         return TRUE;\r
-       case WM_DRAWITEM:\r
-               drawItem = (LPDRAWITEMSTRUCT)lParam;\r
-           if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)\r
+    case WM_DRAWITEM:\r
+        drawItem = (LPDRAWITEMSTRUCT)lParam;\r
+        if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)\r
         {\r
-                       PaintStaticControls(hwndDlg, drawItem);\r
+            PaintStaticControls(hwndDlg, drawItem);\r
             return TRUE;\r
         }\r
         break;\r
@@ -272,8 +273,33 @@ DriveGeneralDlg(
               CloseHandle(pi.hProcess);\r
               CloseHandle(pi.hThread);\r
            }\r
+           break;\r
+        }\r
+    case WM_NOTIFY:\r
+        lppsn = (LPPSHNOTIFY) lParam;\r
+        if (LOWORD(wParam) == 14001)\r
+        {\r
+           if (HIWORD(wParam) == EN_CHANGE)\r
+           {\r
+              PropSheet_Changed(GetParent(hwndDlg), hwndDlg);\r
+           }\r
+           break;\r
+        }\r
+        if (lppsn->hdr.code == PSN_APPLY)\r
+        {\r
+           lpstr = (LPWSTR)GetWindowLong(hwndDlg, DWLP_USER);\r
+           if (lpstr && SendDlgItemMessageW(hwndDlg, 14001, WM_GETTEXT, sizeof(szPath)/sizeof(WCHAR), (LPARAM)szPath))\r
+           {\r
+              szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';\r
+              SetVolumeLabelW(lpstr, szPath);\r
+           }\r
+           SetWindowLong( hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR );\r
+           return TRUE;\r
         }\r
         break;\r
+\r
+    default:\r
+        break;\r
    }\r
 \r
 \r
@@ -409,6 +435,8 @@ SH_ShowDriveProperties(WCHAR * drive)
    PROPSHEETHEADERW psh;\r
    BOOL ret;\r
    UINT i;\r
+   WCHAR szName[MAX_PATH];\r
+   DWORD dwMaxComponent, dwFileSysFlags;\r
 \r
    ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));\r
    psh.dwSize = sizeof(PROPSHEETHEADERW);\r
@@ -417,6 +445,30 @@ SH_ShowDriveProperties(WCHAR * drive)
    psh.nStartPage = 0;\r
    psh.phpage = hpsp;\r
 \r
+\r
+   if (GetVolumeInformationW(drive, szName, sizeof(szName)/sizeof(WCHAR), NULL, &dwMaxComponent,\r
+                             &dwFileSysFlags, NULL, 0))\r
+   {\r
+      psh.pszCaption = szName;\r
+      psh.dwFlags |= PSH_PROPTITLE;\r
+      if (!wcslen(szName))\r
+      {\r
+          /* FIXME\r
+           * check if disk is a really a local hdd \r
+           */\r
+          i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szName, sizeof(szName)/sizeof(WCHAR));\r
+          if (i > 0 && i < (sizeof(szName)/sizeof(WCHAR)) + 6)\r
+          {\r
+              szName[i] = L' ';\r
+              szName[i+1] = L'(';\r
+              wcscpy(&szName[i+2], drive);\r
+              szName[i+4] = L')';\r
+              szName[i+5] = L'\0';\r
+          }\r
+      }\r
+   }\r
+\r
+\r
    for (i = 0; i < DRIVE_PROPERTY_PAGES; i++)\r
    {\r
        HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)drive, NULL);\r
index de8bd88..329aa9f 100644 (file)
@@ -674,6 +674,7 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA
     UINT Length;
     DWORD dwName;
     int Pages;
+    CLSID clsid;
 
     pOffset = wcsrchr(wFileName, L'.');
     if (!pOffset)
@@ -681,8 +682,16 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA
         Length = wcslen(szName);
         if (Length >=94)
            return 0;
-        wcscpy(szName, L"CLSID\\");
-        wcscpy(&szName[6], wFileName);
+
+        if (CLSIDFromString(wFileName, &clsid) == NOERROR)
+        {
+           wcscpy(szName, L"CLSID\\");
+           wcscpy(&szName[6], wFileName);
+        }
+        else
+        {
+           wcscpy(szName, wFileName);
+        }
     }
     else
     {
@@ -767,12 +776,17 @@ SH_ShowPropertiesDialog(PCWSTR lpf)
         strcpyW(wFileName, lpf);
     }
 
-    if (PathIsDirectoryW(wFileName) || strlenW(wFileName) == 3)
+    if (PathIsDirectoryW(wFileName))
     {
-        FIXME("directory / drive resources are missing\n");
+        FIXME("directory resources are missing\n");
         return FALSE;
     }
-    
+
+    if (wcslen(wFileName) == 3)
+    {
+        return SH_ShowDriveProperties(wFileName);
+    }
+
     wcscpy(szTemp, wFileName);
     pFileName = wcsrchr(szTemp, '\\');
     if (pFileName)
index 607c4bd..dcdd672 100644 (file)
@@ -7,13 +7,13 @@
        <define name="WINVER">0x0600</define>
        <define name="_WIN32_WINNT">0x0501</define>
        <library>wine</library>
-       <library>ntdll</library>
        <library>gdi32</library>
        <library>kernel32</library>
        <library>advapi32</library>
        <library>imm32</library>
        <library>win32ksys</library>
        <library>pseh</library>
+       <library>ntdll</library>
 
        <directory name="include">
                <pch>user32.h</pch>
index a10bed7..135bc7b 100644 (file)
@@ -233,17 +233,9 @@ NTSTATUS
 PciCreateInstanceIDString(PUNICODE_STRING InstanceID,
                           PPCI_DEVICE Device)
 {
-  WCHAR Buffer[32];
-  ULONG Index;
-
-  Index = 0;
-  if (((PPDO_DEVICE_EXTENSION)Device->Pdo->DeviceExtension)->PciDevice->BusNumber != 0)
-  {
-    /* FIXME: Copy InstanceID of parent PCI bus to Buffer */
-    // Index += swprintf(Buffer, ....);
-  }
+  WCHAR Buffer[3];
 
-  swprintf(&Buffer[Index], L"%02X", Device->SlotNumber.u.AsULONG & 0xff);
+  swprintf(Buffer, L"%02X", Device->SlotNumber.u.AsULONG & 0xff);
 
   return RtlCreateUnicodeString(InstanceID, Buffer) ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES;
 }
index 1909aa4..b662512 100644 (file)
@@ -255,9 +255,9 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
                                if (ClientCcb->Data)
                                        ExFreePool(ClientCcb->Data);
                                KeUnlockMutex(&Fcb->CcbListLock);
-                               Irp->IoStatus.Status = STATUS_PIPE_BUSY;
+                               Irp->IoStatus.Status = STATUS_OBJECT_PATH_NOT_FOUND;
                                IoCompleteRequest(Irp, IO_NO_INCREMENT);
-                               return STATUS_PIPE_BUSY;
+                               return STATUS_OBJECT_PATH_NOT_FOUND;
                        }
                }
                else
@@ -368,9 +368,9 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
                {
                        DPRINT("Out of instances.\n");
                        ExFreePool(Ccb);
-                       Irp->IoStatus.Status = STATUS_PIPE_BUSY;
+                       Irp->IoStatus.Status = STATUS_INSTANCE_NOT_AVAILABLE;
                        IoCompleteRequest(Irp, IO_NO_INCREMENT);
-                       return STATUS_PIPE_BUSY;
+                       return STATUS_INSTANCE_NOT_AVAILABLE;
                }
 
                /* FIXME: Check pipe modes also! */
index 3b1ae64..5c1e5bc 100644 (file)
@@ -37,7 +37,7 @@ ClassCreate(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CREATE\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CREATE\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -54,7 +54,7 @@ ClassClose(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CLOSE\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CLOSE\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -71,7 +71,7 @@ ClassCleanup(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CLEANUP\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CLEANUP\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -92,7 +92,7 @@ ClassRead(
        KIRQL OldIrql;
        NTSTATUS Status;
 
-       DPRINT("IRP_MJ_READ\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_READ\n");
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -122,7 +122,7 @@ ClassDeviceControl(
        PCLASS_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status = STATUS_NOT_SUPPORTED;
 
-       DPRINT("IRP_MJ_DEVICE_CONTROL\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -170,7 +170,7 @@ ClassDeviceControl(
                        break;
                }
                default:
-                       DPRINT1("IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
+                       WARN_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
                                IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlCode);
                        ASSERT(FALSE);
                        break;
@@ -200,7 +200,7 @@ IrpStub(
                                return ForwardIrpAndForget(DeviceObject, Irp);
                        default:
                        {
-                               DPRINT1("Port DO stub for major function 0x%lx\n",
+                               ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
                                        IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
                                ASSERT(FALSE);
                        }
@@ -208,7 +208,7 @@ IrpStub(
        }
        else
        {
-               DPRINT1("Class DO stub for major function 0x%lx\n",
+               ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
                        IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
                ASSERT(FALSE);
        }
@@ -236,7 +236,7 @@ ReadRegistryEntries(
        ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool, ParametersRegistryKey.MaximumLength, CLASS_TAG);
        if (!ParametersRegistryKey.Buffer)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                return STATUS_NO_MEMORY;
        }
        RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
@@ -315,7 +315,7 @@ CreateClassDeviceObject(
        PCLASS_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
 
-       DPRINT("CreateClassDeviceObject(0x%p)\n", DriverObject);
+       TRACE_(CLASS_NAME, "CreateClassDeviceObject(0x%p)\n", DriverObject);
 
        /* Create new device object */
        DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -328,19 +328,19 @@ CreateClassDeviceObject(
        DeviceNameU.Buffer = ExAllocatePoolWithTag(PagedPool, DeviceNameU.MaximumLength, CLASS_TAG);
        if (!DeviceNameU.Buffer)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                return STATUS_NO_MEMORY;
        }
        Status = RtlAppendUnicodeToString(&DeviceNameU, L"\\Device\\");
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        Status = RtlAppendUnicodeStringToString(&DeviceNameU, &DriverExtension->DeviceBaseName);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        PrefixLength = DeviceNameU.MaximumLength - 4 * sizeof(WCHAR) - sizeof(UNICODE_NULL);
@@ -360,12 +360,12 @@ CreateClassDeviceObject(
                        goto cleanup;
                else if (Status != STATUS_OBJECT_NAME_COLLISION)
                {
-                       DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
                        goto cleanup;
                }
                DeviceId++;
        }
-       DPRINT("Too many devices starting with '\\Device\\%wZ'\n", &DriverExtension->DeviceBaseName);
+       WARN_(CLASS_NAME, "Too many devices starting with '\\Device\\%wZ'\n", &DriverExtension->DeviceBaseName);
        Status = STATUS_TOO_MANY_NAMES;
 cleanup:
        if (!NT_SUCCESS(Status))
@@ -468,7 +468,7 @@ ClassCallback(
        SIZE_T InputCount = DataEnd - DataStart;
        SIZE_T ReadSize;
 
-       DPRINT("ClassCallback()\n");
+       TRACE_(CLASS_NAME, "ClassCallback()\n");
 
        ASSERT(ClassDeviceExtension->Common.IsClassDO);
 
@@ -506,7 +506,7 @@ ClassCallback(
        }
        KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql);
 
-       DPRINT("Leaving ClassCallback()\n");
+       TRACE_(CLASS_NAME, "Leaving ClassCallback()\n");
        return TRUE;
 }
 
@@ -522,7 +522,7 @@ ConnectPortDriver(
        CONNECT_DATA ConnectData;
        NTSTATUS Status;
 
-       DPRINT("Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
+       TRACE_(CLASS_NAME, "Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
 
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
 
@@ -578,7 +578,7 @@ DestroyPortDriver(
        KIRQL OldIrql;
        NTSTATUS Status;
 
-       DPRINT("Destroying PortDO %p\n", PortDO);
+       TRACE_(CLASS_NAME, "Destroying PortDO %p\n", PortDO);
 
        DeviceExtension = (PPORT_DEVICE_EXTENSION)PortDO->DeviceExtension;
        ClassDeviceExtension = DeviceExtension->ClassDO->DeviceExtension;
@@ -634,7 +634,7 @@ ClassAddDevice(
        PPORT_DEVICE_EXTENSION DeviceExtension = NULL;
        NTSTATUS Status;
 
-       DPRINT("ClassAddDevice called. Pdo = 0x%p\n", Pdo);
+       TRACE_(CLASS_NAME, "ClassAddDevice called. Pdo = 0x%p\n", Pdo);
 
        DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
 
@@ -653,7 +653,7 @@ ClassAddDevice(
                &Fdo);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        IoSetStartIoAttributes(Fdo, TRUE, TRUE);
@@ -666,7 +666,7 @@ ClassAddDevice(
        Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@@ -686,14 +686,14 @@ ClassAddDevice(
                        &DeviceExtension->ClassDO);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
                        goto cleanup;
                }
        }
        Status = ConnectPortDriver(Fdo, DeviceExtension->ClassDO);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ConnectPortDriver() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
@@ -725,7 +725,7 @@ ClassCancelRoutine(
        KIRQL OldIrql;
        BOOLEAN wasQueued = FALSE;
 
-       DPRINT("ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(ClassDeviceExtension->Common.IsClassDO);
 
@@ -762,7 +762,7 @@ HandleReadIrp(
        PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
        NTSTATUS Status;
 
-       DPRINT("HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -828,7 +828,7 @@ ClassStartIo(
        PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
        KIRQL OldIrql;
 
-       DPRINT("ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -854,7 +854,7 @@ SearchForLegacyDrivers(
        ULONG Size, ResultLength;
        NTSTATUS Status;
 
-       DPRINT("SearchForLegacyDrivers(%p %p %lu)\n",
+       TRACE_(CLASS_NAME, "SearchForLegacyDrivers(%p %p %lu)\n",
                DriverObject, Context, Count);
 
        if (Count != 1)
@@ -868,7 +868,7 @@ SearchForLegacyDrivers(
                &PortBaseName);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        PortBaseName.Length -= (sizeof(L"Class") - sizeof(UNICODE_NULL));
@@ -879,7 +879,7 @@ SearchForLegacyDrivers(
        KeyValueInformation = ExAllocatePoolWithTag(PagedPool, Size, CLASS_TAG);
        if (!KeyValueInformation)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                Status = STATUS_NO_MEMORY;
                goto cleanup;
        }
@@ -889,13 +889,13 @@ SearchForLegacyDrivers(
        Status = ZwOpenKey(&hDeviceMapKey, 0, &ObjectAttributes);
        if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
        {
-               DPRINT("HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
+               INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
                Status = STATUS_SUCCESS;
                goto cleanup;
        }
        else if (!NT_SUCCESS(Status))
        {
-               DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
 
@@ -904,13 +904,13 @@ SearchForLegacyDrivers(
        Status = ZwOpenKey(&hPortKey, KEY_QUERY_VALUE, &ObjectAttributes);
        if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
        {
-               DPRINT("HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n", &PortBaseName);
+               INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n", &PortBaseName);
                Status = STATUS_SUCCESS;
                goto cleanup;
        }
        else if (!NT_SUCCESS(Status))
        {
-               DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
 
@@ -928,16 +928,16 @@ SearchForLegacyDrivers(
                Status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject, &PortDeviceObject);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n", &PortName, Status);
+                       WARN_(CLASS_NAME, "IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n", &PortName, Status);
                        continue;
                }
-               DPRINT("Legacy driver found\n");
+               INFO_(CLASS_NAME, "Legacy driver found\n");
 
                Status = ClassAddDevice(DriverObject, PortDeviceObject);
                if (!NT_SUCCESS(Status))
                {
                        /* FIXME: Log the error */
-                       DPRINT("ClassAddDevice() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "ClassAddDevice() failed with status 0x%08lx\n", Status);
                }
        }
 
@@ -969,7 +969,7 @@ DriverEntry(
                (PVOID*)&DriverExtension);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
                return Status;
        }
        RtlZeroMemory(DriverExtension, sizeof(CLASS_DRIVER_EXTENSION));
@@ -980,14 +980,14 @@ DriverEntry(
                &DriverExtension->RegistryPath);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
                return Status;
        }
 
        Status = ReadRegistryEntries(RegistryPath, DriverExtension);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
                return Status;
        }
 
@@ -998,7 +998,7 @@ DriverEntry(
                        &DriverExtension->MainClassDeviceObject);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
                        return Status;
                }
        }
index 1a015f4..46f92d9 100644 (file)
@@ -4,7 +4,6 @@
 #include <stdio.h>
 #include <pseh/pseh.h>
 
-#define NDEBUG
 #include <debug.h>
 
 #define MAX_PATH 260
@@ -13,6 +12,7 @@
 
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define CLASS_TAG TAG('K', 'b', 'd', 'C')
+#define DPFLTR_CLASS_NAME_ID DPFLTR_KBDCLASS_ID
 
 typedef enum
 {
index e7a0fa6..91aa4f8 100644 (file)
@@ -37,7 +37,7 @@ ForwardIrpAndWait(
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);
 
-       DPRINT("Calling lower device %p\n", LowerDevice);
+       TRACE_(CLASS_NAME, "Calling lower device %p\n", LowerDevice);
        IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
 
        Status = IoCallDriver(LowerDevice, Irp);
index 3645e74..b7d882b 100644 (file)
@@ -37,7 +37,7 @@ ForwardIrpAndWait(
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);
 
-       DPRINT("Calling lower device %p\n", LowerDevice);
+       TRACE_(CLASS_NAME, "Calling lower device %p\n", LowerDevice);
        IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
 
        Status = IoCallDriver(LowerDevice, Irp);
index 1588611..523f08e 100644 (file)
@@ -37,7 +37,7 @@ ClassCreate(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CREATE\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CREATE\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -54,7 +54,7 @@ ClassClose(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CLOSE\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CLOSE\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -71,7 +71,7 @@ ClassCleanup(
        IN PDEVICE_OBJECT DeviceObject,
        IN PIRP Irp)
 {
-       DPRINT("IRP_MJ_CLEANUP\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_CLEANUP\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -92,7 +92,7 @@ ClassRead(
        KIRQL OldIrql;
        NTSTATUS Status;
 
-       DPRINT("IRP_MJ_READ\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_READ\n");
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -122,7 +122,7 @@ ClassDeviceControl(
        PCLASS_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status = STATUS_NOT_SUPPORTED;
 
-       DPRINT("IRP_MJ_DEVICE_CONTROL\n");
+       TRACE_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL\n");
 
        if (!((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsClassDO)
                return ForwardIrpAndForget(DeviceObject, Irp);
@@ -147,7 +147,7 @@ ClassDeviceControl(
                        break;
                }
                default:
-                       DPRINT1("IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
+                       WARN_(CLASS_NAME, "IRP_MJ_DEVICE_CONTROL / unknown I/O control code 0x%lx\n",
                                IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.IoControlCode);
                        ASSERT(FALSE);
                        break;
@@ -177,7 +177,7 @@ IrpStub(
                                return ForwardIrpAndForget(DeviceObject, Irp);
                        default:
                        {
-                               DPRINT1("Port DO stub for major function 0x%lx\n",
+                               ERR_(CLASS_NAME, "Port DO stub for major function 0x%lx\n",
                                        IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
                                ASSERT(FALSE);
                        }
@@ -185,7 +185,7 @@ IrpStub(
        }
        else
        {
-               DPRINT1("Class DO stub for major function 0x%lx\n",
+               ERR_(CLASS_NAME, "Class DO stub for major function 0x%lx\n",
                        IoGetCurrentIrpStackLocation(Irp)->MajorFunction);
                ASSERT(FALSE);
        }
@@ -213,7 +213,7 @@ ReadRegistryEntries(
        ParametersRegistryKey.Buffer = ExAllocatePoolWithTag(PagedPool, ParametersRegistryKey.MaximumLength, CLASS_TAG);
        if (!ParametersRegistryKey.Buffer)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                return STATUS_NO_MEMORY;
        }
        RtlCopyUnicodeString(&ParametersRegistryKey, RegistryPath);
@@ -292,7 +292,7 @@ CreateClassDeviceObject(
        PCLASS_DEVICE_EXTENSION DeviceExtension;
        NTSTATUS Status;
 
-       DPRINT("CreateClassDeviceObject(0x%p)\n", DriverObject);
+       TRACE_(CLASS_NAME, "CreateClassDeviceObject(0x%p)\n", DriverObject);
 
        /* Create new device object */
        DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
@@ -305,19 +305,19 @@ CreateClassDeviceObject(
        DeviceNameU.Buffer = ExAllocatePoolWithTag(PagedPool, DeviceNameU.MaximumLength, CLASS_TAG);
        if (!DeviceNameU.Buffer)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                return STATUS_NO_MEMORY;
        }
        Status = RtlAppendUnicodeToString(&DeviceNameU, L"\\Device\\");
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "RtlAppendUnicodeToString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        Status = RtlAppendUnicodeStringToString(&DeviceNameU, &DriverExtension->DeviceBaseName);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        PrefixLength = DeviceNameU.MaximumLength - 4 * sizeof(WCHAR) - sizeof(UNICODE_NULL);
@@ -337,12 +337,12 @@ CreateClassDeviceObject(
                        goto cleanup;
                else if (Status != STATUS_OBJECT_NAME_COLLISION)
                {
-                       DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
                        goto cleanup;
                }
                DeviceId++;
        }
-       DPRINT("Too many devices starting with '\\Device\\%wZ'\n", &DriverExtension->DeviceBaseName);
+       WARN_(CLASS_NAME, "Too many devices starting with '\\Device\\%wZ'\n", &DriverExtension->DeviceBaseName);
        Status = STATUS_TOO_MANY_NAMES;
 cleanup:
        if (!NT_SUCCESS(Status))
@@ -444,7 +444,7 @@ ClassCallback(
        SIZE_T InputCount = DataEnd - DataStart;
        SIZE_T ReadSize;
 
-       DPRINT("ClassCallback()\n");
+       TRACE_(CLASS_NAME, "ClassCallback()\n");
 
        ASSERT(ClassDeviceExtension->Common.IsClassDO);
 
@@ -482,7 +482,7 @@ ClassCallback(
        }
        KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql);
 
-       DPRINT("Leaving ClassCallback()\n");
+       TRACE_(CLASS_NAME, "Leaving ClassCallback()\n");
        return TRUE;
 }
 
@@ -498,7 +498,7 @@ ConnectPortDriver(
        CONNECT_DATA ConnectData;
        NTSTATUS Status;
 
-       DPRINT("Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
+       TRACE_(CLASS_NAME, "Connecting PortDO %p to ClassDO %p\n", PortDO, ClassDO);
 
        KeInitializeEvent(&Event, NotificationEvent, FALSE);
 
@@ -554,7 +554,7 @@ DestroyPortDriver(
        KIRQL OldIrql;
        NTSTATUS Status;
 
-       DPRINT("Destroying PortDO %p\n", PortDO);
+       TRACE_(CLASS_NAME, "Destroying PortDO %p\n", PortDO);
 
        DeviceExtension = (PPORT_DEVICE_EXTENSION)PortDO->DeviceExtension;
        ClassDeviceExtension = DeviceExtension->ClassDO->DeviceExtension;
@@ -610,7 +610,7 @@ ClassAddDevice(
        PPORT_DEVICE_EXTENSION DeviceExtension = NULL;
        NTSTATUS Status;
 
-       DPRINT("ClassAddDevice called. Pdo = 0x%p\n", Pdo);
+       TRACE_(CLASS_NAME, "ClassAddDevice called. Pdo = 0x%p\n", Pdo);
 
        DriverExtension = IoGetDriverObjectExtension(DriverObject, DriverObject);
 
@@ -629,7 +629,7 @@ ClassAddDevice(
                &Fdo);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoCreateDevice() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        IoSetStartIoAttributes(Fdo, TRUE, TRUE);
@@ -642,7 +642,7 @@ ClassAddDevice(
        Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo, &DeviceExtension->LowerDevice);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        if (DeviceExtension->LowerDevice->Flags & DO_POWER_PAGABLE)
@@ -662,14 +662,14 @@ ClassAddDevice(
                        &DeviceExtension->ClassDO);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
                        goto cleanup;
                }
        }
        Status = ConnectPortDriver(Fdo, DeviceExtension->ClassDO);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ConnectPortDriver() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
@@ -701,7 +701,7 @@ ClassCancelRoutine(
        KIRQL OldIrql;
        BOOLEAN wasQueued = FALSE;
 
-       DPRINT("ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "ClassCancelRoutine(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(ClassDeviceExtension->Common.IsClassDO);
 
@@ -738,7 +738,7 @@ HandleReadIrp(
        PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
        NTSTATUS Status;
 
-       DPRINT("HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "HandleReadIrp(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -804,7 +804,7 @@ ClassStartIo(
        PCLASS_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
        KIRQL OldIrql;
 
-       DPRINT("ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
+       TRACE_(CLASS_NAME, "ClassStartIo(DeviceObject %p, Irp %p)\n", DeviceObject, Irp);
 
        ASSERT(DeviceExtension->Common.IsClassDO);
 
@@ -830,7 +830,7 @@ SearchForLegacyDrivers(
        ULONG Size, ResultLength;
        NTSTATUS Status;
 
-       DPRINT("SearchForLegacyDrivers(%p %p %lu)\n",
+       TRACE_(CLASS_NAME, "SearchForLegacyDrivers(%p %p %lu)\n",
                DriverObject, Context, Count);
 
        if (Count != 1)
@@ -844,7 +844,7 @@ SearchForLegacyDrivers(
                &PortBaseName);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
        PortBaseName.Length -= (sizeof(L"Class") - sizeof(UNICODE_NULL));
@@ -855,7 +855,7 @@ SearchForLegacyDrivers(
        KeyValueInformation = ExAllocatePoolWithTag(PagedPool, Size, CLASS_TAG);
        if (!KeyValueInformation)
        {
-               DPRINT("ExAllocatePoolWithTag() failed\n");
+               WARN_(CLASS_NAME, "ExAllocatePoolWithTag() failed\n");
                Status = STATUS_NO_MEMORY;
                goto cleanup;
        }
@@ -865,13 +865,13 @@ SearchForLegacyDrivers(
        Status = ZwOpenKey(&hDeviceMapKey, 0, &ObjectAttributes);
        if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
        {
-               DPRINT("HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
+               INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP is non-existent\n");
                Status = STATUS_SUCCESS;
                goto cleanup;
        }
        else if (!NT_SUCCESS(Status))
        {
-               DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
 
@@ -880,13 +880,13 @@ SearchForLegacyDrivers(
        Status = ZwOpenKey(&hPortKey, KEY_QUERY_VALUE, &ObjectAttributes);
        if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
        {
-               DPRINT("HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n", &PortBaseName);
+               INFO_(CLASS_NAME, "HKLM\\HARDWARE\\DEVICEMAP\\%wZ is non-existent\n", &PortBaseName);
                Status = STATUS_SUCCESS;
                goto cleanup;
        }
        else if (!NT_SUCCESS(Status))
        {
-               DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ZwOpenKey() failed with status 0x%08lx\n", Status);
                goto cleanup;
        }
 
@@ -904,16 +904,16 @@ SearchForLegacyDrivers(
                Status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject, &PortDeviceObject);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n", &PortName, Status);
+                       WARN_(CLASS_NAME, "IoGetDeviceObjectPointer(%wZ) failed with status 0x%08lx\n", &PortName, Status);
                        continue;
                }
-               DPRINT("Legacy driver found\n");
+               INFO_(CLASS_NAME, "Legacy driver found\n");
 
                Status = ClassAddDevice(DriverObject, PortDeviceObject);
                if (!NT_SUCCESS(Status))
                {
                        /* FIXME: Log the error */
-                       DPRINT("ClassAddDevice() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "ClassAddDevice() failed with status 0x%08lx\n", Status);
                }
        }
 
@@ -945,7 +945,7 @@ DriverEntry(
                (PVOID*)&DriverExtension);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "IoAllocateDriverObjectExtension() failed with status 0x%08lx\n", Status);
                return Status;
        }
        RtlZeroMemory(DriverExtension, sizeof(CLASS_DRIVER_EXTENSION));
@@ -956,14 +956,14 @@ DriverEntry(
                &DriverExtension->RegistryPath);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
                return Status;
        }
 
        Status = ReadRegistryEntries(RegistryPath, DriverExtension);
        if (!NT_SUCCESS(Status))
        {
-               DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
+               WARN_(CLASS_NAME, "ReadRegistryEntries() failed with status 0x%08lx\n", Status);
                return Status;
        }
 
@@ -974,7 +974,7 @@ DriverEntry(
                        &DriverExtension->MainClassDeviceObject);
                if (!NT_SUCCESS(Status))
                {
-                       DPRINT("CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
+                       WARN_(CLASS_NAME, "CreateClassDeviceObject() failed with status 0x%08lx\n", Status);
                        return Status;
                }
        }
index 2f5ac76..005414a 100644 (file)
@@ -4,7 +4,6 @@
 #include <stdio.h>
 #include <pseh/pseh.h>
 
-#define NDEBUG
 #include <debug.h>
 
 #define MAX_PATH 260
@@ -13,6 +12,7 @@
 
 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
 #define CLASS_TAG TAG('M', 'o', 'u', 'C')
+#define DPFLTR_CLASS_NAME_ID DPFLTR_MOUCLASS_ID
 
 typedef enum
 {
index 368557b..0a15a6c 100644 (file)
@@ -303,45 +303,36 @@ RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
     // Calculate the actual offset in the drive
     //
     ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart;
-    DPRINT1("Disk offset is: %d and Offset is: %I64d. Total: %I64d\n",
-            DeviceExtension->DiskOffset, Offset, ActualOffset);
     
     //
     // Convert to pages
     //
     ActualPages.QuadPart = ActualOffset.QuadPart >> PAGE_SHIFT;
-    DPRINT1("Offset in pages is: %I64x\n", ActualPages);
     
     //
     // Now add the base page
     //
     ActualPages.QuadPart = DeviceExtension->BasePage + ActualPages.QuadPart;
-    DPRINT1("Ramdisk mapped at page: %d, actual page is: %I64d\n",
-            DeviceExtension->BasePage, ActualPages);
     
     //
     // Calculate final amount of bytes
     //
     PhysicalAddress.QuadPart = ActualPages.QuadPart << PAGE_SHIFT;
-    DPRINT1("Physical Address is: %I64x\n", PhysicalAddress);
     
     //
     // Calculate pages spanned for the mapping
     //
     ActualLength = ADDRESS_AND_SIZE_TO_SPAN_PAGES(ActualOffset.QuadPart, Length);
-    DPRINT1("Length in pages: %d\n", ActualLength);
     
     //
     // And convert this back to bytes
     //
     ActualLength <<= PAGE_SHIFT;
-    DPRINT1("Length in bytes: %d\n", ActualLength);
     
     //
     // Get the offset within the page
     //
     PageOffset = BYTE_OFFSET(ActualOffset.QuadPart);
-    DPRINT1("Page offset: %lx\n", PageOffset);
     
     //
     // Map the I/O Space from the loader
@@ -353,7 +344,6 @@ RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
     //
     if (MappedBase) MappedBase = (PVOID)((ULONG_PTR)MappedBase + PageOffset);
     *OutputLength = Length;
-    DPRINT1("Mapped at: %p\n", MappedBase);
     return MappedBase;
 }
 
@@ -377,32 +367,26 @@ RamdiskUnmapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
     // Calculate the actual offset in the drive
     //
     ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart;
-    DPRINT1("Disk offset is: %d and Offset is: %I64d. Total: %I64d\n",
-            DeviceExtension->DiskOffset, Offset, ActualOffset);
     
     //
     // Calculate pages spanned for the mapping
     //
     ActualLength = ADDRESS_AND_SIZE_TO_SPAN_PAGES(ActualOffset.QuadPart, Length);
-    DPRINT1("Length in pages: %d\n", ActualLength);
     
     //
     // And convert this back to bytes
     //
     ActualLength <<= PAGE_SHIFT;
-    DPRINT1("Length in bytes: %d\n", ActualLength);
     
     //
     // Get the offset within the page
     //
     PageOffset = BYTE_OFFSET(ActualOffset.QuadPart);
-    DPRINT1("Page offset: %lx\n", PageOffset);
     
     //
     // Calculate actual base address where we mapped this
     //
     BaseAddress = (PVOID)((ULONG_PTR)BaseAddress - PageOffset);
-    DPRINT1("Unmapping at: %p\n", BaseAddress);
     
     //
     // Unmap the I/O space we got from the loader
@@ -528,7 +512,6 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
         DeviceName.MaximumLength = Length;
         wcsncpy(Buffer, L"\\Device\\Ramdisk", Length / sizeof(WCHAR));
         wcsncat(Buffer, GuidString.Buffer, Length / sizeof(WCHAR));
-        DPRINT1("Creating device: %wZ\n", &DeviceName);
         
         //
         // Create the drive device
@@ -573,8 +556,6 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
                 wcsncat(Buffer,
                         GuidString.Buffer,
                         SymbolicLinkName.MaximumLength / sizeof(WCHAR));
-                DPRINT1("Creating symbolic link: %wZ to %wZ \n",
-                        &SymbolicLinkName, &DeviceName);
                 Status = IoCreateSymbolicLink(&SymbolicLinkName, &DeviceName);
                 if (!NT_SUCCESS(Status))
                 {
@@ -612,8 +593,6 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
                                L"\\DosDevices\\%wc:",
                                Input->DriveLetter);
                     RtlInitUnicodeString(&DriveString, LocalBuffer);
-                    DPRINT1("Creating symbolic link: %wZ to %wZ\n",
-                            &DriveString, &DeviceName);
                     IoDeleteSymbolicLink(&DriveString);
                     IoCreateSymbolicLink(&DriveString, &DeviceName);
                     
@@ -765,19 +744,6 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
             DriveExtension->Cylinders++;
         }
         
-        //
-        // Sanity check for debugging
-        //
-        DPRINT1("[RAMDISK] Loaded...\n"
-                "Bytes per Sector: %d\n"
-                "Sectors per Track: %d\n"
-                "Number of Heads: %d\n"
-                "Number of Cylinders: %d\n",
-                DriveExtension->BytesPerSector,
-                DriveExtension->SectorsPerTrack,
-                DriveExtension->NumberOfHeads,
-                DriveExtension->Cylinders);
-        
         //
         // Acquire the disk lock
         //
@@ -1151,7 +1117,6 @@ RamdiskReadWriteReal(IN PIRP Irp,
     //
     // Do the copy loop
     //
-    DPRINT1("Initiating copy loop for %lx bytes at %p\n", BytesLeft, SystemVa);
     while (TRUE)
     {
         //
@@ -1286,11 +1251,7 @@ RamdiskGetPartitionInfo(IN PIRP Irp,
     PartitionInfo->RecognizedPartition = IsRecognizedPartition(PartitionInfo->
                                                                PartitionType);
     PartitionInfo->RewritePartition = FALSE;
-    
-    DPRINT1("Partition length: %I64d\n", PartitionInfo->PartitionLength);
-    DPRINT1("Type: %lx. Recognized: %d\n",
-            PartitionInfo->PartitionType, PartitionInfo->RecognizedPartition);
-    
+
     //
     // Unmap the partition table
     //
index e7296e3..2f63cb5 100644 (file)
@@ -4405,7 +4405,8 @@ SpiCompletionRoutine(PDEVICE_OBJECT DeviceObject,
 
     if (Irp->MdlAddress != NULL)
     {
-        MmUnlockPages(Irp->MdlAddress);
+               /* We don't need to unlock this MDL because the request could 
+                * only have come from dispatch level */
         IoFreeMdl(Irp->MdlAddress);
         Irp->MdlAddress = NULL;
     }
index 40e512f..d3c3aa2 100644 (file)
@@ -1084,4 +1084,23 @@ KeReleaseQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle,
   UNIMPLEMENTED;
 }
 
+VOID
+HalSweepDcache(VOID)
+{
+  UNIMPLEMENTED;
+}
+
+VOID
+HalSweepIcache(VOID)
+{
+    UNIMPLEMENTED;
+}
+
+ULONG
+HalGetInterruptSource(VOID)
+{
+    UNIMPLEMENTED;
+    return 0;
+}
+
 /* EOF */
index f07de77..83daee1 100644 (file)
@@ -1,15 +1,28 @@
 <?xml version="1.0"?>
 <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
 <group>
+       <if property="ARCH" value="arm">
        <module name="hal" type="kernelmodedll">
-               <importlibrary definition="hal_$(ARCH).def" />
+               <importlibrary definition="hal_arm.def" />
                <include base="ntoskrnl">include</include>
                <library>ntoskrnl</library>
                <define name="_NTHAL_" />
-               <linkerflag>-enable-stdcall-fixup</linkerflag>
                <file>hal.c</file>
                <file>hal.rc</file>
+               <file>hal.spec</file>
        </module>
+    </if>
+    <if property="ARCH" value="i386">
+       <module name="hal" type="kernelmodedll">
+               <importlibrary definition="hal.spec.def" />
+               <include base="ntoskrnl">include</include>
+               <library>ntoskrnl</library>
+               <define name="_NTHAL_" />
+               <file>hal.c</file>
+               <file>hal.rc</file>
+               <file>hal.spec</file>
+       </module>
+    </if>
        <if property="ARCH" value="i386">
                <module ifnot="false" name="halupalias" type="alias" installbase="system32" installname="hal.dll" aliasof="halup">
                </module>
index 6ba3578..da2e5db 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #define REACTOS_VERSION_DLL
 #define REACTOS_STR_FILE_DESCRIPTION   "Template Hardware Abstraction Layer\0"
 #define REACTOS_STR_INTERNAL_NAME      "hal\0"
diff --git a/reactos/hal/hal/hal.spec b/reactos/hal/hal/hal.spec
new file mode 100644 (file)
index 0000000..2d5ec88
--- /dev/null
@@ -0,0 +1,102 @@
+#include "include/reactos/msvctarget.h"
+
+@ fastcall ExAcquireFastMutex(ptr) ExiAcquireFastMutex
+@ fastcall ExReleaseFastMutex(ptr) ExiReleaseFastMutex
+@ fastcall ExTryToAcquireFastMutex(ptr) ExiTryToAcquireFastMutex
+@ fastcall HalClearSoftwareInterrupt(long)
+@ fastcall HalRequestSoftwareInterrupt(long)
+@ fastcall HalSystemVectorDispatchEntry(long long long)
+@ fastcall KeAcquireInStackQueuedSpinLock(ptr ptr)
+@ fastcall KeAcquireInStackQueuedSpinLockRaiseToSynch(ptr ptr)
+@ fastcall KeAcquireSpinLockRaiseToSynch(ptr)
+@ fastcall KeAcquireQueuedSpinLock(ptr)
+@ fastcall KeAcquireQueuedSpinLockRaiseToSynch(ptr)
+@ fastcall KeReleaseInStackQueuedSpinLock(ptr)
+@ fastcall KeReleaseQueuedSpinLock(ptr long)
+@ fastcall KeTryToAcquireQueuedSpinLock(long ptr)
+@ fastcall KeTryToAcquireQueuedSpinLockRaiseToSynch(long ptr)
+@ fastcall KfAcquireSpinLock(ptr)
+@ fastcall KfLowerIrql(long)
+@ fastcall KfRaiseIrql(long)
+@ fastcall KfReleaseSpinLock(ptr long)
+
+@ stdcall HalAcquireDisplayOwnership(ptr)
+@ stdcall HalAdjustResourceList(ptr)
+@ stdcall HalAllProcessorsStarted()
+@ stdcall HalAllocateAdapterChannel(ptr ptr long ptr)
+@ stdcall HalAllocateCommonBuffer(ptr long ptr long)
+@ stdcall HalAllocateCrashDumpRegisters(ptr ptr)
+@ stdcall HalAssignSlotResources(ptr ptr ptr ptr long long long ptr)
+@ stdcall HalBeginSystemInterrupt(long long ptr)
+@ stdcall HalCalibratePerformanceCounter(ptr long long)
+@ stdcall HalDisableSystemInterrupt(long long)
+@ stdcall HalDisplayString(str)
+@ stdcall HalEnableSystemInterrupt(long long long)
+@ stdcall HalEndSystemInterrupt(long long)
+@ stdcall HalFlushCommonBuffer(long long long long long)
+@ stdcall HalFreeCommonBuffer(ptr long long long ptr long)
+@ stdcall HalGetAdapter(ptr ptr)
+@ stdcall HalGetBusData(long long long ptr long)
+@ stdcall HalGetBusDataByOffset(long long long ptr long long)
+@ stdcall HalGetEnvironmentVariable(str long str)
+#ifdef _M_ARM
+@ fastcall HalGetInterruptSource()
+#endif
+@ stdcall HalGetInterruptVector(long long long long ptr ptr)
+@ stdcall HalHandleNMI(ptr)
+@ stdcall HalInitSystem(long ptr)
+@ stdcall HalInitializeProcessor(long ptr)
+@ stdcall HalMakeBeep(long)
+@ stdcall HalProcessorIdle()
+@ stdcall HalQueryDisplayParameters(ptr ptr ptr ptr)
+@ stdcall HalQueryRealTimeClock(ptr)
+@ stdcall HalReadDmaCounter(ptr)
+@ stdcall HalReportResourceUsage()
+@ stdcall HalRequestIpi(long)
+@ stdcall HalReturnToFirmware(long)
+@ stdcall HalSetBusData(long long long ptr long)
+@ stdcall HalSetBusDataByOffset(long long long ptr long long)
+@ stdcall HalSetDisplayParameters(long long)
+@ stdcall HalSetEnvironmentVariable(str str)
+@ stdcall HalSetProfileInterval(long)
+@ stdcall HalSetRealTimeClock(ptr)
+@ stdcall HalSetTimeIncrement(long)
+@ stdcall HalStartNextProcessor(ptr ptr)
+@ stdcall HalStartProfileInterrupt(long)
+@ stdcall HalStopProfileInterrupt(long)
+#ifdef _M_ARM
+@ fastcall HalSweepIcache()
+@ fastcall HalSweepDcache()
+#endif
+@ stdcall HalTranslateBusAddress(long long long long ptr ptr)
+@ stdcall IoAssignDriveLetters(ptr str ptr ptr) HalpAssignDriveLetters
+@ stdcall IoFlushAdapterBuffers(ptr ptr ptr ptr long long)
+@ stdcall IoFreeAdapterChannel(ptr)
+@ stdcall IoFreeMapRegisters(ptr ptr long)
+@ stdcall IoMapTransfer(ptr ptr ptr ptr ptr long)
+@ stdcall IoReadPartitionTable(ptr long long ptr) HalpReadPartitionTable
+@ stdcall IoSetPartitionInformation(ptr long long long) HalpSetPartitionInformation
+@ stdcall IoWritePartitionTable(ptr long long long ptr) HalpWritePartitionTable
+@ stdcall KeAcquireSpinLock(ptr ptr)
+@ extern KdComPortInUse _KdComPortInUse
+@ stdcall KeFlushWriteBuffer()
+@ stdcall KeGetCurrentIrql()
+@ stdcall KeLowerIrql(long)
+@ stdcall KeQueryPerformanceCounter(ptr)
+@ stdcall KeRaiseIrql(long ptr)
+@ stdcall KeRaiseIrqlToDpcLevel()
+@ stdcall KeRaiseIrqlToSynchLevel()
+@ stdcall KeReleaseSpinLock(ptr long)
+@ stdcall KeStallExecutionProcessor(long)
+@ stdcall READ_PORT_BUFFER_UCHAR(ptr ptr long)
+@ stdcall READ_PORT_BUFFER_ULONG(ptr ptr long)
+@ stdcall READ_PORT_BUFFER_USHORT(ptr ptr long)
+@ stdcall READ_PORT_UCHAR(ptr)
+@ stdcall READ_PORT_ULONG(ptr)
+@ stdcall READ_PORT_USHORT(ptr)
+@ stdcall WRITE_PORT_BUFFER_UCHAR(ptr ptr long)
+@ stdcall WRITE_PORT_BUFFER_ULONG(ptr ptr long)
+@ stdcall WRITE_PORT_BUFFER_USHORT(ptr ptr long)
+@ stdcall WRITE_PORT_UCHAR(ptr long)
+@ stdcall WRITE_PORT_ULONG(ptr long)
+@ stdcall WRITE_PORT_USHORT(ptr long)
index 1e31984..5595453 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
 <group xmlns:xi="http://www.w3.org/2001/XInclude">
        <module name="halmp" type="kernelmodedll" entrypoint="0">
-               <importlibrary base="hal" definition="hal_i386.def" />
+               <importlibrary base="hal" definition="hal.spec.def" />
                <bootstrap installbase="$(CDOUTPUT)" />
                <include>include</include>
                <include base="ntoskrnl">include</include>
index 902645c..c588db5 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
 <group xmlns:xi="http://www.w3.org/2001/XInclude">
        <module name="halup" type="kernelmodedll" entrypoint="0" installname="hal.dll">
-               <importlibrary base="hal" definition="hal_i386.def" />
+               <importlibrary base="hal" definition="hal.spec.def" />
                <bootstrap installbase="$(CDOUTPUT)" />
                <include>include</include>
                <include base="ntoskrnl">include</include>
index 3002bde..6dff278 100644 (file)
@@ -2,7 +2,7 @@
 <!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
 <group xmlns:xi="http://www.w3.org/2001/XInclude">
        <module name="halxbox" type="kernelmodedll" entrypoint="0" allowwarnings="true">
-               <importlibrary base="hal" definition="hal_i386.def" />
+               <importlibrary base="hal" definition="hal.spec.def" />
                <include>include</include>
                <include base="ntoskrnl">include</include>
                <define name="_DISABLE_TIDENTS" />
index 6e41a90..172d987 100644 (file)
@@ -79,6 +79,22 @@ DEFINE_GUID (GUID_HID_INTERFACE_HIDPARSE, \
 #define IOCTL_HID_SET_DRIVER_CONFIG           HID_BUFFER_CTL_CODE(101)
 #define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR     HID_OUT_CTL_CODE(121)
 
+/* FIXME: these values are wrong! */
+#define IOCTL_HID_GET_STRING                  0
+#define IOCTL_HID_GET_DEVICE_ATTRIBUTES       1
+#define IOCTL_HID_GET_DEVICE_DESCRIPTOR       2
+#define IOCTL_HID_READ_REPORT                 3
+#define IOCTL_HID_WRITE_REPORT                4
+#define IOCTL_HID_GET_REPORT_DESCRIPTOR       5
+
+typedef enum _HID_STRING_TYPE
+{
+       HID_STRING_INDEXED = 0,
+       HID_STRING_ID_IMANUFACTURER,
+       HID_STRING_ID_IPRODUCT,
+       HID_STRING_ID_ISERIALNUMBER,
+       HID_STRING_MAX
+} HID_STRING_TYPE;
 
 enum DeviceObjectState {
   DeviceObjectStarted = 0,
index 390b5ff..34ab88d 100644 (file)
 #pragma GCC system_header
 #endif
 
-/* translate GCC target defines to MS equivalents. Keep this synchronized
-   with winnt.h. */
-#if defined(__i686__) && !defined(_M_IX86)
-#define _M_IX86 600
-#elif defined(__i586__) && !defined(_M_IX86)
-#define _M_IX86 500
-#elif defined(__i486__) && !defined(_M_IX86)
-#define _M_IX86 400
-#elif defined(__i386__) && !defined(_M_IX86)
-#define _M_IX86 300
+#ifdef __GNUC__
+#include <msvctarget.h>
 #endif
+
 #if defined(_M_IX86) && !defined(_X86_)
 #define _X86_
 #elif defined(_M_ALPHA) && !defined(_ALPHA_)
 #define _ALPHA_
+#elif defined(_M_ARM) && !defined(_ARM_)
+#define _ARM_
 #elif defined(_M_PPC) && !defined(_PPC_)
 #define _PPC_
 #elif defined(_M_MRX000) && !defined(_MIPS_)
index 96f067c..f7b6c05 100644 (file)
@@ -4,24 +4,16 @@
 #pragma GCC system_header
 #endif
 
-/* translate GCC target defines to MS equivalents. Keep this synchronized
-   with windows.h. */
-#if defined(__i686__) && !defined(_M_IX86)
-#define _M_IX86 600
-#elif defined(__i586__) && !defined(_M_IX86)
-#define _M_IX86 500
-#elif defined(__i486__) && !defined(_M_IX86)
-#define _M_IX86 400
-#elif defined(__i386__) && !defined(_M_IX86)
-#define _M_IX86 300
+#ifdef __GNUC__
+#include <msvctarget.h>
 #endif
+
 #if defined(_M_IX86) && !defined(_X86_)
 #define _X86_
 #elif defined(_M_ALPHA) && !defined(_ALPHA_)
 #define _ALPHA_
-
-#elif defined(_M_ARM) && !defined(ARM)
-#define ARM
+#elif defined(_M_ARM) && !defined(_ARM_)
+#define _ARM_
 #elif defined(_M_PPC) && !defined(_PPC_)
 #define _PPC_
 #elif defined(_M_MRX000) && !defined(_MIPS_)
diff --git a/reactos/include/reactos/msvctarget.h b/reactos/include/reactos/msvctarget.h
new file mode 100644 (file)
index 0000000..2366279
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef __GNUC__
+#error Unsupported compiler
+#endif
+
+/* translate GCC target defines to MS equivalents. */
+#if defined(__i686__) && !defined(_M_IX86)
+#define _M_IX86 600
+#undef __i686__
+#elif defined(__i586__) && !defined(_M_IX86)
+#define _M_IX86 500
+#undef __i586__
+#elif defined(__i486__) && !defined(_M_IX86)
+#define _M_IX86 400
+#undef __i486__
+#elif defined(__i386__) && !defined(_M_IX86)
+#define _M_IX86 300
+#endif
index c6575d1..873751d 100644 (file)
@@ -6,8 +6,11 @@ extern "C" {
 #endif
 
 #include <windows.h>
+#include <objbase.h>
 #define ANY_SIZE 1
 
+/* Structures used by the API Interface */
+
 typedef struct _DELETED_FILE_DETAILS_A
 {
        FILETIME      LastModification;
@@ -34,12 +37,29 @@ typedef struct _DELETED_FILE_DETAILS_W
 #define PDELETED_FILE_DETAILS PDELETED_FILE_DETAILS_A
 #endif
 
+/* API Interface */
+
+/* Function called for each deleted file in the recycle bin
+ * Context: value given by the caller of the EnumerateRecycleBin function
+ * hDeletedFile: a handle to the deleted file
+ * Returning FALSE stops the enumeration.
+ * Remarks: the handle must be closed with the CloseRecycleBinHandle function
+ */
 typedef BOOL (WINAPI *PENUMERATE_RECYCLEBIN_CALLBACK)(IN PVOID Context, IN HANDLE hDeletedFile);
 
+/* Closes a file deleted handle.
+ * hDeletedFile: the handle to close
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remark: The handle is obtained in the PENUMERATE_RECYCLEBIN_CALLBACK callback
+ */
 BOOL WINAPI
 CloseRecycleBinHandle(
        IN HANDLE hDeletedFile);
 
+/* Moves a file to the recycle bin.
+ * FileName: the name of the file to move the recycle bin
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ */
 BOOL WINAPI
 DeleteFileToRecycleBinA(
        IN LPCSTR FileName);
@@ -52,6 +72,11 @@ DeleteFileToRecycleBinW(
 #define DeleteFileToRecycleBin DeleteFileToRecycleBinA
 #endif
 
+/* Removes all elements contained in a recycle bin
+ * pszRoot: the name of the drive containing the recycle bin
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remarks: 'pszRoot' can be NULL to mean 'all recycle bins'.
+ */
 BOOL WINAPI
 EmptyRecycleBinA(
        IN LPCSTR pszRoot OPTIONAL);
@@ -64,6 +89,13 @@ EmptyRecycleBinW(
 #define EmptyRecycleBin EmptyRecycleBinA
 #endif
 
+/* Enumerate contents of a recycle bin.
+ * pszRoot: the name of the drive containing the recycle bin
+ * pFnCallback: callback function to be called for each deleted item found
+ * Context: some value which will be given back in the callback function
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remarks: 'pszRoot' can be NULL to mean 'all recycle bins'.
+ */
 BOOL WINAPI
 EnumerateRecycleBinA(
        IN LPCSTR pszRoot OPTIONAL,
@@ -80,6 +112,14 @@ EnumerateRecycleBinW(
 #define EnumerateRecycleBin EnumerateRecycleBinA
 #endif
 
+/* Gets details about a deleted file
+ * hDeletedFile: handle of the deleted file to get details about
+ * BufferSize: size of the 'FileDetails' buffer, in bytes
+ * FileDetails: if the function succeeded, contains details about the deleted file
+ * RequiredSize: contains the minimal buffer size required to get file information details
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remark: The handle is obtained in the PENUMERATE_RECYCLEBIN_CALLBACK callback
+ */
 BOOL WINAPI
 GetDeletedFileDetailsA(
        IN HANDLE hDeletedFile,
@@ -98,67 +138,87 @@ GetDeletedFileDetailsW(
 #define GetDeletedFileDetails GetDeletedFileDetailsA
 #endif
 
+/* Restores a deleted file
+ * hDeletedFile: handle of the deleted file to restore
+ * Returns TRUE if operation succeeded, FALSE otherwise.
+ * Remarks: if the function succeeds, the handle is not valid anymore.
+ */
 BOOL WINAPI
 RestoreFile(
        IN HANDLE hDeletedFile);
 
 /* COM interface */
 
-typedef interface IRecycleBinFile IRecycleBinFile;
-EXTERN_C const IID IID_IRecycleBinFile;
+#undef INTERFACE
+#define INTERFACE IRecycleBinFile
 
-typedef struct IRecycleBinFileVtbl
+DECLARE_INTERFACE_(IRecycleBinFile, IUnknown)
 {
-       HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-               IN IRecycleBinFile *This,
-               IN REFIID riid,
-               OUT void **ppvObject);
-
-       ULONG (STDMETHODCALLTYPE *AddRef)(
-               IN IRecycleBinFile *This);
+       BEGIN_INTERFACE
+
+       /* IUnknown methods */
+       STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
+       STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+       STDMETHOD_(ULONG, Release)(THIS) PURE;
+
+       /* IRecycleBinFile methods */
+       STDMETHOD(GetLastModificationTime)(THIS_ FILETIME *pLastModificationTime) PURE;
+       STDMETHOD(GetDeletionTime)(THIS_ FILETIME *pDeletionTime) PURE;
+       STDMETHOD(GetFileSize)(THIS_ ULARGE_INTEGER *pFileSize) PURE;
+       STDMETHOD(GetPhysicalFileSize)(THIS_ ULARGE_INTEGER *pPhysicalFileSize) PURE;
+       STDMETHOD(GetAttributes)(THIS_ DWORD *pAttributes) PURE;
+       STDMETHOD(GetFileName)(THIS_ SIZE_T BufferSize, LPWSTR Buffer, SIZE_T *RequiredSize) PURE;
+       STDMETHOD(Delete)(THIS) PURE;
+       STDMETHOD(Restore)(THIS) PURE;
+
+       END_INTERFACE
+};
 
-       ULONG (STDMETHODCALLTYPE *Release)(
-               IN IRecycleBinFile *This);
+#undef INTERFACE
+#define INTERFACE IRecycleBinEnumList
 
-       HRESULT (STDMETHODCALLTYPE *GetLastModificationTime)(
-               IN IRecycleBinFile *This,
-               OUT FILETIME *pLastModificationTime);
+DECLARE_INTERFACE_(IRecycleBinEnumList, IUnknown)
+{
+       BEGIN_INTERFACE
 
-       HRESULT (STDMETHODCALLTYPE *GetDeletionTime)(
-               IN IRecycleBinFile *This,
-               OUT FILETIME *pDeletionTime);
+       /* IUnknown methods */
+       STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
+       STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+       STDMETHOD_(ULONG, Release)(THIS) PURE;
 
-       HRESULT (STDMETHODCALLTYPE *GetFileSize)(
-               IN IRecycleBinFile *This,
-               OUT ULARGE_INTEGER *pFileSize);
+       /* IRecycleBinEnumList methods */
+       STDMETHOD(Next)(THIS_ DWORD celt, IRecycleBinFile **rgelt, DWORD *pceltFetched);
+       STDMETHOD(Skip)(THIS_ DWORD celt) PURE;
+       STDMETHOD(Reset)(THIS) PURE;
 
-       HRESULT (STDMETHODCALLTYPE *GetPhysicalFileSize)(
-               IN IRecycleBinFile *This,
-               OUT ULARGE_INTEGER *pPhysicalFileSize);
+       END_INTERFACE
+};
 
-       HRESULT (STDMETHODCALLTYPE *GetAttributes)(
-               IN IRecycleBinFile *This,
-               OUT DWORD *pAttributes);
+#undef INTERFACE
+#define INTERFACE IRecycleBin
 
-       HRESULT (STDMETHODCALLTYPE *GetFileName)(
-               IN IRecycleBinFile *This,
-               IN SIZE_T BufferSize,
-               IN OUT LPWSTR Buffer,
-               OUT SIZE_T *RequiredSize);
+DECLARE_INTERFACE_(IRecycleBin, IUnknown)
+{
+       BEGIN_INTERFACE
 
-       HRESULT (STDMETHODCALLTYPE *Delete)(
-               IN IRecycleBinFile *This);
+       /* IUnknown methods */
+       STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
+       STDMETHOD_(ULONG, AddRef)(THIS) PURE;
+       STDMETHOD_(ULONG, Release)(THIS) PURE;
 
-       HRESULT (STDMETHODCALLTYPE *Restore)(
-               IN IRecycleBinFile *This);
-} IRecycleBinFileVtbl;
+       /* IRecycleBin methods */
+       STDMETHOD(DeleteFile)(THIS_ LPCWSTR szFileName);
+       STDMETHOD(EmptyRecycleBin)(THIS);
+       STDMETHOD(EnumObjects)(THIS_ IRecycleBinEnumList **ppEnumList);
 
-interface IRecycleBinFile
-{
-       CONST_VTBL struct IRecycleBinFileVtbl *lpVtbl;
+       END_INTERFACE
 };
 
-#ifdef COBJMACROS
+EXTERN_C const IID IID_IRecycleBinFile;
+EXTERN_C const IID IID_IRecycleBinEnumList;
+EXTERN_C const IID IID_IRecycleBin;
+
+#if (!defined(__cplusplus) || defined(CINTERFACE)) && defined(COBJMACROS)
 #define IRecycleBinFile_QueryInterface(This, riid, ppvObject) \
        (This)->lpVtbl->QueryInterface(This, riid, ppvObject)
 #define IRecycleBinFile_AddRef(This) \
@@ -181,44 +241,7 @@ interface IRecycleBinFile
        (This)->lpVtbl->Delete(This)
 #define IRecycleBinFile_Restore(This) \
        (This)->lpVtbl->Restore(This)
-#endif
-
-typedef interface IRecycleBinEnumList IRecycleBinEnumList;
-EXTERN_C const IID IID_IRecycleBinEnumList;
-
-typedef struct IRecycleBinEnumListVtbl
-{
-       HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-               IN IRecycleBinEnumList *This,
-               IN REFIID riid,
-               OUT void **ppvObject);
-
-       ULONG (STDMETHODCALLTYPE *AddRef)(
-               IN IRecycleBinEnumList *This);
-
-       ULONG (STDMETHODCALLTYPE *Release)(
-               IN IRecycleBinEnumList *This);
 
-       HRESULT (STDMETHODCALLTYPE *Next)(
-               IN IRecycleBinEnumList *This,
-               IN DWORD celt,
-               IN OUT IRecycleBinFile **rgelt,
-               OUT DWORD *pceltFetched);
-
-       HRESULT (STDMETHODCALLTYPE *Skip)(
-               IN IRecycleBinEnumList *This,
-               IN DWORD celt);
-
-       HRESULT (STDMETHODCALLTYPE *Reset)(
-               IN IRecycleBinEnumList *This);
-} IRecycleBinEnumListVtbl;
-
-interface IRecycleBinEnumList
-{
-       CONST_VTBL struct IRecycleBinEnumListVtbl *lpVtbl;
-};
-
-#ifdef COBJMACROS
 #define IRecycleBinEnumList_QueryInterface(This, riid, ppvObject) \
        (This)->lpVtbl->QueryInterface(This, riid, ppvObject)
 #define IRecycleBinEnumList_AddRef(This) \
@@ -231,42 +254,7 @@ interface IRecycleBinEnumList
        (This)->lpVtbl->Skip(This, celt)
 #define IRecycleBinEnumList_Reset(This) \
        (This)->lpVtbl->Reset(This)
-#endif
-
-typedef interface IRecycleBin IRecycleBin;
-EXTERN_C const IID IID_IRecycleBin;
-
-typedef struct IRecycleBinVtbl
-{
-       HRESULT (STDMETHODCALLTYPE *QueryInterface)(
-               IN IRecycleBin *This,
-               IN REFIID riid,
-               OUT void **ppvObject);
-
-       ULONG (STDMETHODCALLTYPE *AddRef)(
-               IN IRecycleBin *This);
-
-       ULONG (STDMETHODCALLTYPE *Release)(
-               IN IRecycleBin *This);
-
-       HRESULT (STDMETHODCALLTYPE *DeleteFile)(
-               IN IRecycleBin *This,
-               IN LPCWSTR szFileName);
-
-       HRESULT (STDMETHODCALLTYPE *EmptyRecycleBin)(
-               IN IRecycleBin *This);
-
-       HRESULT (STDMETHODCALLTYPE *EnumObjects)(
-               IN IRecycleBin *This,
-               OUT IRecycleBinEnumList **ppEnumList);
-} IRecycleBinVtbl;
-
-interface IRecycleBin
-{
-       CONST_VTBL struct IRecycleBinVtbl *lpVtbl;
-};
 
-#ifdef COBJMACROS
 #define IRecycleBin_QueryInterface(This, riid, ppvObject) \
        (This)->lpVtbl->QueryInterface(This, riid, ppvObject)
 #define IRecycleBin_AddRef(This) \
index 25d68e9..07f8ff5 100644 (file)
@@ -195,7 +195,7 @@ RtlCreateUserProcess(IN PUNICODE_STRING ImageFileName,
     HANDLE hSection;
     PROCESS_BASIC_INFORMATION ProcessBasicInfo;
     OBJECT_ATTRIBUTES ObjectAttributes;
-    UNICODE_STRING DebugString = RTL_CONSTANT_STRING(L"\\WindowsSS");;
+    UNICODE_STRING DebugString = RTL_CONSTANT_STRING(L"\\WindowsSS");
     DPRINT("RtlCreateUserProcess: %wZ\n", ImageFileName);
 
     /* Map and Load the File */
index 297c7a6..10125e4 100644 (file)
@@ -27,7 +27,7 @@
  */
 #define MAX_ELEM_LEN 64 /* Max length of country/language/CP string */
 
-unsigned char MSVCRT_mbctype[257];
+unsigned char MSVCRT_mbctype[257] = { 0 };
 static int g_mbcp_is_multibyte = 0;
 
 /* It seems that the data about valid trail bytes is not available from kernel32
@@ -49,11 +49,11 @@ static struct cp_extra_info_t g_cpextrainfo[] =
 };
 
 
-char MSVCRT_current_lc_all[MAX_LOCALE_LENGTH];
-LCID MSVCRT_current_lc_all_lcid;
-int MSVCRT___lc_codepage;
-int MSVCRT___lc_collate_cp;
-HANDLE MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1];
+char MSVCRT_current_lc_all[MAX_LOCALE_LENGTH] = { 0 };
+LCID MSVCRT_current_lc_all_lcid = 0;
+int MSVCRT___lc_codepage = 0;
+int MSVCRT___lc_collate_cp = 0;
+HANDLE MSVCRT___lc_handle[MSVCRT_LC_MAX - MSVCRT_LC_MIN + 1] = { 0 };
 
 /* MT */
 #define LOCK_LOCALE   _mlock(_SETLOCALE_LOCK);
@@ -875,3 +875,19 @@ int CDECL _getmbcp(void)
 {
     return MSVCRT___lc_codepage;
 }
+
+/*********************************************************************
+ *             ___unguarded_readlc_active_add_func (MSVCRT.@)
+ */
+unsigned int * CDECL ___unguarded_readlc_active_add_func(void)
+{
+  return &__unguarded_readlc_active;
+}
+
+/*********************************************************************
+ *             ___setlc_active_func (MSVCRT.@)
+ */
+unsigned int CDECL ___setlc_active_func(void)
+{
+  return __setlc_active;
+}
index 383a9f1..e0ded79 100644 (file)
@@ -96,7 +96,7 @@ typedef struct {
 
 /*static */ioinfo fdesc[MAX_FILES];
 
-FILE _iob[3];
+FILE _iob[3] = { { 0 } };
 
 static int fdstart = 3; /* first unallocated fd */
 static int fdend = 3; /* highest allocated fd */
@@ -182,7 +182,7 @@ static HANDLE fdtoh(int fd)
     *_errno() = EBADF;
     return INVALID_HANDLE_VALUE;
   }
-  if (fdesc[fd].handle == INVALID_HANDLE_VALUE) FIXME("wtf\n");
+  //if (fdesc[fd].handle == INVALID_HANDLE_VALUE) FIXME("wtf\n");
   return fdesc[fd].handle;
 }
 
index 7f13aae..356088a 100644 (file)
@@ -76,7 +76,10 @@ NtProcessStartup(PPEB Peb)
     ULONG Length;
     ASSERT(Peb);
 
-    DPRINT("%s(%08lx) called\n", __FUNCTION__, Peb);
+#ifdef _M_ARM // Huge achievement
+    DPRINT1("%s(%08lx) called\n", __FUNCTION__, Peb);
+    while (TRUE);
+#endif
 
     /* Normalize and get the Process Parameters */
     ProcessParameters = RtlNormalizeProcessParams(Peb->ProcessParameters);
index 20ef06b..83b553f 100644 (file)
@@ -147,4 +147,23 @@ typedef enum _ARM_DOMAIN
     ManagerDomain
 } ARM_DOMAIN;
 
+//
+// Take 0x80812345 and extract:
+// PTE_BASE[0x808][0x12]
+//
+#define MiGetPteAddress(x)         \
+    (PMMPTE)(PTE_BASE + \
+             (((ULONG)(x) >> 20) << 12) + \
+             ((((ULONG)(x) >> 12) & 0xFF) << 2))
+
+#define MiGetPdeAddress(x)         \
+    (PMMPTE)(PDE_BASE + \
+             (((ULONG)(x) >> 20) << 2))
+
+#define MiGetPdeOffset(x) (((ULONG)(x)) >> 22)
+
+#define PTE_BASE    0xC0000000
+#define PDE_BASE    0xC1000000
+#define HYPER_SPACE 0xC1100000
+
 #endif
index 26d4a33..a799b3b 100644 (file)
@@ -251,6 +251,27 @@ KdpBochsDebugPrint(
     IN ULONG Length
 );
 
+BOOLEAN
+STDCALL
+KdpSafeReadMemory(
+    IN ULONG_PTR Addr,
+    IN LONG Len,
+    OUT PVOID Value
+);
+
+BOOLEAN
+STDCALL
+KdpSafeWriteMemory(
+    IN ULONG_PTR Addr,
+    IN LONG Len,
+    IN ULONGLONG Value
+);
+
+VOID
+STDCALL
+KdpEnableSafeMem();
+
+
 /* KD GLOBALS  ***************************************************************/
 
 typedef
index 39686a1..6e252b2 100644 (file)
@@ -250,15 +250,6 @@ typedef struct _MEMORY_AREA
     } Data;
 } MEMORY_AREA, *PMEMORY_AREA;
 
-typedef struct _MADDRESS_SPACE
-{
-    PMEMORY_AREA MemoryAreaRoot;
-    PVOID LowestAddress;
-    PEPROCESS Process;
-    PUSHORT PageTableRefCountTable;
-    PEX_PUSH_LOCK Lock;
-} MADDRESS_SPACE, *PMADDRESS_SPACE;
-
 typedef struct
 {
     ULONG NrTotalPages;
@@ -371,7 +362,7 @@ extern MM_MEMORY_CONSUMER MiMemoryConsumers[MC_MAXIMUM];
 
 typedef VOID
 (*PMM_ALTER_REGION_FUNC)(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID BaseAddress,
     ULONG Length,
     ULONG OldType,
@@ -390,22 +381,6 @@ typedef VOID
     BOOLEAN Dirty
 );
 
-/* aspace.c ******************************************************************/
-
-VOID
-NTAPI
-MmInitializeKernelAddressSpace(VOID);
-
-NTSTATUS
-NTAPI
-MmInitializeAddressSpace(
-    struct _EPROCESS* Process,
-    PMADDRESS_SPACE AddressSpace);
-
-NTSTATUS
-NTAPI
-MmDestroyAddressSpace(PMADDRESS_SPACE AddressSpace);
-
 /* marea.c *******************************************************************/
 
 NTSTATUS
@@ -415,7 +390,7 @@ MmInitMemoryAreas(VOID);
 NTSTATUS
 NTAPI
 MmCreateMemoryArea(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     ULONG Type,
     PVOID *BaseAddress,
     ULONG_PTR Length,
@@ -429,21 +404,21 @@ MmCreateMemoryArea(
 PMEMORY_AREA
 NTAPI
 MmLocateMemoryAreaByAddress(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID Address
 );
 
 ULONG_PTR
 NTAPI
 MmFindGapAtAddress(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID Address
 );
 
 NTSTATUS
 NTAPI
 MmFreeMemoryArea(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MemoryArea,
     PMM_FREE_PAGE_FUNC FreePage,
     PVOID FreePageContext
@@ -452,7 +427,7 @@ MmFreeMemoryArea(
 NTSTATUS
 NTAPI
 MmFreeMemoryAreaByPtr(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID BaseAddress,
     PMM_FREE_PAGE_FUNC FreePage,
     PVOID FreePageContext
@@ -460,12 +435,12 @@ MmFreeMemoryAreaByPtr(
 
 VOID
 NTAPI
-MmDumpMemoryAreas(PMADDRESS_SPACE AddressSpace);
+MmDumpMemoryAreas(PMM_AVL_TABLE AddressSpace);
 
 PMEMORY_AREA
 NTAPI
 MmLocateMemoryAreaByRegion(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID Address,
     ULONG_PTR Length
 );
@@ -473,7 +448,7 @@ MmLocateMemoryAreaByRegion(
 PVOID
 NTAPI
 MmFindGap(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     ULONG_PTR Length,
     ULONG_PTR Granularity,
     BOOLEAN TopDown
@@ -483,7 +458,7 @@ VOID
 NTAPI
 MmReleaseMemoryAreaIfDecommitted(
     struct _EPROCESS *Process,
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID BaseAddress
 );
 
@@ -749,7 +724,7 @@ MmAccessFault(
 NTSTATUS
 NTAPI
 MmNotPresentFaultVirtualMemory(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     MEMORY_AREA* MemoryArea,
     PVOID Address,
     BOOLEAN Locked
@@ -758,7 +733,7 @@ MmNotPresentFaultVirtualMemory(
 NTSTATUS
 NTAPI
 MmPageOutVirtualMemory(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MemoryArea,
     PVOID Address,
     struct _MM_PAGEOP* PageOp
@@ -783,7 +758,7 @@ MmFreeVirtualMemory(
 NTSTATUS
 NTAPI
 MmProtectAnonMem(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MemoryArea,
     PVOID BaseAddress,
     ULONG Length,
@@ -794,7 +769,7 @@ MmProtectAnonMem(
 NTSTATUS
 NTAPI
 MmWritePageVirtualMemory(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MArea,
     PVOID Address,
     PMM_PAGEOP PageOp
@@ -1364,7 +1339,7 @@ MmTrimUserMemory(
 NTSTATUS
 NTAPI
 MmAlterRegion(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PVOID BaseAddress,
     PLIST_ENTRY RegionListHead,
     PVOID StartAddress,
@@ -1432,7 +1407,7 @@ MmQuerySectionView(
 NTSTATUS
 NTAPI
 MmProtectSectionView(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MemoryArea,
     PVOID BaseAddress,
     ULONG Length,
@@ -1443,7 +1418,7 @@ MmProtectSectionView(
 NTSTATUS
 NTAPI
 MmWritePageSectionView(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MArea,
     PVOID Address,
     PMM_PAGEOP PageOp
@@ -1456,7 +1431,7 @@ MmInitSectionImplementation(VOID);
 NTSTATUS
 NTAPI
 MmNotPresentFaultSectionView(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     MEMORY_AREA* MemoryArea,
     PVOID Address,
     BOOLEAN Locked
@@ -1465,7 +1440,7 @@ MmNotPresentFaultSectionView(
 NTSTATUS
 NTAPI
 MmPageOutSectionView(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     PMEMORY_AREA MemoryArea,
     PVOID Address,
     struct _MM_PAGEOP *PageOp
@@ -1478,7 +1453,7 @@ MmCreatePhysicalMemorySection(VOID);
 NTSTATUS
 NTAPI
 MmAccessFaultSectionView(
-    PMADDRESS_SPACE AddressSpace,
+    PMM_AVL_TABLE AddressSpace,
     MEMORY_AREA* MemoryArea,
     PVOID Address,
     BOOLEAN Locked
@@ -1572,36 +1547,42 @@ MiSyncThreadProcessViews(IN PVOID Process,
 }
 
 
-extern MADDRESS_SPACE MmKernelAddressSpace;
+extern PMM_AVL_TABLE MmKernelAddressSpace;
 
 FORCEINLINE
 VOID
-MmLockAddressSpace(PMADDRESS_SPACE AddressSpace)
+MmLockAddressSpace(PMM_AVL_TABLE AddressSpace)
 {
-    KeEnterCriticalRegion();
-    ExAcquirePushLockExclusive(AddressSpace->Lock);
+    KeAcquireGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot)->AddressCreationLock);
 }
 
 FORCEINLINE
 VOID
-MmUnlockAddressSpace(PMADDRESS_SPACE AddressSpace)
+MmUnlockAddressSpace(PMM_AVL_TABLE AddressSpace)
+{
+    KeReleaseGuardedMutex(&CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot)->AddressCreationLock);
+}
+
+FORCEINLINE
+PEPROCESS
+MmGetAddressSpaceOwner(IN PMM_AVL_TABLE AddressSpace)
 {
-    ExReleasePushLock(AddressSpace->Lock);
-    KeLeaveCriticalRegion();
+    if (AddressSpace == MmKernelAddressSpace) return NULL;
+    return CONTAINING_RECORD(AddressSpace, EPROCESS, VadRoot);
 }
 
 FORCEINLINE
-PMADDRESS_SPACE
+PMM_AVL_TABLE
 MmGetCurrentAddressSpace(VOID)
 {
-    return (PMADDRESS_SPACE)&((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->VadRoot;
+    return &((PEPROCESS)KeGetCurrentThread()->ApcState.Process)->VadRoot;
 }
 
 FORCEINLINE
-PMADDRESS_SPACE
+PMM_AVL_TABLE
 MmGetKernelAddressSpace(VOID)
 {
-    return &MmKernelAddressSpace;
+    return MmKernelAddressSpace;
 }
 
 #endif
index 91c385e..91877a4 100644 (file)
@@ -15,6 +15,8 @@
 #define OBP_LOCK_STATE_RELEASED                     0xEEEE1234
 #define OBP_LOCK_STATE_INITIALIZED                  0xFFFF1234
 
+#define OBP_NAME_LOOKASIDE_MAX_SIZE 248
+
 ULONG
 FORCEINLINE
 ObpSelectObjectLockSlot(IN POBJECT_HEADER ObjectHeader)
index fdb4806..f4f7ea4 100644 (file)
@@ -682,23 +682,30 @@ IoBuildAsynchronousFsdRequest(IN ULONG MajorFunction,
                 return NULL;
             }
 
-            /* Probe and Lock */
-            _SEH_TRY
-            {
-                /* Do the probe */
-                MmProbeAndLockPages(Irp->MdlAddress,
-                                    KernelMode,
-                                    MajorFunction == IRP_MJ_READ ?
-                                    IoWriteAccess : IoReadAccess);
-            }
-            _SEH_HANDLE
-            {
-                /* Free the IRP and its MDL */
-                IoFreeMdl(Irp->MdlAddress);
-                IoFreeIrp(Irp);
-                Irp = NULL;
-            }
-            _SEH_END;
+                       if (KeGetCurrentIrql() >= DISPATCH_LEVEL)
+                       {
+                               MmBuildMdlForNonPagedPool(Irp->MdlAddress);
+                       }
+                       else
+                       {
+                               /* Probe and Lock */
+                               _SEH_TRY
+                               {
+                                       /* Do the probe */
+                                       MmProbeAndLockPages(Irp->MdlAddress,
+                                                                               KernelMode,
+                                                                               MajorFunction == IRP_MJ_READ ?
+                                                                               IoWriteAccess : IoReadAccess);
+                               }
+                               _SEH_HANDLE
+                               {
+                                       /* Free the IRP and its MDL */
+                                       IoFreeMdl(Irp->MdlAddress);
+                                       IoFreeIrp(Irp);
+                                       Irp = NULL;
+                               }
+                               _SEH_END;
+                       }
 
             /* This is how we know if we failed during the probe */
             if (!Irp) return NULL;
@@ -1344,7 +1351,7 @@ IofCompleteRequest(IN PIRP Irp,
     Mdl = Irp->MdlAddress;
     while (Mdl)
     {
-        MmUnlockPages(Mdl);
+               MmUnlockPages(Mdl);
         Mdl = Mdl->Next;
     }
 
diff --git a/reactos/ntoskrnl/kd/i386/kdmemsup.c b/reactos/ntoskrnl/kd/i386/kdmemsup.c
new file mode 100644 (file)
index 0000000..c3054ac
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS Kernel
+ * FILE:            ntoskrnl/kd/i386/kdmemsup.c
+ * PURPOSE:         Kernel Debugger Safe Memory Support
+ *
+ * PROGRAMMERS:     arty
+ */
+
+#include <ntoskrnl.h>
+#define NDEBUG
+#include <internal/debug.h>
+
+#define HIGH_PHYS_MASK 0x80000000
+#define PAGE_TABLE_MASK 0x3ff
+#define BIG_PAGE_SIZE (1<<22)
+#define CR4_PAGE_SIZE_BIT 0x10
+#define PDE_PRESENT_BIT 1
+#define PDE_W_BIT 2
+#define PDE_PS_BIT 0x80
+
+/* VARIABLES ***************************************************************/
+
+extern ULONG MmGlobalKernelPageDirectory[1024];
+static BOOLEAN KdpPhysAccess = FALSE;
+ULONG_PTR IdentityMapAddrHigh, IdentityMapAddrLow;
+extern PFN_TYPE NTAPI MmAllocEarlyPage();
+
+ULONGLONG
+FASTCALL
+KdpPhysRead(ULONG_PTR Addr, LONG Len)
+{
+    ULONGLONG Result = 0;
+    ULONG_PTR OldCR3 = __readcr3(), OldCR4 = __readcr4();
+
+    if (Addr & HIGH_PHYS_MASK)
+    {
+        Addr &= ~HIGH_PHYS_MASK;
+        __writecr3(IdentityMapAddrHigh);
+    }
+    else
+        __writecr3(IdentityMapAddrLow);
+
+    __writecr4(OldCR4|CR4_PAGE_SIZE_BIT); // Turn on large page translation
+    __invlpg((PVOID)Addr);
+
+    switch (Len)
+    {
+    case 8:
+        Result = *((PULONGLONG)Addr);
+        break;
+    case 4:
+        Result = *((PULONG)Addr);
+        break;
+    case 2:
+        Result = *((PUSHORT)Addr);
+        break;
+    case 1:
+        Result = *((PUCHAR)Addr);
+        break;
+    }
+    __writecr4(OldCR4); // Turn off large page translation
+    __writecr3(OldCR3);
+    __invlpg((PVOID)Addr);
+
+    return Result;
+}
+
+
+VOID
+NTAPI
+KdpPhysWrite(ULONG_PTR Addr, LONG Len, ULONGLONG Value)
+{
+    ULONG_PTR OldCR3 = __readcr3(), OldCR4 = __readcr4();
+
+    if (Addr & HIGH_PHYS_MASK)
+    {
+        Addr &= ~HIGH_PHYS_MASK;
+        __writecr3(IdentityMapAddrHigh);
+    }
+    else
+        __writecr3(IdentityMapAddrLow);
+
+    __writecr4(OldCR4|CR4_PAGE_SIZE_BIT); // Turn on large page translation
+    __invlpg((PVOID)Addr);
+
+    switch (Len)
+    {
+    case 8:
+        *((PULONGLONG)Addr) = Value;
+        break;
+    case 4:
+        *((PULONG)Addr) = Value;
+        break;
+    case 2:
+        *((PUSHORT)Addr) = Value;
+        break;
+    case 1:
+        *((PUCHAR)Addr) = Value;
+        break;
+    }
+    __writecr4(OldCR4); // Turn off large page translation
+    __writecr3(OldCR3);    
+    __invlpg((PVOID)Addr);
+}
+
+BOOLEAN
+NTAPI
+KdpTranslateAddress(ULONG_PTR Addr, PULONG_PTR ResultAddr)
+{
+    ULONG_PTR CR3Value = __readcr3();
+    ULONG_PTR CR4Value = __readcr4();
+    ULONG_PTR PageDirectory = (CR3Value & ~(PAGE_SIZE-1)) + 
+        ((Addr >> 22) * sizeof(ULONG));
+    ULONG_PTR PageDirectoryEntry = KdpPhysRead(PageDirectory, sizeof(ULONG));
+
+    /* Not present -> fail */
+    if (!(PageDirectoryEntry & PDE_PRESENT_BIT))
+    {
+        return FALSE;
+    }
+
+    /* Big Page? */
+    if ((PageDirectoryEntry & PDE_PS_BIT) && (CR4Value & CR4_PAGE_SIZE_BIT))
+    {
+        *ResultAddr = (PageDirectoryEntry & ~(BIG_PAGE_SIZE-1)) +
+            (Addr & (BIG_PAGE_SIZE-1));
+        return TRUE;
+    }
+    else
+    {
+        ULONG_PTR PageTableAddr = 
+            (PageDirectoryEntry & ~(PAGE_SIZE-1)) +
+            ((Addr >> PAGE_SHIFT) & PAGE_TABLE_MASK) * sizeof(ULONG);
+        ULONG_PTR PageTableEntry = KdpPhysRead(PageTableAddr, sizeof(ULONG));
+        if (PageTableEntry & PDE_PRESENT_BIT)
+        {
+            *ResultAddr = (PageTableEntry & ~(PAGE_SIZE-1)) +
+                (Addr & (PAGE_SIZE-1));
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
+
+BOOLEAN
+NTAPI
+KdpSafeReadMemory(ULONG_PTR Addr, LONG Len, PVOID Value)
+{
+    ULONG_PTR ResultPhysAddr;
+
+    if (!KdpPhysAccess)
+    {
+        memcpy(Value, (PVOID)Addr, Len);
+        return TRUE;
+    }
+
+    memset(Value, 0, Len);
+            
+    if (!KdpTranslateAddress(Addr, &ResultPhysAddr))
+        return FALSE;
+
+    switch (Len)
+    {
+    case 8:
+        *((PULONGLONG)Value) = KdpPhysRead(ResultPhysAddr, Len);
+        break;
+    case 4:
+        *((PULONG)Value) = KdpPhysRead(ResultPhysAddr, Len);
+        break;
+    case 2:
+        *((PUSHORT)Value) = KdpPhysRead(ResultPhysAddr, Len);
+        break;
+    case 1:
+        *((PUCHAR)Value) = KdpPhysRead(ResultPhysAddr, Len);
+        break;
+    }
+
+    return TRUE;
+}
+
+BOOLEAN
+NTAPI
+KdpSafeWriteMemory(ULONG_PTR Addr, LONG Len, ULONGLONG Value)
+{
+    ULONG_PTR ResultPhysAddr;
+
+    if (!KdpPhysAccess)
+    {
+        memcpy((PVOID)Addr, &Value, Len);
+        return TRUE;
+    }
+            
+    if (!KdpTranslateAddress(Addr, &ResultPhysAddr))
+        return FALSE;
+
+    KdpPhysWrite(ResultPhysAddr, Len, Value);
+    return TRUE;
+}
+
+VOID
+NTAPI
+KdpEnableSafeMem()
+{
+    int i;
+    PULONG IdentityMapVirt;
+    PHYSICAL_ADDRESS IdentityMapPhys, Highest = { };
+
+    if (KdpPhysAccess)
+        return;
+
+    Highest.LowPart = (ULONG)-1;
+    /* Allocate a physical page and map it to copy the phys copy code onto */
+    IdentityMapVirt = (PULONG)MmAllocateContiguousMemory(2 * PAGE_SIZE, Highest);
+    IdentityMapPhys = MmGetPhysicalAddress(IdentityMapVirt);
+    IdentityMapAddrHigh = IdentityMapPhys.LowPart;
+
+    /* Copy the kernel space */
+    memcpy(IdentityMapVirt,
+           MmGlobalKernelPageDirectory,
+           PAGE_SIZE);
+
+    /* Set up 512 4Mb pages (high 2Gig identity mapped) */
+    for (i = 0; i < 512; i++)
+    {
+        IdentityMapVirt[i] = 
+            HIGH_PHYS_MASK | (i << 22) | PDE_PS_BIT | PDE_W_BIT | PDE_PRESENT_BIT;
+    }
+
+    /* Allocate a physical page and map it to copy the phys copy code onto */
+    IdentityMapAddrLow = IdentityMapAddrHigh + PAGE_SIZE;
+    IdentityMapVirt += PAGE_SIZE / sizeof(ULONG);
+
+    /* Copy the kernel space */
+    memcpy(IdentityMapVirt,
+           MmGlobalKernelPageDirectory,
+           PAGE_SIZE);
+
+    /* Set up 512 4Mb pages (low 2Gig identity mapped) */
+    for (i = 0; i < 512; i++)
+    {
+        IdentityMapVirt[i] = (i << 22) | PDE_PS_BIT | PDE_W_BIT | PDE_PRESENT_BIT;
+    }
+
+    KdpPhysAccess = TRUE;
+}
index 927a89b..dfbb09f 100644 (file)
@@ -257,6 +257,8 @@ KdInitSystem(ULONG BootPhase,
         if (WrapperInitRoutine) WrapperInitRoutine(&WrapperTable, 0);
         return TRUE;
     }
+    else
+       KdpEnableSafeMem();
 
     /* Call the Initialization Routines of the Registered Providers */
     KdpCallInitRoutine(BootPhase);
index 1e23ef9..aedf32d 100644 (file)
@@ -322,19 +322,9 @@ static volatile void *GspAccessLocation = NULL;
 static CHAR
 GspReadMemSafe(PCHAR Address)
 {
-  CHAR ch;
-
-  if (NULL == Address)
-    {
-      GspMemoryError = TRUE;
-      return '\0';
-    }
-
-  GspAccessLocation = Address;
-  ch = *Address;
-  GspAccessLocation = NULL;
-
-  return ch;
+    CHAR ch;
+    KdpSafeReadMemory((ULONG_PTR)Address, 1, &ch);
+    return ch;
 }
 
 /* Convert the memory pointed to by Address into hex, placing result in Buffer */
@@ -455,19 +445,11 @@ GspHex2Mem(PCHAR Buffer,
   return Buffer + 2 * Count;
 }
 
-static CHAR
-GspWriteMemSafeGetContent(PVOID Context, ULONG Offset)
-{
-  ASSERT(0 == Offset);
-
-  return *((PCHAR) Context);
-}
-
 static void
 GspWriteMemSafe(PCHAR Address,
   CHAR Ch)
 {
-  GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch);
+    KdpSafeWriteMemory((ULONG_PTR)Address, 1, Ch);
 }
 
 
index 0edf8a5..a07882a 100644 (file)
@@ -1658,21 +1658,31 @@ KdbpSafeReadMemory(OUT PVOID Dest,
                    IN PVOID Src,
                    IN ULONG Bytes)
 {
-   NTSTATUS Status = STATUS_SUCCESS;
+    BOOLEAN Result = TRUE;
 
-   _SEH_TRY
-   {
-      RtlCopyMemory(Dest,
-                    Src,
-                    Bytes);
-   }
-   _SEH_HANDLE
-   {
-      Status = _SEH_GetExceptionCode();
-   }
-   _SEH_END;
+    switch (Bytes)
+    {
+    case 1:
+    case 2:
+    case 4:
+    case 8:
+        Result = KdpSafeReadMemory((ULONG_PTR)Src, Bytes, Dest);
+        break;
+    default:
+    {
+        ULONG_PTR Start, End, Write;
+        for (Start = (ULONG_PTR)Src, 
+                 End = Start + Bytes, 
+                 Write = (ULONG_PTR)Dest; 
+             Result && (Start < End); 
+             Start++, Write++)
+            if (!KdpSafeReadMemory(Start, 1, (PVOID)Write))
+                Result = FALSE;
+        break;
+    }
+    }
 
-   return Status;
+    return Result ? STATUS_SUCCESS : STATUS_ACCESS_VIOLATION;
 }
 
 NTSTATUS
@@ -1680,19 +1690,16 @@ KdbpSafeWriteMemory(OUT PVOID Dest,
                     IN PVOID Src,
                     IN ULONG Bytes)
 {
-   NTSTATUS Status = STATUS_SUCCESS;
-
-   _SEH_TRY
-   {
-      RtlCopyMemory(Dest,
-                    Src,
-                    Bytes);
-   }
-   _SEH_HANDLE
-   {
-      Status = _SEH_GetExceptionCode();
-   }
-   _SEH_END;
-
-   return Status;
+    BOOLEAN Result;
+    ULONG_PTR Start, End, Write;
+
+    for (Start = (ULONG_PTR)Src, 
+             End = Start + Bytes, 
+             Write = (ULONG_PTR)Dest; 
+         Result && (Start < End); 
+         Start++, Write++)
+        if (!KdpSafeReadMemory(Start, 1, (PVOID)Write))
+            Result = FALSE;
+
+    return Result ? STATUS_SUCCESS : STATUS_ACCESS_VIOLATION;
 }
index 368e8c6..87826d3 100644 (file)
@@ -451,6 +451,7 @@ KeAttachProcess(IN PKPROCESS Process)
                              (PVOID)Thread->StackLimit,
                              Thread->LargeStack ?
                              KERNEL_STACK_SIZE : KERNEL_LARGE_STACK_SIZE);
+    MiSyncThreadProcessViews(Process, Thread, sizeof(ETHREAD));
 
     /* Check if we're already in that process */
     if (Thread->ApcState.Process == Process) return;
@@ -580,6 +581,7 @@ KeStackAttachProcess(IN PKPROCESS Process,
                              (PVOID)Thread->StackLimit,
                              Thread->LargeStack ?
                              KERNEL_STACK_SIZE : KERNEL_LARGE_STACK_SIZE);
+    MiSyncThreadProcessViews(Process, Thread, sizeof(ETHREAD));
 
     /* Crash system if DPC is being executed! */
     if (KeIsExecutingDpc())
index e7c5de1..dd1943c 100644 (file)
@@ -47,7 +47,7 @@
 
 NTSTATUS
 NTAPI
-MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
+MmWritePageVirtualMemory(PMM_AVL_TABLE AddressSpace,
                          PMEMORY_AREA MemoryArea,
                          PVOID Address,
                          PMM_PAGEOP PageOp)
@@ -55,6 +55,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
    SWAPENTRY SwapEntry;
    PFN_TYPE Page;
    NTSTATUS Status;
+   PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
 
    /*
     * Check for paging out from a deleted virtual memory area.
@@ -67,12 +68,12 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
       return(STATUS_UNSUCCESSFUL);
    }
 
-   Page = MmGetPfnForProcess(AddressSpace->Process, Address);
+   Page = MmGetPfnForProcess(Process, Address);
 
    /*
     * Get that the page actually is dirty.
     */
-   if (!MmIsDirtyPage(AddressSpace->Process, Address))
+   if (!MmIsDirtyPage(Process, Address))
    {
       PageOp->Status = STATUS_SUCCESS;
       KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
@@ -83,7 +84,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
    /*
     * Speculatively set the mapping to clean.
     */
-   MmSetCleanPage(AddressSpace->Process, Address);
+   MmSetCleanPage(Process, Address);
 
    /*
     * If necessary, allocate an entry in the paging file for this page
@@ -94,7 +95,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
       SwapEntry = MmAllocSwapPage();
       if (SwapEntry == 0)
       {
-         MmSetDirtyPage(AddressSpace->Process, Address);
+         MmSetDirtyPage(Process, Address);
          PageOp->Status = STATUS_PAGEFILE_QUOTA_EXCEEDED;
          KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
          MmReleasePageOp(PageOp);
@@ -110,7 +111,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
    {
       DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
               Status);
-      MmSetDirtyPage(AddressSpace->Process, Address);
+      MmSetDirtyPage(Process, Address);
       PageOp->Status = STATUS_UNSUCCESSFUL;
       KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
       MmReleasePageOp(PageOp);
@@ -129,7 +130,7 @@ MmWritePageVirtualMemory(PMADDRESS_SPACE AddressSpace,
 
 NTSTATUS
 NTAPI
-MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
+MmPageOutVirtualMemory(PMM_AVL_TABLE AddressSpace,
                        PMEMORY_AREA MemoryArea,
                        PVOID Address,
                        PMM_PAGEOP PageOp)
@@ -138,9 +139,10 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
    BOOLEAN WasDirty;
    SWAPENTRY SwapEntry;
    NTSTATUS Status;
-
+   PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+    
    DPRINT("MmPageOutVirtualMemory(Address 0x%.8X) PID %d\n",
-          Address, AddressSpace->Process->UniqueProcessId);
+          Address, Process->UniqueProcessId);
 
    /*
     * Check for paging out from a deleted virtual memory area.
@@ -156,7 +158,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
    /*
     * Disable the virtual mapping.
     */
-   MmDisableVirtualMapping(AddressSpace->Process, Address,
+   MmDisableVirtualMapping(Process, Address,
                            &WasDirty, &Page);
 
    if (Page == 0)
@@ -170,11 +172,11 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
    if (!WasDirty)
    {
       MmLockAddressSpace(AddressSpace);
-      MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
+      MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
       MmDeleteAllRmaps(Page, NULL, NULL);
       if ((SwapEntry = MmGetSavedSwapEntryPage(Page)) != 0)
       {
-         MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
+         MmCreatePageFileMapping(Process, Address, SwapEntry);
          MmSetSavedSwapEntryPage(Page, 0);
       }
       MmUnlockAddressSpace(AddressSpace);
@@ -195,7 +197,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
       if (SwapEntry == 0)
       {
          MmShowOutOfSpaceMessagePagingFile();
-         MmEnableVirtualMapping(AddressSpace->Process, Address);
+         MmEnableVirtualMapping(Process, Address);
          PageOp->Status = STATUS_UNSUCCESSFUL;
          KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
          MmReleasePageOp(PageOp);
@@ -211,7 +213,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
    {
       DPRINT1("MM: Failed to write to swap page (Status was 0x%.8X)\n",
               Status);
-      MmEnableVirtualMapping(AddressSpace->Process, Address);
+      MmEnableVirtualMapping(Process, Address);
       PageOp->Status = STATUS_UNSUCCESSFUL;
       KeSetEvent(&PageOp->CompletionEvent, IO_NO_INCREMENT, FALSE);
       MmReleasePageOp(PageOp);
@@ -223,8 +225,8 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
     */
    DPRINT("MM: Swapped out virtual memory page 0x%.8X!\n", Page << PAGE_SHIFT);
    MmLockAddressSpace(AddressSpace);
-   MmDeleteVirtualMapping(AddressSpace->Process, Address, FALSE, NULL, NULL);
-   MmCreatePageFileMapping(AddressSpace->Process, Address, SwapEntry);
+   MmDeleteVirtualMapping(Process, Address, FALSE, NULL, NULL);
+   MmCreatePageFileMapping(Process, Address, SwapEntry);
    MmUnlockAddressSpace(AddressSpace);
    MmDeleteAllRmaps(Page, NULL, NULL);
    MmSetSavedSwapEntryPage(Page, 0);
@@ -237,7 +239,7 @@ MmPageOutVirtualMemory(PMADDRESS_SPACE AddressSpace,
 
 NTSTATUS
 NTAPI
-MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
+MmNotPresentFaultVirtualMemory(PMM_AVL_TABLE AddressSpace,
                                MEMORY_AREA* MemoryArea,
                                PVOID Address,
                                BOOLEAN Locked)
@@ -255,7 +257,8 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
    NTSTATUS Status;
    PMM_REGION Region;
    PMM_PAGEOP PageOp;
-
+   PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+    
    /*
     * There is a window between taking the page fault and locking the
     * address space when another thread could load the page so we check
@@ -292,7 +295,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
    /*
     * Get or create a page operation
     */
-   PageOp = MmGetPageOp(MemoryArea, AddressSpace->Process->UniqueProcessId,
+   PageOp = MmGetPageOp(MemoryArea, Process->UniqueProcessId,
                         (PVOID)PAGE_ROUND_DOWN(Address), NULL, 0,
                         MM_PAGEOP_PAGEIN, FALSE);
    if (PageOp == NULL)
@@ -380,7 +383,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
    {
       SWAPENTRY SwapEntry;
 
-      MmDeletePageFileMapping(AddressSpace->Process, Address, &SwapEntry);
+      MmDeletePageFileMapping(Process, Address, &SwapEntry);
       Status = MmReadFromSwapPage(SwapEntry, Page);
       if (!NT_SUCCESS(Status))
       {
@@ -393,7 +396,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
     * Set the page. If we fail because we are out of memory then
     * try again
     */
-   Status = MmCreateVirtualMapping(AddressSpace->Process,
+   Status = MmCreateVirtualMapping(Process,
                                    (PVOID)PAGE_ROUND_DOWN(Address),
                                    Region->Protect,
                                    &Page,
@@ -401,7 +404,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
    while (Status == STATUS_NO_MEMORY)
    {
       MmUnlockAddressSpace(AddressSpace);
-      Status = MmCreateVirtualMapping(AddressSpace->Process,
+      Status = MmCreateVirtualMapping(Process,
                                       Address,
                                       Region->Protect,
                                       &Page,
@@ -418,7 +421,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
    /*
     * Add the page to the process's working set
     */
-   MmInsertRmap(Page, AddressSpace->Process, (PVOID)PAGE_ROUND_DOWN(Address));
+   MmInsertRmap(Page, Process, (PVOID)PAGE_ROUND_DOWN(Address));
 
    /*
     * Finish the operation
@@ -434,7 +437,7 @@ MmNotPresentFaultVirtualMemory(PMADDRESS_SPACE AddressSpace,
 }
 
 VOID static
-MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
+MmModifyAttributes(PMM_AVL_TABLE AddressSpace,
                    PVOID BaseAddress,
                    ULONG RegionSize,
                    ULONG OldType,
@@ -445,6 +448,8 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
  * FUNCTION: Modify the attributes of a memory region
  */
 {
+   PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
+    
    /*
     * If we are switching a previously committed region to reserved then
     * free any allocated pages within the region
@@ -457,19 +462,19 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
       {
          PFN_TYPE Page;
 
-         if (MmIsPageSwapEntry(AddressSpace->Process,
+         if (MmIsPageSwapEntry(Process,
                                (char*)BaseAddress + (i * PAGE_SIZE)))
          {
             SWAPENTRY SwapEntry;
 
-            MmDeletePageFileMapping(AddressSpace->Process,
+            MmDeletePageFileMapping(Process,
                                     (char*)BaseAddress + (i * PAGE_SIZE),
                                     &SwapEntry);
             MmFreeSwapPage(SwapEntry);
          }
          else
          {
-            MmDeleteVirtualMapping(AddressSpace->Process,
+            MmDeleteVirtualMapping(Process,
                                    (char*)BaseAddress + (i*PAGE_SIZE),
                                    FALSE, NULL, &Page);
             if (Page != 0)
@@ -481,7 +486,7 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
                   MmFreeSwapPage(SavedSwapEntry);
                   MmSetSavedSwapEntryPage(Page, 0);
                }
-               MmDeleteRmap(Page, AddressSpace->Process,
+               MmDeleteRmap(Page, Process,
                             (char*)BaseAddress + (i * PAGE_SIZE));
                MmReleasePageMemoryConsumer(MC_USER, Page);
             }
@@ -500,10 +505,10 @@ MmModifyAttributes(PMADDRESS_SPACE AddressSpace,
 
       for (i=0; i < PAGE_ROUND_UP(RegionSize)/PAGE_SIZE; i++)
       {
-         if (MmIsPagePresent(AddressSpace->Process,
+         if (MmIsPagePresent(Process,
                              (char*)BaseAddress + (i*PAGE_SIZE)))
          {
-            MmSetPageProtect(AddressSpace->Process,
+            MmSetPageProtect(Process,
                              (char*)BaseAddress + (i*PAGE_SIZE),
                              NewProtect);
          }
@@ -548,7 +553,7 @@ NtAllocateVirtualMemory(IN     HANDLE ProcessHandle,
    ULONG_PTR MemoryAreaLength;
    ULONG Type;
    NTSTATUS Status;
-   PMADDRESS_SPACE AddressSpace;
+   PMM_AVL_TABLE AddressSpace;
    PVOID BaseAddress;
    ULONG RegionSize;
    PVOID PBaseAddress;
@@ -699,7 +704,7 @@ NtAllocateVirtualMemory(IN     HANDLE ProcessHandle,
    Type = (AllocationType & MEM_COMMIT) ? MEM_COMMIT : MEM_RESERVE;
    DPRINT("Type %x\n", Type);
 
-   AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
+   AddressSpace = &Process->VadRoot;
    MmLockAddressSpace(AddressSpace);
 
    if (PBaseAddress != 0)
@@ -856,7 +861,7 @@ MmFreeVirtualMemory(PEPROCESS Process,
          if (PageOp != NULL)
          {
             NTSTATUS Status;
-            MmUnlockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+            MmUnlockAddressSpace(&Process->VadRoot);
             Status = KeWaitForSingleObject(&PageOp->CompletionEvent,
                                            0,
                                            KernelMode,
@@ -867,7 +872,7 @@ MmFreeVirtualMemory(PEPROCESS Process,
                DPRINT1("Failed to wait for page op\n");
                KEBUGCHECK(0);
             }
-            MmLockAddressSpace((PMADDRESS_SPACE)&Process->VadRoot);
+            MmLockAddressSpace(&Process->VadRoot);
             MmReleasePageOp(PageOp);
          }
       }
@@ -883,7 +888,7 @@ MmFreeVirtualMemory(PEPROCESS Process,
    }
 
    /* Actually free the memory area. */
-   MmFreeMemoryArea((PMADDRESS_SPACE)&Process->VadRoot,
+   MmFreeMemoryArea(&Process->VadRoot,
                     MemoryArea,
                     MmFreeVirtualMemoryPage,
                     (PVOID)Process);
@@ -913,7 +918,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
    MEMORY_AREA* MemoryArea;
    NTSTATUS Status;
    PEPROCESS Process;
-   PMADDRESS_SPACE AddressSpace;
+   PMM_AVL_TABLE AddressSpace;
    PVOID BaseAddress;
    ULONG RegionSize;
 
@@ -936,7 +941,7 @@ NtFreeVirtualMemory(IN HANDLE ProcessHandle,
       return(Status);
    }
 
-   AddressSpace = (PMADDRESS_SPACE)&Process->VadRoot;
+   AddressSpace = &Process->VadRoot;
 
    MmLockAddressSpace(AddressSpace);
    MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
@@ -986,7 +991,7 @@ unlock_deref_and_return:
 
 NTSTATUS
 NTAPI
-MmProtectAnonMem(PMADDRESS_SPACE AddressSpace,
+MmProtectAnonMem(PMM_AVL_TABLE AddressSpace,
                  PMEMORY_AREA MemoryArea,
                  PVOID BaseAddress,
                  ULONG Length,
index 7ba7cbd..b8a1a8a 100644 (file)
 
 /* GLOBALS ********************************************************************/
 
-#undef UNIMPLEMENTED
-#define UNIMPLEMENTED \
-{ \
-    DPRINT1("[ARM Mm Bringup]: %s is unimplemented!\n", __FUNCTION__); \
-    while (TRUE); \
-}
-
-//
-// Take 0x80812345 and extract:
-// PTE_BASE[0x808][0x12]
-//
-#define MiGetPteAddress(x)         \
-    (PMMPTE)(PTE_BASE + (((ULONG)(x) >> 20) << 12) + ((((ULONG)(x) >> 12) & 0xFF) << 2))
-
-#define MiGetPdeAddress(x)         \
-    (PMMPTE)(PDE_BASE + (((ULONG)(x) >> 20) << 2))
-
-#define MiGetPdeOffset(x) (((ULONG)(x)) >> 22)
-
-#define PTE_BASE    0xC0000000
-#define PDE_BASE    0xC1000000
-#define HYPER_SPACE ((PVOID)0xC1100000)
-
 ULONG MmGlobalKernelPageDirectory[1024];
 MMPTE MiArmTemplatePte, MiArmTemplatePde;
 
-VOID
-KiFlushSingleTb(IN BOOLEAN Invalid,
-                IN PVOID Virtual);
-
-/* FUNCTIONS ******************************************************************/
+/* PRIVATE FUNCTIONS **********************************************************/
 
-VOID
+BOOLEAN
 NTAPI
-MmUpdatePageDir(IN PEPROCESS Process,
-                IN PVOID Address,
-                IN ULONG Size)
+MiUnmapPageTable(IN PMMPTE PointerPde)
 {
     //
-    // Nothing to do
+    // Check if this address belongs to the kernel
     //
-    return;
+    if (((ULONG_PTR)PointerPde > PDE_BASE) ||
+        ((ULONG_PTR)PointerPde < (PDE_BASE + 1024*1024)))
+    {
+        //
+        // Nothing to do
+        //
+        return TRUE;
+    }
+    
+    //
+    // FIXME-USER: Shouldn't get here yet
+    //
+    ASSERT(FALSE);
+    return FALSE;
 }
 
-NTSTATUS
+VOID
 NTAPI
-Mmi386ReleaseMmInfo(IN PEPROCESS Process)
+MiFlushTlb(IN PMMPTE PointerPte,
+           IN PVOID Address)
 {
     //
-    // TODO
+    // Make sure the PTE is valid, and unmap the pagetable if user-mode
     //
-    UNIMPLEMENTED;
-    return 0;
+    if (((PointerPte) && (MiUnmapPageTable(PointerPte))) ||
+        (Address >= MmSystemRangeStart))
+    {
+        //
+        // Invalidate this page
+        //
+        KeArmInvalidateTlbEntry(Address);
+    }
 }
 
-NTSTATUS
+PMMPTE
 NTAPI
-MmInitializeHandBuiltProcess(IN PEPROCESS Process,
-                             IN PLARGE_INTEGER DirectoryTableBase)
+MiGetPageTableForProcess(IN PEPROCESS Process,
+                         IN PVOID Address,
+                         IN BOOLEAN Create)
 {
+    ULONG PdeOffset;
+    PMMPTE PointerPde;
+    MMPTE Pte;
+    NTSTATUS Status;
+    PFN_NUMBER Pfn;
+    
     //
-    // Share the directory base with the idle process
+    // Check if this is a user-mode, non-kernel or non-current address
     //
-    *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase;
+    if ((Address < MmSystemRangeStart) &&
+        (Process) &&
+        (Process != PsGetCurrentProcess()))
+    {
+        //
+        // FIXME-USER: No user-mode memory support
+        //
+        ASSERT(FALSE);
+    }
     
     //
-    // Initialize the Addresss Space
+    // Get the PDE
     //
-    MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot);
+    PointerPde = MiGetPdeAddress(Address);
+    if (PointerPde->u.Hard.L1.Fault.Type == FaultPte)
+    {
+        //
+        // Invalid PDE, is this a kernel address?
+        //
+        if (Address >= MmSystemRangeStart)
+        {            
+            //
+            // Does it exist in the kernel page directory?
+            //
+            PdeOffset = MiGetPdeOffset(Address);
+            if (MmGlobalKernelPageDirectory[PdeOffset] == 0)
+            {
+                //
+                // It doesn't. Is this a create operation? If not, fail
+                //
+                if (Create == FALSE) return NULL;
+                
+                //
+                // THIS WHOLE PATH IS TODO
+                //
+                ASSERT(FALSE);
+                
+                //
+                // Allocate a non paged pool page for the PDE
+                //
+                Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
+                if (!NT_SUCCESS(Status)) return NULL;
+                
+                //
+                // Make the entry valid
+                //
+                Pte.u.Hard.AsUlong = 0xDEADBEEF;
+                
+                //
+                // Save it
+                //
+                MmGlobalKernelPageDirectory[PdeOffset] = Pte.u.Hard.AsUlong;
+            }
+            
+            //
+            // Now set the actual PDE
+            //
+            PointerPde = (PMMPTE)&MmGlobalKernelPageDirectory[PdeOffset];
+        }
+        else
+        {
+            //
+            // Is this a create operation? If not, fail
+            //
+            if (Create == FALSE) return NULL;
+            
+            //
+            // THIS WHOLE PATH IS TODO
+            //
+            ASSERT(FALSE);
+         
+            //
+            // Allocate a non paged pool page for the PDE
+            //
+            Status = MmRequestPageMemoryConsumer(MC_NPPOOL, FALSE, &Pfn);
+            if (!NT_SUCCESS(Status)) return NULL;
+            
+            //
+            // Make the entry valid
+            //
+            Pte.u.Hard.AsUlong = 0xDEADBEEF;
+            
+            //
+            // Set it
+            //
+            *PointerPde = Pte;
+        }
+    }
     
     //
-    // The process now has an address space
+    // Return the PTE
     //
-    Process->HasAddressSpace = TRUE;
-    return STATUS_SUCCESS;
+    return MiGetPteAddress(Address);
 }
 
-PULONG
-MmGetPageDirectory(VOID)
+MMPTE
+NTAPI
+MiGetPageEntryForProcess(IN PEPROCESS Process,
+                         IN PVOID Address)
 {
+    PMMPTE PointerPte;
+    MMPTE Pte;
+    Pte.u.Hard.AsUlong = 0;
+    
     //
-    // Return the TTB
+    // Get the PTE
     //
-    return (PULONG)KeArmTranslationTableRegisterGet().AsUlong;
-}
-
+    PointerPte = MiGetPageTableForProcess(Process, Address, FALSE);
+    if (PointerPte)
+    {
+        //
+        // Capture the PTE value and unmap the page table
+        //
+        Pte = *PointerPte;
+        MiUnmapPageTable(PointerPte);
+    }
 
-BOOLEAN
-NTAPI
-MmCreateProcessAddressSpace(IN ULONG MinWs,
-                            IN PEPROCESS Process,
-                            IN PLARGE_INTEGER DirectoryTableBase)
-{
     //
-    // TODO
+    // Return the PTE value
     //
-    UNIMPLEMENTED;
-    return 0;
+    return Pte;
 }
 
 VOID
@@ -133,17 +217,16 @@ MmDeletePageTable(IN PEPROCESS Process,
     if ((Process) && (Process != PsGetCurrentProcess()))
     {
         //
-        // TODO
+        // FIXME-USER: Need to attach to the process
         //
-        UNIMPLEMENTED;
-        return;
+        ASSERT(FALSE);
     }
-       
+    
     //
     // Get the PDE
     //
     PointerPde = MiGetPdeAddress(Address);
-
+    
     //
     // On ARM, we use a section mapping for the original low-memory mapping
     //
@@ -164,233 +247,92 @@ MmDeletePageTable(IN PEPROCESS Process,
     //
     // Invalidate the TLB entry
     //
-    KiFlushSingleTb(TRUE, Address);
+    MiFlushTlb(PointerPde, MiAddressToPte(Address));
 }
 
-PFN_TYPE
+BOOLEAN
 NTAPI
-MmGetPfnForProcess(IN PEPROCESS Process,
-                   IN PVOID Address)
+MmCreateProcessAddressSpace(IN ULONG MinWs,
+                            IN PEPROCESS Process,
+                            IN PLARGE_INTEGER DirectoryTableBase)
 {
-    PMMPTE Pte;
-    
-    //
-    // Check if this is for a different process
-    //
-    if ((Process) && (Process != PsGetCurrentProcess()))
-    {
-        //
-        // TODO
-        //
-        UNIMPLEMENTED;
-        return 0;
-    }
-    
-    //
-    // Get the PDE
     //
-    Pte = MiGetPdeAddress(Address);
-    if (Pte->u.Hard.L1.Fault.Type != FaultPte)
-    {
-        //
-        // Get the PTE
-        //
-        Pte = MiGetPteAddress(Address);
-    }
-    
-    //
-    // If PTE is invalid, return 0
-    //
-    if (Pte->u.Hard.L2.Fault.Type == FaultPte) return 0;
-    
-    //
-    // Return PFN
+    // FIXME-USER: Need to create address space
     //
-    return Pte->u.Hard.L2.Small.BaseAddress;
+    UNIMPLEMENTED;
+    while (TRUE);
+    return 0;
 }
 
 VOID
 NTAPI
-MmDisableVirtualMapping(IN PEPROCESS Process,
-                        IN PVOID Address,
-                        OUT PBOOLEAN WasDirty,
-                        OUT PPFN_TYPE Page)
+MmUpdatePageDir(IN PEPROCESS Process,
+                IN PVOID Address,
+                IN ULONG Size)
 {
     //
-    // TODO
+    // Nothing to do
     //
-    UNIMPLEMENTED;
+    return;
 }
 
-VOID
+NTSTATUS
 NTAPI
-MmRawDeleteVirtualMapping(IN PVOID Address)
+Mmi386ReleaseMmInfo(IN PEPROCESS Process)
 {
-    PMMPTE PointerPte, PointerPde;
-    
     //
-    // Get the PDE
+    // FIXME-USER: Need to delete address space
     //
-    PointerPde = MiGetPdeAddress(Address);
-    if (PointerPde->u.Hard.L1.Fault.Type == FaultPte) return;
-
-    //
-    // Get the PTE
-    //
-    PointerPte = MiGetPteAddress(Address);
-    ASSERT(PointerPte->u.Hard.L2.Small.Type == SmallPte);
-    
-    //
-    // Destroy the PTE
-    //
-    PointerPte->u.Hard.AsUlong = 0;
-    ASSERT(PointerPte->u.Hard.L2.Fault.Type == FaultPte);
-    
-    //
-    // Flush the TLB
-    //
-    KiFlushSingleTb(TRUE, Address);
+    UNIMPLEMENTED;
+    while (TRUE);
+    return 0;
 }
 
-VOID
+NTSTATUS
 NTAPI
-MmDeleteVirtualMapping(IN PEPROCESS Process,
-                       IN PVOID Address,
-                       IN BOOLEAN FreePage,
-                       OUT PBOOLEAN WasDirty,
-                       OUT PPFN_TYPE Page)
+MmInitializeHandBuiltProcess(IN PEPROCESS Process,
+                             IN PLARGE_INTEGER DirectoryTableBase)
 {
-    PMMPTE PointerPte, PointerPde;
-    MMPTE Pte;
-    
-    //
-    // Check if this is for a different process
-    //
-    if ((Process) && (Process != PsGetCurrentProcess()))
-    {
-        //
-        // TODO
-        //
-        UNIMPLEMENTED;
-        return;
-    }
-    
     //
-    // Get the PDE
-    //
-    PointerPde = MiGetPdeAddress(Address);
-    if (PointerPde->u.Hard.L1.Fault.Type == FaultPte)
-    {
-        //
-        // Invalid PDE
-        //
-        if (WasDirty) *WasDirty = FALSE;
-        if (Page) *Page = 0;
-        return;
-    }
-    
-    //
-    // Get the PTE
-    //
-    PointerPte = MiGetPteAddress(Address);
-    ASSERT(PointerPte->u.Hard.L2.Small.Type == SmallPte);
-    
-    //
-    // Save the PTE
-    //
-    Pte = *PointerPte;
-    
-    //
-    // Destroy the PTE
-    //
-    PointerPte->u.Hard.AsUlong = 0;
-    ASSERT(PointerPte->u.Hard.L2.Fault.Type == FaultPte);
-
-    //
-    // Flush the TLB
-    //
-    KiFlushSingleTb(TRUE, Address);
-    
-    //
-    // Check if the PTE was valid
+    // Share the directory base with the idle process
     //
-    if (Pte.u.Hard.L2.Fault.Type != FaultPte)
-    {
-        //
-        // Mark the page as unmapped
-        //
-        MmMarkPageUnmapped(Pte.u.Hard.L2.Small.BaseAddress);
-    }
-    else
-    {
-        //
-        // Make it sane
-        //
-        Pte.u.Hard.L2.Small.BaseAddress = 0;
-    }
+    *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase;
     
     //
-    // Check if this was our page, and valid
+    // Initialize the Addresss Space
     //
-    if ((FreePage) && (Pte.u.Hard.L2.Fault.Type != FaultPte))
-    {
-        //
-        // Release it
-        //
-        MmReleasePageMemoryConsumer(MC_NPPOOL, Pte.u.Hard.L2.Small.BaseAddress);
-    }
+    KeInitializeGuardedMutex(&Process->AddressCreationLock);
+    Process->VadRoot.BalancedRoot.u1.Parent = NULL;
     
     //
-    // Return if the page was dirty
-    //
-    if (WasDirty) *WasDirty = TRUE; // LIE!!!
-    if (Page) *Page = Pte.u.Hard.L2.Small.BaseAddress;
-}
-
-VOID
-NTAPI
-MmDeletePageFileMapping(IN PEPROCESS Process,
-                        IN PVOID Address,
-                        IN SWAPENTRY *SwapEntry)
-{
-    //
-    // TODO
-    //
-    UNIMPLEMENTED;
-}
-
-BOOLEAN
-NTAPI
-MmIsDirtyPage(IN PEPROCESS Process,
-              IN PVOID Address)
-{
-    //
- &nbs