[CMAKE]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 26 Jan 2011 23:24:08 +0000 (23:24 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Wed, 26 Jan 2011 23:24:08 +0000 (23:24 +0000)
- Sync with trunk 50501
- fix a couple of merge artifacts (indentation)

svn path=/branches/cmake-bringup/; revision=50505

40 files changed:
base/applications/network/ping/CMakeLists.txt
base/applications/network/ping/ping.c
base/applications/network/ping/ping.rc
dll/directx/dsound/CMakeLists.txt
dll/directx/wine/wined3d/CMakeLists.txt
dll/win32/avifil32/CMakeLists.txt
dll/win32/avifil32/rsrc-utf8.rc [new file with mode: 0644]
dll/win32/avifil32/rsrc.rc
dll/win32/gdiplus/CMakeLists.txt
dll/win32/jscript/CMakeLists.txt
dll/win32/setupapi/cfgmgr.c
dll/win32/user32/controls/icontitle.c
dll/win32/user32/windows/class.c
dll/win32/user32/windows/cursoricon.c
drivers/usb/usbehci/fdo.c
drivers/usb/usbehci/irp.c
drivers/usb/usbehci/transfer.c
drivers/usb/usbehci/usbehci.h
drivers/usb/usbehci/usbiffn.c
include/crt/math.h
lib/3rdparty/libsamplerate/CMakeLists.txt
lib/sdk/crt/CMakeLists.txt
lib/sdk/crt/misc/i10output.c
lib/sdk/crt/printf/streamout.c
ntoskrnl/include/internal/i386/mm.h
ntoskrnl/mm/ARM3/syspte.c
ntoskrnl/se/priv.c
subsystems/win32/win32k/include/tags.h
subsystems/win32/win32k/include/xformobj.h
subsystems/win32/win32k/ntuser/window.c
subsystems/win32/win32k/objects/arc.c
subsystems/win32/win32k/objects/bitmaps.c
subsystems/win32/win32k/objects/coord.c
subsystems/win32/win32k/objects/dibobj.c
subsystems/win32/win32k/objects/drawing.c
subsystems/win32/win32k/objects/font.c
subsystems/win32/win32k/objects/metafile.c
subsystems/win32/win32k/objects/path.c
subsystems/win32/win32k/objects/xformobj.c
subsystems/win32/win32k/pch.h

index 8cb9b9f..c9ef4c2 100644 (file)
@@ -2,6 +2,8 @@
 set_unicode()
 add_definitions(-D__USE_W32_SOCKETS)
 
+set_unicode()
+
 add_executable(ping ping.c ping.rc)
 
 set_module_type(ping win32cui)
index 616498d..6f7935e 100644 (file)
@@ -381,7 +381,7 @@ static BOOL Setup(VOID)
                    sizeof(DontFragment)) == SOCKET_ERROR)
     {
         FormatOutput(IDS_SETSOCKOPT_FAILED, WSAGetLastError());
-         return FALSE;
+        return FALSE;
     }
 
     if (setsockopt(IcmpSock,
@@ -391,7 +391,7 @@ static BOOL Setup(VOID)
                    sizeof(TTLValue)) == SOCKET_ERROR)
     {
         FormatOutput(IDS_SETSOCKOPT_FAILED, WSAGetLastError());
-         return FALSE;
+        return FALSE;
     }
 
 
@@ -736,7 +736,8 @@ int wmain(int argc, LPWSTR argv[])
         /* Print statistics */
         FormatOutput(IDS_PING_STATISTICS, TargetIP);
         FormatOutput(IDS_PACKETS_SENT_RECEIVED_LOST,\
-            SentCount, SentCount - LostCount, LostCount, Count);
+                     SentCount, SentCount - LostCount, LostCount, Count);
+
 
         /* Print approximate times or NO approximate times if 100% loss */
         if ((SentCount - LostCount) > 0)
index e138e7c..0cc7ddf 100644 (file)
@@ -2,10 +2,10 @@
 #include <windows.h>
 #include "resource.h"
 
-#define REACTOS_STR_FILE_DESCRIPTION   "ReactOS TCP/IPv4 Win32 Ping\0"
-#define REACTOS_STR_INTERNAL_NAME      "ping\0"
-#define REACTOS_STR_ORIGINAL_FILENAME  "ping.exe\0"
-#define REACTOS_STR_ORIGINAL_COPYRIGHT "Casper S. Hornstrup (chorns@users.sourceforge.net)\0"
+#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS TCP/IPv4 Win32 Ping\0"
+#define REACTOS_STR_INTERNAL_NAME       "ping\0"
+#define REACTOS_STR_ORIGINAL_FILENAME   "ping.exe\0"
+#define REACTOS_STR_ORIGINAL_COPYRIGHT  "Casper S. Hornstrup (chorns@users.sourceforge.net)\0"
 #include <reactos/version.rc>
 
 #include "lang/de-DE.rc"
index b953611..203b037 100644 (file)
@@ -1,6 +1,7 @@
 
 add_definitions(
     -D_WINE
+    -D_USE_MATH_DEFINES
     -D_DLL -D__USE_CRTIMP)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
index 17bbf30..67e6891 100644 (file)
@@ -1,6 +1,7 @@
 
 add_definitions(
     -D__WINESRC__
+    -D_USE_MATH_DEFINES
     -DUSE_WIN32_OPENGL)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
index c11db8b..2260517 100644 (file)
@@ -23,6 +23,7 @@ add_library(avifil32 SHARED
     tmpfile.c
     wavfile.c
     rsrc.rc
+    rsrc-utf8.rc
     ${CMAKE_CURRENT_BINARY_DIR}/avifil32.def)
 
 set_module_type(avifil32 win32dll)
diff --git a/dll/win32/avifil32/rsrc-utf8.rc b/dll/win32/avifil32/rsrc-utf8.rc
new file mode 100644 (file)
index 0000000..1a68e2c
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Top level resource file for avifil32.dll
+ *
+ * Copyright 2002 Michael Günnewig
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "avifile_private.h"
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#define WINE_OLESELFREGISTER
+#define WINE_FILEDESCRIPTION_STR "Wine AVI file support library"
+#define WINE_FILENAME_STR "avifil32.dll"
+#define WINE_FILEVERSION 4,0,3,1998
+#define WINE_FILEVERSION_STR "4.03.1998"
+
+#include "wine/wine_common_ver.rc"
+
+/*
+ * Everything specific to any language goes
+ * in one of the specific files.
+ */
+
+/* UTF-8 */
+#include "avifile_Bg.rc"
+#include "avifile_Da.rc"
+#include "avifile_De.rc"
+#include "avifile_Fr.rc"
+#include "avifile_Ja.rc"
+#include "avifile_Ko.rc"
+#include "avifile_Lt.rc"
+#include "avifile_Pt.rc"
+#include "avifile_Ro.rc"
+#include "avifile_Ru.rc"
+#include "avifile_Si.rc"
+#include "avifile_Zh.rc"
index 1014aad..a0ec2cf 100644 (file)
@@ -46,16 +46,3 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 #include "avifile_Tr.rc"
 #include "avifile_Uk.rc"
 
-/* UTF-8 */
-#include "avifile_Bg.rc"
-#include "avifile_Da.rc"
-#include "avifile_De.rc"
-#include "avifile_Fr.rc"
-#include "avifile_Ja.rc"
-#include "avifile_Ko.rc"
-#include "avifile_Lt.rc"
-#include "avifile_Pt.rc"
-#include "avifile_Ro.rc"
-#include "avifile_Ru.rc"
-#include "avifile_Si.rc"
-#include "avifile_Zh.rc"
index 43750f4..27462da 100644 (file)
@@ -1,6 +1,7 @@
 
 add_definitions(
     -D__WINESRC__
+    -D_USE_MATH_DEFINES
     -D_DLL -D__USE_CRTIMP)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
index ffa2248..fa7bafa 100644 (file)
@@ -7,6 +7,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 add_definitions(
     -D__WINESRC__
+    -D_USE_MATH_DEFINES
     -D_DLL
     -D__USE_CRTIMP)
 
index 78feede..0ef10c4 100644 (file)
@@ -2294,16 +2294,16 @@ CONFIGRET WINAPI CM_Get_First_Log_Conf_Ex(
 
     if (plcLogConf)
     {
-    pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
-    if (pLogConfInfo == NULL)
-        return CR_OUT_OF_MEMORY;
+        pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
+        if (pLogConfInfo == NULL)
+            return CR_OUT_OF_MEMORY;
 
-    pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
-    pLogConfInfo->dnDevInst = dnDevInst;
-    pLogConfInfo->ulFlags = ulFlags;
-    pLogConfInfo->ulTag = ulTag;
+        pLogConfInfo->ulMagic = LOG_CONF_MAGIC;
+        pLogConfInfo->dnDevInst = dnDevInst;
+        pLogConfInfo->ulFlags = ulFlags;
+        pLogConfInfo->ulTag = ulTag;
 
-    *plcLogConf = (LOG_CONF)pLogConfInfo;
+        *plcLogConf = (LOG_CONF)pLogConfInfo;
     }
 
     return CR_SUCCESS;
index 0b30a21..467ca07 100644 (file)
@@ -31,12 +31,12 @@ static HFONT hIconTitleFont;
 const struct builtin_class_descr ICONTITLE_builtin_class =
 {
     WC_ICONTITLE,     /* name */
-    0,                    /* style */
-    NULL,                 /* procA (winproc is Unicode only) */
-    IconTitleWndProc,     /* procW */
-    0,                    /* extra */
-    IDC_ARROW,            /* cursor */
-    0                     /* brush */
+    0,                /* style */
+    NULL,             /* procA (winproc is Unicode only) */
+    IconTitleWndProc, /* procW */
+    0,                /* extra */
+    IDC_ARROW,        /* cursor */
+    0                 /* brush */
 };
 
 
index c598d00..df665d1 100644 (file)
@@ -342,154 +342,154 @@ IntGetWndProc(PWND pWnd, BOOL Ansi)
 static ULONG_PTR FASTCALL
 IntGetClassLongA(PWND Wnd, PCLS Class, int nIndex)
 {
-    ULONG_PTR Ret = 0;
+       ULONG_PTR Ret = 0;
 
-            if (nIndex >= 0)
-            {
-                if (nIndex + sizeof(ULONG_PTR) < nIndex ||
-                    nIndex + sizeof(ULONG_PTR) > Class->cbclsExtra)
-                {
-                    SetLastError(ERROR_INVALID_PARAMETER);
-                }
-                else
-                    Ret = *(PULONG_PTR)((ULONG_PTR)(Class + 1) + nIndex);
-            }
-            else
-            {
-                switch (nIndex)
-                {
-                    case GCL_CBWNDEXTRA:
-                        Ret = (ULONG_PTR)Class->cbwndExtra;
-                        break;
-
-                    case GCL_CBCLSEXTRA:
-                        Ret = (ULONG_PTR)Class->cbclsExtra;
-                        break;
-
-                    case GCL_HBRBACKGROUND:
-                        Ret = (ULONG_PTR)Class->hbrBackground;
-                        if (Ret != 0 && Ret < 0x4000)
-                            Ret = (ULONG_PTR)GetSysColorBrush((ULONG)Ret - 1);
-                        break;
-
-                    case GCL_HMODULE:
-                        //ERR("Cls 0x%x GCL_HMODULE 0x%x\n", Wnd->pcls, Class->hModule);
-                        Ret = (ULONG_PTR)Class->hModule;
-                        break;
-
-                    case GCL_MENUNAME:
-                        Ret = (ULONG_PTR)Class->lpszClientAnsiMenuName;
-                        break;
-
-                    case GCL_STYLE:
-                        Ret = (ULONG_PTR)Class->style;
-                        break;
-
-                    case GCW_ATOM:
-                        Ret = (ULONG_PTR)Class->atomClassName;
-                        break;
-
-                    case GCLP_HCURSOR:
-                        /* FIXME - get handle from pointer to CURSOR object */
-                        Ret = (ULONG_PTR)Class->hCursor;
-                        break;
-
-                    case GCLP_HICON:
-                        /* FIXME - get handle from pointer to ICON object */
-                        Ret = (ULONG_PTR)Class->hIcon;
-                        break;
-
-                    case GCLP_HICONSM:
-                        /* FIXME - get handle from pointer to ICON object */
-                        Ret = (ULONG_PTR)Class->hIconSm;
-                        break;
-
-                    case GCLP_WNDPROC:
-                        Ret = IntGetClsWndProc(Wnd, Class, TRUE);
-                        break;
-
-                    default:
-                        SetLastError(ERROR_INVALID_INDEX);
-                        break;
-                }
-            }
+    if (nIndex >= 0)
+    {
+        if (nIndex + sizeof(ULONG_PTR) < nIndex ||
+            nIndex + sizeof(ULONG_PTR) > Class->cbclsExtra)
+        {
+            SetLastError(ERROR_INVALID_PARAMETER);
+        }
+        else
+            Ret = *(PULONG_PTR)((ULONG_PTR)(Class + 1) + nIndex);
+    }
+    else
+    {
+        switch (nIndex)
+        {
+            case GCL_CBWNDEXTRA:
+                Ret = (ULONG_PTR)Class->cbwndExtra;
+                break;
+
+            case GCL_CBCLSEXTRA:
+                Ret = (ULONG_PTR)Class->cbclsExtra;
+                break;
+
+            case GCL_HBRBACKGROUND:
+                Ret = (ULONG_PTR)Class->hbrBackground;
+                if (Ret != 0 && Ret < 0x4000)
+                    Ret = (ULONG_PTR)GetSysColorBrush((ULONG)Ret - 1);
+                break;
+
+            case GCL_HMODULE:
+                //ERR("Cls 0x%x GCL_HMODULE 0x%x\n", Wnd->pcls, Class->hModule);
+                Ret = (ULONG_PTR)Class->hModule;
+                break;
+
+            case GCL_MENUNAME:
+                Ret = (ULONG_PTR)Class->lpszClientAnsiMenuName;
+                break;
+
+            case GCL_STYLE:
+                Ret = (ULONG_PTR)Class->style;
+                break;
+
+            case GCW_ATOM:
+                Ret = (ULONG_PTR)Class->atomClassName;
+                break;
+
+            case GCLP_HCURSOR:
+                /* FIXME - get handle from pointer to CURSOR object */
+                Ret = (ULONG_PTR)Class->hCursor;
+                break;
+
+            case GCLP_HICON:
+                /* FIXME - get handle from pointer to ICON object */
+                Ret = (ULONG_PTR)Class->hIcon;
+                break;
+
+            case GCLP_HICONSM:
+                /* FIXME - get handle from pointer to ICON object */
+                Ret = (ULONG_PTR)Class->hIconSm;
+                break;
+
+            case GCLP_WNDPROC:
+                Ret = IntGetClsWndProc(Wnd, Class, TRUE);
+                break;
+
+            default:
+                SetLastError(ERROR_INVALID_INDEX);
+                break;
+        }
+    }
 
-    return Ret;
+       return Ret;
 }
 
 static ULONG_PTR FASTCALL
 IntGetClassLongW (PWND Wnd, PCLS Class, int nIndex)
 {
-    ULONG_PTR Ret = 0;
+       ULONG_PTR Ret = 0;
 
-            if (nIndex >= 0)
-            {
-                if (nIndex + sizeof(ULONG_PTR) < nIndex ||
-                    nIndex + sizeof(ULONG_PTR) > Class->cbclsExtra)
-                {
-                    SetLastError(ERROR_INVALID_PARAMETER);
-                }
-                else
-                    Ret = *(PULONG_PTR)((ULONG_PTR)(Class + 1) + nIndex);
-            }
-            else
-            {
-                switch (nIndex)
-                {
-                    case GCL_CBWNDEXTRA:
-                        Ret = (ULONG_PTR)Class->cbwndExtra;
-                        break;
+    if (nIndex >= 0)
+    {
+        if (nIndex + sizeof(ULONG_PTR) < nIndex ||
+            nIndex + sizeof(ULONG_PTR) > Class->cbclsExtra)
+        {
+            SetLastError(ERROR_INVALID_PARAMETER);
+        }
+        else
+            Ret = *(PULONG_PTR)((ULONG_PTR)(Class + 1) + nIndex);
+    }
+    else
+    {
+        switch (nIndex)
+        {
+            case GCL_CBWNDEXTRA:
+                Ret = (ULONG_PTR)Class->cbwndExtra;
+                break;
 
-                    case GCL_CBCLSEXTRA:
-                        Ret = (ULONG_PTR)Class->cbclsExtra;
-                        break;
+            case GCL_CBCLSEXTRA:
+                Ret = (ULONG_PTR)Class->cbclsExtra;
+                break;
 
             case GCLP_HBRBACKGROUND:
-                        Ret = (ULONG_PTR)Class->hbrBackground;
-                        if (Ret != 0 && Ret < 0x4000)
-                            Ret = (ULONG_PTR)GetSysColorBrush((ULONG)Ret - 1);
-                        break;
+                Ret = (ULONG_PTR)Class->hbrBackground;
+                if (Ret != 0 && Ret < 0x4000)
+                    Ret = (ULONG_PTR)GetSysColorBrush((ULONG)Ret - 1);
+                break;
 
-                    case GCL_HMODULE:
-                        Ret = (ULONG_PTR)Class->hModule;
-                        break;
+            case GCL_HMODULE:
+                Ret = (ULONG_PTR)Class->hModule;
+                break;
 
             case GCLP_MENUNAME:
-                        Ret = (ULONG_PTR)Class->lpszClientUnicodeMenuName;
-                        break;
-
-                    case GCL_STYLE:
-                        Ret = (ULONG_PTR)Class->style;
-                        break;
-
-                    case GCW_ATOM:
-                        Ret = (ULONG_PTR)Class->atomClassName;
-                        break;
-
-                    case GCLP_HCURSOR:
-                        /* FIXME - get handle from pointer to CURSOR object */
-                        Ret = (ULONG_PTR)Class->hCursor;
-                        break;
-
-                    case GCLP_HICON:
-                        /* FIXME - get handle from pointer to ICON object */
-                        Ret = (ULONG_PTR)Class->hIcon;
-                        break;
-
-                    case GCLP_HICONSM:
-                        /* FIXME - get handle from pointer to ICON object */
-                        Ret = (ULONG_PTR)Class->hIconSm;
-                        break;
-
-                    case GCLP_WNDPROC:
-                        Ret = IntGetClsWndProc(Wnd, Class, FALSE);
-                        break;
-
-                    default:
-                        SetLastError(ERROR_INVALID_INDEX);
-                        break;
-                }
-            }
+                Ret = (ULONG_PTR)Class->lpszClientUnicodeMenuName;
+                break;
+
+            case GCL_STYLE:
+                Ret = (ULONG_PTR)Class->style;
+                break;
+
+            case GCW_ATOM:
+                Ret = (ULONG_PTR)Class->atomClassName;
+                break;
+
+            case GCLP_HCURSOR:
+                /* FIXME - get handle from pointer to CURSOR object */
+                Ret = (ULONG_PTR)Class->hCursor;
+                break;
+
+            case GCLP_HICON:
+                /* FIXME - get handle from pointer to ICON object */
+                Ret = (ULONG_PTR)Class->hIcon;
+                break;
+
+            case GCLP_HICONSM:
+                /* FIXME - get handle from pointer to ICON object */
+                Ret = (ULONG_PTR)Class->hIconSm;
+                break;
+
+            case GCLP_WNDPROC:
+                Ret = IntGetClsWndProc(Wnd, Class, FALSE);
+                break;
+
+            default:
+                SetLastError(ERROR_INVALID_INDEX);
+                break;
+        }
+    }
 
        return Ret;
 }
@@ -531,7 +531,7 @@ GetClassLongA(HWND hWnd, int nIndex)
                                default:
                                        Ret = IntGetClassLongA(Wnd, Class, nIndex);
                                        break;
-        }
+                       }
 #else
                        Ret = IntGetClassLongA(Wnd, Class, nIndex);
 #endif
@@ -623,7 +623,7 @@ GetClassLongPtrA(HWND hWnd,
 
     Wnd = ValidateHwnd(hWnd);
     if (!Wnd)
-    return 0;
+        return 0;
 
     _SEH2_TRY
     {
@@ -662,7 +662,7 @@ GetClassLongPtrW(HWND hWnd,
 
     Wnd = ValidateHwnd(hWnd);
     if (!Wnd)
-    return 0;
+        return 0;
 
     _SEH2_TRY
     {
index 009a847..32b0ffd 100644 (file)
@@ -1176,7 +1176,7 @@ HICON WINAPI CreateIcon(
     if (bPlanes * bBitsPixel > 1)
     {
         iinfo.hbmColor = CreateBitmap( nWidth, nHeight, bPlanes, bBitsPixel, lpXORbits );
-    iinfo.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits );
+        iinfo.hbmMask = CreateBitmap( nWidth, nHeight, 1, 1, lpANDbits );
     }
     else
     {
index 02dd3e7..645f4cb 100644 (file)
@@ -48,10 +48,10 @@ EhciDefferedRoutine(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVO
         PQUEUE_HEAD CompletedQH, NextQH;
         PQUEUE_TRANSFER_DESCRIPTOR CompletedTD, NextTD;
         
-               /* AsyncListAddr Register will have the next QueueHead to execute */
+        /* AsyncListAddr Register will have the next QueueHead to execute */
         CurrentAddr = GetAsyncListQueueRegister(hcd);
 
-               /* Calculate the VA for the next QueueHead */
+        /* Calculate the VA for the next QueueHead */
         OffSet = CurrentAddr - (ULONG)FdoDeviceExtension->hcd.CommonBufferPA.LowPart;
         NextQH = (PQUEUE_HEAD)((ULONG)FdoDeviceExtension->hcd.CommonBufferVA + OffSet);
 
@@ -62,14 +62,14 @@ EhciDefferedRoutine(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVO
 
         //DumpQueueHead(CompletedQH);
 
-               /* Free memory for the Descriptors */
+        /* Free memory for the Descriptors */
         CompletedTD = CompletedQH->TransferDescriptor;
         NextTD = CompletedTD;
         while (NextTD)
         {
             CompletedTD = NextTD;
             NextTD = NextTD->NextDescriptor;
-        FreeDescriptor(CompletedTD);
+            FreeDescriptor(CompletedTD);
         }
         
         /* If the Event is set then release waiter */
@@ -80,19 +80,19 @@ EhciDefferedRoutine(PKDPC Dpc, PVOID DeferredContext, PVOID SystemArgument1, PVO
 
         /* Free the Mdl if there was one */
         if(CompletedQH->MdlToFree)
-        IoFreeMdl(CompletedQH->MdlToFree);
+            IoFreeMdl(CompletedQH->MdlToFree);
 
         /* Is there an IRP that needs to be completed */
         if (CompletedQH->IrpToComplete)
         {
-            PIRP Irp; 
-                PIO_STACK_LOCATION Stack;
-                PURB Urb;
+            PIRP Irp;     
+            PIO_STACK_LOCATION Stack;
+            PURB Urb;
 
             Irp = CompletedQH->IrpToComplete;            
-                Stack = IoGetCurrentIrpStackLocation(Irp);
-                ASSERT(Stack);
-                Urb = (PURB) Stack->Parameters.Others.Argument1;
+            Stack = IoGetCurrentIrpStackLocation(Irp);
+            ASSERT(Stack);
+            Urb = (PURB) Stack->Parameters.Others.Argument1;
 
             /* Check for error */
             if (CStatus & EHCI_ERROR_INT)
index 4f43c5e..fa77f1c 100644 (file)
@@ -538,7 +538,8 @@ NTSTATUS HandleUrbRequest(PPDO_DEVICE_EXTENSION PdoDeviceExtension, PIRP Irp)
                     }
 
                     if (!(PdoDeviceExtension->Ports[Urb->UrbControlVendorClassRequest.Index-1].PortStatus & 0x8000))
-                    CompletePendingURBRequest(PdoDeviceExtension);
+                        CompletePendingURBRequest(PdoDeviceExtension);
+
 
                     break;
                 }
@@ -635,19 +636,19 @@ CompletePendingURBRequest(PPDO_DEVICE_EXTENSION DeviceExtension)
         KeReleaseSpinLock(&DeviceExtension->IrpQueueLock, oldIrql);
         return;
     }
-        NextIrp = RemoveHeadList(&DeviceExtension->IrpQueue);
-        Irp = CONTAINING_RECORD(NextIrp, IRP, Tail.Overlay.ListEntry);
+    NextIrp = RemoveHeadList(&DeviceExtension->IrpQueue);
+    Irp = CONTAINING_RECORD(NextIrp, IRP, Tail.Overlay.ListEntry);
 
-        if (!Irp)
-        {
+    if (!Irp)
+    {
         DPRINT1("No Irp\n");
         return;
-        }
+    }
 
-        IoSetCancelRoutine(Irp, NULL);
-        KeReleaseSpinLock(&DeviceExtension->IrpQueueLock, oldIrql);
+    IoSetCancelRoutine(Irp, NULL);
+    KeReleaseSpinLock(&DeviceExtension->IrpQueueLock, oldIrql);
 
-        HandleUrbRequest(DeviceExtension, Irp);
-        IoCompleteRequest(Irp, IO_NO_INCREMENT);
+    HandleUrbRequest(DeviceExtension, Irp);
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 }
 
index 4d33726..d129b00 100644 (file)
@@ -159,18 +159,18 @@ SubmitControlTransfer(PEHCI_HOST_CONTROLLER hcd,
 
     if (TransferBuffer)
     {
-    /* Allocate Mdl for Buffer */
-    pMdl = IoAllocateMdl(TransferBuffer,
-                         TransferBufferLength,
-                         FALSE,
-                         FALSE,
-                         NULL);
-
-    /* Lock Physical Pages */
-    MmBuildMdlForNonPagedPool(pMdl);
-    //MmProbeAndLockPages(pMdl, KernelMode, IoReadAccess);
-
-    MdlPhysicalAddr = MmGetPhysicalAddress((PVOID)TransferBuffer).LowPart;
+        /* Allocate Mdl for Buffer */
+        pMdl = IoAllocateMdl(TransferBuffer,
+                             TransferBufferLength,
+                             FALSE,
+                             FALSE,
+                             NULL);
+
+        /* Lock Physical Pages */
+        MmBuildMdlForNonPagedPool(pMdl);
+        //MmProbeAndLockPages(pMdl, KernelMode, IoReadAccess);
+
+        MdlPhysicalAddr = MmGetPhysicalAddress((PVOID)TransferBuffer).LowPart;
     }
 
     QueueHead = CreateQueueHead(hcd);
@@ -187,8 +187,8 @@ SubmitControlTransfer(PEHCI_HOST_CONTROLLER hcd,
 
     if (TransferBuffer)
     {
-    Descriptor[1] = CreateDescriptor(hcd,
-                                     PID_CODE_IN_TOKEN,
+        Descriptor[1] = CreateDescriptor(hcd,
+                                         PID_CODE_IN_TOKEN,
                                          TransferBufferLength);        
     }
 
@@ -202,10 +202,10 @@ SubmitControlTransfer(PEHCI_HOST_CONTROLLER hcd,
 
     if (TransferBuffer)
     {
-    Descriptor[0]->NextDescriptor = Descriptor[1];
-    Descriptor[1]->NextDescriptor = Descriptor[2];
-    Descriptor[1]->PreviousDescriptor = Descriptor[0];
-    Descriptor[2]->PreviousDescriptor = Descriptor[1];
+        Descriptor[0]->NextDescriptor = Descriptor[1];
+        Descriptor[1]->NextDescriptor = Descriptor[2];
+        Descriptor[1]->PreviousDescriptor = Descriptor[0];
+        Descriptor[2]->PreviousDescriptor = Descriptor[1];
     }
     else
     {
@@ -218,8 +218,8 @@ SubmitControlTransfer(PEHCI_HOST_CONTROLLER hcd,
 
     if (TransferBuffer)
     {        
-    Descriptor[1]->BufferPointer[0] = MdlPhysicalAddr;
-    Descriptor[0]->NextPointer = Descriptor[1]->PhysicalAddr;
+        Descriptor[1]->BufferPointer[0] = MdlPhysicalAddr;
+        Descriptor[0]->NextPointer = Descriptor[1]->PhysicalAddr;
         Descriptor[1]->NextPointer = Descriptor[2]->PhysicalAddr;   
     }
     else
index b535387..0ba36bd 100644 (file)
@@ -4,7 +4,7 @@
 #include <ntifs.h>
 #include <ntddk.h>
 #include <stdio.h>
-#define        NDEBUG
+#define NDEBUG
 #include <debug.h>
 #include <hubbusif.h>
 #include <usbioctl.h>
 
 #define USB_POOL_TAG (ULONG)'ebsu'
 
-#define        DEVICEINTIALIZED                0x01
-#define        DEVICESTARTED                   0x02
-#define        DEVICEBUSY                      0x04
-#define DEVICESTOPPED                  0x08
-#define DEVICESTALLED          0x10
+#define DEVICEINTIALIZED        0x01
+#define DEVICESTARTED           0x02
+#define DEVICEBUSY              0x04
+#define DEVICESTOPPED           0x08
+#define DEVICESTALLED           0x10
+#define DEVICEREMOVED           0x20
 #define DEVICEREMOVED           0x20
 
 
-#define        MAX_USB_DEVICES                 127
-#define        EHCI_MAX_SIZE_TRANSFER          0x100000
+#define        MAX_USB_DEVICES         127
+#define        EHCI_MAX_SIZE_TRANSFER  0x100000
 
 #define C_HUB_LOCAL_POWER   0
 #define C_HUB_OVER_CURRENT  1
index 43bdd66..6f49320 100644 (file)
@@ -338,7 +338,7 @@ RemoveUsbDevice(PVOID BusContext, PUSB_DEVICE_HANDLE DeviceHandle, ULONG Flags)
         case USBD_MARK_DEVICE_BUSY:
             UsbDevice->DeviceState |= DEVICEBUSY;
             /* Fall through */
-       case USBD_KEEP_DEVICE_DATA:
+        case USBD_KEEP_DEVICE_DATA:
             UsbDevice->DeviceState |= DEVICEREMOVED;
             break;
         default:
@@ -469,9 +469,9 @@ QueryDeviceInformation(PVOID BusContext,
     }
     else
     {
-    DeviceInfo->CurrentConfigurationValue = UsbDevice->ActiveConfig->ConfigurationDescriptor.bConfigurationValue;
+        DeviceInfo->CurrentConfigurationValue = UsbDevice->ActiveConfig->ConfigurationDescriptor.bConfigurationValue;
         /* FIXME: Use correct number of open pipes instead of all available */
-    DeviceInfo->NumberOfOpenPipes = UsbDevice->ActiveInterface->InterfaceDescriptor.bNumEndpoints;
+        DeviceInfo->NumberOfOpenPipes = UsbDevice->ActiveInterface->InterfaceDescriptor.bNumEndpoints;
         DeviceInfo->PortNumber = UsbDevice->Port;
     }
 
index fe4b4bc..94c0d65 100644 (file)
@@ -40,179 +40,167 @@ extern "C" {
 #define _UNDERFLOW 4
 #define _TLOSS 5
 #define _PLOSS 6
-
 #define EDOM 33
 #define ERANGE 34
 
   _CRTIMP extern double _HUGE;
 
 #define HUGE_VAL _HUGE
+#define _matherrl _matherr
 
 #ifndef _CRT_ABS_DEFINED
 #define _CRT_ABS_DEFINED
-  int __cdecl abs(int _X);
-  long __cdecl labs(long _X);
+  int __cdecl abs(int x);
+  long __cdecl labs(long x);
 #endif
-  double __cdecl acos(double _X);
-  double __cdecl asin(double _X);
-  double __cdecl atan(double _X);
-  double __cdecl atan2(double _Y,double _X);
-#ifndef _SIGN_DEFINED
-#define _SIGN_DEFINED
-  _CRTIMP double __cdecl _copysign (double _Number,double _Sign);
-  _CRTIMP double __cdecl _chgsign (double _X);
+  double __cdecl acos(double x);
+  double __cdecl asin(double x);
+  double __cdecl atan(double x);
+  double __cdecl atan2(double y, double x);
+  double __cdecl cos(double x);
+  double __cdecl cosh(double x);
+  double __cdecl exp(double x);
+  double __cdecl fabs(double x);
+  double __cdecl fmod(double x, double y);
+  double __cdecl log(double x);
+  double __cdecl log10(double x);
+  double __cdecl pow(double x, double y);
+  double __cdecl sin(double x);
+  double __cdecl sinh(double x);
+  double __cdecl sqrt(double x);
+  double __cdecl tan(double x);
+  double __cdecl tanh(double x);
+#ifndef _CRT_MATHERR_DEFINED
+#define _CRT_MATHERR_DEFINED
+  int __cdecl _matherr(struct _exception *except);
 #endif
-  double __cdecl cos(double _X);
-  double __cdecl cosh(double _X);
-  double __cdecl exp(double _X);
-  double expm1(double _X);
-  double __cdecl fabs(double _X);
-  double __cdecl fmod(double _X,double _Y);
-  double __cdecl log(double _X);
-  double __cdecl log10(double _X);
-  double __cdecl pow(double _X,double _Y);
-  double __cdecl sin(double _X);
-  double __cdecl sinh(double _X);
-  double __cdecl tan(double _X);
-  double __cdecl tanh(double _X);
-  double __cdecl sqrt(double _X);
+
 #ifndef _CRT_ATOF_DEFINED
 #define _CRT_ATOF_DEFINED
-  double __cdecl atof(const char *_String);
-  double __cdecl _atof_l(const char *_String,_locale_t _Locale);
+  _CRTIMP double __cdecl atof(const char *str);
+  _CRTIMP double __cdecl _atof_l(const char *str ,_locale_t locale);
 #endif
-
-  _CRTIMP double __cdecl _cabs(struct _complex _ComplexA);
-  _CRTIMP double __cdecl ceil(double _X);
-  _CRTIMP double __cdecl floor(double _X);
-  _CRTIMP double __cdecl frexp(double _X,int *_Y);
-  _CRTIMP double __cdecl _hypot(double _X,double _Y);
-  _CRTIMP double __cdecl _j0(double _X);
-  _CRTIMP double __cdecl _j1(double _X);
-  _CRTIMP double __cdecl _jn(int _X,double _Y);
-  _CRTIMP double __cdecl ldexp(double _X,int _Y);
-#ifndef _CRT_MATHERR_DEFINED
-#define _CRT_MATHERR_DEFINED
-  int __cdecl _matherr(struct _exception *_Except);
+#ifndef _SIGN_DEFINED
+#define _SIGN_DEFINED
+  _CRTIMP double __cdecl _copysign(double x,double sgn);
+  _CRTIMP double __cdecl _chgsign(double x);
 #endif
-  _CRTIMP double __cdecl modf(double _X,double *_Y);
-  _CRTIMP double __cdecl _y0(double _X);
-  _CRTIMP double __cdecl _y1(double _X);
-  _CRTIMP double __cdecl _yn(int _X,double _Y);
+  _CRTIMP double __cdecl _cabs(struct _complex a);
+  _CRTIMP double __cdecl ceil(double x);
+  _CRTIMP double __cdecl floor(double x);
+  _CRTIMP double __cdecl frexp(double x, int *y);
+  _CRTIMP double __cdecl _hypot(double x, double y);
+  _CRTIMP double __cdecl _j0(double x);
+  _CRTIMP double __cdecl _j1(double x);
+  _CRTIMP double __cdecl _jn(int x, double y);
+  _CRTIMP double __cdecl ldexp(double x, int y);
+  _CRTIMP double __cdecl modf(double x, double *y);
+  _CRTIMP double __cdecl _y0(double x);
+  _CRTIMP double __cdecl _y1(double x);
+  _CRTIMP double __cdecl _yn(int x, double y);
+  _CRTIMP float __cdecl _hypotf(float x, float y);
 
 #if defined(__i386__) || defined(_M_IX86)
-  _CRTIMP int __cdecl _set_SSE2_enable(int _Flag);
-  /* from libmingwex */
-  float __cdecl _hypotf(float _X,float _Y);
+  _CRTIMP int __cdecl _set_SSE2_enable(int flag);
 #endif
 
-  float frexpf(float _X,int *_Y);
-  float __cdecl ldexpf(float _X,int _Y);
-  long double __cdecl ldexpl(long double _X,int _Y);
-  float __cdecl acosf(float _X);
-  float __cdecl asinf(float _X);
-   float __cdecl atanf(float _X);
-   float __cdecl atan2f(float _X,float _Y);
-   float __cdecl cosf(float _X);
-   float __cdecl sinf(float _X);
-   float __cdecl tanf(float _X);
-   float __cdecl coshf(float _X);
-   float __cdecl sinhf(float _X);
-   float __cdecl tanhf(float _X);
-   float __cdecl expf(float _X);
-   float expm1f(float _X);
-   float __cdecl logf(float _X);
-   float __cdecl log10f(float _X);
-   float __cdecl modff(float _X,float *_Y);
-   float __cdecl powf(float _X,float _Y);
-   float __cdecl sqrtf(float _X);
-   float __cdecl ceilf(float _X);
-   float __cdecl floorf(float _X);
-  float __cdecl fmodf(float _X,float _Y);
-   float __cdecl _hypotf(float _X,float _Y);
-  float __cdecl fabsf(float _X);
-#if !defined(__ia64__) && !defined(_M_IA64)
-   /* from libmingwex */
-   float __cdecl _copysignf (float _Number,float _Sign);
-   float __cdecl _chgsignf (float _X);
-   float __cdecl _logbf(float _X);
-   float __cdecl _nextafterf(float _X,float _Y);
-   int __cdecl _finitef(float _X);
-   int __cdecl _isnanf(float _X);
-   int __cdecl _fpclassf(float _X);
+#if defined(__x86_64) || defined(_M_AMD64)
+  _CRTIMP float __cdecl _copysignf(float x, float sgn);
+  _CRTIMP float __cdecl _chgsignf(float x);
+  _CRTIMP float __cdecl _logbf(float x);
+  _CRTIMP float __cdecl _nextafterf(float x,float y);
+  _CRTIMP int __cdecl _finitef(float x);
+  _CRTIMP int __cdecl _isnanf(float x);
+  _CRTIMP int __cdecl _fpclassf(float x);
 #endif
 
-#if defined(__GNUC__)
-
-#define __fabs(x, res) \
-  __asm__ ("fabs;" : "=t" (res) : "0" (x))
-
-#elif defined(_MSC_VER)
-
-#define __fabs(x, res) \
-  __asm { fld [(x)] } \
-  __asm { fabs } \
-  __asm { fstp [(res)] }
-
+#if defined(__ia64__) || defined (_M_IA64)
+  _CRTIMP float __cdecl fabsf(float x);
+  _CRTIMP float __cdecl ldexpf(float x, int y);
+  _CRTIMP long double __cdecl tanl(long double x);
+#else
+  __CRT_INLINE float __cdecl fabsf(float x) { return ((float)fabs((double)x)); }
+  __CRT_INLINE float __cdecl ldexpf(float x, int expn) { return (float)ldexp (x, expn); }
+  __CRT_INLINE long double tanl(long double x) { return (tan((double)x)); }
 #endif
 
-  __CRT_INLINE long double __cdecl fabsl (long double x)
-  {
-    long double res;
-    __fabs(x, res);
-    return res;
-  }
-
-  __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); }
-  __CRT_INLINE long double _copysignl(long double _Number,long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); }
-  __CRT_INLINE long double _hypotl(long double _X,long double _Y) { return _hypot((double)(_X),(double)(_Y)); }
-  __CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }
-
-#if !defined (__ia64__) && !defined (_M_IA64)
-  __CRT_INLINE float __cdecl fabsf (float x)
-  {
-    float res;
-    __fabs(x, res);
-    return res;
+#if defined(__x86_64) || defined(_M_AMD64) || \
+    defined (__ia64__) || defined (_M_IA64)
+  _CRTIMP float __cdecl acosf(float x);
+  _CRTIMP float __cdecl asinf(float x);
+  _CRTIMP float __cdecl atanf(float x);
+  _CRTIMP float __cdecl atan2f(float x, float y);
+  _CRTIMP float __cdecl ceilf(float x);
+  _CRTIMP float __cdecl cosf(float x);
+  _CRTIMP float __cdecl coshf(float x);
+  _CRTIMP float __cdecl expf(float x);
+  _CRTIMP float __cdecl floorf(float x);
+  _CRTIMP float __cdecl fmodf(float x, float y);
+  _CRTIMP float __cdecl logf(float x);
+  _CRTIMP float __cdecl log10f(float x);
+  _CRTIMP float __cdecl modff(float x, float *y);
+  _CRTIMP float __cdecl powf(float b, float e);
+  _CRTIMP float __cdecl sinf(float x);
+  _CRTIMP float __cdecl sinhf(float x);
+  _CRTIMP float __cdecl sqrtf(float x);
+  _CRTIMP float __cdecl tanf(float x);
+  _CRTIMP float __cdecl tanhf(float x);
+#else
+  __CRT_INLINE float acosf(float x) { return ((float)acos((double)x)); }
+  __CRT_INLINE float asinf(float x) { return ((float)asin((double)x)); }
+  __CRT_INLINE float atanf(float x) { return ((float)atan((double)x)); }
+  __CRT_INLINE float atan2f(float x,float y) { return ((float)atan2((double)x,(double)y)); }
+  __CRT_INLINE float ceilf(float x) { return ((float)ceil((double)x)); }
+  __CRT_INLINE float cosf(float x) { return ((float)cos((double)x)); }
+  __CRT_INLINE float coshf(float x) { return ((float)cosh((double)x)); }
+  __CRT_INLINE float expf(float x) { return ((float)exp((double)x)); }
+  __CRT_INLINE float floorf(float x) { return ((float)floor((double)x)); }
+  __CRT_INLINE float fmodf(float x,float y) { return ((float)fmod((double)x,(double)y)); }
+  __CRT_INLINE float logf(float x) { return ((float)log((double)x)); }
+  __CRT_INLINE float log10f(float x) { return ((float)log10((double)x)); }
+  __CRT_INLINE float modff(float x,float *y) {
+    double _Di,_Df = modf((double)x,&_Di);
+    *y = (float)_Di;
+    return ((float)_Df);
   }
-
-  __CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp (x, expn); }
+  __CRT_INLINE float powf(float x,float y) { return ((float)pow((double)x,(double)y)); }
+  __CRT_INLINE float sinf(float x) { return ((float)sin((double)x)); }
+  __CRT_INLINE float sinhf(float x) { return ((float)sinh((double)x)); }
+  __CRT_INLINE float sqrtf(float x) { return ((float)sqrt((double)x)); }
+  __CRT_INLINE float tanf(float x) { return ((float)tan((double)x)); }
+  __CRT_INLINE float tanhf(float x) { return ((float)tanh((double)x)); }
 #endif
 
-#define _matherrl _matherr
-
-  __CRT_INLINE long double modfl(long double _X,long double *_Y) {
-    double _Di,_Df = modf((double)_X,&_Di);
-    *_Y = (long double)_Di;
+  __CRT_INLINE long double acosl(long double x) { return (acos((double)x)); }
+  __CRT_INLINE long double asinl(long double x) { return (asin((double)x)); }
+  __CRT_INLINE long double atanl(long double x) { return (atan((double)x)); }
+  __CRT_INLINE long double atan2l(long double y, long double x) { return (atan2((double)y, (double)x)); }
+  __CRT_INLINE long double ceill(long double x) { return (ceil((double)x)); }
+  __CRT_INLINE long double cosl(long double x) { return (cos((double)x)); }
+  __CRT_INLINE long double coshl(long double x) { return (cosh((double)x)); }
+  __CRT_INLINE long double expl(long double x) { return (exp((double)x)); }
+  __CRT_INLINE long double floorl(long double x) { return (floor((double)x)); }
+  __CRT_INLINE long double fmodl(long double x, long double y) { return (fmod((double)x, (double)y)); }
+  __CRT_INLINE long double frexpl(long double x, int *y) { return (frexp((double)x, y)); }
+  __CRT_INLINE long double logl(long double x) { return (log((double)x)); }
+  __CRT_INLINE long double log10l(long double x) { return (log10((double)x)); }
+  __CRT_INLINE long double powl(long double x, long double y) { return (pow((double)x, (double)y)); }
+  __CRT_INLINE long double sinl(long double x) { return (sin((double)x)); }
+  __CRT_INLINE long double sinhl(long double x) { return (sinh((double)x)); }
+  __CRT_INLINE long double sqrtl(long double x) { return (sqrt((double)x)); }
+  __CRT_INLINE long double tanhl(long double x) {return (tanh((double)x)); }
+  __CRT_INLINE long double __cdecl fabsl(long double x) { return fabs((double)x); }
+  __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); }
+  __CRT_INLINE long double _copysignl(long double _Number, long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); }
+  __CRT_INLINE long double _hypotl(long double x,long double y) { return _hypot((double)(x),(double)(y)); }
+  __CRT_INLINE float frexpf(float x, int *y) { return ((float)frexp((double)x,y)); }
+  __CRT_INLINE long double ldexpl(long double x, int y) { return ldexp((double)x, y); }
+  __CRT_INLINE long double modfl(long double x,long double *y) {
+    double _Di,_Df = modf((double)x,&_Di);
+    *y = (long double)_Di;
     return (_Df);
   }
 
-#if !defined(__x86_64) && !defined(_M_AMD64)
-  __CRT_INLINE float acosf(float _X) { return ((float)acos((double)_X)); }
-  __CRT_INLINE float asinf(float _X) { return ((float)asin((double)_X)); }
-  __CRT_INLINE float atanf(float _X) { return ((float)atan((double)_X)); }
-  __CRT_INLINE float atan2f(float _X,float _Y) { return ((float)atan2((double)_X,(double)_Y)); }
-  __CRT_INLINE float ceilf(float _X) { return ((float)ceil((double)_X)); }
-  __CRT_INLINE float cosf(float _X) { return ((float)cos((double)_X)); }
-  __CRT_INLINE float coshf(float _X) { return ((float)cosh((double)_X)); }
-  __CRT_INLINE float expf(float _X) { return ((float)exp((double)_X)); }
-  __CRT_INLINE float floorf(float _X) { return ((float)floor((double)_X)); }
-  __CRT_INLINE float fmodf(float _X,float _Y) { return ((float)fmod((double)_X,(double)_Y)); }
-  __CRT_INLINE float logf(float _X) { return ((float)log((double)_X)); }
-  __CRT_INLINE float log10f(float _X) { return ((float)log10((double)_X)); }
-  __CRT_INLINE float modff(float _X,float *_Y) {
-    double _Di,_Df = modf((double)_X,&_Di);
-    *_Y = (float)_Di;
-    return ((float)_Df);
-  }
-  __CRT_INLINE float powf(float _X,float _Y) { return ((float)pow((double)_X,(double)_Y)); }
-  __CRT_INLINE float sinf(float _X) { return ((float)sin((double)_X)); }
-  __CRT_INLINE float sinhf(float _X) { return ((float)sinh((double)_X)); }
-  __CRT_INLINE float sqrtf(float _X) { return ((float)sqrt((double)_X)); }
-  __CRT_INLINE float tanf(float _X) { return ((float)tan((double)_X)); }
-  __CRT_INLINE float tanhf(float _X) { return ((float)tanh((double)_X)); }
-#endif
-
 #ifndef        NO_OLDNAMES
 #define DOMAIN _DOMAIN
 #define SING _SING
@@ -221,540 +209,29 @@ extern "C" {
 #define TLOSS _TLOSS
 #define PLOSS _PLOSS
 #define matherr _matherr
-
-#define HUGE   _HUGE
-  /*   double __cdecl cabs(struct _complex _X); */
-  double __cdecl hypot(double _X,double _Y);
-  __CRT_INLINE float __cdecl hypotf (float x, float y)
-  { return (float) hypot (x, y);}
-  _CRTIMP double __cdecl j0(double _X);
-  _CRTIMP double __cdecl j1(double _X);
-  _CRTIMP double __cdecl jn(int _X,double _Y);
-  _CRTIMP double __cdecl y0(double _X);
-  _CRTIMP double __cdecl y1(double _X);
-  _CRTIMP double __cdecl yn(int _X,double _Y);
-#endif
-
-#ifndef __NO_ISOCEXT
-#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
-  || !defined __STRICT_ANSI__ || defined __GLIBCPP__
-
-#if !defined(_MSC_VER)
-#define NAN (0.0F/0.0F)
-#define HUGE_VALF (1.0F/0.0F)
-#define HUGE_VALL (1.0L/0.0L)
-#define INFINITY (1.0F/0.0F)
-#endif
-
-
-#define FP_NAN         0x0100
-#define FP_NORMAL      0x0400
-#define FP_INFINITE    (FP_NAN | FP_NORMAL)
-#define FP_ZERO                0x4000
-#define FP_SUBNORMAL   (FP_NORMAL | FP_ZERO)
-  /* 0x0200 is signbit mask */
-
-#if defined(__GNUC__)
-
-#define __fxam(x, sw) \
-       __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x))
-
-#elif defined(_MSC_VER)
-
-#define __fxam(x, sw) \
-    __asm { fld [(x)] } \
-    __asm { fxam } \
-    __asm { wait } \
-    __asm { fnstsw [(sw)] } \
-    __asm { fstp st(0) }
-
-#endif
-
-  /*
-  We can't __CRT_INLINE float or double, because we want to ensure truncation
-  to semantic type before classification.
-  (A normal long double value might become subnormal when
-  converted to double, and zero when converted to float.)
-  */
-
-  extern int __cdecl __fpclassifyf (float);
-  extern int __cdecl __fpclassify (double);
-
-  __CRT_INLINE int __cdecl __fpclassifyl (long double x){
-    unsigned short sw;
-    __fxam(x, sw);
-    return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
-  }
-
-  __CRT_INLINE int __cdecl __fpclassify (double x){
-    return __fpclassifyl((long double)x);
-  }
-
-#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x)          \
-  : sizeof (x) == sizeof (double) ? __fpclassify (x) \
-  : __fpclassifyl (x))
-
-  /* 7.12.3.2 */
-#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
-
-  /* 7.12.3.3 */
-/* #define isinf(x) (fpclassify(x) == FP_INFINITE) */
-
-  /* we don't have fpclassify */
-__CRT_INLINE int isinf (double d) {
-  int expon = 0;
-  double val = frexp (d, &expon);
-  if (expon == 1025) {
-    if (val == 0.5) {
-        return 1;
-    } else if (val == -0.5) {
-        return -1;
-    } else {
-        return 0;
-    }
-  } else {
-    return 0;
-  }
-}
-
-  /* 7.12.3.4 */
-  /* We don't need to worry about truncation here:
-  A NaN stays a NaN. */
-
-  __CRT_INLINE int __cdecl __isnan (double _x)
-  {
-    unsigned short sw;
-    __fxam(_x, sw);
-    return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
-      == FP_NAN;
-  }
-
-  __CRT_INLINE int __cdecl __isnanf (float _x)
-  {
-    unsigned short sw;
-    __fxam(_x, sw);
-    return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
-      == FP_NAN;
-  }
-
-  __CRT_INLINE int __cdecl __isnanl (long double _x)
-  {
-    unsigned short sw;
-    __fxam(_x, sw);
-    return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
-      == FP_NAN;
-  }
-
-
-#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x)  \
-  : sizeof (x) == sizeof (double) ? __isnan (x)        \
-  : __isnanl (x))
-
-  /* 7.12.3.5 */
-#define isnormal(x) (fpclassify(x) == FP_NORMAL)
-
-  /* 7.12.3.6 The signbit macro */
-  __CRT_INLINE int __cdecl __signbit (double x) {
-    unsigned short stw;
-    __fxam(x, stw);
-    return stw & 0x0200;
-  }
-
-  __CRT_INLINE int __cdecl __signbitf (float x) {
-    unsigned short stw;
-    __fxam(x, stw);
-    return stw & 0x0200;
-  }
-
-  __CRT_INLINE int __cdecl __signbitl (long double x) {
-    unsigned short stw;
-    __fxam(x, stw);
-    return stw & 0x0200;
-  }
-
-#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x)      \
-  : sizeof (x) == sizeof (double) ? __signbit (x)      \
-  : __signbitl (x))
-
-  extern double __cdecl exp2(double);
-  extern float __cdecl exp2f(float);
-  extern long double __cdecl exp2l(long double);
-
-#define FP_ILOGB0 ((int)0x80000000)
-#define FP_ILOGBNAN ((int)0x80000000)
-  extern int __cdecl ilogb (double);
-  extern int __cdecl ilogbf (float);
-  extern int __cdecl ilogbl (long double);
-
-  extern double __cdecl log1p(double);
-  extern float __cdecl log1pf(float);
-  extern long double __cdecl log1pl(long double);
-
-  extern double __cdecl log2 (double);
-  extern float __cdecl log2f (float);
-  extern long double __cdecl log2l (long double);
-
-  extern double __cdecl logb (double);
-  extern float __cdecl logbf (float);
-  extern long double __cdecl logbl (long double);
-
-#if defined(__GNUC__)
-
-#define __fxtract(x, res) \
-    __asm__ ("fxtract\n\t" \
-      "fstp    %%st" : "=t" (res) : "0" (x))
-
-#elif defined(_MSC_VER)
-
-#define __fxtract(x, res) \
-    __asm { fld [(x)] } \
-    __asm { fxtract } \
-    __asm { fstp st(0) } \
-    __asm { fstp [(res)] }
-
-#endif
-
-  __CRT_INLINE double __cdecl logb (double x)
-  {
-    double res;
-    __fxtract(x, res);
-    return res;
-  }
-
-  __CRT_INLINE float __cdecl logbf (float x)
-  {
-    float res;
-    __fxtract(x, res);
-    return res;
-  }
-
-  __CRT_INLINE long double __cdecl logbl (long double x)
-  {
-    long double res;
-    __fxtract(x, res);
-    return res;
-  }
-
-  /* 7.12.6.13 */
-  extern double __cdecl scalbn (double, int);
-  extern float __cdecl scalbnf (float, int);
-  extern long double __cdecl scalbnl (long double, int);
-
-  extern double __cdecl scalbln (double, long);
-  extern float __cdecl scalblnf (float, long);
-  extern long double __cdecl scalblnl (long double, long);
-
-  /* 7.12.7.1 */
-  /* Implementations adapted from Cephes versions */
-  extern double __cdecl cbrt (double);
-  extern float __cdecl cbrtf (float);
-  extern long double __cdecl cbrtl (long double);
-
-  extern long double __cdecl hypotl (long double, long double);
-
-  extern long double __cdecl powl (long double, long double);
-  extern long double __cdecl expl(long double);
-  extern long double expm1l(long double);
-  extern long double __cdecl coshl(long double);
-  extern long double __cdecl acosl(long double);
-  extern long double __cdecl asinl(long double);
-  extern long double __cdecl atanl(long double);
-  extern long double __cdecl atan2l(long double,long double);
-  extern long double __cdecl sinhl(long double);
-  extern long double __cdecl tanhl(long double);
-
-  /* 7.12.8.1 The erf functions  */
-  extern double __cdecl erf (double);
-  extern float __cdecl erff (float);
-  /* TODO
-  extern long double __cdecl erfl (long double);
-  */
-
-  /* 7.12.8.2 The erfc functions  */
-  extern double __cdecl erfc (double);
-  extern float __cdecl erfcf (float);
-  /* TODO
-  extern long double __cdecl erfcl (long double);
-  */
-
-  /* 7.12.8.3 The lgamma functions */
-  extern double __cdecl lgamma (double);
-  extern float __cdecl lgammaf (float);
-  extern long double __cdecl lgammal (long double);
-
-  /* 7.12.8.4 The tgamma functions */
-  extern double __cdecl tgamma (double);
-  extern float __cdecl tgammaf (float);
-  extern long double __cdecl tgammal (long double);
-
-  extern long double __cdecl ceill (long double);
-  extern long double __cdecl floorl (long double);
-  extern long double __cdecl frexpl(long double,int *);
-  extern long double __cdecl log10l(long double);
-  extern long double __cdecl logl(long double);
-  extern long double __cdecl cosl(long double);
-  extern long double __cdecl sinl(long double);
-  extern long double __cdecl tanl(long double);
-  extern long double sqrtl(long double);
-
-  /* 7.12.9.3 */
-  extern double __cdecl nearbyint ( double);
-  extern float __cdecl nearbyintf (float);
-  extern long double __cdecl nearbyintl (long double);
-
-  /* 7.12.9.4 */
-  /* round, using fpu control word settings */
-#if defined(__GNUC__)
-
-#define __frndint(x, res) \
-  __asm__ ("fabs;" : "=t" (res) : "0" (x))
-
-#elif defined(_MSC_VER)
-
-#define __frndint(x, res) \
-  __asm { fld [(x)] } \
-  __asm { frndint } \
-  __asm { fstp [(res)] }
-
+#define HUGE _HUGE
+  // _CRTIMP double __cdecl cabs(struct _complex x);
+  #define cabs _cabs
+  _CRTIMP double __cdecl hypot(double x,double y);
+  _CRTIMP double __cdecl j0(double x);
+  _CRTIMP double __cdecl j1(double x);
+  _CRTIMP double __cdecl jn(int x,double y);
+  _CRTIMP double __cdecl y0(double x);
+  _CRTIMP double __cdecl y1(double x);
+  _CRTIMP double __cdecl yn(int x,double y);
+  __CRT_INLINE float __cdecl hypotf(float x, float y) { return (float) hypot (x, y); }
 #endif
 
-  __CRT_INLINE double __cdecl rint (double x)
-  {
-    double retval;
-    __frndint(x, retval);
-    return retval;
-  }
-
-  __CRT_INLINE float __cdecl rintf (float x)
-  {
-    float retval;
-    __frndint(x, retval);
-    return retval;
-  }
-
-  __CRT_INLINE long double __cdecl rintl (long double x)
-  {
-    long double retval;
-    __frndint(x, retval);
-    return retval;
-  }
-
-  /* 7.12.9.5 */
-#if defined(__GNUC__)
-
-#define __fistpl(x, res) \
-  __asm__ __volatile__("fistpl %0"  : "=m" (res) : "t" (x) : "st")
-
-#define __fistpll(x, res) \
-  __asm__ __volatile__("fistpll %0"  : "=m" (res) : "t" (x) : "st")
-
-#elif defined(_MSC_VER)
-
-#define __fistpl(x, res) \
-  __asm { fld [(x)] } \
-  __asm { fistp [(res)] }
-
-#define __fistpll(x, res) \
-  __asm { fld [(x)] } \
-  __asm { fistp [(res)] }
-
-#endif
-
-  __CRT_INLINE long __cdecl lrint (double x)
-  {
-    long retval;
-    __fistpl(x, retval);
-    return retval;
-  }
-
-  __CRT_INLINE long __cdecl lrintf (float x)
-  {
-    long retval;
-    __fistpl(x, retval);
-    return retval;
-  }
-
-  __CRT_INLINE long __cdecl lrintl (long double x)
-  {
-    long retval;
-    __fistpl(x, retval);
-    return retval;
-  }
-
-  __MINGW_EXTENSION __CRT_INLINE long long __cdecl llrint (double x)
-  {
-    __MINGW_EXTENSION long long retval;
-    __fistpll(x, retval);
-    return retval;
-  }
-
-  __MINGW_EXTENSION __CRT_INLINE long long __cdecl llrintf (float x)
-  {
-    __MINGW_EXTENSION long long retval;
-    __fistpll(x, retval);
-    return retval;
-  }
-
-  __MINGW_EXTENSION __CRT_INLINE long long __cdecl llrintl (long double x)
-  {
-    __MINGW_EXTENSION long long retval;
-    __fistpll(x, retval);
-    return retval;
-  }
-
-  /* 7.12.9.6 */
-  /* round away from zero, regardless of fpu control word settings */
-  extern double __cdecl round (double);
-  extern float __cdecl roundf (float);
-  extern long double __cdecl roundl (long double);
-
-  /* 7.12.9.7  */
-  extern long __cdecl lround (double);
-  extern long __cdecl lroundf (float);
-  extern long __cdecl lroundl (long double);
-
-  __MINGW_EXTENSION extern long long __cdecl llround (double);
-  __MINGW_EXTENSION extern long long __cdecl llroundf (float);
-  __MINGW_EXTENSION extern long long __cdecl llroundl (long double);
-
-  /* 7.12.9.8 */
-  /* round towards zero, regardless of fpu control word settings */
-  extern double __cdecl trunc (double);
-  extern float __cdecl truncf (float);
-  extern long double __cdecl truncl (long double);
-
-  extern long double __cdecl fmodl (long double, long double);
-
-  /* 7.12.10.2 */
-  extern double __cdecl remainder (double, double);
-  extern float __cdecl remainderf (float, float);
-  extern long double __cdecl remainderl (long double, long double);
-
-  /* 7.12.10.3 */
-  extern double __cdecl remquo(double, double, int *);
-  extern float __cdecl remquof(float, float, int *);
-  extern long double __cdecl remquol(long double, long double, int *);
-
-  /* 7.12.11.1 */
-  extern double __cdecl copysign (double, double); /* in libmoldname.a */
-  extern float __cdecl copysignf (float, float);
-  extern long double __cdecl copysignl (long double, long double);
-
-  /* 7.12.11.2 Return a NaN */
-  extern double __cdecl nan(const char *tagp);
-  extern float __cdecl nanf(const char *tagp);
-  extern long double __cdecl nanl(const char *tagp);
-
-#ifndef __STRICT_ANSI__
-#define _nan() nan("")
-#define _nanf() nanf("")
-#define _nanl() nanl("")
-#endif
-
-  /* 7.12.11.3 */
-  extern double __cdecl nextafter (double, double); /* in libmoldname.a */
-  extern float __cdecl nextafterf (float, float);
-  extern long double __cdecl nextafterl (long double, long double);
-
-  /* 7.12.11.4 The nexttoward functions: TODO */
-
-  /* 7.12.12.1 */
-  /*  x > y ? (x - y) : 0.0  */
-  extern double __cdecl fdim (double x, double y);
-  extern float __cdecl fdimf (float x, float y);
-  extern long double __cdecl fdiml (long double x, long double y);
-
-  /* fmax and fmin.
-  NaN arguments are treated as missing data: if one argument is a NaN
-  and the other numeric, then these functions choose the numeric
-  value. */
-
-  /* 7.12.12.2 */
-  extern double __cdecl fmax  (double, double);
-  extern float __cdecl fmaxf (float, float);
-  extern long double __cdecl fmaxl (long double, long double);
-
-  /* 7.12.12.3 */
-  extern double __cdecl fmin (double, double);
-  extern float __cdecl fminf (float, float);
-  extern long double __cdecl fminl (long double, long double);
-
-  /* 7.12.13.1 */
-  /* return x * y + z as a ternary op */
-  extern double __cdecl fma (double, double, double);
-  extern float __cdecl fmaf (float, float, float);
-  extern long double __cdecl fmal (long double, long double, long double);
-
-
-  /* 7.12.14 */
-  /*
-  *  With these functions, comparisons involving quiet NaNs set the FP
-  *  condition code to "unordered".  The IEEE floating-point spec
-  *  dictates that the result of floating-point comparisons should be
-  *  false whenever a NaN is involved, with the exception of the != op,
-  *  which always returns true: yes, (NaN != NaN) is true).
-  */
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-
-#define isgreater(x, y) __builtin_isgreater(x, y)
-#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
-#define isless(x, y) __builtin_isless(x, y)
-#define islessequal(x, y) __builtin_islessequal(x, y)
-#define islessgreater(x, y) __builtin_islessgreater(x, y)
-#define isunordered(x, y) __builtin_isunordered(x, y)
-
-#else
-  /*  helper  */
-  __CRT_INLINE int  __cdecl
-    __fp_unordered_compare (long double x, long double y){
-      unsigned short retval;
-#if defined(__GNUC__)
-      __asm__ ("fucom %%st(1);"
-       "fnstsw;": "=a" (retval) : "t" (x), "u" (y));
-#elif defined(_MSC_VER)
-      __asm {
-        fld [x]
-        fld [y]
-        fxch st(1)
-        fucom st(1)
-        fnstsw [retval]
-        fstp st(0)
-        fstp st(0)
-      }
-#endif
-      return retval;
-  }
-
-#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
-  & 0x4500) == 0)
-#define isless(x, y) ((__fp_unordered_compare (y, x) \
-  & 0x4500) == 0)
-#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
-  & FP_INFINITE) == 0)
-#define islessequal(x, y) ((__fp_unordered_compare(y, x) \
-  & FP_INFINITE) == 0)
-#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
-  & FP_SUBNORMAL) == 0)
-#define isunordered(x, y) ((__fp_unordered_compare(x, y) \
-  & 0x4500) == 0x4500)
-
-#endif
-
-
-#endif /* __STDC_VERSION__ >= 199901L */
-#endif /* __NO_ISOCEXT */
-
 #ifdef __cplusplus
 }
 extern "C++" {
-  template<class _Ty> inline _Ty _Pow_int(_Ty _X,int _Y) {
+  template<class _Ty> inline _Ty _Pow_int(_Ty x,int y) {
     unsigned int _N;
-    if(_Y >= 0) _N = (unsigned int)_Y;
-    else _N = (unsigned int)(-_Y);
-    for(_Ty _Z = _Ty(1);;_X *= _X) {
-      if((_N & 1)!=0) _Z *= _X;
-      if((_N >>= 1)==0) return (_Y < 0 ? _Ty(1) / _Z : _Z);
+    if(y >= 0) _N = (unsigned int)y;
+    else _N = (unsigned int)(-y);
+    for(_Ty _Z = _Ty(1);;x *= x) {
+      if((_N & 1)!=0) _Z *= x;
+      if((_N >>= 1)==0) return (y < 0 ? _Ty(1) / _Z : _Z);
     }
   }
 }
@@ -762,7 +239,9 @@ extern "C++" {
 
 #pragma pack(pop)
 
-#if !defined(__STRICT_ANSI__) && !defined(_MATH_DEFINES_DEFINED)
+#endif /* !_INC_MATH */
+
+#if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED)
 #define _MATH_DEFINES_DEFINED
 
 #define M_E 2.71828182845904523536
@@ -778,20 +257,5 @@ extern "C++" {
 #define M_2_SQRTPI 1.12837916709551257390
 #define M_SQRT2 1.41421356237309504880
 #define M_SQRT1_2 0.707106781186547524401
-#endif
 
-#ifndef __MINGW_FPCLASS_DEFINED
-#define __MINGW_FPCLASS_DEFINED 1
-#define        _FPCLASS_SNAN   0x0001  /* Signaling "Not a Number" */
-#define        _FPCLASS_QNAN   0x0002  /* Quiet "Not a Number" */
-#define        _FPCLASS_NINF   0x0004  /* Negative Infinity */
-#define        _FPCLASS_NN     0x0008  /* Negative Normal */
-#define        _FPCLASS_ND     0x0010  /* Negative Denormal */
-#define        _FPCLASS_NZ     0x0020  /* Negative Zero */
-#define        _FPCLASS_PZ     0x0040  /* Positive Zero */
-#define        _FPCLASS_PD     0x0080  /* Positive Denormal */
-#define        _FPCLASS_PN     0x0100  /* Positive Normal */
-#define        _FPCLASS_PINF   0x0200  /* Positive Infinity */
-#endif /* __MINGW_FPCLASS_DEFINED */
-
-#endif /* !_INC_MATH */
+#endif /* _USE_MATH_DEFINES */
index 9fa2700..4c78e32 100644 (file)
@@ -1,8 +1,4 @@
 
-add_definitions(
-    -DHAVE_LRINT
-    -DHAVE_LRINTF)
-
 list(APPEND SOURCE
     samplerate.c
     src_linear.c
index 388e3ed..053ed01 100644 (file)
@@ -442,10 +442,12 @@ add_pch(crt ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${CRT_SOURCE})
 add_dependencies(crt psdk buildno_header asm)
 
 list(APPEND LIBCNTPR_SOURCE
+    float/isnan.c
     math/abs.c
     math/div.c
     math/labs.c
     math/rand_nt.c
+    mbstring/mbstrlen.c
     mem/memccpy.c
     mem/memcmp.c
     mem/memicmp.c
@@ -526,6 +528,7 @@ if(ARCH MATCHES i386)
         math/i386/ftol_asm.s
         math/i386/ftol2_asm.s
         math/i386/log_asm.s
+        math/i386/log10_asm.s
         math/i386/pow_asm.s
         math/i386/sin_asm.s
         math/i386/sqrt_asm.s
@@ -634,4 +637,4 @@ add_library(user32_wsprintf
     printf/wvsnprintfA.c
     printf/wvsnprintfW.c
     string/mbstowcs_nt.c
-    string/wcstombs_nt.c)
\ No newline at end of file
+    string/wcstombs_nt.c)
index 779e2ab..b44d03a 100644 (file)
@@ -42,7 +42,7 @@ int CDECL MSVCRT_I10_OUTPUT(long double ld, int prec, int flag, struct _I10_OUTP
     } else
         data->sign = ' ';
 
-    if(isinf(d)) {
+    if(!_finite(d)) {
         data->pos = 1;
         data->len = 5;
         memcpy(data->str, inf_str, sizeof(inf_str));
@@ -50,7 +50,7 @@ int CDECL MSVCRT_I10_OUTPUT(long double ld, int prec, int flag, struct _I10_OUTP
         return 0;
     }
 
-    if(isnan(d)) {
+    if(_isnan(d)) {
         data->pos = 1;
         data->len = 6;
         memcpy(data->str, nan_str, sizeof(nan_str));
index 1aa3e6f..c1f654f 100644 (file)
@@ -217,7 +217,7 @@ format_float(
     }
 
     if (precision > 0 || flags & FLAG_SPECIAL)
-    *--(*string) = _T('.');
+        *--(*string) = _T('.');
 
     /* Digits before the decimal point */
     do
@@ -422,7 +422,7 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
                 /* Check if this is the 2nd 'l' in a row */
                 if (format[-2] == 'l') flags |= FLAG_INT64;
                 else flags |= FLAG_LONG;
-                }
+            }
             else if (chr == _T('I'))
             {
                 if (format[0] == _T('3') && format[1] == _T('2'))
index 51e4d32..c9b41ca 100644 (file)
@@ -43,9 +43,9 @@ PULONG MmGetPageDirectory(VOID);
 #define MiPdeToPte(PDE) ((PMMPTE)MiPteToAddress(PDE))
 #define MiPteToPde(PTE) ((PMMPDE)MiAddressToPte(PTE))
 
-#define ADDR_TO_PAGE_TABLE(v) (((ULONG)(v)) / (1024 * PAGE_SIZE))
+#define ADDR_TO_PAGE_TABLE(v)  (((ULONG)(v)) / (1024 * PAGE_SIZE))
 #define ADDR_TO_PDE_OFFSET(v)  (((ULONG)(v)) / (1024 * PAGE_SIZE))
-#define ADDR_TO_PTE_OFFSET(v)  ((((ULONG)(v)) % (1024 * PAGE_SIZE)) / PAGE_SIZE)
+#define ADDR_TO_PTE_OFFSET(v) ((((ULONG)(v)) % (1024 * PAGE_SIZE)) / PAGE_SIZE)
 
 #define MiGetPdeOffset ADDR_TO_PDE_OFFSET
 
index 298e18a..fd59826 100644 (file)
@@ -109,43 +109,43 @@ MiReserveAlignedSystemPtes(IN ULONG NumberOfPtes,
         NextPte = MmSystemPteBase + PreviousPte->u.List.NextEntry;
         ClusterSize = MI_GET_CLUSTER_SIZE(NextPte);
 
-    //
+        //
         // Check if this cluster contains enough PTEs
-    //
+        //
         if (NumberOfPtes <= ClusterSize)
             break;
 
-    //
+        //
         // On to the next cluster
-    //
+        //
         PreviousPte = NextPte;
     }
 
-        //
+    //
     // Make sure we didn't reach the end of the cluster list
-        //
+    //
     if (PreviousPte->u.List.NextEntry == MM_EMPTY_LIST)
-        {
-            //
+    {
+        //
         // Release the System PTE lock and return failure
-            //
+        //
         KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql);
         return NULL;
     }
 
-            //
+    //
     // Unlink the cluster
-            //
+    //
     PreviousPte->u.List.NextEntry = NextPte->u.List.NextEntry;
 
-                //
+    //
     // Check if the reservation spans the whole cluster
-                //
+    //
     if (ClusterSize == NumberOfPtes)
-                {
-                    //
+    {
+        //
         // Return the first PTE of this cluster
-                    //
+        //
         ReturnPte = NextPte;
 
         //
@@ -155,41 +155,41 @@ MiReserveAlignedSystemPtes(IN ULONG NumberOfPtes,
         {
             NextPte->u.Long = 0;
             NextPte++;
-                }
+        }
         NextPte->u.Long = 0;
     }
-                else
-                {
-                    //
+    else
+    {
+        //
         // Divide the cluster into two parts
-                    //
+        //
         ClusterSize -= NumberOfPtes;
         ReturnPte = NextPte + ClusterSize;
 
-                //
+        //
         // Set the size of the first cluster, zero the second if needed
-                //
+        //
         if (ClusterSize == 1)
         {
             NextPte->u.List.OneEntry = 1;
             ReturnPte->u.Long = 0;
-            }
+        }
         else
         {
             NextPte++;
             NextPte->u.List.NextEntry = ClusterSize;
         }
 
-            //
+        //
         // Step through the cluster list to find out where to insert the first
-            //
+        //
         PreviousPte = &MmFirstFreeSystemPte[SystemPtePoolType];
 
         while (PreviousPte->u.List.NextEntry != MM_EMPTY_LIST)
-            {
-                //
+        {
+            //
             // Get the next cluster
-                //
+            //
             NextPte = MmSystemPteBase + PreviousPte->u.List.NextEntry;
 
             //
@@ -202,30 +202,30 @@ MiReserveAlignedSystemPtes(IN ULONG NumberOfPtes,
             // On to the next cluster
             //
             PreviousPte = NextPte;
-            }
+        }
 
-            //
+        //
         // Retrieve the first cluster and link it back into the cluster list
-            //
+        //
         NextPte = ReturnPte - ClusterSize;
 
         NextPte->u.List.NextEntry = PreviousPte->u.List.NextEntry;
         PreviousPte->u.List.NextEntry = NextPte - MmSystemPteBase;
-        }
+    }
 
-        //
+    //
     // Decrease availability
-        //
+    //
     MmTotalFreeSystemPtes[SystemPtePoolType] -= NumberOfPtes;
 
-            //
+    //
     // Release the System PTE lock
-            //
-            KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql);
+    //
+    KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql);
 
-        //
+    //
     // Flush the TLB
-        //
+    //
     KeFlushProcessTb();
 
     //
@@ -309,23 +309,23 @@ MiReleaseSystemPtes(IN PMMPTE StartingPte,
         NextPte = MmSystemPteBase + PreviousPte->u.List.NextEntry;
         ClusterSize = MI_GET_CLUSTER_SIZE(NextPte);
 
-            //
+        //
         // Check if this cluster is adjacent to the PTEs being released
-            //
+        //
         if ((NextPte + ClusterSize == StartingPte) ||
             (StartingPte + NumberOfPtes == NextPte))
-            {
-                //
+        {
+            //
             // Add the PTEs in the cluster to the PTEs being released
-                //
+            //
             NumberOfPtes += ClusterSize;
 
             if (NextPte < StartingPte)
                 StartingPte = NextPte;
 
-                //
+            //
             // Unlink this cluster and zero it
-                //
+            //
             PreviousPte->u.List.NextEntry = NextPte->u.List.NextEntry;
 
             if (NextPte->u.List.OneEntry == 0)
@@ -335,55 +335,55 @@ MiReleaseSystemPtes(IN PMMPTE StartingPte,
             }
             NextPte->u.Long = 0;
 
-                //
+            //
             // Invalidate the previously found insertion location, if any
-                //
+            //
             InsertPte = NULL;
-            }
-            else
-            {
-                //
+        }
+        else
+        {
+            //
             // Check if the insertion location is right before this cluster
-                //
+            //
             if ((InsertPte == NULL) && (NumberOfPtes <= ClusterSize))
                 InsertPte = PreviousPte;
 
-                //
+            //
             // On to the next cluster
-                //
+            //
             PreviousPte = NextPte;
-                }
+        }
     }
 
-                    //
+    //
     // If no insertion location was found, use the tail of the list
-                    //
+    //
     if (InsertPte == NULL)
         InsertPte = PreviousPte;
 
-            //
+    //
     // Create a new cluster using the PTEs being released
-            //
+    //
     if (NumberOfPtes != 1)
-            {
-                StartingPte->u.List.OneEntry = 0;
+    {
+        StartingPte->u.List.OneEntry = 0;
 
-                NextPte = StartingPte + 1;
+        NextPte = StartingPte + 1;
         NextPte->u.List.NextEntry = NumberOfPtes;
-                }
-                else
+    }
+    else
         StartingPte->u.List.OneEntry = 1;
 
-                //
+    //
     // Link the new cluster into the cluster list at the insertion location
-                //
+    //
     StartingPte->u.List.NextEntry = InsertPte->u.List.NextEntry;
     InsertPte->u.List.NextEntry = StartingPte - MmSystemPteBase;
 
-            //
+    //
     // Release the System PTE lock
-            //
-            KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql);
+    //
+    KeReleaseQueuedSpinLock(LockQueueSystemSpaceLock, OldIrql);
 }
 
 VOID
index ca1fe9a..c692ed3 100644 (file)
@@ -145,16 +145,16 @@ SepPrivilegeCheck(PTOKEN Token,
 
                 /* Check if the privilege is enabled */
                 if (Token->Privileges[j].Attributes & SE_PRIVILEGE_ENABLED)
-                    {
+                {
                     Privileges[i].Attributes |= SE_PRIVILEGE_USED_FOR_ACCESS;
                     Required--;
-                    }
+                }
 
                 /* Leave the inner loop */
                 break;
-                }
             }
         }
+    }
 
     /* Return whether we found all required privileges */
     return (Required == 0);
index 644d0cd..b969966 100644 (file)
 
 /* Official tags */
 #define GDITAG_ATM_FONT                  'ebdA'
-#define GDITAG_BMP_FONT 'dfmB'
-#define GDITAG_ENG_EVENT 'msfD'
-#define GDITAG_DWM_HWND_LOOKUP 'LmwD'
-#define GDITAG_DWM_VALIDATION 'vMWD'
-#define GDITAG_LOCKED_PRIMARY 'ddxD'
-#define GDITAG_DC_COLOR_TRANSFORM 'bdaG'
-#define GDITAG_DC_FONT 'ddaG'
-#define GDITAG_ALPHABLEND 'plaG'
-#define GDITAG_BRUSH_FREELIST 'fabG'
-#define GDITAG_ICM_DIB_LIST 'ldbG'
-#define GDITAG_FONTCACHE 'cacG'
-#define GDITAG_SCRIPTS 'lscG'
-#define GDITAG_CHAR_TO_WIDE_CHAR 'cwcG'
-#define GDITAG_RBRUSH 'rbdG'
-#define GDITAG_DC_FREELIST 'fcdG'
-#define GDITAG_DWMSTATE 'scDG'
-#define GDITAG_DEVMODE 'vedG'
-#define GDITAG_PDEV 'veDG'
-#define GDITAG_HGLYPH_ARRAY 'mfdG'
-#define GDITAG_DRVSUP 'srdG'
-#define GDITAG_CLIPOBJ 'vrdG'
-#define GDITAG_SEMAPHORE_VALIDATE 'dtdG'
-#define GDITAG_WATCHDOG 'dwdG'
-#define GDITAG_ENGBRUSH 'rbeG'
-#define GDITAG_ENUM_DISPLAY_DEVICES 'ddeG'
-#define GDITAG_EDGE 'gdeG'
-#define GDITAG_TRIANGLEDATA 'gdEg'
-#define GDITAG_TEXTOUT 'oteG'
-#define GDITAG_FONT_DEFAULT_FAMILY 'fdfG'
-#define GDITAG_FONTFILEVIEW 'vffG'
-#define GDITAG_UNIVERSAL_FONT_ID 'difG'
-#define GDITAG_FILEPATH 'liFG'
-#define GDITAG_MAPFILE 'lifG'
-#define GDITAG_FLOODFILL 'dlFG'
-#define GDITAG_RFONT 'tnfG'
-#define GDITAG_FONT_SUB 'bsfG'
-#define GDITAG_FONT_STOCKFONT 'fsfG'
-#define GDITAG_FAST_MUTEX 'msfG'
-#define GDITAG_FULLSCREEN 'lufG'
-#define GDITAG_FONTVICTIM 'ivfG'
-#define GDITAG_GLYPHBLOCK ' bgG'
-#define GDITAG_GDEVICE 'vdgG'
-#define GDITAG_GLYPHSET 'slgG'
-#define GDITAG_HGLYPH 'ylgG'
-#define GDITAG_HMGR_LFONT_TYPE ':?hG'
-#define GDITAG_HMGR_RFONT_TYPE ';?hG'
-#define GDITAG_HMGR_BRUSH_TYPE '@?hG'
-#define GDITAG_HMGR_ICMCXF_TYPE '>?hG'
-#define GDITAG_HMGR_DEF_TYPE '0?hG'
-#define GDITAG_HMGR_DC_TYPE '1?hG'
-#define GDITAG_HMGR_RGN_TYPE '4?hG'
-#define GDITAG_HMGR_SURF_TYPE '5?hG'
-#define GDITAG_HMGR_CLIENTOBJ_TYPE '6?hG'
-#define GDITAG_HMGR_PATH_TYPE '7?hG'
-#define GDITAG_HMGR_PAL_TYPE '8?hG'
-#define GDITAG_HMGR_ICMLCS_TYPE '9?hG'
-#define GDITAG_HMGR_UMPD_TYPE 'A?hG'
-#define GDITAG_HMGR_HLSURF_TYPE 'B?hG'
-#define GDITAG_HMGR_META_TYPE 'E?hG'
-#define GDITAG_HMGR_DRVOBJ_TYPE 'L?hG'
-#define GDITAG_HMGR_SPRITE_TYPE '??hG'
-#define GDITAG_HMGR_START '00hG'
-#define GDITAG_PFE_HASHBUCKET 'bahG'
-#define GDITAG_PFE_HASHTABLE 'sahG'
-#define GDITAG_HMGR_LOCK 'lmhG'
-#define GDITAG_HALFTONE_COLORTRIAD 'cthG'
-#define GDITAG_HMGR_TEMP 'mthG'
-#define GDITAG_DDCCI 'c2iG'
-#define GDITAG_ICM 'mciG'
-#define GDITAG_KMODE_BITMAP 'mbkG'
+#define GDITAG_BMP_FONT                  'dfmB'
+#define GDITAG_ENG_EVENT                 'msfD'
+#define GDITAG_DWM_HWND_LOOKUP           'LmwD'
+#define GDITAG_DWM_VALIDATION            'vMWD'
+#define GDITAG_LOCKED_PRIMARY            'ddxD'
+#define GDITAG_DC_COLOR_TRANSFORM        'bdaG'
+#define GDITAG_DC_FONT                   'ddaG'
+#define GDITAG_ALPHABLEND                'plaG'
+#define GDITAG_BRUSH_FREELIST            'fabG'
+#define GDITAG_ICM_DIB_LIST              'ldbG'
+#define GDITAG_FONTCACHE                 'cacG'
+#define GDITAG_SCRIPTS                   'lscG'
+#define GDITAG_CHAR_TO_WIDE_CHAR         'cwcG'
+#define GDITAG_RBRUSH                    'rbdG'
+#define GDITAG_DC_FREELIST               'fcdG'
+#define GDITAG_DWMSTATE                  'scDG'
+#define GDITAG_DEVMODE                   'vedG'
+#define GDITAG_PDEV                      'veDG'
+#define GDITAG_HGLYPH_ARRAY              'mfdG'
+#define GDITAG_DRVSUP                    'srdG'
+#define GDITAG_CLIPOBJ                   'vrdG'
+#define GDITAG_SEMAPHORE_VALIDATE        'dtdG'
+#define GDITAG_WATCHDOG                  'dwdG'
+#define GDITAG_ENGBRUSH                  'rbeG'
+#define GDITAG_ENUM_DISPLAY_DEVICES      'ddeG'
+#define GDITAG_EDGE                      'gdeG'
+#define GDITAG_TRIANGLEDATA              'gdEg'
+#define GDITAG_TEXTOUT                   'oteG'
+#define GDITAG_FONT_DEFAULT_FAMILY       'fdfG'
+#define GDITAG_FONTFILEVIEW              'vffG'
+#define GDITAG_UNIVERSAL_FONT_ID         'difG'
+#define GDITAG_FILEPATH                  'liFG'
+#define GDITAG_MAPFILE                   'lifG'
+#define GDITAG_FLOODFILL                 'dlFG'
+#define GDITAG_RFONT                     'tnfG'
+#define GDITAG_FONT_SUB                  'bsfG'
+#define GDITAG_FONT_STOCKFONT            'fsfG'
+#define GDITAG_FAST_MUTEX                'msfG'
+#define GDITAG_FULLSCREEN                'lufG'
+#define GDITAG_FONTVICTIM                'ivfG'
+#define GDITAG_GLYPHBLOCK                ' bgG'
+#define GDITAG_GDEVICE                   'vdgG'
+#define GDITAG_GLYPHSET                  'slgG'
+#define GDITAG_HGLYPH                    'ylgG'
+#define GDITAG_HMGR_LFONT_TYPE           ':?hG'
+#define GDITAG_HMGR_RFONT_TYPE           ';?hG'
+#define GDITAG_HMGR_BRUSH_TYPE           '@?hG'
+#define GDITAG_HMGR_ICMCXF_TYPE          '>?hG'
+#define GDITAG_HMGR_DEF_TYPE             '0?hG'
+#define GDITAG_HMGR_DC_TYPE              '1?hG'
+#define GDITAG_HMGR_RGN_TYPE             '4?hG'
+#define GDITAG_HMGR_SURF_TYPE            '5?hG'
+#define GDITAG_HMGR_CLIENTOBJ_TYPE       '6?hG'
+#define GDITAG_HMGR_PATH_TYPE            '7?hG'
+#define GDITAG_HMGR_PAL_TYPE             '8?hG'
+#define GDITAG_HMGR_ICMLCS_TYPE          '9?hG'
+#define GDITAG_HMGR_UMPD_TYPE            'A?hG'
+#define GDITAG_HMGR_HLSURF_TYPE          'B?hG'
+#define GDITAG_HMGR_META_TYPE            'E?hG'
+#define GDITAG_HMGR_DRVOBJ_TYPE          'L?hG'
+#define GDITAG_HMGR_SPRITE_TYPE          '??hG'
+#define GDITAG_HMGR_START                '00hG'
+#define GDITAG_PFE_HASHBUCKET            'bahG'
+#define GDITAG_PFE_HASHTABLE             'sahG'
+#define GDITAG_HMGR_LOCK                 'lmhG'
+#define GDITAG_HALFTONE_COLORTRIAD       'cthG'
+#define GDITAG_HMGR_TEMP                 'mthG'
+#define GDITAG_DDCCI                     'c2iG'
+#define GDITAG_ICM                       'mciG'
+#define GDITAG_KMODE_BITMAP              'mbkG'
 #define GDITAG_HMGR_LOOKASIDE_LFONT_TYPE ':alG'
 #define GDITAG_HMGR_LOOKASIDE_RFONT_TYPE ';alG'
 #define GDITAG_HMGR_LOOKASIDE_BRUSH_TYPE '@alG'
-#define GDITAG_HMGR_LOOKASIDE_START '0alG'
-#define GDITAG_HMGR_LOOKASIDE_DC_TYPE '1alG'
-#define GDITAG_HMGR_LOOKASIDE_RGN_TYPE '4alG'
-#define GDITAG_HMGR_LOOKASIDE_SURF_TYPE '5alG'
-#define GDITAG_HMGR_LOOKASIDE_PAL_TYPE '8alG'
-#define GDITAG_LDEV 'vdlG'
-#define GDITAG_LOCALEINFO 'dilG'
-#define GDITAG_PFE_LINK 'knlG'
-#define GDITAG_FONT_MAPPER 'pamG'
-#define GDITAG_DISPURF_SORT 'osmG'
-#define GDITAG_MULTIFONT 'lumG'
-#define GDITAG_NLS 'slnG'
-#define GDITAG_OPENGL 'lgoG'
-#define GDITAG_OPM 'MPOG'
-#define GDITAG_PALETTE 'laPG'
-#define GDITAG_PANNING_PDEV 'napG'
-#define GDITAG_PATHOBJ 'tapG'
-#define GDITAG_PFF_INDEXES 'efpG'
-#define GDITAG_PFF 'ffpG'
-#define GDITAG_PFT 'tfpG'
-#define GDITAG_PLGBLT_DATA 'bgpG'
-#define GDITAG_PRINTCLIENTID 'dipG'
-#define GDITAG_CLIP_PATHOBJ 'oppG'
-#define GDITAG_PROXYPORT 'tppG'
-#define GDITAG_PRESENT 'erpG'
-#define GDITAG_LFONT_QUICKLOOKUP 'knqG'
-#define GDITAG_PALETTE_RGB_XLATE 'bgrG'
-#define GDITAG_REGION 'ngrG'
-#define GDITAG_SEMAPHORE 'mesG'
-#define GDITAG_SPRITE ' psG'
-#define GDITAG_METASPRITE 'mpsG'
-#define GDITAG_SPRITESCAN 'rpsG'
-#define GDITAG_STACKTRACE 'atsG'
-#define GDITAG_STRETCHBLT 'htsG'
-#define GDITAG_PENSTYLE 'ytsG'
-#define GDITAG_SFM 'xusG'
-#define GDITAG_TEMP 'pmtG'
-#define GDITAG_TEMP_THREADLOCK 'pmTG'
-#define GDITAG_TEXTMETRICS 'wmtG'
-#define GDITAG_PFF_DATA 'pvtG'
-#define GDITAG_TRIANGLE_MESH 'tvtG'
-#define GDITAG_TEXT 'txtG'
-#define GDITAG_UMODE_BITMAP 'mbuG'
-#define GDITAG_ENG_USER_MEM_ALLOC_TABLE 'amUG'
-#define GDITAG_UMPD 'pmuG'
-#define GDITAG_HDEV 'sdvG'
-#define GDITAG_VDEV 'vdVG'
-#define GDITAG_MULTISAVEBITS 'smVG'
-#define GDITAG_MDSURF 'fsVG'
-#define GDITAG_WNDOBJ 'dnwG'
-#define GDITAG_PXLATE 'tlxG'
-#define GDITAG_UMPDOBJ 'dpxG'
-#define GDITAG_FONT_LINK 'flnk'
-#define GDITAG_PANNING_SURFACE 'fSAP'
-#define GDITAG_PANNING_SHADOWLOCK 'olSP'
-#define GDITAG_SINGLEREADERLOCK 'lrsS'
-#define GDITAG_TT_FONT_CACHE 'CFTT'
-#define GDITAG_TT_FONT 'dftT'
-#define GDITAG_VF_FONT 'dftV'
-#define GDITAG_W32PIDLOCK 'l23W'
-#define GDITAG_HANDLEPUSHLOCK 'lpHG'
+#define GDITAG_HMGR_LOOKASIDE_START      '0alG'
+#define GDITAG_HMGR_LOOKASIDE_DC_TYPE    '1alG'
+#define GDITAG_HMGR_LOOKASIDE_RGN_TYPE   '4alG'
+#define GDITAG_HMGR_LOOKASIDE_SURF_TYPE  '5alG'
+#define GDITAG_HMGR_LOOKASIDE_PAL_TYPE   '8alG'
+#define GDITAG_LDEV                      'vdlG'
+#define GDITAG_LOCALEINFO                'dilG'
+#define GDITAG_PFE_LINK                  'knlG'
+#define GDITAG_FONT_MAPPER               'pamG'
+#define GDITAG_DISPURF_SORT              'osmG'
+#define GDITAG_MULTIFONT                 'lumG'
+#define GDITAG_NLS                       'slnG'
+#define GDITAG_OPENGL                    'lgoG'
+#define GDITAG_OPM                       'MPOG'
+#define GDITAG_PALETTE                   'laPG'
+#define GDITAG_PANNING_PDEV              'napG'
+#define GDITAG_PATHOBJ                   'tapG'
+#define GDITAG_PFF_INDEXES               'efpG'
+#define GDITAG_PFF                       'ffpG'
+#define GDITAG_PFT                       'tfpG'
+#define GDITAG_PLGBLT_DATA               'bgpG'
+#define GDITAG_PRINTCLIENTID             'dipG'
+#define GDITAG_CLIP_PATHOBJ              'oppG'
+#define GDITAG_PROXYPORT                 'tppG'
+#define GDITAG_PRESENT                   'erpG'
+#define GDITAG_LFONT_QUICKLOOKUP         'knqG'
+#define GDITAG_PALETTE_RGB_XLATE         'bgrG'
+#define GDITAG_REGION                    'ngrG'
+#define GDITAG_SEMAPHORE                 'mesG'
+#define GDITAG_SPRITE                    ' psG'
+#define GDITAG_METASPRITE                'mpsG'
+#define GDITAG_SPRITESCAN                'rpsG'
+#define GDITAG_STACKTRACE                'atsG'
+#define GDITAG_STRETCHBLT                'htsG'
+#define GDITAG_PENSTYLE                  'ytsG'
+#define GDITAG_SFM                       'xusG'
+#define GDITAG_TEMP                      'pmtG'
+#define GDITAG_TEMP_THREADLOCK           'pmTG'
+#define GDITAG_TEXTMETRICS               'wmtG'
+#define GDITAG_PFF_DATA                  'pvtG'
+#define GDITAG_TRIANGLE_MESH             'tvtG'
+#define GDITAG_TEXT                      'txtG'
+#define GDITAG_UMODE_BITMAP              'mbuG'
+#define GDITAG_ENG_USER_MEM_ALLOC_TABLE  'amUG'
+#define GDITAG_UMPD                      'pmuG'
+#define GDITAG_HDEV                      'sdvG'
+#define GDITAG_VDEV                      'vdVG'
+#define GDITAG_MULTISAVEBITS             'smVG'
+#define GDITAG_MDSURF                    'fsVG'
+#define GDITAG_WNDOBJ                    'dnwG'
+#define GDITAG_PXLATE                    'tlxG'
+#define GDITAG_UMPDOBJ                   'dpxG'
+#define GDITAG_FONT_LINK                 'flnk'
+#define GDITAG_PANNING_SURFACE           'fSAP'
+#define GDITAG_PANNING_SHADOWLOCK        'olSP'
+#define GDITAG_SINGLEREADERLOCK          'lrsS'
+#define GDITAG_TT_FONT_CACHE             'CFTT'
+#define GDITAG_TT_FONT                   'dftT'
+#define GDITAG_VF_FONT                   'dftV'
+#define GDITAG_W32PIDLOCK                'l23W'
+#define GDITAG_HANDLEPUSHLOCK            'lpHG'
 
-#define USERTAG_SERVICE_TABLE 'lacU'
-#define USERTAG_MONITOR_MARGIN 'mamU'
-#define USERTAG_REDIRECT 'rdrU'
-#define USERTAG_ACCEL 'casU'
-#define USERTAG_ATTACHINFO 'iasU'
-#define USERTAG_ALTTAB 'lasU'
-#define USERTAG_DEBUG 'gbsU'
-#define USERTAG_CLIPBOARD 'bcsU'
-#define USERTAG_CALLBACK 'ccsU'
-#define USERTAG_COMPOSITIONPROP 'dcsU'
-#define USERTAG_CLIENTTHREADINFO 'icsU'
-#define USERTAG_CLASS 'lcsU'
-#define USERTAG_SCANCODEMAP 'mcsU'
-#define USERTAG_CLIPBOARDPALETTE 'pcsU'
-#define USERTAG_COLORS 'rcsU'
-#define USERTAG_CHECKPT 'tcsU'
-#define USERTAG_CURSOR 'ucsU'
-#define USERTAG_COLORVALUES 'vcsU'
-#define USERTAG_DDE1 '1dsU'
-#define USERTAG_DDE2 '2dsU'
-#define USERTAG_DDE4 '4dsU'
-#define USERTAG_DDE5 '5dsU'
-#define USERTAG_DDE6 '6dsU'
-#define USERTAG_DDE7 '7dsU'
-#define USERTAG_DDE8 '8dsU'
-#define USERTAG_DDE9 '9dsU'
-#define USERTAG_DDEa 'AdsU'
-#define USERTAG_DDEb 'BdsU'
-#define USERTAG_DCE 'cdsU'
-#define USERTAG_DDEd 'DdsU'
-#define USERTAG_DDE 'EdsU'
-#define USERTAG_DEVICEINFO 'IDsU'
-#define USERTAG_DISPLAYINFO 'idsU'
-#define USERTAG_DRAGDROP 'sdsU'
-#define USERTAG_DEVICECHANGE 'vdsU'
-#define USERTAG_WSEXCOMPINVALID 'CEsU'
-#define USERTAG_ERESOURCE 'resU'
-#define USERTAG_EVENT 'vesU'
-#define USERTAG_FORWARDTOUCHMESSAGE 'tfsU'
-#define USERTAG_GRANTEDHANDLES 'hgsU'
-#define USERTAG_GESTUREINFO 'igsU'
-#define USERTAG_GLOBALTHREADLOCK 'lgsU'
-#define USERTAG_GHOST 'tgsU'
-#define USERTAG_HIDDATA 'ahsU'
-#define USERTAG_HIDDESC 'DhsU'
-#define USERTAG_HOTKEY 'khsU'
-#define USERTAG_IMEHOTKEY 'hisU'
-#define USERTAG_IME 'misU'
-#define USERTAG_W32JOB 'bjsU'
-#define USERTAG_W32JOBEXTRA 'xjsU'
-#define USERTAG_KBDLAYOUT 'bksU'
-#define USERTAG_KBDEXID 'eksU'
-#define USERTAG_KBDFILE 'fksU'
-#define USERTAG_KBDSTATE 'sksU'
-#define USERTAG_KBDTABLE 'tksU'
-#define USERTAG_LOOKASIDE 'alsU'
-#define USERTAG_LOGDESKTOP 'dlsU'
-#define USERTAG_LOCKRECORD 'rlsU'
-#define USERTAG_MAGNIFICATION 'gmsU'
-#define USERTAG_MIRROR 'imsU'
-#define USERTAG_MESSAGE_FILTER 'lmsU'
-#define USERTAG_MONITORRECTS 'rmsU'
-#define USERTAG_MOVESIZE 'smsU'
-#define USERTAG_MENUSTATE 'tmsU'
-#define USERTAG_NKAPC 'ansU'
-#define USERTAG_NOTIFY 'ynsU'
-#define USERTAG_POWERBROADCAST 'bpsU'
-#define USERTAG_PROCESSINFO 'ipsU'
-#define USERTAG_POPUPMENU 'mpsU'
-#define USERTAG_PROFILEUSERNAME 'npsU'
-#define USERTAG_POWER 'opsU'
-#define USERTAG_PNP 'ppsU'
-#define USERTAG_PROFILE 'rpsU'
-#define USERTAG_WINDOWARRAY 'wpsU'
-#define USERTAG_SQM 'mqsU'
-#define USERTAG_QMSG 'mqsU'
-#define USERTAG_Q 'uqsU'
-#define USERTAG_RTL 'trsU'
-#define USERTAG_SMS_ASYNC 'assU'
-#define USERTAG_SPB 'bssU'
-#define USERTAG_SMS_CAPTURE 'cssU'
-#define USERTAG_SHADOW 'dssU'
-#define USERTAG_SECURITY 'essU'
-#define USERTAG_SENDINPUT 'issU'
-#define USERTAG_SENDTOUCHINPUT 'jssU'
-#define USERTAG_SMS 'mssU'
-#define USERTAG_SMS_STRING 'sssU'
-#define USERTAG_SCROLLTRACK 'tssU'
-#define USERTAG_SWP 'wssU'
-#define USERTAG_SYSTEM 'yssU'
-#define USERTAG_TRACKDESKTOP 'dtsU'
-#define USERTAG_THREADINFO 'itsU'
-#define USERTAG_STACK 'ktsU'
-#define USERTAG_TIMER 'mtsU'
-#define USERTAG_TOKEN 'otsU'
-#define USERTAG_SECTION 'stsU'
-#define USERTAG_TEXT 'xtsU'
-#define USERTAG_TEXT2 'ytsU'
-#define USERTAG_TOUCHINPUTINFO 'ztsU'
-#define USERTAG_UNICODEBUFFER 'busU'
-#define USERTAG_UIPI_SQM 'susU'
-#define USERTAG_VISRGN 'ivsU'
-#define USERTAG_VWPL 'lvsU'
-#define USERTAG_WINDOW 'dwsU'
-#define USERTAG_WINEVENT 'ewsU'
-#define USERTAG_WINDOWLIST 'lwsU'
-#define USERTAG_WOWTDB 'owsU'
-#define USERTAG_WOWPROCESSINFO 'pwsU'
-#define USERTAG_WOWTHREADINFO 'twsU'
+#define USERTAG_SERVICE_TABLE            'lacU'
+#define USERTAG_MONITOR_MARGIN           'mamU'
+#define USERTAG_REDIRECT                 'rdrU'
+#define USERTAG_ACCEL                    'casU'
+#define USERTAG_ATTACHINFO               'iasU'
+#define USERTAG_ALTTAB                   'lasU'
+#define USERTAG_DEBUG                    'gbsU'
+#define USERTAG_CLIPBOARD                'bcsU'
+#define USERTAG_CALLBACK                 'ccsU'
+#define USERTAG_COMPOSITIONPROP          'dcsU'
+#define USERTAG_CLIENTTHREADINFO         'icsU'
+#define USERTAG_CLASS                    'lcsU'
+#define USERTAG_SCANCODEMAP              'mcsU'
+#define USERTAG_CLIPBOARDPALETTE         'pcsU'
+#define USERTAG_COLORS                   'rcsU'
+#define USERTAG_CHECKPT                  'tcsU'
+#define USERTAG_CURSOR                   'ucsU'
+#define USERTAG_COLORVALUES              'vcsU'
+#define USERTAG_DDE1                     '1dsU'
+#define USERTAG_DDE2                     '2dsU'
+#define USERTAG_DDE4                     '4dsU'
+#define USERTAG_DDE5                     '5dsU'
+#define USERTAG_DDE6                     '6dsU'
+#define USERTAG_DDE7                     '7dsU'
+#define USERTAG_DDE8                     '8dsU'
+#define USERTAG_DDE9                     '9dsU'
+#define USERTAG_DDEa                     'AdsU'
+#define USERTAG_DDEb                     'BdsU'
+#define USERTAG_DCE                      'cdsU'
+#define USERTAG_DDEd                     'DdsU'
+#define USERTAG_DDE                      'EdsU'
+#define USERTAG_DEVICEINFO               'IDsU'
+#define USERTAG_DISPLAYINFO              'idsU'
+#define USERTAG_DRAGDROP                 'sdsU'
+#define USERTAG_DEVICECHANGE             'vdsU'
+#define USERTAG_WSEXCOMPINVALID          'CEsU'
+#define USERTAG_ERESOURCE                'resU'
+#define USERTAG_EVENT                    'vesU'
+#define USERTAG_FORWARDTOUCHMESSAGE      'tfsU'
+#define USERTAG_GRANTEDHANDLES           'hgsU'
+#define USERTAG_GESTUREINFO              'igsU'
+#define USERTAG_GLOBALTHREADLOCK         'lgsU'
+#define USERTAG_GHOST                    'tgsU'
+#define USERTAG_HIDDATA                  'ahsU'
+#define USERTAG_HIDDESC                  'DhsU'
+#define USERTAG_HOTKEY                   'khsU'
+#define USERTAG_IMEHOTKEY                'hisU'
+#define USERTAG_IME                      'misU'
+#define USERTAG_W32JOB                   'bjsU'
+#define USERTAG_W32JOBEXTRA              'xjsU'
+#define USERTAG_KBDLAYOUT                'bksU'
+#define USERTAG_KBDEXID                  'eksU'
+#define USERTAG_KBDFILE                  'fksU'
+#define USERTAG_KBDSTATE                 'sksU'
+#define USERTAG_KBDTABLE                 'tksU'
+#define USERTAG_LOOKASIDE                'alsU'
+#define USERTAG_LOGDESKTOP               'dlsU'
+#define USERTAG_LOCKRECORD               'rlsU'
+#define USERTAG_MAGNIFICATION            'gmsU'
+#define USERTAG_MIRROR                   'imsU'
+#define USERTAG_MESSAGE_FILTER           'lmsU'
+#define USERTAG_MONITORRECTS             'rmsU'
+#define USERTAG_MOVESIZE                 'smsU'
+#define USERTAG_MENUSTATE                'tmsU'
+#define USERTAG_NKAPC                    'ansU'
+#define USERTAG_NOTIFY                   'ynsU'
+#define USERTAG_POWERBROADCAST           'bpsU'
+#define USERTAG_PROCESSINFO              'ipsU'
+#define USERTAG_POPUPMENU                'mpsU'
+#define USERTAG_PROFILEUSERNAME          'npsU'
+#define USERTAG_POWER                    'opsU'
+#define USERTAG_PNP                      'ppsU'
+#define USERTAG_PROFILE                  'rpsU'
+#define USERTAG_WINDOWARRAY              'wpsU'
+#define USERTAG_SQM                      'mqsU'
+#define USERTAG_QMSG                     'mqsU'
+#define USERTAG_Q                        'uqsU'
+#define USERTAG_RTL                      'trsU'
+#define USERTAG_SMS_ASYNC                'assU'
+#define USERTAG_SPB                      'bssU'
+#define USERTAG_SMS_CAPTURE              'cssU'
+#define USERTAG_SHADOW                   'dssU'
+#define USERTAG_SECURITY                 'essU'
+#define USERTAG_SENDINPUT                'issU'
+#define USERTAG_SENDTOUCHINPUT           'jssU'
+#define USERTAG_SMS                      'mssU'
+#define USERTAG_SMS_STRING               'sssU'
+#define USERTAG_SCROLLTRACK              'tssU'
+#define USERTAG_SWP                      'wssU'
+#define USERTAG_SYSTEM                   'yssU'
+#define USERTAG_TRACKDESKTOP             'dtsU'
+#define USERTAG_THREADINFO               'itsU'
+#define USERTAG_STACK                    'ktsU'
+#define USERTAG_TIMER                    'mtsU'
+#define USERTAG_TOKEN                    'otsU'
+#define USERTAG_SECTION                  'stsU'
+#define USERTAG_TEXT                     'xtsU'
+#define USERTAG_TEXT2                    'ytsU'
+#define USERTAG_TOUCHINPUTINFO           'ztsU'
+#define USERTAG_UNICODEBUFFER            'busU'
+#define USERTAG_UIPI_SQM                 'susU'
+#define USERTAG_VISRGN                   'ivsU'
+#define USERTAG_VWPL                     'lvsU'
+#define USERTAG_WINDOW                   'dwsU'
+#define USERTAG_WINEVENT                 'ewsU'
+#define USERTAG_WINDOWLIST               'lwsU'
+#define USERTAG_WOWTDB                   'owsU'
+#define USERTAG_WOWPROCESSINFO           'pwsU'
+#define USERTAG_WOWTHREADINFO            'twsU'
index 0e26492..6c4ab3b 100644 (file)
@@ -36,29 +36,29 @@ XFORMOBJ_pmx(
 ULONG
 INTERNAL_CALL
 XFORMOBJ_iSetXform(
-       OUT XFORMOBJ *pxo,
+    OUT XFORMOBJ *pxo,
     IN const XFORML *pxform);
 
 ULONG
 INTERNAL_CALL
 XFORMOBJ_iCombine(
-       IN XFORMOBJ *pxo,
-       IN XFORMOBJ *pxo1,
-       IN XFORMOBJ *pxo2);
+    IN XFORMOBJ *pxo,
+    IN XFORMOBJ *pxo1,
+    IN XFORMOBJ *pxo2);
 
 ULONG
 INTERNAL_CALL
 XFORMOBJ_iCombineXform(
-       IN XFORMOBJ *pxo,
-       IN XFORMOBJ *pxo1,
-       IN XFORML *pxform,
-       IN BOOL bLeftMultiply);
+    IN XFORMOBJ *pxo,
+    IN XFORMOBJ *pxo1,
+    IN XFORML *pxform,
+    IN BOOL bLeftMultiply);
 
 ULONG
 INTERNAL_CALL
 XFORMOBJ_iInverse(
-       OUT XFORMOBJ *pxoDst,
-       IN XFORMOBJ *pxoSrc);
+    OUT XFORMOBJ *pxoDst,
+    IN XFORMOBJ *pxoSrc);
 
 ULONG
 APIENTRY
index 9f120a0..892ef7a 100644 (file)
@@ -1681,7 +1681,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
                Cs->dwExStyle |= WS_EX_LAYOUTRTL;
             }
          }
-   }
+      }
    }
 
    /* Automatically add WS_EX_WINDOWEDGE */
index 4cb7a55..17d7f26 100644 (file)
@@ -1,4 +1,6 @@
 #include <win32k.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
 
 #define NDEBUG
 #include <debug.h>
index ca6cde6..23e8c39 100644 (file)
@@ -194,7 +194,7 @@ NtGdiCreateBitmap(
 
     if (pUnsafeBits && hbmp)
     {
-               PSURFACE psurf = SURFACE_LockSurface(hbmp);
+        PSURFACE psurf = SURFACE_LockSurface(hbmp);
         _SEH2_TRY
         {
             ProbeForRead(pUnsafeBits, cjSize, 1);
@@ -202,13 +202,13 @@ NtGdiCreateBitmap(
         }
         _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
         {
-                       SURFACE_UnlockSurface(psurf);
+            SURFACE_UnlockSurface(psurf);
             SURFACE_FreeSurfaceByHandle(hbmp);
             _SEH2_YIELD(return NULL;)
         }
         _SEH2_END
 
-               SURFACE_UnlockSurface(psurf);
+        SURFACE_UnlockSurface(psurf);
     }
 
     return hbmp;
index c00d67c..634320a 100644 (file)
@@ -149,9 +149,9 @@ IntGdiCombineTransform(
 BOOL
 APIENTRY
 NtGdiCombineTransform(
-    LPXFORM  UnsafeXFormResult,
-    LPXFORM  Unsafexform1,
-    LPXFORM  Unsafexform2)
+    LPXFORM UnsafeXFormResult,
+    LPXFORM Unsafexform1,
+    LPXFORM Unsafexform2)
 {
     BOOL Ret;
 
index 820b2b1..6ab2f6c 100644 (file)
@@ -1036,19 +1036,19 @@ NtGdiStretchDIBitsInternal(
     if (!Bits || !BitsInfo)
         return 0;
 
-       safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB);
-       if(!safeBits)
-       {
-               EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
-               return 0;
-       }
+    safeBits = ExAllocatePoolWithTag(PagedPool, cjMaxBits, TAG_DIB);
+    if(!safeBits)
+    {
+        EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return 0;
+    }
 
     if (!(pdc = DC_LockDc(hDC)))
-       {
-               ExFreePoolWithTag(safeBits, TAG_DIB);
-               EngSetLastError(ERROR_INVALID_HANDLE);
-               return 0;
-       }
+    {
+        ExFreePoolWithTag(safeBits, TAG_DIB);
+        EngSetLastError(ERROR_INVALID_HANDLE);
+        return 0;
+    }
 
     _SEH2_TRY
     {
@@ -1059,7 +1059,7 @@ NtGdiStretchDIBitsInternal(
             DPRINT1("Invalid bitmap\n");
             _SEH2_YIELD(goto cleanup;)
         }
-               RtlCopyMemory(safeBits, Bits, cjMaxBits);
+        RtlCopyMemory(safeBits, Bits, cjMaxBits);
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
@@ -1085,44 +1085,44 @@ NtGdiStretchDIBitsInternal(
         ret = IntGdiGetObject(hBitmap, sizeof(bmp), &bmp) == sizeof(bmp);
         if (ret &&
             bmp.bmBitsPixel == bpp &&
-                bmp.bmWidth == SrcWidth &&
-                bmp.bmHeight == SrcHeight &&
-                bmp.bmPlanes == planes)
-    {
-        /* fast path */
+            bmp.bmWidth == SrcWidth &&
+            bmp.bmHeight == SrcHeight &&
+            bmp.bmPlanes == planes)
+        {
+            /* fast path */
             ret = IntSetDIBits(pdc, hBitmap, 0, height, safeBits, BitsInfo, Usage);
             goto cleanup;
-    }
+        }
     }
 
-        /* slow path - need to use StretchBlt */
+    /* slow path - need to use StretchBlt */
 
     hdcMem = NtGdiCreateCompatibleDC(hDC);
-        hBitmap = DIB_CreateDIBSection(pdc, BitsInfo, Usage, &pvBits, NULL, 0, 0);
-               if(!hBitmap)
-               {
-                       DPRINT1("Error, failed to create a DIB section\n");
-                       NtGdiDeleteObjectApp(hdcMem);
-                       goto cleanup;
-               }
+    hBitmap = DIB_CreateDIBSection(pdc, BitsInfo, Usage, &pvBits, NULL, 0, 0);
+    if(!hBitmap)
+    {
+        DPRINT1("Error, failed to create a DIB section\n");
+        NtGdiDeleteObjectApp(hdcMem);
+        goto cleanup;
+    }
 
-        RtlCopyMemory(pvBits, safeBits, cjMaxBits);
+    RtlCopyMemory(pvBits, safeBits, cjMaxBits);
     hOldBitmap = NtGdiSelectBitmap(hdcMem, hBitmap);
 
-        /* Origin for DIBitmap may be bottom left (positive biHeight) or top
-           left (negative biHeight) */
+    /* Origin for DIBitmap may be bottom left (positive biHeight) or top
+       left (negative biHeight) */
     ret = NtGdiStretchBlt(hDC, XDest, YDest, DestWidth, DestHeight,
-                             hdcMem, XSrc, abs(height) - SrcHeight - YSrc,
+                         hdcMem, XSrc, abs(height) - SrcHeight - YSrc,
                          SrcWidth, SrcHeight, ROP, 0);
 
-               if(ret)
-            ret = SrcHeight;
+    if(ret)
+        ret = SrcHeight;
     NtGdiSelectBitmap(hdcMem, hOldBitmap);
     NtGdiDeleteObjectApp(hdcMem);
     GreDeleteObject(hBitmap);
 
 cleanup:
-       ExFreePoolWithTag(safeBits, TAG_DIB);
+    ExFreePoolWithTag(safeBits, TAG_DIB);
     DC_UnlockDc(pdc);
     return ret;
 }
index 8b79493..351c081 100755 (executable)
@@ -50,6 +50,8 @@ SUCH DAMAGE.
  */
 
 #include <win32k.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
 
 #define NDEBUG
 #include <debug.h>
index e3230e6..8ac2eb3 100644 (file)
@@ -107,12 +107,12 @@ GreGetCharacterPlacementW(
  
   DPRINT1("GreGCPW Start\n");
 
-  if (!pgcpw)
-  {
+   if (!pgcpw)
+   {
       if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1))
-        return MAKELONG(Size.cx, Size.cy);
-     return 0;
-  }
+         return MAKELONG(Size.cx, Size.cy);
+      return 0;
+   }
 
   DPRINT1("GreGCPW 1\n");
 
@@ -139,7 +139,7 @@ GreGetCharacterPlacementW(
                              &Size,
                              0) )
   {
-  return 0;
+     return 0;
   }
 
   DPRINT1("GreGCPW 2\n");
@@ -814,7 +814,7 @@ NtGdiGetKerningPairs(HDC  hDC,
      {
         EngSetLastError(ERROR_INVALID_PARAMETER);
         Count = 0;
-  }
+     }
      ExFreePoolWithTag(pKP,GDITAG_TEXT);
   }
   return Count;
index 4cf931f..bf0f30e 100644 (file)
@@ -44,13 +44,13 @@ NtGdiCreateMetafileDC(IN HDC hdc)
       { // Not sure this is right for getting the HDEV handle, maybe Timo could help or just if'ed it out.
          ret = IntGdiCreateDisplayDC(pDc->ppdev->BaseObject.hHmgr, DC_TYPE_INFO, TRUE);
          DC_UnlockDc(pDc);
+      }
    }
-         }
    else
    {
        ret = UserGetDesktopDC(DC_TYPE_INFO, TRUE, FALSE);
    }
-    return ret;
+   return ret;
 }
 
 /*
index 8a9010c..801e8e5 100644 (file)
@@ -33,7 +33,8 @@
  */
 
 #include <win32k.h>
-#include "math.h"
+#define _USE_MATH_DEFINES
+#include <math.h>
 
 #define NDEBUG
 #include <debug.h>
index 87e1e07..e5f9448 100644 (file)
@@ -97,14 +97,14 @@ HintFromAccel(ULONG flAccel)
 {
     switch (flAccel & (MX_NOTRANSLATE |  MX_IDENTITYSCALE | MX_SCALE))
     {
-    case (MX_SCALE | MX_IDENTITYSCALE | MX_NOTRANSLATE):
-        return GX_IDENTITY;
-    case (MX_SCALE | MX_IDENTITYSCALE):
-        return GX_OFFSET;
-    case MX_SCALE:
-        return GX_SCALE;
-    default:
-        return GX_GENERAL;
+        case (MX_SCALE | MX_IDENTITYSCALE | MX_NOTRANSLATE):
+            return GX_IDENTITY;
+        case (MX_SCALE | MX_IDENTITYSCALE):
+            return GX_OFFSET;
+        case MX_SCALE:
+            return GX_SCALE;
+        default:
+            return GX_GENERAL;
     }
 }
 
@@ -124,25 +124,25 @@ XFORMOBJ_UpdateAccel(
     pmx->flAccel = 0;
 
     if (FLOATOBJ_Equal0(&pmx->efDx) &&
-            FLOATOBJ_Equal0(&pmx->efDy))
+        FLOATOBJ_Equal0(&pmx->efDy))
     {
         pmx->flAccel |= MX_NOTRANSLATE;
     }
 
     if (FLOATOBJ_Equal0(&pmx->efM12) &&
-            FLOATOBJ_Equal0(&pmx->efM21))
+        FLOATOBJ_Equal0(&pmx->efM21))
     {
         pmx->flAccel |= MX_SCALE;
     }
 
     if (FLOATOBJ_Equal1(&pmx->efM11) &&
-            FLOATOBJ_Equal1(&pmx->efM22))
+        FLOATOBJ_Equal1(&pmx->efM22))
     {
         pmx->flAccel |= MX_IDENTITYSCALE;
     }
 
     if (FLOATOBJ_IsLong(&pmx->efM11) && FLOATOBJ_IsLong(&pmx->efM12) &&
-            FLOATOBJ_IsLong(&pmx->efM21) && FLOATOBJ_IsLong(&pmx->efM22))
+        FLOATOBJ_IsLong(&pmx->efM21) && FLOATOBJ_IsLong(&pmx->efM22))
     {
         pmx->flAccel |= MX_INTEGER;
     }
@@ -308,42 +308,42 @@ XFORMOBJ_bXformFixPoints(
     {
         if (flAccel & MX_IDENTITYSCALE)
         {
-        /* 1-scale integer transform */
-        i = cPoints - 1;
-        do
-        {
-            LONG x = pptIn[i].x + pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21);
-            LONG y = pptIn[i].y + pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12);
-            pptOut[i].y = y;
-            pptOut[i].x = x;
-        }
-        while (--i >= 0);
+            /* 1-scale integer transform */
+            i = cPoints - 1;
+            do
+            {
+                LONG x = pptIn[i].x + pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21);
+                LONG y = pptIn[i].y + pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12);
+                pptOut[i].y = y;
+                pptOut[i].x = x;
+            }
+            while (--i >= 0);
         }
         else if (flAccel & MX_SCALE)
         {
-        /* Diagonal integer transform */
-        i = cPoints - 1;
-        do
-        {
-            pptOut[i].x = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11);
-            pptOut[i].y = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22);
-        }
-        while (--i >= 0);
+            /* Diagonal integer transform */
+            i = cPoints - 1;
+            do
+            {
+                pptOut[i].x = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11);
+                pptOut[i].y = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22);
+            }
+            while (--i >= 0);
         }
         else
         {
-        /* Full integer transform */
-        i = cPoints - 1;
-        do
-        {
-            LONG x;
-            x  = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11);
-            x += pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21);
-            pptOut[i].y  = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22);
-            pptOut[i].y += pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12);
-            pptOut[i].x = x;
-        }
-        while (--i >= 0);
+            /* Full integer transform */
+            i = cPoints - 1;
+            do
+            {
+                LONG x;
+                x  = pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM11);
+                x += pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM21);
+                pptOut[i].y  = pptIn[i].y * FLOATOBJ_GetLong(&pmx->efM22);
+                pptOut[i].y += pptIn[i].x * FLOATOBJ_GetLong(&pmx->efM12);
+                pptOut[i].x = x;
+            }
+            while (--i >= 0);
         }
     }
     else if (flAccel & MX_IDENTITYSCALE)
@@ -468,11 +468,11 @@ XFORMOBJ_iGetFloatObjXform(
 BOOL
 APIENTRY
 XFORMOBJ_bApplyXform(
-    IN XFORMOBJ  *pxo,
-    IN ULONG  iMode,
-    IN ULONG  cPoints,
-    IN PVOID  pvIn,
-    OUT PVOID  pvOut)
+    IN XFORMOBJ *pxo,
+    IN ULONG iMode,
+    IN ULONG cPoints,
+    IN PVOID pvIn,
+    OUT PVOID pvOut)
 {
     MATRIX mx;
     XFORMOBJ xoInv;
index 8a39b1d..479f00a 100644 (file)
@@ -70,10 +70,6 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
 
 /* Undocumented stuff */
 typedef DRIVEROBJ *PDRIVEROBJ;
-#ifndef M_PI
-#define M_PI 3.14159265358979323846f
-#define M_PI_2 1.57079632679489661923
-#endif
 
 /* User heap */
 extern HANDLE GlobalUserHeap;