Sync with trunk r58113.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 4 Jan 2013 13:36:15 +0000 (13:36 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Fri, 4 Jan 2013 13:36:15 +0000 (13:36 +0000)
svn path=/branches/ros-csrss/; revision=58114

139 files changed:
base/applications/rapps/rapps/mpc.txt
base/applications/regedit/childwnd.c
base/applications/regedit/edit.c
base/applications/regedit/error.c
base/applications/regedit/find.c
base/applications/regedit/framewnd.c
base/applications/regedit/listview.c
base/applications/regedit/regproc.c
base/applications/regedit/settings.c
base/applications/regedit/treeview.c
base/applications/taskmgr/lang/fr-FR.rc
boot/freeldr/freeldr/arch/i386/i386bug.c
boot/freeldr/freeldr/debug.c
boot/freeldr/freeldr/include/arch/pc/x86common.h
boot/freeldr/freeldr/include/debug.h
boot/freeldr/freeldr/include/mm.h
boot/freeldr/freeldr/mm/meminit.c
dll/cpl/usrmgr/users.c
dll/win32/kernel32/client/path.c
dll/win32/kernel32/client/proc.c
dll/win32/kernel32/client/thread.c
dll/win32/netapi32/user.c
dll/win32/samlib/samlib.c
dll/win32/samsrv/samrpc.c
dll/win32/shell32/lang/bg-BG.rc
dll/win32/shell32/lang/ca-ES.rc
dll/win32/shell32/lang/cs-CZ.rc
dll/win32/shell32/lang/el-GR.rc
dll/win32/shell32/lang/fi-FI.rc
dll/win32/shell32/lang/fr-FR.rc
dll/win32/shell32/lang/hu-HU.rc
dll/win32/shell32/lang/it-IT.rc
dll/win32/shell32/lang/ja-JP.rc
dll/win32/shell32/lang/ko-KR.rc
dll/win32/shell32/lang/nl-NL.rc
dll/win32/shell32/lang/pl-PL.rc
dll/win32/shell32/lang/pt-BR.rc
dll/win32/shell32/lang/pt-PT.rc
dll/win32/shell32/lang/ru-RU.rc
dll/win32/shell32/lang/sl-SI.rc
dll/win32/shell32/lang/sv-SE.rc
dll/win32/shell32/lang/zh-CN.rc
dll/win32/shell32/lang/zh-TW.rc
dll/win32/shell32/shell32.spec
dll/win32/syssetup/wizard.c
drivers/bus/pcix/device.c
drivers/bus/pcix/enum.c
drivers/bus/pcix/fdo.c
drivers/bus/pcix/init.c
drivers/bus/pcix/intrface/agpintrf.c
drivers/bus/pcix/intrface/busintrf.c
drivers/bus/pcix/intrface/cardbus.c
drivers/bus/pcix/intrface/devhere.c
drivers/bus/pcix/intrface/lddintrf.c
drivers/bus/pcix/intrface/locintrf.c
drivers/bus/pcix/intrface/pmeintf.c
drivers/bus/pcix/intrface/routintf.c
drivers/bus/pcix/pci/config.c
drivers/bus/pcix/pci/ppbridge.c
drivers/bus/pcix/pcivrify.c
drivers/bus/pcix/pdo.c
drivers/bus/pcix/power.c
drivers/bus/pcix/utils.c
drivers/ksfilter/ks/device.c
drivers/ksfilter/ks/irp.c
drivers/ksfilter/ks/ksfunc.h
drivers/storage/class/ramdisk/ramdisk.c
drivers/usb/usbhub/fdo.c
hal/halx86/acpi/halpnpdd.c
hal/halx86/generic/bios.c
hal/halx86/generic/misc.c
hal/halx86/generic/spinlock.c
hal/halx86/legacy/bus/cmosbus.c
hal/halx86/legacy/bus/pcibus.c
hal/halx86/legacy/halpnpdd.c
include/ddk/ntsam.h
include/reactos/idl/sam.idl
include/reactos/ks386.inc [deleted file]
include/reactos/ksamd64.inc [deleted file]
include/reactos/libs/pseh/pseh3.h
lib/cmlib/hivecell.c
ntoskrnl/cache/cachesub.c
ntoskrnl/cache/copysup.c
ntoskrnl/cache/fssup.c
ntoskrnl/cache/logsup.c
ntoskrnl/include/internal/i386/ke.h
ntoskrnl/io/iomgr/irp.c
ntoskrnl/io/pnpmgr/pnpmgr.c
ntoskrnl/kd/kdmain.c
ntoskrnl/kd64/amd64/kdx64.c
ntoskrnl/kd64/arm/kdarm.c
ntoskrnl/ke/bug.c
ntoskrnl/ke/dpc.c
ntoskrnl/ke/i386/context.c
ntoskrnl/ke/i386/traphdlr.c
ntoskrnl/mm/ARM3/arm/init.c
ntoskrnl/mm/ARM3/largepag.c
ntoskrnl/mm/ARM3/mminit.c
ntoskrnl/mm/ARM3/pagfault.c
ntoskrnl/mm/ARM3/pool.c
ntoskrnl/mm/ARM3/procsup.c
ntoskrnl/mm/ARM3/section.c
ntoskrnl/mm/ARM3/sysldr.c
ntoskrnl/mm/ARM3/virtual.c
ntoskrnl/mm/arm/page.c
ntoskrnl/mm/arm/stubs.c
ntoskrnl/po/povolume.c
win32ss/gdi/eng/alphablend.c
win32ss/gdi/eng/bitblt.c
win32ss/gdi/eng/clip.c
win32ss/gdi/eng/copybits.c
win32ss/gdi/eng/debug.c
win32ss/gdi/eng/device.c
win32ss/gdi/eng/driverobj.c
win32ss/gdi/eng/engbrush.c
win32ss/gdi/eng/engevent.c
win32ss/gdi/eng/engmisc.c
win32ss/gdi/eng/error.c
win32ss/gdi/eng/float.c
win32ss/gdi/eng/gradient.c
win32ss/gdi/eng/inteng.h
win32ss/gdi/eng/ldevobj.c
win32ss/gdi/eng/lineto.c
win32ss/gdi/eng/mapping.c
win32ss/gdi/eng/math.c
win32ss/gdi/eng/pdevobj.c
win32ss/gdi/eng/surface.c
win32ss/gdi/eng/xlateobj.c
win32ss/gdi/gdi32/objects/region.c
win32ss/gdi/ntgdi/dc.h
win32ss/gdi/ntgdi/dclife.c
win32ss/gdi/ntgdi/dcobjs.c
win32ss/gdi/ntgdi/dcstate.c
win32ss/gdi/ntgdi/dibobj.c
win32ss/gdi/ntgdi/font.c
win32ss/gdi/ntgdi/gdibatch.c
win32ss/gdi/ntgdi/gdifloat.h
win32ss/gdi/ntgdi/text.h
win32ss/user/ntuser/object.h

index 22958be..43298ad 100644 (file)
@@ -8,7 +8,7 @@ Description = A media player.
 Size = 7.0MB\r
 Category = 1\r
 URLSite = http://mpc-hc.sourceforge.net/\r
-URLDownload = http://heanet.dl.sourceforge.netproject/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.6.5.6366_x86/MPC-HC.1.6.5.6366.x86.exe\r
+URLDownload = http://heanet.dl.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.6.5.6366_x86/MPC-HC.1.6.5.6366.x86.exe\r
 CDPath = none\r
 \r
 [Section.0407]\r
index d8b40e7..a55310a 100644 (file)
@@ -236,16 +236,16 @@ static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions
             {
                 /* Sanity check this key; it cannot be empty, nor can it be a
                  * loop back */
-                if ((szBuffer[0] != L'\0') && wcsicmp(szBuffer, pszKeyPath))
+                if ((szBuffer[0] != L'\0') && _wcsicmp(szBuffer, pszKeyPath))
                 {
                     if (RegOpenKeyW(hRootKey, szBuffer, &hOtherKey) == ERROR_SUCCESS)
                     {
-                        wcsncpy(pszSuggestions, L"HKCR\\", (int) iSuggestionsLength);
+                        lstrcpynW(pszSuggestions, L"HKCR\\", (int) iSuggestionsLength);
                         i = wcslen(pszSuggestions);
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
 
-                        wcsncpy(pszSuggestions, szBuffer, (int) iSuggestionsLength);
+                        lstrcpynW(pszSuggestions, szBuffer, (int) iSuggestionsLength);
                         i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
                         pszSuggestions += i;
                         iSuggestionsLength -= i;
@@ -266,12 +266,12 @@ static void SuggestKeys(HKEY hRootKey, LPCWSTR pszKeyPath, LPWSTR pszSuggestions
             if (QueryStringValue(hSubKey, L"CLSID", NULL, szBuffer,
                                  COUNT_OF(szBuffer)) == ERROR_SUCCESS)
             {
-                wcsncpy(pszSuggestions, L"HKCR\\CLSID\\", (int)iSuggestionsLength);
+                lstrcpynW(pszSuggestions, L"HKCR\\CLSID\\", (int)iSuggestionsLength);
                 i = wcslen(pszSuggestions);
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
 
-                wcsncpy(pszSuggestions, szBuffer, (int)iSuggestionsLength);
+                lstrcpynW(pszSuggestions, szBuffer, (int)iSuggestionsLength);
                 i = MIN(wcslen(pszSuggestions) + 1, iSuggestionsLength);
                 pszSuggestions += i;
                 iSuggestionsLength -= i;
@@ -286,7 +286,7 @@ LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
 {
     WNDPROC oldwndproc;
     static WCHAR s_szNode[256];
-    oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
+    oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -300,7 +300,7 @@ LRESULT CALLBACK AddressBarProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPar
     default:
         break;
     }
-    return CallWindowProc(oldwndproc, hwnd, uMsg, wParam, lParam);
+    return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
 }
 
 static VOID
@@ -333,8 +333,8 @@ UpdateAddress(HTREEITEM hItem, HKEY hRootKey, LPCWSTR pszPath)
             EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_LOADHIVE, MF_BYCOMMAND | MF_GRAYED);
             EnableMenuItem(GetSubMenu(hMenuFrame,0), ID_REGISTRY_UNLOADHIVE, MF_BYCOMMAND | MF_GRAYED);
             /* compare the strings to see if we should enable/disable the "Load Hive" menus accordingly */
-            if (!(wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") &&
-                  wcsicmp(rootName, L"HKEY_USERS")))
+            if (!(_wcsicmp(rootName, L"HKEY_LOCAL_MACHINE") &&
+                  _wcsicmp(rootName, L"HKEY_USERS")))
             {
                 /*
                  * enable the unload menu item if at the root, otherwise
@@ -406,9 +406,9 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                          0);
         }
         /* Subclass the AddressBar */
-        oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWL_WNDPROC);
-        SetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWL_USERDATA, (DWORD_PTR)oldproc);
-        SetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWL_WNDPROC, (DWORD_PTR)AddressBarProc);
+        oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWLP_WNDPROC);
+        SetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWLP_USERDATA, (DWORD_PTR)oldproc);
+        SetWindowLongPtr(g_pChildWnd->hAddressBarWnd, GWLP_WNDPROC, (DWORD_PTR)AddressBarProc);
         break;
     }
     case WM_COMMAND:
@@ -660,8 +660,8 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
         {
             TVHITTESTINFO hti;
             HMENU hContextMenu;
-            TVITEM item;
-            MENUITEMINFO mii;
+            TVITEMW item;
+            MENUITEMINFOW mii;
             WCHAR resource[256];
             WCHAR buffer[256];
             LPWSTR s;
index 4ff2ec9..3ec9e14 100644 (file)
@@ -230,7 +230,7 @@ LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
 {
     WNDPROC oldwndproc;
 
-    oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWL_USERDATA);
+    oldwndproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwnd, GWLP_USERDATA);
 
     switch (uMsg)
     {
@@ -263,7 +263,7 @@ LRESULT CALLBACK DwordEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPAR
         }
     }
 
-    return CallWindowProc(oldwndproc, hwnd, uMsg, wParam, lParam);
+    return CallWindowProcW(oldwndproc, hwnd, uMsg, wParam, lParam);
 }
 
 
@@ -285,9 +285,9 @@ INT_PTR CALLBACK modify_dword_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
 
         /* subclass the edit control */
         hwndValue = GetDlgItem(hwndDlg, IDC_VALUE_DATA);
-        oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwndValue, GWL_WNDPROC);
-        SetWindowLongPtr(hwndValue, GWL_USERDATA, (DWORD_PTR)oldproc);
-        SetWindowLongPtr(hwndValue, GWL_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
+        oldproc = (WNDPROC)(LONG_PTR)GetWindowLongPtr(hwndValue, GWLP_WNDPROC);
+        SetWindowLongPtr(hwndValue, GWLP_USERDATA, (DWORD_PTR)oldproc);
+        SetWindowLongPtr(hwndValue, GWLP_WNDPROC, (DWORD_PTR)DwordEditSubclassProc);
 
         if (editValueName && wcscmp(editValueName, L""))
         {
@@ -665,7 +665,7 @@ ParseResources(HWND hwnd)
     HWND hwndLV;
 
     WCHAR buffer[80];
-    LVITEM item;
+    LVITEMW item;
     INT iItem;
 
     pFullDescriptor = &resourceValueData->List[fullResourceIndex];
@@ -866,7 +866,7 @@ OnResourceNotify(HWND hwndDlg, NMHDR *phdr)
                     if (lpnmlv->iItem != -1)
                     {
                         PCM_PARTIAL_RESOURCE_DESCRIPTOR pDescriptor;
-                        LVITEM item;
+                        LVITEMW item;
 
                         item.mask = LVIF_PARAM;
                         item.iItem = lpnmlv->iItem;
@@ -968,7 +968,7 @@ static VOID AddFullResourcesToList(HWND hwnd)
 {
     PCM_FULL_RESOURCE_DESCRIPTOR pFullDescriptor;
     WCHAR buffer[80];
-    LVITEM item;
+    LVITEMW item;
     ULONG i;
     INT iItem;
 
@@ -1344,7 +1344,7 @@ static LONG CopyKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR l
     }
 
     /* create the destination subkey */
-    lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, 0, KEY_WRITE, NULL,
+    lResult = RegCreateKeyExW(hDestKey, lpDestSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
                              &hDestSubKey, &dwDisposition);
     if (lResult)
         goto done;
@@ -1399,6 +1399,12 @@ static LONG MoveKey(HKEY hDestKey, LPCWSTR lpDestSubKey, HKEY hSrcKey, LPCWSTR l
     if (!lpSrcSubKey)
         return ERROR_INVALID_FUNCTION;
 
+    if (_wcsicmp(lpDestSubKey, lpSrcSubKey) == 0)
+    {
+        /* Destination name equals source name */
+        return ERROR_SUCCESS;
+    }
+
     lResult = CopyKey(hDestKey, lpDestSubKey, hSrcKey, lpSrcSubKey);
     if (lResult == ERROR_SUCCESS)
         SHDeleteKey(hSrcKey, lpSrcSubKey);
index 6313591..1999ac6 100644 (file)
@@ -40,7 +40,7 @@ int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...)
 
     va_end(args);
 
-    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, MB_OK | MB_ICONERROR);
+    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message."), lpTitle, MB_OK | MB_ICONERROR);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
@@ -52,22 +52,25 @@ int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ..
 {
     int iRet = 0;
     LPWSTR lpMsgBuf = NULL;
-    DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, lpMessage);
 
-    Status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
-                            lpMessage,
-                            0,
-                            0,
-                            (LPWSTR)&lpMsgBuf,
-                            0,
-                            &args);
+    if (lpMessage)
+    {
+        SIZE_T strLen = _vscwprintf(lpMessage, args);
+
+        /* Create a buffer on the heap and zero it out (LPTR) */
+        lpMsgBuf = (LPWSTR)LocalAlloc(LPTR, (strLen + 1) * sizeof(WCHAR));
+        if (lpMsgBuf)
+        {
+            _vsnwprintf(lpMsgBuf, strLen, lpMessage, args);
+        }
+    }
 
     va_end(args);
 
-    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, uType);
+    iRet = MessageBoxW(hWnd, (lpMessage && lpMsgBuf ? lpMsgBuf : L"Error displaying info message."), lpTitle, uType);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
index 0a15204..3c3e7d4 100644 (file)
@@ -77,7 +77,7 @@ static BOOL CompareName(LPCWSTR pszName1, LPCWSTR pszName2)
         if (s_dwFlags & RSF_MATCHCASE)
             return wcscmp(pszName1, pszName2) == 0;
         else
-            return wcsicmp(pszName1, pszName2) == 0;
+            return _wcsicmp(pszName1, pszName2) == 0;
     }
     else
     {
@@ -130,7 +130,7 @@ int compare(const void *x, const void *y)
 {
     const LPCWSTR *a = (const LPCWSTR *)x;
     const LPCWSTR *b = (const LPCWSTR *)y;
-    return wcsicmp(*a, *b);
+    return _wcsicmp(*a, *b);
 }
 
 BOOL RegFindRecurse(
@@ -198,7 +198,7 @@ BOOL RegFindRecurse(
         if (DoEvents())
             goto err;
 
-        if (!fPast && wcsicmp(ppszNames[i], pszValueName) == 0)
+        if (!fPast && _wcsicmp(ppszNames[i], pszValueName) == 0)
         {
             fPast = TRUE;
             continue;
@@ -390,7 +390,7 @@ BOOL RegFindWalk(
         }
         else
         {
-            wcsncpy(szKeyName, pch + 1, MAX_PATH);
+            lstrcpynW(szKeyName, pch + 1, MAX_PATH);
             *pch = 0;
             lResult = RegOpenKeyExW(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
                                    &hSubKey);
@@ -434,7 +434,7 @@ BOOL RegFindWalk(
             if (DoEvents())
                 goto err;
 
-            if (!fPast && wcsicmp(ppszNames[i], szKeyName) == 0)
+            if (!fPast && _wcsicmp(ppszNames[i], szKeyName) == 0)
             {
                 fPast = TRUE;
                 continue;
@@ -586,7 +586,7 @@ static void SetFindFlags(DWORD dwFlags)
     DWORD dwDisposition;
     DWORD dwData;
 
-    if (RegCreateKeyExW(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
+    if (RegCreateKeyExW(HKEY_CURRENT_USER, g_szGeneralRegKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition) == ERROR_SUCCESS)
     {
         dwData = (dwFlags >> 0) & 0x0000FFFF;
         RegSetValueExW(hKey, s_szFindFlags, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
index 19b8a8e..d94534a 100644 (file)
@@ -453,7 +453,7 @@ static BOOL ImportRegistryFile(HWND hWnd)
     {
         /* Look at the extension of the file to determine its type */
         if (ofn.nFileExtension >= 1 &&
-            wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
+            _wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
         {
             /* Open the file */
             FILE* fp = _wfopen(ofn.lpstrFile, L"r");
@@ -1249,7 +1249,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
         if ((LOWORD(wParam) >= ID_FAVORITES_MIN) && (LOWORD(wParam) <= ID_FAVORITES_MAX))
         {
             HMENU hMenu;
-            MENUITEMINFO mii;
+            MENUITEMINFOW mii;
             WCHAR szFavorite[512];
 
             hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
index 2d7970a..958c50f 100644 (file)
@@ -56,7 +56,7 @@ static const int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_LEFT
 LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
 {
     int item;
-    LVITEM LVItem;
+    LVITEMW LVItem;
     PLINE_INFO lineinfo;
 
     /*
@@ -108,7 +108,7 @@ VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
 BOOL IsDefaultValue(HWND hwndLV, int i)
 {
     PLINE_INFO lineinfo;
-    LVITEM Item;
+    LVITEMW Item;
 
     Item.mask = LVIF_PARAM;
     Item.iItem = i;
@@ -126,7 +126,7 @@ BOOL IsDefaultValue(HWND hwndLV, int i)
 static void AddEntryToList(HWND hwndLV, LPWSTR Name, DWORD dwValType, void* ValBuf, DWORD dwCount, int Position, BOOL ValExists)
 {
     PLINE_INFO linfo;
-    LVITEM item;
+    LVITEMW item;
     int index;
 
     linfo = (PLINE_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LINE_INFO) + dwCount);
@@ -654,7 +654,7 @@ fail:
 void DestroyListView(HWND hwndLV)
 {
     INT count, i;
-    LVITEM item;
+    LVITEMW item;
 
     count = ListView_GetItemCount(hwndLV);
     for (i = 0; i < count; i++)
index 69604e8..5ca0850 100644 (file)
@@ -458,17 +458,16 @@ static LONG openKeyW(WCHAR* stdInput)
     if (!parseKeyName(stdInput, &keyClass, &keyPath))
         return ERROR_INVALID_PARAMETER;
 
-    res = RegCreateKeyExW(
-        keyClass,                 /* Class     */
-        keyPath,                  /* Sub Key   */
-        0,                        /* MUST BE 0 */
-        NULL,                     /* object type */
-        REG_OPTION_NON_VOLATILE,  /* option, REG_OPTION_NON_VOLATILE ... */
-        KEY_ALL_ACCESS,           /* access mask, KEY_ALL_ACCESS */
-        NULL,                     /* security attribute */
-        &currentKeyHandle,        /* result */
-        &dwDisp);                 /* disposition, REG_CREATED_NEW_KEY or
-                                                        REG_OPENED_EXISTING_KEY */
+    res = RegCreateKeyExW(keyClass,                 /* Class     */
+                          keyPath,                  /* Sub Key   */
+                          0,                        /* MUST BE 0 */
+                          NULL,                     /* object type */
+                          REG_OPTION_NON_VOLATILE,  /* option, REG_OPTION_NON_VOLATILE ... */
+                          KEY_ALL_ACCESS,           /* access mask, KEY_ALL_ACCESS */
+                          NULL,                     /* security attribute */
+                          &currentKeyHandle,        /* result */
+                          &dwDisp);                 /* disposition, REG_CREATED_NEW_KEY or
+                                                                    REG_OPENED_EXISTING_KEY */
 
     if (res == ERROR_SUCCESS)
         currentKeyName = GetMultiByteString(stdInput);
index 1d562ac..10a1e55 100644 (file)
@@ -116,49 +116,45 @@ extern void SaveSettings(void)
 
     if (RegCreateKeyW(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
     {
-        if (RegOpenKeyW(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
+        RegistryBinaryConfig tConfig;
+        DWORD iBufferSize = sizeof(tConfig);
+        WCHAR szBuffer[MAX_PATH];
+        LPCWSTR keyPath, rootName;
+        HKEY hRootKey;
+
+        /* Save key position */
+        keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
+        if (keyPath)
         {
-            RegistryBinaryConfig tConfig;
-            DWORD iBufferSize = sizeof(tConfig);
-            WCHAR szBuffer[MAX_PATH];
-            LPCWSTR keyPath, rootName;
-            HKEY hRootKey;
-
-            /* Save key position */
-            keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
-            if (keyPath)
-            {
-                rootName = get_root_key_name(hRootKey);
+            rootName = get_root_key_name(hRootKey);
 
-                /* Load "My Computer" string and complete it */
-                LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
-                wcscat(szBuffer, L"\\"); wcscat(szBuffer, rootName);
-                wcscat(szBuffer, L"\\"); wcscat(szBuffer, keyPath);
+            /* Load "My Computer" string and complete it */
+            LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
+            wcscat(szBuffer, L"\\"); wcscat(szBuffer, rootName);
+            wcscat(szBuffer, L"\\"); wcscat(szBuffer, keyPath);
 
-                RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR));
-            }
+            RegSetValueExW(hKey, L"LastKey", 0, REG_SZ, (LPBYTE)szBuffer, (DWORD)wcslen(szBuffer) * sizeof(WCHAR));
+        }
 
-            /* Get statusbar settings */
-            tConfig.StatusBarVisible = ((GetMenuState(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_STATUSBAR, MF_BYCOMMAND) & MF_CHECKED) ? 1 : 0);
+        /* Get statusbar settings */
+        tConfig.StatusBarVisible = ((GetMenuState(GetSubMenu(hMenuFrame, ID_VIEW_MENU), ID_VIEW_STATUSBAR, MF_BYCOMMAND) & MF_CHECKED) ? 1 : 0);
 
-            /* Get splitter position */
-            tConfig.TreeViewSize = g_pChildWnd->nSplitPos;
+        /* Get splitter position */
+        tConfig.TreeViewSize = g_pChildWnd->nSplitPos;
 
-            /* Get list view column width*/
-            tConfig.NameColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 0);
-            tConfig.TypeColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 1);
-            tConfig.DataColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 2);
+        /* Get list view column width*/
+        tConfig.NameColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 0);
+        tConfig.TypeColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 1);
+        tConfig.DataColumnSize = ListView_GetColumnWidth(g_pChildWnd->hListWnd, 2);
 
-            /* Get program window settings */
-            tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
-            GetWindowPlacement(hFrameWnd , &tConfig.tPlacement);
+        /* Get program window settings */
+        tConfig.tPlacement.length = sizeof(WINDOWPLACEMENT);
+        GetWindowPlacement(hFrameWnd , &tConfig.tPlacement);
 
-            /* Save all the data */
-            RegSetValueExW(hKey, L"View", 0, REG_BINARY, (LPBYTE)&tConfig, iBufferSize);
+        /* Save all the data */
+        RegSetValueExW(hKey, L"View", 0, REG_BINARY, (LPBYTE)&tConfig, iBufferSize);
 
-            RegCloseKey(hKey);
-        }
+        RegCloseKey(hKey);
     }
 }
-
 /* EOF */
index cd06e7b..f27299c 100644 (file)
@@ -34,7 +34,7 @@ static LPWSTR pathBuffer;
 
 static BOOL get_item_path(HWND hwndTV, HTREEITEM hItem, HKEY* phKey, LPWSTR* pKeyPath, int* pPathLen, int* pMaxLen)
 {
-    TVITEM item;
+    TVITEMW item;
     size_t maxLen, len;
     LPWSTR newStr;
 
@@ -109,8 +109,8 @@ BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem)
 /* Add an entry to the tree. Only give hKey for root nodes (HKEY_ constants) */
 static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HKEY hKey, DWORD dwChildren)
 {
-    TVITEM tvi;
-    TVINSERTSTRUCT tvins;
+    TVITEMW tvi;
+    TVINSERTSTRUCTW tvins;
 
     if (hKey)
     {
@@ -140,7 +140,7 @@ BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem)
     LPCWSTR KeyPath;
     DWORD dwCount, dwIndex, dwMaxSubKeyLen;
     LPWSTR Name = NULL;
-    TVITEM tvItem;
+    TVITEMW tvItem;
     LPWSTR pszNodes = NULL;
     BOOL bSuccess = FALSE;
     LPWSTR s;
@@ -332,7 +332,7 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name)
 {
     WCHAR buf[MAX_NEW_KEY_LEN];
     HTREEITEM hNewItem = 0;
-    TVITEMEX item;
+    TVITEMEXW item;
 
     /* Default to the current selection */
     if (!hItem)
@@ -390,8 +390,8 @@ HWND StartKeyRename(HWND hwndTV)
 
 static BOOL InitTreeViewItems(HWND hwndTV, LPWSTR pHostName)
 {
-    TVITEM tvi;
-    TVINSERTSTRUCT tvins;
+    TVITEMW tvi;
+    TVINSERTSTRUCTW tvins;
     HTREEITEM hRoot;
 
     tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
@@ -593,7 +593,7 @@ BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
     do
     {
         wsprintf(szNewKey, szNewKeyFormat, iIndex++);
-        nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, 0, KEY_WRITE, NULL, &hNewKey, &dwDisposition);
+        nResult = RegCreateKeyExW(hKey, szNewKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hNewKey, &dwDisposition);
         if (hNewKey && dwDisposition == REG_OPENED_EXISTING_KEY)
         {
             RegCloseKey(hNewKey);
@@ -664,7 +664,7 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
     WCHAR szPathPart[128];
     WCHAR szBuffer[128];
     LPCWSTR s;
-    TVITEM tvi;
+    TVITEMW tvi;
 
     /* Load "My Computer" string... */
     LoadStringW(hInst, IDS_MY_COMPUTER, szBuffer, COUNT_OF(szBuffer));
@@ -683,22 +683,22 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
     while(keyPath[0])
     {
         s = wcschr(keyPath, L'\\');
-        wcsncpy(szPathPart, keyPath, s ? s - keyPath + 1 : wcslen(keyPath) + 1);
+        lstrcpynW(szPathPart, keyPath, s ? s - keyPath + 1 : wcslen(keyPath) + 1);
 
         /* Special case for root to expand root key abbreviations */
         if (hItem == hRoot)
         {
-            if (!wcsicmp(szPathPart, L"HKCR"))
+            if (!_wcsicmp(szPathPart, L"HKCR"))
                 wcscpy(szPathPart, L"HKEY_CLASSES_ROOT");
-            else if (!wcsicmp(szPathPart, L"HKCU"))
+            else if (!_wcsicmp(szPathPart, L"HKCU"))
                 wcscpy(szPathPart, L"HKEY_CURRENT_USER");
-            else if (!wcsicmp(szPathPart, L"HKLM"))
+            else if (!_wcsicmp(szPathPart, L"HKLM"))
                 wcscpy(szPathPart, L"HKEY_LOCAL_MACHINE");
-            else if (!wcsicmp(szPathPart, L"HKU"))
+            else if (!_wcsicmp(szPathPart, L"HKU"))
                 wcscpy(szPathPart, L"HKEY_USERS");
-            else if (!wcsicmp(szPathPart, L"HKCC"))
+            else if (!_wcsicmp(szPathPart, L"HKCC"))
                 wcscpy(szPathPart, L"HKEY_CURRENT_CONFIG");
-            else if (!wcsicmp(szPathPart, L"HKDD"))
+            else if (!_wcsicmp(szPathPart, L"HKDD"))
                 wcscpy(szPathPart, L"HKEY_DYN_DATA");
         }
 
@@ -713,7 +713,7 @@ BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
 
             (void)TreeView_GetItem(hwndTV, &tvi);
 
-            if (!wcsicmp(szBuffer, szPathPart))
+            if (!_wcsicmp(szBuffer, szPathPart))
                 break;
         }
 
index 3a71738..1c70373 100644 (file)
@@ -513,7 +513,7 @@ STRINGTABLE DISCARDABLE
 BEGIN
     IDS_APP_TITLE           "Gestionnaire des tâches"
     IDC_TASKMGR             "Gestionnaire des tâches"
-    IDS_IDLE_PROCESS        "Processus système en atente"
+    IDS_IDLE_PROCESS        "Processus système en attente"
 END
 
 STRINGTABLE DISCARDABLE
index 260e39d..4ea6876 100644 (file)
@@ -171,14 +171,6 @@ i386PrintExceptionText(ULONG TrapIndex, PKTRAP_FRAME TrapFrame, PKSPECIAL_REGIST
               InstructionPointer[6], InstructionPointer[7]);
 }
 
-char *BugCodeStrings[] =
-{
-    "TEST_BUGCHECK",
-    "MISSING_HARDWARE_REQUIREMENTS",
-};
-
-ULONG_PTR BugCheckInfo[5];
-
 void
 NTAPI
 FrLdrBugCheckEx(
index 21b78ca..5ac8e10 100644 (file)
@@ -427,3 +427,13 @@ RtlAssert(IN PVOID FailedAssertion,
 
    DbgBreakPoint();
 }
+
+char *BugCodeStrings[] =
+{
+    "TEST_BUGCHECK",
+    "MISSING_HARDWARE_REQUIREMENTS",
+    "FREELDR_IMAGE_CORRUPTION",
+};
+
+ULONG_PTR BugCheckInfo[5];
+
index 91f8c42..e681390 100644 (file)
@@ -23,6 +23,7 @@
 #define BIOSCALLBUFSEGMENT (BIOSCALLBUFFER/16) /* Buffer to store temporary data for any Int386() call */
 #define BIOSCALLBUFOFFSET   HEX(0000) /* Buffer to store temporary data for any Int386() call */
 #define BIOSCALLBUFSIZE     PAGE_SIZE /* max is sizeof(VESA_SVGA_INFO) = 512 */
+#define MAX_FREELDR_PE_SIZE (DISKREADBUFFER - FREELDR_PE_BASE)
 
 /* These addresses specify the realmode "BSS section" layout */
 #define BSS_RealModeEntry        (BSS_START +  0)
index 16d04cc..7ab94d0 100644 (file)
@@ -120,4 +120,19 @@ void       MEMORY_WRITE_BREAKPOINT4(unsigned long addr);
 
 #endif // DBG
 
+void
+NTAPI
+FrLdrBugCheck(ULONG BugCode);
+
+/* Bugcheck codes */
+enum _FRLDR_BUGCHECK_CODES
+{
+    TEST_BUGCHECK,
+    MISSING_HARDWARE_REQUIREMENTS,
+    FREELDR_IMAGE_CORRUPTION,
+};
+
+extern char *BugCodeStrings[];
+extern ULONG_PTR BugCheckInfo[5];
+
 #endif // defined __DEBUG_H
index a453a28..7b6ed61 100644 (file)
 
 #pragma once
 
+extern char __ImageBase;
+#ifdef __GNUC__
+#define FREELDR_SECTION_COUNT 3
+#else
+#define FREELDR_SECTION_COUNT 1
+#endif
+
 typedef struct _FREELDR_MEMORY_DESCRIPTOR
 {
     TYPE_OF_MEMORY MemoryType;
index 7794f6f..b9e8877 100644 (file)
@@ -163,6 +163,46 @@ ArcGetMemoryDescriptor(const FREELDR_MEMORY_DESCRIPTOR* Current)
 }
 
 
+BOOLEAN
+MmCheckFreeldrImageFile()
+{
+    PIMAGE_NT_HEADERS NtHeaders;
+    PIMAGE_FILE_HEADER FileHeader;
+    PIMAGE_OPTIONAL_HEADER OptionalHeader;
+
+    /* Get the NT headers */
+    NtHeaders = RtlImageNtHeader(&__ImageBase);
+    if (!NtHeaders)
+    {
+        ERR("Coult not get NtHeaders!\n");
+        return FALSE;
+    }
+
+    /* Check the file header */
+    FileHeader = &NtHeaders->FileHeader;
+    if ((FileHeader->Machine != IMAGE_FILE_MACHINE_NATIVE) ||
+        (FileHeader->NumberOfSections != FREELDR_SECTION_COUNT) ||
+        (FileHeader->PointerToSymbolTable != 0) ||
+        (FileHeader->NumberOfSymbols != 0) ||
+        (FileHeader->SizeOfOptionalHeader != 0xE0))
+    {
+        return FALSE;
+    }
+
+    /* Check the optional header */
+    OptionalHeader = &NtHeaders->OptionalHeader;
+    if ((OptionalHeader->Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC) ||
+        (OptionalHeader->Subsystem != 1) || // native
+        (OptionalHeader->ImageBase != FREELDR_PE_BASE) ||
+        (OptionalHeader->SizeOfImage > MAX_FREELDR_PE_SIZE) ||
+        (OptionalHeader->SectionAlignment != OptionalHeader->FileAlignment))
+    {
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
 BOOLEAN MmInitializeMemoryManager(VOID)
 {
 #if DBG
@@ -171,6 +211,12 @@ BOOLEAN MmInitializeMemoryManager(VOID)
 
        TRACE("Initializing Memory Manager.\n");
 
+       /* Check the freeldr binary */
+       if (!MmCheckFreeldrImageFile())
+       {
+               FrLdrBugCheck(FREELDR_IMAGE_CORRUPTION);
+       }
+
     BiosMemoryMap = MachVtbl.GetMemoryMap(&BiosMemoryMapEntryCount);
 
 #if DBG
index e4d1c9b..a549248 100644 (file)
@@ -261,14 +261,10 @@ UserNew(HWND hwndDlg)
                        NewUserDlgProc,
                        (LPARAM)&user) == IDOK)
     {
-#if 0
         status = NetUserAdd(NULL,
                             3,
                             (LPBYTE)&user,
                             NULL);
-#else
-        status = NERR_Success;
-#endif
         if (status != NERR_Success)
         {
             TCHAR szText[256];
@@ -434,11 +430,13 @@ UpdateUsersList(HWND hwndListView)
            lvi.iImage = (pBuffer[i].usri20_flags & UF_ACCOUNTDISABLE) ? 1 : 0;
            iItem = ListView_InsertItem(hwndListView, &lvi);
 
-           ListView_SetItemText(hwndListView, iItem, 1,
-                                pBuffer[i].usri20_full_name);
+           if (pBuffer[i].usri20_full_name != NULL)
+               ListView_SetItemText(hwndListView, iItem, 1,
+                                    pBuffer[i].usri20_full_name);
 
-           ListView_SetItemText(hwndListView, iItem, 2,
-                                pBuffer[i].usri20_comment);
+           if (pBuffer[i].usri20_comment != NULL)
+               ListView_SetItemText(hwndListView, iItem, 2,
+                                    pBuffer[i].usri20_comment);
         }
 
         NetApiBufferFree(pBuffer);
index 48224db..2229d3e 100644 (file)
@@ -237,7 +237,8 @@ BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder,
                 {
                     /* This means someone added RTL_PERTHREAD_CURDIR */
                     UNIMPLEMENTED;
-                    while (TRUE);
+                    ASSERT(FALSE);
+                    // while (TRUE);
                 }
 
                 /* We do not. Do we have the LDR_ENTRY for the executable? */
index a0409d7..7fd9ce6 100644 (file)
@@ -2637,7 +2637,7 @@ CreateProcessInternalW(HANDLE hToken,
         while (NULL != (ScanString = wcschr(ScanString, L'^')))
         {
             ScanString++;
-            if (*ScanString == L'\"' || *ScanString == L'^' || *ScanString == L'\"')
+            if (*ScanString == L'\"' || *ScanString == L'^' || *ScanString == L'\\')
             {
                 Escape = TRUE;
                 break;
index 404bd11..c9d7f17 100644 (file)
@@ -241,7 +241,8 @@ CreateRemoteThread(IN HANDLE hProcess,
             DbgPrint("SXS: %s - Failing thread create because "
                      "NtQueryInformationThread() failed with status %08lx\n",
                      __FUNCTION__, Status);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return NULL;
         }
 
         /* Allocate the Activation Context Stack */
@@ -252,7 +253,8 @@ CreateRemoteThread(IN HANDLE hProcess,
             DbgPrint("SXS: %s - Failing thread create because "
                      "RtlAllocateActivationContextStack() failed with status %08lx\n",
                      __FUNCTION__, Status);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return NULL;
         }
 
         /* Save it */
@@ -274,7 +276,8 @@ CreateRemoteThread(IN HANDLE hProcess,
             DbgPrint("SXS: %s - Failing thread create because "
                      "RtlQueryInformationActivationContext() failed with status %08lx\n",
                      __FUNCTION__, Status);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return NULL;
         }
 
         /* Does it need to be activated? */
@@ -291,7 +294,8 @@ CreateRemoteThread(IN HANDLE hProcess,
                 DbgPrint("SXS: %s - Failing thread create because "
                          "RtlActivateActivationContextEx() failed with status %08lx\n",
                          __FUNCTION__, Status);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
+                return NULL;
             }
         }
     }
@@ -367,7 +371,8 @@ ExitThread(IN DWORD uExitCode)
 
     /* We should never reach this place */
     DPRINT1("It should not happen\n");
-    while (TRUE);
+    ASSERT(FALSE);
+    while (TRUE); // 'noreturn' function.
 }
 
 /*
index 3022cc3..25238ae 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+/*
+ *  TODO:
+ *    Implement NetUserChangePassword
+ *    Implement NetUserDel
+ *    Implement NetUserGetGroups
+ *    Implement NetUserSetGroups
+ *    Implement NetUserSetInfo
+ *    NetUserGetLocalGroups does not support LG_INCLUDE_INDIRECT yet.
+ *    Add missing information levels.
+ *    ...
+ */
+
 #include "netapi32.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
@@ -31,7 +43,7 @@ typedef struct _ENUM_CONTEXT
 
     SAM_ENUMERATE_HANDLE EnumerationContext;
     PSAM_RID_ENUMERATION Buffer;
-    ULONG Returned;
+    ULONG Count;
     ULONG Index;
     BOOLEAN BuiltinDone;
 
@@ -107,6 +119,46 @@ static struct sam_user* NETAPI_FindUser(LPCWSTR UserName)
 }
 
 
+static PSID
+CreateSidFromSidAndRid(PSID SrcSid,
+                       ULONG RelativeId)
+{
+    UCHAR RidCount;
+    PSID DstSid;
+    ULONG i;
+    ULONG DstSidSize;
+    PULONG p, q;
+
+    RidCount = *RtlSubAuthorityCountSid(SrcSid);
+    if (RidCount >= 8)
+        return NULL;
+
+    DstSidSize = RtlLengthRequiredSid(RidCount + 1);
+
+    DstSid = RtlAllocateHeap(RtlGetProcessHeap(),
+                             0,
+                             DstSidSize);
+    if (DstSid == NULL)
+        return NULL;
+
+    RtlInitializeSid(DstSid,
+                     RtlIdentifierAuthoritySid(SrcSid),
+                     RidCount + 1);
+
+    for (i = 0; i < (ULONG)RidCount; i++)
+    {
+        p = RtlSubAuthoritySid(SrcSid, i);
+        q = RtlSubAuthoritySid(DstSid, i);
+        *q = *p;
+    }
+
+    q = RtlSubAuthoritySid(DstSid, (ULONG)RidCount);
+    *q = RelativeId;
+
+    return DstSid;
+}
+
+
 static
 NET_API_STATUS
 BuildUserInfoBuffer(PUSER_ACCOUNT_INFORMATION UserInfo,
@@ -246,7 +298,7 @@ BuildUserInfoBuffer(PUSER_ACCOUNT_INFORMATION UserInfo,
                     Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR));
                 }
 
-                UserInfo1->usri1_flags = UserInfo->UserAccountControl;
+//                UserInfo1->usri1_flags = UserInfo->UserAccountControl;
 
                 if (UserInfo->ScriptPath.Length > 0)
                 {
@@ -342,7 +394,7 @@ BuildUserInfoBuffer(PUSER_ACCOUNT_INFORMATION UserInfo,
                 Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR));
             }
 
-            UserInfo20->usri20_flags = UserInfo->UserAccountControl;
+//            UserInfo20->usri20_flags = UserInfo->UserAccountControl;
             UserInfo20->usri20_user_id = RelativeId;
             break;
 
@@ -399,6 +451,131 @@ FreeUserInfo(PUSER_ACCOUNT_INFORMATION UserInfo)
 }
 
 
+static
+NET_API_STATUS
+SetUserInfo(SAM_HANDLE UserHandle,
+            LPBYTE UserInfo,
+            DWORD Level)
+{
+    USER_ALL_INFORMATION UserAllInfo;
+    PUSER_INFO_1 UserInfo1;
+    PUSER_INFO_3 UserInfo3;
+    NET_API_STATUS ApiStatus = NERR_Success;
+    NTSTATUS Status = STATUS_SUCCESS;
+
+    ZeroMemory(&UserAllInfo, sizeof(USER_ALL_INFORMATION));
+
+    switch (Level)
+    {
+        case 1:
+            UserInfo1 = (PUSER_INFO_1)UserInfo;
+//            RtlInitUnicodeString(&UserAllInfo.UserName,
+//                                 UserInfo1->usri1_name);
+
+            RtlInitUnicodeString(&UserAllInfo.AdminComment,
+                                 UserInfo1->usri1_comment);
+
+            RtlInitUnicodeString(&UserAllInfo.HomeDirectory,
+                                 UserInfo1->usri1_home_dir);
+
+            RtlInitUnicodeString(&UserAllInfo.ScriptPath,
+                                 UserInfo1->usri1_script_path);
+
+            RtlInitUnicodeString(&UserAllInfo.NtPassword,
+                                 UserInfo1->usri1_password);
+            UserAllInfo.NtPasswordPresent = TRUE;
+
+//          UserInfo1->usri1_flags
+//          UserInfo1->usri1_priv
+
+            UserAllInfo.WhichFields = 
+                USER_ALL_ADMINCOMMENT |
+                USER_ALL_HOMEDIRECTORY |
+                USER_ALL_SCRIPTPATH |
+                USER_ALL_NTPASSWORDPRESENT
+//                USER_ALL_USERACCOUNTCONTROL
+                ;
+            break;
+
+
+        case 3:
+            UserInfo3 = (PUSER_INFO_3)UserInfo;
+
+//  LPWSTR usri3_name;
+
+            RtlInitUnicodeString(&UserAllInfo.NtPassword,
+                                 UserInfo3->usri3_password);
+            UserAllInfo.NtPasswordPresent = TRUE;
+
+//  DWORD  usri3_password_age; // ignored
+//  DWORD  usri3_priv;
+
+            RtlInitUnicodeString(&UserAllInfo.HomeDirectory,
+                                 UserInfo3->usri3_home_dir);
+
+            RtlInitUnicodeString(&UserAllInfo.AdminComment,
+                                 UserInfo3->usri3_comment);
+
+//  DWORD  usri3_flags;
+
+            RtlInitUnicodeString(&UserAllInfo.ScriptPath,
+                                 UserInfo3->usri3_script_path);
+
+//  DWORD  usri3_auth_flags;
+
+            RtlInitUnicodeString(&UserAllInfo.FullName,
+                                 UserInfo3->usri3_full_name);
+
+//  LPWSTR usri3_usr_comment;
+//  LPWSTR usri3_parms;
+//  LPWSTR usri3_workstations;
+//  DWORD  usri3_last_logon;
+//  DWORD  usri3_last_logoff;
+//  DWORD  usri3_acct_expires;
+//  DWORD  usri3_max_storage;
+//  DWORD  usri3_units_per_week;
+//  PBYTE  usri3_logon_hours;
+//  DWORD  usri3_bad_pw_count;
+//  DWORD  usri3_num_logons;
+//  LPWSTR usri3_logon_server;
+//  DWORD  usri3_country_code;
+//  DWORD  usri3_code_page;
+//  DWORD  usri3_user_id;  // ignored
+//  DWORD  usri3_primary_group_id;
+//  LPWSTR usri3_profile;
+//  LPWSTR usri3_home_dir_drive;
+//  DWORD  usri3_password_expired;
+
+            UserAllInfo.WhichFields = 
+                USER_ALL_NTPASSWORDPRESENT |
+                USER_ALL_HOMEDIRECTORY |
+                USER_ALL_ADMINCOMMENT |
+                USER_ALL_SCRIPTPATH |
+                USER_ALL_FULLNAME
+//                USER_ALL_USERACCOUNTCONTROL
+                ;
+            break;
+
+        default:
+            ERR("Unsupported level %lu!\n", Level);
+            return ERROR_INVALID_PARAMETER;
+    }
+
+    Status = SamSetInformationUser(UserHandle,
+                                   UserAllInformation,
+                                   &UserAllInfo);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("SamSetInformationUser failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
+
+done:
+    return ApiStatus;
+}
+
+
 /************************************************************
  * NetUserAdd (NETAPI32.@)
  */
@@ -409,72 +586,89 @@ NetUserAdd(LPCWSTR servername,
            LPBYTE bufptr,
            LPDWORD parm_err)
 {
-    NET_API_STATUS status;
-    struct sam_user * su = NULL;
+    UNICODE_STRING ServerName;
+    UNICODE_STRING UserName;
+    SAM_HANDLE ServerHandle = NULL;
+    SAM_HANDLE DomainHandle = NULL;
+    SAM_HANDLE UserHandle = NULL;
+    ULONG GrantedAccess;
+    ULONG RelativeId;
+    NET_API_STATUS ApiStatus = NERR_Success;
+    NTSTATUS Status = STATUS_SUCCESS;
 
-    FIXME("(%s, %d, %p, %p) stub!\n", debugstr_w(servername), level, bufptr, parm_err);
+    TRACE("(%s, %d, %p, %p)\n", debugstr_w(servername), level, bufptr, parm_err);
 
-    if((status = NETAPI_ValidateServername(servername)) != NERR_Success)
-        return status;
+    /* Check the info level */
+    if (level < 1 || level > 4)
+        return ERROR_INVALID_LEVEL;
 
-    switch(level)
-    {
-    /* Level 3 and 4 are identical for the purposes of NetUserAdd */
-    case 4:
-    case 3:
-        FIXME("Level 3 and 4 not implemented.\n");
-        /* Fall through */
-    case 2:
-        FIXME("Level 2 not implemented.\n");
-        /* Fall through */
-    case 1:
+    if (servername != NULL)
+        RtlInitUnicodeString(&ServerName, servername);
+
+    /* Connect to the SAM Server */
+    Status = SamConnect((servername != NULL) ? &ServerName : NULL,
+                        &ServerHandle,
+                        SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
+                        NULL);
+    if (!NT_SUCCESS(Status))
     {
-        PUSER_INFO_1 ui = (PUSER_INFO_1) bufptr;
-        su = HeapAlloc(GetProcessHeap(), 0, sizeof(struct sam_user));
-        if(!su)
-        {
-            status = NERR_InternalError;
-            break;
-        }
+        ERR("SamConnect failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
 
-        if(lstrlenW(ui->usri1_name) > LM20_UNLEN)
-        {
-            status = NERR_BadUsername;
-            break;
-        }
+    /* Open the Account Domain */
+    Status = OpenAccountDomain(ServerHandle,
+                               (servername != NULL) ? &ServerName : NULL,
+                               DOMAIN_CREATE_USER | DOMAIN_LOOKUP,
+                               &DomainHandle);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("OpenAccountDomain failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
 
-        /*FIXME: do other checks for a valid username */
-        lstrcpyW(su->user_name, ui->usri1_name);
+    /* Initialize the user name string */
+    RtlInitUnicodeString(&UserName,
+                         ((PUSER_INFO_1)bufptr)->usri1_name);
 
-        if(lstrlenW(ui->usri1_password) > PWLEN)
-        {
-            /* Always return PasswordTooShort on invalid passwords. */
-            status = NERR_PasswordTooShort;
-            break;
-        }
-        lstrcpyW(su->user_password, ui->usri1_password);
+    /* Create the user account */
+    Status = SamCreateUser2InDomain(DomainHandle,
+                                    &UserName,
+                                    USER_NORMAL_ACCOUNT,
+                                    USER_ALL_ACCESS | DELETE | WRITE_DAC,
+                                    &UserHandle,
+                                    &GrantedAccess,
+                                    &RelativeId);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("SamCreateUser2InDomain failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
 
-        su->sec_since_passwd_change = ui->usri1_password_age;
-        su->user_priv = ui->usri1_priv;
-        su->user_flags = ui->usri1_flags;
+    /* Set user information */
+    ApiStatus = SetUserInfo(UserHandle,
+                            bufptr,
+                            level);
+    if (ApiStatus != NERR_Success)
+    {
+        ERR("SetUserInfo failed (Status %lu)\n", ApiStatus);
+        goto done;
+    }
 
-        /*FIXME: set the other LPWSTRs to NULL for now */
-        su->home_dir = NULL;
-        su->user_comment = NULL;
-        su->user_logon_script_path = NULL;
+done:
+    if (UserHandle != NULL)
+        SamCloseHandle(UserHandle);
 
-        list_add_head(&user_list, &su->entry);
-        return NERR_Success;
-    }
-    default:
-        TRACE("Invalid level %d specified.\n", level);
-        status = ERROR_INVALID_LEVEL;
-        break;
-    }
+    if (DomainHandle != NULL)
+        SamCloseHandle(DomainHandle);
 
-    HeapFree(GetProcessHeap(), 0, su);
+    if (ServerHandle != NULL)
+        SamCloseHandle(ServerHandle);
 
-    return status;
+    return ApiStatus;
 }
 
 
@@ -599,7 +793,7 @@ NetUserEnum(LPCWSTR servername,
 
         EnumContext->EnumerationContext = 0;
         EnumContext->Buffer = NULL;
-        EnumContext->Returned = 0;
+        EnumContext->Count = 0;
         EnumContext->Index = 0;
         EnumContext->BuiltinDone = FALSE;
 
@@ -639,9 +833,9 @@ NetUserEnum(LPCWSTR servername,
 //    while (TRUE)
 //    {
         TRACE("EnumContext->Index: %lu\n", EnumContext->Index);
-        TRACE("EnumContext->Returned: %lu\n", EnumContext->Returned);
+        TRACE("EnumContext->Count: %lu\n", EnumContext->Count);
 
-        if (EnumContext->Index >= EnumContext->Returned)
+        if (EnumContext->Index >= EnumContext->Count)
         {
 //            if (EnumContext->BuiltinDone == TRUE)
 //            {
@@ -655,7 +849,7 @@ NetUserEnum(LPCWSTR servername,
                                                0,
                                                (PVOID *)&EnumContext->Buffer,
                                                prefmaxlen,
-                                               &EnumContext->Returned);
+                                               &EnumContext->Count);
 
             TRACE("SamEnumerateUsersInDomain returned (Status %08lx)\n", Status);
             if (!NT_SUCCESS(Status))
@@ -677,7 +871,7 @@ NetUserEnum(LPCWSTR servername,
         }
 
         TRACE("EnumContext: %lu\n", EnumContext);
-        TRACE("EnumContext->Returned: %lu\n", EnumContext->Returned);
+        TRACE("EnumContext->Count: %lu\n", EnumContext->Count);
         TRACE("EnumContext->Buffer: %p\n", EnumContext->Buffer);
 
         /* Get a pointer to the current user */
@@ -731,11 +925,11 @@ NetUserEnum(LPCWSTR servername,
 //    }
 
 done:
-    if (ApiStatus == NERR_Success && EnumContext->Index < EnumContext->Returned)
+    if (ApiStatus == NERR_Success && EnumContext->Index < EnumContext->Count)
         ApiStatus = ERROR_MORE_DATA;
 
     if (EnumContext != NULL)
-        *totalentries = EnumContext->Returned;
+        *totalentries = EnumContext->Count;
 
     if (resume_handle == NULL || ApiStatus != ERROR_MORE_DATA)
     {
@@ -752,7 +946,7 @@ done:
 
             if (EnumContext->Buffer != NULL)
             {
-                for (i = 0; i < EnumContext->Returned; i++)
+                for (i = 0; i < EnumContext->Count; i++)
                 {
                     SamFreeMemory(EnumContext->Buffer[i].Name.Buffer);
                 }
@@ -955,53 +1149,298 @@ NetUserGetLocalGroups(LPCWSTR servername,
                       LPDWORD entriesread,
                       LPDWORD totalentries)
 {
-    NET_API_STATUS status;
-    const WCHAR admins[] = {'A','d','m','i','n','i','s','t','r','a','t','o','r','s',0};
-    LPWSTR currentuser;
-    LOCALGROUP_USERS_INFO_0* info;
-    DWORD size;
+    UNICODE_STRING ServerName;
+    UNICODE_STRING UserName;
+    SAM_HANDLE ServerHandle = NULL;
+    SAM_HANDLE BuiltinDomainHandle = NULL;
+    SAM_HANDLE AccountDomainHandle = NULL;
+    PSID AccountDomainSid = NULL;
+    PSID UserSid = NULL;
+    PULONG RelativeIds = NULL;
+    PSID_NAME_USE Use = NULL;
+    ULONG BuiltinMemberCount = 0;
+    ULONG AccountMemberCount = 0;
+    PULONG BuiltinAliases = NULL;
+    PULONG AccountAliases = NULL;
+    PUNICODE_STRING BuiltinNames = NULL;
+    PUNICODE_STRING AccountNames = NULL;
+    PLOCALGROUP_USERS_INFO_0 Buffer = NULL;
+    ULONG Size;
+    ULONG Count = 0;
+    ULONG Index;
+    ULONG i;
+    LPWSTR StrPtr;
+    NET_API_STATUS ApiStatus = NERR_Success;
+    NTSTATUS Status = STATUS_SUCCESS;
 
-    FIXME("(%s, %s, %d, %08x, %p %d, %p, %p) stub!\n",
+    TRACE("(%s, %s, %d, %08x, %p %d, %p, %p) stub!\n",
           debugstr_w(servername), debugstr_w(username), level, flags, bufptr,
           prefmaxlen, entriesread, totalentries);
 
-    status = NETAPI_ValidateServername(servername);
-    if (status != NERR_Success)
-        return status;
+    if (level != 0)
+        return ERROR_INVALID_LEVEL;
 
-    size = UNLEN + 1;
-    NetApiBufferAllocate(size * sizeof(WCHAR), (LPVOID*)&currentuser);
-    GetUserNameW(currentuser, &size);
+    if (flags & ~LG_INCLUDE_INDIRECT)
+        return ERROR_INVALID_PARAMETER;
 
-    if (lstrcmpiW(username, currentuser) && NETAPI_FindUser(username))
+    if (flags & LG_INCLUDE_INDIRECT)
     {
-        NetApiBufferFree(currentuser);
-        return NERR_UserNotFound;
+        WARN("The flag LG_INCLUDE_INDIRECT is not supported yet!\n");
     }
 
-    NetApiBufferFree(currentuser);
-    *totalentries = 1;
-    size = sizeof(*info) + sizeof(admins);
+    if (servername != NULL)
+        RtlInitUnicodeString(&ServerName, servername);
 
-    if(prefmaxlen < size)
-        status = ERROR_MORE_DATA;
-    else
-        status = NetApiBufferAllocate(size, (LPVOID*)&info);
+    RtlInitUnicodeString(&UserName, username);
 
-    if(status != NERR_Success)
+    /* Connect to the SAM Server */
+    Status = SamConnect((servername != NULL) ? &ServerName : NULL,
+                        &ServerHandle,
+                        SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN,
+                        NULL);
+    if (!NT_SUCCESS(Status))
     {
-        *bufptr = NULL;
-        *entriesread = 0;
-        return status;
+        ERR("SamConnect failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
     }
 
-    info->lgrui0_name = (LPWSTR)((LPBYTE)info + sizeof(*info));
-    lstrcpyW(info->lgrui0_name, admins);
+    /* Open the Builtin Domain */
+    Status = OpenBuiltinDomain(ServerHandle,
+                               DOMAIN_LOOKUP | DOMAIN_GET_ALIAS_MEMBERSHIP,
+                               &BuiltinDomainHandle);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("OpenBuiltinDomain failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
 
-    *bufptr = (LPBYTE)info;
-    *entriesread = 1;
+    /* Get the Account Domain SID */
+    Status = GetAccountDomainSid((servername != NULL) ? &ServerName : NULL,
+                                 &AccountDomainSid);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("GetAccountDomainSid failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
 
-    return NERR_Success;
+    /* Open the Account Domain */
+    Status = SamOpenDomain(ServerHandle,
+                           DOMAIN_LOOKUP | DOMAIN_GET_ALIAS_MEMBERSHIP,
+                           AccountDomainSid,
+                           &AccountDomainHandle);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("OpenAccountDomain failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
+
+    /* Get the RID for the given user name */
+    Status = SamLookupNamesInDomain(AccountDomainHandle,
+                                    1,
+                                    &UserName,
+                                    &RelativeIds,
+                                    &Use);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("SamLookupNamesInDomain failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
+
+    /* Fail, if it is not a user account */
+    if (Use[0] != SidTypeUser)
+    {
+        ERR("Account is not a User!\n");
+        ApiStatus = NERR_UserNotFound;
+        goto done;
+    }
+
+    /* Build the User SID from the Account Domain SID and the users RID */
+    UserSid = CreateSidFromSidAndRid(AccountDomainSid,
+                                     RelativeIds[0]);
+    if (UserSid == NULL)
+    {
+        ERR("CreateSidFromSidAndRid failed!\n");
+        ApiStatus = ERROR_NOT_ENOUGH_MEMORY;
+        goto done;
+    }
+
+    /* Get alias memberships in the Builtin Domain */
+    Status = SamGetAliasMembership(BuiltinDomainHandle,
+                                   1,
+                                   &UserSid,
+                                   &BuiltinMemberCount,
+                                   &BuiltinAliases);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("SamGetAliasMembership failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
+
+    if (BuiltinMemberCount > 0)
+    {
+        /* Get the Names of the builtin alias members */
+        Status = SamLookupIdsInDomain(BuiltinDomainHandle,
+                                      BuiltinMemberCount,
+                                      BuiltinAliases,
+                                      &BuiltinNames,
+                                      NULL);
+        if (!NT_SUCCESS(Status))
+        {
+            ERR("SamLookupIdsInDomain failed (Status %08lx)\n", Status);
+            ApiStatus = NetpNtStatusToApiStatus(Status);
+            goto done;
+        }
+    }
+
+    /* Get alias memberships in the Account Domain */
+    Status = SamGetAliasMembership(AccountDomainHandle,
+                                   1,
+                                   &UserSid,
+                                   &AccountMemberCount,
+                                   &AccountAliases);
+    if (!NT_SUCCESS(Status))
+    {
+        ERR("SamGetAliasMembership failed (Status %08lx)\n", Status);
+        ApiStatus = NetpNtStatusToApiStatus(Status);
+        goto done;
+    }
+
+    if (AccountMemberCount > 0)
+    {
+        /* Get the Names of the builtin alias members */
+        Status = SamLookupIdsInDomain(AccountDomainHandle,
+                                      AccountMemberCount,
+                                      AccountAliases,
+                                      &AccountNames,
+                                      NULL);
+        if (!NT_SUCCESS(Status))
+        {
+            ERR("SamLookupIdsInDomain failed (Status %08lx)\n", Status);
+            ApiStatus = NetpNtStatusToApiStatus(Status);
+            goto done;
+        }
+    }
+
+    /* Calculate the required buffer size */
+    Size = 0;
+
+    for (i = 0; i < BuiltinMemberCount; i++)
+    {
+        if (BuiltinNames[i].Length > 0)
+        {
+            Size += (sizeof(LOCALGROUP_USERS_INFO_0) + BuiltinNames[i].Length + sizeof(UNICODE_NULL));
+            Count++;
+        }
+    }
+
+    for (i = 0; i < AccountMemberCount; i++)
+    {
+        if (BuiltinNames[i].Length > 0)
+        {
+            Size += (sizeof(LOCALGROUP_USERS_INFO_0) + AccountNames[i].Length + sizeof(UNICODE_NULL));
+            Count++;
+        }
+    }
+
+    if (Size == 0)
+    {
+        ApiStatus = NERR_Success;
+        goto done;
+    }
+
+    /* Allocate buffer */
+    ApiStatus = NetApiBufferAllocate(Size, (LPVOID*)&Buffer);
+    if (ApiStatus != NERR_Success)
+        goto done;
+
+    ZeroMemory(Buffer, Size);
+
+    StrPtr = (LPWSTR)((INT_PTR)Buffer + Count * sizeof(LOCALGROUP_USERS_INFO_0));
+
+    /* Copy data to the allocated buffer */
+    Index = 0;
+    for (i = 0; i < BuiltinMemberCount; i++)
+    {
+        if (BuiltinNames[i].Length > 0)
+        {
+            CopyMemory(StrPtr,
+                       BuiltinNames[i].Buffer,
+                       BuiltinNames[i].Length);
+            Buffer[Index].lgrui0_name = StrPtr;
+
+            StrPtr = (LPWSTR)((INT_PTR)StrPtr + BuiltinNames[i].Length + sizeof(UNICODE_NULL));
+            Index++;
+        }
+    }
+
+    for (i = 0; i < AccountMemberCount; i++)
+    {
+        if (AccountNames[i].Length > 0)
+        {
+            CopyMemory(StrPtr,
+                       AccountNames[i].Buffer,
+                       AccountNames[i].Length);
+            Buffer[Index].lgrui0_name = StrPtr;
+
+            StrPtr = (LPWSTR)((INT_PTR)StrPtr + AccountNames[i].Length + sizeof(UNICODE_NULL));
+            Index++;
+        }
+    }
+
+done:
+    if (AccountNames != NULL)
+        SamFreeMemory(AccountNames);
+
+    if (BuiltinNames != NULL)
+        SamFreeMemory(BuiltinNames);
+
+    if (AccountAliases != NULL)
+        SamFreeMemory(AccountAliases);
+
+    if (BuiltinAliases != NULL)
+        SamFreeMemory(BuiltinAliases);
+
+    if (RelativeIds != NULL)
+        SamFreeMemory(RelativeIds);
+
+    if (Use != NULL)
+        SamFreeMemory(Use);
+
+    if (UserSid != NULL)
+        RtlFreeHeap(RtlGetProcessHeap(), 0, UserSid);
+
+    if (AccountDomainSid != NULL)
+        RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid);
+
+    if (AccountDomainHandle != NULL)
+        SamCloseHandle(AccountDomainHandle);
+
+    if (BuiltinDomainHandle != NULL)
+        SamCloseHandle(BuiltinDomainHandle);
+
+    if (ServerHandle != NULL)
+        SamCloseHandle(ServerHandle);
+
+    if (ApiStatus != NERR_Success && ApiStatus != ERROR_MORE_DATA)
+    {
+        *entriesread = 0;
+        *totalentries = 0;
+    }
+    else
+    {
+        *entriesread = Count;
+        *totalentries = Count;
+    }
+
+    *bufptr = (LPBYTE)Buffer;
+
+    return ApiStatus;
 }
 
 
index 000fa18..1b28ba3 100644 (file)
@@ -212,7 +212,7 @@ SamCloseHandle(IN SAM_HANDLE SamHandle)
 
 NTSTATUS
 NTAPI
-SamConnect(IN OUT PUNICODE_STRING ServerName,
+SamConnect(IN OUT PUNICODE_STRING ServerName OPTIONAL,
            OUT PSAM_HANDLE ServerHandle,
            IN ACCESS_MASK DesiredAccess,
            IN POBJECT_ATTRIBUTES ObjectAttributes)
@@ -682,7 +682,7 @@ SamGetAliasMembership(IN SAM_HANDLE DomainHandle,
     SAMPR_ULONG_ARRAY Membership;
     NTSTATUS Status;
 
-    TRACE("SamAliasMembership(%p %ul %p %p %p)\n",
+    TRACE("SamAliasMembership(%p %lu %p %p %p)\n",
           DomainHandle, PassedCount, Sids, MembershipCount, Aliases);
 
     if (Sids == NULL ||
@@ -905,7 +905,7 @@ SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
                      IN ULONG Count,
                      IN PULONG RelativeIds,
                      OUT PUNICODE_STRING *Names,
-                     OUT PSID_NAME_USE *Use)
+                     OUT PSID_NAME_USE *Use OPTIONAL)
 {
     SAMPR_RETURNED_USTRING_ARRAY NamesBuffer = {0, NULL};
     SAMPR_ULONG_ARRAY UseBuffer = {0, NULL};
@@ -916,7 +916,9 @@ SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
           DomainHandle, Count, RelativeIds, Names, Use);
 
     *Names = NULL;
-    *Use = NULL;
+
+    if (Use != NULL)
+        *Use = NULL;
 
     RpcTryExcept
     {
@@ -951,13 +953,6 @@ SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
             }
         }
 
-        *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
-        if (*Use == NULL)
-        {
-            Status = STATUS_INSUFFICIENT_RESOURCES;
-            goto done;
-        }
-
         for (i = 0; i < Count; i++)
         {
             (*Names)[i].Length = NamesBuffer.Element[i].Length;
@@ -968,9 +963,19 @@ SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
                           NamesBuffer.Element[i].Length);
         }
 
-        RtlCopyMemory(*Use,
-                      UseBuffer.Element,
-                      Count * sizeof(SID_NAME_USE));
+        if (Use != NULL)
+        {
+            *Use = midl_user_allocate(Count * sizeof(SID_NAME_USE));
+            if (*Use == NULL)
+            {
+                Status = STATUS_INSUFFICIENT_RESOURCES;
+                goto done;
+            }
+
+            RtlCopyMemory(*Use,
+                          UseBuffer.Element,
+                          Count * sizeof(SID_NAME_USE));
+        }
     }
 
 done:
@@ -987,7 +992,7 @@ done:
             midl_user_free(*Names);
         }
 
-        if (*Use != NULL)
+        if (Use != NULL && *Use != NULL)
             midl_user_free(*Use);
     }
 
@@ -1659,8 +1664,21 @@ NTSTATUS
 NTAPI
 SamShutdownSamServer(IN SAM_HANDLE ServerHandle)
 {
-    UNIMPLEMENTED;
-    return STATUS_NOT_IMPLEMENTED;
+    NTSTATUS Status;
+
+    TRACE("(%p)\n", ServerHandle);
+
+    RpcTryExcept
+    {
+        Status = SamrShutdownSamServer((SAMPR_HANDLE)ServerHandle);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        Status = I_RpcMapWin32Status(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
+    return Status;
 }
 
 /* EOF */
index edb6dc2..ebc6020 100644 (file)
@@ -17,6 +17,46 @@ WINE_DEFAULT_DEBUG_CHANNEL(samsrv);
 
 static SID_IDENTIFIER_AUTHORITY NtSidAuthority = {SECURITY_NT_AUTHORITY};
 
+static GENERIC_MAPPING ServerMapping =
+{
+    SAM_SERVER_READ,
+    SAM_SERVER_WRITE,
+    SAM_SERVER_EXECUTE,
+    SAM_SERVER_ALL_ACCESS
+};
+
+static GENERIC_MAPPING DomainMapping =
+{
+    DOMAIN_READ,
+    DOMAIN_WRITE,
+    DOMAIN_EXECUTE,
+    DOMAIN_ALL_ACCESS
+};
+
+static GENERIC_MAPPING AliasMapping =
+{
+    ALIAS_READ,
+    ALIAS_WRITE,
+    ALIAS_EXECUTE,
+    ALIAS_ALL_ACCESS
+};
+
+static GENERIC_MAPPING GroupMapping =
+{
+    GROUP_READ,
+    GROUP_WRITE,
+    GROUP_EXECUTE,
+    GROUP_ALL_ACCESS
+};
+
+static GENERIC_MAPPING UserMapping =
+{
+    USER_READ,
+    USER_WRITE,
+    USER_EXECUTE,
+    USER_ALL_ACCESS
+};
+
 
 /* FUNCTIONS *****************************************************************/
 
@@ -68,10 +108,12 @@ void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
     HeapFree(GetProcessHeap(), 0, ptr);
 }
 
+
 void __RPC_USER SAMPR_HANDLE_rundown(SAMPR_HANDLE hHandle)
 {
 }
 
+
 /* Function 0 */
 NTSTATUS
 NTAPI
@@ -85,6 +127,11 @@ SamrConnect(IN PSAMPR_SERVER_NAME ServerName,
     TRACE("SamrConnect(%p %p %lx)\n",
           ServerName, ServerHandle, DesiredAccess);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &ServerMapping);
+
+    /* Open the Server Object */
     Status = SampOpenDbObject(NULL,
                               NULL,
                               L"SAM",
@@ -100,6 +147,7 @@ SamrConnect(IN PSAMPR_SERVER_NAME ServerName,
     return Status;
 }
 
+
 /* Function 1 */
 NTSTATUS
 NTAPI
@@ -125,6 +173,7 @@ SamrCloseHandle(IN OUT SAMPR_HANDLE *SamHandle)
     return Status;
 }
 
+
 /* Function 2 */
 NTSTATUS
 NTAPI
@@ -136,6 +185,7 @@ SamrSetSecurityObject(IN SAMPR_HANDLE ObjectHandle,
     return STATUS_NOT_IMPLEMENTED;
 }
 
+
 /* Function 3 */
 NTSTATUS
 NTAPI
@@ -147,6 +197,7 @@ SamrQuerySecurityObject(IN SAMPR_HANDLE ObjectHandle,
     return STATUS_NOT_IMPLEMENTED;
 }
 
+
 /* Function 4 */
 NTSTATUS
 NTAPI
@@ -486,6 +537,10 @@ SamrOpenDomain(IN SAMPR_HANDLE ServerHandle,
     TRACE("SamrOpenDomain(%p %lx %p %p)\n",
           ServerHandle, DesiredAccess, DomainId, DomainHandle);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &DomainMapping);
+
     /* Validate the server handle */
     Status = SampValidateDbObject(ServerHandle,
                                   SamDbServerObject,
@@ -1653,6 +1708,10 @@ SamrCreateGroupInDomain(IN SAMPR_HANDLE DomainHandle,
     TRACE("SamrCreateGroupInDomain(%p %p %lx %p %p)\n",
           DomainHandle, Name, DesiredAccess, GroupHandle, RelativeId);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &GroupMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -2019,6 +2078,10 @@ SamrCreateUserInDomain(IN SAMPR_HANDLE DomainHandle,
         RelativeId == NULL)
         return STATUS_INVALID_PARAMETER;
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &UserMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -2473,6 +2536,10 @@ SamrCreateAliasInDomain(IN SAMPR_HANDLE DomainHandle,
     TRACE("SamrCreateAliasInDomain(%p %p %lx %p %p)\n",
           DomainHandle, AccountName, DesiredAccess, AliasHandle, RelativeId);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &AliasMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -2810,6 +2877,7 @@ SamrGetAliasMembership(IN SAMPR_HANDLE DomainHandle,
     ULONG DataLength;
     ULONG i, j;
     NTSTATUS Status;
+    WCHAR NameBuffer[9];
 
     TRACE("SamrGetAliasMembership(%p %p %p)\n",
           DomainHandle, SidArray, Membership);
@@ -2817,7 +2885,7 @@ SamrGetAliasMembership(IN SAMPR_HANDLE DomainHandle,
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
-                                  DOMAIN_LOOKUP,
+                                  DOMAIN_GET_ALIAS_MEMBERSHIP,
                                   &DomainObject);
     if (!NT_SUCCESS(Status))
         return Status;
@@ -2835,6 +2903,13 @@ SamrGetAliasMembership(IN SAMPR_HANDLE DomainHandle,
                             KEY_READ,
                             &MembersKeyHandle);
     TRACE("SampRegOpenKey returned %08lX\n", Status);
+
+    if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
+    {
+        Status = STATUS_SUCCESS;
+        goto done;
+    }
+
     if (!NT_SUCCESS(Status))
         goto done;
 
@@ -2859,13 +2934,21 @@ TRACE("Open %S\n", MemberSidString);
                 MaxSidCount += ValueCount;
             }
 
-
             NtClose(MemberKeyHandle);
         }
 
+        if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
+            Status = STATUS_SUCCESS;
+
         LocalFree(MemberSidString);
     }
 
+    if (MaxSidCount == 0)
+    {
+        Status = STATUS_SUCCESS;
+        goto done;
+    }
+
     TRACE("Maximum sid count: %lu\n", MaxSidCount);
     RidArray = midl_user_allocate(MaxSidCount * sizeof(ULONG));
     if (RidArray == NULL)
@@ -2895,14 +2978,18 @@ TRACE("Open %S\n", MemberSidString);
 
                 for (j = 0; j < ValueCount; j++)
                 {
-                    DataLength = sizeof(ULONG);
+                    DataLength = 9 * sizeof(WCHAR);
                     Status = SampRegEnumerateValue(MemberKeyHandle,
                                                    j,
-                      NULL,
-                      NULL,
-                      NULL,
-                      (PVOID)&RidArray[j],
-                      &DataLength);
+                                                   NameBuffer,
+                                                   &DataLength,
+                                                   NULL,
+                                                   NULL,
+                                                   NULL);
+                    if (NT_SUCCESS(Status))
+                    {
+                        RidArray[j] = wcstoul(NameBuffer, NULL, 16);
+                    }
                 }
             }
 
@@ -2912,7 +2999,6 @@ TRACE("Open %S\n", MemberSidString);
         LocalFree(MemberSidString);
     }
 
-
 done:
     if (NT_SUCCESS(Status))
     {
@@ -3452,6 +3538,10 @@ SamrOpenGroup(IN SAMPR_HANDLE DomainHandle,
     TRACE("SamrOpenGroup(%p %lx %lx %p)\n",
           DomainHandle, DesiredAccess, GroupId, GroupHandle);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &GroupMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -3900,6 +3990,10 @@ SamrOpenAlias(IN SAMPR_HANDLE DomainHandle,
     TRACE("SamrOpenAlias(%p %lx %lx %p)\n",
           DomainHandle, DesiredAccess, AliasId, AliasHandle);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &AliasMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -4565,6 +4659,10 @@ SamrOpenUser(IN SAMPR_HANDLE DomainHandle,
     TRACE("SamrOpenUser(%p %lx %lx %p)\n",
           DomainHandle, DesiredAccess, UserId, UserHandle);
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &UserMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -5903,6 +6001,181 @@ done:
 }
 
 
+static NTSTATUS
+SampSetUserAll(PSAM_DB_OBJECT UserObject,
+               PSAMPR_USER_INFO_BUFFER Buffer)
+{
+    SAM_USER_FIXED_DATA FixedData;
+    ULONG Length = 0;
+    ULONG WhichFields;
+    NTSTATUS Status = STATUS_SUCCESS;
+
+    WhichFields = Buffer->All.WhichFields;
+
+    if (WhichFields & USER_ALL_USERNAME)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"Name",
+                                        REG_SZ,
+                                        Buffer->All.UserName.Buffer,
+                                        Buffer->All.UserName.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_FULLNAME)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"FullName",
+                                        REG_SZ,
+                                        Buffer->All.FullName.Buffer,
+                                        Buffer->All.FullName.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_ADMINCOMMENT)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"AdminComment",
+                                        REG_SZ,
+                                        Buffer->All.AdminComment.Buffer,
+                                        Buffer->All.AdminComment.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_USERCOMMENT)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"UserComment",
+                                        REG_SZ,
+                                        Buffer->All.UserComment.Buffer,
+                                        Buffer->All.UserComment.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_HOMEDIRECTORY)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"HomeDirectory",
+                                        REG_SZ,
+                                        Buffer->All.HomeDirectory.Buffer,
+                                        Buffer->All.HomeDirectory.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_HOMEDIRECTORYDRIVE)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"HomeDirectoryDrive",
+                                        REG_SZ,
+                                        Buffer->All.HomeDirectoryDrive.Buffer,
+                                        Buffer->All.HomeDirectoryDrive.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_SCRIPTPATH)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"ScriptPath",
+                                        REG_SZ,
+                                        Buffer->All.ScriptPath.Buffer,
+                                        Buffer->All.ScriptPath.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_PROFILEPATH)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"ProfilePath",
+                                        REG_SZ,
+                                        Buffer->All.ProfilePath.Buffer,
+                                        Buffer->All.ProfilePath.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_WORKSTATIONS)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"WorkStations",
+                                        REG_SZ,
+                                        Buffer->All.WorkStations.Buffer,
+                                        Buffer->All.WorkStations.MaximumLength);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+    if (WhichFields & USER_ALL_PARAMETERS)
+    {
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"Parameters",
+                                        REG_SZ,
+                                        Buffer->All.Parameters.Buffer,
+                                        Buffer->All.Parameters.MaximumLength);
+    }
+
+    if (WhichFields & (USER_ALL_PRIMARYGROUPID |
+                       USER_ALL_ACCOUNTEXPIRES |
+                       USER_ALL_USERACCOUNTCONTROL |
+                       USER_ALL_COUNTRYCODE |
+                       USER_ALL_CODEPAGE))
+    {
+        Length = sizeof(SAM_USER_FIXED_DATA);
+        Status = SampGetObjectAttribute(UserObject,
+                                        L"F",
+                                        NULL,
+                                        (PVOID)&FixedData,
+                                        &Length);
+        if (!NT_SUCCESS(Status))
+            goto done;
+
+        if (WhichFields & USER_ALL_PRIMARYGROUPID)
+            FixedData.PrimaryGroupId = Buffer->All.PrimaryGroupId;
+
+        if (WhichFields & USER_ALL_ACCOUNTEXPIRES)
+        {
+            FixedData.AccountExpires.LowPart = Buffer->All.AccountExpires.LowPart;
+            FixedData.AccountExpires.HighPart = Buffer->All.AccountExpires.HighPart;
+        }
+
+        if (WhichFields & USER_ALL_USERACCOUNTCONTROL)
+            FixedData.UserAccountControl = Buffer->All.UserAccountControl;
+
+        if (WhichFields & USER_ALL_COUNTRYCODE)
+            FixedData.CountryCode = Buffer->Preferences.CountryCode;
+
+        if (WhichFields & USER_ALL_CODEPAGE)
+            FixedData.CodePage = Buffer->Preferences.CodePage;
+
+        Status = SampSetObjectAttribute(UserObject,
+                                        L"F",
+                                        REG_BINARY,
+                                        &FixedData,
+                                        Length);
+        if (!NT_SUCCESS(Status))
+            goto done;
+    }
+
+/*
+FIXME:
+    USER_ALL_LOGONHOURS
+    USER_ALL_NTPASSWORDPRESENT
+    USER_ALL_LMPASSWORDPRESENT
+    USER_ALL_PASSWORDEXPIRED
+*/
+
+done:
+
+    return Status;
+}
+
+
 /* Function 37 */
 NTSTATUS
 NTAPI
@@ -5931,6 +6204,7 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
         case UserWorkStationsInformation:
         case UserControlInformation:
         case UserExpiresInformation:
+        case UserParametersInformation:
             DesiredAccess = USER_WRITE_ACCOUNT;
             break;
 
@@ -5947,6 +6221,10 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
             DesiredAccess = USER_FORCE_PASSWORD_CHANGE;
             break;
 
+        case UserAllInformation:
+            DesiredAccess = 0; /* FIXME */
+            break;
+
         default:
             return STATUS_INVALID_INFO_CLASS;
     }
@@ -6086,8 +6364,20 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
             break;
 
 //        case UserInternal1Information:
-//        case UserParametersInformation:
-//        case UserAllInformation:
+
+        case UserParametersInformation:
+            Status = SampSetObjectAttribute(UserObject,
+                                            L"Parameters",
+                                            REG_SZ,
+                                            Buffer->Parameters.Parameters.Buffer,
+                                            Buffer->Parameters.Parameters.MaximumLength);
+            break;
+
+        case UserAllInformation:
+            Status = SampSetUserAll(UserObject,
+                                    Buffer);
+            break;
+
 //        case UserInternal4Information:
 //        case UserInternal5Information:
 //        case UserInternal4InformationNew:
@@ -6100,6 +6390,7 @@ SamrSetInformationUser(IN SAMPR_HANDLE UserHandle,
     return Status;
 }
 
+
 /* Function 38 */
 NTSTATUS
 NTAPI
@@ -6285,6 +6576,10 @@ SamrCreateUser2InDomain(IN SAMPR_HANDLE DomainHandle,
         AccountType != USER_TEMP_DUPLICATE_ACCOUNT)
         return STATUS_INVALID_PARAMETER;
 
+    /* Map generic access rights */
+    RtlMapGenericMask(&DesiredAccess,
+                      &UserMapping);
+
     /* Validate the domain handle */
     Status = SampValidateDbObject(DomainHandle,
                                   SamDbDomainObject,
@@ -6639,6 +6934,7 @@ SamrConnect2(IN PSAMPR_SERVER_NAME ServerName,
     return STATUS_NOT_IMPLEMENTED;
 }
 
+
 /* Function 58 */
 NTSTATUS
 NTAPI
@@ -6646,10 +6942,14 @@ SamrSetInformationUser2(IN SAMPR_HANDLE UserHandle,
                         IN USER_INFORMATION_CLASS UserInformationClass,
                         IN PSAMPR_USER_INFO_BUFFER Buffer)
 {
-    UNIMPLEMENTED;
-    return STATUS_NOT_IMPLEMENTED;
+    TRACE("(%p %lu %p)\n", UserHandle, UserInformationClass, Buffer);
+
+    return SamrSetInformationUser(UserHandle,
+                                  UserInformationClass,
+                                  Buffer);
 }
 
+
 /* Function 59 */
 NTSTATUS
 NTAPI
index 64aa994..cb0d71d 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 889dd8e..adf5650 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index efff2da..f186042 100644 (file)
@@ -143,7 +143,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index b58f408..9b87bcc 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index c2b8f9f..f86c4a7 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 767bc3a..2348a28 100644 (file)
@@ -159,7 +159,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Exécuter"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index e971fc5..52aa059 100644 (file)
@@ -158,7 +158,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index c1febfb..efb90e4 100644 (file)
@@ -156,7 +156,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index dd17a72..264fc37 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 9, "MS UI Gothic"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 0dfe874..f61e3db 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 1013a6b..eebea39 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index b4cd60e..c84de91 100644 (file)
@@ -163,7 +163,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 35d5098..d0a6a79 100644 (file)
@@ -158,7 +158,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index f3691d5..0898ee7 100644 (file)
@@ -158,7 +158,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 7e4fbfe..86bafaf 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 8a0cd0a..9d38327 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 9f502fd..f7ec76d 100644 (file)
@@ -155,7 +155,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 0082df8..9885eff 100644 (file)
@@ -146,7 +146,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 54bd301..2944d51 100644 (file)
@@ -145,7 +145,7 @@ END
 
 IDD_RUN DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 227, 95
 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION ""
+CAPTION "Run"
 FONT 8, "MS Shell Dlg"
 BEGIN
     ICON "", 12297, 7, 11, 18, 20, WS_VISIBLE
index 589ec73..e8324b5 100644 (file)
@@ -1,4 +1,3 @@
-# Functions exported by the WinXP SP3 shell32.dll (6.0.2900.5686)
 2   stdcall SHChangeNotifyRegister(long long long long long ptr)
 3   stdcall SHDefExtractIconA(str long long ptr ptr long)
 4   stdcall SHChangeNotifyDeregister(long)
@@ -27,7 +26,7 @@
 27  stdcall ILSaveToStream(ptr ptr)
 28  stdcall SHILCreateFromPath(ptr ptr ptr) SHILCreateFromPathAW
 29  stdcall -noname PathIsRoot(ptr) PathIsRootAW
-30  stdcall -noname PathBuildRoot(ptr long) PathBuildRootAW
+30  stdcall -noname PathBuildRoot(ptr long) PathBuildRootAW # FIXME: should be PathBuildRootW
 31  stdcall -noname PathFindExtension(wstr) PathFindExtensionW
 32  stdcall -noname PathAddBackslash(wstr) PathAddBackslashW
 33  stdcall -noname PathRemoveBlanks(wstr) PathRemoveBlanksW
@@ -41,7 +40,6 @@
 41  stdcall IsLFNDriveA(str)
 42  stdcall IsLFNDriveW(wstr)
 43  stdcall PathIsExe(ptr) PathIsExeAW
-44  stdcall OpenAs_RunDLL(long long str long) OpenAs_RunDLLA
 45  stdcall -noname PathFileExists(ptr) PathFileExistsAW # Fixme
 46  stdcall -noname PathMatchSpec(wstr wstr) PathMatchSpecW
 47  stdcall PathMakeUniqueName(ptr long ptr ptr ptr) PathMakeUniqueNameAW
@@ -50,7 +48,7 @@
 50  stdcall -noname PathStripToRoot(wstr) PathStripToRootW
 51  stdcall PathResolve(str long long) PathResolveAW
 52  stdcall -noname PathGetArgs(wstr) PathGetArgsW
-53  stdcall -noname IsSuspendAllowed()
+53  stdcall -noname IsSuspendAllowed() # FIXME: Wine says DoEnvironmentSubst
 54  stdcall -noname LogoffWindowsDialog(ptr)
 55  stdcall -noname PathQuoteSpaces(wstr) PathQuoteSpacesW
 56  stdcall -noname PathUnquoteSpaces(wstr) PathUnquoteSpacesW
 68  stdcall SHGetSetSettings(ptr long long)
 69  stdcall -noname SHGetNetResource(ptr long ptr long)
 70  stdcall -noname SHCreateDefClassObject(long long long long long)
-71  stdcall -noname Shell_GetImageLists(ptr ptr)
+71  stdcall Shell_GetImageLists(ptr ptr)
 72  stdcall Shell_GetCachedImageIndex(ptr ptr long) Shell_GetCachedImageIndexAW
 73  stdcall SHShellFolderView_Message(long long long)
 74  stdcall SHCreateStdEnumFmtEtc(long ptr ptr)
 75  stdcall PathYetAnotherMakeUniqueName(ptr wstr wstr wstr)
-76  stdcall DragQueryInfo(ptr ptr)
+76  stdcall -noname DragQueryInfo(ptr ptr)
 77  stdcall SHMapPIDLToSystemImageListIndex(ptr ptr ptr)
 78  stdcall -noname OleStrToStrN(str long wstr long) OleStrToStrNAW # Fixme
 79  stdcall -noname StrToOleStrN(wstr long str long) StrToOleStrNAW # Fixme
 80  stdcall SHOpenPropSheetW(wstr ptr long ptr ptr ptr wstr)
-81  stdcall OpenAs_RunDLLA(long long str long)
 82  stdcall -noname DDECreatePostNotify(ptr)
 83  stdcall -noname CIDLData_CreateFromIDArray(ptr long ptr ptr)
-84  stdcall SHIsBadInterfacePtr(ptr long) # Fixme
+84  stdcall -noname SHIsBadInterfacePtr(ptr long) # Fixme
 85  stdcall OpenRegStream(long str str long) shlwapi.SHOpenRegStreamA
 86  stdcall -noname SHRegisterDragDrop(long ptr)
 87  stdcall -noname SHRevokeDragDrop(long)
 88  stdcall SHDoDragDrop(long ptr ptr long ptr)
 89  stdcall SHCloneSpecialIDList(long long long)
 90  stdcall SHFindFiles(ptr ptr)
-91  stdcall SHFindComputer(ptr ptr)
+91  stdcall -noname SHFindComputer(ptr ptr)
 92  stdcall PathGetShortPath(ptr) PathGetShortPathAW
 93  stdcall -noname Win32CreateDirectory(wstr ptr) Win32CreateDirectoryW
 94  stdcall -noname Win32RemoveDirectory(wstr) Win32RemoveDirectoryW
 98  stdcall SHGetRealIDL(ptr ptr ptr)
 99  stdcall -noname SetAppStartingCursor(long long) # Fixme
 100 stdcall SHRestricted(long)
-101 stdcall OpenAs_RunDLLW(long long wstr long)
 102 stdcall SHCoCreateInstance(wstr ptr long ptr ptr)
-103 stdcall SignalFileOpen(long)
-104 stdcall Activate_RunDLL(long ptr ptr ptr)
-105 stdcall AppCompat_RunDLLW(ptr ptr wstr long)
-106 stdcall CheckEscapesA(str long)
-107 stdcall CheckEscapesW(wstr long)
-108 stdcall CommandLineToArgvW(wstr ptr)
-109 stdcall Control_FillCache_RunDLL(long long long long) Control_FillCache_RunDLLA
-110 stdcall Control_FillCache_RunDLLA(long long long long)
-111 stdcall Control_FillCache_RunDLLW(long long long long)
-112 stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA
-113 stdcall Control_RunDLLA(ptr ptr str long)
-114 stdcall Control_RunDLLAsUserW(ptr ptr wstr long)
-115 stdcall Control_RunDLLW(ptr ptr wstr long)
-@ stdcall -private DllCanUnloadNow()
-@ stdcall -private DllGetClassObject(ptr ptr ptr)
-118 stdcall DllGetVersion(ptr)
+103 stdcall SignalFileOpen(ptr)
 119 stdcall IsLFNDrive(ptr) IsLFNDriveAW
-@ stdcall -private DllInstall(long wstr)
 121 stdcall SHFlushClipboard()
 122 stdcall -noname RunDLL_CallEntry16(long long long str long) # Fixme #name wrong?
 123 stdcall -noname SHFreeUnusedLibraries()
-@ stdcall -private DllRegisterServer()
-@ stdcall -private DllUnregisterServer()
 126 stdcall -noname SHOutOfMemoryMessageBox(long long long) # Fixme
 127 stdcall -noname SHWinHelp(long long long long)
 128 stdcall -noname SHDllGetClassObject(ptr ptr ptr) DllGetClassObject
 130 stdcall -noname DAD_DragEnter(long)
 131 stdcall DAD_DragEnterEx(long double)
 132 stdcall DAD_DragLeave()
-133 stdcall DoEnvironmentSubstA(str str)
 134 stdcall DAD_DragMove(double)
-135 stdcall DoEnvironmentSubstW(wstr wstr)
 136 stdcall DAD_SetDragImage(long long)
 137 stdcall DAD_ShowDragImage(long)
-138 stdcall DragAcceptFiles(long long)
-139 stdcall DragFinish(long)
-140 stdcall DragQueryFile(long long ptr long) DragQueryFileA
-141 stdcall DragQueryFileA(long long ptr long)
-142 stdcall DragQueryFileAorW(ptr long wstr long long long)
-143 stdcall DragQueryFileW(long long ptr long)
-144 stdcall DragQueryPoint(long ptr)
 145 stdcall -noname PathFindOnPath(wstr wstr) PathFindOnPathW
 146 stdcall -noname RLBuildListOfPaths()
 147 stdcall SHCLSIDFromString(long long) SHCLSIDFromStringAW
 148 stdcall SHMapIDListToImageListIndexAsync(ptr ptr ptr long ptr ptr ptr ptr ptr)
 149 stdcall SHFind_InitMenuPopup(long long long long)
-150 stdcall DuplicateIcon(long long)
 151 stdcall SHLoadOLE(long)
 152 stdcall ILGetSize(ptr)
 153 stdcall ILGetNext(ptr)
 157 stdcall ILCreateFromPath(ptr) ILCreateFromPathAW
 158 stdcall -noname PathGetExtension(wstr long long) SHPathGetExtensionW
 159 stdcall -noname PathIsDirectory(wstr) PathIsDirectoryW
-160 stdcall SHNetConnectionDialog(ptr wstr long) # Fixme
+160 stdcall -noname SHNetConnectionDialog(ptr wstr long) # Fixme
 161 stdcall SHRunControlPanel(long long)
 162 stdcall SHSimpleIDListFromPath(ptr) SHSimpleIDListFromPathAW # Fixme
 163 stdcall -noname StrToOleStr(wstr str) StrToOleStrAW # Fixme
 179 stdcall SHGetNewLinkInfoA(str str ptr long long)
 180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long)
 181 stdcall -noname RegisterShellHook(long long)
-182 varargs ShellMessageBoxA(long long str str long)
-183 varargs ShellMessageBoxW(long long wstr wstr long)
+182 varargs ShellMessageBoxW(long long wstr wstr long)
+183 varargs ShellMessageBoxA(long long str str long)
 184 stdcall -noname ArrangeWindows(long long long long long)
 185 stdcall -noname SHHandleDiskFull(ptr long) # Fixme
 186 stdcall -noname ILGetDisplayNameEx(ptr ptr ptr long)
 196 stdcall SHAlloc(long)
 197 stdcall -noname SHGlobalDefect(long)
 198 stdcall -noname SHAbortInvokeCommand()
-199 stdcall ExtractAssociatedIconA(long str ptr)
+# FIXME: Wine has SHGetFileIcon/SHLocalAlloc/SHLocalFree/SHLocalReAlloc from 199-202
 200 stdcall -noname SHCreateDesktop(ptr)
 201 stdcall -noname SHDesktopMessageLoop(ptr)
 202 stub -noname DDEHandleViewFolderNotify
 203 stdcall -noname AddCommasW(long wstr)
 204 stdcall -noname ShortSizeFormatW(double)
-205 stdcall Printer_LoadIconsW(wstr ptr ptr)
-206 stdcall ExtractAssociatedIconExA(long str long long)
-207 stdcall ExtractAssociatedIconExW(long wstr long long)
-208 stdcall ExtractAssociatedIconW(long wstr ptr)
+205 stdcall -noname Printer_LoadIconsW(wstr ptr ptr)
 209 stdcall -noname Int64ToString(double wstr long long ptr long) # Fixme
 210 stdcall -noname LargeIntegerToString(ptr wstr long long ptr long) # Fixme
 211 stdcall -noname Printers_GetPidl(ptr str) # Fixme
 213 stdcall -noname Printers_RegisterWindowW(wstr long ptr ptr)
 214 stdcall -noname Printers_UnregisterWindow(long long)
 215 stdcall -noname SHStartNetConnectionDialog(long str long)
-216 stdcall ExtractIconA(long str long)
-217 stdcall ExtractIconEx(ptr long ptr ptr long) ExtractIconExA
-218 stdcall ExtractIconExA(str long ptr ptr long)
-219 stdcall ExtractIconExW(wstr long ptr ptr long)
-220 stdcall ExtractIconResInfoA(ptr str long ptr ptr)
-221 stdcall ExtractIconResInfoW(ptr wstr long ptr ptr)
-222 stdcall ExtractIconW(long wstr long)
-223 stdcall ExtractVersionResource16W(wstr ptr)
-224 stdcall FindExeDlgProc(ptr long ptr ptr)
-225 stdcall FindExecutableA(str str ptr)
-226 stdcall FindExecutableW(wstr wstr ptr)
-227 stdcall FreeIconList(long)
-228 stdcall InternalExtractIconListA(ptr str ptr)
-229 stdcall InternalExtractIconListW(ptr wstr ptr)
 230 stdcall -noname FirstUserLogon(wstr wstr)
 231 stdcall -noname SHSetFolderPathA(long ptr long str)
 232 stdcall -noname SHSetFolderPathW(long ptr long wstr)
 235 stdcall -noname SHOpenEffectiveToken(ptr)
 236 stdcall -noname SHTestTokenPrivilegeW(ptr ptr)
 237 stdcall -noname SHShouldShowWizards(ptr)
-238 stdcall Options_RunDLL(ptr ptr str long)
 239 stdcall PathIsSlowW(wstr long)
 240 stdcall PathIsSlowA(str long)
 241 stdcall -noname SHGetUserDisplayName(wstr ptr)
 252 stdcall -noname PathIsURL(wstr) shlwapi.PathIsURLW
 253 stub -noname SHIsCurrentProcessConsoleSession
 254 stub -noname DisconnectWindowsDialog
-255 stdcall Options_RunDLLA(ptr ptr str long)
 256 stdcall SHCreateShellFolderView(ptr ptr)
 257 stdcall -noname SHGetShellFolderViewCB(ptr)
 258 stdcall -noname LinkWindow_RegisterClass()
 259 stdcall -noname LinkWindow_UnregisterClass()
-260 stdcall Options_RunDLLW(ptr ptr wstr long)
-261 stdcall PrintersGetCommand_RunDLL(ptr ptr wstr long)
-262 stdcall PrintersGetCommand_RunDLLA(ptr ptr str long)
-263 stdcall PrintersGetCommand_RunDLLW(ptr ptr wstr long)
-264 stdcall RealShellExecuteA(ptr str str str str str str str long ptr)
-265 stdcall RealShellExecuteExA(ptr str str str str str str str long ptr long)
-266 stdcall RealShellExecuteExW(ptr str str str str str str str long ptr long)
-267 stdcall RealShellExecuteW(ptr wstr wstr wstr wstr wstr wstr wstr long ptr)
-268 stdcall RegenerateUserEnvironment(ptr long)
-269 stdcall SHAddToRecentDocs(long ptr)
-270 stdcall SHAppBarMessage(long ptr)
-271 stdcall SHBindToParent(ptr ptr ptr ptr)
-272 stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
-273 stdcall SHBrowseForFolderA(ptr)
-274 stdcall SHBrowseForFolderW(ptr)
-275 stdcall SHChangeNotify(long long ptr ptr)
-276 stdcall SHChangeNotifySuspendResume(long ptr long long)
-277 stdcall SHCreateDirectoryExA(long str ptr)
-278 stdcall SHCreateDirectoryExW(long wstr ptr)
-279 stub SHCreateLocalServerRunDll
-280 stdcall SHCreateProcessAsUserW(ptr)
-281 stdcall SHCreateQueryCancelAutoPlayMoniker(ptr)
-282 stdcall SHCreateShellItem(ptr ptr ptr ptr)
-283 stdcall SHEmptyRecycleBinA(long str long)
-284 stdcall SHEmptyRecycleBinW(long wstr long)
-285 stub SHEnableServiceObject
-286 stub SHEnumerateUnreadMailAccountsW
-287 stdcall SHExtractIconsW(wstr long long long ptr ptr long long) user32.PrivateExtractIconsW
-288 stdcall SHFileOperation(ptr) SHFileOperationA
-289 stdcall SHFileOperationA(ptr)
-290 stdcall SHFileOperationW(ptr)
-291 stdcall SHFormatDrive(long long long long)
-292 stdcall SHFreeNameMappings(ptr)
-293 stdcall SHGetDataFromIDListA(ptr ptr long ptr long)
-294 stdcall SHGetDataFromIDListW(ptr ptr long ptr long)
-295 stdcall SHGetDesktopFolder(ptr)
-296 stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
-297 stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
-298 stdcall SHGetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW
-299 stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA
-300 stdcall SHGetFileInfoA(ptr long ptr long long)
-301 stdcall SHGetFileInfoW(ptr long ptr long long)
-302 stdcall SHGetFolderLocation(long long long long ptr)
-303 stdcall SHGetFolderPathA(long long long long ptr)
-304 stdcall SHGetFolderPathAndSubDirA(long long long long str ptr)
-305 stdcall SHGetFolderPathAndSubDirW(long long long long wstr ptr)
-306 stdcall SHGetFolderPathW(long long long long ptr)
-307 stdcall SHGetIconOverlayIndexA(str long)
-308 stdcall SHGetIconOverlayIndexW(wstr long)
-309 stdcall SHGetInstanceExplorer(long)
-310 stdcall SHGetMalloc(ptr)
-311 stdcall SHGetNewLinkInfo(str str ptr long long) SHGetNewLinkInfoA
-312 stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListA
-313 stdcall SHGetPathFromIDListA(ptr ptr)
-314 stdcall SHGetPathFromIDListW(ptr ptr)
-315 stdcall SHGetSettings(ptr long)
-316 stdcall SHGetSpecialFolderLocation(long long ptr)
-317 stdcall SHGetSpecialFolderPathA(long ptr long long)
-318 stdcall SHGetSpecialFolderPathW(long ptr long long)
-319 stdcall SHGetUnreadMailCountW (long wstr long ptr wstr long)
-320 stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLLA
-321 stdcall SHHelpShortcuts_RunDLLA(long long long long)
-322 stdcall SHHelpShortcuts_RunDLLW(long long long long)
-323 stdcall SHInvokePrinterCommandA(ptr long str str long)
-324 stdcall SHInvokePrinterCommandW(ptr long wstr wstr long)
-325 stdcall SHIsFileAvailableOffline(wstr ptr)
-326 stdcall SHLoadInProc(long)
-327 stdcall SHLoadNonloadedIconOverlayIdentifiers()
-328 stdcall SHOpenFolderAndSelectItems(ptr long ptr long)
-329 stdcall SHParseDisplayName(wstr ptr ptr long ptr)
-330 stdcall SHPathPrepareForWriteA(long ptr str long)
-331 stdcall SHPathPrepareForWriteW(long ptr wstr long)
-332 stdcall SHQueryRecycleBinA(str ptr)
-333 stdcall SHQueryRecycleBinW(wstr ptr)
-334 stdcall SHSetLocalizedName(wstr wstr long)
-335 stdcall SHSetUnreadMailCountW (wstr long wstr)
-336 stdcall SHUpdateRecycleBinIcon()
-337 stdcall SheChangeDirA(str)
-338 stdcall SheChangeDirExA(str)
-339 stdcall SheChangeDirExW(wstr)
-340 stdcall SheChangeDirW(wstr)
-341 stdcall SheConvertPathW(wstr wstr long)
-342 stdcall SheFullPathA(str long str)
-343 stdcall SheFullPathW(wstr long wstr)
-344 stdcall SheGetCurDrive()
-345 stdcall SheGetDirA(long long)
-346 stdcall SheGetDirExW(wstr ptr wstr)
-347 stdcall SheGetDirW(long long)
-348 stdcall SheGetPathOffsetW(wstr)
-349 stdcall SheRemoveQuotesA(str)
-350 stdcall SheRemoveQuotesW(wstr)
-351 stdcall SheSetCurDrive(long)
-352 stdcall SheShortenPathA(str long)
-353 stdcall SheShortenPathW(wstr long)
-354 stdcall ShellAboutA(long str str long)
-355 stdcall ShellAboutW(long wstr wstr long)
-356 stdcall ShellExec_RunDLL(ptr ptr wstr long)
-357 stdcall ShellExec_RunDLLA(ptr ptr str long)
-358 stdcall ShellExec_RunDLLW(ptr ptr wstr long)
-359 stdcall ShellExecuteA(long str str str str long)
-360 stdcall ShellExecuteEx(long) ShellExecuteExA
-361 stdcall ShellExecuteExA (long)
-362 stdcall ShellExecuteExW (long)
-363 stdcall ShellExecuteW(long wstr wstr wstr wstr long)
-364 stdcall ShellHookProc(long ptr ptr)
-365 stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
-366 stdcall Shell_NotifyIconA(long ptr)
-367 stdcall Shell_NotifyIconW(long ptr)
-368 stdcall StrChrA(str long) shlwapi.StrChrA
-369 stdcall StrChrIA(str long) shlwapi.StrChrIA
-370 stdcall StrChrIW(wstr long) shlwapi.StrChrIW
-371 stdcall StrChrW(wstr long) shlwapi.StrChrW
-372 stdcall StrCmpNA(str str long) shlwapi.StrCmpNA
-373 stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
-374 stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
-375 stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
-376 stdcall StrCpyNA (ptr str long) kernel32.lstrcpynA
-377 stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
-378 stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
-379 stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
-380 stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
-381 stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
-382 stdcall StrNCpyA (ptr str long) kernel32.lstrcpynA
-383 stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
-384 stdcall StrRChrA(str str long) shlwapi.StrRChrA
-385 stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
-386 stdcall StrRChrIW(str str long) shlwapi.StrRChrIW
-387 stdcall StrRChrW(wstr wstr long) shlwapi.StrRChrW
-388 stdcall StrRStrA(str str str)
-389 stdcall StrRStrIA(str str str) shlwapi.StrRStrIA
-390 stdcall StrRStrIW(wstr wstr wstr) shlwapi.StrRStrIW
-391 stdcall StrRStrW(wstr wstr wstr)
-392 stdcall StrStrA(str str) shlwapi.StrStrA
-393 stdcall StrStrIA(str str) shlwapi.StrStrIA
-394 stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
-395 stdcall StrStrW(wstr wstr) shlwapi.StrStrW
-396 stdcall WOWShellExecute(ptr wstr wstr wstr wstr long ptr)
 520 stdcall SHAllocShared(ptr long long)
 521 stdcall SHLockShared(long long)
 522 stdcall SHUnlockShared(ptr)
 755 stdcall -noname PathIsEqualOrSubFolder(wstr wstr)
 756 stub -noname DeleteFileThumbnail
 
+@ stdcall Activate_RunDLL(long ptr ptr ptr)
+@ stdcall AppCompat_RunDLLW(ptr ptr wstr long)
+@ stdcall CheckEscapesA(str long)
+@ stdcall CheckEscapesW(wstr long)
+@ stdcall CommandLineToArgvW(wstr ptr)
+@ stdcall Control_FillCache_RunDLL(long long long long) Control_FillCache_RunDLLA
+@ stdcall Control_FillCache_RunDLLA(long long long long)
+@ stdcall Control_FillCache_RunDLLW(long long long long)
+@ stdcall Control_RunDLL(ptr ptr str long) Control_RunDLLA
+@ stdcall Control_RunDLLA(ptr ptr str long)
+@ stdcall Control_RunDLLAsUserW(ptr ptr wstr long)
+@ stdcall Control_RunDLLW(ptr ptr wstr long)
+@ stdcall -private DllCanUnloadNow()
+@ stdcall -private DllGetClassObject(ptr ptr ptr)
+@ stdcall -private DllGetVersion(ptr)
+@ stdcall -private DllInstall(long wstr)
+@ stdcall -private DllRegisterServer()
+@ stdcall -private DllUnregisterServer()
+@ stdcall DoEnvironmentSubstA(str str)
+@ stdcall DoEnvironmentSubstW(wstr wstr)
+@ stdcall DragAcceptFiles(long long)
+@ stdcall DragFinish(long)
+@ stdcall DragQueryFile(long long ptr long) DragQueryFileA
+@ stdcall DragQueryFileA(long long ptr long)
+@ stdcall DragQueryFileAorW(ptr long wstr long long long)
+@ stdcall DragQueryFileW(long long ptr long)
+@ stdcall DragQueryPoint(long ptr)
+@ stdcall DuplicateIcon(long long)
+@ stdcall ExtractAssociatedIconA(long str ptr)
+@ stdcall ExtractAssociatedIconExA(long str long long)
+@ stdcall ExtractAssociatedIconExW(long wstr long long)
+@ stdcall ExtractAssociatedIconW(long wstr ptr)
+@ stdcall ExtractIconA(long str long)
+@ stdcall ExtractIconEx(ptr long ptr ptr long) ExtractIconExA
+@ stdcall ExtractIconExA(str long ptr ptr long)
+@ stdcall ExtractIconExW(wstr long ptr ptr long)
+@ stdcall ExtractIconResInfoA(ptr str long ptr ptr)
+@ stdcall ExtractIconResInfoW(ptr wstr long ptr ptr)
+@ stdcall ExtractIconW(long wstr long)
+@ stdcall ExtractVersionResource16W(wstr ptr)
+@ stdcall FindExecutableA(str str ptr)
+@ stdcall FindExecutableW(wstr wstr ptr)
+@ stdcall FindExeDlgProc(ptr long ptr ptr)
+@ stdcall FreeIconList(long)
+@ stdcall InternalExtractIconListA(ptr str ptr)
+@ stdcall InternalExtractIconListW(ptr wstr ptr)
+@ stdcall OpenAs_RunDLL(long long str long) OpenAs_RunDLLA
+@ stdcall OpenAs_RunDLLA(long long str long)
+@ stdcall OpenAs_RunDLLW(long long wstr long)
+@ stdcall Options_RunDLL(ptr ptr str long)
+@ stdcall Options_RunDLLA(ptr ptr str long)
+@ stdcall Options_RunDLLW(ptr ptr wstr long)
+@ stdcall PrintersGetCommand_RunDLL(ptr ptr wstr long)
+@ stdcall PrintersGetCommand_RunDLLA(ptr ptr str long)
+@ stdcall PrintersGetCommand_RunDLLW(ptr ptr wstr long)
+@ stdcall RealShellExecuteA(ptr str str str str str str str long ptr)
+@ stdcall RealShellExecuteExA(ptr str str str str str str str long ptr long)
+@ stdcall RealShellExecuteExW(ptr str str str str str str str long ptr long)
+@ stdcall RealShellExecuteW(ptr wstr wstr wstr wstr wstr wstr wstr long ptr)
+@ stdcall RegenerateUserEnvironment(ptr long)
+@ stdcall SHAddToRecentDocs(long ptr)
+@ stdcall SHAppBarMessage(long ptr)
+@ stdcall SHBindToParent(ptr ptr ptr ptr)
+@ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
+@ stdcall SHBrowseForFolderA(ptr)
+@ stdcall SHBrowseForFolderW(ptr)
+@ stdcall SHChangeNotify(long long ptr ptr)
+@ stdcall SHChangeNotifySuspendResume(long ptr long long)
+@ stdcall SHCreateDirectoryExA(long str ptr)
+@ stdcall SHCreateDirectoryExW(long wstr ptr)
+@ stub SHCreateLocalServerRunDll
+@ stdcall SHCreateProcessAsUserW(ptr)
+@ stdcall SHCreateQueryCancelAutoPlayMoniker(ptr)
+@ stdcall SHCreateShellItem(ptr ptr ptr ptr)
+@ stdcall SHEmptyRecycleBinA(long str long)
+@ stdcall SHEmptyRecycleBinW(long wstr long)
+@ stub SHEnableServiceObject
+@ stub SHEnumerateUnreadMailAccountsW
+@ stdcall SHExtractIconsW(wstr long long long ptr ptr long long) user32.PrivateExtractIconsW
+@ stdcall SHFileOperation(ptr) SHFileOperationA
+@ stdcall SHFileOperationA(ptr)
+@ stdcall SHFileOperationW(ptr)
+@ stdcall SHFormatDrive(long long long long)
+@ stdcall SHFreeNameMappings(ptr)
+@ stdcall SHGetDataFromIDListA(ptr ptr long ptr long)
+@ stdcall SHGetDataFromIDListW(ptr ptr long ptr long)
+@ stdcall SHGetDesktopFolder(ptr)
+@ stdcall SHGetDiskFreeSpaceA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
+@ stdcall SHGetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA
+@ stdcall SHGetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW
+@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA
+@ stdcall SHGetFileInfoA(ptr long ptr long long)
+@ stdcall SHGetFileInfoW(ptr long ptr long long)
+@ stdcall SHGetFolderLocation(long long long long ptr)
+@ stdcall SHGetFolderPathA(long long long long ptr)
+@ stdcall SHGetFolderPathAndSubDirA(long long long long str ptr)
+@ stdcall SHGetFolderPathAndSubDirW(long long long long wstr ptr)
+@ stdcall SHGetFolderPathW(long long long long ptr)
+@ stdcall SHGetIconOverlayIndexA(str long)
+@ stdcall SHGetIconOverlayIndexW(wstr long)
+@ stdcall SHGetInstanceExplorer(long)
+@ stdcall SHGetMalloc(ptr)
+@ stdcall SHGetNewLinkInfo(str str ptr long long) SHGetNewLinkInfoA
+@ stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListA
+@ stdcall SHGetPathFromIDListA(ptr ptr)
+@ stdcall SHGetPathFromIDListW(ptr ptr)
+@ stdcall SHGetSettings(ptr long)
+@ stdcall SHGetSpecialFolderLocation(long long ptr)
+@ stdcall SHGetSpecialFolderPathA(long ptr long long)
+@ stdcall SHGetSpecialFolderPathW(long ptr long long)
+@ stdcall SHGetUnreadMailCountW (long wstr long ptr wstr long)
+@ stdcall SHHelpShortcuts_RunDLL(long long long long) SHHelpShortcuts_RunDLLA
+@ stdcall SHHelpShortcuts_RunDLLA(long long long long)
+@ stdcall SHHelpShortcuts_RunDLLW(long long long long)
+@ stdcall SHInvokePrinterCommandA(ptr long str str long)
+@ stdcall SHInvokePrinterCommandW(ptr long wstr wstr long)
+@ stdcall SHIsFileAvailableOffline(wstr ptr)
+@ stdcall SHLoadInProc(long)
+@ stdcall SHLoadNonloadedIconOverlayIdentifiers()
+@ stdcall SHOpenFolderAndSelectItems(ptr long ptr long)
+@ stdcall SHParseDisplayName(wstr ptr ptr long ptr)
+@ stdcall SHPathPrepareForWriteA(long ptr str long)
+@ stdcall SHPathPrepareForWriteW(long ptr wstr long)
+@ stdcall SHQueryRecycleBinA(str ptr)
+@ stdcall SHQueryRecycleBinW(wstr ptr)
+@ stdcall SHSetLocalizedName(wstr wstr long)
+@ stdcall SHSetUnreadMailCountW (wstr long wstr)
+@ stdcall SHUpdateRecycleBinIcon()
+@ stdcall SheChangeDirA(str)
+@ stdcall SheChangeDirExA(str)
+@ stdcall SheChangeDirExW(wstr)
+@ stdcall SheChangeDirW(wstr)
+@ stdcall SheConvertPathW(wstr wstr long)
+@ stdcall SheFullPathA(str long str)
+@ stdcall SheFullPathW(wstr long wstr)
+@ stdcall SheGetCurDrive()
+@ stdcall SheGetDirA(long long)
+@ stdcall SheGetDirExW(wstr ptr wstr)
+@ stdcall SheGetDirW(long long)
+@ stdcall SheGetPathOffsetW(wstr)
+@ stdcall SheRemoveQuotesA(str)
+@ stdcall SheRemoveQuotesW(wstr)
+@ stdcall SheSetCurDrive(long)
+@ stdcall SheShortenPathA(str long)
+@ stdcall SheShortenPathW(wstr long)
+@ stdcall ShellAboutA(long str str long)
+@ stdcall ShellAboutW(long wstr wstr long)
+@ stdcall ShellExec_RunDLL(ptr ptr wstr long)
+@ stdcall ShellExec_RunDLLA(ptr ptr str long)
+@ stdcall ShellExec_RunDLLW(ptr ptr wstr long)
+@ stdcall ShellExecuteA(long str str str str long)
+@ stdcall ShellExecuteEx(long) ShellExecuteExA
+@ stdcall ShellExecuteExA (long)
+@ stdcall ShellExecuteExW (long)
+@ stdcall ShellExecuteW(long wstr wstr wstr wstr long)
+@ stdcall ShellHookProc(long ptr ptr)
+@ stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA
+@ stdcall Shell_NotifyIconA(long ptr)
+@ stdcall Shell_NotifyIconW(long ptr)
+@ stdcall StrChrA(str long) shlwapi.StrChrA
+@ stdcall StrChrIA(str long) shlwapi.StrChrIA
+@ stdcall StrChrIW(wstr long) shlwapi.StrChrIW
+@ stdcall StrChrW(wstr long) shlwapi.StrChrW
+@ stdcall StrCmpNA(str str long) shlwapi.StrCmpNA
+@ stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
+@ stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
+@ stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
+@ stdcall StrCpyNA (ptr str long) kernel32.lstrcpynA
+@ stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
+@ stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
+@ stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
+@ stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
+@ stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
+@ stdcall StrNCpyA (ptr str long) kernel32.lstrcpynA
+@ stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
+@ stdcall StrRChrA(str str long) shlwapi.StrRChrA
+@ stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
+@ stdcall StrRChrIW(wstr wstr long) shlwapi.StrRChrIW
+@ stdcall StrRChrW(wstr wstr long) shlwapi.StrRChrW
+@ stdcall StrRStrA(str str str)
+@ stdcall StrRStrIA(str str str) shlwapi.StrRStrIA
+@ stdcall StrRStrIW(wstr wstr wstr) shlwapi.StrRStrIW
+@ stdcall StrRStrW(wstr wstr wstr)
+@ stdcall StrStrA(str str) shlwapi.StrStrA
+@ stdcall StrStrIA(str str) shlwapi.StrStrIA
+@ stdcall StrStrIW(wstr wstr) shlwapi.StrStrIW
+@ stdcall StrStrW(wstr wstr) shlwapi.StrStrW
+@ stdcall WOWShellExecute(ptr str str str str long ptr)
+
 # Functions exported by the WinVista shell32.dll
 @ stdcall SHCreateDefaultContextMenu(ptr ptr ptr)
 @ stdcall SHCreateDefaultExtractIcon(ptr ptr)
 @ stdcall FileMenu_GetItemExtent(long long)
 
 # 4.0 (NT) and higher. Until discontinued in 5.0
+# FIXME: ordinals 505-512?
 @ stdcall SHRegCloseKey(long)
 @ stdcall SHRegOpenKeyA(long str long)
 @ stdcall SHRegOpenKeyW(long wstr long)
index ea1b22c..f1caf2a 100644 (file)
@@ -348,6 +348,7 @@ AckPageDlgProc(HWND hwndDlg,
             if (HIWORD(wParam) == BN_CLICKED && IDC_VIEWGPL == LOWORD(wParam))
             {
                 DialogBox(hDllInstance, MAKEINTRESOURCE(IDD_GPL), NULL, GplDlgProc);
+                SetForegroundWindow(GetParent(hwndDlg));
             }
             break;
 
index 360f5ce..c8a1acc 100644 (file)
@@ -262,7 +262,7 @@ Device_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -272,7 +272,7 @@ Device_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -282,7 +282,7 @@ Device_ChangeResourceSettings(IN PPCI_PDO_EXTENSION PdoExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 /* EOF */
index 537c78f..4fde88f 100644 (file)
@@ -148,13 +148,13 @@ PciComputeNewCurrentSettings(IN PPCI_PDO_EXTENSION PdoExtension,
                         /* Not used in the driver yet */
                         case 1:
                             UNIMPLEMENTED;
-                            while (TRUE);
+                            ASSERT(FALSE); // while (TRUE);
                             break;
 
                         /* Not used in the driver yet */
                         case 2:
                             UNIMPLEMENTED;
-                            while (TRUE);
+                            ASSERT(FALSE); // while (TRUE);
                             break;
 
                         /* A drain request */
@@ -541,7 +541,8 @@ PciQueryEjectionRelations(IN PPCI_PDO_EXTENSION PdoExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 NTSTATUS
@@ -599,7 +600,7 @@ PciQueryRequirements(IN PPCI_PDO_EXTENSION PdoExtension,
         {
             /* Have not tested this on eVb's machine yet */
             UNIMPLEMENTED;
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
         }
 
         /* Check if the requirements are actually the zero list */
@@ -1522,7 +1523,7 @@ PciProcessBus(IN PPCI_FDO_EXTENSION DeviceExtension)
     {
         /* Not really handling this year */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
 
         /* Check for PCI bridges with the ISA bit set, or required */
         if ((PdoExtension) &&
@@ -1532,7 +1533,7 @@ PciProcessBus(IN PPCI_FDO_EXTENSION DeviceExtension)
         {
             /* We'll need to do some legacy support */
             UNIMPLEMENTED;
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
         }
     }
     else
@@ -1547,7 +1548,7 @@ PciProcessBus(IN PPCI_FDO_EXTENSION DeviceExtension)
             {
                 /* Again, some more legacy support we'll have to do */
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
         }
     }
@@ -1557,7 +1558,7 @@ PciProcessBus(IN PPCI_FDO_EXTENSION DeviceExtension)
     {
         /* Not yet supported */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 }
 
@@ -1606,7 +1607,7 @@ PciScanBus(IN PPCI_FDO_EXTENSION DeviceExtension)
         {
             DPRINT1("PCI: Bus numbers have been changed!  Restoring originals.\n");
             UNIMPLEMENTED;
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
         }
     }
 
@@ -1668,7 +1669,7 @@ PciScanBus(IN PPCI_FDO_EXTENSION DeviceExtension)
             {
                 /* Check if this PCI device is the ACPI Watchdog Device... */
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
 
             /* Check for non-simple devices */
@@ -1734,7 +1735,7 @@ PciScanBus(IN PPCI_FDO_EXTENSION DeviceExtension)
             {
                 /* Rescan scenarios are not yet implemented */
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
 
             /* Bus processing will need to happen */
@@ -2197,7 +2198,7 @@ PciSetResources(IN PPCI_PDO_EXTENSION PdoExtension,
     {
         /* Don't have hotplug devices to test with yet, QEMU 0.14 should */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 
     /* Locate the correct resource configurator for this type of device */
index 785dfca..ed80518 100644 (file)
@@ -94,7 +94,7 @@ PciFdoIrpStartDevice(IN PIRP Irp,
         /* These resources would only be for non-root FDOs, unhandled for now */
         ASSERT(Resources->Count == 1);
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 
     /* Initialize the arbiter for this FDO */
@@ -112,7 +112,7 @@ PciFdoIrpStartDevice(IN PIRP Irp,
         /* Unhandled for now */
         ASSERT(Resources->Count == 1);
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 
     /* Commit the transition to the started state */
@@ -137,7 +137,7 @@ PciFdoIrpRemoveDevice(IN PIRP Irp,
                       IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -148,7 +148,7 @@ PciFdoIrpCancelRemoveDevice(IN PIRP Irp,
                             IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -159,7 +159,7 @@ PciFdoIrpStopDevice(IN PIRP Irp,
                     IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -170,7 +170,7 @@ PciFdoIrpQueryStopDevice(IN PIRP Irp,
                          IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -181,7 +181,7 @@ PciFdoIrpCancelStopDevice(IN PIRP Irp,
                           IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -319,7 +319,7 @@ PciFdoIrpDeviceUsageNotification(IN PIRP Irp,
                                  IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -330,7 +330,7 @@ PciFdoIrpSurpriseRemoval(IN PIRP Irp,
                          IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -341,7 +341,7 @@ PciFdoIrpQueryLegacyBusInformation(IN PIRP Irp,
                                    IN PPCI_FDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -393,7 +393,7 @@ PciGetHotPlugParameters(IN PPCI_FDO_EXTENSION FdoExtension)
 
         /* HotPlug PCI Support not yet implemented */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     } while (FALSE);
 
     /* Free the buffer and return */
@@ -545,7 +545,7 @@ PciAddDevice(IN PDRIVER_OBJECT DriverObject,
             {
                 /* Root PDO in ReactOS does not assign boot resources */
                 UNIMPLEMENTED;
-//                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 DPRINT1("Encountered during setup\n");
                 Descriptor = NULL;
             }
@@ -554,7 +554,7 @@ PciAddDevice(IN PDRIVER_OBJECT DriverObject,
             {
                 /* Root PDO in ReactOS does not assign boot resources */
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
             else
             {
index 45e02ae..36d1d93 100644 (file)
@@ -679,7 +679,7 @@ PciGetDebugPorts(IN HANDLE DebugKey)
 {
     /* This function is not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
@@ -690,7 +690,7 @@ PciDriverUnload(IN PDRIVER_OBJECT DriverObject)
     /* This function is not yet implemented */
     DPRINT1("PCI: Unload\n");
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
index a860ad1..e9d285d 100644 (file)
@@ -59,7 +59,8 @@ agpintrf_Constructor(IN PVOID DeviceExtension,
 
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index 08681cb..a6dc65d 100644 (file)
@@ -49,7 +49,8 @@ busintrf_Constructor(IN PVOID DeviceExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index e51fb12..be6ce00 100644 (file)
@@ -34,7 +34,7 @@ NTAPI
 Cardbus_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -42,7 +42,7 @@ NTAPI
 Cardbus_SaveLimits(IN PPCI_CONFIGURATOR_CONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -50,7 +50,7 @@ NTAPI
 Cardbus_MassageHeaderForLimitsDetermination(IN PPCI_CONFIGURATOR_CONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -58,7 +58,7 @@ NTAPI
 Cardbus_RestoreCurrent(IN PPCI_CONFIGURATOR_CONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -68,7 +68,7 @@ Cardbus_GetAdditionalResourceDescriptors(IN PPCI_CONFIGURATOR_CONTEXT Context,
                                          IN PIO_RESOURCE_DESCRIPTOR IoDescriptor)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -77,7 +77,7 @@ Cardbus_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension,
                     IN PPCI_COMMON_HEADER PciData)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -86,7 +86,7 @@ Cardbus_ChangeResourceSettings(IN PPCI_PDO_EXTENSION PdoExtension,
                                IN PPCI_COMMON_HEADER PciData)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -109,7 +109,8 @@ pcicbintrf_Constructor(IN PVOID DeviceExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index 919ff30..b2d4548 100644 (file)
@@ -51,7 +51,8 @@ devpresent_Constructor(IN PVOID DeviceExtension,
 
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index 6665427..512390e 100644 (file)
@@ -49,7 +49,8 @@ lddintrf_Constructor(IN PVOID DeviceExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index f2ca179..814d69e 100644 (file)
@@ -49,7 +49,8 @@ locintrf_Constructor(IN PVOID DeviceExtension,
 {
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index 5b59e9a..0debb22 100644 (file)
@@ -52,7 +52,8 @@ PciPmeInterfaceConstructor(IN PVOID DeviceExtension,
 
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 /* EOF */
index d7b7b45..f7e5371 100644 (file)
@@ -54,7 +54,8 @@ routeintrf_Constructor(IN PVOID DeviceExtension,
 
     /* Not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 NTSTATUS
index 453656d..c4fc3c7 100644 (file)
@@ -66,7 +66,7 @@ PciReadWriteConfigSpace(IN PPCI_FDO_EXTENSION DeviceExtension,
     {
         /* Currently this driver only supports the legacy HAL interface */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
     else
     {
index 57b660d..7881f1d 100644 (file)
@@ -672,7 +672,7 @@ PPBridge_ResetDevice(IN PPCI_PDO_EXTENSION PdoExtension,
                      IN PPCI_COMMON_HEADER PciData)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
index f51f02d..1d04ee7 100644 (file)
@@ -80,7 +80,7 @@ PciVerifierProfileChangeCallback(IN PVOID NotificationStructure,
 {
     /* This function is not yet implemented */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
index 4bbc524..7a647d6 100644 (file)
@@ -80,7 +80,7 @@ PciPdoWaitWake(IN PIRP Irp,
                IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -101,7 +101,7 @@ PciPdoIrpQueryPower(IN PIRP Irp,
                     IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -219,7 +219,7 @@ PciPdoIrpRemoveDevice(IN PIRP Irp,
                       IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -230,7 +230,7 @@ PciPdoIrpCancelRemoveDevice(IN PIRP Irp,
                             IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -241,7 +241,7 @@ PciPdoIrpStopDevice(IN PIRP Irp,
                     IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -252,7 +252,7 @@ PciPdoIrpQueryStopDevice(IN PIRP Irp,
                          IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -263,7 +263,7 @@ PciPdoIrpCancelStopDevice(IN PIRP Irp,
                           IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -274,7 +274,7 @@ PciPdoIrpQueryInterface(IN PIRP Irp,
                         IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -405,7 +405,7 @@ PciPdoIrpReadConfig(IN PIRP Irp,
                     IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -416,7 +416,7 @@ PciPdoIrpWriteConfig(IN PIRP Irp,
                      IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -437,7 +437,7 @@ PciPdoIrpDeviceUsageNotification(IN PIRP Irp,
                                  IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -448,7 +448,7 @@ PciPdoIrpSurpriseRemoval(IN PIRP Irp,
                          IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
@@ -459,7 +459,7 @@ PciPdoIrpQueryLegacyBusInformation(IN PIRP Irp,
                                    IN PPCI_PDO_EXTENSION DeviceExtension)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_NOT_SUPPORTED;
 }
 
index d57c1b7..d52aab0 100644 (file)
@@ -192,7 +192,8 @@ PciSetPowerManagedDevicePowerState(IN PPCI_PDO_EXTENSION DeviceExtension,
         {
             /* We would normally re-assign resources after powerup */
             UNIMPLEMENTED;
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            Status = STATUS_NOT_IMPLEMENTED;
         }
     }
 
index 5948e8a..d7511f7 100644 (file)
@@ -153,7 +153,7 @@ PciIsDatacenter(VOID)
     {
         /* This scenario shouldn't happen yet, since SetupDD isn't used */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 
     /* Return if this is Datacenter or not */
@@ -758,7 +758,8 @@ PciIsDeviceOnDebugPath(IN PPCI_PDO_EXTENSION DeviceExtension)
 
     /* eVb has not been able to test such devices yet */
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
+    return FALSE;
 }
 
 NTSTATUS
index a382c4e..c93b0b9 100644 (file)
@@ -218,7 +218,7 @@ IKsDevice_fnCheckIoCapability(
     return STATUS_NOT_IMPLEMENTED;
 }
 
-static IKsDeviceVtbl vt_IKsDevice = 
+static IKsDeviceVtbl vt_IKsDevice =
 {
     IKsDevice_fnQueryInterface,
     IKsDevice_fnAddRef,
@@ -631,12 +631,16 @@ IKsDevice_Create(
         ASSERT(ObjectHeader);
 
         /* find a matching a create item */
-        Status = FindMatchingCreateItem(&ObjectHeader->ItemList, IoStack->FileObject->FileName.Length, IoStack->FileObject->FileName.Buffer, &CreateItemEntry);
+        Status = FindMatchingCreateItem(&ObjectHeader->ItemList,
+                                        &IoStack->FileObject->FileName,
+                                        &CreateItemEntry);
     }
     else
     {
         /* request to create a filter */
-        Status = FindMatchingCreateItem(&DeviceHeader->ItemList, IoStack->FileObject->FileName.Length, IoStack->FileObject->FileName.Buffer, &CreateItemEntry);
+        Status = FindMatchingCreateItem(&DeviceHeader->ItemList,
+                                        &IoStack->FileObject->FileName,
+                                        &CreateItemEntry);
     }
 
     if (NT_SUCCESS(Status))
index 3074371..d2ca995 100644 (file)
@@ -1175,7 +1175,7 @@ KsDefaultDeviceIoCompletion(
     /* get current irp stack */
     IoStack = IoGetCurrentIrpStackLocation(Irp);
 
-    if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY && 
+    if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY &&
         IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_METHOD &&
         IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
     {
@@ -1744,41 +1744,53 @@ KsCancelRoutine(
 NTSTATUS
 FindMatchingCreateItem(
     PLIST_ENTRY ListHead,
-    ULONG BufferSize,
-    LPWSTR Buffer,
+    PUNICODE_STRING String,
     OUT PCREATE_ITEM_ENTRY *OutCreateItem)
 {
     PLIST_ENTRY Entry;
     PCREATE_ITEM_ENTRY CreateItemEntry;
     UNICODE_STRING RefString;
     LPWSTR pStr;
+    ULONG Count;
 
-    /* get terminator */
-    pStr = wcschr(Buffer, L'\\');
+    /* Copy the input string */
+    RefString = *String;
 
-    /* sanity check */
-    ASSERT(pStr != NULL);
-
-    if (pStr == Buffer)
+    /* Check if the string starts with a backslash */
+    if (String->Buffer[0] == L'\\')
     {
-        // skip slash
-        RtlInitUnicodeString(&RefString, ++pStr);
+        /* Skip backslash */
+        RefString.Buffer++;
+        RefString.Length -= sizeof(WCHAR);
     }
     else
     {
+        /* get terminator */
+        pStr = String->Buffer;
+        Count = String->Length / sizeof(WCHAR);
+        while ((Count > 0) && (*pStr != L'\\'))
+        {
+            pStr++;
+            Count--;
+        }
+
+        /* sanity check */
+        ASSERT(Count != 0);
+
         // request is for pin / node / allocator
-        RefString.Buffer = Buffer;
-        RefString.Length = BufferSize = RefString.MaximumLength = ((ULONG_PTR)pStr - (ULONG_PTR)Buffer);
+        RefString.Length = (USHORT)((PCHAR)pStr - (PCHAR)String->Buffer);
     }
 
     /* point to first entry */
     Entry = ListHead->Flink;
 
     /* loop all device items */
-    while(Entry != ListHead)
+    while (Entry != ListHead)
     {
         /* get create item entry */
-        CreateItemEntry = (PCREATE_ITEM_ENTRY)CONTAINING_RECORD(Entry, CREATE_ITEM_ENTRY, Entry);
+        CreateItemEntry = (PCREATE_ITEM_ENTRY)CONTAINING_RECORD(Entry,
+                                                                CREATE_ITEM_ENTRY,
+                                                                Entry);
 
         ASSERT(CreateItemEntry->CreateItem);
 
@@ -1796,10 +1808,11 @@ FindMatchingCreateItem(
             continue;
         }
 
-        DPRINT("CreateItem %S Length %u Request %wZ %u\n", CreateItemEntry->CreateItem->ObjectClass.Buffer,
-                                                           CreateItemEntry->CreateItem->ObjectClass.Length,
-                                                           &RefString,
-                                                           RefString.Length);
+        DPRINT("CreateItem %S Length %u Request %wZ %u\n",
+               CreateItemEntry->CreateItem->ObjectClass.Buffer,
+               CreateItemEntry->CreateItem->ObjectClass.Length,
+               &RefString,
+               RefString.Length);
 
         if (CreateItemEntry->CreateItem->ObjectClass.Length > RefString.Length)
         {
@@ -1809,7 +1822,9 @@ FindMatchingCreateItem(
         }
 
          /* now check if the object class is the same */
-        if (!RtlCompareUnicodeString(&CreateItemEntry->CreateItem->ObjectClass, &RefString, TRUE))
+        if (!RtlCompareUnicodeString(&CreateItemEntry->CreateItem->ObjectClass,
+                                     &RefString,
+                                     TRUE))
         {
             /* found matching create item */
             *OutCreateItem = CreateItemEntry;
@@ -1865,12 +1880,16 @@ KspCreate(
         ASSERT(ObjectHeader);
 
         /* find a matching a create item */
-        Status = FindMatchingCreateItem(&ObjectHeader->ItemList, IoStack->FileObject->FileName.Length, IoStack->FileObject->FileName.Buffer, &CreateItemEntry);
+        Status = FindMatchingCreateItem(&ObjectHeader->ItemList,
+                                        &IoStack->FileObject->FileName,
+                                        &CreateItemEntry);
     }
     else
     {
         /* request to create a filter */
-        Status = FindMatchingCreateItem(&DeviceHeader->ItemList, IoStack->FileObject->FileName.Length, IoStack->FileObject->FileName.Buffer, &CreateItemEntry);
+        Status = FindMatchingCreateItem(&DeviceHeader->ItemList,
+                                        &IoStack->FileObject->FileName,
+                                        &CreateItemEntry);
     }
 
     if (NT_SUCCESS(Status))
index 1c51a8c..fc039f1 100644 (file)
@@ -106,8 +106,7 @@ KspPinPropertyHandler(
 NTSTATUS
 FindMatchingCreateItem(
     PLIST_ENTRY ListHead,
-    ULONG BufferSize,
-    LPWSTR Buffer,
+    PUNICODE_STRING String,
     OUT PCREATE_ITEM_ENTRY *OutCreateItem);
 
 NTSTATUS
index 42b94c9..06f6461 100644 (file)
@@ -773,7 +773,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
     
 FailCreate:
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
@@ -1068,7 +1068,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
                         
                         DPRINT1("Get drive layout request\n");
                         UNIMPLEMENTED;
-                        while (TRUE);
+                        ASSERT(FALSE); // while (TRUE);
                         break;
                         
                     case IOCTL_DISK_GET_PARTITION_INFO:
@@ -1080,7 +1080,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
                         
                         DPRINT1("Invalid request\n");
                         UNIMPLEMENTED;
-                        while (TRUE);
+                        ASSERT(FALSE); // while (TRUE);
                         break;
                 }
                 
@@ -1097,7 +1097,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
                 
                 DPRINT1("Read/Write request\n");
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             //
@@ -1107,7 +1107,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
 
                 DPRINT1("SCSI request\n");
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             //
@@ -1117,7 +1117,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
                 
                 DPRINT1("Flush request\n");
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
 
             //
@@ -1127,7 +1127,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
                 
                 DPRINT1("Invalid request: %lx\n", IoStackLocation->MajorFunction);
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
         }
         
@@ -1481,8 +1481,7 @@ RamdiskDeviceControl(IN PDEVICE_OBJECT DeviceObject,
                 //
                 // We don't handle anything else yet
                 //
-                ASSERT(FALSE);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
         }
     }
     else
@@ -1498,7 +1497,7 @@ RamdiskDeviceControl(IN PDEVICE_OBJECT DeviceObject,
             case IOCTL_CDROM_CHECK_VERIFY:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
 
             case IOCTL_STORAGE_GET_MEDIA_TYPES:
@@ -1664,67 +1663,67 @@ RamdiskDeviceControl(IN PDEVICE_OBJECT DeviceObject,
             case IOCTL_DISK_GET_DRIVE_LAYOUT:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_DISK_GET_LENGTH_INFO:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_DISK_IS_WRITABLE:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_SCSI_MINIPORT:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_STORAGE_QUERY_PROPERTY:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_MOUNTDEV_QUERY_UNIQUE_ID:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_MOUNTDEV_QUERY_STABLE_GUID:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_VOLUME_SET_GPT_ATTRIBUTES:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_VOLUME_GET_GPT_ATTRIBUTES:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             case IOCTL_VOLUME_OFFLINE:
                 
                 UNIMPLEMENTED;
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
                 break;
                 
             default:
@@ -1793,7 +1792,7 @@ RamdiskQueryDeviceRelations(IN DEVICE_RELATION_TYPE Type,
         // FIXME: TODO
         //
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
     
     //
@@ -1980,7 +1979,7 @@ RamdiskDeleteDiskDevice(IN PDEVICE_OBJECT DeviceObject,
                         IN PIRP Irp)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
@@ -2148,37 +2147,37 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
         case IRP_MN_START_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_QUERY_STOP_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_CANCEL_STOP_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_STOP_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_QUERY_REMOVE_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_CANCEL_REMOVE_DEVICE:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_REMOVE_DEVICE:
@@ -2213,7 +2212,7 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
         case IRP_MN_SURPRISE_REMOVAL:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_QUERY_ID:
@@ -2224,7 +2223,7 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
             if (DeviceExtension->Type == RamdiskDrive)
             {
                 DPRINT1("PnP IRP: %lx\n", Minor);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
             break;
             
@@ -2236,14 +2235,14 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
             if (DeviceExtension->Type == RamdiskDrive)
             {
                 DPRINT1("PnP IRP: %lx\n", Minor);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
             break;
             
         case IRP_MN_EJECT:
             
             DPRINT1("PnP IRP: %lx\n", Minor);
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
             break;
             
         case IRP_MN_QUERY_DEVICE_TEXT:
@@ -2254,7 +2253,7 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
             if (DeviceExtension->Type == RamdiskDrive)
             {
                 DPRINT1("PnP IRP: %lx\n", Minor);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
             break;
             
@@ -2278,7 +2277,7 @@ RamdiskPnp(IN PDEVICE_OBJECT DeviceObject,
             if (DeviceExtension->Type == RamdiskDrive)
             {
                 DPRINT1("PnP IRP: %lx\n", Minor);
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
             }
             break;
             
index 0342b13..d6c6298 100644 (file)
@@ -1,4 +1,4 @@
-/*
+/*
  * PROJECT:         ReactOS Universal Serial Bus Hub Driver
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            drivers/usb/usbhub/fdo.c
index a0bf743..37e13ee 100644 (file)
@@ -814,7 +814,7 @@ HalpDispatchWmi(IN PDEVICE_OBJECT DeviceObject,
                 IN PIRP Irp)
 {
     DPRINT1("HAL: PnP Driver WMI!\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
index 2fb9ef9..fa159e0 100644 (file)
@@ -216,6 +216,8 @@ HalpTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
     /* Strange, it isn't! This can happen during NMI */
     DPRINT1("HAL: Trap0D while not in V86 mode\n");
     KiDumpTrapFrame(TrapFrame);
+
+    ASSERT(FALSE);
     while (TRUE);
 }
 
index 1c37901..87be9c8 100644 (file)
@@ -229,7 +229,7 @@ HalHandleNMI(IN PVOID NmiInfo)
     //
     // Don't recurse
     //
-    if (HalpNMIInProgress++) while (TRUE);
+    if (HalpNMIInProgress++) ASSERT(FALSE); // while (TRUE);
 
     //
     // Read the system control register B
index 77aaa21..d9cf19b 100644 (file)
@@ -182,7 +182,8 @@ KeTryToAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
 {
 #ifdef CONFIG_SMP
     ASSERT(FALSE); // FIXME: Unused
-    while (TRUE);
+    // while (TRUE);
+    return FALSE;
 #endif
 
     /* Simply raise to synch */
@@ -206,7 +207,8 @@ KeTryToAcquireQueuedSpinLock(IN KSPIN_LOCK_QUEUE_NUMBER LockNumber,
 {
 #ifdef CONFIG_SMP
     ASSERT(FALSE); // FIXME: Unused
-    while (TRUE);
+    // while (TRUE);
+    return FALSE;
 #endif
 
     /* Simply raise to dispatch */
index 279aebf..5561284 100644 (file)
@@ -26,7 +26,7 @@ HalpcGetCmosData(IN PBUS_HANDLER BusHandler,
                  IN ULONG Length)
 {
     DPRINT1("CMOS GetData\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return 0;
 }
 
@@ -40,7 +40,7 @@ HalpcSetCmosData(IN PBUS_HANDLER BusHandler,
                  IN ULONG Length)
 {
     DPRINT1("CMOS SetData\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return 0;
 }
 
index 0710279..b1bde8a 100644 (file)
@@ -537,7 +537,7 @@ HalpPCIPin2ISALine(IN PBUS_HANDLER BusHandler,
                    IN PPCI_COMMON_CONFIG PciData)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -549,7 +549,7 @@ HalpPCIISALine2Pin(IN PBUS_HANDLER BusHandler,
                    IN PPCI_COMMON_CONFIG PciOldData)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -643,7 +643,8 @@ HalpRegisterPciDebuggingDeviceInfo(VOID)
     /* FIXME: TODO */
     DPRINT1("You have implemented the KD routines for searching PCI debugger"
             "devices, but you have forgotten to implement this routine\n");
-    while (TRUE);
+    UNIMPLEMENTED;
+    ASSERT(FALSE); // while (TRUE);
 }
 
 static ULONG NTAPI
@@ -678,7 +679,7 @@ HalpAdjustPCIResourceList(IN PBUS_HANDLER BusHandler,
     {
         /* /PCILOCK is not yet supported */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 #endif
     /* Now create the correct resource list based on the supported bus ranges */
index 62534a9..c79a9a3 100644 (file)
@@ -812,7 +812,7 @@ HalpDispatchWmi(IN PDEVICE_OBJECT DeviceObject,
                 IN PIRP Irp)
 {
     DPRINT1("HAL: PnP Driver WMI!\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
index ba0771e..886be46 100644 (file)
@@ -192,6 +192,39 @@ extern "C" {
 #define SAM_HOURS_PER_WEEK       (24 * SAM_DAYS_PER_WEEK)
 #define SAM_MINUTES_PER_WEEK     (60 * SAM_HOURS_PER_WEEK)
 
+/* Flags used in USER_ALL_INFORMATION.WhichField */
+#define USER_ALL_USERNAME           0x00000001
+#define USER_ALL_FULLNAME           0x00000002
+#define USER_ALL_USERID             0x00000004
+#define USER_ALL_PRIMARYGROUPID     0x00000008
+#define USER_ALL_ADMINCOMMENT       0x00000010
+#define USER_ALL_USERCOMMENT        0x00000020
+#define USER_ALL_HOMEDIRECTORY      0x00000040
+#define USER_ALL_HOMEDIRECTORYDRIVE 0x00000080
+#define USER_ALL_SCRIPTPATH         0x00000100
+#define USER_ALL_PROFILEPATH        0x00000200
+#define USER_ALL_WORKSTATIONS       0x00000400
+#define USER_ALL_LASTLOGON          0x00000800
+#define USER_ALL_LASTLOGOFF         0x00001000
+#define USER_ALL_LOGONHOURS         0x00002000
+#define USER_ALL_BADPASSWORDCOUNT   0x00004000
+#define USER_ALL_LOGONCOUNT         0x00008000
+#define USER_ALL_PASSWORDCANCHANGE  0x00010000
+#define USER_ALL_PASSWORDMUSTCHANGE 0x00020000
+#define USER_ALL_PASSWORDLASTSET    0x00040000
+#define USER_ALL_ACCOUNTEXPIRES     0x00080000
+#define USER_ALL_USERACCOUNTCONTROL 0x00100000
+#define USER_ALL_PARAMETERS         0x00200000
+#define USER_ALL_COUNTRYCODE        0x00400000
+#define USER_ALL_CODEPAGE           0x00800000
+#define USER_ALL_NTPASSWORDPRESENT  0x01000000
+#define USER_ALL_LMPASSWORDPRESENT  0x02000000
+#define USER_ALL_PRIVATEDATA        0x04000000
+#define USER_ALL_PASSWORDEXPIRED    0x08000000
+#define USER_ALL_SECURITYDESCRIPTOR 0x10000000
+#define USER_ALL_OWFPASSWORD        0x20000000
+#define USER_ALL_UNDEFINED_MASK     0xC0000000
+
 
 typedef PVOID SAM_HANDLE, *PSAM_HANDLE;
 typedef ULONG SAM_ENUMERATE_HANDLE, *PSAM_ENUMERATE_HANDLE;
@@ -345,6 +378,12 @@ typedef struct _LOGON_HOURS
     PUCHAR LogonHours;
 } LOGON_HOURS, *PLOGON_HOURS;
 
+typedef struct _SR_SECURITY_DESCRIPTOR
+{
+    ULONG Length;
+    PUCHAR SecurityDescriptor;
+} SR_SECURITY_DESCRIPTOR, *PSR_SECURITY_DESCRIPTOR;
+
 typedef enum _USER_INFORMATION_CLASS
 {
     UserGeneralInformation = 1,
@@ -506,6 +545,55 @@ typedef struct _USER_CONTROL_INFORMATION
     ULONG UserAccountControl;
 } USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION;
 
+typedef struct _USER_EXPIRES_INFORMATION
+{
+    LARGE_INTEGER AccountExpires;
+} USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION;
+
+typedef struct _USER_PARAMETERS_INFORMATION
+{
+    UNICODE_STRING Parameters;
+} USER_PARAMETERS_INFORMATION, *PUSER_PARAMETERS_INFORMATION;
+
+#include "pshpack4.h"
+typedef struct _USER_ALL_INFORMATION
+{
+    LARGE_INTEGER LastLogon;
+    LARGE_INTEGER LastLogoff;
+    LARGE_INTEGER PasswordLastSet;
+    LARGE_INTEGER AccountExpires;
+    LARGE_INTEGER PasswordCanChange;
+    LARGE_INTEGER PasswordMustChange;
+    UNICODE_STRING UserName;
+    UNICODE_STRING FullName;
+    UNICODE_STRING HomeDirectory;
+    UNICODE_STRING HomeDirectoryDrive;
+    UNICODE_STRING ScriptPath;
+    UNICODE_STRING ProfilePath;
+    UNICODE_STRING AdminComment;
+    UNICODE_STRING WorkStations;
+    UNICODE_STRING UserComment;
+    UNICODE_STRING Parameters;
+    UNICODE_STRING LmPassword;
+    UNICODE_STRING NtPassword;
+    UNICODE_STRING PrivateData;
+    SR_SECURITY_DESCRIPTOR SecurityDescriptor;
+    ULONG UserId;
+    ULONG PrimaryGroupId;
+    ULONG UserAccountControl;
+    ULONG WhichFields;
+    LOGON_HOURS LogonHours;
+    USHORT BadPasswordCount;
+    USHORT LogonCount;
+    USHORT CountryCode;
+    USHORT CodePage;
+    BOOLEAN LmPasswordPresent;
+    BOOLEAN NtPasswordPresent;
+    BOOLEAN PasswordExpired;
+    BOOLEAN PrivateDataSensitive;
+} USER_ALL_INFORMATION, *PUSER_ALL_INFORMATION;
+#include "poppack.h"
+
 
 #define SAM_SID_COMPATIBILITY_ALL    0
 #define SAM_SID_COMPATIBILITY_LAX    1
@@ -535,7 +623,7 @@ SamCloseHandle(IN SAM_HANDLE SamHandle);
 
 NTSTATUS
 NTAPI
-SamConnect(IN OUT PUNICODE_STRING ServerName,
+SamConnect(IN OUT PUNICODE_STRING ServerName OPTIONAL,
            OUT PSAM_HANDLE ServerHandle,
            IN ACCESS_MASK DesiredAccess,
            IN POBJECT_ATTRIBUTES ObjectAttributes);
@@ -667,7 +755,7 @@ SamLookupIdsInDomain(IN SAM_HANDLE DomainHandle,
                      IN ULONG Count,
                      IN PULONG RelativeIds,
                      OUT PUNICODE_STRING *Names,
-                     OUT PSID_NAME_USE *Use);
+                     OUT PSID_NAME_USE *Use OPTIONAL);
 
 NTSTATUS
 NTAPI
index 6bfdaa9..07c7922 100644 (file)
@@ -459,12 +459,12 @@ typedef struct _USER_CONTROL_INFORMATION
 {
     unsigned long UserAccountControl;
 } USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION;
-cpp_quote("#endif")
 
 typedef struct _USER_EXPIRES_INFORMATION
 {
     OLD_LARGE_INTEGER AccountExpires;
 } USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION;
+cpp_quote("#endif")
 
 typedef struct _SAMPR_LOGON_HOURS
 {
diff --git a/include/reactos/ks386.inc b/include/reactos/ks386.inc
deleted file mode 100644 (file)
index c7ccf36..0000000
+++ /dev/null
@@ -1,947 +0,0 @@
-\r
-/* Pointer size */\r
-SizeofPointer = 0x4\r
-\r
-/* Breakpoints */\r
-BREAKPOINT_BREAK = 0x0\r
-BREAKPOINT_PRINT = 0x1\r
-BREAKPOINT_PROMPT = 0x2\r
-BREAKPOINT_LOAD_SYMBOLS = 0x3\r
-BREAKPOINT_UNLOAD_SYMBOLS = 0x4\r
-BREAKPOINT_COMMAND_STRING = 0x5\r
-\r
-/* Context Frame Flags */\r
-CONTEXT_FULL = 0x10007\r
-CONTEXT_CONTROL = 0x10001\r
-CONTEXT_INTEGER = 0x10002\r
-CONTEXT_SEGMENTS = 0x10004\r
-CONTEXT_FLOATING_POINT = 0x10008\r
-CONTEXT_DEBUG_REGISTERS = 0x10010\r
-\r
-/* Exception flags */\r
-EXCEPTION_NONCONTINUABLE = 0x1\r
-EXCEPTION_UNWINDING = 0x2\r
-EXCEPTION_EXIT_UNWIND = 0x4\r
-EXCEPTION_STACK_INVALID = 0x8\r
-EXCEPTION_NESTED_CALL = 0x10\r
-EXCEPTION_TARGET_UNWIND = 0x20\r
-EXCEPTION_COLLIDED_UNWIND = 0x20\r
-EXCEPTION_UNWIND = 0x6\r
-EXCEPTION_EXECUTE_HANDLER = 0x1\r
-EXCEPTION_CONTINUE_SEARCH = 0x0\r
-EXCEPTION_CONTINUE_EXECUTION = 0xffffffff\r
-EXCEPTION_CHAIN_END = 0xffffffff\r
-\r
-/* Exception types */\r
-ExceptionContinueExecution = 0x0\r
-ExceptionContinueSearch = 0x1\r
-ExceptionNestedException = 0x2\r
-ExceptionCollidedUnwind = 0x3\r
-\r
-/* Lock Queue */\r
-LOCK_QUEUE_WAIT = 0x1\r
-LOCK_QUEUE_OWNER = 0x2\r
-LockQueueDispatcherLock = 0x0\r
-\r
-/* Process states */\r
-ProcessInMemory = 0x0\r
-ProcessOutOfMemory = 0x1\r
-ProcessInTransition = 0x2\r
-\r
-/* Processor mode */\r
-KernelMode = 0x0\r
-UserMode = 0x1\r
-\r
-/* Status codes */\r
-STATUS_ACCESS_VIOLATION = 0xc0000005\r
-STATUS_ASSERTION_FAILURE = 0xc0000420\r
-STATUS_ARRAY_BOUNDS_EXCEEDED = 0xc000008c\r
-STATUS_BAD_COMPRESSION_BUFFER = 0xc0000242\r
-STATUS_BREAKPOINT = 0x80000003\r
-STATUS_CALLBACK_POP_STACK = 0xc0000423\r
-STATUS_DATATYPE_MISALIGNMENT = 0x80000002\r
-STATUS_FLOAT_DENORMAL_OPERAND = 0xc000008d\r
-STATUS_FLOAT_DIVIDE_BY_ZERO = 0xc000008e\r
-STATUS_FLOAT_INEXACT_RESULT = 0xc000008f\r
-STATUS_FLOAT_INVALID_OPERATION = 0xc0000090\r
-STATUS_FLOAT_OVERFLOW = 0xc0000091\r
-STATUS_FLOAT_STACK_CHECK = 0xc0000092\r
-STATUS_FLOAT_UNDERFLOW = 0xc0000093\r
-STATUS_FLOAT_MULTIPLE_FAULTS = 0xc00002b4\r
-STATUS_FLOAT_MULTIPLE_TRAPS = 0xc00002b5\r
-STATUS_GUARD_PAGE_VIOLATION = 0x80000001\r
-STATUS_ILLEGAL_FLOAT_CONTEXT = 0xc000014a\r
-STATUS_ILLEGAL_INSTRUCTION = 0xc000001d\r
-STATUS_INSTRUCTION_MISALIGNMENT = 0xc00000aa\r
-STATUS_INVALID_HANDLE = 0xc0000008\r
-STATUS_INVALID_LOCK_SEQUENCE = 0xc000001e\r
-STATUS_INVALID_OWNER = 0xc000005a\r
-STATUS_INVALID_PARAMETER = 0xc000000d\r
-STATUS_INVALID_PARAMETER_1 = 0xc00000ef\r
-STATUS_INVALID_SYSTEM_SERVICE = 0xc000001c\r
-STATUS_INTEGER_DIVIDE_BY_ZERO = 0xc0000094\r
-STATUS_INTEGER_OVERFLOW = 0xc0000095\r
-STATUS_IN_PAGE_ERROR = 0xc0000006\r
-STATUS_KERNEL_APC = 0x100\r
-STATUS_LONGJUMP = 0x80000026\r
-STATUS_NO_CALLBACK_ACTIVE = 0xc0000258\r
-STATUS_NO_EVENT_PAIR = 0xc000014e\r
-STATUS_PRIVILEGED_INSTRUCTION = 0xc0000096\r
-STATUS_SINGLE_STEP = 0x80000004\r
-STATUS_STACK_BUFFER_OVERRUN = 0xc0000409\r
-STATUS_STACK_OVERFLOW = 0xc00000fd\r
-STATUS_SUCCESS = 0x0\r
-STATUS_THREAD_IS_TERMINATING = 0xc000004b\r
-STATUS_TIMEOUT = 0x102\r
-STATUS_UNWIND = 0xc0000027\r
-STATUS_UNWIND_CONSOLIDATE = 0x80000029\r
-STATUS_USER_APC = 0xc0\r
-STATUS_WAKE_SYSTEM_DEBUGGER = 0x80000007\r
-\r
-/* TLS defines */\r
-TLS_MINIMUM_AVAILABLE = 0x40\r
-TLS_EXPANSION_SLOTS = 0x400\r
-\r
-/* Thread states */\r
-Initialized = 0x0\r
-Ready = 0x1\r
-Running = 0x2\r
-Standby = 0x3\r
-Terminated = 0x4\r
-Waiting = 0x5\r
-\r
-/* Wait type / reason */\r
-WrExecutive = 0x7\r
-WrMutex = 0x1d\r
-WrDispatchInt = 0x1f\r
-WrQuantumEnd = 0x1e\r
-WrEventPair = 0xe\r
-WaitAny = 0x1\r
-WaitAll = 0x0\r
-\r
-/* Interrupt object types */\r
-InLevelSensitive = 0x0\r
-InLatched = 0x1\r
-\r
-/* Bug Check Codes */\r
-APC_INDEX_MISMATCH = 0x1\r
-INVALID_AFFINITY_SET = 0x3\r
-INVALID_DATA_ACCESS_TRAP = 0x4\r
-IRQL_NOT_GREATER_OR_EQUAL = 0x9\r
-IRQL_NOT_LESS_OR_EQUAL = 0xa\r
-NO_USER_MODE_CONTEXT = 0xe\r
-SPIN_LOCK_ALREADY_OWNED = 0xf\r
-SPIN_LOCK_NOT_OWNED = 0x10\r
-THREAD_NOT_MUTEX_OWNER = 0x11\r
-TRAP_CAUSE_UNKNOWN = 0x12\r
-KMODE_EXCEPTION_NOT_HANDLED = 0x1e\r
-KERNEL_APC_PENDING_DURING_EXIT = 0x20\r
-PANIC_STACK_SWITCH = 0x2b\r
-DATA_BUS_ERROR = 0x2e\r
-INSTRUCTION_BUS_ERROR = 0x2f\r
-SYSTEM_EXIT_OWNED_MUTEX = 0x39\r
-PAGE_FAULT_WITH_INTERRUPTS_OFF = 0x49\r
-IRQL_GT_ZERO_AT_SYSTEM_SERVICE = 0x4a\r
-DATA_COHERENCY_EXCEPTION = 0x55\r
-INSTRUCTION_COHERENCY_EXCEPTION = 0x56\r
-HAL1_INITIALIZATION_FAILED = 0x61\r
-UNEXPECTED_KERNEL_MODE_TRAP = 0x7f\r
-NMI_HARDWARE_FAILURE = 0x80\r
-SPIN_LOCK_INIT_FAILURE = 0x81\r
-ATTEMPTED_SWITCH_FROM_DPC = 0xb8\r
-\r
-/* IRQL */\r
-PASSIVE_LEVEL = 0x0\r
-APC_LEVEL = 0x1\r
-DISPATCH_LEVEL = 0x2\r
-CLOCK1_LEVEL = 0x1c\r
-CLOCK2_LEVEL = 0x1c\r
-IPI_LEVEL = 0x1d\r
-POWER_LEVEL = 0x1e\r
-PROFILE_LEVEL = 0x1b\r
-HIGH_LEVEL = 0x1f\r
-#ifdef NT_UP\r
-SYNCH_LEVEL = 0x2\r
-#else\r
-SYNCH_LEVEL = 0x1b\r
-#endif\r
-\r
-/* Stack sizes */\r
-KERNEL_STACK_SIZE = 0x3000\r
-KERNEL_LARGE_STACK_SIZE = 0xf000\r
-KERNEL_LARGE_STACK_COMMIT = 0x3000\r
-\r
-/* Miscellaneous Definitions */\r
-LOW_REALTIME_PRIORITY = 0x10\r
-CLOCK_QUANTUM_DECREMENT = 0x3\r
-WAIT_QUANTUM_DECREMENT = 0x1\r
-MAXIMUM_PROCESSORS = 0x20\r
-INITIAL_STALL_COUNT = 0x64\r
-KI_EXCEPTION_ACCESS_VIOLATION = 0x10000004\r
-Executive = 0x0\r
-FALSE = 0x0\r
-TRUE = 0x1\r
-DBG_STATUS_CONTROL_C = 0x1\r
-USER_SHARED_DATA = 0xffdf0000\r
-PAGE_SIZE = 0x1000\r
-MAXIMUM_IDTVECTOR = 0xff\r
-PRIMARY_VECTOR_BASE = 0x30\r
-RPL_MASK = 0x3\r
-MODE_MASK = 0x1\r
-NUMBER_SERVICE_TABLES = 0x2\r
-SERVICE_NUMBER_MASK = 0xfff\r
-SERVICE_TABLE_SHIFT = 0x8\r
-SERVICE_TABLE_MASK = 0x10\r
-SERVICE_TABLE_TEST = 0x10\r
-\r
-/* KAPC */\r
-ApType = 0x0\r
-ApSize = 0x2\r
-ApThread = 0x8\r
-ApApcListEntry = 0xc\r
-ApKernelRoutine = 0x14\r
-ApRundownRoutine = 0x18\r
-ApNormalRoutine = 0x1c\r
-ApNormalContext = 0x20\r
-ApSystemArgument1 = 0x24\r
-ApSystemArgument2 = 0x28\r
-ApApcStateIndex = 0x2c\r
-ApApcMode = 0x2d\r
-ApInserted = 0x2e\r
-ApcObjectLength = 0x30\r
-\r
-/* KAPC_STATE */\r
-AsApcListHead = 0x0\r
-AsProcess = 0x10\r
-AsKernelApcInProgress = 0x14\r
-AsKernelApcPending = 0x15\r
-AsUserApcPending = 0x16\r
-\r
-/* CLIENT_ID */\r
-CidUniqueProcess = 0x0\r
-CidUniqueThread = 0x4\r
-\r
-/* RTL_CRITICAL_SECTION */\r
-CsDebugInfo = 0x0\r
-CsLockCount = 0x4\r
-CsRecursionCount = 0x8\r
-CsOwningThread = 0xc\r
-CsLockSemaphore = 0x10\r
-CsSpinCount = 0x14\r
-\r
-/* RTL_CRITICAL_SECTION_DEBUG */\r
-CsType = 0x0\r
-CsCreatorBackTraceIndex = 0x2\r
-CsCriticalSection = 0x4\r
-CsProcessLocksList = 0x8\r
-CsEntryCount = 0x10\r
-CsContentionCount = 0x14\r
-\r
-/* KDEVICE_QUEUE_ENTRY */\r
-DeDeviceListEntry = 0x0\r
-DeSortKey = 0x8\r
-DeInserted = 0xc\r
-DeviceQueueEntryLength = 0x10\r
-\r
-/* KDPC */\r
-DpType = 0x0\r
-DpImportance = 0x1\r
-DpNumber = 0x2\r
-DpDpcListEntry = 0x4\r
-DpDeferredRoutine = 0xc\r
-DpDeferredContext = 0x10\r
-DpSystemArgument1 = 0x14\r
-DpSystemArgument2 = 0x18\r
-DpDpcData = 0x1c\r
-DpcObjectLength = 0x20\r
-\r
-/* KDEVICE_QUEUE */\r
-DvType = 0x0\r
-DvSize = 0x2\r
-DvDeviceListHead = 0x4\r
-DvSpinLock = 0xc\r
-DvBusy = 0x10\r
-DeviceQueueObjectLength = 0x14\r
-\r
-/* EXCEPTION_RECORD */\r
-ErExceptionCode = 0x0\r
-ErExceptionFlags = 0x4\r
-ErExceptionRecord = 0x8\r
-ErExceptionAddress = 0xc\r
-ErNumberParameters = 0x10\r
-ErExceptionInformation = 0x14\r
-ExceptionRecordLength = 0x50\r
-EXCEPTION_RECORD_LENGTH = 0x50\r
-\r
-/* EPROCESS */\r
-EpDebugPort = 0xcc\r
-EpVdmObjects = 0x144\r
-ExecutiveProcessObjectLength = 0x278\r
-\r
-/* KEVENT */\r
-EvType = 0x0\r
-EvSize = 0x2\r
-EvSignalState = 0x4\r
-EvWaitListHead = 0x8\r
-EventObjectLength = 0x10\r
-\r
-/* FAST_MUTEX */\r
-FmCount = 0x0\r
-FmOwner = 0x4\r
-FmContention = 0x8\r
-FmOldIrql = 0x1c\r
-\r
-/* KINTERRUPT */\r
-InType = 0x0\r
-InSize = 0x2\r
-InInterruptListEntry = 0x4\r
-InServiceRoutine = 0xc\r
-InServiceContext = 0x10\r
-InSpinLock = 0x14\r
-InTickCount = 0x18\r
-InActualLock = 0x1c\r
-InDispatchAddress = 0x20\r
-InVector = 0x24\r
-InIrql = 0x28\r
-InSynchronizeIrql = 0x29\r
-InFloatingSave = 0x2a\r
-InConnected = 0x2b\r
-InNumber = 0x2c\r
-InShareVector = 0x2d\r
-InMode = 0x30\r
-InServiceCount = 0x34\r
-InDispatchCount = 0x38\r
-InDispatchCode = 0x3c\r
-InterruptObjectLength = 0x1e4\r
-\r
-/* IO_STATUS_BLOCK */\r
-IoStatus = 0x0\r
-IoPointer = 0x0\r
-IoInformation = 0x4\r
-\r
-/* KNODE */\r
-KnPfnDereferenceSListHead = 0x8\r
-KnProcessorMask = 0x10\r
-KnColor = 0x14\r
-KnSeed = 0x18\r
-KnNodeNumber = 0x19\r
-KnFlags = 0x1a\r
-knMmShiftedColor = 0x1e\r
-KnFreeCount = 0x22\r
-KnPfnDeferredList = 0x2a\r
-KNODE_SIZE = 0x2e\r
-\r
-/* KSPIN_LOCK_QUEUE */\r
-LqNext = 0x0\r
-LqLock = 0x4\r
-\r
-/* KLOCK_QUEUE_HANDLE */\r
-LqhNext = 0x0\r
-LqhLock = 0x4\r
-LqhOldIrql = 0x8\r
-LOCK_QUEUE_HEADER_SIZE = 0xc\r
-\r
-/* LARGE_INTEGER */\r
-LiLowPart = 0x0\r
-LiHighPart = 0x4\r
-\r
-/* LIST_ENTRY */\r
-LsFlink = 0x0\r
-LsBlink = 0x4\r
-\r
-/* PEB */\r
-PeKernelCallbackTable = 0x2c\r
-ProcessEnvironmentBlockLength = 0x230\r
-\r
-/* KPROFILE */\r
-PfType = 0x0\r
-PfSize = 0x2\r
-PfProfileListEntry = 0x4\r
-PfProcess = 0xc\r
-PfRangeBase = 0x10\r
-PfRangeLimit = 0x14\r
-PfBucketShift = 0x18\r
-PfBuffer = 0x1c\r
-PfSegment = 0x20\r
-PfAffinity = 0x24\r
-PfSource = 0x28\r
-PfStarted = 0x2c\r
-ProfileObjectLength = 0x30\r
-\r
-/* PORT_MESSAGE */\r
-PmLength = 0x0\r
-PmZeroInit = 0x4\r
-PmClientId = 0x8\r
-PmProcess = 0x8\r
-PmThread = 0xc\r
-PmMessageId = 0x10\r
-PmClientViewSize = 0x14\r
-PortMessageLength = 0x18\r
-\r
-/* KPROCESS */\r
-PrType = 0x0\r
-PrSize = 0x2\r
-PrSignalState = 0x4\r
-PrProfileListHead = 0x10\r
-PrDirectoryTableBase = 0x18\r
-PrLdtDescriptor = 0x20\r
-PrIopmOffset = 0x30\r
-PrInt21Descriptor = 0x28\r
-PrVdmTrapcHandler = 0x4c\r
-PrFlags = 0x6b\r
-PrActiveProcessors = 0x34\r
-PrKernelTime = 0x38\r
-PrUserTime = 0x3c\r
-PrReadyListHead = 0x40\r
-PrSwapListEntry = 0x48\r
-PrThreadListHead = 0x50\r
-PrProcessLock = 0x58\r
-PrAffinity = 0x5c\r
-PrProcessFlags = 0x60\r
-PrBasePriority = 0x64\r
-PrQuantumReset = 0x65\r
-PrState = 0x66\r
-PrStackCount = 0x6c\r
-KernelProcessObjectLength = 0x78\r
-\r
-/* KQUEUE */\r
-QuType = 0x0\r
-QuSize = 0x2\r
-QuSignalState = 0x4\r
-QuEntryListHead = 0x10\r
-QuCurrentCount = 0x18\r
-QuMaximumCount = 0x1c\r
-QuThreadListHead = 0x20\r
-QueueObjectLength = 0x28\r
-\r
-/* STRING */\r
-StrLength = 0x0\r
-StrMaximumLength = 0x2\r
-StrBuffer = 0x4\r
-\r
-/* TEB */\r
-TeCmTeb = 0x0\r
-TeExceptionList = 0x0\r
-TeStackBase = 0x4\r
-TeStackLimit = 0x8\r
-TeFiberData = 0x10\r
-TeSelf = 0x18\r
-TeEnvironmentPointer = 0x1c\r
-TeClientId = 0x20\r
-TeActiveRpcHandle = 0x28\r
-TeThreadLocalStoragePointer = 0x2c\r
-TeCountOfOwnedCriticalSections = 0x38\r
-TePeb = 0x30\r
-TeCsrClientThread = 0x3c\r
-TeWOW32Reserved = 0xc0\r
-TeExceptionCode = 0x1a4\r
-TeActivationContextStackPointer = 0x1a8\r
-TeGdiClientPID = 0x6c0\r
-TeGdiClientTID = 0x6c4\r
-TeGdiThreadLocalInfo = 0x6c8\r
-TeglDispatchTable = 0x7c4\r
-TeglReserved1 = 0xb68\r
-TeglReserved2 = 0xbdc\r
-TeglSectionInfo = 0xbe0\r
-TeglSection = 0xbe4\r
-TeglTable = 0xbe8\r
-TeglCurrentRC = 0xbec\r
-TeglContext = 0xbf0\r
-TeDeallocationStack = 0xe0c\r
-TeTlsSlots = 0xe10\r
-TeTlsExpansionSlots = 0xf94\r
-TeLastErrorValue = 0x34\r
-TeVdm = 0xf18\r
-TeInstrumentation = 0xf2c\r
-TeGdiBatchCount = 0xf70\r
-TeGuaranteedStackBytes = 0xf78\r
-TeFlsData = 0xfb4\r
-TeSafeThunkCall = 0xfb8\r
-ThreadEnvironmentBlockLength = 0xfbc\r
-\r
-/* TIME_FIELDS */\r
-TfSecond = 0xa\r
-TfMinute = 0x8\r
-TfHour = 0x6\r
-TfWeekday = 0xe\r
-TfDay = 0x4\r
-TfMonth = 0x2\r
-TfYear = 0x0\r
-TfMilliseconds = 0xc\r
-\r
-/* KTHREAD */\r
-ThType = 0x0\r
-ThSize = 0x2\r
-ThLock = 0x0\r
-ThDebugActive = 0x3\r
-ThSignalState = 0x4\r
-ThInitialStack = 0x18\r
-ThStackLimit = 0x1c\r
-ThKernelStack = 0x20\r
-ThThreadLock = 0x24\r
-ThAlerted = 0x5e\r
-ThApcState = 0x28\r
-ThPriority = 0x5b\r
-ThSwapBusy = 0x5d\r
-ThNextProcessor = 0x40\r
-ThDeferredProcessor = 0x41\r
-ThApcQueueLock = 0x44\r
-ThContextSwitches = 0x48\r
-ThState = 0x4c\r
-ThNpxState = 0x4d\r
-ThWaitIrql = 0x4e\r
-ThWaitMode = 0x4f\r
-ThWaitStatus = 0x50\r
-ThWaitBlockList = 0x54\r
-ThGateObject = 0x54\r
-ThWaitListEntry = 0x60\r
-ThSwapListEntry = 0x60\r
-ThQueue = 0x68\r
-ThWaitTime = 0x6c\r
-ThCombinedApcDisable = 0x70\r
-ThKernelApcDisable = 0x70\r
-ThSpecialApcDisable = 0x72\r
-ThTeb = 0x74\r
-ThTimer = 0x78\r
-ThThreadFlags = 0xa0\r
-ThServiceTable = 0x118\r
-ThWaitBlock = 0xa8\r
-ThResourceIndex = 0xef\r
-ThQueueListEntry = 0x108\r
-ThTrapFrame = 0x110\r
-ThCallbackStack = 0x114\r
-ThApcStateIndex = 0x11c\r
-ThIdealProcessor = 0x11d\r
-ThBasePriority = 0x121\r
-ThPriorityDecrement = 0x122\r
-ThAdjustReason = 0x42\r
-ThAdjustIncrement = 0x43\r
-ThPreviousMode = 0xd7\r
-ThSaturation = 0x123\r
-ThFreezeCount = 0x14f\r
-ThUserAffinity = 0x124\r
-ThProcess = 0x128\r
-ThAffinity = 0x12c\r
-ThUserIdealProcessor = 0x151\r
-ThApcStatePointer = 0x130\r
-ThSavedApcState = 0x138\r
-ThWaitReason = 0x5a\r
-ThSuspendCount = 0x150\r
-ThWin32Thread = 0x154\r
-ThStackBase = 0x158\r
-ThSuspendApc = 0x15c\r
-ThPowerState = 0x18b\r
-ThKernelTime = 0x160\r
-ThLegoData = 0x184\r
-ThLargeStack = 0x107\r
-ThUserTime = 0x18c\r
-ThSuspendSemaphore = 0x190\r
-ThSListFaultCount = 0x1a4\r
-ThThreadListEntry = 0x1a8\r
-ThMutantListHead = 0x10\r
-ThSListFaultAddress = 0x1b0\r
-KernelThreadObjectLength = 0x1b8\r
-ExecutiveThreadObjectLength = 0x250\r
-\r
-/* KTIMER */\r
-TiType = 0x0\r
-TiSize = 0x2\r
-TiInserted = 0x3\r
-TiSignalState = 0x4\r
-TiDueTime = 0x10\r
-TiTimerListEntry = 0x18\r
-TiDpc = 0x20\r
-TiPeriod = 0x24\r
-TimerObjectLength = 0x28\r
-\r
-/* TIME */\r
-\r
-/* KUSER_SHARED_DATA */\r
-UsTickCountMultiplier = 0x4\r
-UsInterruptTime = 0x8\r
-UsSystemTime = 0x14\r
-UsTimeZoneBias = 0x20\r
-UsImageNumberLow = 0x2c\r
-UsImageNumberHigh = 0x2e\r
-UsNtSystemRoot = 0x30\r
-UsMaxStackTraceDepth = 0x238\r
-UsCryptoExponent = 0x23c\r
-UsTimeZoneId = 0x240\r
-UsLargePageMinimum = 0x244\r
-UsReserved2 = 0x248\r
-UsNtProductType = 0x264\r
-UsProductTypeIsValid = 0x268\r
-UsNtMajorVersion = 0x26c\r
-UsNtMinorVersion = 0x270\r
-UsProcessorFeatures = 0x274\r
-UsReserved1 = 0x2b4\r
-UsReserved3 = 0x2b8\r
-UsTimeSlip = 0x2bc\r
-UsAlternativeArchitecture = 0x2c0\r
-UsSystemExpirationDate = 0x2c8\r
-UsSuiteMask = 0x2d0\r
-UsKdDebuggerEnabled = 0x2d4\r
-UsActiveConsoleId = 0x2d8\r
-UsDismountCount = 0x2dc\r
-UsComPlusPackage = 0x2e0\r
-UsLastSystemRITEventTickCount = 0x2e4\r
-UsNumberOfPhysicalPages = 0x2e8\r
-UsSafeBootMode = 0x2ec\r
-UsTestRetInstruction = 0x2f8\r
-UsSystemCall = 0x300\r
-UsSystemCallReturn = 0x304\r
-UsSystemCallPad = 0x308\r
-UsTickCount = 0x320\r
-UsTickCountQuad = 0x320\r
-UsWow64SharedInformation = 0x340\r
-\r
-/* KWAIT_BLOCK */\r
-WbWaitListEntry = 0x0\r
-WbThread = 0x8\r
-WbObject = 0xc\r
-WbNextWaitBlock = 0x10\r
-WbWaitKey = 0x14\r
-WbWaitType = 0x16\r
-\r
-/* CR0 flags */\r
-CR0_PE = 0x1\r
-CR0_MP = 0x2\r
-CR0_EM = 0x4\r
-CR0_TS = 0x8\r
-CR0_ET = 0x10\r
-CR0_NE = 0x20\r
-CR0_WP = 0x10000\r
-CR0_AM = 0x40000\r
-CR0_NW = 0x20000000\r
-CR0_CD = 0x40000000\r
-CR0_PG = 0x80000000\r
-\r
-/* CR4 flags */\r
-CR4_VME = 0x1\r
-CR4_PVI = 0x2\r
-CR4_TSD = 0x4\r
-CR4_DE = 0x8\r
-CR4_PSE = 0x10\r
-CR4_PAE = 0x20\r
-CR4_MCE = 0x40\r
-CR4_PGE = 0x80\r
-CR4_FXSR = 0x200\r
-CR4_XMMEXCPT = 0x400\r
-\r
-/* KeFeatureBits flags */\r
-KF_RDTSC = 0x2\r
-KF_CR4 = 0x4\r
-KF_GLOBAL_PAGE = 0x10\r
-KF_LARGE_PAGE = 0x20\r
-KF_CMPXCHG8B = 0x80\r
-KF_FAST_SYSCALL = 0x1000\r
-KF_V86_VIS = 0x1\r
-\r
-/* Machine type definitions */\r
-MACHINE_TYPE_ISA = 0x0\r
-MACHINE_TYPE_EISA = 0x1\r
-MACHINE_TYPE_MCA = 0x2\r
-\r
-/* EFLAGS */\r
-EFLAGS_TF = 0x100\r
-EFLAGS_INTERRUPT_MASK = 0x200\r
-EFLAGS_V86_MASK = 0x20000\r
-EFLAGS_ALIGN_CHECK = 0x40000\r
-EFLAGS_VIF = 0x80000\r
-EFLAGS_VIP = 0x100000\r
-EFLAGS_USER_SANITIZE = 0x3f4dd7\r
-\r
-/* KDGT selectors */\r
-KGDT_R3_DATA = 0x20\r
-KGDT_R3_CODE = 0x18\r
-KGDT_R0_CODE = 0x8\r
-KGDT_R0_DATA = 0x10\r
-KGDT_R0_PCR = 0x30\r
-KGDT_TSS = 0x28\r
-KGDT_R3_TEB = 0x38\r
-KGDT_DF_TSS = 0x50\r
-KGDT_NMI_TSS = 0x58\r
-KGDT_LDT = 0x48\r
-NPX_STATE_NOT_LOADED = 0xa\r
-NPX_STATE_LOADED = 0x0\r
-PF_XMMI_INSTRUCTIONS_AVAILABLE = 0x6\r
-EFLAG_SELECT = 0xc000\r
-\r
-/* CONTEXT */\r
-CsContextFlags = 0x0\r
-CsDr0 = 0x4\r
-CsDr1 = 0x8\r
-CsDr2 = 0xc\r
-CsDr3 = 0x10\r
-CsDr6 = 0x14\r
-CsDr7 = 0x18\r
-CsFloatSave = 0x1c\r
-CsSegGs = 0x8c\r
-CsSegFs = 0x90\r
-CsSegEs = 0x94\r
-CsSegDs = 0x98\r
-CsEdi = 0x9c\r
-CsEsi = 0xa0\r
-CsEbx = 0xa4\r
-CsEdx = 0xa8\r
-CsEcx = 0xac\r
-CsEax = 0xb0\r
-CsEbp = 0xb4\r
-CsEip = 0xb8\r
-CsSegCs = 0xbc\r
-CsEflags = 0xc0\r
-CsEsp = 0xc4\r
-CsSegSs = 0xc8\r
-CsExtendedRegisters = 0xcc\r
-ContextFrameLength = 0x2cc\r
-CONTEXT_LENGTH = 0x2cc\r
-\r
-/* KGDTENTRY */\r
-KgdtBaseLow = 0x2\r
-KgdtBaseMid = 0x4\r
-KgdtBaseHi = 0x7\r
-KgdtLimitHi = 0x6\r
-KgdtLimitLow = 0x0\r
-\r
-/* KTRAP_FRAME */\r
-TsExceptionList = 0x4c\r
-TsPreviousPreviousMode = 0x48\r
-TsSegGs = 0x30\r
-TsSegFs = 0x50\r
-TsSegEs = 0x34\r
-TsSegDs = 0x38\r
-TsEdi = 0x54\r
-TsEsi = 0x58\r
-TsEbp = 0x60\r
-TsEbx = 0x5c\r
-TsEdx = 0x3c\r
-TsEcx = 0x40\r
-TsEax = 0x44\r
-TsErrCode = 0x64\r
-TsEip = 0x68\r
-TsSegCs = 0x6c\r
-TsEflags = 0x70\r
-TsHardwareEsp = 0x74\r
-TsHardwareSegSs = 0x78\r
-TsTempSegCs = 0x10\r
-TsTempEsp = 0x14\r
-TsDbgEbp = 0x0\r
-TsDbgEip = 0x4\r
-TsDbgArgMark = 0x8\r
-TsDbgArgPointer = 0xc\r
-TsDr0 = 0x18\r
-TsDr1 = 0x1c\r
-TsDr2 = 0x20\r
-TsDr3 = 0x24\r
-TsDr6 = 0x28\r
-TsDr7 = 0x2c\r
-TsV86Es = 0x7c\r
-TsV86Ds = 0x80\r
-TsV86Fs = 0x84\r
-TsV86Gs = 0x88\r
-KTRAP_FRAME_LENGTH = 0x8c\r
-KTRAP_FRAME_ALIGN = 0x4\r
-FRAME_EDITED = 0xfff8\r
-\r
-/* KTSS */\r
-TssEsp0 = 0x4\r
-TssCR3 = 0x1c\r
-TssEip = 0x20\r
-TssEFlags = 0x24\r
-TssEax = 0x28\r
-TssEbx = 0x34\r
-TssEcx = 0x2c\r
-TssEdx = 0x30\r
-TssEsp = 0x38\r
-TssEbp = 0x3c\r
-TssEsi = 0x40\r
-TssEdi = 0x44\r
-TssEs = 0x48\r
-TssCs = 0x4c\r
-TssSs = 0x50\r
-TssDs = 0x54\r
-TssFs = 0x58\r
-TssGs = 0x5c\r
-TssLDT = 0x60\r
-TssIoMapBase = 0x66\r
-TssIoMaps = 0x68\r
-TssLength = 0x20ac\r
-\r
-/* KPCR */\r
-KPCR_EXCEPTION_LIST = 0x0\r
-KPCR_PERF_GLOBAL_GROUP_MASK = 0x8\r
-KPCR_CONTEXT_SWITCHES = 0x10\r
-KPCR_TEB = 0x18\r
-KPCR_SELF = 0x1c\r
-KPCR_PRCB = 0x20\r
-KPCR_IDT = 0x38\r
-KPCR_GDT = 0x3c\r
-KPCR_TSS = 0x40\r
-KPCR_STALL_SCALE_FACTOR = 0x4c\r
-KPCR_PRCB_DATA = 0x120\r
-KPCR_CURRENT_THREAD = 0x124\r
-KPCR_PRCB_NEXT_THREAD = 0x128\r
-KPCR_PRCB_DPC_QUEUE_DEPTH = 0xa4c\r
-KPCR_PRCB_DPC_STACK = 0xa68\r
-KPCR_PRCB_MAXIMUM_DPC_QUEUE_DEPTH = 0xa6c\r
-KPCR_PRCB_DPC_ROUTINE_ACTIVE = 0xa7a\r
-KPCR_PRCB_TIMER_REQUEST = 0xa88\r
-KPCR_PRCB_QUANTUM_END = 0xaa1\r
-KPCR_PRCB_DEFERRED_READY_LIST_HEAD = 0xc10\r
-KPCR_PRCB_POWER_STATE_IDLE_FUNCTION = 0xec0\r
-\r
-/* KTRAP_FRAME */\r
-KTRAP_FRAME_DEBUGEBP = 0x0\r
-KTRAP_FRAME_DEBUGEIP = 0x4\r
-KTRAP_FRAME_TEMPESP = 0x14\r
-KTRAP_FRAME_DR0 = 0x18\r
-KTRAP_FRAME_DR1 = 0x1c\r
-KTRAP_FRAME_DR2 = 0x20\r
-KTRAP_FRAME_DR3 = 0x24\r
-KTRAP_FRAME_DR6 = 0x28\r
-KTRAP_FRAME_DR7 = 0x2c\r
-KTRAP_FRAME_GS = 0x30\r
-KTRAP_FRAME_ES = 0x34\r
-KTRAP_FRAME_DS = 0x38\r
-KTRAP_FRAME_EDX = 0x3c\r
-KTRAP_FRAME_ECX = 0x40\r
-KTRAP_FRAME_EAX = 0x44\r
-KTRAP_FRAME_PREVIOUS_MODE = 0x48\r
-KTRAP_FRAME_EXCEPTION_LIST = 0x4c\r
-KTRAP_FRAME_FS = 0x50\r
-KTRAP_FRAME_EDI = 0x54\r
-KTRAP_FRAME_ESI = 0x58\r
-KTRAP_FRAME_EBX = 0x5c\r
-KTRAP_FRAME_EBP = 0x60\r
-KTRAP_FRAME_ERROR_CODE = 0x64\r
-KTRAP_FRAME_EIP = 0x68\r
-KTRAP_FRAME_EFLAGS = 0x70\r
-KTRAP_FRAME_ESP = 0x74\r
-KTRAP_FRAME_SS = 0x78\r
-KTRAP_FRAME_V86_ES = 0x7c\r
-KTRAP_FRAME_V86_DS = 0x80\r
-KTRAP_FRAME_V86_FS = 0x84\r
-KTRAP_FRAME_V86_GS = 0x88\r
-KTRAP_FRAME_SIZE = 0x8c\r
-FRAME_EDITED = 0xfff8\r
-\r
-/* CONTEXT */\r
-CONTEXT_FLAGS = 0x0\r
-CONTEXT_SEGGS = 0x8c\r
-CONTEXT_SEGFS = 0x90\r
-CONTEXT_SEGES = 0x94\r
-CONTEXT_SEGDS = 0x98\r
-CONTEXT_EDI = 0x9c\r
-CONTEXT_ESI = 0xa0\r
-CONTEXT_EBX = 0xa4\r
-CONTEXT_EDX = 0xa8\r
-CONTEXT_ECX = 0xac\r
-CONTEXT_EAX = 0xb0\r
-CONTEXT_EBP = 0xb4\r
-CONTEXT_EIP = 0xb8\r
-CONTEXT_SEGCS = 0xbc\r
-CONTEXT_EFLAGS = 0xc0\r
-CONTEXT_ESP = 0xc4\r
-CONTEXT_SEGSS = 0xc8\r
-CONTEXT_FRAME_LENGTH = 0x2cc\r
-\r
-/* FIBER */\r
-FIBER_PARAMETER = 0x0\r
-FIBER_EXCEPTION_LIST = 0x4\r
-FIBER_STACK_BASE = 0x8\r
-FIBER_STACK_LIMIT = 0xc\r
-FIBER_DEALLOCATION_STACK = 0x10\r
-FIBER_CONTEXT = 0x14\r
-FIBER_CONTEXT_FLAGS = 0x14\r
-FIBER_CONTEXT_EAX = 0xc4\r
-FIBER_CONTEXT_EBX = 0xb8\r
-FIBER_CONTEXT_ECX = 0xc0\r
-FIBER_CONTEXT_EDX = 0xbc\r
-FIBER_CONTEXT_ESI = 0xb4\r
-FIBER_CONTEXT_EDI = 0xb0\r
-FIBER_CONTEXT_EBP = 0xc8\r
-FIBER_CONTEXT_EIP = 0xcc\r
-FIBER_CONTEXT_ESP = 0xd8\r
-FIBER_CONTEXT_DR6 = 0x28\r
-FIBER_CONTEXT_FLOAT_SAVE_CONTROL_WORD = 0x30\r
-FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD = 0x34\r
-FIBER_CONTEXT_FLOAT_SAVE_TAG_WORD = 0x38\r
-FIBER_GUARANTEED_STACK_BYTES = 0x2e0\r
-FIBER_FLS_DATA = 0x2e4\r
-FIBER_ACTIVATION_CONTEXT_STACK = 0x2e8\r
-\r
-/* KTSS */\r
-KTSS_IOMAPBASE = 0x66\r
-KTSS_ESP0 = 0x4\r
-\r
-/* EXCEPTION_RECORD */\r
-EXCEPTION_RECORD_EXCEPTION_CODE = 0x0\r
-EXCEPTION_RECORD_EXCEPTION_FLAGS = 0x4\r
-EXCEPTION_RECORD_EXCEPTION_RECORD = 0x8\r
-EXCEPTION_RECORD_EXCEPTION_ADDRESS = 0xc\r
-EXCEPTION_RECORD_NUMBER_PARAMETERS = 0x10\r
-EXCEPTION_RECORD_EXCEPTION_ADDRESS = 0xc\r
-SIZEOF_EXCEPTION_RECORD = 0x50\r
-EXCEPTION_RECORD_LENGTH = 0x50\r
-\r
-/* KTHREAD */\r
-KTHREAD_DEBUG_ACTIVE = 0x3\r
-KTHREAD_INITIAL_STACK = 0x18\r
-KTHREAD_STACK_LIMIT = 0x1c\r
-KTHREAD_TEB = 0x74\r
-KTHREAD_KERNEL_STACK = 0x20\r
-KTHREAD_APCSTATE_PROCESS = 0x38\r
-KTHREAD_PENDING_KERNEL_APC = 0x3d\r
-KTHREAD_CONTEXT_SWITCHES = 0x48\r
-KTHREAD_STATE_ = 0x4c\r
-KTHREAD_NPX_STATE = 0x4d\r
-KTHREAD_WAIT_IRQL = 0x4e\r
-KTHREAD_WAIT_REASON = 0x5a\r
-KTHREAD_COMBINED_APC_DISABLE = 0x70\r
-KTHREAD_SPECIAL_APC_DISABLE = 0x72\r
-KTHREAD_LARGE_STACK = 0x107\r
-KTHREAD_TRAP_FRAME = 0x110\r
-KTHREAD_CALLBACK_STACK = 0x114\r
-KTHREAD_APC_STATE_INDEX = 0x11c\r
-KTHREAD_STACK_BASE = 0x158\r
-\r
-/* KPROCESS */\r
-KPROCESS_DIRECTORY_TABLE_BASE = 0x18\r
-KPROCESS_LDT_DESCRIPTOR0 = 0x20\r
-KPROCESS_LDT_DESCRIPTOR1 = 0x24\r
-KPROCESS_INT21_DESCRIPTOR0 = 0x28\r
-KPROCESS_INT21_DESCRIPTOR1 = 0x2c\r
-KPROCESS_IOPM_OFFSET = 0x30\r
-\r
-/* Teb */\r
-TEB_EXCEPTION_LIST = 0x0\r
-TEB_STACK_LIMIT = 0x8\r
-TEB_STACK_BASE = 0x4\r
-TEB_SELF = 0x18\r
-TEB_FIBER_DATA = 0x10\r
-TEB_PEB = 0x30\r
-TEB_EXCEPTION_CODE = 0x1a4\r
-PEB_KERNEL_CALLBACK_TABLE = 0x2c\r
-TEB_FLS_DATA = 0xfb4\r
-TEB_ACTIVATION_CONTEXT_STACK_POINTER = 0x1a8\r
-TEB_GUARANTEED_STACK_BYTES = 0xf78\r
-TEB_DEALLOCATION_STACK = 0xe0c\r
-\r
-/* Misc */\r
-NPX_FRAME_LENGTH = 0x210\r
-FN_CR0_NPX_STATE = 0x20c\r
-DR7_RESERVED_MASK = 0xdc00\r
-FP_CONTROL_WORD = 0x0\r
-FP_STATUS_WORD = 0x4\r
-FP_TAG_WORD = 0x8\r
-FP_DATA_SELECTOR = 0x18\r
-CBSTACK_RESULT = 0x20\r
-CBSTACK_RESULT_LENGTH = 0x24\r
-CBSTACK_TRAP_FRAME = 0x4\r
-CBSTACK_CALLBACK_STACK = 0x8\r
-SIZEOF_FX_SAVE_AREA = 0x210\r
-KUSER_SHARED_SYSCALL = 0x7ffe0300\r
-EXCEPTION_EXECUTE_HANDLER = 0x1\r
-STATUS_CALLBACK_POP_STACK = 0xc0000423\r
-CONTEXT_ALIGNED_SIZE = 0x2cc\r
-PROCESSOR_FEATURE_FXSR = 0x7ffe0278\r
diff --git a/include/reactos/ksamd64.inc b/include/reactos/ksamd64.inc
deleted file mode 100644 (file)
index 24caf53..0000000
+++ /dev/null
@@ -1,1074 +0,0 @@
-
-/* Pointer size */
-SizeofPointer = 0x8
-
-/* Breakpoints */
-BREAKPOINT_BREAK = 0x0
-BREAKPOINT_PRINT = 0x1
-BREAKPOINT_PROMPT = 0x2
-BREAKPOINT_LOAD_SYMBOLS = 0x3
-BREAKPOINT_UNLOAD_SYMBOLS = 0x4
-BREAKPOINT_COMMAND_STRING = 0x5
-
-/* Context Frame Flags */
-CONTEXT_FULL = 0x10000b
-CONTEXT_CONTROL = 0x100001
-CONTEXT_INTEGER = 0x100002
-CONTEXT_SEGMENTS = 0x100004
-CONTEXT_FLOATING_POINT = 0x100008
-CONTEXT_DEBUG_REGISTERS = 0x100010
-
-/* Exception flags */
-EXCEPTION_NONCONTINUABLE = 0x1
-EXCEPTION_UNWINDING = 0x2
-EXCEPTION_EXIT_UNWIND = 0x4
-EXCEPTION_STACK_INVALID = 0x8
-EXCEPTION_NESTED_CALL = 0x10
-EXCEPTION_TARGET_UNWIND = 0x20
-EXCEPTION_COLLIDED_UNWIND = 0x20
-EXCEPTION_UNWIND = 0x6
-EXCEPTION_EXECUTE_HANDLER = 0x1
-EXCEPTION_CONTINUE_SEARCH = 0x0
-EXCEPTION_CONTINUE_EXECUTION = 0xffffffff
-
-/* Exception types */
-ExceptionContinueExecution = 0x0
-ExceptionContinueSearch = 0x1
-ExceptionNestedException = 0x2
-ExceptionCollidedUnwind = 0x3
-
-/* Lock Queue */
-LOCK_QUEUE_WAIT = 0x1
-LOCK_QUEUE_OWNER = 0x2
-LockQueueDispatcherLock = 0x0
-
-/* Process states */
-ProcessInMemory = 0x0
-ProcessOutOfMemory = 0x1
-ProcessInTransition = 0x2
-
-/* Processor mode */
-KernelMode = 0x0
-UserMode = 0x1
-
-/* Status codes */
-STATUS_ACCESS_VIOLATION = 0xc0000005
-STATUS_ASSERTION_FAILURE = 0xc0000420
-STATUS_ARRAY_BOUNDS_EXCEEDED = 0xc000008c
-STATUS_BAD_COMPRESSION_BUFFER = 0xc0000242
-STATUS_BREAKPOINT = 0x80000003
-STATUS_CALLBACK_POP_STACK = 0xc0000423
-STATUS_DATATYPE_MISALIGNMENT = 0x80000002
-STATUS_FLOAT_DENORMAL_OPERAND = 0xc000008d
-STATUS_FLOAT_DIVIDE_BY_ZERO = 0xc000008e
-STATUS_FLOAT_INEXACT_RESULT = 0xc000008f
-STATUS_FLOAT_INVALID_OPERATION = 0xc0000090
-STATUS_FLOAT_OVERFLOW = 0xc0000091
-STATUS_FLOAT_STACK_CHECK = 0xc0000092
-STATUS_FLOAT_UNDERFLOW = 0xc0000093
-STATUS_FLOAT_MULTIPLE_FAULTS = 0xc00002b4
-STATUS_FLOAT_MULTIPLE_TRAPS = 0xc00002b5
-STATUS_GUARD_PAGE_VIOLATION = 0x80000001
-STATUS_ILLEGAL_FLOAT_CONTEXT = 0xc000014a
-STATUS_ILLEGAL_INSTRUCTION = 0xc000001d
-STATUS_INSTRUCTION_MISALIGNMENT = 0xc00000aa
-STATUS_INVALID_HANDLE = 0xc0000008
-STATUS_INVALID_LOCK_SEQUENCE = 0xc000001e
-STATUS_INVALID_OWNER = 0xc000005a
-STATUS_INVALID_PARAMETER = 0xc000000d
-STATUS_INVALID_PARAMETER_1 = 0xc00000ef
-STATUS_INVALID_SYSTEM_SERVICE = 0xc000001c
-STATUS_INTEGER_DIVIDE_BY_ZERO = 0xc0000094
-STATUS_INTEGER_OVERFLOW = 0xc0000095
-STATUS_IN_PAGE_ERROR = 0xc0000006
-STATUS_KERNEL_APC = 0x100
-STATUS_LONGJUMP = 0x80000026
-STATUS_NO_CALLBACK_ACTIVE = 0xc0000258
-STATUS_NO_EVENT_PAIR = 0xc000014e
-STATUS_PRIVILEGED_INSTRUCTION = 0xc0000096
-STATUS_SINGLE_STEP = 0x80000004
-STATUS_STACK_BUFFER_OVERRUN = 0xc0000409
-STATUS_STACK_OVERFLOW = 0xc00000fd
-STATUS_SUCCESS = 0x0
-STATUS_THREAD_IS_TERMINATING = 0xc000004b
-STATUS_TIMEOUT = 0x102
-STATUS_UNWIND = 0xc0000027
-STATUS_UNWIND_CONSOLIDATE = 0x80000029
-STATUS_USER_APC = 0xc0
-STATUS_WAKE_SYSTEM_DEBUGGER = 0x80000007
-
-/* TLS defines */
-TLS_MINIMUM_AVAILABLE = 0x40
-TLS_EXPANSION_SLOTS = 0x400
-
-/* Thread states */
-Initialized = 0x0
-Ready = 0x1
-Running = 0x2
-Standby = 0x3
-Terminated = 0x4
-Waiting = 0x5
-
-/* Wait type / reason */
-WrExecutive = 0x7
-WrMutex = 0x1d
-WrDispatchInt = 0x1f
-WrQuantumEnd = 0x1e
-WrEventPair = 0xe
-WaitAny = 0x1
-WaitAll = 0x0
-
-/* Interrupt object types */
-InLevelSensitive = 0x0
-InLatched = 0x1
-
-/* Bug Check Codes */
-APC_INDEX_MISMATCH = 0x1
-INVALID_AFFINITY_SET = 0x3
-INVALID_DATA_ACCESS_TRAP = 0x4
-IRQL_NOT_GREATER_OR_EQUAL = 0x9
-IRQL_NOT_LESS_OR_EQUAL = 0xa
-NO_USER_MODE_CONTEXT = 0xe
-SPIN_LOCK_ALREADY_OWNED = 0xf
-SPIN_LOCK_NOT_OWNED = 0x10
-THREAD_NOT_MUTEX_OWNER = 0x11
-TRAP_CAUSE_UNKNOWN = 0x12
-KMODE_EXCEPTION_NOT_HANDLED = 0x1e
-KERNEL_APC_PENDING_DURING_EXIT = 0x20
-PANIC_STACK_SWITCH = 0x2b
-DATA_BUS_ERROR = 0x2e
-INSTRUCTION_BUS_ERROR = 0x2f
-SYSTEM_EXIT_OWNED_MUTEX = 0x39
-PAGE_FAULT_WITH_INTERRUPTS_OFF = 0x49
-IRQL_GT_ZERO_AT_SYSTEM_SERVICE = 0x4a
-DATA_COHERENCY_EXCEPTION = 0x55
-INSTRUCTION_COHERENCY_EXCEPTION = 0x56
-HAL1_INITIALIZATION_FAILED = 0x61
-UNEXPECTED_KERNEL_MODE_TRAP = 0x7f
-NMI_HARDWARE_FAILURE = 0x80
-SPIN_LOCK_INIT_FAILURE = 0x81
-ATTEMPTED_SWITCH_FROM_DPC = 0xb8
-
-/* IRQL */
-PASSIVE_LEVEL = 0x0
-APC_LEVEL = 0x1
-DISPATCH_LEVEL = 0x2
-CLOCK_LEVEL = 0xd
-IPI_LEVEL = 0xe
-POWER_LEVEL = 0xe
-PROFILE_LEVEL = 0xf
-HIGH_LEVEL = 0xf
-#ifdef NT_UP
-SYNCH_LEVEL = 0x2
-#else
-SYNCH_LEVEL = 0xc
-#endif
-
-/* Stack sizes */
-KERNEL_STACK_SIZE = 0x6000
-KERNEL_LARGE_STACK_SIZE = 0x12000
-KERNEL_LARGE_STACK_COMMIT = 0x6000
-KERNEL_MCA_EXCEPTION_STACK_SIZE = 0x2000
-NMI_STACK_SIZE = 0x2000
-
-/* Miscellaneous Definitions */
-LOW_REALTIME_PRIORITY = 0x10
-CLOCK_QUANTUM_DECREMENT = 0x3
-WAIT_QUANTUM_DECREMENT = 0x1
-MAXIMUM_PROCESSORS = 0x40
-INITIAL_STALL_COUNT = 0x64
-KI_EXCEPTION_ACCESS_VIOLATION = 0x10000004
-Executive = 0x0
-FALSE = 0x0
-TRUE = 0x1
-DBG_STATUS_CONTROL_C = 0x1
-USER_SHARED_DATA = 0xffdf0000
-PAGE_SIZE = 0x1000
-MAXIMUM_IDTVECTOR = 0xff
-PRIMARY_VECTOR_BASE = 0x30
-RPL_MASK = 0x3
-MODE_MASK = 0x1
-NUMBER_SERVICE_TABLES = 0x2
-SERVICE_NUMBER_MASK = 0xfff
-SERVICE_TABLE_SHIFT = 0x7
-SERVICE_TABLE_MASK = 0x20
-SERVICE_TABLE_TEST = 0x20
-
-/* KAPC */
-ApType = 0x0
-ApSize = 0x2
-ApThread = 0x8
-ApApcListEntry = 0x10
-ApKernelRoutine = 0x20
-ApRundownRoutine = 0x28
-ApNormalRoutine = 0x30
-ApNormalContext = 0x38
-ApSystemArgument1 = 0x40
-ApSystemArgument2 = 0x48
-ApApcStateIndex = 0x50
-ApApcMode = 0x51
-ApInserted = 0x52
-ApcObjectLength = 0x58
-
-/* KAPC_STATE */
-AsApcListHead = 0x0
-AsProcess = 0x20
-AsKernelApcInProgress = 0x28
-AsKernelApcPending = 0x29
-AsUserApcPending = 0x2a
-
-/* CLIENT_ID */
-CidUniqueProcess = 0x0
-CidUniqueThread = 0x8
-
-/* RTL_CRITICAL_SECTION */
-CsDebugInfo = 0x0
-CsLockCount = 0x8
-CsRecursionCount = 0xc
-CsOwningThread = 0x10
-CsLockSemaphore = 0x18
-CsSpinCount = 0x20
-
-/* RTL_CRITICAL_SECTION_DEBUG */
-CsType = 0x0
-CsCreatorBackTraceIndex = 0x2
-CsCriticalSection = 0x8
-CsProcessLocksList = 0x10
-CsEntryCount = 0x20
-CsContentionCount = 0x24
-
-/* KDEVICE_QUEUE_ENTRY */
-DeDeviceListEntry = 0x0
-DeSortKey = 0x10
-DeInserted = 0x14
-DeviceQueueEntryLength = 0x18
-
-/* KDPC */
-DpType = 0x0
-DpImportance = 0x1
-DpNumber = 0x2
-DpDpcListEntry = 0x8
-DpDeferredRoutine = 0x18
-DpDeferredContext = 0x20
-DpSystemArgument1 = 0x28
-DpSystemArgument2 = 0x30
-DpDpcData = 0x38
-DpcObjectLength = 0x40
-
-/* KDEVICE_QUEUE */
-DvType = 0x0
-DvSize = 0x2
-DvDeviceListHead = 0x8
-DvSpinLock = 0x18
-DvBusy = 0x20
-DeviceQueueObjectLength = 0x28
-
-/* EXCEPTION_RECORD */
-ErExceptionCode = 0x0
-ErExceptionFlags = 0x4
-ErExceptionRecord = 0x8
-ErExceptionAddress = 0x10
-ErNumberParameters = 0x18
-ErExceptionInformation = 0x20
-ExceptionRecordLength = 0x98
-EXCEPTION_RECORD_LENGTH = 0x98
-
-/* EPROCESS */
-EpDebugPort = 0x110
-EpVdmObjects = 0x1f0
-ExecutiveProcessObjectLength = 0x3a0
-
-/* KEVENT */
-EvType = 0x0
-EvSize = 0x2
-EvSignalState = 0x4
-EvWaitListHead = 0x8
-EventObjectLength = 0x18
-
-/* FAST_MUTEX */
-FmCount = 0x0
-FmOwner = 0x8
-FmContention = 0x10
-FmOldIrql = 0x30
-
-/* KINTERRUPT */
-InType = 0x0
-InSize = 0x2
-InInterruptListEntry = 0x8
-InServiceRoutine = 0x18
-InServiceContext = 0x20
-InSpinLock = 0x28
-InTickCount = 0x30
-InActualLock = 0x38
-InDispatchAddress = 0x40
-InVector = 0x48
-InIrql = 0x4c
-InSynchronizeIrql = 0x4d
-InFloatingSave = 0x4e
-InConnected = 0x4f
-InNumber = 0x50
-InShareVector = 0x51
-InMode = 0x54
-InServiceCount = 0x58
-InDispatchCount = 0x5c
-InDispatchCode = 0x60
-InterruptObjectLength = 0x208
-
-/* IO_STATUS_BLOCK */
-IoStatus = 0x0
-IoPointer = 0x0
-IoInformation = 0x8
-
-/* KNODE */
-KnPfnDereferenceSListHead = 0x10
-KnProcessorMask = 0x20
-KnColor = 0x28
-KnSeed = 0x2c
-KnNodeNumber = 0x2d
-KnFlags = 0x2e
-knMmShiftedColor = 0x32
-KnFreeCount = 0x36
-KnPfnDeferredList = 0x3e
-KNODE_SIZE = 0x46
-
-/* KSPIN_LOCK_QUEUE */
-LqNext = 0x0
-LqLock = 0x8
-
-/* KLOCK_QUEUE_HANDLE */
-LqhNext = 0x0
-LqhLock = 0x8
-LqhOldIrql = 0x10
-LOCK_QUEUE_HEADER_SIZE = 0x18
-
-/* LARGE_INTEGER */
-LiLowPart = 0x0
-LiHighPart = 0x4
-
-/* LIST_ENTRY */
-LsFlink = 0x0
-LsBlink = 0x8
-
-/* PEB */
-PeKernelCallbackTable = 0x58
-ProcessEnvironmentBlockLength = 0x358
-
-/* KPROFILE */
-PfType = 0x0
-PfSize = 0x2
-PfProfileListEntry = 0x8
-PfProcess = 0x18
-PfRangeBase = 0x20
-PfRangeLimit = 0x28
-PfBucketShift = 0x30
-PfBuffer = 0x38
-PfSegment = 0x40
-PfAffinity = 0x48
-PfSource = 0x50
-PfStarted = 0x54
-ProfileObjectLength = 0x58
-
-/* PORT_MESSAGE */
-PmLength = 0x0
-PmZeroInit = 0x4
-PmClientId = 0x8
-PmProcess = 0x8
-PmThread = 0x10
-PmMessageId = 0x18
-PmClientViewSize = 0x1c
-PortMessageLength = 0x24
-
-/* KPROCESS */
-PrType = 0x0
-PrSize = 0x2
-PrSignalState = 0x4
-PrProfileListHead = 0x18
-PrDirectoryTableBase = 0x28
-PrActiveProcessors = 0x30
-PrKernelTime = 0x34
-PrUserTime = 0x38
-PrReadyListHead = 0x40
-PrSwapListEntry = 0x50
-PrThreadListHead = 0x60
-PrProcessLock = 0x70
-PrAffinity = 0x78
-PrProcessFlags = 0x80
-PrBasePriority = 0x84
-PrQuantumReset = 0x85
-PrState = 0x86
-PrStackCount = 0x8c
-KernelProcessObjectLength = 0xa0
-
-/* KQUEUE */
-QuType = 0x0
-QuSize = 0x2
-QuSignalState = 0x4
-QuEntryListHead = 0x18
-QuCurrentCount = 0x28
-QuMaximumCount = 0x2c
-QuThreadListHead = 0x30
-QueueObjectLength = 0x40
-
-/* STRING */
-StrLength = 0x0
-StrMaximumLength = 0x2
-StrBuffer = 0x8
-
-/* TEB */
-TeCmTeb = 0x0
-TeStackBase = 0x8
-TeStackLimit = 0x10
-TeFiberData = 0x20
-TeSelf = 0x30
-TeEnvironmentPointer = 0x38
-TeClientId = 0x40
-TeActiveRpcHandle = 0x50
-TeThreadLocalStoragePointer = 0x58
-TeCountOfOwnedCriticalSections = 0x6c
-TePeb = 0x60
-TeCsrClientThread = 0x70
-TeWOW32Reserved = 0x100
-TeExceptionCode = 0x2c0
-TeActivationContextStackPointer = 0x2c8
-TeGdiClientPID = 0x7f0
-TeGdiClientTID = 0x7f4
-TeGdiThreadLocalInfo = 0x7f8
-TeglDispatchTable = 0x9f0
-TeglReserved1 = 0x1138
-TeglReserved2 = 0x1220
-TeglSectionInfo = 0x1228
-TeglSection = 0x1230
-TeglTable = 0x1238
-TeglCurrentRC = 0x1240
-TeglContext = 0x1248
-TeDeallocationStack = 0x1478
-TeTlsSlots = 0x1480
-TeTlsExpansionSlots = 0x1780
-TeLastErrorValue = 0x68
-TeVdm = 0x1690
-TeInstrumentation = 0x16b8
-TeGdiBatchCount = 0x1740
-TeGuaranteedStackBytes = 0x1748
-TeFlsData = 0x17c8
-ThreadEnvironmentBlockLength = 0x17d8
-
-/* TIME_FIELDS */
-TfSecond = 0xa
-TfMinute = 0x8
-TfHour = 0x6
-TfWeekday = 0xe
-TfDay = 0x4
-TfMonth = 0x2
-TfYear = 0x0
-TfMilliseconds = 0xc
-
-/* KTHREAD */
-ThType = 0x0
-ThSize = 0x2
-ThLock = 0x0
-ThDebugActive = 0x3
-ThSignalState = 0x4
-ThInitialStack = 0x28
-ThStackLimit = 0x30
-ThKernelStack = 0x38
-ThThreadLock = 0x40
-ThAlerted = 0x9e
-ThApcState = 0x48
-ThPriority = 0x9b
-ThSwapBusy = 0x9d
-ThNextProcessor = 0x60
-ThDeferredProcessor = 0x61
-ThApcQueueLock = 0x78
-ThContextSwitches = 0x80
-ThState = 0x84
-ThNpxState = 0x85
-ThWaitIrql = 0x86
-ThWaitMode = 0x87
-ThWaitStatus = 0x88
-ThWaitBlockList = 0x90
-ThGateObject = 0x90
-ThWaitListEntry = 0xa0
-ThSwapListEntry = 0xa0
-ThQueue = 0xb0
-ThWaitTime = 0xb8
-ThCombinedApcDisable = 0xbc
-ThKernelApcDisable = 0xbc
-ThSpecialApcDisable = 0xbe
-ThTeb = 0xc0
-ThTimer = 0xc8
-ThThreadFlags = 0xf0
-ThServiceTable = 0x1e8
-ThWaitBlock = 0x108
-ThResourceIndex = 0x14f
-ThQueueListEntry = 0x1c8
-ThTrapFrame = 0x1d8
-ThCallbackStack = 0x1e0
-ThApcStateIndex = 0x1f0
-ThIdealProcessor = 0x1f1
-ThBasePriority = 0x1f5
-ThPriorityDecrement = 0x1f6
-ThAdjustReason = 0x62
-ThAdjustIncrement = 0x63
-ThPreviousMode = 0x137
-ThSaturation = 0x1f7
-ThFreezeCount = 0x237
-ThUserAffinity = 0x1f8
-ThProcess = 0x200
-ThAffinity = 0x208
-ThUserIdealProcessor = 0x239
-ThApcStatePointer = 0x210
-ThSavedApcState = 0x220
-ThWaitReason = 0x9a
-ThSuspendCount = 0x238
-ThWin32Thread = 0x250
-ThStackBase = 0x258
-ThSuspendApc = 0x260
-ThPowerState = 0x28f
-ThKernelTime = 0x264
-ThLegoData = 0x288
-ThLargeStack = 0x167
-ThUserTime = 0x290
-ThSuspendSemaphore = 0x2b8
-ThSListFaultCount = 0x2cc
-ThThreadListEntry = 0x2d8
-ThMutantListHead = 0x18
-ThSListFaultAddress = 0x2e8
-KernelThreadObjectLength = 0x2f0
-ExecutiveThreadObjectLength = 0x3f8
-
-/* KTIMER */
-TiType = 0x0
-TiSize = 0x2
-TiInserted = 0x3
-TiSignalState = 0x4
-TiDueTime = 0x18
-TiTimerListEntry = 0x20
-TiDpc = 0x30
-TiPeriod = 0x3c
-TimerObjectLength = 0x40
-
-/* TIME */
-
-/* KUSER_SHARED_DATA */
-UsTickCountMultiplier = 0x4
-UsInterruptTime = 0x8
-UsSystemTime = 0x14
-UsTimeZoneBias = 0x20
-UsImageNumberLow = 0x2c
-UsImageNumberHigh = 0x2e
-UsNtSystemRoot = 0x30
-UsMaxStackTraceDepth = 0x238
-UsCryptoExponent = 0x23c
-UsTimeZoneId = 0x240
-UsLargePageMinimum = 0x244
-UsReserved2 = 0x248
-UsNtProductType = 0x264
-UsProductTypeIsValid = 0x268
-UsNtMajorVersion = 0x26c
-UsNtMinorVersion = 0x270
-UsProcessorFeatures = 0x274
-UsReserved1 = 0x2b4
-UsReserved3 = 0x2b8
-UsTimeSlip = 0x2bc
-UsAlternativeArchitecture = 0x2c0
-UsSystemExpirationDate = 0x2c8
-UsSuiteMask = 0x2d0
-UsKdDebuggerEnabled = 0x2d4
-UsActiveConsoleId = 0x2d8
-UsDismountCount = 0x2dc
-UsComPlusPackage = 0x2e0
-UsLastSystemRITEventTickCount = 0x2e4
-UsNumberOfPhysicalPages = 0x2e8
-UsSafeBootMode = 0x2ec
-UsTestRetInstruction = 0x2f8
-UsSystemCall = 0x300
-UsSystemCallReturn = 0x304
-UsSystemCallPad = 0x308
-UsTickCount = 0x320
-UsTickCountQuad = 0x320
-UsWow64SharedInformation = 0x340
-
-/* KWAIT_BLOCK */
-WbWaitListEntry = 0x0
-WbThread = 0x10
-WbObject = 0x18
-WbNextWaitBlock = 0x20
-WbWaitKey = 0x28
-WbWaitType = 0x2a
-
-/* CR0 flags */
-CR0_PE = 0x1
-CR0_MP = 0x2
-CR0_EM = 0x4
-CR0_TS = 0x8
-CR0_ET = 0x10
-CR0_NE = 0x20
-CR0_WP = 0x10000
-CR0_AM = 0x40000
-CR0_NW = 0x20000000
-CR0_CD = 0x40000000
-CR0_PG = 0x80000000
-
-/* CR4 flags */
-CR4_VME = 0x1
-CR4_PVI = 0x2
-CR4_TSD = 0x4
-CR4_DE = 0x8
-CR4_PSE = 0x10
-CR4_PAE = 0x20
-CR4_MCE = 0x40
-CR4_PGE = 0x80
-CR4_FXSR = 0x200
-CR4_XMMEXCPT = 0x400
-CR4_CHANNELS = 0x800
-
-/* KeFeatureBits flags */
-KF_RDTSC = 0x2
-KF_CR4 = 0x4
-KF_GLOBAL_PAGE = 0x10
-KF_LARGE_PAGE = 0x20
-KF_CMPXCHG8B = 0x80
-KF_FAST_SYSCALL = 0x1000
-
-/* Machine type definitions */
-MACHINE_TYPE_ISA = 0x0
-MACHINE_TYPE_EISA = 0x1
-MACHINE_TYPE_MCA = 0x2
-
-/* EFLAGS */
-EFLAGS_TF_MASK = 0x100
-EFLAGS_TF_SHIFT = 0x8
-EFLAGS_IF_MASK = 0x200
-EFLAGS_IF_SHIFT = 0x9
-EFLAGS_ID_MASK = 0x200000
-
-/* Hypervisor Enlightenment Definitions */
-
-/* KDGT selectors */
-KGDT64_NULL = 0x0
-KGDT64_R0_CODE = 0x10
-KGDT64_R0_DATA = 0x18
-KGDT64_R3_CMCODE = 0x20
-KGDT64_R3_DATA = 0x28
-KGDT64_R3_CODE = 0x30
-KGDT64_SYS_TSS = 0x40
-KGDT64_R3_CMTEB = 0x50
-
-/* Machine Specific Register Numbers */
-MSR_EFER = 0xc0000080
-MSR_STAR = 0xc0000081
-MSR_LSTAR = 0xc0000082
-MSR_CSTAR = 0xc0000083
-MSR_SYSCALL_MASK = 0xc0000084
-MSR_FS_BASE = 0xc0000100
-MSR_GS_BASE = 0xc0000101
-MSR_GS_SWAP = 0xc0000102
-MSR_MCG_STATUS = 0x17a
-MSR_AMD_ACCESS = 0x9c5a203a
-
-/* Flags for MSR_EFER */
-MSR_LMA = 0x400
-MSR_LME = 0x100
-MSR_SCE = 0x1
-MSR_NXE = 0x800
-MSR_PAT = 0x277
-MSR_DEGUG_CTL = 0x1d9
-MSR_LAST_BRANCH_FROM = 0x1db
-MSR_LAST_BRANCH_TO = 0x1dc
-MSR_LAST_EXCEPTION_FROM = 0x1dd
-MSR_LAST_EXCEPTION_TO = 0x1de
-
-/* Flags for MSR_DEGUG_CTL */
-
-/* Fatal exception codes */
-EXCEPTION_DIVIDED_BY_ZERO = 0x0
-EXCEPTION_DEBUG = 0x1
-EXCEPTION_NMI = 0x2
-EXCEPTION_INT3 = 0x3
-EXCEPTION_BOUND_CHECK = 0x5
-EXCEPTION_INVALID_OPCODE = 0x6
-EXCEPTION_NPX_NOT_AVAILABLE = 0x7
-EXCEPTION_DOUBLE_FAULT = 0x8
-EXCEPTION_NPX_OVERRUN = 0x9
-EXCEPTION_INVALID_TSS = 0xa
-EXCEPTION_SEGMENT_NOT_PRESENT = 0xb
-EXCEPTION_STACK_FAULT = 0xc
-EXCEPTION_GP_FAULT = 0xd
-EXCEPTION_RESERVED_TRAP = 0xf
-EXCEPTION_NPX_ERROR = 0x10
-EXCEPTION_ALIGNMENT_CHECK = 0x11
-
-/* Argument Home Address */
-P1Home = 0x0
-P2Home = 0x0
-P3Home = 0x0
-P4Home = 0x0
-
-/* CONTEXT */
-CONTEXT_P1Home = 0x0
-CONTEXT_P2Home = 0x8
-CONTEXT_P3Home = 0x10
-CONTEXT_P4Home = 0x18
-CONTEXT_P5Home = 0x20
-CONTEXT_P6Home = 0x28
-CONTEXT_ContextFlags = 0x30
-CONTEXT_MxCsr = 0x34
-CONTEXT_SegCs = 0x38
-CONTEXT_SegDs = 0x3a
-CONTEXT_SegEs = 0x3c
-CONTEXT_SegFs = 0x3e
-CONTEXT_SegGs = 0x40
-CONTEXT_SegSs = 0x42
-CONTEXT_EFlags = 0x44
-CONTEXT_Dr0 = 0x48
-CONTEXT_Dr1 = 0x50
-CONTEXT_Dr2 = 0x58
-CONTEXT_Dr3 = 0x60
-CONTEXT_Dr6 = 0x68
-CONTEXT_Dr7 = 0x70
-CONTEXT_Rax = 0x78
-CONTEXT_Rcx = 0x80
-CONTEXT_Rdx = 0x88
-CONTEXT_Rbx = 0x90
-CONTEXT_Rsp = 0x98
-CONTEXT_Rbp = 0xa0
-CONTEXT_Rsi = 0xa8
-CONTEXT_Rdi = 0xb0
-CONTEXT_R8 = 0xb8
-CONTEXT_R9 = 0xc0
-CONTEXT_R10 = 0xc8
-CONTEXT_R11 = 0xd0
-CONTEXT_R12 = 0xd8
-CONTEXT_R13 = 0xe0
-CONTEXT_R14 = 0xe8
-CONTEXT_R15 = 0xf0
-CONTEXT_Rip = 0xf8
-CONTEXT_FltSave = 0x100
-CONTEXT_Xmm0 = 0x1a0
-CONTEXT_Xmm1 = 0x1b0
-CONTEXT_Xmm2 = 0x1c0
-CONTEXT_Xmm3 = 0x1d0
-CONTEXT_Xmm4 = 0x1e0
-CONTEXT_Xmm5 = 0x1f0
-CONTEXT_Xmm6 = 0x200
-CONTEXT_Xmm7 = 0x210
-CONTEXT_Xmm8 = 0x220
-CONTEXT_Xmm9 = 0x230
-CONTEXT_Xmm10 = 0x240
-CONTEXT_Xmm11 = 0x250
-CONTEXT_Xmm12 = 0x260
-CONTEXT_Xmm13 = 0x270
-CONTEXT_Xmm14 = 0x280
-CONTEXT_Xmm15 = 0x290
-CONTEXT_DebugControl = 0x4a8
-CONTEXT_LastBranchToRip = 0x4b0
-CONTEXT_LastBranchFromRip = 0x4b8
-CONTEXT_LastExceptionToRip = 0x4c0
-CONTEXT_LastExceptionFromRip = 0x4c8
-CONTEXT_VectorControl = 0x4a0
-CONTEXT_VectorRegister = 0x300
-CONTEXT_FRAME_LENGTH = 0x4d0
-
-/* DISPATCHER_CONTEXT */
-DcControlPc = 0x0
-DcImageBase = 0x8
-DcFunctionEntry = 0x10
-DcEstablisherFrame = 0x18
-DcTargetIp = 0x20
-DcContextRecord = 0x28
-DcLanguageHandler = 0x30
-DcHandlerData = 0x38
-DcHistoryTable = 0x40
-DcScopeIndex = 0x48
-
-/* KEXCEPTION_FRAME */
-KEXCEPTION_FRAME_P1Home = 0x0
-KEXCEPTION_FRAME_P2Home = 0x8
-KEXCEPTION_FRAME_P3Home = 0x10
-KEXCEPTION_FRAME_P4Home = 0x18
-KEXCEPTION_FRAME_P5 = 0x20
-KEXCEPTION_FRAME_Xmm6 = 0x30
-KEXCEPTION_FRAME_Xmm7 = 0x40
-KEXCEPTION_FRAME_Xmm8 = 0x50
-KEXCEPTION_FRAME_Xmm9 = 0x60
-KEXCEPTION_FRAME_Xmm10 = 0x70
-KEXCEPTION_FRAME_Xmm11 = 0x80
-KEXCEPTION_FRAME_Xmm12 = 0x90
-KEXCEPTION_FRAME_Xmm13 = 0xa0
-KEXCEPTION_FRAME_Xmm14 = 0xb0
-KEXCEPTION_FRAME_Xmm15 = 0xc0
-KEXCEPTION_FRAME_MxCsr = 0xf0
-KEXCEPTION_FRAME_Rbp = 0xf8
-KEXCEPTION_FRAME_Rbx = 0x100
-KEXCEPTION_FRAME_Rdi = 0x108
-KEXCEPTION_FRAME_Rsi = 0x110
-KEXCEPTION_FRAME_R12 = 0x118
-KEXCEPTION_FRAME_R13 = 0x120
-KEXCEPTION_FRAME_R14 = 0x128
-KEXCEPTION_FRAME_R15 = 0x130
-KEXCEPTION_FRAME_Return = 0x138
-KEXCEPTION_FRAME_InitialStack = 0x28
-KEXCEPTION_FRAME_TrapFrame = 0xd0
-KEXCEPTION_FRAME_CallbackStack = 0xd8
-KEXCEPTION_FRAME_OutputBuffer = 0xe0
-KEXCEPTION_FRAME_OutputLength = 0xe8
-KEXCEPTION_FRAME_LENGTH = 0x140
-
-/* JUMP_BUFFER */
-JbFrame = 0x0
-JbRbx = 0x8
-JbRsp = 0x10
-JbRbp = 0x18
-JbRsi = 0x20
-JbRdi = 0x28
-JbR12 = 0x30
-JbR13 = 0x38
-JbR14 = 0x40
-JbR15 = 0x48
-JbRip = 0x50
-JbXmm6 = 0x60
-JbXmm7 = 0x70
-JbXmm8 = 0x80
-JbXmm9 = 0x90
-JbXmm10 = 0xa0
-JbXmm11 = 0xb0
-JbXmm12 = 0xc0
-JbXmm13 = 0xd0
-JbXmm14 = 0xe0
-JbXmm15 = 0xf0
-
-/* KGDTENTRY64 */
-KgdtBaseLow = 0x2
-KgdtBaseMiddle = 0x4
-KgdtBaseHigh = 0x7
-KgdtBaseUpper = 0x8
-KgdtLimitHigh = 0x6
-KgdtLimitLow = 0x0
-
-/* KPRCB */
-PbMxCsr = 0x0
-PbNumber = 0x4
-PbInterruptRequest = 0x6
-PbIdleHalt = 0x7
-PbCurrentThread = 0x8
-PbNextThread = 0x10
-PbIdleThread = 0x18
-PbNestingLevel = 0x5
-PbRspBase = 0x28
-PbPrcbLock = 0x30
-PbSetMember = 0x38
-PbProcessorState = 0x40
-PbCpuType = 0x5f0
-PbCpuID = 0x5f1
-PbCpuStep = 0x5f2
-PbHalReserved = 0x5f8
-PbMinorVersion = 0x638
-PbMajorVersion = 0x63a
-PbBuildType = 0x63c
-PbCpuVendor = 0x63d
-PbApicMask = 0x640
-PbCFlushSize = 0x644
-PbAcpiReserved = 0x648
-PbInitialApicId = 0x63e
-PbLockQueue = 0x670
-PbPPLookasideList = 0x880
-PbPPNPagedLookasideList = 0x980
-PbPPPagedLookasideList = 0xb80
-PbPacketBarrier = 0xd80
-PbDeferredReadyListHead = 0xd88
-PbLookasideIrpFloat = 0xdc4
-PbTargetSet = 0xe00
-PbIpiFrozen = 0xe08
-PbRequestMailbox = 0xe80
-PbSenderSummary = 0x2680
-PbDpcStack = 0x2740
-PbMaximumDpcQueueDepth = 0x2750
-PbDpcRequestRate = 0x2754
-PbMinimumDpcRate = 0x2758
-PbDpcInterruptRequested = 0x275c
-PbDpcThreadRequested = 0x275d
-PbDpcRoutineActive = 0x275e
-PbDpcThreadActive = 0x275f
-PbTimerHand = 0x2760
-PbTimerRequest = 0x2768
-PbTickOffset = 0x2770
-PbMasterOffset = 0x2774
-PbDpcLastCount = 0x2778
-PbQuantumEnd = 0x277d
-PbDpcSetEventRequest = 0x2780
-PbIdleSchedule = 0x277f
-PbReadySummary = 0x2818
-PbDispatcherReadyListHead = 0x2820
-PbInterruptCount = 0x2a20
-PbKernelTime = 0x2a24
-PbUserTime = 0x2a28
-PbDpcTime = 0x2a2c
-PbInterruptTime = 0x2a30
-PbAdjustDpcThreshold = 0x2a34
-PbSkipTick = 0x2a38
-PbPollSlot = 0x2a3a
-PbParentNode = 0x2a48
-PbMultiThreadProcessorSet = 0x2a50
-PbMultiThreadSetMaster = 0x2a58
-PbPageColor = 0x2a6c
-PbNodeColor = 0x2a70
-PbNodeShiftedColor = 0x2a74
-PbSecondaryColorMask = 0x2a78
-PbSleeping = 0x2a60
-PbVendorString = 0x2abc
-PbPowerState = 0x2ad8
-ProcessorBlockLength = 0x2c88
-
-/* KPCR */
-PcUserRsp = 0x10
-PcSelf = 0x18
-PcCurrentPrcb = 0x20
-PcLockArray = 0x28
-PcIrql = 0x50
-PcStallScaleFactor = 0x64
-PcHalReserved = 0xc0
-
-/* KPROCESSOR_STATE */
-PsSpecialRegisters = 0x0
-PsCr0 = 0x0
-PsCr2 = 0x8
-PsCr3 = 0x10
-PsCr4 = 0x18
-PsKernelDr0 = 0x20
-PsKernelDr1 = 0x28
-PsKernelDr2 = 0x30
-PsKernelDr3 = 0x38
-PsKernelDr6 = 0x40
-PsKernelDr7 = 0x48
-PsGdtr = 0x50
-PsIdtr = 0x60
-PsTr = 0x70
-PsLdtr = 0x72
-PsMxCsr = 0x74
-PsContextFrame = 0xe0
-PsDebugControl = 0x78
-PsLastBranchToRip = 0x80
-PsLastBranchFromRip = 0x88
-PsLastExceptionToRip = 0x90
-PsLastExceptionFromRip = 0x98
-PsCr8 = 0xa0
-ProcessorStateLength = 0x5b0
-
-/* KSTART_FRAME */
-SfP1Home = 0x0
-SfP2Home = 0x8
-SfP3Home = 0x10
-SfP4Home = 0x18
-SfReturn = 0x28
-KSTART_FRAME_LENGTH = 0x30
-
-/* KSPECIAL_REGISTERS */
-SrKernelDr0 = 0x20
-SrKernelDr1 = 0x28
-SrKernelDr2 = 0x30
-SrKernelDr3 = 0x38
-SrKernelDr6 = 0x40
-SrKernelDr7 = 0x48
-SrGdtr = 0x50
-SrIdtr = 0x60
-SrTr = 0x70
-SrMxCsr = 0x74
-SrMsrGsBase = 0xa8
-SrMsrGsSwap = 0xb0
-SrMsrStar = 0xb8
-SrMsrLStar = 0xc0
-SrMsrCStar = 0xc8
-SrMsrSyscallMask = 0xd0
-
-/* KSYSTEM_TIME */
-StLowTime = 0x0
-StHigh1Time = 0x4
-StHigh2Time = 0x8
-
-/* KSWITCH_FRAME */
-SwP5Home = 0x20
-SwApcBypass = 0x28
-SwRbp = 0x30
-SwReturn = 0x38
-SwitchFrameLength = 0x40
-KSWITCH_FRAME_LENGTH = 0x40
-
-/* KTRAP_FRAME */
-KTRAP_FRAME_P1Home = 0x0
-KTRAP_FRAME_P2Home = 0x8
-KTRAP_FRAME_P3Home = 0x10
-KTRAP_FRAME_P4Home = 0x18
-KTRAP_FRAME_P5 = 0x20
-KTRAP_FRAME_PreviousMode = 0x28
-KTRAP_FRAME_PreviousIrql = 0x29
-KTRAP_FRAME_FaultIndicator = 0x2a
-KTRAP_FRAME_ExceptionActive = 0x2b
-KTRAP_FRAME_MxCsr = 0x2c
-KTRAP_FRAME_Rax = 0x30
-KTRAP_FRAME_Rcx = 0x38
-KTRAP_FRAME_Rdx = 0x40
-KTRAP_FRAME_R8 = 0x48
-KTRAP_FRAME_R9 = 0x50
-KTRAP_FRAME_R10 = 0x58
-KTRAP_FRAME_R11 = 0x60
-KTRAP_FRAME_GsBase = 0x68
-KTRAP_FRAME_GsSwap = 0x68
-KTRAP_FRAME_Xmm0 = 0x70
-KTRAP_FRAME_Xmm1 = 0x80
-KTRAP_FRAME_Xmm2 = 0x90
-KTRAP_FRAME_Xmm3 = 0xa0
-KTRAP_FRAME_Xmm4 = 0xb0
-KTRAP_FRAME_Xmm5 = 0xc0
-KTRAP_FRAME_FaultAddress = 0xd0
-KTRAP_FRAME_TimeStampCKCL = 0xd0
-KTRAP_FRAME_Dr0 = 0xd8
-KTRAP_FRAME_Dr1 = 0xe0
-KTRAP_FRAME_Dr2 = 0xe8
-KTRAP_FRAME_Dr3 = 0xf0
-KTRAP_FRAME_Dr6 = 0xf8
-KTRAP_FRAME_Dr7 = 0x100
-KTRAP_FRAME_DebugControl = 0x108
-KTRAP_FRAME_LastBranchToRip = 0x110
-KTRAP_FRAME_LastBranchFromRip = 0x118
-KTRAP_FRAME_LastExceptionToRip = 0x120
-KTRAP_FRAME_LastExceptionFromRip = 0x128
-KTRAP_FRAME_LastBranchControl = 0x108
-KTRAP_FRAME_LastBranchMSR = 0x110
-KTRAP_FRAME_SegDs = 0x130
-KTRAP_FRAME_SegEs = 0x132
-KTRAP_FRAME_SegFs = 0x134
-KTRAP_FRAME_SegGs = 0x136
-KTRAP_FRAME_TrapFrame = 0x138
-KTRAP_FRAME_Rbx = 0x140
-KTRAP_FRAME_Rdi = 0x148
-KTRAP_FRAME_Rsi = 0x150
-KTRAP_FRAME_Rbp = 0x158
-KTRAP_FRAME_ErrorCode = 0x160
-KTRAP_FRAME_TimeStampKlog = 0x160
-KTRAP_FRAME_Rip = 0x168
-KTRAP_FRAME_SegCs = 0x170
-KTRAP_FRAME_Logging = 0x173
-KTRAP_FRAME_EFlags = 0x178
-KTRAP_FRAME_Rsp = 0x180
-KTRAP_FRAME_SegSs = 0x188
-KTRAP_FRAME_CodePatchCycle = 0x18c
-KTRAP_FRAME_LENGTH = 0x190
-
-/* KTSS */
-TssRsp0 = 0x4
-TssRsp1 = 0xc
-TssRsp2 = 0x14
-TssPanicStack = 0x24
-TssMcaStack = 0x2c
-TssNmiStack = 0x34
-TssIoMapBase = 0x66
-TssLength = 0x68
-
-/* EXCEPTION_RECORD */
-EXCEPTION_RECORD_ExceptionCode = 0x0
-EXCEPTION_RECORD_ExceptionFlags = 0x4
-EXCEPTION_RECORD_ExceptionRecord = 0x8
-EXCEPTION_RECORD_ExceptionAddress = 0x10
-EXCEPTION_RECORD_NumberParameters = 0x18
-EXCEPTION_RECORD_ExceptionInformation = 0x20
-KTHREAD_WAIT_IRQL = 0x86
index 78e2487..7e051d6 100644 (file)
@@ -45,6 +45,9 @@ typedef struct _SEH3$_REGISTRATION_FRAME
 
 } SEH3$_REGISTRATION_FRAME ,*PSEH3$_REGISTRATION_FRAME;
 
+/* Prevent gcc from inlining functions that use SEH. */
+static inline __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3$_PreventInlining() {}
+
 extern inline __attribute__((always_inline,gnu_inline))
 void _SEH3$_UnregisterFrame(volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame)
 {
@@ -92,18 +95,20 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter
 
 /* This is an asm wrapper around _SEH3$_RegisterFrame */
 #define _SEH3$_RegisterFrame(_TrylevelFrame, _DataTable, _Target) \
-    asm goto ("call __SEH3$_RegisterFrame\n" \
+    asm goto ("leal %0, %%ecx\n" \
+              "call __SEH3$_RegisterFrame\n" \
               : \
-              : "c" (_TrylevelFrame), "a" (_DataTable) \
-              : "edx", "memory" \
+              : "m" (*(_TrylevelFrame)), "a" (_DataTable) \
+              : "ecx", "edx", "memory" \
               : _Target)
 
 /* This is an asm wrapper around _SEH3$_EnterTryLevel */
 #define _SEH3$_RegisterTryLevel(_TrylevelFrame, _DataTable, _Target) \
-    asm goto ("call __SEH3$_RegisterTryLevel\n" \
+    asm goto ("leal %0, %%ecx\n" \
+              "call __SEH3$_RegisterTryLevel\n" \
               : \
-              : "c" (_TrylevelFrame), "a" (_DataTable) \
-              : "edx", "memory" \
+              : "m" (*(_TrylevelFrame)), "a" (_DataTable) \
+              : "ecx", "edx", "memory" \
               : _Target)
 
 /* On GCC the filter function is a nested function with __fastcall calling
@@ -165,13 +170,16 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter
    around into places that are never executed. */
 #define _SEH3$_SCARE_GCC() \
         void *plabel; \
+        _SEH3$_ASM_GOTO("#\n", _SEH3$_l_BeforeTry); \
         _SEH3$_ASM_GOTO("#\n", _SEH3$_l_HandlerTarget); \
+        _SEH3$_ASM_GOTO("#\n", _SEH3$_l_OnException); \
         asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \
                       : _SEH3$_CLOBBER_ON_EXCEPTION ); \
-        goto *plabel;
+        goto _SEH3$_l_OnException;
 
 
 #define _SEH3_TRY \
+    _SEH3$_PreventInlining(); \
     /* Enter the outer scope */ \
     do { \
         /* Declare local labels */ \
index c3e3dbe..3c82b45 100644 (file)
@@ -549,7 +549,7 @@ HvTrackCellRef(PHV_TRACK_CELL_REF CellRef,
 
     /* FIXME: TODO */
     DPRINT1("ERROR: Too many references\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
index f9a949d..0431a56 100644 (file)
@@ -132,7 +132,7 @@ CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 
index eb344ee..be2af04 100644 (file)
@@ -122,7 +122,7 @@ CcFastCopyRead(IN PFILE_OBJECT FileObject,
                OUT PIO_STATUS_BLOCK IoStatus)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -209,7 +209,7 @@ CcFastCopyWrite(IN PFILE_OBJECT FileObject,
                 IN PVOID Buffer)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -220,7 +220,7 @@ CcCanIWrite(IN PFILE_OBJECT FileObject,
             IN UCHAR Retrying)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -234,7 +234,7 @@ CcDeferWrite(IN PFILE_OBJECT FileObject,
              IN BOOLEAN Retrying)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 /* EOF */
index 4b4bc15..f816100 100644 (file)
@@ -399,7 +399,7 @@ CcSetDirtyPageThreshold(IN PFILE_OBJECT FileObject,
                         IN ULONG DirtyPageThreshold)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 /*
index 6c5f354..cb4f78a 100644 (file)
@@ -24,7 +24,7 @@ CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject,
                                IN BOOLEAN DisableWriteBehind)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -48,7 +48,7 @@ CcGetDirtyPages(IN PVOID LogHandle,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 \f
@@ -57,7 +57,7 @@ NTAPI
 CcIsThereDirtyData(IN PVPB Vpb)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -68,7 +68,7 @@ CcGetLsnForFileObject(IN PFILE_OBJECT FileObject,
 {
     LARGE_INTEGER Result = {{0}};
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return Result;
 }
 
index 8363477..7e81de3 100644 (file)
@@ -138,8 +138,8 @@ typedef union _KTRAP_EXIT_SKIP_BITS
     {                                               \
         /* Not yet handled */                       \
         UNIMPLEMENTED;                              \
-        while (TRUE);                               \
-        return TRUE;                                \
+        ASSERT(FALSE); /* while (TRUE); */          \
+        return FALSE;                               \
     }
 
 C_ASSERT(NPX_FRAME_LENGTH == sizeof(FX_SAVE_AREA));
index f88e80f..f19b496 100644 (file)
@@ -266,7 +266,8 @@ IopCompleteRequest(IN PKAPC Apc,
         {
             /* We should never get this yet */
             DPRINT1("Reparse support not yet present!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return;
         }
     }
 
@@ -1373,7 +1374,7 @@ IofCompleteRequest(IN PIRP Irp,
 #else
             /* Not implemented yet. */
             DPRINT1("Not supported!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
 #endif
         }
 
index ebba94d..54e5c41 100644 (file)
@@ -3784,7 +3784,7 @@ PiGetDeviceRegistryProperty(IN PDEVICE_OBJECT DeviceObject,
 
 #define PIP_RETURN_DATA(x, y)   {ReturnLength = x; Data = y; Status = STATUS_SUCCESS; break;}
 #define PIP_REGISTRY_DATA(x, y) {ValueName = x; ValueType = y; break;}
-#define PIP_UNIMPLEMENTED()     {UNIMPLEMENTED; while(TRUE); break;}
+#define PIP_UNIMPLEMENTED()     {UNIMPLEMENTED; ASSERT(FALSE); /* while (TRUE); */ break;}
 
 /*
  * @implemented
index 3e21f67..0b13fae 100644 (file)
@@ -108,7 +108,8 @@ KdpServiceDispatcher(ULONG Service,
 #endif /* KDBG */
 #endif /* DBG */
         default:
-            HalDisplayString ("Invalid debug service call!\n");
+            DPRINT1("Invalid debug service call!\n");
+            HalDisplayString("Invalid debug service call!\n");
             break;
     }
 
index df27345..a496fd7 100644 (file)
@@ -140,7 +140,7 @@ KdpSysReadBusData(IN ULONG BusDataType,
                   OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -155,7 +155,7 @@ KdpSysWriteBusData(IN ULONG BusDataType,
                    OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -358,7 +358,7 @@ NTAPI
 KdpSysCheckLowMemory(IN ULONG Flags)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -367,6 +367,6 @@ NTAPI
 KdpAllowDisable(VOID)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_ACCESS_DENIED;
 }
index 32a82eb..35f9211 100644 (file)
@@ -23,7 +23,7 @@ KdpGetStateChange(IN PDBGKD_MANIPULATE_STATE64 State,
                   IN PCONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -32,7 +32,7 @@ KdpSetContextState(IN PDBGKD_ANY_WAIT_STATE_CHANGE WaitStateChange,
                    IN PCONTEXT Context)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -41,7 +41,7 @@ KdpSysReadMsr(IN ULONG Msr,
               OUT PLARGE_INTEGER MsrValue)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -51,7 +51,7 @@ KdpSysWriteMsr(IN ULONG Msr,
                IN PLARGE_INTEGER MsrValue)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -66,7 +66,7 @@ KdpSysReadBusData(IN ULONG BusDataType,
                   OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -81,7 +81,7 @@ KdpSysWriteBusData(IN ULONG BusDataType,
                    OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -94,7 +94,7 @@ KdpSysReadControlSpace(IN ULONG Processor,
                        OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -107,7 +107,7 @@ KdpSysWriteControlSpace(IN ULONG Processor,
                         OUT PULONG ActualLength)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -122,7 +122,7 @@ KdpSysReadIoSpace(IN ULONG InterfaceType,
                   OUT PULONG ActualDataSize)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -137,7 +137,7 @@ KdpSysWriteIoSpace(IN ULONG InterfaceType,
                    OUT PULONG ActualDataSize)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -146,7 +146,7 @@ NTAPI
 KdpSysCheckLowMemory(IN ULONG Flags)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_UNSUCCESSFUL;
 }
 
@@ -155,6 +155,6 @@ NTAPI
 KdpAllowDisable(VOID)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_ACCESS_DENIED;
 }
index 641c544..d701444 100644 (file)
@@ -1178,6 +1178,7 @@ KeBugCheckWithTf(IN ULONG BugCheckCode,
     KiBugCheckDebugBreak(DBG_STATUS_BUGCHECK_SECOND);
 
     /* Shouldn't get here */
+    ASSERT(FALSE);
     while (TRUE);
 }
 
index d507b72..577fefb 100644 (file)
@@ -780,6 +780,7 @@ KeInsertQueueDpc(IN PKDPC Dpc,
             {
                 /* FIXME: Setup Threaded DPC */
                 DPRINT1("Threaded DPC not supported\n");
+                ASSERT(FALSE);
                 while (TRUE);
             }
         }
index 085e9ae..cd36a14 100644 (file)
@@ -36,7 +36,8 @@ KiSwapProcess(IN PKPROCESS NewProcess,
     {
         /* Not handled yet */
         UNIMPLEMENTED;
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
+        return;
     }
     
     /* Update CR3 */
index 835d8e7..2bd9a46 100644 (file)
@@ -663,6 +663,7 @@ KiTrap06Handler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Should only happen in VDM mode */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
         
@@ -735,6 +736,7 @@ KiTrap07Handler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Not implemented */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     
@@ -921,6 +923,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Should only happen in VDM mode */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
         
@@ -1077,6 +1080,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
     {
         /* Not implemented */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
 
@@ -1133,6 +1137,7 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* Otherwise, this is another kind of IRET fault */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     }
@@ -1191,6 +1196,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
         {
             /* The stack is somewhere in between frames, we need to fix it */
             UNIMPLEMENTED;
+            ASSERT(FALSE);
             while (TRUE);
         }
     }
@@ -1256,6 +1262,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
     {
         /* Not yet implemented */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
 #endif
@@ -1439,7 +1446,7 @@ FASTCALL
 KiGetTickCountHandler(IN PKTRAP_FRAME TrapFrame)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -1447,7 +1454,7 @@ FASTCALL
 KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 DECLSPEC_NORETURN
@@ -1618,6 +1625,7 @@ KiSystemCall(IN PKTRAP_FRAME TrapFrame,
     {
         /* Access violation */
         UNIMPLEMENTED;
+        ASSERT(FALSE);
         while (TRUE);
     }
     
@@ -1683,6 +1691,7 @@ Kei386EoiHelper(VOID)
 {
     /* We should never see this call happening */
     DPRINT1("Mismatched NT/HAL version");
+    ASSERT(FALSE);
     while (TRUE);
 }
 
index 3f1d2c2..0b87140 100644 (file)
@@ -66,7 +66,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
     // Always return success for now
     //
     DPRINT1("NEVER TELL ME THE ODDS!\n");
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
index 49ce25f..84ef6f6 100644 (file)
@@ -59,7 +59,7 @@ MiSyncCachedRanges(VOID)
     for (i = 0; i < MiLargePageRangeIndex; i++)
     {
         DPRINT1("No support for large pages\n");
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
     }
 }
 
index 06db17a..1211b65 100644 (file)
@@ -2043,7 +2043,7 @@ MmArmInitSystem(IN ULONG Phase,
         // Define the basic user vs. kernel address space separation
         //
         MmSystemRangeStart = (PVOID)MI_DEFAULT_SYSTEM_RANGE_START;
-        MmUserProbeAddress = (ULONG_PTR)MI_HIGHEST_USER_ADDRESS;
+        MmUserProbeAddress = (ULONG_PTR)MI_USER_PROBE_ADDRESS;
         MmHighestUserAddress = (PVOID)MI_HIGHEST_USER_ADDRESS;
 
         /* Highest PTE and PDE based on the addresses above */
index aa45a70..b99f77e 100644 (file)
@@ -876,7 +876,8 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
     NTSTATUS Status;
     PMMPTE SuperProtoPte;
     PMMPFN Pfn1, OutPfn = NULL;
-    PFN_NUMBER PageFrameIndex, PteCount, ProcessedPtes;
+    PFN_NUMBER PageFrameIndex;
+    PFN_COUNT PteCount, ProcessedPtes;
     DPRINT("ARM3 Page Fault Dispatcher for address: %p in process: %p\n",
              Address,
              Process);
@@ -1055,7 +1056,7 @@ MiDispatchFault(IN BOOLEAN StoreInstruction,
             if (ProcessedPtes)
             {
                 /* Bump the transition count */
-                InterlockedExchangeAdd(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes);
+                InterlockedExchangeAddSizeT(&KeGetCurrentPrcb()->MmTransitionCount, ProcessedPtes);
                 ProcessedPtes--;
 
                 /* Loop all the processing we did */
@@ -1208,9 +1209,15 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction,
             if (TrapInformation)
             {
                 PKTRAP_FRAME TrapFrame = TrapInformation;
+#ifdef _M_IX86
                 DbgPrint("MM:***EIP %p, EFL %p\n", TrapFrame->Eip, TrapFrame->EFlags);
                 DbgPrint("MM:***EAX %p, ECX %p EDX %p\n", TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx);
                 DbgPrint("MM:***EBX %p, ESI %p EDI %p\n", TrapFrame->Ebx, TrapFrame->Esi, TrapFrame->Edi);
+#elif defined(_M_AMD64)
+                DbgPrint("MM:***RIP %p, EFL %p\n", TrapFrame->Rip, TrapFrame->EFlags);
+                DbgPrint("MM:***RAX %p, RCX %p RDX %p\n", TrapFrame->Rax, TrapFrame->Rcx, TrapFrame->Rdx);
+                DbgPrint("MM:***RBX %p, RSI %p RDI %p\n", TrapFrame->Rbx, TrapFrame->Rsi, TrapFrame->Rdi);
+#endif
             }
 
             /* Tell the trap handler to fail */
index f31f512..728949d 100644 (file)
@@ -1324,8 +1324,10 @@ MiInitializeSessionPool(VOID)
     /* Initialize the first page table */
     Index = (ULONG_PTR)MmSessionSpace->PagedPoolStart - (ULONG_PTR)MmSessionBase;
     Index >>= 22;
+#ifndef _M_AMD64 // FIXME
     ASSERT(MmSessionSpace->PageTables[Index].u.Long == 0);
     MmSessionSpace->PageTables[Index] = *PointerPde;
+#endif
 
     /* Bump up counters */
     InterlockedIncrementSizeT(&MmSessionSpace->NonPageablePages);
index 27660f7..7cfa0b3 100644 (file)
@@ -1580,7 +1580,9 @@ MiReleaseProcessReferenceToSessionDataPage(IN PMM_SESSION_SPACE SessionGlobal)
     DPRINT1("Last process in sessino %d going down!!!\n", SessionId);
 
     /* Free the session page tables */
+#ifndef _M_AMD64
     ExFreePool(SessionGlobal->PageTables);
+#endif
     ASSERT(!MI_IS_PHYSICAL_ADDRESS(SessionGlobal));
 
     /* Capture the data page PFNs */
@@ -1744,8 +1746,9 @@ MiSessionInitializeWorkingSetList(VOID)
 
         /* Add this into the list */
         Index = ((ULONG_PTR)WorkingSetList - (ULONG_PTR)MmSessionBase) >> 22;
+#ifndef _M_AMD64
         MmSessionSpace->PageTables[Index] = TempPte;
-
+#endif
         /* Initialize the page directory page, and now zero the working set list itself */
         MiInitializePfnForOtherProcess(PageFrameIndex,
                                        PointerPde,
@@ -1977,8 +1980,10 @@ MiSessionCreateInternal(OUT PULONG SessionId)
     MmSessionSpace->Color = Color;
     MmSessionSpace->NonPageablePages = MiSessionCreateCharge;
     MmSessionSpace->CommittedPages = MiSessionCreateCharge;
+#ifndef _M_AMD64
     MmSessionSpace->PageTables = PageTables;
     MmSessionSpace->PageTables[PointerPde - MiAddressToPde(MmSessionBase)] = *PointerPde;
+#endif
     InitializeListHead(&MmSessionSpace->ImageList);
     DPRINT1("Session %d is ready to go: 0x%p 0x%p, %lx 0x%p\n",
             *SessionId, MmSessionSpace, SessionGlobal, SessionPageDirIndex, PageTables);
index 5c10f2c..b3c4674 100644 (file)
@@ -906,9 +906,10 @@ MiSessionCommitPageTables(IN PVOID StartVa,
     Index = ((ULONG_PTR)StartVa - (ULONG_PTR)MmSessionBase) >> 22;
     while (StartPde <= EndPde)
     {
+#ifndef _M_AMD64
         /* If we don't already have a page table for it, increment count */
         if (MmSessionSpace->PageTables[Index].u.Long == 0) PageCount++;
-
+#endif
         /* Move to the next one */
         StartPde++;
         Index++;
@@ -924,6 +925,7 @@ MiSessionCommitPageTables(IN PVOID StartVa,
     /* Loop each PDE while holding the working set lock */
 //  MiLockWorkingSet(PsGetCurrentThread(),
 //                   &MmSessionSpace->GlobalVirtualAddress->Vm);
+#ifndef _M_AMD64
     while (StartPde <= EndPde)
     {
         /* Check if we already have a page table */
@@ -966,6 +968,7 @@ MiSessionCommitPageTables(IN PVOID StartVa,
         StartPde++;
         Index++;
     }
+#endif
 
     /* Make sure we didn't do more pages than expected */
     ASSERT(ActualPages <= PageCount);
index 59e37c1..e226766 100644 (file)
@@ -106,7 +106,8 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr,
     {
         /* Fail */
         DPRINT1("Session loading not yet supported!\n");
-        while (TRUE);
+        ASSERT(FALSE); // while (TRUE);
+        return STATUS_NOT_IMPLEMENTED;
     }
 
     /* Not session load, shouldn't have an entry */
@@ -1217,7 +1218,7 @@ CheckDllState:
                     /* We failed, unload the image */
                     MmUnloadSystemImage(DllEntry);
                     DPRINT1("MmCallDllInitialize failed with status 0x%x\n", Status);
-                    while (TRUE);
+                    ASSERT(FALSE); // while (TRUE);
                     Loaded = FALSE;
                 }
             }
@@ -1720,7 +1721,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
         {
             /* Shouldn't happen */
             DPRINT1("[Mm0]: Couldn't allocate driver section!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            return;
         }
 
         /* This is the new virtual address for the module */
@@ -1773,7 +1775,8 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
             {
                 /* This shouldn't happen */
                 DPRINT1("Relocations failed!\n");
-                while (TRUE);
+                ASSERT(FALSE); // while (TRUE);
+                return;
             }
         }
 
@@ -2922,7 +2925,8 @@ LoaderScan:
         {
             /* We don't support session loading yet */
             DPRINT1("Unsupported Session-Load!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            Status = STATUS_NOT_IMPLEMENTED;
         }
 
         /* Do cleanup */
@@ -3023,7 +3027,8 @@ LoaderScan:
         {
             /* We don't support session loading yet */
             DPRINT1("Unsupported Session-Load!\n");
-            while (TRUE);
+            ASSERT(FALSE); // while (TRUE);
+            goto Quickie;
         }
 
         /* Check the loader list again, we should end up in the path below */
index 65f2701..3d3b4a1 100644 (file)
@@ -3861,8 +3861,9 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
     }
     if ((AllocationType & MEM_RESET) == MEM_RESET)
     {
-        DPRINT1("MEM_RESET not supported\n");
-        Status = STATUS_INVALID_PARAMETER;
+        /// @todo HACK: pretend success
+        DPRINT("MEM_RESET not supported\n");
+        Status = STATUS_SUCCESS;
         goto FailPathNoLock;
     }
     if (Process->VmTopDown == 1)
@@ -4307,7 +4308,6 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
             // There's a change in protection, remember this for later, but do
             // not yet handle it.
             //
-            DPRINT1("Protection change to: 0x%lx not implemented\n", Protect);
             ChangeProtection = TRUE;
         }
 
@@ -4317,11 +4317,6 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
         PointerPte++;
     }
 
-    //
-    // This path is not yet handled
-    //
-    ASSERT(ChangeProtection == FALSE);
-
     //
     // Release the working set lock, unlock the address space, and detach from
     // the target process if it was not the current process. Also dereference the
@@ -4331,6 +4326,26 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
     Status = STATUS_SUCCESS;
 FailPath:
     MmUnlockAddressSpace(AddressSpace);
+
+    //
+    // Check if we need to update the protection
+    //
+    if (ChangeProtection)
+    {
+        PVOID ProtectBaseAddress = (PVOID)StartingAddress;
+        SIZE_T ProtectSize = PRegionSize;
+        ULONG OldProtection;
+
+        //
+        // Change the protection of the region
+        //
+        MiProtectVirtualMemory(Process,
+                               &ProtectBaseAddress,
+                               &ProtectSize,
+                               Protect,
+                               &OldProtection);
+    }
+
 FailPathNoLock:
     if (Attached) KeUnstackDetachProcess(&ApcState);
     if (ProcessHandle != NtCurrentProcess()) ObDereferenceObject(Process);
index 1820d91..5dda483 100644 (file)
@@ -125,7 +125,7 @@ MiFlushTlb(IN PMMPTE PointerPte,
            IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -135,7 +135,7 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
                             IN PULONG DirectoryTableBase)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -165,7 +165,7 @@ MmDisableVirtualMapping(IN PEPROCESS Process,
                         OUT PPFN_NUMBER Page)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -174,7 +174,7 @@ MmEnableVirtualMapping(IN PEPROCESS Process,
                        IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -186,7 +186,7 @@ MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
                              IN ULONG PageCount)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
@@ -199,7 +199,7 @@ MmCreateVirtualMapping(IN PEPROCESS Process,
                        IN ULONG PageCount)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return STATUS_SUCCESS;
 }
 
@@ -208,7 +208,7 @@ NTAPI
 MmRawDeleteVirtualMapping(IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -220,7 +220,7 @@ MmDeleteVirtualMapping(IN PEPROCESS Process,
                        OUT PPFN_NUMBER Page)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -230,7 +230,7 @@ MmDeletePageFileMapping(IN PEPROCESS Process,
                         IN SWAPENTRY *SwapEntry)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 NTSTATUS
@@ -240,8 +240,8 @@ MmCreatePageFileMapping(IN PEPROCESS Process,
                         IN SWAPENTRY SwapEntry)
 {
     UNIMPLEMENTED;
-    while (TRUE);
-    return 0;
+    ASSERT(FALSE); // while (TRUE);
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 PFN_NUMBER
@@ -250,7 +250,7 @@ MmGetPfnForProcess(IN PEPROCESS Process,
                    IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return 0;
 }
 
@@ -260,8 +260,8 @@ MmIsDirtyPage(IN PEPROCESS Process,
               IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
-    return 0;
+    ASSERT(FALSE); // while (TRUE);
+    return FALSE;
 }
 
 VOID
@@ -270,7 +270,7 @@ MmSetCleanPage(IN PEPROCESS Process,
                IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 VOID
@@ -279,7 +279,7 @@ MmSetDirtyPage(IN PEPROCESS Process,
                IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 }
 
 BOOLEAN
@@ -288,7 +288,7 @@ MmIsPagePresent(IN PEPROCESS Process,
                 IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -298,7 +298,7 @@ MmIsPageSwapEntry(IN PEPROCESS Process,
                   IN PVOID Address)
 {
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
     return FALSE;
 }
 
@@ -357,7 +357,7 @@ MmGetPhysicalAddress(IN PVOID Address)
     PhysicalAddress.QuadPart = 0;
 
     UNIMPLEMENTED;
-    while (TRUE);
+    ASSERT(FALSE); // while (TRUE);
 
     return PhysicalAddress;
 }