Delete all Trailing spaces in code.
authorDaniel Reimer <reimer.daniel@freenet.de>
Fri, 19 Oct 2007 23:01:40 +0000 (23:01 +0000)
committerDaniel Reimer <reimer.daniel@freenet.de>
Fri, 19 Oct 2007 23:01:40 +0000 (23:01 +0000)
svn path=/trunk/; revision=29688

161 files changed:
rostests/apitests/gdi32api/gdi32api.c
rostests/apitests/gdi32api/tests/AddFontResource.c
rostests/apitests/gdi32api/tests/CreateFont.c
rostests/apitests/gdi32api/tests/GetObject.c
rostests/apitests/gdi32api/tests/SetSysColors.c
rostests/apitests/w32kdll/w32kdll_2ksp4/main.c
rostests/apitests/w32kdll/w32kdll_ros/main.c
rostests/apitests/w32kdll/w32kdll_xpsp2/main.c
rostests/apitests/w32knapi/ntdd/NtGdiDdQueryDirectDrawObject.c
rostests/apitests/w32knapi/ntgdi/NtGdiDoPalette.c
rostests/apitests/w32knapi/ntgdi/NtGdiGetDIBits.c
rostests/apitests/w32knapi/w32knapi.c
rostests/drivers/kmtest/deviface.c
rostests/drivers/kmtest/ntos_ob.c
rostests/drivers/ntoskrnl/IoEaTest.cpp
rostests/dxtest/ddraw/DDraw/available_mem.cpp
rostests/dxtest/ddraw/DDraw/create.cpp
rostests/dxtest/ddraw/DDraw/display_modes.cpp
rostests/dxtest/ddraw/Surface/blt.cpp
rostests/dxtest/ddraw/Surface/caps_tests.h
rostests/dxtest/ddraw/Surface/create.cpp
rostests/dxtest/ddraw/Surface/misc.cpp
rostests/dxtest/ddraw/Surface/private_data.cpp
rostests/dxtest/ddraw/helper.cpp
rostests/dxtest/win32kdxtest/NtGdiDdCanCreateSurface.c
rostests/dxtest/win32kdxtest/NtGdiDdCreateDirectDrawObject.c
rostests/dxtest/win32kdxtest/NtGdiDdDeleteDirectDrawObject.c
rostests/dxtest/win32kdxtest/NtGdiDdGetScanLine.c
rostests/dxtest/win32kdxtest/NtGdiDdQueryDirectDrawObject.c
rostests/dxtest/win32kdxtest/NtGdiDdWaitForVerticalBlank.c
rostests/dxtest/win32kdxtest/dump.c
rostests/dxtest/win32kdxtest/main.c
rostests/dxtest/win32kdxtest/win32kdxtest.rbuild
rostests/regtests_by_casper/shared/regtests.h
rostests/tests/D3DParseUnknownCommand_show/main.c
rostests/tests/DxHalTest/main.c
rostests/tests/DxHalTest/main.h
rostests/tests/diskspeed/diskspeed.c
rostests/tests/enumfonts/enumfonts.cpp
rostests/tests/iptest/iptest.cpp
rostests/tests/lantst/lantest.cpp
rostests/tests/map_dup_inherit/map_dup_inherit.c
rostests/tests/mdi/mdi.rc
rostests/tests/miditest/miditest.rc
rostests/tests/oskittcp/tcptest.cpp
rostests/tests/patblt/patblt.cpp
rostests/tests/polytest/polytest.cpp
rostests/tests/popupmenu/popupmenu.rc
rostests/tests/primitives/mk_font.cpp
rostests/tests/primitives/primitives.cpp
rostests/tests/readconsole/readconsole.rbuild
rostests/tests/stretchblt/stretchblt.cpp
rostests/tests/txtscale/mk_font.cpp
rostests/tests/txtscale/txtscale.cpp
rostests/tests/wclickat/wclickat.c
rostests/tests/wm_erasebkgnd/wm_erasebkgnd.cpp
rostests/win32/loadlib/loadlib.c
rostests/win32/loadlib/loadlib.h
rostests/win32/msvcrt/fileio/_tfileio.c
rostests/win32/msvcrt/fileio/fileio.c
rostests/win32/msvcrt/fileio/main.c
rostests/win32/msvcrt/fileio/main.h
rostests/win32/msvcrt/fileio/wfileio.c
rostests/win32/rpcrt4/context_handles/client.c
rostests/win32/rpcrt4/context_handles/ctx.h
rostests/win32/rpcrt4/context_handles/ctx_c.c
rostests/win32/rpcrt4/context_handles/ctx_s.c
rostests/win32/rpcrt4/context_handles/server.c
rostests/win32/smss/movefile/movefile.cpp
rostests/win32/user32/drawcaption/capicon.c
rostests/win32/user32/drawcaption/drawcap.c
rostests/win32/user32/kbdlayout/kbdlayout.c
rostests/win32/user32/kbdlayout/kbdlayout.rc
rostests/win32/user32/kbdlayout/resource.h
rostests/win32/user32/sysicon/sysicon.c
rostests/winetests/advapi32/registry.c
rostests/winetests/cabinet/extract.c
rostests/winetests/comctl32/comboex.c
rostests/winetests/comctl32/dpa.c
rostests/winetests/comctl32/header.c
rostests/winetests/comctl32/listview.c
rostests/winetests/comctl32/progress.c
rostests/winetests/comctl32/propsheet.c
rostests/winetests/comctl32/subclass.c
rostests/winetests/comctl32/toolbar.c
rostests/winetests/comctl32/treeview.c
rostests/winetests/comctl32/updown.c
rostests/winetests/comdlg32/printdlg.c
rostests/winetests/gdi32/bitmap.c
rostests/winetests/gdi32/brush.c
rostests/winetests/gdi32/clipping.c
rostests/winetests/gdi32/dc.c
rostests/winetests/gdi32/font.c
rostests/winetests/gdi32/mapping.c
rostests/winetests/gdi32/metafile.c
rostests/winetests/gdi32/palette.c
rostests/winetests/icmp/icmp.c
rostests/winetests/kernel32/atom.c
rostests/winetests/kernel32/change.c
rostests/winetests/kernel32/codepage.c
rostests/winetests/kernel32/comm.c
rostests/winetests/kernel32/directory.c
rostests/winetests/kernel32/file.c
rostests/winetests/kernel32/heap.c
rostests/winetests/kernel32/locale.c
rostests/winetests/kernel32/mailslot.c
rostests/winetests/kernel32/module.c
rostests/winetests/kernel32/path.c
rostests/winetests/kernel32/pipe.c
rostests/winetests/kernel32/process.c
rostests/winetests/kernel32/profile.c
rostests/winetests/kernel32/sync.c
rostests/winetests/kernel32/thread.c
rostests/winetests/kernel32/time.c
rostests/winetests/kernel32/timer.c
rostests/winetests/lz32/lzexpand_main.c
rostests/winetests/mlang/mlang.c
rostests/winetests/msi/db.c
rostests/winetests/msi/format.c
rostests/winetests/msi/install.c
rostests/winetests/msi/msi.c
rostests/winetests/msi/package.c
rostests/winetests/msi/record.c
rostests/winetests/msvcrt/cpp.c
rostests/winetests/msvcrt/file.c
rostests/winetests/msvcrt/heap.c
rostests/winetests/msvcrt/printf.c
rostests/winetests/msvcrt/string.c
rostests/winetests/msvcrt/time.c
rostests/winetests/ntdll/atom.c
rostests/winetests/ntdll/change.c
rostests/winetests/ntdll/env.c
rostests/winetests/ntdll/info.c
rostests/winetests/ntdll/om.c
rostests/winetests/ntdll/port.c
rostests/winetests/ntdll/rtl.c
rostests/winetests/ntdll/rtlstr.c
rostests/winetests/ntdll/string.c
rostests/winetests/ntdll/time.c
rostests/winetests/powrprof/pwrprof.c
rostests/winetests/psapi/psapi_main.c
rostests/winetests/setupapi/stringtable.c
rostests/winetests/shell32/shellpath.c
rostests/winetests/shell32/shlexec.c
rostests/winetests/shell32/shlfolder.c
rostests/winetests/shlwapi/ordinal.c
rostests/winetests/shlwapi/path.c
rostests/winetests/shlwapi/shreg.c
rostests/winetests/shlwapi/string.c
rostests/winetests/user32/edit.c
rostests/winetests/user32/listbox.c
rostests/winetests/user32/menu.c
rostests/winetests/user32/msg.c
rostests/winetests/user32/resource.c
rostests/winetests/user32/sysparams.c
rostests/winetests/user32/text.c
rostests/winetests/user32/win.c
rostests/winetests/usp10/usp10.c
rostests/winetests/winetest/gui.c
rostests/winetests/winetest/main.c
rostests/winetests/winetest/winetest.rc

index 054cc10..000fa2b 100644 (file)
@@ -8,7 +8,7 @@ IsFunctionPresent(LPWSTR lpszFunction)
        return TRUE;\r
 }\r
 \r
-int APIENTRY \r
+int APIENTRY\r
 WinMain(HINSTANCE hInstance,\r
         HINSTANCE hPrevInstance,\r
         LPSTR     lpCmdLine,\r
index 016c5bd..727cedc 100644 (file)
@@ -16,7 +16,7 @@ Test_AddFontResourceA(PTESTINFO pti)
 
     RtlZeroMemory(szFileNameA,MAX_PATH);
 
-    /* 
+    /*
      * Start testing Ansi version
      *
      */
index fc26058..e14ba71 100644 (file)
@@ -7,8 +7,8 @@ Test_CreateFont(PTESTINFO pti)
        LOGFONTA logfonta;\r
 \r
        /* Test invalid font name */\r
-       hFont = CreateFontA(15, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, \r
-                           DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, \r
+       hFont = CreateFontA(15, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,\r
+                           DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,\r
                            DEFAULT_QUALITY, DEFAULT_PITCH, INVALIDFONT);\r
        RTEST(hFont);\r
        RTEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA));\r
index 45a8863..06acb3b 100644 (file)
@@ -220,7 +220,7 @@ Test_Pen(PTESTINFO pti)
 \r
        /* test if the fields are filled correctly */\r
        RTEST(logpen.lopnStyle == PS_SOLID);\r
-       \r
+\r
 \r
        DeleteObject(hPen);\r
        return TRUE;\r
@@ -308,7 +308,7 @@ Test_Font(PTESTINFO pti)
        BYTE bData[270];\r
 \r
        FillMemory(&logfonta, sizeof(LOGFONTA), 0x77);\r
-       hFont = CreateFont(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, \r
+       hFont = CreateFont(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,\r
                ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS,\r
                ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont");\r
        TEST(hFont);\r
index 9becb7e..224a37e 100644 (file)
@@ -18,7 +18,7 @@ Test_SetSysColors(PTESTINFO pti)
        TEST((UINT)SetSysColors(0, nElements, crColors) == 1);\r
        RTEST((UINT)SetSysColors(1, nElements, crColors) == 1);\r
        RTEST((UINT)SetSysColors(2, nElements, crColors) == 1);\r
-       \r
+\r
        /* try more than NUM_SYSCOLORS */\r
        RTEST((UINT)SetSysColors(55, nElements, crColors) == 1);\r
 \r
index 65d2fee..8b5e3ff 100644 (file)
@@ -14,15 +14,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
             // attach to process\r
             // return FALSE to fail DLL load\r
             break;\r
-        \r
+\r
         case DLL_PROCESS_DETACH:\r
             // detach from process\r
             break;\r
-        \r
+\r
         case DLL_THREAD_ATTACH:\r
             // attach to thread\r
             break;\r
-        \r
+\r
         case DLL_THREAD_DETACH:\r
             // detach from thread\r
             break;\r
index 65d2fee..8b5e3ff 100644 (file)
@@ -14,15 +14,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
             // attach to process\r
             // return FALSE to fail DLL load\r
             break;\r
-        \r
+\r
         case DLL_PROCESS_DETACH:\r
             // detach from process\r
             break;\r
-        \r
+\r
         case DLL_THREAD_ATTACH:\r
             // attach to thread\r
             break;\r
-        \r
+\r
         case DLL_THREAD_DETACH:\r
             // detach from thread\r
             break;\r
index 65d2fee..8b5e3ff 100644 (file)
@@ -14,15 +14,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
             // attach to process\r
             // return FALSE to fail DLL load\r
             break;\r
-        \r
+\r
         case DLL_PROCESS_DETACH:\r
             // detach from process\r
             break;\r
-        \r
+\r
         case DLL_THREAD_ATTACH:\r
             // attach to thread\r
             break;\r
-        \r
+\r
         case DLL_THREAD_DETACH:\r
             // detach from thread\r
             break;\r
index eb929ad..ce5e224 100644 (file)
@@ -52,10 +52,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        /* Test ReactX */\r
        hDirectDraw = (HANDLE) Syscall(L"NtGdiDdCreateDirectDrawObject", 1, &hdc);\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( NULL, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( NULL, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC) == FALSE);\r
 \r
@@ -70,10 +70,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RTEST(puNumHeaps == NULL);\r
        RTEST(puvmList == NULL);\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC) == FALSE);\r
 \r
@@ -89,10 +89,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RTEST(puvmList == NULL);\r
 \r
        pHalInfo = &HalInfo;\r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -124,11 +124,11 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
 \r
                /* Check the res */\r
                RTEST(pHalInfo->vmiData.dwDisplayWidth == devmode.dmPelsWidth );\r
-               RTEST(pHalInfo->vmiData.dwDisplayHeight == devmode.dmPelsHeight ); \r
-               /* FIXME \r
+               RTEST(pHalInfo->vmiData.dwDisplayHeight == devmode.dmPelsHeight );\r
+               /* FIXME\r
                        RTEST(pHalInfo->vmiData.lDisplayPitch == 0x1700;\r
                */\r
-               RTEST(pHalInfo->vmiData.ddpfDisplay.dwSize == sizeof(DDPIXELFORMAT) ); \r
+               RTEST(pHalInfo->vmiData.ddpfDisplay.dwSize == sizeof(DDPIXELFORMAT) );\r
                ASSERT(pHalInfo->vmiData.ddpfDisplay.dwSize == sizeof(DDPIXELFORMAT));\r
 \r
                /* Fail on 8bit screen deep */\r
@@ -159,18 +159,18 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
                /* the primary display address */\r
                /* test see if it in kmode memory or not */\r
                RTEST(pHalInfo->vmiData.pvPrimary != 0 );\r
-               \r
+\r
                /* Test see if we got any hardware acclartions for 2d or 3d */\r
                //RTEST(pHalInfo->ddCaps.dwSize == sizeof(DDCORECAPS));\r
 \r
-               /* Testing see if we got any hw support for \r
-                * This test can fail on video card that does not support 2d/overlay/3d \r
+               /* Testing see if we got any hw support for\r
+                * This test can fail on video card that does not support 2d/overlay/3d\r
                 */\r
                RTEST( pHalInfo->ddCaps.dwCaps != 0);\r
                RTEST( pHalInfo->ddCaps.ddsCaps.dwCaps != 0);\r
 \r
                /* if this fail we do not have a dx driver install acodring ms, some version of windows it\r
-                * is okay this fail and drv does then only support basic dx \r
+                * is okay this fail and drv does then only support basic dx\r
                 */\r
                RTEST( (pHalInfo->dwFlags & (DDHALINFO_GETDRIVERINFOSET | DDHALINFO_GETDRIVERINFO2)) != 0 );\r
 \r
@@ -191,10 +191,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        pCallBackFlags = CallBackFlags;\r
        RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -225,10 +225,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));\r
        RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -266,10 +266,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);\r
        RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -309,10 +309,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));\r
        RtlZeroMemory(puD3dDriverData,sizeof(D3DNTHAL_CALLBACKS));\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -354,10 +354,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RtlZeroMemory(puD3dDriverData,sizeof(D3DNTHAL_GLOBALDRIVERDATA));\r
        RtlZeroMemory(&D3dBufferCallbacks,sizeof(DD_D3DBUFCALLBACKS));\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -408,10 +408,10 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
        RtlZeroMemory(puD3dDriverData,sizeof(D3DNTHAL_GLOBALDRIVERDATA));\r
        RtlZeroMemory(&D3dBufferCallbacks,sizeof(DD_D3DBUFCALLBACKS));\r
 \r
-       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo, \r
-                                                                               pCallBackFlags, puD3dCallbacks, \r
-                                                                               puD3dDriverData, puD3dBufferCallbacks, \r
-                                                                               puD3dTextureFormats, puNumHeaps, \r
+       RTEST(NtGdiDdQueryDirectDrawObject( hDirectDraw, pHalInfo,\r
+                                                                               pCallBackFlags, puD3dCallbacks,\r
+                                                                               puD3dDriverData, puD3dBufferCallbacks,\r
+                                                                               puD3dTextureFormats, puNumHeaps,\r
                                                                                puvmList, puNumFourCC,\r
                                                                                puFourCC)== FALSE);\r
        RTEST(pHalInfo != NULL);\r
@@ -445,8 +445,8 @@ Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
 \r
 \r
 \r
-       /* Todo \r
-       * adding test for \r
+       /* Todo\r
+       * adding test for\r
        * puD3dCallbacks\r
        * puD3dDriverData\r
        * puD3dBufferCallbacks\r
index b30438c..6331d71 100644 (file)
@@ -5,7 +5,7 @@ CreateTestPalette()
        {\r
                LOGPALETTE logpal;\r
                PALETTEENTRY entry[5];\r
-       } palstruct = \r
+       } palstruct =\r
        { {0x300,5,\r
          { {1,2,3,0} }},\r
          { {22,33,44,PC_RESERVED},\r
index e1fc948..6718bb9 100644 (file)
@@ -4,7 +4,7 @@ FASTCALL
 DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )\r
 {\r
     UINT MaxBits = 0;\r
-    \r
+\r
     if (Info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))\r
     {\r
        PBITMAPCOREHEADER Core = (PBITMAPCOREHEADER)Info;\r
@@ -14,7 +14,7 @@ DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines )
     {\r
        if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS))\r
            return Info->bmiHeader.biSizeImage;\r
-    // Planes are over looked by Yuan. I guess assumed always 1.    \r
+    // Planes are over looked by Yuan. I guess assumed always 1.\r
        MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth;\r
     }\r
     MaxBits = ((MaxBits + 31) & ~31 ) / 8; // From Yuan, ScanLineSize = (Width * bitcount + 31)/32\r
index 32837aa..41d67df 100644 (file)
@@ -9,7 +9,7 @@ IntSyscall(FARPROC proc, UINT cParams, PVOID pFirstParam)
 {\r
        DWORD ret;\r
 \r
-       asm volatile \r
+       asm volatile\r
        (\r
                "pushfl;"                               // Save flags\r
                "movl %%ecx, %%eax;"\r
index 3f6ed12..ebb5010 100644 (file)
  * Returns a list of device interfaces of a particular device interface class.
  *
  * Parameters
- *    InterfaceClassGuid 
+ *    InterfaceClassGuid
  *       Points to a class GUID specifying the device interface class.
  *
- *    PhysicalDeviceObject 
+ *    PhysicalDeviceObject
  *       Points to an optional PDO that narrows the search to only the
- *       device interfaces of the device represented by the PDO. 
+ *       device interfaces of the device represented by the PDO.
  *
- *    Flags 
+ *    Flags
  *       Specifies flags that modify the search for device interfaces. The
  *       DEVICE_INTERFACE_INCLUDE_NONACTIVE flag specifies that the list of
  *       returned symbolic links should contain also disabled device
- *       interfaces in addition to the enabled ones.  
+ *       interfaces in addition to the enabled ones.
  *
- *    SymbolicLinkList 
+ *    SymbolicLinkList
  *       Points to a character pointer that is filled in on successful return
  *       with a list of unicode strings identifying the device interfaces
  *       that match the search criteria. The newly allocated buffer contains
  *       a list of symbolic link names. Each unicode string in the list is
  *       null-terminated; the end of the whole list is marked by an additional
  *       NULL. The caller is responsible for freeing the buffer (ExFreePool)
- *       when it is no longer needed. 
+ *       when it is no longer needed.
  *       If no device interfaces match the search criteria, this routine
  *       returns STATUS_SUCCESS and the string contains a single NULL
- *       character. 
+ *       character.
  *
  * Status
  *    @unimplemented
@@ -102,7 +102,7 @@ ReactOS_IoGetDeviceInterfaces(
    ULONG i = 0;
    ULONG j = 0;
    OBJECT_ATTRIBUTES ObjectAttributes;
-  
+
    Status = RtlStringFromGUID(InterfaceClassGuid, &GuidString);
    if (!NT_SUCCESS(Status))
    {
@@ -144,17 +144,17 @@ ReactOS_IoGetDeviceInterfaces(
       }
 
       DPRINT("IoGetDeviceInterfaces() called with PDO, not implemented.\n");
-      return STATUS_NOT_IMPLEMENTED;    
+      return STATUS_NOT_IMPLEMENTED;
    }
    else
-   {                                
+   {
       InitializeObjectAttributes(
          &ObjectAttributes,
          &BaseKeyName,
          OBJ_CASE_INSENSITIVE,
          NULL,
          NULL);
-                                                         
+
       Status = ZwOpenKey(
          &InterfaceKey,
          KEY_READ,
@@ -191,7 +191,7 @@ ReactOS_IoGetDeviceInterfaces(
          fip,
          Size,
          &Size);
-  
+
       if (!NT_SUCCESS(Status))
       {
          DPRINT("ZwQueryKey() Failed. (0x%X)\n", Status);
@@ -224,7 +224,7 @@ ReactOS_IoGetDeviceInterfaces(
 
          bip = (PKEY_BASIC_INFORMATION)ExAllocatePool(NonPagedPool, Size);
          ASSERT(bip != NULL);
-    
+
          Status = ZwEnumerateKey(
             InterfaceKey,
             i,
@@ -232,7 +232,7 @@ ReactOS_IoGetDeviceInterfaces(
             bip,
             Size,
             &Size);
-      
+
          if (!NT_SUCCESS(Status))
          {
             DPRINT("ZwEnumerateKey() Failed.(0x%X)\n", Status);
@@ -244,7 +244,7 @@ ReactOS_IoGetDeviceInterfaces(
             ZwClose(InterfaceKey);
             return Status;
          }
-         
+
          SubKeyName.Length = 0;
          SubKeyName.MaximumLength = BaseKeyName.Length + bip->NameLength + sizeof(WCHAR);
          SubKeyName.Buffer = ExAllocatePool(NonPagedPool, SubKeyName.MaximumLength);
@@ -308,7 +308,7 @@ ReactOS_IoGetDeviceInterfaces(
             bfip,
             Size,
             &Size);
-  
+
          if (!NT_SUCCESS(Status))
          {
             DPRINT("ZwQueryKey() Failed. (0x%X)\n", Status);
@@ -319,7 +319,7 @@ ReactOS_IoGetDeviceInterfaces(
             ZwClose(InterfaceKey);
             return Status;
          }
-         
+
          for(j = 0; j < bfip->SubKeys; j++)
          {
             Status = ZwEnumerateKey(
@@ -372,12 +372,12 @@ ReactOS_IoGetDeviceInterfaces(
                ZwClose(InterfaceKey);
                return Status;
             }
-         
+
             if (!wcsncmp(bip->Name, L"Control", bip->NameLength))
             {
                continue;
             }
-            
+
             SymbolicLinkKeyName.Length = 0;
             SymbolicLinkKeyName.MaximumLength = SubKeyName.Length + bip->NameLength + sizeof(WCHAR);
             SymbolicLinkKeyName.Buffer = ExAllocatePool(NonPagedPool, SymbolicLinkKeyName.MaximumLength);
@@ -394,7 +394,7 @@ ReactOS_IoGetDeviceInterfaces(
             ASSERT(ControlKeyName.Buffer != NULL);
             RtlCopyUnicodeString(&ControlKeyName, &SymbolicLinkKeyName);
             RtlAppendUnicodeStringToString(&ControlKeyName, &Control);
-   
+
             ExFreePool(bip);
 
             InitializeObjectAttributes(
@@ -425,16 +425,16 @@ ReactOS_IoGetDeviceInterfaces(
             }
 
             Status = ZwQueryValueKey(
-               SymbolicLinkKey, 
-               &SymbolicLink, 
+               SymbolicLinkKey,
+               &SymbolicLink,
                KeyValuePartialInformation,
                NULL,
                0,
                &Size);
-               
+
             if (Status == STATUS_OBJECT_NAME_NOT_FOUND)
                continue;
-      
+
             if (Status != STATUS_BUFFER_TOO_SMALL)
             {
                DPRINT("ZwQueryValueKey() Failed.(0x%X)\n", Status);
@@ -482,7 +482,7 @@ ReactOS_IoGetDeviceInterfaces(
             Status = RtlCheckRegistryKey(RTL_REGISTRY_ABSOLUTE, ControlKeyName.Buffer);
 
             if (NT_SUCCESS(Status))
-            {         
+            {
                /* Put the name in the string here */
                if (SymLinkList == NULL)
                {
@@ -510,7 +510,7 @@ ReactOS_IoGetDeviceInterfaces(
                   RtlCopyMemory(SymLinkListPtr, vpip->Data, vpip->DataLength);
                   SymLinkListPtr[vpip->DataLength / sizeof(WCHAR)] = 0;
                   SymLinkListPtr[1] = '?';
-               }               
+               }
             }
 
             RtlFreeUnicodeString(&SymbolicLinkKeyName);
@@ -534,7 +534,7 @@ ReactOS_IoGetDeviceInterfaces(
       }
 
       *SymbolicLinkList = SymLinkList;
-    
+
       RtlFreeUnicodeString(&BaseKeyName);
       ZwClose(InterfaceKey);
       ExFreePool(bfip);
index 1b54dac..e053b2d 100644 (file)
@@ -201,10 +201,10 @@ ObtCreateObjectTypes()
         ObTypeInitializer[i].ParseProcedure = (OB_PARSE_METHOD)ParseProc;
         //ObTypeInitializer[i].OkayToCloseProcedure =
         //    (OB_OKAYTOCLOSE_METHOD)OkayToCloseProc;
-        
+
         //ObTypeInitializer[i].QueryNameProcedure =
         //    (OB_QUERYNAME_METHOD)QueryNameProc;
-        
+
         //ObTypeInitializer[i].SecurityProcedure =
         // (OB_SECURITY_METHOD)SecurityProc;
 
@@ -284,7 +284,7 @@ ObtCreateObjects()
     QueryNameSave=QueryNameCount;
 
     Status = ObInsertObject(ObBody[1], NULL, GENERIC_ALL, 0,
-        &ObBody[1], &ObHandle1[1]); 
+        &ObBody[1], &ObHandle1[1]);
     ok(Status == STATUS_SUCCESS,
         "Failed to insert object 1 with status=0x%lX", Status);
     ok(ObBody[1] != NULL, "Object body = NULL");
index 7e2f40e..4bd18e5 100644 (file)
@@ -34,16 +34,16 @@ IoCheckEaBufferValidityROS(IN PFILE_FULL_EA_INFORMATION EaBuffer,
    ULONG NextEaBufferOffset;
    UINT IntEaLength;
 
-   /* Lenght of the rest. Inital equal to EaLength */ 
+   /* Lenght of the rest. Inital equal to EaLength */
    IntEaLength = EaLength;
-   /* Inital EaBuffer equal to EaBuffer */ 
+   /* Inital EaBuffer equal to EaBuffer */
    EaBufferEnd = EaBuffer;
 
    /* The rest length of the buffer */
    /* 8 = sizeof(ULONG) + sizeof(UCHAR) + sizeof(UCHAR) + sizeof(USHORT) */
    while (IntEaLength >= 8)
    {
-      /* rest of buffer must greater then the sizeof(FILE_FULL_EA_INFORMATION) + buffer */ 
+      /* rest of buffer must greater then the sizeof(FILE_FULL_EA_INFORMATION) + buffer */
       NextEaBufferOffset = EaBufferEnd->EaNameLength+EaBufferEnd->EaValueLength + 9;
       if (IntEaLength >= NextEaBufferOffset)
       {
@@ -61,11 +61,11 @@ IoCheckEaBufferValidityROS(IN PFILE_FULL_EA_INFORMATION EaBuffer,
                }
             }
             else
-            { 
-               /* 
-                  From the MSDN (http://msdn2.microsoft.com/en-us/library/ms795740.aspx). 
-                  For all entries except the last, the value of NextEntryOffset must be greater 
-                  than zero and must fall on a ULONG boundary. 
+            {
+               /*
+                  From the MSDN (http://msdn2.microsoft.com/en-us/library/ms795740.aspx).
+                  For all entries except the last, the value of NextEntryOffset must be greater
+                  than zero and must fall on a ULONG boundary.
                */
                NextEaBufferOffset = ((NextEaBufferOffset + 3) & 0xFFFFFFFC);
                if ((EaBufferEnd->NextEntryOffset == NextEaBufferOffset) && (EaBufferEnd->NextEntryOffset>0))
@@ -89,7 +89,7 @@ IoCheckEaBufferValidityROS(IN PFILE_FULL_EA_INFORMATION EaBuffer,
       /* calculate the error offset. Or in */
       *ErrorOffset = (ULONG)((ULONG_PTR)EaBufferEnd - (ULONG_PTR)EaBuffer);
    }
-   
+
    return STATUS_EA_LIST_INCONSISTENT;
 }
 
@@ -125,7 +125,7 @@ int _tmain(int argc, _TCHAR* argv[])
 {
    void *pFunction;
    pIoCheckEaBufferValidity IoCheckEaBufferValidity;
-   
+
    HMODULE hKrnlMod = LoadLibrary(L"ntoskrnl.exe");
    if (hKrnlMod)
    {
@@ -144,29 +144,29 @@ int _tmain(int argc, _TCHAR* argv[])
          int iTestCount,i;
          ULONG TestEaLength;
          UCHAR TestEaBufferFlags;
-         
+
          // Test the flag
          TestEaBufferFlags = 0;
-         
+
          iTestCount = 1;
          WinEaBuffer = (PFILE_FULL_EA_INFORMATION)malloc(TEST_BUFFER_LEN);
          ROSEaBuffer = (PFILE_FULL_EA_INFORMATION)malloc(TEST_BUFFER_LEN);
-         
+
 
          printf("1.) Test : *********************\n");
 
          /* Check EaLength calculation */
-         /* Here all zero : only i>9 pass the test with STATUS_SUCCESS */ 
+         /* Here all zero : only i>9 pass the test with STATUS_SUCCESS */
 
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             ulROSError = RANDOM_INIT_ERROR;
@@ -179,18 +179,18 @@ int _tmain(int argc, _TCHAR* argv[])
 
          printf("2.) Test : *********************\n");
 
-         /* Here all zero but EaBuffer::EaName is set : will allways end in STATUS_EA_LIST_INCONSISTENT */ 
-         /* There must a link to EaBuffer::EaName */ 
+         /* Here all zero but EaBuffer::EaName is set : will allways end in STATUS_EA_LIST_INCONSISTENT */
+         /* There must a link to EaBuffer::EaName */
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -202,20 +202,20 @@ int _tmain(int argc, _TCHAR* argv[])
          }
 
          printf("3.) Test : *********************\n");
-         
-         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is count up. EaLength is maxbuffer: STATUS_SUCCESS when EaBuffer::EaNameLength>strlen(EaBuffer::EaName) */ 
+
+         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is count up. EaLength is maxbuffer: STATUS_SUCCESS when EaBuffer::EaNameLength>strlen(EaBuffer::EaName) */
          TestEaLength = TEST_BUFFER_LEN;
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
 
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
             WinEaBuffer->EaNameLength = i;
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -229,19 +229,19 @@ int _tmain(int argc, _TCHAR* argv[])
          }
 
          printf("4.) Test : *********************\n");
-         
-         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName). EaLength is count: STATUS_SUCCESS when EaLength>=17 (EaBuffer::EaNameLength+9) */ 
+
+         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName). EaLength is count: STATUS_SUCCESS when EaLength>=17 (EaBuffer::EaNameLength+9) */
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
             WinEaBuffer->EaNameLength = (UCHAR)strlen(WinEaBuffer->EaName);
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -256,11 +256,11 @@ int _tmain(int argc, _TCHAR* argv[])
 
          printf("5.) Test : *********************\n");
 
-         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: STATUS_SUCCESS when EaLength>=26 (EaBuffer::EaNameLength+EaBuffer::EaValueLength+9) */ 
+         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: STATUS_SUCCESS when EaLength>=26 (EaBuffer::EaNameLength+EaBuffer::EaValueLength+9) */
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
             WinEaBuffer->EaNameLength = (UCHAR)strlen(WinEaBuffer->EaName);
@@ -268,7 +268,7 @@ int _tmain(int argc, _TCHAR* argv[])
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -282,16 +282,16 @@ int _tmain(int argc, _TCHAR* argv[])
             iTestCount++;
          }
 
-         
+
          printf("6.) Test : *********************\n");
 
          /* The same test like 5.) but more data in the buffer*/
-         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: STATUS_SUCCESS when EaLength>=26 (EaBuffer::EaNameLength+EaBuffer::EaValueLength+9) */ 
-         
+         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: STATUS_SUCCESS when EaLength>=26 (EaBuffer::EaNameLength+EaBuffer::EaValueLength+9) */
+
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -300,7 +300,7 @@ int _tmain(int argc, _TCHAR* argv[])
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
@@ -316,13 +316,13 @@ int _tmain(int argc, _TCHAR* argv[])
          }
 
          printf("7.) Test : *********************\n");
-         
+
          /* The same test like 6.) but wrong strlen */
-         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: will allways end in STATUS_EA_LIST_INCONSISTENT */ 
+         /* Here EaBuffer::EaName is set and EaBuffer::EaNameLength is strlen(EaBuffer::EaName) EaBuffer::EaValueLength is strlen(EaBuffer::EaName)+1. EaLength is count: will allways end in STATUS_EA_LIST_INCONSISTENT */
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = i;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -331,7 +331,7 @@ int _tmain(int argc, _TCHAR* argv[])
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
@@ -348,13 +348,13 @@ int _tmain(int argc, _TCHAR* argv[])
 
 
          printf("8.) Test : *********************\n");
-         
-         /* Here WinEaBuffer->NextEntryOffset test : STATUS_SUCCESS when NextEntryOffset=0 else STATUS_EA_LIST_INCONSISTENT when NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC then ErrorOffset 28 */ 
+
+         /* Here WinEaBuffer->NextEntryOffset test : STATUS_SUCCESS when NextEntryOffset=0 else STATUS_EA_LIST_INCONSISTENT when NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC then ErrorOffset 28 */
          /* From the MSDN (http://msdn2.microsoft.com/en-us/library/ms795740.aspx). For all entries except the last, the value of NextEntryOffset must be greater than zero and must fall on a ULONG boundary.*/
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = TEST_BUFFER_LEN;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
@@ -364,7 +364,7 @@ int _tmain(int argc, _TCHAR* argv[])
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinEaBuffer->NextEntryOffset = i;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x%x%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
@@ -382,27 +382,27 @@ int _tmain(int argc, _TCHAR* argv[])
          }
 
          printf("9.) Test : *********************\n");
-         
-         /* Here WinEaBuffer->NextEntryOffset test wrong strlen: STATUS_SUCCESS NextEntryOffset=0 & NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC */ 
+
+         /* Here WinEaBuffer->NextEntryOffset test wrong strlen: STATUS_SUCCESS NextEntryOffset=0 & NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC */
          /* From the MSDN (http://msdn2.microsoft.com/en-us/library/ms795740.aspx). For all entries except the last, the value of NextEntryOffset must be greater than zero and must fall on a ULONG boundary.*/
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = TEST_BUFFER_LEN;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
-            
+
             WinEaBuffer->EaNameLength = (UCHAR)strlen(WinEaBuffer->EaName)-1;
             WinEaBuffer->EaValueLength = (UCHAR)strlen(WinEaBuffer->EaName);
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinEaBuffer->NextEntryOffset = i;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
-            
+
             ROSEaBuffer->EaNameLength = (UCHAR)strlen(ROSEaBuffer->EaName)-1;
             ROSEaBuffer->EaValueLength = (UCHAR)strlen(ROSEaBuffer->EaName);
             ulROSError = RANDOM_INIT_ERROR;
@@ -416,27 +416,27 @@ int _tmain(int argc, _TCHAR* argv[])
          }
 
          printf("10.) Test : *********************\n");
-         
-         /* Here WinEaBuffer->NextEntryOffset test wrong strlen: STATUS_SUCCESS NextEntryOffset=0 & NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC */ 
+
+         /* Here WinEaBuffer->NextEntryOffset test wrong strlen: STATUS_SUCCESS NextEntryOffset=0 & NextEntryOffset = 28 = 8+8+9 ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC */
          /* From the MSDN (http://msdn2.microsoft.com/en-us/library/ms795740.aspx). For all entries except the last, the value of NextEntryOffset must be greater than zero and must fall on a ULONG boundary.*/
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = TEST_BUFFER_LEN;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
-            
+
             WinEaBuffer->EaNameLength = (UCHAR)strlen(WinEaBuffer->EaName)+1;
             WinEaBuffer->EaValueLength = (UCHAR)strlen(WinEaBuffer->EaName)+1;
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinEaBuffer->NextEntryOffset = i;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR);
-            
+
             ROSEaBuffer->EaNameLength = (UCHAR)strlen(ROSEaBuffer->EaName)+1;
             ROSEaBuffer->EaValueLength = (UCHAR)strlen(ROSEaBuffer->EaName)+1;
             ulROSError = RANDOM_INIT_ERROR;
@@ -451,25 +451,25 @@ int _tmain(int argc, _TCHAR* argv[])
 
          printf("11.) Test : *********************\n");
 
-         /* Here WinEaBuffer->NextEntryOffset :  */ 
+         /* Here WinEaBuffer->NextEntryOffset :  */
          for (i=0;i<TEST_BUFFER_LEN;i++)
          {
             TestEaLength = TEST_BUFFER_LEN;
-            // Windows 
+            // Windows
             memset(WinEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(WinEaBuffer->EaName,"%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
-            
+
             WinEaBuffer->EaNameLength = (UCHAR)strlen(WinEaBuffer->EaName);
             WinEaBuffer->EaValueLength = (UCHAR)strlen(WinEaBuffer->EaName);
             ulWinError = RANDOM_INIT_ERROR;
             WinEaBuffer->Flags = TestEaBufferFlags;
             WinEaBuffer->NextEntryOffset = ((WinEaBuffer->EaNameLength+WinEaBuffer->EaNameLength+9)+3)&0xFFFFFFFC;
             WinStatus = IoCheckEaBufferValidity(WinEaBuffer,TestEaLength,&ulWinError);
-            
+
             // ROS
             memset(ROSEaBuffer,0,TEST_BUFFER_LEN);
             sprintf(ROSEaBuffer->EaName,"%x",RANDOM_INIT_ERROR,RANDOM_INIT_ERROR);
-            
+
             ROSEaBuffer->EaNameLength = (UCHAR)strlen(ROSEaBuffer->EaName);
             ROSEaBuffer->EaValueLength = (UCHAR)strlen(ROSEaBuffer->EaName);
             ulROSError = RANDOM_INIT_ERROR;
@@ -486,7 +486,7 @@ int _tmain(int argc, _TCHAR* argv[])
          free(WinEaBuffer);
          free(ROSEaBuffer);
       }
-      
+
       FreeLibrary(hKrnlMod);
    }
    else
index 2af24ac..6a93fb9 100644 (file)
@@ -254,7 +254,7 @@ BOOL Test_GetAvailableVidMem (INT* passed, INT* failed)
        memset(&Caps,0,sizeof(DDSCAPS2));
        Caps.dwCaps3 = ~(DDSCAPS3_MULTISAMPLE_QUALITY_MASK | DDSCAPS3_MULTISAMPLE_MASK | DDSCAPS3_RESERVED1 | DDSCAPS3_RESERVED2 | DDSCAPS3_LIGHTWEIGHTMIPMAP | DDSCAPS3_AUTOGENMIPMAP | DDSCAPS3_DMAP);
        TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DDERR_INVALIDCAPS);
-       
+
        memset(&Caps,0,sizeof(DDSCAPS2));
        Caps.dwCaps3 = (DDSCAPS3_MULTISAMPLE_QUALITY_MASK | DDSCAPS3_MULTISAMPLE_MASK | DDSCAPS3_RESERVED1 | DDSCAPS3_RESERVED2 | DDSCAPS3_LIGHTWEIGHTMIPMAP | DDSCAPS3_AUTOGENMIPMAP | DDSCAPS3_DMAP);
        TEST (DirectDraw->GetAvailableVidMem(&Caps, &Total, &Free) == DD_OK);
index 21ccd25..ffa612b 100644 (file)
@@ -12,7 +12,7 @@ BOOL Test_CreateDDraw (INT* passed, INT* failed)
 
        TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, (IUnknown*)0xdeadbeef) == CLASS_E_NOAGGREGATION);
        TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw4, NULL) == DDERR_INVALIDPARAMS);
-       TEST (DirectDrawCreateEx(NULL, NULL, IID_IDirectDraw7, NULL) == DDERR_INVALIDPARAMS); 
+       TEST (DirectDrawCreateEx(NULL, NULL, IID_IDirectDraw7, NULL) == DDERR_INVALIDPARAMS);
 
        DirectDraw = NULL;
        TEST (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) == DD_OK);
index 68e30b2..9915af2 100644 (file)
@@ -18,7 +18,7 @@ HRESULT CALLBACK EnumDisplayModes( LPDDSURFACEDESC2 pDDSD, ENUMCONTEXT* Context
        if(setcout >= 5)
                return DDENUMRET_OK;
 
-       DWORD lpdwFrequency = 0; 
+       DWORD lpdwFrequency = 0;
        INT* passed = Context->passed;
        INT* failed = Context->failed;
        DDSURFACEDESC2 DisplayMode = {0};
@@ -29,12 +29,12 @@ HRESULT CALLBACK EnumDisplayModes( LPDDSURFACEDESC2 pDDSD, ENUMCONTEXT* Context
        TEST ( Context->DirectDraw->SetDisplayMode (pDDSD->dwWidth, pDDSD->dwHeight, pDDSD->ddpfPixelFormat.dwRGBBitCount, pDDSD->dwRefreshRate, 0) == DD_OK);
        TEST ( Context->DirectDraw->GetMonitorFrequency (&lpdwFrequency) == DD_OK && lpdwFrequency == pDDSD->dwRefreshRate);
        TEST ( Context->DirectDraw->GetDisplayMode (&DisplayMode) == DD_OK
-               && pDDSD->dwHeight == DisplayMode.dwHeight 
-               && pDDSD->dwWidth == DisplayMode.dwWidth 
+               && pDDSD->dwHeight == DisplayMode.dwHeight
+               && pDDSD->dwWidth == DisplayMode.dwWidth
                && pDDSD->dwRefreshRate == DisplayMode.dwRefreshRate
-               && pDDSD->ddpfPixelFormat.dwRGBBitCount == DisplayMode.ddpfPixelFormat.dwRGBBitCount 
+               && pDDSD->ddpfPixelFormat.dwRGBBitCount == DisplayMode.ddpfPixelFormat.dwRGBBitCount
                && DisplayMode.dwFlags == DDSD_HEIGHT | DDSD_WIDTH | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_REFRESHRATE );
-       
+
        setcout++;
        return DDENUMRET_OK;
 }
index 5515bc4..ed3024f 100644 (file)
@@ -53,11 +53,11 @@ VOID Blt_Test (LPDIRECTDRAWSURFACE7 Surface, INT* passed, INT* failed)
        bltfx.dwFillColor = RGB(255, 255, 0);
     TEST (Source->Blt(&rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &bltfx) == DD_OK);
     TEST (GetPixel(Source, 0, 0) == RGB(0, 255, 0));
-    TEST (GetPixel(Source, 100, 100) == RGB(255, 255, 0));    
+    TEST (GetPixel(Source, 100, 100) == RGB(255, 255, 0));
 
     // Test DestRect and SrcRect
-    RECT SourceRect = {100, 100, 200, 200}; 
-    RECT DestRect = {0, 0, 200, 100}; 
+    RECT SourceRect = {100, 100, 200, 200};
+    RECT DestRect = {0, 0, 200, 100};
 
     TEST (Surface->Blt(&SourceRect, Source, &DestRect, 0, NULL) == DD_OK);
     TEST (GetPixel(Surface, 100, 100) == RGB(0, 255, 0)); // Src bigger: normal blt
@@ -68,20 +68,20 @@ VOID Blt_Test (LPDIRECTDRAWSURFACE7 Surface, INT* passed, INT* failed)
     DestRect.right = 100; // both are same size now
     TEST (Surface->Blt(&DestRect, Source, &SourceRect, 0, NULL) == DD_OK);
     TEST (GetPixel(Surface, 0, 0) == RGB(255, 255, 0));
-    
-    RECT TooBig = {100, 100, 200, 250}; 
+
+    RECT TooBig = {100, 100, 200, 250};
     TEST (Surface->Blt(&TooBig, Source, &SourceRect, 0, NULL) == DDERR_INVALIDRECT);
     TEST (Surface->Blt(&DestRect, Source, &TooBig, 0, NULL) == DDERR_INVALIDRECT);
 
     // Test Rotation
        bltfx.dwDDFX = DDBLTFX_MIRRORLEFTRIGHT|DDBLTFX_MIRRORUPDOWN;
-    TEST (Surface->Blt(NULL, Source, NULL, DDBLT_WAIT|DDBLT_DDFX, &bltfx) == DD_OK); 
+    TEST (Surface->Blt(NULL, Source, NULL, DDBLT_WAIT|DDBLT_DDFX, &bltfx) == DD_OK);
     TEST (GetPixel(Surface, 0, 0) == RGB(255, 255, 0));
 
        bltfx.dwDDFX = DDBLTFX_ROTATE180;
     TEST (Surface->Blt(NULL, Source, NULL, DDBLT_DDFX, &bltfx) == DDERR_NOROTATIONHW);
 
-       //bltfx.dwRotationAngle = 
+       //bltfx.dwRotationAngle =
     TEST (Surface->Blt(NULL, Source, NULL, DDBLT_ROTATIONANGLE, &bltfx) == DDERR_NOROTATIONHW);
 
     // Test Raster Operations
@@ -95,7 +95,7 @@ VOID Blt_Test (LPDIRECTDRAWSURFACE7 Surface, INT* passed, INT* failed)
     TEST (Surface->Blt(NULL, Source, NULL, DDBLT_WAIT|DDBLT_ROP, &bltfx) == DD_OK);
     TEST(GetPixel(Surface, 0, 0) == RGB(0, 255, 0));
        bltfx.dwROP = SRCAND;
-    TEST (Surface->Blt(NULL, Source, NULL, DDBLT_WAIT|DDBLT_ROP, &bltfx) == DDERR_NORASTEROPHW); 
+    TEST (Surface->Blt(NULL, Source, NULL, DDBLT_WAIT|DDBLT_ROP, &bltfx) == DDERR_NORASTEROPHW);
 
     // Test Direct Draw Raster Operations
        bltfx.dwDDROP = 0x123;
index cf26f8e..0a1394f 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * The following test cases have been generated automatically. Many of them might be 
- * redundant. Also some of them might fail on other other machines then the one I 
- * used (win xp, nvidea, 32 bit color deepth) - mbosma 
+ * The following test cases have been generated automatically. Many of them might be
+ * redundant. Also some of them might fail on other other machines then the one I
+ * used (win xp, nvidea, 32 bit color deepth) - mbosma
  *
  */
 
index 6c53c64..7ad5cb5 100644 (file)
@@ -5,7 +5,7 @@ LPDIRECTDRAW7 DirectDraw;
 BOOL TestCaps (char* dummy, DWORD Caps, HRESULT test1, HRESULT test2)
 {
     LPDIRECTDRAWSURFACE7 Surface = NULL;
-       DDSURFACEDESC2 Desc = { 0 }; 
+       DDSURFACEDESC2 Desc = { 0 };
        Desc.dwHeight = 200;
        Desc.dwWidth = 200;
        Desc.dwSize = sizeof (DDSURFACEDESC2);
@@ -27,7 +27,7 @@ BOOL Test_CreateSurface (INT* passed, INT* failed)
 {
        LPDIRECTDRAWSURFACE7 Surface = NULL;
        HWND hwnd;
+
        /* Preparations */
        if (DirectDrawCreateEx(NULL, (VOID**)&DirectDraw, IID_IDirectDraw7, NULL) != DD_OK)
        {
@@ -36,21 +36,21 @@ BOOL Test_CreateSurface (INT* passed, INT* failed)
        }
 
        TEST ( DirectDraw->CreateSurface(NULL, NULL, NULL) == DDERR_NOCOOPERATIVELEVELSET);
+
        if(!( hwnd = CreateBasicWindow() ))
        {
                printf("ERROR: Failed to create window\n");
                DirectDraw->Release();
                return FALSE;
        }
+
        if (DirectDraw->SetCooperativeLevel (hwnd, DDSCL_NORMAL) != DD_OK)
        {
                printf("ERROR: Could not set cooperative level\n");
                DirectDraw->Release();
                return 0;
        }
+
        /* The Test */
        DDSURFACEDESC2 Desc = { 0 };
        Desc.dwSize = sizeof (DDSURFACEDESC2);
@@ -61,11 +61,11 @@ BOOL Test_CreateSurface (INT* passed, INT* failed)
        TEST ( DirectDraw->CreateSurface(NULL, &Surface, NULL) == DDERR_INVALIDPARAMS );
        TEST ( DirectDraw->CreateSurface(&Desc, NULL, NULL) == DDERR_INVALIDPARAMS );
        TEST ( DirectDraw->CreateSurface(&Desc, &Surface, NULL) == DDERR_INVALIDPARAMS );
-    
+
     // Test (nearly) all possible cap combinations
     #include "caps_tests.h"
 
     DirectDraw->Release();
+
        return TRUE;
 }
index 1d493e9..41c13c0 100644 (file)
@@ -11,7 +11,7 @@ BOOL Test_Misc (INT* passed, INT* failed)
     // GetCaps
     DDSCAPS2 Caps;
     TEST (Surface->GetCaps((DDSCAPS2*)0xdeadbeef) == DDERR_INVALIDPARAMS);
-    TEST (Surface->GetCaps(&Caps) == DD_OK && Caps.dwCaps == 0x10004040 
+    TEST (Surface->GetCaps(&Caps) == DD_OK && Caps.dwCaps == 0x10004040
         && Caps.dwCaps2 == Caps.dwCaps3 == Caps.dwCaps4 == 0); // FIXME: Replace 0x10004040
 
     // GetDC / ReleaseDC
@@ -41,7 +41,7 @@ BOOL Test_Misc (INT* passed, INT* failed)
     TEST (Surface->GetPixelFormat(&PixelFormat));
     PixelFormat.dwSize = sizeof(DDPIXELFORMAT);
     TEST (Surface->GetPixelFormat(&PixelFormat) == DD_OK && PixelFormat.dwFlags == 0x40); // FIXME: Find out what 0x40 is
-    
+
     // GetSurfaceDesc / SetSurfaceDesc
     DDSURFACEDESC2 Desc = {0};
     // FIXME: Produce DDERR_INVALIDSURFACETYPE
index cb8f85b..e9839af 100644 (file)
@@ -29,7 +29,7 @@ BOOL Test_PrivateData (INT* passed, INT* failed)
     TEST(Surface->FreePrivateData(guid) == DD_OK);
     TEST(Surface->FreePrivateData(guid) == DDERR_NOTFOUND);
 
-    // Test for DDSPD_VOLATILE flag 
+    // Test for DDSPD_VOLATILE flag
     TEST(Surface->SetPrivateData(guid, (LPVOID)&dummy, sizeof(DWORD), DDSPD_VOLATILE) == DD_OK);
     size = 0;
     TEST(Surface->GetPrivateData(guid, NULL, &size) == DDERR_MOREDATA && size == sizeof(DWORD));
@@ -37,7 +37,7 @@ BOOL Test_PrivateData (INT* passed, INT* failed)
 
        DDBLTFX  bltfx;
        bltfx.dwSize = sizeof(DDBLTFX);
-       bltfx.dwFillColor = RGB(0, 0, 0);       
+       bltfx.dwFillColor = RGB(0, 0, 0);
        if(Surface->Blt(NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &bltfx) != DD_OK)
         printf("ERROR: Failed to draw to surface !");
     TEST(Surface->GetPrivateData(guid, &dummy, &size) == DDERR_EXPIRED);
index b414ffc..92bf3aa 100644 (file)
@@ -37,7 +37,7 @@ BOOL CreateSurface(LPDIRECTDRAWSURFACE7* pSurface)
                printf("ERROR: Failed to set up ddraw\n");
                return FALSE;
        }
+
        if(!( hwnd = CreateBasicWindow() ))
        {
                printf("ERROR: Failed to create window\n");
@@ -53,9 +53,9 @@ BOOL CreateSurface(LPDIRECTDRAWSURFACE7* pSurface)
        }
 
     // Creat Surface
-       DDSURFACEDESC2 Desc = { 0 }; 
+       DDSURFACEDESC2 Desc = { 0 };
        Desc.dwHeight = 200;
-       Desc.dwWidth = 200;     
+       Desc.dwWidth = 200;
     Desc.dwSize = sizeof (DDSURFACEDESC2);
     Desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
        Desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
index e3662f4..0bc6e4c 100644 (file)
@@ -20,10 +20,10 @@ test_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)
     BOOL retValue=FALSE;\r
     DDHAL_CANCREATESURFACEDATA pCanCreateSurface;\r
     DDSURFACEDESC2 desc;\r
-    \r
+\r
     RtlZeroMemory(&pCanCreateSurface,sizeof(DDHAL_CANCREATESURFACEDATA));\r
     RtlZeroMemory(&desc,sizeof(DDSURFACEDESC2));\r
-    \r
+\r
     /* crash in windows 2000 */\r
     retValue = OsThunkDdCanCreateSurface(NULL,NULL);\r
     testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdCanCreateSurface(NULL,NULL);\0");\r
index 08f9e41..28943ce 100644 (file)
@@ -37,7 +37,7 @@ test_NtGdiDdCreateDirectDrawObject()
     }
 
     printf("Start testing of NtGdiDdCreateDirectDrawObject\n");
-    
+
     retValue = OsThunkDdCreateDirectDrawObject(NULL);
     testing_noteq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(NULL);\0");
 
index c2dd32b..0fd1e47 100644 (file)
@@ -17,7 +17,7 @@ test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
     int fails=0;
     BOOL retValue=FALSE;
     printf("Start testing of NtGdiDdDeleteDirectDrawObject\n");
-    
+
     retValue = OsThunkDdDeleteDirectDrawObject(hDirectDrawLocal);
     testing_eq(retValue,FALSE,fails,"NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);\0");
 
index d3ed876..3aea20f 100644 (file)
@@ -20,7 +20,7 @@ test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)
 \r
     printf("Start testing of NtGdiDdGetScanLine\n");\r
     RtlZeroMemory(&puGetScanLineData,sizeof(DD_GETSCANLINEDATA));\r
-    \r
+\r
     retValue = OsThunkDdGetScanLine(NULL,NULL);\r
     testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdGetScanLine(NULL,NULL);\0");\r
 \r
@@ -33,7 +33,7 @@ test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)
     testing_noteq(puGetScanLineData.ddRVal,DD_OK,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");\r
     testing_eq(puGetScanLineData.dwScanLine,0,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");\r
 \r
-    \r
+\r
     /* FIXME DDERR_VERTICALBLANKINPROGRESS test */\r
 \r
     show_status(fails, "NtGdiDdGetScanLine\0");\r
index bc72101..3d0daa3 100644 (file)
@@ -16,21 +16,21 @@ struct
 } *mytest;
 
 /*
- * Test see if we can setup DirectDrawObject 
+ * Test see if we can setup DirectDrawObject
  *
  */
 
-/* 
- * ToDO 
- * 1. add more testcase it is only some, but we do not test for all case 
+/*
+ * ToDO
+ * 1. add more testcase it is only some, but we do not test for all case
  *    that happen only some
  *
- * 2.Fixed the false alaret for drivers only support 2d dx interface 
+ * 2.Fixed the false alaret for drivers only support 2d dx interface
  *
- * 3. fixed the dumping of d3d struct. 
+ * 3. fixed the dumping of d3d struct.
  *
  */
+
 void
 test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
 {
@@ -69,14 +69,14 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     memset(CallBackFlags,0,sizeof(DWORD)*3);
 
     printf("Start testing of NtGdiDdQueryDirectDrawObject\n");
-    
+
     /* testing  OsThunkDdQueryDirectDrawObject( NULL, ....  */
     printf("testing  DdQueryDirectDrawObject( NULL, ....)\n");
 
-    retValue = OsThunkDdQueryDirectDrawObject( NULL, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( NULL, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
     testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(NULL, ...);\0");
@@ -92,10 +92,10 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     /* testing  OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, NULL, ....  */
     printf("testing  DdQueryDirectDrawObject( hDD, NULL, ....)\n");
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
@@ -113,10 +113,10 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     printf("testing  DdQueryDirectDrawObject( hDD, pHalInfo, NULL, ....)\n");
 
     pHalInfo = &HalInfo;
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
@@ -150,10 +150,10 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
 
     RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
@@ -189,16 +189,16 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     RtlZeroMemory(pHalInfo,sizeof(DD_HALINFO));
     RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
     testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
     testing_eq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
-    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");    
+    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
     testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"4. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
 
     testing_noteq(puD3dDriverData,NULL,fails,"5. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
@@ -232,16 +232,16 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     RtlZeroMemory(pCallBackFlags,sizeof(DWORD)*3);
     RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
     testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
     testing_eq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
-    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");    
+    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
     testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"4. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, NULL, ...);\0");
 
     testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"5. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, NULL, ...);\0");
@@ -279,16 +279,16 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
     RtlZeroMemory(puD3dCallbacks,sizeof(D3DNTHAL_CALLBACKS));
     RtlZeroMemory(puD3dDriverData,sizeof(D3DNTHAL_CALLBACKS));
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
     testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
     testing_eq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
-    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");    
+    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
     testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"4. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, NULL, ...);\0");
 
     testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"5. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dBufferCallbacks, NULL, ...);\0");
@@ -315,7 +315,7 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
         /* FIXME dump puD3dCallbacks */
         /* FIXME dump puD3dDriverData */
         /* FIXME dump D3dBufferCallbacks */
-        
+
     }
 
 /* testing  OsThunkDdQueryDirectDrawObject( hDD, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, D3dBufferCallbacks, puD3dTextureFormats, NULL, */
@@ -342,16 +342,16 @@ test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
         RtlZeroMemory(puD3dTextureFormats, puD3dDriverData->dwNumTextureFormats * sizeof(DDSURFACEDESC2));
     }
 
-    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
-                                                pCallBackFlags, puD3dCallbacks, 
-                                                puD3dDriverData, puD3dBufferCallbacks, 
-                                                puD3dTextureFormats, puNumHeaps, 
+    retValue = OsThunkDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo,
+                                                pCallBackFlags, puD3dCallbacks,
+                                                puD3dDriverData, puD3dBufferCallbacks,
+                                                puD3dTextureFormats, puNumHeaps,
                                                 puvmList, puNumFourCC,
                                                 puFourCC);
 
     testing_noteq(retValue,FALSE,fails,"1. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
     testing_eq(pHalInfo,NULL,fails,"2. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
-    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");    
+    testing_eq(pCallBackFlags,NULL,fails,"3. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
     testing_noteq(puD3dCallbacks->dwSize,sizeof(D3DNTHAL_CALLBACKS),fails,"4. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dDriverData, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
 
     testing_noteq(puD3dDriverData->dwSize,sizeof(D3DNTHAL_GLOBALDRIVERDATA),fails,"5. NtGdiDdQueryDirectDrawObject(hDirectDrawLocal, pHalInfo, pCallBackFlags, puD3dCallbacks, puD3dBufferCallbacks, puD3dTextureFormats, NULL, ...);\0");
index 9b51d15..2f7eae7 100644 (file)
@@ -19,7 +19,7 @@ test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)
     int fails=0;\r
     BOOL retValue=FALSE;\r
     DDHAL_WAITFORVERTICALBLANKDATA pDdWaitForVerticalBlankData;\r
-    \r
+\r
     RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));\r
 \r
     retValue = OsThunkDdWaitForVerticalBlank(NULL,NULL);\r
index b44dafa..1747860 100644 (file)
@@ -86,7 +86,7 @@ void
 dump_halinfo(DD_HALINFO *pHalInfo, char *text)
 {
     printf("dumping the DD_HALINFO from %s\n",text);
-    
+
     if (pHalInfo->dwSize == sizeof(DD_HALINFO_V4))
     {
         DD_HALINFO_V4 *pHalInfo4 = (DD_HALINFO_V4 *) pHalInfo;
@@ -101,7 +101,7 @@ dump_halinfo(DD_HALINFO *pHalInfo, char *text)
         printf(" pHalInfo4->vmiData->lDisplayPitch                  : 0x%08lx\n",(long)pHalInfo4->vmiData.lDisplayPitch);
 
         printf(" pHalInfo4->vmiData->ddpfDisplay.dwSize             : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwSize);
-        printf(" pHalInfo4->vmiData->ddpfDisplay.dwFlags            : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwFlags); 
+        printf(" pHalInfo4->vmiData->ddpfDisplay.dwFlags            : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwFlags);
         printf(" pHalInfo4->vmiData->ddpfDisplay.dwFourCC           : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwFourCC);
         printf(" pHalInfo4->vmiData->ddpfDisplay.dwRGBBitCount      : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwRGBBitCount);
         printf(" pHalInfo4->vmiData->ddpfDisplay.dwRBitMask         : 0x%08lx\n",(long)pHalInfo4->vmiData.ddpfDisplay.dwRBitMask);
@@ -203,7 +203,7 @@ dump_halinfo(DD_HALINFO *pHalInfo, char *text)
         printf(" pHalInfo->vmiData->lDisplayPitch                  : 0x%08lx\n",(long)pHalInfo->vmiData.lDisplayPitch);
 
         printf(" pHalInfo->vmiData->ddpfDisplay.dwSize             : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwSize);
-        printf(" pHalInfo->vmiData->ddpfDisplay.dwFlags            : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwFlags); 
+        printf(" pHalInfo->vmiData->ddpfDisplay.dwFlags            : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwFlags);
         printf(" pHalInfo->vmiData->ddpfDisplay.dwFourCC           : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwFourCC);
         printf(" pHalInfo->vmiData->ddpfDisplay.dwRGBBitCount      : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwRGBBitCount);
         printf(" pHalInfo->vmiData->ddpfDisplay.dwRBitMask         : 0x%08lx\n",(long)pHalInfo->vmiData.ddpfDisplay.dwRBitMask);
index f8fffa1..95f3088 100644 (file)
 
 BOOL dumping_on =FALSE;
 
-/* we using d3d8thk.dll it is doing the real syscall in windows 2000 
+/* we using d3d8thk.dll it is doing the real syscall in windows 2000
  * in ReactOS and Windows XP and higher d3d8thk.dll it linking to
- * gdi32.dll instead doing syscall, gdi32.dll export DdEntry1-56 
- * and doing the syscall direcly. I did forget about it, This 
- * test program are now working on any Windows and ReactOS 
+ * gdi32.dll instead doing syscall, gdi32.dll export DdEntry1-56
+ * and doing the syscall direcly. I did forget about it, This
+ * test program are now working on any Windows and ReactOS
  * that got d3d8thk.dll
  */
 
index c3977c4..c503ae4 100644 (file)
@@ -15,5 +15,5 @@
        <file>NtGdiDdGetScanLine.c</file>
        <file>NtGdiDdWaitForVerticalBlank.c</file>
        <file>NtGdiDdCanCreateSurface.c</file>
-       <file>dump.c</file>     
+       <file>dump.c</file>
 </module>
\ No newline at end of file
index aa1845f..eeca12f 100644 (file)
@@ -265,7 +265,7 @@ FrameworkGetFunction(_PAPI_DESCRIPTION ApiDescription)
   exportedFunctionName = FrameworkGetExportedFunctionNameInternal(ApiDescription);
 
   hModule = _GetModuleHandleA(ApiDescription->FileName);
-  if (hModule != NULL) 
+  if (hModule != NULL)
     {
       function = _GetProcAddress(hModule, exportedFunctionName);
     }
@@ -303,7 +303,7 @@ FrameworkGetHookInternal(ULONG index)
     ExternalDependencies[index].FileName);
 
   address = FrameworkGetFunction(&ExternalDependencies[index]);
+
   if (address == NULL)
     {
       printf("Function '%s' not found in DLL '%s'.\n",
@@ -311,7 +311,7 @@ FrameworkGetHookInternal(ULONG index)
         ExternalDependencies[index].FileName);
     }
   ExternalDependencies[index].FunctionAddress = address;
+
   return address;
 }
 
index f23f948..c96d6c1 100644 (file)
@@ -7,18 +7,18 @@
 
 /* Black Box program for D3DParseUnknownCommand in ddraw.dll
  *
- * This program scaning all return valu that D3DParseUnknownCommand have in ddraw.dll 
- * This command is not 100% document in MSDN so I using ddk kit doc and WinCE document 
- * and ms ddk / ms sdk to figout the basic. and MSDN was unclare what this command support for 
+ * This program scaning all return valu that D3DParseUnknownCommand have in ddraw.dll
+ * This command is not 100% document in MSDN so I using ddk kit doc and WinCE document
+ * and ms ddk / ms sdk to figout the basic. and MSDN was unclare what this command support for
  * D3DHAL_DP2COMMAND dp2command->bCommand so I wrote this small scanner
  *
  * it will show D3DParseUnknownCommand  dp2command->bCommand support follow command
- *  command                 hex      dec 
+ *  command                 hex      dec
  *  D3DDP2OP_VIEWPORTINFO (aka 0x1c) 28
  *  D3DDP2OP_WINFO        (aka 0x1d) 29
  *  Unknown               (aka 0x0d) 13
  *
- *  no doc in msdn about command 13 (dec) I will exaime it later 
+ *  no doc in msdn about command 13 (dec) I will exaime it later
  *
  */
 
@@ -39,11 +39,11 @@ VOID BuildReturnCode(DWORD * ReturnCode)
     INT t;
     D3DHAL_DP2COMMAND dp2command;
     DWORD lplpvReturnedCommand[2];
-    
+
     for (t=0;t<256;t++)
     {
        dp2command.bCommand = t;
-       ReturnCode[t] = D3DParseUnknownCommand ( (LPVOID) &dp2command, (LPVOID *) lplpvReturnedCommand) ;   
+       ReturnCode[t] = D3DParseUnknownCommand ( (LPVOID) &dp2command, (LPVOID *) lplpvReturnedCommand) ;
        printf("D3DParseUnknownCommand return code = %x command %d \n", ReturnCode[t], t);
     }
 }
index 527ac80..af89cd9 100644 (file)
@@ -3,7 +3,7 @@
 
 
 // TODO:
-//  
+//
 // - free memory
 // - Check if we ran out of memory (HeapAlloc == NULL)
   HDC hdc;
@@ -67,7 +67,7 @@ typedef struct _DD_MISCELLANEOUSCALLBACKS {
 } DD_MISCELLANEOUSCALLBACKS;
 
 
-int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, 
+int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
                                        LPSTR lpCmdLine, int nCmdShow)
 {
        /* get the functions we need */
@@ -84,13 +84,13 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     const UINT bmiSize = sizeof(BITMAPINFOHEADER) + 0x10;
     UCHAR *pbmiData;
     BITMAPINFO *pbmi;
-    
+
     DWORD *pMasks;
     //BOOL newmode = FALSE;
        //DWORD Status; /* for create surface */
        UINT i;
        UINT j;
-       
+
 
        printf("This apps showing how to start up directx draw/d3d interface and some other as well\n");
        printf("This code have been releae to some close applactons with my premtions, if any company\n");
@@ -104,17 +104,17 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
        printf("and a overlay sufrace and blt to the primary surface\n");
 
 
-    /* 
-       Get and Create mode info 
+    /*
+       Get and Create mode info
     */
     mcModeInfos = 1;
-    mpModeInfos = (DDHALMODEINFO*)HeapAlloc(GetProcessHeap(), 
-                                                  HEAP_ZERO_MEMORY, 
-                                                  mcModeInfos * sizeof(DDHALMODEINFO));  
-   
+    mpModeInfos = (DDHALMODEINFO*)HeapAlloc(GetProcessHeap(),
+                                                  HEAP_ZERO_MEMORY,
+                                                  mcModeInfos * sizeof(DDHALMODEINFO));
+
     if (mpModeInfos == NULL)
     {
-       printf("Fail to alloc mpModeInfos\n"); 
+       printf("Fail to alloc mpModeInfos\n");
        return DD_FALSE;
     }
 
@@ -128,28 +128,28 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     mpModeInfos[0].wRefreshRate = (WORD)devmode.dmDisplayFrequency;
 
     /*
-       Setup HDC and mDDrawGlobal right 
-    */    
-    hdc = CreateDCW(L"DISPLAY",L"DISPLAY",NULL,NULL);    
+       Setup HDC and mDDrawGlobal right
+    */
+    hdc = CreateDCW(L"DISPLAY",L"DISPLAY",NULL,NULL);
 
     if (hdc == NULL)
     {
-         printf("Fail to create HDC\n"); 
+         printf("Fail to create HDC\n");
       return DD_FALSE;
     }
 
     /*
-      Dectect RGB bit mask 
-    */  
-    hbmp = CreateCompatibleBitmap(hdc, 1, 1);  
+      Dectect RGB bit mask
+    */
+    hbmp = CreateCompatibleBitmap(hdc, 1, 1);
     if (hbmp==NULL)
     {
        HeapFree(GetProcessHeap(), 0, mpModeInfos);
        DeleteDC(hdc);
-          printf("Fail to Create Compatible Bitmap\n"); 
+          printf("Fail to Create Compatible Bitmap\n");
        return DD_FALSE;
     }
-  
+
     pbmiData = (UCHAR *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bmiSize);
     pbmi = (BITMAPINFO*)pbmiData;
 
@@ -159,7 +159,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
        free(mpModeInfos);
        DeleteDC(hdc);
        DeleteObject(hbmp);
-          printf("Fail to Alloc  pbmiData\n"); 
+          printf("Fail to Alloc  pbmiData\n");
        return DDERR_UNSUPPORTED;
     }
 
@@ -180,32 +180,32 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
 
     HeapFree(GetProcessHeap(), 0, pbmiData);
 
-    /* 
-      prepare start up the DX Draw HAL interface now 
+    /*
+      prepare start up the DX Draw HAL interface now
     */
-   
+
     memset(&mDDrawGlobal, 0, sizeof(DDRAWI_DIRECTDRAW_GBL));
     memset(&mHALInfo,     0, sizeof(DDHALINFO));
     memset(&mCallbacks,   0, sizeof(DDHAL_CALLBACKS));
-       
-    /* 
-      Startup DX HAL step one of three 
+
+    /*
+      Startup DX HAL step one of three
     */
     if (!DdCreateDirectDrawObject(&mDDrawGlobal, hdc))
     {
-       HeapFree(GetProcessHeap(), 0, mpModeInfos);       
+       HeapFree(GetProcessHeap(), 0, mpModeInfos);
        DeleteDC(hdc);
        DeleteObject(hbmp);
-          printf("Fail to Create Direct DrawObject\n"); 
+          printf("Fail to Create Direct DrawObject\n");
        return DD_FALSE;
     }
 
        mDDrawGlobal.dwRefCnt = 1; //addref / remove ref
 
-    // Do not relase HDC it have been map in kernel mode 
+    // Do not relase HDC it have been map in kernel mode
     // DeleteDC(hdc);
-  
-    /* we need reanable it if screen res have changes, and some bad drv need be reanble very few 
+
+    /* we need reanable it if screen res have changes, and some bad drv need be reanble very few
           to contiune */
        /*
     if (!DdReenableDirectDrawObject(&mDDrawGlobal, &newmode))
@@ -215,11 +215,11 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
       DeleteObject(hbmp);
       return DD_FALSE;
     }*/
-  
+
     /*
-      Setup the DirectDraw Local 
+      Setup the DirectDraw Local
     */
-  
+
     mDDrawLocal.lpDDCB = &mCallbacks;
     mDDrawLocal.lpGbl = &mDDrawGlobal;
     mDDrawLocal.dwProcessId = GetCurrentProcessId();
@@ -228,16 +228,16 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     mDDrawGlobal.lpExclusiveOwner = &mDDrawLocal;
        //mDDrawLocal.dwLocalFlags = DDRAWILCL_DIRECTDRAW7;
 
-       
+
     /*
-       Startup DX HAL step two of three 
+       Startup DX HAL step two of three
     */
 
     if (!DdQueryDirectDrawObject(&mDDrawGlobal,
                                  &mHALInfo,
                                  &mCallbacks.HALDD,
                                  &mCallbacks.HALDDSurface,
-                                 &mCallbacks.HALDDPalette, 
+                                 &mCallbacks.HALDDPalette,
                                  &mD3dCallbacks,
                                  &mD3dDriverData,
                                  &mD3dBufferCallbacks,
@@ -255,12 +255,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     mcvmList = mHALInfo.vmiData.dwNumHeaps;
     mpvmList = (VIDMEM*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIDMEM) * mcvmList);
     if (mpvmList == NULL)
-    {      
+    {
       HeapFree(GetProcessHeap(), 0, mpModeInfos);
       DeleteDC(hdc);
       DeleteObject(hbmp);
       // FIXME Close DX fristcall and second call
-         printf("Fail to QueryDirect Draw Object frist pass\n"); 
+         printf("Fail to QueryDirect Draw Object frist pass\n");
       return DD_FALSE;
     }
 
@@ -279,14 +279,14 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     mcTextures = mD3dDriverData.dwNumTextureFormats;
     mpTextures = (DDSURFACEDESC*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DDSURFACEDESC) * mcTextures);
     if (mpTextures == NULL)
-    {      
+    {
       HeapFree(GetProcessHeap(), 0, mpFourCC);
       HeapFree(GetProcessHeap(), 0, mpvmList);
       HeapFree(GetProcessHeap(), 0, mpModeInfos);
       DeleteDC(hdc);
       DeleteObject(hbmp);
       // FIXME Close DX fristcall and second call
-         printf("Fail QueryDirect Draw Object to Alloc mpTextures \n"); 
+         printf("Fail QueryDirect Draw Object to Alloc mpTextures \n");
       return DD_FALSE;
     }
 
@@ -299,14 +299,14 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
                                     &mHALInfo,
                                     &mCallbacks.HALDD,
                                     &mCallbacks.HALDDSurface,
-                                    &mCallbacks.HALDDPalette, 
+                                    &mCallbacks.HALDDPalette,
                                     &mD3dCallbacks,
                                     &mD3dDriverData,
                                     &mCallbacks.HALDDExeBuf,
                                     mpTextures,
                                     mpFourCC,
                                     mpvmList))
-  
+
     {
       HeapFree(GetProcessHeap(), 0, mpTextures);
       HeapFree(GetProcessHeap(), 0, mpFourCC);
@@ -314,7 +314,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
       HeapFree(GetProcessHeap(), 0, mpModeInfos);
       DeleteDC(hdc);
       DeleteObject(hbmp);
-         printf("Fail to QueryDirect Draw Object second pass\n"); 
+         printf("Fail to QueryDirect Draw Object second pass\n");
       return DD_FALSE;
     }
 
@@ -322,7 +322,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
       Copy over from HalInfo to DirectDrawGlobal
    */
 
-  // this is wrong, cDriverName need be in ASC code not UNICODE 
+  // this is wrong, cDriverName need be in ASC code not UNICODE
   //memcpy(mDDrawGlobal.cDriverName, mDisplayAdapter, sizeof(wchar)*MAX_DRIVER_NAME);
 
   memcpy(&mDDrawGlobal.vmiData, &mHALInfo.vmiData,sizeof(VIDMEMINFO));
@@ -336,11 +336,11 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   mDDrawGlobal.dwModeIndex        = mHALInfo.dwModeIndex;
   mDDrawGlobal.dwNumModes         = mHALInfo.dwNumModes;
   mDDrawGlobal.lpModeInfo         = mHALInfo.lpModeInfo;
-  mDDrawGlobal.hInstance          = mHALInfo.hInstance;    
-  
+  mDDrawGlobal.hInstance          = mHALInfo.hInstance;
+
   mDDrawGlobal.lp16DD = &mDDrawGlobal;
 
-  
+
 
   /* Hal insate is down now */
 
@@ -358,7 +358,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   /* cleare surface ends now */
 
   /* create primare surface now */
-  
+
    memset(&mddsdPrimary,   0, sizeof(DDSURFACEDESC));
    mddsdPrimary.dwSize      = sizeof(DDSURFACEDESC);
    mddsdPrimary.dwFlags     = DDSD_CAPS;
@@ -369,16 +369,16 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
    mDdCanCreateSurface.CanCreateSurface = mCallbacks.HALDD.CanCreateSurface;
    mDdCanCreateSurface.bIsDifferentPixelFormat = FALSE; //isDifferentPixelFormat;
    mDdCanCreateSurface.lpDDSurfaceDesc = &mddsdPrimary; // pDDSD;
-      
-   if (mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) 
+
+   if (mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED)
    {
-     printf("Fail to mDdCanCreateSurface DDHAL_DRIVER_NOTHANDLED\n"); 
+     printf("Fail to mDdCanCreateSurface DDHAL_DRIVER_NOTHANDLED\n");
      return DDERR_NOTINITIALIZED;
    }
 
    if (mDdCanCreateSurface.ddRVal != DD_OK)
    {
-          printf("Fail to mDdCanCreateSurface mDdCanCreateSurface.ddRVal = %d:%s\n",(int)mDdCanCreateSurface.ddRVal,DDErrorString(mDdCanCreateSurface.ddRVal)); 
+          printf("Fail to mDdCanCreateSurface mDdCanCreateSurface.ddRVal = %d:%s\n",(int)mDdCanCreateSurface.ddRVal,DDErrorString(mDdCanCreateSurface.ddRVal));
        return DDERR_NOTINITIALIZED;
    }
 
@@ -393,7 +393,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   memset(&mPrimaryMore,   0, sizeof(DDRAWI_DDRAWSURFACE_MORE));
   mPrimaryMore.dwSize = sizeof(DDRAWI_DDRAWSURFACE_MORE);
 
-   
+
   //mPrimaryMore. = mpr
 
   memset(&mPrimaryLocal,  0, sizeof(DDRAWI_DDRAWSURFACE_LCL));
@@ -407,7 +407,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
 
   DDHAL_CREATESURFACEDATA      mDdCreateSurface;
   mDdCreateSurface.lpDD = &mDDrawGlobal;
-  mDdCreateSurface.CreateSurface = mCallbacks.HALDD.CreateSurface;  
+  mDdCreateSurface.CreateSurface = mCallbacks.HALDD.CreateSurface;
   mDdCreateSurface.lpDDSurfaceDesc = &mddsdPrimary;//pDDSD;
   mDdCreateSurface.lplpSList = mpPrimaryLocals; //cSurfaces;
   mDdCreateSurface.dwSCnt = 1 ;  //ppSurfaces;
@@ -417,11 +417,11 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
     printf("Fail to mDdCreateSurface  DDHAL_DRIVER_NOTHANDLED \n");
        return DDERR_NOTINITIALIZED;
   }
-  
 
-  if (mDdCreateSurface.ddRVal != DD_OK) 
-  {   
-    printf("Fail to mDdCanCreateSurface mDdCreateSurface.ddRVal = %d:%s\n",(int)mDdCreateSurface.ddRVal,DDErrorString(mDdCreateSurface.ddRVal)); 
+
+  if (mDdCreateSurface.ddRVal != DD_OK)
+  {
+    printf("Fail to mDdCanCreateSurface mDdCreateSurface.ddRVal = %d:%s\n",(int)mDdCreateSurface.ddRVal,DDErrorString(mDdCreateSurface.ddRVal));
     return mDdCreateSurface.ddRVal;
   }
 
@@ -429,7 +429,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   memset(&mPrimaryClipperGlobal, 0, sizeof(DDRAWI_DDRAWCLIPPER_GBL));
   mPrimaryClipperGlobal.dwFlags = DDRAWICLIP_ISINITIALIZED;
   mPrimaryClipperGlobal.dwProcessId = GetCurrentProcessId();
-  //mPrimaryClipperGlobal.hWnd = (ULONG_PTR)hwnd; 
+  //mPrimaryClipperGlobal.hWnd = (ULONG_PTR)hwnd;
   mPrimaryClipperGlobal.hWnd = (ULONG_PTR)GetDesktopWindow();
   mPrimaryClipperGlobal.lpDD = &mDDrawGlobal;
   mPrimaryClipperGlobal.lpStaticClipList = NULL;
@@ -447,12 +447,12 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   //mPrimaryMore.lpDDIClipper = &mPrimaryClipperInterface;
 
   mDdBlt.lpDDDestSurface = mpPrimaryLocals[0];
-  
-  
+
+
   /* create primare surface is down now */
 
   /* create overlay surface now */
-  
+
   memset(&mddsdOverlay, 0, sizeof(DDSURFACEDESC));
   mddsdOverlay.dwSize = sizeof(DDSURFACEDESC);
   mddsdOverlay.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT | DDSD_WIDTH | DDSD_HEIGHT;
@@ -464,32 +464,32 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   mddsdOverlay.dwBackBufferCount = 1; //cBuffers;
 
   mddsdOverlay.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
-  mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB; 
+  mddsdOverlay.ddpfPixelFormat.dwFlags = DDPF_RGB;
   mddsdOverlay.ddpfPixelFormat.dwRGBBitCount = 32;
-  
+
 
    //DDHAL_CANCREATESURFACEDATA   mDdCanCreateSurface;
    mDdCanCreateSurface.lpDD = &mDDrawGlobal;
    mDdCanCreateSurface.CanCreateSurface = mCallbacks.HALDD.CanCreateSurface;
    mDdCanCreateSurface.bIsDifferentPixelFormat = TRUE; //isDifferentPixelFormat;
    mDdCanCreateSurface.lpDDSurfaceDesc = &mddsdOverlay; // pDDSD;
-   
-   
-   if (mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED) 
+
+
+   if (mHALInfo.lpDDCallbacks->CanCreateSurface(&mDdCanCreateSurface)== DDHAL_DRIVER_NOTHANDLED)
    {
     // derr(L"DirectDrawImpl[%08x]::__createPrimary Cannot create primary [%08x]", this, rv);
-          
-        printf("Fail to mDdCanCreateSurface DDHAL_DRIVER_NOTHANDLED \n"); 
+
+        printf("Fail to mDdCanCreateSurface DDHAL_DRIVER_NOTHANDLED \n");
     return DDERR_NOTINITIALIZED;
    }
 
    if (mDdCanCreateSurface.ddRVal != DD_OK)
    {
-        printf("Fail to mDdCanCreateSurface mDdCanCreateSurface.ddRVal = %d:%s\n",(int)mDdCanCreateSurface.ddRVal,DDErrorString(mDdCanCreateSurface.ddRVal)); 
+        printf("Fail to mDdCanCreateSurface mDdCanCreateSurface.ddRVal = %d:%s\n",(int)mDdCanCreateSurface.ddRVal,DDErrorString(mDdCanCreateSurface.ddRVal));
      return DDERR_NOTINITIALIZED;
    }
 
+
   memset(&mOverlayGlobal, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL));
   mOverlayGlobal.dwGlobalFlags = 0;
   mOverlayGlobal.lpDD       = &mDDrawGlobal;
@@ -514,7 +514,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
       (DDRAWISURF_IMPLICITROOT|DDRAWISURF_FRONTBUFFER):
       (DDRAWISURF_IMPLICITCREATE|DDRAWISURF_BACKBUFFER);
 
-    mOverlayLocal[i].dwFlags |= 
+    mOverlayLocal[i].dwFlags |=
       DDRAWISURF_ATTACHED|DDRAWISURF_ATTACHED_FROM|
       DDRAWISURF_HASPIXELFORMAT|
       DDRAWISURF_HASOVERLAYDATA;
@@ -527,26 +527,26 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   {
     j = (i + 1) % cSurfaces;
 
-       
-    /*if (!mHALInfo.lpDDSurfaceCallbacks->AddAttachedSurface(mpOverlayLocals[i], mpOverlayLocals[j])) 
+
+    /*if (!mHALInfo.lpDDSurfaceCallbacks->AddAttachedSurface(mpOverlayLocals[i], mpOverlayLocals[j]))
        {
      // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j);
       return DD_FALSE;
     }*/
 
-       if (!DdAttachSurface(mpOverlayLocals[i], mpOverlayLocals[j])) 
+       if (!DdAttachSurface(mpOverlayLocals[i], mpOverlayLocals[j]))
        {
      // derr(L"DirectDrawImpl[%08x]::__setupDevice DdAttachSurface(%d, %d) failed", this, i, j);
                printf("Fail to DdAttachSurface (%d:%d)\n", i, j);
       return DD_FALSE;
     }
-       
+
   }
 
 
   // DDHAL_CREATESURFACEDATA      mDdCreateSurface;
   mDdCreateSurface.lpDD = &mDDrawGlobal;
-  mDdCreateSurface.CreateSurface = mCallbacks.HALDD.CreateSurface;  
+  mDdCreateSurface.CreateSurface = mCallbacks.HALDD.CreateSurface;
   mDdCreateSurface.lpDDSurfaceDesc = &mddsdOverlay;//pDDSD;
   mDdCreateSurface.lplpSList = mpOverlayLocals; //cSurfaces;
   mDdCreateSurface.dwSCnt = 1 ;  //ppSurfaces;
@@ -556,11 +556,11 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
        printf("Fail to mDdCreateSurface = DDHAL_DRIVER_HANDLED\n");
        return DDERR_NOTINITIALIZED;
   }
-  
 
-  if (mDdCreateSurface.ddRVal != DD_OK) 
-  {   
-        printf("Fail to mDdCreateSurface mDdCreateSurface.ddRVal = %d:%s\n",(int)mDdCreateSurface.ddRVal,DDErrorString(mDdCreateSurface.ddRVal)); 
+
+  if (mDdCreateSurface.ddRVal != DD_OK)
+  {
+        printf("Fail to mDdCreateSurface mDdCreateSurface.ddRVal = %d:%s\n",(int)mDdCreateSurface.ddRVal,DDErrorString(mDdCreateSurface.ddRVal));
      return mDdCreateSurface.ddRVal;
   }
 
@@ -577,7 +577,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   copyRect(&mDdUpdateOverlay.rDest, pdst);
   copyRect(&mDdUpdateOverlay.rSrc, psrc);
 */
-  
+
   mDdUpdateOverlay.rDest.top = 0;
   mDdUpdateOverlay.rDest.left = 0;
   mDdUpdateOverlay.rDest.right = 50;
@@ -588,63 +588,63 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
   mDdUpdateOverlay.rSrc.right = 50;
   mDdUpdateOverlay.rSrc.bottom = 50;
 
+
+
 
   if ( mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED)
   {
         printf("Fail to mDdBlt = DDHAL_DRIVER_HANDLED\n");
         return DDERR_NOTINITIALIZED;
   }
-  
 
-  if (mDdUpdateOverlay.ddRVal != DD_OK) 
-  {   
-         printf("Fail to mDdUpdateOverlay mDdUpdateOverlay.ddRVal = %d:%s\n",(int)mDdUpdateOverlay.ddRVal,DDErrorString(mDdUpdateOverlay.ddRVal)); 
+
+  if (mDdUpdateOverlay.ddRVal != DD_OK)
+  {
+         printf("Fail to mDdUpdateOverlay mDdUpdateOverlay.ddRVal = %d:%s\n",(int)mDdUpdateOverlay.ddRVal,DDErrorString(mDdUpdateOverlay.ddRVal));
       return mDdUpdateOverlay.ddRVal;
   }
+
   /* blt */
-    
+
 
   DDRAWI_DDRAWSURFACE_LCL *pDDSurface = mpPrimaryLocals[0];
 
-  if (!DdResetVisrgn(pDDSurface, NULL)) 
+  if (!DdResetVisrgn(pDDSurface, NULL))
   {
    // derr(L"DirectDrawImpl[%08x]::_clear DdResetVisrgn failed", this);
   }
 
-   
+
   memset(&mDdBlt, 0, sizeof(DDHAL_BLTDATA));
   memset(&mDdBlt.bltFX, 0, sizeof(DDBLTFX));
   mDdBlt.bltFX.dwSize = sizeof(DDBLTFX);
 
   mDdBlt.lpDD = &mDDrawGlobal;
-  mDdBlt.Blt = mCallbacks.HALDDSurface.Blt; 
+  mDdBlt.Blt = mCallbacks.HALDDSurface.Blt;
   mDdBlt.lpDDDestSurface = mpPrimaryLocals[0];
-       
+
   mpPrimaryLocals[0]->hDC = (ULONG_PTR)GetDC(GetDesktopWindow());
   mDdBlt.rDest.top = 50;
   mDdBlt.rDest.bottom = 100;
   mDdBlt.rDest.left = 0;
   mDdBlt.rDest.right = 100;
   mDdBlt.lpDDSrcSurface = NULL;
-  mDdBlt.IsClipped = FALSE;    
+  mDdBlt.IsClipped = FALSE;
   mDdBlt.bltFX.dwFillColor = 0xFFFF00;
   mDdBlt.dwFlags = DDBLT_COLORFILL | DDBLT_WAIT;
  // mDdBlt.IsClipped = TRUE;
-    
+
     if (mDdBlt.Blt(&mDdBlt) != DDHAL_DRIVER_HANDLED)
        {
       printf("Fail to mDdBlt = DDHAL_DRIVER_HANDLED\n");
          return DDHAL_DRIVER_HANDLED;
     }
 
-       
 
-    if (mDdBlt.ddRVal!=DD_OK) 
-       {      
-               printf("Fail to mDdBlt mDdBlt.ddRVal = %d:%s\n",(int)mDdBlt.ddRVal,DDErrorString(mDdBlt.ddRVal)); 
+
+    if (mDdBlt.ddRVal!=DD_OK)
+       {
+               printf("Fail to mDdBlt mDdBlt.ddRVal = %d:%s\n",(int)mDdBlt.ddRVal,DDErrorString(mDdBlt.ddRVal));
                return mDdBlt.ddRVal;
     }
 
index db46e69..f431388 100644 (file)
@@ -28,71 +28,71 @@ extern   DDRAWI_DIRECTDRAW_GBL mDDrawGlobal;
 
 
 
-BOOL (APIENTRY *DdCreateDirectDrawObject) ( 
+BOOL (APIENTRY *DdCreateDirectDrawObject) (
     LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
     HDC hdc
 );
 
-BOOL (APIENTRY *DdQueryDirectDrawObject) ( 
+BOOL (APIENTRY *DdQueryDirectDrawObject) (
     LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
     LPDDHALINFO pHalInfo,
     LPDDHAL_DDCALLBACKS pDDCallbacks,
     LPDDHAL_DDSURFACECALLBACKS pDDSurfaceCallbacks,
     LPDDHAL_DDPALETTECALLBACKS pDDPaletteCallbacks,
-    LPD3DHAL_CALLBACKS pD3dCallbacks, 
-    LPD3DHAL_GLOBALDRIVERDATA pD3dDriverData, 
+    LPD3DHAL_CALLBACKS pD3dCallbacks,
+    LPD3DHAL_GLOBALDRIVERDATA pD3dDriverData,
     LPDDHAL_DDEXEBUFCALLBACKS pD3dBufferCallbacks,
     LPDDSURFACEDESC pD3dTextureFormats,
     LPDWORD pdwFourCC,
     LPVIDMEM pvmList
 );
 
-BOOL 
-APIENTRY 
-DdDeleteDirectDrawObject( 
+BOOL
+APIENTRY
+DdDeleteDirectDrawObject(
     LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal
 );
 
-BOOL 
-APIENTRY 
-DdCreateSurfaceObject( 
+BOOL
+APIENTRY
+DdCreateSurfaceObject(
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
     BOOL bPrimarySurface
 );
 
-BOOL 
-APIENTRY 
-DdDeleteSurfaceObject( 
+BOOL
+APIENTRY
+DdDeleteSurfaceObject(
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal
 );
 
-//BOOL 
-//APIENTRY 
-//DdResetVisrgn( 
+//BOOL
+//APIENTRY
+//DdResetVisrgn(
 //    LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
 //    HWND hWnd
 //);
-BOOL (APIENTRY *DdResetVisrgn) ( 
+BOOL (APIENTRY *DdResetVisrgn) (
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
     HWND hWnd
 );
 
-HDC 
-APIENTRY 
-DdGetDC( 
+HDC
+APIENTRY
+DdGetDC(
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
     LPPALETTEENTRY pColorTable
 );
 
-BOOL 
-APIENTRY 
-DdReleaseDC( 
+BOOL
+APIENTRY
+DdReleaseDC(
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal
 );
 
-HBITMAP 
-APIENTRY 
-DdCreateDIBSection( 
+HBITMAP
+APIENTRY
+DdCreateDIBSection(
     HDC hdc,
     CONST BITMAPINFO *pbmi,
     UINT iUsage,
@@ -101,62 +101,62 @@ DdCreateDIBSection(
     DWORD dwOffset
 );
 
-BOOL 
-APIENTRY 
-DdReenableDirectDrawObject( 
+BOOL
+APIENTRY
+DdReenableDirectDrawObject(
     LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
     BOOL *pbNewMode
 );
 
-//BOOL 
-//APIENTRY 
-//DdAttachSurface( 
+//BOOL
+//APIENTRY
+//DdAttachSurface(
 //    LPDDRAWI_DDRAWSURFACE_LCL pSurfaceFrom,
 //    LPDDRAWI_DDRAWSURFACE_LCL pSurfaceTo
 //);
 
-BOOL (APIENTRY *DdAttachSurface) ( 
+BOOL (APIENTRY *DdAttachSurface) (
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceFrom,
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceTo
 );
 
-VOID 
-APIENTRY 
-DdUnattachSurface( 
+VOID
+APIENTRY
+DdUnattachSurface(
     LPDDRAWI_DDRAWSURFACE_LCL pSurface,
     LPDDRAWI_DDRAWSURFACE_LCL pSurfaceAttached
 );
 
-ULONG 
-APIENTRY 
+ULONG
+APIENTRY
 DdQueryDisplaySettingsUniqueness(VOID);
 
-HANDLE 
-APIENTRY 
-DdGetDxHandle( 
+HANDLE
+APIENTRY
+DdGetDxHandle(
     LPDDRAWI_DIRECTDRAW_LCL pDDraw,
     LPDDRAWI_DDRAWSURFACE_LCL pSurface,
     BOOL bRelease
 );
 
-BOOL 
-APIENTRY 
-DdSetGammaRamp( 
+BOOL
+APIENTRY
+DdSetGammaRamp(
     LPDDRAWI_DIRECTDRAW_LCL pDDraw,
     HDC hdc,
     LPVOID lpGammaRamp
 );
 
-DWORD 
-APIENTRY 
-DdSwapTextureHandles( 
+DWORD
+APIENTRY
+DdSwapTextureHandles(
     LPDDRAWI_DIRECTDRAW_LCL pDDraw,
     LPDDRAWI_DDRAWSURFACE_LCL pDDSLcl1,
     LPDDRAWI_DDRAWSURFACE_LCL pDDSLcl2
 );
 
 char* DDErrorString (HRESULT hr)
-{ 
+{
        switch (hr)
        {
                case DD_OK:                                                              return "DD_OK";
@@ -261,7 +261,7 @@ char* DDErrorString (HRESULT hr)
                case DDERR_NOTPAGELOCKED:                return "DDERR_NOTPAGELOCKED";
                case DDERR_NOTINITIALIZED:               return "DDERR_NOTINITIALIZED";
        }
-       
+
        return "Unknown Error ";
 }
 
index 510d0b1..acb83c8 100644 (file)
@@ -5,7 +5,7 @@
  * PROJECT:         ReactOS diskspeed.exe
  * FILE:            apps/tests/diskspeed/diskspeed.c
  * PURPOSE:         Determines disk transfer rates
- * PROGRAMMER:      
+ * PROGRAMMER:
  */
 
 #include <stdio.h>
index ae55f09..e7d9b4b 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -29,18 +29,18 @@ const int ID_LISTBOX = 101;
 
 HINSTANCE hInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, 
+LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
    LPARAM lParam);
 
 
-int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, 
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
    int nCmdShow)
 {
    hInst = hInstance;
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpszClassName = WndClassName;
    wc.lpfnWndProc = MainWndProc;
@@ -52,17 +52,17 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
 
    if (RegisterClass(&wc))
    {
-      HWND hWnd = 
+      HWND hWnd =
          CreateWindow(
             WndClassName, TEXT("Font Enumeration Demo"),
-            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | 
+            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
             WS_VISIBLE | WS_CLIPCHILDREN,
             CW_USEDEFAULT, CW_USEDEFAULT, 295, 285,
             NULL, NULL, hInst, NULL
             );
 
       if (hWnd)
-      {                                 
+      {
          ShowWindow(hWnd, nCmdShow);
          UpdateWindow(hWnd);
 
@@ -71,10 +71,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
-    return 0;                                                               
+    return 0;
 }
 //-------------------------------------------------------------------------
 
@@ -87,78 +87,78 @@ int CALLBACK MyEnumFontFamExProc(ENUMLOGFONTEX *lpelfe,
       // if the typeface name is not already in the list
       LPARAM name = reinterpret_cast<LPARAM>(lpelfe->elfFullName);
       if (SNDMSG(hListBox, LB_FINDSTRINGEXACT, (ULONG)-1, name) == LB_ERR)
-      {                 
-         // add each font to the list box    
+      {
+         // add each font to the list box
          int index = SNDMSG(hListBox, LB_ADDSTRING, 0, name);
-   
+
          // fix the size of the font
          lpelfe->elfLogFont.lfHeight = -20;
          lpelfe->elfLogFont.lfWidth = 0;
-   
+
          // create a new font and store its handle
          // as the data of the newly added item
          HFONT hFont = CreateFontIndirect(&lpelfe->elfLogFont);
-         SNDMSG(hListBox, LB_SETITEMDATA, index, 
+         SNDMSG(hListBox, LB_SETITEMDATA, index,
                 reinterpret_cast<LPARAM>(hFont));
       }
    }
-   return TRUE;   
+   return TRUE;
 }
 //-------------------------------------------------------------------------
 
 
 void AddScreenFonts()
 {
-   // grab a handle to the screen's DC    
-   HDC hScreenDC = GetDC(NULL);    
-   try    
-   {  
-      // 
+   // grab a handle to the screen's DC
+   HDC hScreenDC = GetDC(NULL);
+   try
+   {
+      //
       // NOTE: Windows 95, 98 and Me requires that the lpLogfont
-      // (second) parameter of the EnumFontFamiliesEx function is 
+      // (second) parameter of the EnumFontFamiliesEx function is
       // non-NULL.  This parameter can be NULL on Windows NT/2000.
-      //      
+      //
       LOGFONT lf = {0};
       lf.lfCharSet = DEFAULT_CHARSET;
 
-      // enumerate the current screen fonts        
+      // enumerate the current screen fonts
       EnumFontFamiliesEx(
-         hScreenDC, &lf, 
+         hScreenDC, &lf,
          (FONTENUMPROC)MyEnumFontFamExProc,
          0, 0
-         );                         
-   }    
-   catch (...)    
-   {        
-      // release the screen's DC        
-      ReleaseDC(NULL, hScreenDC);    
-   }    
-   // release the screen's DC        
+         );
+   }
+   catch (...)
+   {
+      // release the screen's DC
+      ReleaseDC(NULL, hScreenDC);
+   }
+   // release the screen's DC
    ReleaseDC(NULL, hScreenDC);
 }
 //-------------------------------------------------------------------------
 
 
-LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, 
+LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
    LPARAM lParam)
 {
    switch (msg)
    {
       case WM_CREATE:
-      {  
-         hListBox = 
+      {
+         hListBox =
             CreateWindowEx(
                WS_EX_CLIENTEDGE, TEXT("LISTBOX"), TEXT(""),
-               WS_CHILD | WS_VISIBLE | LBS_STANDARD | 
-               LBS_HASSTRINGS | LBS_OWNERDRAWFIXED, 
-               20, 10, 250, 250, 
+               WS_CHILD | WS_VISIBLE | LBS_STANDARD |
+               LBS_HASSTRINGS | LBS_OWNERDRAWFIXED,
+               20, 10, 250, 250,
                hWnd, reinterpret_cast<HMENU>(ID_LISTBOX),
                hInst, NULL
-               );    
+               );
          if (hListBox)
          {
             AddScreenFonts();
-         }         
+         }
       }
       case WM_MEASUREITEM:
       {
@@ -193,14 +193,14 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
             // if the item is currently selected
             if (lpdis->itemState & ODS_SELECTED)
             {
-               // set the text color to white and 
+               // set the text color to white and
                // the background color to black
                COLORREF clrWhite = PALETTERGB(255, 255, 255);
                OldColor = SetTextColor(lpdis->hDC, clrWhite);
                stock = BLACK_BRUSH;
             }
             FillRect(
-               lpdis->hDC, &lpdis->rcItem, 
+               lpdis->hDC, &lpdis->rcItem,
                static_cast<HBRUSH>(GetStockObject(stock))
                );
 
@@ -209,7 +209,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
                // extract the item's text
                char text[MAX_PATH];
                SNDMSG(hListBox, LB_GETTEXT, lpdis->itemID,
-                      reinterpret_cast<LPARAM>(text)); 
+                      reinterpret_cast<LPARAM>(text));
 
                // extract the corresponding font handle
                DWORD value =
@@ -228,11 +228,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
                // render the text
                RECT RText = lpdis->rcItem;
                InflateRect(&RText, -2, -2);
-               DrawText(lpdis->hDC, text, strlen(text), &RText, 
+               DrawText(lpdis->hDC, text, strlen(text), &RText,
                         DT_LEFT | DT_VCENTER | DT_SINGLELINE);
 
                // restore the previous font
-               SelectObject(lpdis->hDC, HOldFont);            
+               SelectObject(lpdis->hDC, HOldFont);
             }
 
             // render the focus rectangle
@@ -251,13 +251,13 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
       }
       case WM_DESTROY:
       {
-         // delete each created font object    
+         // delete each created font object
          int count = SNDMSG(hListBox, LB_GETCOUNT, 0, 0);
          for (int index = 0; index < count; ++index)
          {
             DWORD value = SNDMSG(hListBox, LB_GETITEMDATA, index, 0);
             DeleteObject(reinterpret_cast<HFONT>(value));
-         }         
+         }
 
          PostQuitMessage(0);
          break;
index e442060..8d67a7c 100644 (file)
@@ -30,7 +30,7 @@ PVOID GlobalBufferPool, GlobalPacketPool;
 
 char hwaddr[6] = { 0x08, 0x00, 0x20, 0x0b, 0xb7, 0xbb };
 
-char hdr[14] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+char hdr[14] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                 0x08, 0x00 };
 
@@ -70,7 +70,7 @@ void receive_complete( void *context, NTSTATUS status, unsigned long count ) {
 class SocketObject {
 public:
     virtual ~SocketObject() { }
-    virtual int send( char *buf, int len, int *bytes, 
+    virtual int send( char *buf, int len, int *bytes,
                      struct sockaddr_in *si ) = 0;
     virtual int recv( char *buf, int len, int *bytes,
                      struct sockaddr_in *si ) = 0;
@@ -88,7 +88,7 @@ UINT TdiAddressSizeFromType( UINT AddressType ) {
 
 NTSTATUS TdiBuildNullConnectionInfoInPlace
 ( PTDI_CONNECTION_INFORMATION ConnInfo,
-  ULONG Type ) 
+  ULONG Type )
 /*
  * FUNCTION: Builds a NULL TDI connection information structure
  * ARGUMENTS:
@@ -99,7 +99,7 @@ NTSTATUS TdiBuildNullConnectionInfoInPlace
  */
 {
   ULONG TdiAddressSize;
-  
+
   TdiAddressSize = TdiAddressSizeFromType(Type);
 
   RtlZeroMemory(ConnInfo,
@@ -119,7 +119,7 @@ NTSTATUS TdiBuildNullConnectionInfo
 /*
  * FUNCTION: Builds a NULL TDI connection information structure
  * ARGUMENTS:
- *     ConnectionInfo = Address of buffer pointer to allocate connection 
+ *     ConnectionInfo = Address of buffer pointer to allocate connection
  *                      information in
  *     Type           = TDI style address type (TDI_ADDRESS_TYPE_XXX).
  * RETURNS:
@@ -129,7 +129,7 @@ NTSTATUS TdiBuildNullConnectionInfo
   PTDI_CONNECTION_INFORMATION ConnInfo;
   ULONG TdiAddressSize;
   NTSTATUS Status;
-  
+
   TdiAddressSize = TdiAddressSizeFromType(Type);
 
   ConnInfo = (PTDI_CONNECTION_INFORMATION)
@@ -141,7 +141,7 @@ NTSTATUS TdiBuildNullConnectionInfo
 
   Status = TdiBuildNullConnectionInfoInPlace( ConnInfo, Type );
 
-  if (!NT_SUCCESS(Status)) 
+  if (!NT_SUCCESS(Status))
       ExFreePool( ConnInfo );
   else
       *ConnectionInfo = ConnInfo;
@@ -164,11 +164,11 @@ TdiBuildConnectionInfoInPlace
 ( PTDI_CONNECTION_INFORMATION ConnectionInfo,
   PTA_ADDRESS Address ) {
     NTSTATUS Status = STATUS_SUCCESS;
-    
+
     RtlCopyMemory( ConnectionInfo->RemoteAddress,
-                  Address, 
+                  Address,
                   ConnectionInfo->RemoteAddressLength );
-    
+
     return Status;
 }
 
@@ -178,10 +178,10 @@ TdiBuildConnectionInfo
   PTA_ADDRESS Address ) {
   NTSTATUS Status = TdiBuildNullConnectionInfo( ConnectionInfo,
                                                Address->AddressType );
-  
+
   if( NT_SUCCESS(Status) )
       TdiBuildConnectionInfoInPlace( *ConnectionInfo, Address );
-  
+
   return Status;
 }
 
@@ -200,10 +200,10 @@ public:
        TdiBuildConnectionInfo( &ConnInfo, (PTA_ADDRESS)&ConnectTo );
 
        Connection = TCPAllocateConnectionEndpoint( NULL );
-       *status = TCPSocket( Connection, 
+       *status = TCPSocket( Connection,
                             AF_INET,
                             SOCK_STREAM, IPPROTO_TCP );
-       if( !*status ) 
+       if( !*status )
            *status = TCPConnect( Connection,
                                  ConnInfo,
                                  NULL,
@@ -220,7 +220,7 @@ public:
        NTSTATUS Status = STATUS_UNSUCCESSFUL;
 
        if( Connection )
-           Status = TCPSendData( Connection, 
+           Status = TCPSendData( Connection,
                                  buf,
                                  len,
                                  (PULONG)bytes,
@@ -232,7 +232,7 @@ public:
        NTSTATUS Status = STATUS_UNSUCCESSFUL;
 
        if( Connection )
-           Status = TCPSendData( Connection, 
+           Status = TCPSendData( Connection,
                                  buf,
                                  len,
                                  (PULONG)bytes,
@@ -244,9 +244,9 @@ private:
     PCONNECTION_ENDPOINT Connection;
 };
 
-VOID SendPacket( PVOID Context, 
-                PNDIS_PACKET NdisPacket, 
-                UINT Offset, 
+VOID SendPacket( PVOID Context,
+                PNDIS_PACKET NdisPacket,
+                UINT Offset,
                 PVOID LinkAddress,
                 USHORT Type ) {
     PCHAR DataOut;
@@ -254,9 +254,9 @@ VOID SendPacket( PVOID Context,
     UINT Size;
     std::string output_packet;
 
-    printf( "Sending packet: %02x:%02x:%02x:%02x:%02x:%02x\n", 
+    printf( "Sending packet: %02x:%02x:%02x:%02x:%02x:%02x\n",
            Addr[0], Addr[1], Addr[2], Addr[3], Addr[4], Addr[5] );
-    
+
     GetDataPtr( NdisPacket, Offset, &DataOut, &Size );
     for( int off = 0; off < Size; off += 16 ) {
        display_row( DataOut, off, Size );
@@ -298,7 +298,7 @@ int main( int argc, char **argv ) {
     SocketObject *S = NULL;
 
     RtlInitUnicodeString
-       ( &RegistryUnicodePath, 
+       ( &RegistryUnicodePath,
          L"\\SYSTEM\\CurrentControlSet\\Services"
          L"\\Tcpip" );
 
@@ -316,7 +316,7 @@ int main( int argc, char **argv ) {
     BindInfo.Address = (PUCHAR)hwaddr;
     BindInfo.AddressLength = sizeof(hwaddr);
     BindInfo.Transmit = SendPacket;
-    
+
     IPCreateInterface( &BindInfo );
 
     asock = socket( AF_INET, SOCK_DGRAM, 0 );
@@ -327,32 +327,32 @@ int main( int argc, char **argv ) {
        printf( "Bind error\n" );
        return 0;
     }
-    
+
     while( true ) {
        FD_ZERO( &readf );
        FD_SET( asock, &readf );
-       tv.tv_sec = 0; 
+       tv.tv_sec = 0;
        tv.tv_usec = 10000;
        selret = select( asock + 1, &readf, NULL, NULL, &tv );
-       
+
        if( FD_ISSET( asock, &readf ) ) {
            fromsize = sizeof( addr_from );
            dgrecv = recvfrom( asock, datagram, sizeof(datagram), 0,
                               (struct sockaddr *)&addr_from, &fromsize );
-           
+
            if( datagram[0] == 'C' && datagram[1] == 'M' &&
                datagram[2] == 'D' && datagram[3] == ' ' ) {
                int theport, bytes, recvret, off, bytin;
                struct sockaddr_in nam;
                std::string faddr, word;
-               std::istringstream 
+               std::istringstream
                    cmdin( std::string( datagram + 4, dgrecv - 4 ) );
-               
+
                cmdin >> word;
-               
+
 /* UDP Section */
                if( word == "udpsocket" ) {
-/* TCP Section */              
+/* TCP Section */
                } else if( word == "tcpsocket" ) {
                    cmdin >> host >> port;
                    S = new TCPSocketObject( host, port, &Status );
@@ -385,23 +385,23 @@ int main( int argc, char **argv ) {
                        *dst++ = c;
                    }
                    *dst = '\0';
-                   if( S ) 
+                   if( S )
                        err = S->send( p, strlen(p), &bytes, NULL );
                    if( err > 0 ) { bytin = err; err = 0; }
-                   
-                   if( err ) 
-                       fprintf ( stderr, "OskitTCPConnect: error %d\n", 
+
+                   if( err )
+                       fprintf ( stderr, "OskitTCPConnect: error %d\n",
                                  err );
                    else {
                        printf ( "wrote %d bytes\n", bytin );
-                   }               
+                   }
                } else if( word == "send" ) {
                    off = 0;
                    while( cmdin >> word ) {
-                       datagram[off++] = 
+                       datagram[off++] =
                            atoi( (std::string("0x") + word).c_str() );
                    }
-                   
+
                    if( (err = S->send( datagram, off, &bytin, NULL )) != 0 ) {
                        fprintf( stderr, "OskitTCPConnect: error %d\n", err );
                    } else {
@@ -409,21 +409,21 @@ int main( int argc, char **argv ) {
                    }
                } else if( word == "recv" ) {
                    cmdin >> bytes;
-                   
-                   if( (err = S->recv( datagram, 
+
+                   if( (err = S->recv( datagram,
                                        sizeof(datagram),
-                                       &bytes, 
+                                       &bytes,
                                        NULL )) != 0 ) {
                        fprintf( stderr, "OskitTCPRecv: error %d\n", err );
                    }
-                   
+
 /* Misc section */
                } else if( word == "end" ) {
                    return 0;
                }
            } else if( dgrecv > 14 ) {
                addr_to = addr_from;
-               
+
                if( datagram[12] == 8 && datagram[13] == 6 ) {
                    /* Answer arp query */
                    char laddr[4];
@@ -439,11 +439,11 @@ int main( int argc, char **argv ) {
                    memcpy( datagram + 38, laddr, 4 );
                    /* Set reply opcode */
                    datagram[21] = 2;
-                   
+
                    err = sendto( asock, datagram, dgrecv, 0,
-                                 (struct sockaddr *)&addr_to, 
+                                 (struct sockaddr *)&addr_to,
                                  sizeof(addr_to) );
-                   
+
                    if( err != 0 )
                        printf( "sendto: %d\n", err );
                } else {
@@ -457,20 +457,20 @@ int main( int argc, char **argv ) {
                }
            }
        }
-       
+
        IPTimeout(NULL, NULL, NULL, NULL);
-       
+
        for( i = output_packets.begin(); i != output_packets.end(); i++ ) {
-           err = sendto( asock, i->c_str(), i->size(), 0, 
+           err = sendto( asock, i->c_str(), i->size(), 0,
                          (struct sockaddr *)&addr_to, sizeof(addr_to) );
-           
+
            fprintf( stderr, "** SENDING PACKET %d bytes **\n", i->size() );
-           
+
            if( err != 0 )
                printf( "sendto: %d\n", err );
        }
-       
+
        output_packets.clear();
     }
 }
-    
+
index 5a02cc3..6b678a2 100644 (file)
@@ -93,10 +93,10 @@ int main( int argc, char **argv ) {
                           NULL,
                           0,
                           0 );
-    
+
     RtlInitUnicodeString( &LanDevice, L"\\Device\\Lan" );
 
-    InitializeObjectAttributes( &Attributes, 
+    InitializeObjectAttributes( &Attributes,
                                &LanDevice,
                                OBJ_CASE_INSENSITIVE,
                                NULL,
@@ -106,9 +106,9 @@ int main( int argc, char **argv ) {
     LAN_FILL_EA_INFO(EaBuffer,sizeof(TypesToListen)/sizeof(USHORT),
                     TypesToListen);
 
-    Status = ZwCreateFile( &LanFile, 
-                          SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE | 
-                          GENERIC_EXECUTE, 
+    Status = ZwCreateFile( &LanFile,
+                          SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE |
+                          GENERIC_EXECUTE,
                           &Attributes,
                           &Iosb,
                           NULL,
@@ -123,7 +123,7 @@ int main( int argc, char **argv ) {
        cerr << "Could not open lan device " << Status << "\n";
        return 1;
     }
-    
+
     Status = DeviceIoControl( LanFile,
                              IOCTL_IF_BUFFERED_MODE,
                              &On,
@@ -132,7 +132,7 @@ int main( int argc, char **argv ) {
                              0,
                              &PktLen,
                              NULL );
-    
+
     if( !Status ) {
        cerr << "Could not turn on buffered mode " << Status << "\n";
        return 1;
@@ -153,7 +153,7 @@ int main( int argc, char **argv ) {
                                      NULL );
 
            cout << "EnumAdapters: " << Status << "\n";
-           if( Status ) 
+           if( Status )
                display_buffer( Packet, PktLen );
        } else if( word == "query" ) {
            cin >> PktLen;
@@ -166,18 +166,18 @@ int main( int argc, char **argv ) {
                                      sizeof(Packet),
                                      &PktLen,
                                      NULL );
-           
+
            cout << "QueryAdapterInfo: " << Status << "\n";
            if( Status )
                display_buffer( Packet, PktLen );
        } else if( word == "send" ) {
-           cin >> Hdr->Fixed.Adapter 
-               >> Hdr->Fixed.AddressType 
-               >> Hdr->Fixed.AddressLen 
+           cin >> Hdr->Fixed.Adapter
+               >> Hdr->Fixed.AddressType
+               >> Hdr->Fixed.AddressLen
                >> Hdr->Fixed.PacketType;
            Hdr->Fixed.Mdl = NULL;
            PktLen = byte_till_end( Packet, Hdr->Address - (PCHAR)Hdr );
-           Status = NtWriteFile( LanFile, 
+           Status = NtWriteFile( LanFile,
                                  NULL,
                                  NULL,
                                  NULL,
@@ -203,7 +203,7 @@ int main( int argc, char **argv ) {
            if( Status == STATUS_PENDING ) {
                LARGE_INTEGER Timeout = { 0 };
                Status = NtWaitForSingleObject( Event, 1, &Timeout );
-           } 
+           }
 
            ReadLen = Iosb.Information;
 
index 1e86bff..59077fd 100644 (file)
@@ -100,7 +100,7 @@ int main( int argc, char **argv ) {
           CloseHandle(pi.hProcess);
       return 6;
     }
-       
+
     if (pi.hProcess != INVALID_HANDLE_VALUE)
         CloseHandle(pi.hProcess);
 
index 310a893..e409b76 100644 (file)
@@ -2,7 +2,7 @@
 #include <reactos/resource.h>
 #include "resource.h"
 
-IDR_MAINMENU MENU DISCARDABLE 
+IDR_MAINMENU MENU DISCARDABLE
 BEGIN
     POPUP "&File"
     BEGIN
index 46f1906..2070bdd 100644 (file)
@@ -2,7 +2,7 @@
 //#include <reactos/resource.h>
 #include "resource.h"
 
-IDR_MAINMENU MENU DISCARDABLE 
+IDR_MAINMENU MENU DISCARDABLE
 BEGIN
     POPUP "&File"
     BEGIN
index 8760ef9..e1985a4 100644 (file)
@@ -41,7 +41,7 @@ extern "C" int is_stack_ptr ( const void* p )
 }
 
 int TCPSocketState(void *ClientData,
-                  void *WhichSocket, 
+                  void *WhichSocket,
                   void *WhichConnection,
                   OSK_UINT NewState ) {
     PCONNECTION_ENDPOINT Connection = (PCONNECTION_ENDPOINT)WhichConnection;
@@ -54,22 +54,22 @@ int TCPSocketState(void *ClientData,
        return 0;
     }
 
-    if( (NewState & SEL_CONNECT) && 
+    if( (NewState & SEL_CONNECT) &&
        !(Connection->State & SEL_CONNECT) ) {
     } else if( (NewState & SEL_READ) || (NewState & SEL_FIN) ) {
-    } 
+    }
 
     return 0;
 }
 
 #define STRINGIFY(x) #x
 
-char hdr[14] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+char hdr[14] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                 0x08, 0x00 };
 
 int TCPPacketSend(void *ClientData, OSK_PCHAR data, OSK_UINT len ) {
-    output_packets.push_back( std::string( hdr, 14 ) + 
+    output_packets.push_back( std::string( hdr, 14 ) +
                              std::string( (char *)data, (int)len ) );
     return 0;
 }
@@ -79,14 +79,14 @@ struct ifaddr *TCPFindInterface( void *ClientData,
                                 OSK_UINT FindType,
                                 struct sockaddr *ReqAddr ) {
     static struct sockaddr_in ifa = { AF_INET }, nm = { AF_INET };
-    static struct ifaddr a = { 
-       (struct sockaddr *)&ifa, 
-       NULL, 
-       (struct sockaddr *)&nm, 
-       0, 
-       0, 
-       1, 
-       1500 
+    static struct ifaddr a = {
+       (struct sockaddr *)&ifa,
+       NULL,
+       (struct sockaddr *)&nm,
+       0,
+       0,
+       1,
+       1500
     };
     ifa.sin_addr.s_addr = inet_addr( "10.10.2.115" );
     nm.sin_addr.s_addr  = inet_addr( "255.255.255.0" );
@@ -110,7 +110,7 @@ int TCPSleep( void *ClientData, void *token, int priority, char *msg,
              int tmio ) {
 #if 0
     PSLEEPING_THREAD SleepingThread;
-    
+
     TI_DbgPrint(MID_TRACE,
                ("Called TSLEEP: tok = %x, pri = %d, wmesg = %s, tmio = %x\n",
                 token, priority, msg, tmio));
@@ -222,7 +222,7 @@ int main( int argc, char **argv ) {
     while( true ) {
        FD_ZERO( &readf );
        FD_SET( asock, &readf );
-       tv.tv_sec = 0; 
+       tv.tv_sec = 0;
        tv.tv_usec = 10000;
        selret = select( asock + 1, &readf, NULL, NULL, &tv );
 
@@ -236,11 +236,11 @@ int main( int argc, char **argv ) {
                int theport, bytes, /*recvret,*/ off, bytin;
                struct sockaddr_in nam;
                std::string faddr, word;
-               std::istringstream 
+               std::istringstream
                    cmdin( std::string( datagram + 4, dgrecv - 4 ) );
-               
+
                cmdin >> word;
-               
+
                if( word == "socket" ) {
                    cmdin >> faddr >> theport;
 
@@ -248,18 +248,18 @@ int main( int argc, char **argv ) {
                    nam.sin_addr.s_addr = inet_addr(faddr.c_str());
                    nam.sin_port = htons(theport);
 
-                   if( (err = OskitTCPSocket( NULL, &conn, AF_INET, 
+                   if( (err = OskitTCPSocket( NULL, &conn, AF_INET,
                                              SOCK_STREAM, 0 )) != 0 ) {
                        fprintf( stderr, "OskitTCPSocket: error %d\n", err );
                    }
-                   
-                   if( (err = OskitTCPConnect( conn, NULL, &nam, 
+
+                   if( (err = OskitTCPConnect( conn, NULL, &nam,
                                                sizeof(nam) )) != 0 ) {
                        fprintf( stderr, "OskitTCPConnect: error %d\n", err );
                    } else {
                        printf( "Socket created\n" );
                    }
-               } 
+               }
 
                /* The rest of the commands apply only to an open socket */
                if( !conn ) continue;
@@ -267,7 +267,7 @@ int main( int argc, char **argv ) {
                if( word == "recv" ) {
                    cmdin >> bytes;
 
-                   if( (err = OskitTCPRecv( conn, (OSK_PCHAR)datagram, 
+                   if( (err = OskitTCPRecv( conn, (OSK_PCHAR)datagram,
                                             sizeof(datagram),
                                             (unsigned int *)&bytin, 0 )) != 0 ) {
                        fprintf( stderr, "OskitTCPRecv: error %d\n", err );
@@ -311,12 +311,12 @@ int main( int argc, char **argv ) {
                } else if( word == "send" ) {
                    off = 0;
                    while( cmdin >> word ) {
-                       datagram[off++] = 
+                       datagram[off++] =
                            atoi( (std::string("0x") + word).c_str() );
                    }
-                   
-                   if( (err = OskitTCPSend( conn, (OSK_PCHAR)datagram, 
-                                            off, (OSK_UINT *)&bytin, 0 )) 
+
+                   if( (err = OskitTCPSend( conn, (OSK_PCHAR)datagram,
+                                            off, (OSK_UINT *)&bytin, 0 ))
                        != 0 ) {
                        fprintf( stderr, "OskitTCPConnect: error %d\n", err );
                    } else {
@@ -346,9 +346,9 @@ int main( int argc, char **argv ) {
                    datagram[21] = 2;
 
                    err = sendto( asock, datagram, dgrecv, 0,
-                                 (struct sockaddr *)&addr_to, 
+                                 (struct sockaddr *)&addr_to,
                                  sizeof(addr_to) );
-                   
+
                    if( err != 0 )
                        printf( "sendto: %d\n", err );
                } else {
@@ -356,7 +356,7 @@ int main( int argc, char **argv ) {
                    memcpy( hdr + 6, datagram, 6 );
                    memcpy( hdr + 12, datagram + 12, 2 );
                    OskitTCPReceiveDatagram
-                       ( (unsigned char *)datagram + 14, 
+                       ( (unsigned char *)datagram + 14,
                          dgrecv - 14, 20 );
                }
            }
@@ -365,7 +365,7 @@ int main( int argc, char **argv ) {
        TimerOskitTCP();
 
        for( i = output_packets.begin(); i != output_packets.end(); i++ ) {
-           err = sendto( asock, i->c_str(), i->size(), 0, 
+           err = sendto( asock, i->c_str(), i->size(), 0,
                          (struct sockaddr *)&addr_to, sizeof(addr_to) );
 
            fprintf( stderr, "** SENDING PACKET %d bytes **\n", i->size() );
@@ -377,4 +377,4 @@ int main( int argc, char **argv ) {
        output_packets.clear();
     }
 }
-    
+
index 84c5d7b..86d4e76 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 
 HINSTANCE HInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
-int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR, 
+int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
    int nCmdShow)
 {
    HInst = HInstance;
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpszClassName = WndClassName;
    wc.lpfnWndProc = MainWndProc;
@@ -41,14 +41,14 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
-         CreateWindow(WndClassName, 
+      HWND HWnd =
+         CreateWindow(WndClassName,
                       TEXT("PatBlt Tracking Rect Demo"),
-                      WS_OVERLAPPEDWINDOW | WS_CAPTION | 
+                      WS_OVERLAPPEDWINDOW | WS_CAPTION |
                       WS_VISIBLE | WS_CLIPCHILDREN,
                       CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,
                       NULL, NULL, HInst, NULL);
-                                 
+
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
@@ -59,7 +59,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
     return 0;
@@ -101,31 +101,31 @@ void RenderTrackingRect(IN HDC HDestDC, IN const RECT& RRender)
    const DWORD dwROP3 = DSTINVERT; // experiment with others
 
    // render top bar
-   PatBlt(HDestDC, 
-          RRender.left, RRender.top, 
-          width, line_width, 
+   PatBlt(HDestDC,
+          RRender.left, RRender.top,
+          width, line_width,
           dwROP3);
    // render bottom bar
-   PatBlt(HDestDC, 
-          RRender.left, RRender.bottom - line_width, 
-          width, line_width, 
+   PatBlt(HDestDC,
+          RRender.left, RRender.bottom - line_width,
+          width, line_width,
           dwROP3);
    // render left bar
-   PatBlt(HDestDC, 
-          RRender.left, RRender.top + line_width, 
-          line_width, height - (2 * line_width), 
+   PatBlt(HDestDC,
+          RRender.left, RRender.top + line_width,
+          line_width, height - (2 * line_width),
           dwROP3);
    // render right bar
-   PatBlt(HDestDC, 
-          RRender.right - line_width, RRender.top + line_width, 
-          line_width, height - (2 * line_width), 
+   PatBlt(HDestDC,
+          RRender.right - line_width, RRender.top + line_width,
+          line_width, height - (2 * line_width),
           dwROP3);
 
 }
 //------------------------------------------------------------------
 
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    switch (Msg)
@@ -138,15 +138,15 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          {
             // load the penguin bitmap
             HBITMAP HBmp = static_cast<HBITMAP>(
-               LoadImage(HInst, filename, IMAGE_BITMAP, 0, 0, 
+               LoadImage(HInst, filename, IMAGE_BITMAP, 0, 0,
                          LR_LOADFROMFILE | LR_DEFAULTSIZE)
-               );         
+               );
             if (HBmp)
             {
                // get the bitmap's dimensions
                BITMAP bmp;
                if (GetObject(HBmp, sizeof(BITMAP), &bmp))
-               {  
+               {
                   RImage.right += bmp.bmWidth;
                   RImage.bottom += bmp.bmHeight;
 
@@ -166,9 +166,9 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          PMouse.y = HIWORD(LParam);
 
          RECT RClient;
-         if (PtInRect(&RImage, PMouse) && 
+         if (PtInRect(&RImage, PMouse) &&
              GetClientRect(HWnd, &RClient))
-         {   
+         {
             MapRect(HWnd, HWND_DESKTOP, RClient);
             ClipCursor(&RClient);
 
@@ -178,23 +178,23 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             HRGN HClipRgn = CreateRectRgnIndirect(&RClient);
             SelectClipRgn(HScreenDC, HClipRgn);
             DeleteObject(HClipRgn);
-            
+
             CopyRect(&RTrack, &RImage);
-            MapRect(HWnd, HWND_DESKTOP, RTrack);                  
+            MapRect(HWnd, HWND_DESKTOP, RTrack);
 
             // render the first tracking rect
             RenderTrackingRect(HScreenDC, RTrack);
             is_tracking = true;
-         }                                       
+         }
          break;
       }
       case WM_MOUSEMOVE:
       {
          if (HScreenDC && is_tracking)
-         {  
-            POINT PCurrent = {LOWORD(LParam), HIWORD(LParam)};       
+         {
+            POINT PCurrent = {LOWORD(LParam), HIWORD(LParam)};
             const int dX = PCurrent.x - PMouse.x;
-            const int dY = PCurrent.y - PMouse.y; 
+            const int dY = PCurrent.y - PMouse.y;
 
             // erase the previous rectangle
             RenderTrackingRect(HScreenDC, RTrack);
@@ -227,12 +227,12 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          break;
       }
       case WM_PAINT:
-      {  
+      {
          PAINTSTRUCT ps;
          HDC Hdc = BeginPaint(HWnd, &ps);
          try
          {
-            // 
+            //
             // TODO: Add palette support...
             //
 
@@ -240,7 +240,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             BitBlt(Hdc, RImage.left, RImage.top,
                    RImage.right - RImage.left,
                    RImage.bottom - RImage.top,
-                   HMemDC, 0, 0, 
+                   HMemDC, 0, 0,
                    SRCCOPY);
          }
          catch (...)
@@ -249,11 +249,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          }
          EndPaint(HWnd, &ps);
          break;
-      }      
+      }
       case WM_DESTROY:
       {
          // clean up
-         if (HOldBmp) 
+         if (HOldBmp)
          {
             DeleteObject(SelectObject(HMemDC, HOldBmp));
          }
index 8a440cf..c05293f 100644 (file)
@@ -315,10 +315,10 @@ POLYGONFILL_MakeEdge(POINT From, POINT To)
 ** lines will become active first when scanning from
 ** top (min y) to bottom (max y).
 **
-** Return Value Meaning 
-** Negative integer element1 < element2 
-** Zero element1 = element2 
-** Positive integer element1 > element2 
+** Return Value Meaning
+** Negative integer element1 < element2
+** Zero element1 = element2
+** Positive integer element1 > element2
 */
 static
 INT
@@ -427,7 +427,7 @@ fail:
 
 
 /*
-** This slow routine uses the data stored in the edge list to 
+** This slow routine uses the data stored in the edge list to
 ** calculate the x intercepts for each line in the edge list
 ** for scanline Scanline.
 **TODO: Get rid of this floating point arithmetic
@@ -664,14 +664,14 @@ POLYGONFILL_FillScanLineWinding(
                RopMode); // MIX
 }
 
-//When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and 
-//even-numbered polygon sides on each scan line. That is, GDI fills the area between the 
-//first and second side, between the third and fourth side, and so on. 
+//When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and
+//even-numbered polygon sides on each scan line. That is, GDI fills the area between the
+//first and second side, between the third and fourth side, and so on.
 
-//WINDING Selects winding mode (fills any region with a nonzero winding value). 
+//WINDING Selects winding mode (fills any region with a nonzero winding value).
 //When the fill mode is WINDING, GDI fills any region that has a nonzero winding value.
 //This value is defined as the number of times a pen used to draw the polygon would go around the region.
-//The direction of each edge of the polygon is important. 
+//The direction of each edge of the polygon is important.
 
 BOOL
 STDCALL
@@ -711,7 +711,7 @@ FillPolygon(
   else /* default */
     FillScanLine = POLYGONFILL_FillScanLineAlternate;
 
-  /* For each Scanline from BoundRect.bottom to BoundRect.top, 
+  /* For each Scanline from BoundRect.bottom to BoundRect.top,
    * determine line segments to draw
    */
   for ( ScanLine = BoundRect.top; ScanLine < BoundRect.bottom; ++ScanLine )
@@ -780,7 +780,7 @@ Polygon ( CONST PPOINT UnsafePoints, int Count, int polyFillMode )
       DestRect.top      = MIN(DestRect.top, Points[CurrentPoint].y);
       DestRect.bottom   = MAX(DestRect.bottom, Points[CurrentPoint].y);
     }
-    
+
   // Draw the Polygon Edges with the current pen
   for (CurrentPoint = 0; CurrentPoint < Count; ++CurrentPoint)
     {
@@ -804,9 +804,9 @@ Polygon ( CONST PPOINT UnsafePoints, int Count, int polyFillMode )
       IntEngLineTo(SurfObj,
                   dc.CombinedClip,
                   OutBrushObj,
-                  From.x, 
-                  From.y, 
-                  To.x, 
+                  From.x,
+                  From.y,
+                  To.x,
                   To.y,
                   &DestRect,
                   EDGE_CHAR); /* MIX */
index edb467a..7ee181d 100644 (file)
@@ -21,7 +21,7 @@ IDM_MAINMENU MENU LOADONCALL MOVEABLE DISCARDABLE
       MENUITEM "&9", 19
     }
     MENUITEM SEPARATOR
-    MENUITEM "&Save\tCtrl+S", 3 
+    MENUITEM "&Save\tCtrl+S", 3
     MENUITEM "Save &as...", 4
     MENUITEM SEPARATOR
     MENUITEM "E&xit\tAlt-F4", IDM_EXIT
index 59e3cf8..650fdfe 100644 (file)
@@ -1,4 +1,4 @@
-                    
+
 // ------------------------------------------------------------------
 // Windows 2000 Graphics API Black Book
 // Chapter 4 - Utility functions
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -23,7 +23,7 @@ namespace font {
 HFONT MakeFont(
     IN HDC hDestDC,           // handle to target DC
     IN LPCSTR typeface_name,  // font's typeface name
-    IN int point_size,        // font's point size 
+    IN int point_size,        // font's point size
     IN const BYTE charset,    // font's character set
     IN const DWORD style      // font's styles
    )
@@ -38,12 +38,12 @@ HFONT MakeFont(
    int pixels_per_inch = GetDeviceCaps(hDestDC, LOGPIXELSY);
 
    POINT PSize = {
-      0, 
-      -MulDiv(static_cast<int>(xf.eM22 * point_size + 0.5), 
+      0,
+      -MulDiv(static_cast<int>(xf.eM22 * point_size + 0.5),
               pixels_per_inch, 72)
       };
 
-   HFONT hResult = NULL;      
+   HFONT hResult = NULL;
    if (DPtoLP(hDestDC, &PSize, 1))
    {
       LOGFONT lf;
index 1a34999..df61756 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 
 HINSTANCE hInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
-int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, 
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
    int nCmdShow)
 {
    hInst = hInstance;
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW;
    wc.lpszClassName = WndClassName;
    wc.lpfnWndProc = MainWndProc;
@@ -45,15 +45,15 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
 
    if (RegisterClass(&wc))
    {
-      HWND hWnd = 
+      HWND hWnd =
          CreateWindow(
             WndClassName, TEXT("Output Primitives Demo"),
-            WS_OVERLAPPEDWINDOW | WS_CAPTION | 
+            WS_OVERLAPPEDWINDOW | WS_CAPTION |
             WS_VISIBLE | WS_CLIPCHILDREN,
             CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,
             NULL, NULL, hInst, NULL
             );
-                                 
+
       if (hWnd)
       {
          ShowWindow(hWnd, nCmdShow);
@@ -64,10 +64,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
-    return 0;                                                               
+    return 0;
 }
 //------------------------------------------------------------------
 
@@ -77,7 +77,7 @@ enum OutPrimitive {
    opEllipse, opArc, opPie, opChord, opCustom
    };
 
-void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive, 
+void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
    IN OutPrimitive PrimitiveID)
 {
    RECT R = RPrimitive;
@@ -98,8 +98,8 @@ void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
             {(R.right - R.left) / 2, R.top},
             {(R.right - R.left) / 2, R.bottom},
             {R.right, R.bottom}
-            };         
-         PolyBezier(hDC, PControlPoints, 4);         
+            };
+         PolyBezier(hDC, PControlPoints, 4);
          break;
       }
       case opRectangle:
@@ -122,8 +122,8 @@ void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
          const POINT PRads[] = {
             {(R.right - R.left) / 3 + R.left, R.top},
             {(R.right - R.left) / 3 + R.left, R.bottom}
-            };         
-         Arc(hDC, R.left, R.top, R.right, R.bottom, 
+            };
+         Arc(hDC, R.left, R.top, R.right, R.bottom,
              PRads[0].x, PRads[0].y, PRads[1].x, PRads[1].y);
          break;
       }
@@ -132,8 +132,8 @@ void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
          const POINT PRads[] = {
             {(R.right - R.left) / 3 + R.left, R.top},
             {(R.right - R.left) / 3 + R.left, R.bottom}
-            };         
-         Pie(hDC, R.left, R.top, R.right, R.bottom, 
+            };
+         Pie(hDC, R.left, R.top, R.right, R.bottom,
              PRads[0].x, PRads[0].y, PRads[1].x, PRads[1].y);
          break;
       }
@@ -142,8 +142,8 @@ void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
          const POINT PRads[] = {
             {(R.right - R.left) / 3 + R.left, R.top},
             {(R.right - R.left) / 3 + R.left, R.bottom}
-            };         
-         Chord(hDC, R.left, R.top, R.right, R.bottom, 
+            };
+         Chord(hDC, R.left, R.top, R.right, R.bottom,
              PRads[0].x, PRads[0].y, PRads[1].x, PRads[1].y);
          break;
       }
@@ -153,8 +153,8 @@ void DrawPrimitive(IN HDC hDC, IN const RECT& RPrimitive,
             {R.left, (R.bottom - R.top) / 2 + R.top},
             {(R.right - R.left) / 2 + R.left, R.top},
             {R.right, (R.bottom - R.top) / 2 + R.top},
-            {(R.right - R.left) / 2 + R.left, R.bottom}            
-            };         
+            {(R.right - R.left) / 2 + R.left, R.bottom}
+            };
          Polygon(hDC, PVertices, 4);
          break;
       }
@@ -168,20 +168,20 @@ HBRUSH hListBrush = NULL;  // handle to the list box brush
 HPEN hListPen = NULL;      // handle to the list box pen
 HFONT hListFont = NULL;    // handle to the list box font
 
-LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, 
+LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
    LPARAM lParam)
 {
    switch (msg)
    {
       case WM_CREATE:
       {
-         hListBox = 
+         hListBox =
             CreateWindowEx(
-               WS_EX_CLIENTEDGE, TEXT("LISTBOX"), TEXT(""), 
+               WS_EX_CLIENTEDGE, TEXT("LISTBOX"), TEXT(""),
                WS_CHILD | WS_VISIBLE | WS_VSCROLL |
-               LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | 
-               LBS_OWNERDRAWFIXED, 
-               0, 0, 640, 480, 
+               LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
+               LBS_OWNERDRAWFIXED,
+               0, 0, 640, 480,
                hWnd, NULL, hInst, NULL
                );
          assert(hListBox != NULL);
@@ -190,23 +190,23 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
             hListBox, GWL_ID, reinterpret_cast<LONG>(hListBox)
             );
 
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Line")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Bezier Curve")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Rectangle")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Rounded Rectangle")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Ellipse")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Arc")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Pie Slice")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Chord")));
-         SNDMSG(hListBox, LB_ADDSTRING, 0, 
+         SNDMSG(hListBox, LB_ADDSTRING, 0,
                 reinterpret_cast<LPARAM>(TEXT("Custom")));
 
          hListBrush = CreateSolidBrush(PALETTERGB(64, 192, 64));
@@ -218,9 +218,9 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
          {
             // MakeFont() from Chapter 4
             hListFont = font::MakeFont(
-               hScreenDC, "Impact", 20, ANSI_CHARSET, 
+               hScreenDC, "Impact", 20, ANSI_CHARSET,
                font::FS_BOLD | font::FS_UNDERLINE
-               ); 
+               );
          }
 #if 0
          catch (...)
@@ -234,30 +234,30 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
       }
       case WM_MEASUREITEM:
       {
-         LPMEASUREITEMSTRUCT lpmis = 
+         LPMEASUREITEMSTRUCT lpmis =
             reinterpret_cast<LPMEASUREITEMSTRUCT>(lParam);
          assert(lpmis != NULL);
 
          if (lpmis->CtlID == reinterpret_cast<UINT>(hListBox))
          {
-            lpmis->itemHeight = 150;            
-            return TRUE;         
+            lpmis->itemHeight = 150;
+            return TRUE;
          }
          break;
       }
       case WM_DRAWITEM:
       {
-         LPDRAWITEMSTRUCT lpdis = 
+         LPDRAWITEMSTRUCT lpdis =
             reinterpret_cast<LPDRAWITEMSTRUCT>(lParam);
          assert(lpdis != NULL);
 
          if (lpdis->CtlID == reinterpret_cast<UINT>(hListBox))
-         {            
+         {
             SaveDC(lpdis->hDC);
 #if 0
             try
 #endif
-            {              
+            {
                SelectObject(lpdis->hDC, hListBrush);
                SelectObject(lpdis->hDC, hListPen);
                SelectObject(lpdis->hDC, hListFont);
@@ -280,11 +280,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
                   0.6 * lpdis->rcItem.right + 0.5
                   );
                FillRect(
-                  lpdis->hDC, &RPrimitive, 
+                  lpdis->hDC, &RPrimitive,
                   reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1)
                   );
                DrawPrimitive(
-                  lpdis->hDC, RPrimitive, 
+                  lpdis->hDC, RPrimitive,
                   static_cast<OutPrimitive>(lpdis->itemID)
                   );
                if (selected) InvertRect(lpdis->hDC, &RPrimitive);
@@ -292,24 +292,24 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
 
                // render the text
                TCHAR text[13];
-               if (SNDMSG(hListBox, LB_GETTEXT, lpdis->itemID, 
+               if (SNDMSG(hListBox, LB_GETTEXT, lpdis->itemID,
                           reinterpret_cast<LPARAM>(&text)) != LB_ERR)
-               {           
+               {
                   RECT RText = RPrimitive;
                   RText.left =  RPrimitive.right;
-                  RText.right = lpdis->rcItem.right; 
+                  RText.right = lpdis->rcItem.right;
 
                   SelectObject(lpdis->hDC, hListFont);
                   SetBkMode(lpdis->hDC, TRANSPARENT);
                   SetTextColor(lpdis->hDC, clrText);
-            
-                  DrawText(lpdis->hDC, text, -1, &RText, 
+
+                  DrawText(lpdis->hDC, text, -1, &RText,
                            DT_CENTER | DT_VCENTER | DT_SINGLELINE);
                }
 
                // indicate keyboard focus
                if (lpdis->itemState & ODS_FOCUS)
-               {  
+               {
                   RECT RFocus = lpdis->rcItem;
                   InflateRect(&RFocus, -1, -1);
                   DrawFocusRect(lpdis->hDC, &RFocus);
@@ -330,7 +330,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
       {
          MoveWindow(
             hListBox, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE
-            ); 
+            );
          return 0;
       }
       case WM_DESTROY:
index d0a0d37..2a1512e 100644 (file)
@@ -1,6 +1,6 @@
 <module name="readconsole" type="win32cui" installbase="bin" installname="readconsole.exe">
        <define name="UNICODE" />
-       <define name="_UNICODE" />      
+       <define name="_UNICODE" />
        <define name="__USE_W32API" />
        <library>kernel32</library>
        <file>main.c</file>
index dec7dd5..fede8e2 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -31,7 +31,7 @@ HINSTANCE HInst;
 HINSTANCE HPrevInst;
 TCHAR *cmdline;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
@@ -44,7 +44,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
@@ -54,63 +54,63 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
+      HWND HWnd =
          CreateWindow(WndClassName, TEXT("StretchBlt NonUniform Zooming Demo"),
-                      WS_OVERLAPPEDWINDOW | WS_CAPTION | 
+                      WS_OVERLAPPEDWINDOW | WS_CAPTION |
                       WS_VISIBLE | WS_CLIPSIBLINGS,
                       0, 0, 675, 560,
                       NULL, NULL, HInst, NULL);
-                                 
+
       if (HWnd)
       {
          HListBox =
-            CreateWindowEx(WS_EX_CLIENTEDGE, "LISTBOX", "", 
-                           LBS_NOTIFY | WS_CHILD | WS_VISIBLE, 
-                           530, 5, 130, 150, HWnd, 
+            CreateWindowEx(WS_EX_CLIENTEDGE, "LISTBOX", "",
+                           LBS_NOTIFY | WS_CHILD | WS_VISIBLE,
+                           530, 5, 130, 150, HWnd,
                            reinterpret_cast<HMENU>(ID_LISTBOX),
                            HInst, NULL);
          VListBox =
-            CreateWindowEx(WS_EX_CLIENTEDGE, "LISTBOX", "", 
-                           LBS_NOTIFY | WS_CHILD | WS_VISIBLE, 
-                           530, 5+170, 130, 150, HWnd, 
+            CreateWindowEx(WS_EX_CLIENTEDGE, "LISTBOX", "",
+                           LBS_NOTIFY | WS_CHILD | WS_VISIBLE,
+                           530, 5+170, 130, 150, HWnd,
                            reinterpret_cast<HMENU>(ID_LISTBOX2),
                            HInst, NULL);
 
          if (HListBox && VListBox)
          {
 // horizontal zoom
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 25%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 50%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 75%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 100%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 125%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 150%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 200%"));
-            SNDMSG(HListBox, LB_ADDSTRING, 0, 
+            SNDMSG(HListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 300%"));
 // vertical zoom
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 25%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 50%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 75%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 100%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 125%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 150%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 200%"));
-            SNDMSG(VListBox, LB_ADDSTRING, 0, 
+            SNDMSG(VListBox, LB_ADDSTRING, 0,
                    reinterpret_cast<LPARAM>("Zoom 300%"));
 
          }
@@ -123,7 +123,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
     return 0;
@@ -143,16 +143,16 @@ HBITMAP HOldBmp = NULL;
 float zoom_factor_h = 0.5;
 float zoom_factor_v = 0.5;
 RECT RDest = {5, 5, 0, 0};
-enum {ID_ZOOM25, ID_ZOOM50, ID_ZOOM75, ID_ZOOM100, 
+enum {ID_ZOOM25, ID_ZOOM50, ID_ZOOM75, ID_ZOOM100,
       ID_ZOOM125, ID_ZOOM150, ID_ZOOM200, ID_ZOOM300};
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
-      {         
+      {
                 // check commandline
                 if (strlen(cmdline) != 0)
                 {
@@ -167,13 +167,13 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          if (HMemDC)
          {
             // load a bitmap from file
-            HBITMAP HBmp = 
+            HBITMAP HBmp =
                static_cast<HBITMAP>(
-                  LoadImage(HInst, filename, IMAGE_BITMAP, 
+                  LoadImage(HInst, filename, IMAGE_BITMAP,
                             0, 0, LR_LOADFROMFILE)
-                            );  
+                            );
             if (HBmp)
-            { 
+            {
                // extract dimensions of the bitmap
                GetObject(HBmp, sizeof(BITMAP), &bmp);
 
@@ -188,7 +188,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                bmInfo.bmiHeader.biXPelsPerMeter = 0;
                bmInfo.bmiHeader.biClrImportant = 0;
                           bmInfo.bmiHeader.biClrUsed = 0;
-               
+
                           // associate the bitmap with the memory DC
                HOldBmp = static_cast<HBITMAP>(
                   SelectObject(HMemDC, HBmp)
@@ -211,11 +211,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                                   fclose(f);
                           }
             }
-         }         
+         }
       }
       case WM_COMMAND:
       {
-         if (WParam == MAKEWPARAM(ID_LISTBOX, LBN_SELCHANGE) || 
+         if (WParam == MAKEWPARAM(ID_LISTBOX, LBN_SELCHANGE) ||
                         WParam == MAKEWPARAM(ID_LISTBOX2, LBN_SELCHANGE))
          {
             switch (SNDMSG(HListBox, LB_GETCURSEL, 0, 0))
@@ -243,15 +243,15 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             }
 
             // calculate the new width and height
-            const int new_width = 
+            const int new_width =
                static_cast<int>(zoom_factor_h * bmp.bmWidth);
-            const int new_height = 
+            const int new_height =
                static_cast<int>(zoom_factor_v * bmp.bmHeight);
 
             // is zooming in?
             bool zoom_in = (new_width > RDest.right - RDest.left);
 
-            // caculate the area that needs to be updated 
+            // caculate the area that needs to be updated
             RECT RUpdate = {
                RDest.left, RDest.top,
                RDest.left + max(new_width, RDest.right - RDest.left),
@@ -260,20 +260,20 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
 
             // adjust the dimenstions of the
             // destination rectangle
-            RDest.right = RDest.left + new_width;               
-            RDest.bottom = RDest.top + new_height;            
+            RDest.right = RDest.left + new_width;
+            RDest.bottom = RDest.top + new_height;
 
             // create an update region from the XOR combination
             // of the update and destination rectangles
             HRGN HUpdateRgn = CreateRectRgnIndirect(&RUpdate);
             HRGN HDestRgn = CreateRectRgnIndirect(&RDest);
-            int result = 
+            int result =
                CombineRgn(HUpdateRgn, HUpdateRgn, HDestRgn, RGN_XOR);
 
             // incite a repaint
             if (result != NULLREGION && result != ERROR)
-            {              
-               InvalidateRgn(HWnd, HUpdateRgn, true);               
+            {
+               InvalidateRgn(HWnd, HUpdateRgn, true);
                RedrawWindow(HWnd, &RDest, NULL, RDW_NOERASE | RDW_INVALIDATE);
             }
             else if (result == NULLREGION)
@@ -301,36 +301,36 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                        if (useDIBits)
                        {
                    if (RDest.right - RDest.left > 0)
-                       {                               
+                       {
                                      if (zoom_factor_h < 1.0 || zoom_factor_v < 1.0)
                                          {
                             SetStretchBltMode(Hdc, COLORONCOLOR);
                              }
 
                                  // render the zoomed image
-                                     StretchDIBits(Hdc, RDest.left, RDest.top, 
-                                                       RDest.right - RDest.left, 
+                                     StretchDIBits(Hdc, RDest.left, RDest.top,
+                                                       RDest.right - RDest.left,
                                                            RDest.bottom - RDest.top,
-                                                               0, 0, 
+                                                               0, 0,
                                                                    bmp.bmWidth, bmp.bmHeight,
                                                                        bbits, &bmInfo,
                                                                        DIB_RGB_COLORS,
-                                       SRCCOPY);  
+                                       SRCCOPY);
                        }
                        }
                        else
                        {
                    if (RDest.right - RDest.left > 0)
                        {
-                               
+
                                   // use BitBlt when not zooming
                       if (zoom_factor_h == 1.0 && zoom_factor_v == 1.0)
                           {
-                                 BitBlt(Hdc, RDest.left, RDest.top, 
-                                            RDest.right - RDest.left, 
+                                 BitBlt(Hdc, RDest.left, RDest.top,
+                                            RDest.right - RDest.left,
                                                 RDest.bottom - RDest.top,
-                                                    HMemDC, 0, 0, 
-                                                        SRCCOPY);  
+                                                    HMemDC, 0, 0,
+                                                        SRCCOPY);
                       }
                           else
                               {
@@ -340,17 +340,17 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                              }
 
                                  // render the zoomed image
-                                     StretchBlt(Hdc, RDest.left, RDest.top, 
-                                                    RDest.right - RDest.left, 
+                                     StretchBlt(Hdc, RDest.left, RDest.top,
+                                                    RDest.right - RDest.left,
                                                         RDest.bottom - RDest.top,
-                                                            HMemDC, 0, 0, 
+                                                            HMemDC, 0, 0,
                                                                 bmp.bmWidth, bmp.bmHeight,
-                                    SRCCOPY);  
+                                    SRCCOPY);
                           }
                        }
                        }
          }
-#if 0           
+#if 0
          catch (...)
 #endif
          {
index 59e3cf8..650fdfe 100644 (file)
@@ -1,4 +1,4 @@
-                    
+
 // ------------------------------------------------------------------
 // Windows 2000 Graphics API Black Book
 // Chapter 4 - Utility functions
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -23,7 +23,7 @@ namespace font {
 HFONT MakeFont(
     IN HDC hDestDC,           // handle to target DC
     IN LPCSTR typeface_name,  // font's typeface name
-    IN int point_size,        // font's point size 
+    IN int point_size,        // font's point size
     IN const BYTE charset,    // font's character set
     IN const DWORD style      // font's styles
    )
@@ -38,12 +38,12 @@ HFONT MakeFont(
    int pixels_per_inch = GetDeviceCaps(hDestDC, LOGPIXELSY);
 
    POINT PSize = {
-      0, 
-      -MulDiv(static_cast<int>(xf.eM22 * point_size + 0.5), 
+      0,
+      -MulDiv(static_cast<int>(xf.eM22 * point_size + 0.5),
               pixels_per_inch, 72)
       };
 
-   HFONT hResult = NULL;      
+   HFONT hResult = NULL;
    if (DPtoLP(hDestDC, &PSize, 1))
    {
       LOGFONT lf;
index c77216b..8c86dc2 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 
 HINSTANCE hInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
-int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, 
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
    int nCmdShow)
 {
    hInst = hInstance;
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpszClassName = WndClassName;
    wc.lpfnWndProc = MainWndProc;
@@ -46,15 +46,15 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
 
    if (RegisterClass(&wc))
    {
-      HWND hWnd = 
+      HWND hWnd =
          CreateWindow(
             WndClassName, TEXT("Scaled Text Demo"),
-            WS_OVERLAPPEDWINDOW | WS_CAPTION | 
+            WS_OVERLAPPEDWINDOW | WS_CAPTION |
             WS_VISIBLE | WS_CLIPCHILDREN,
             CW_USEDEFAULT, CW_USEDEFAULT, 800, 300,
             NULL, NULL, hInst, NULL
             );
-                                 
+
       if (hWnd)
       {
          ShowWindow(hWnd, nCmdShow);
@@ -65,10 +65,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
-    return 0;                                                               
+    return 0;
 }
 //-------------------------------------------------------------------------
 
@@ -78,7 +78,7 @@ HFONT hTTFont = NULL;
 double scale = 0.0;
 LPCSTR pText = TEXT("The Scaled Text!");
 
-LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, 
+LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
    LPARAM lParam)
 {
    switch (msg)
@@ -91,13 +91,13 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
 
          InitCommonControlsEx(&icx);
 
-         hTrackBar = 
+         hTrackBar =
             CreateWindow(
-               TRACKBAR_CLASS, "", 
-               TBS_HORZ | TBS_BOTH | TBS_AUTOTICKS | 
+               TRACKBAR_CLASS, "",
+               TBS_HORZ | TBS_BOTH | TBS_AUTOTICKS |
                TBS_FIXEDLENGTH | TBS_ENABLESELRANGE |
-               WS_CHILD | WS_VISIBLE, 
-               10, 260, 375, 40, 
+               WS_CHILD | WS_VISIBLE,
+               10, 260, 375, 40,
                hWnd, NULL, hInst, NULL
                );
 
@@ -136,9 +136,9 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
          break;
       }
       case WM_ERASEBKGND:
-      {  
+      {
          LRESULT res = DefWindowProc(hWnd, msg, wParam, lParam);
-                       
+
          HDC hDC = reinterpret_cast<HDC>(wParam);
          HFONT hOldFont = static_cast<HFONT>(
             SelectObject(hDC, hTTFont)
@@ -182,8 +182,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
                            );
                         pPEnds[iPoint].y = static_cast<LONG>(
                            scale * pPEnds[iPoint].y + 0.5
-                           );                           
-                     }  
+                           );
+                     }
 
                      for (iPoint = 0; iPoint < num_points; ++iPoint)
                      {
@@ -227,9 +227,9 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
                   delete [] pPEnds;
                   throw;
                }
-               // clean up 
-               delete [] pTypes; 
-               delete [] pPEnds; 
+               // clean up
+               delete [] pTypes;
+               delete [] pPEnds;
             }
             // ...
          }
@@ -243,11 +243,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
       case WM_SIZE:
       {
          MoveWindow(
-            hTrackBar, 
+            hTrackBar,
             0, HIWORD(lParam) - 40, LOWORD(lParam), 40,
             false
             );
-         break;         
+         break;
       }
       case WM_DESTROY:
       {
index cfc6731..22e2f97 100644 (file)
@@ -242,7 +242,7 @@ static BOOL CALLBACK find_top_window(HWND hwnd, LPARAM lParam)
             return TRUE;
         hwnd=control;
     }
-        
+
     pwindow = (HWND*)lParam;
     *pwindow = hwnd;
     return FALSE;
@@ -298,7 +298,7 @@ static void do_click(HWND window, DWORD down, DWORD up)
             if (dragto_y<window_info.rcWindow.top || dragto_y>=window_info.rcWindow.bottom)
                 dragto_y=(window_info.rcWindow.bottom+window_info.rcWindow.top)/2;
             dragto_y=(dragto_y << 16)/GetSystemMetrics(SM_CYSCREEN);
-       
+
             dx = g_dragto_x - g_x;
             dy = g_dragto_y - g_y;
             step_per_x = dx / 4;
@@ -309,8 +309,8 @@ static void do_click(HWND window, DWORD down, DWORD up)
             x=dragto_x;
             y=dragto_y;
         }
-    } 
-    if (up) 
+    }
+    if (up)
        mouse_event(MOUSEEVENTF_ABSOLUTE | up, x, y, 0, 0);
 }
 
index 6bfa5a3..b964bdf 100644 (file)
@@ -6,19 +6,19 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 //*********************************************************//
-//                                                         // 
+//                                                         //
 // SYNOPSIS:                                               //
 //   This sample project demonstrates how to render        //
 //   a background image in response to the WM_ERASEBKGND   //
 //   message.  It also shows how to create a transparent   //
 //   static (text) control by handling the                 //
 //   WM_CTLCOLORSTATIC message.                            //
-//                                                         // 
+//                                                         //
 //*********************************************************//
 
 
@@ -31,7 +31,7 @@ HINSTANCE HInst;
 HINSTANCE HPrevInst;
 TCHAR *cmdline;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
@@ -44,25 +44,25 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
-   wc.hbrBackground = 
+   wc.hbrBackground =
       reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1);
    wc.lpszClassName = WndClassName;
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
-         CreateWindow(WndClassName, 
+      HWND HWnd =
+         CreateWindow(WndClassName,
                       TEXT("WM_ERASEBKGND Demo"),
-                      WS_OVERLAPPEDWINDOW | WS_CAPTION | 
+                      WS_OVERLAPPEDWINDOW | WS_CAPTION |
                       WS_VISIBLE | WS_CLIPSIBLINGS,
                       CW_USEDEFAULT, CW_USEDEFAULT, 205, 85,
                       NULL, NULL, HInstance, NULL);
-                                 
+
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
@@ -73,7 +73,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
     return 0;
@@ -87,17 +87,17 @@ HDC HMemDC;
 HBITMAP HBmp, HOldBmp;
 const char* filename = "BACKBITMAP.BMP";
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
       {
-         HStatic = 
-            CreateWindow(TEXT("STATIC"), TEXT("Static Text"), 
-                         WS_CHILD | WS_VISIBLE | SS_CENTER, 
-                         10, 20, 175, 30, 
+         HStatic =
+            CreateWindow(TEXT("STATIC"), TEXT("Static Text"),
+                         WS_CHILD | WS_VISIBLE | SS_CENTER,
+                         10, 20, 175, 30,
                          HWnd, NULL, HInst, NULL);
 
          // create a memory DC compatible with the screen
@@ -106,7 +106,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          {
             // load a DDB from file
             HBmp = static_cast<HBITMAP>(
-               LoadImage(HInst, filename, IMAGE_BITMAP, 
+               LoadImage(HInst, filename, IMAGE_BITMAP,
                          0, 0, LR_LOADFROMFILE)
                );
             if (HBmp)
@@ -139,19 +139,19 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             RECT RClient;
             GetClientRect(HWnd, &RClient);
 
-            HDC Hdc = reinterpret_cast<HDC>(WParam); 
+            HDC Hdc = reinterpret_cast<HDC>(WParam);
             SetStretchBltMode(Hdc, COLORONCOLOR);
-            
+
             //
-            // TODO: add palette handling code for 
+            // TODO: add palette handling code for
             // palettized displays (see Chapter 9)...
             //
 
-            // render the background image            
-            StretchBlt(Hdc, 0, 0, 
+            // render the background image
+            StretchBlt(Hdc, 0, 0,
                        RClient.right - RClient.left,
                        RClient.bottom - RClient.top,
-                       HMemDC, 0, 0, bmp.bmWidth, bmp.bmHeight, 
+                       HMemDC, 0, 0, bmp.bmWidth, bmp.bmHeight,
                        SRCCOPY);
             return TRUE;
          }
index 1c0bec9..391795f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  loadlib.c
  *
@@ -91,7 +91,7 @@ const char* appName(const char* argv0)
     const char* name;
 
     name = (const char*)strrchr(argv0, '\\');
-    if (name != NULL) 
+    if (name != NULL)
         return name + 1;
     return argv0;
 }
index 51210d4..c4b4acd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  loadlib.h
  *
index 84d0e1a..e140dc3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  _tfileio.c
  *
@@ -31,8 +31,8 @@
 #define _tfopen      _wfopen
 #define _tunlink     _wunlink
 #define _TEOF        WEOF
-#define _gettchar    getwchar 
-#define _puttchar    putwchar  
+#define _gettchar    getwchar
+#define _puttchar    putwchar
 #define _THEX_FORMAT _T("0x%04x ")
 #else /*UNICODE*/
 #define _tfopen      fopen
index ab29300..dd6659b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  _fileio.c
  *
index 64f5476..3ac8f0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  main.c
  *
index ee20fbe..df22b72 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  main.h
  *
index 5985a8a..1f8fe37 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  ReactOS test program - 
+ *  ReactOS test program -
  *
  *  wfileio.c
  *
index 8cfb261..5540cfd 100644 (file)
@@ -1,12 +1,12 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <ctype.h>
-#include "ctx.h" 
-#define TYPE_FORMAT_STRING_SIZE   23                                
-#define PROC_FORMAT_STRING_SIZE   21                                
-#define TRANSMIT_AS_TABLE_SIZE    0            
-#define WIRE_MARSHAL_TABLE_SIZE   0   
+#include "ctx.h"
+
+#define TYPE_FORMAT_STRING_SIZE   23
+#define PROC_FORMAT_STRING_SIZE   21
+#define TRANSMIT_AS_TABLE_SIZE    0
+#define WIRE_MARSHAL_TABLE_SIZE   0
 
 typedef struct _MIDL_TYPE_FORMAT_STRING
     {
@@ -29,23 +29,23 @@ extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  *****************************************************************/
 
 
-void m_CtxOpen( 
+void m_CtxOpen(
     /* [out] */ PCTXTYPE __RPC_FAR *pphContext,
     /* [in] */ long Value)
 {
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
 
        char *ctx, *buf;
        int i;
-       
+
        printf("\n*******************************************************************\n");
        printf("**** CtxOpen()                                                  ***\n");
        printf("*******************************************************************\n\n");
-    
+
     if(!pphContext)
         {
         RpcRaiseException(RPC_X_NULL_REF_POINTER);
@@ -57,18 +57,18 @@ void m_CtxOpen(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           0);
-        
-        
+
+
         _Handle = hBinding;
-        
-        
+
+
         _StubMsg.BufferLength = 4U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value;
-        
+
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
 
@@ -77,74 +77,74 @@ void m_CtxOpen(
         for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.RpcMsg->BufferLength; i++)
                printf("0x%x, ", buf[i] & 0x0FF);
         printf("\n\n");
-        
+
         *pphContext = (void *)0;
         NdrClientContextUnmarshall(
                               ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                               ( NDR_CCONTEXT __RPC_FAR * )pphContext,
                               _Handle);
-        
+
         ctx = (char*)*pphContext;
         printf("\nNdrClientContextUnmarshall returned: handle=0x%p\n", ctx);
         printf("00: 0x%x <- obviously pointer to binding handle copyed from _Handle\n", *((int*)ctx));
         ctx+=4;
         printf("04: 0x%x <- unknown field\n", *((int*)ctx));
         printf("08: ");
-        
+
         for(ctx+=4, i = 0; i < 20; i++)
                printf("0x%x,", *(ctx+i) & 0x0FF); printf(" <- ndr 20 bytes\n\n");
-               
+
         printf("Buflen=%d, Buffer: ", _StubMsg.BufferLength);
         for(buf = _StubMsg.BufferStart; buf < _StubMsg.BufferEnd; buf++)
                printf("0x%x,", *buf & 0x0FF);
         printf("\n");
-        
-        
+
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
-void m_CtxOpen2( 
+void m_CtxOpen2(
     /* [out] */ PCTXTYPE __RPC_FAR *pphContext,
     /* [in] */ long Value)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
-    
+
     char buf[255];
-    
+
         NdrClientInitializeNew(
                           ( PRPC_MESSAGE  )&_RpcMessage,
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           0);
-        
-        
+
+
         _Handle = hBinding;
-        
-        
+
+
         _StubMsg.BufferLength = 4U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value;
-        
+
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
-        
+
         *pphContext = (void *)0;
-        
+
         RpcTryExcept
         {
         NdrClientContextUnmarshall(
@@ -157,9 +157,9 @@ void m_CtxOpen2(
                printf("NdrClientContextUnmarshall reported exception = %d\n", RpcExceptionCode());
         }
         RpcEndExcept
-        
-        
-        
+
+
+
         RpcTryExcept
         {
         NdrClientContextUnmarshall(
@@ -172,8 +172,8 @@ void m_CtxOpen2(
                printf("NdrClientContextUnmarshall reported exception = %d\n", RpcExceptionCode());
         }
         RpcEndExcept
-        
-                            
+
+
         RpcTryExcept
         {
         NdrClientContextMarshall(
@@ -186,7 +186,7 @@ void m_CtxOpen2(
                printf("NdrClientContextMarshall reported exception = %d\n", RpcExceptionCode());
         }
         RpcEndExcept
-        
+
         RpcTryExcept
         {
                NDRCContextUnmarshall( NULL, _Handle, buf, _RpcMessage.DataRepresentation  );
@@ -197,29 +197,29 @@ void m_CtxOpen2(
         }
         RpcEndExcept
 
-        
+
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
-    
+
+
 }
 
-void m_CtxHello( 
+void m_CtxHello(
     /* [in] */ PCTXTYPE phContext)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
-    
+
     char *buf;
     int i;
-    
+
        printf("\n*******************************************************************\n");
        printf("**** CtxHello()                                                 ***\n");
        printf("*******************************************************************\n\n");
-    
+
     RpcTryFinally
         {
         NdrClientInitializeNew(
@@ -227,21 +227,21 @@ void m_CtxHello(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           1);
-        
-        
+
+
         if(phContext != 0)
             {
             _Handle = NDRCContextBinding(( NDR_CCONTEXT  )phContext);;
-            
+
             }
         else
             {
             RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT);
             }
-        
+
         _StubMsg.BufferLength = 20U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         NdrClientContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_CCONTEXT  )phContext,
@@ -250,36 +250,36 @@ void m_CtxHello(
         for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.BufferLength; i++)
                printf("0x%x, ", buf[i] & 0x0FF);
         printf("\n\n");
-        
+
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
 
-void m_CtxClose( 
+void m_CtxClose(
     /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
     char *buf;
     int i;
-       
+
        printf("\n*******************************************************************\n");
        printf("**** CtxClose()                                                 ***\n");
        printf("*******************************************************************\n\n");
-       
+
     if(!pphContext)
         {
         RpcRaiseException(RPC_X_NULL_REF_POINTER);
@@ -291,50 +291,50 @@ void m_CtxClose(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           2);
-        
-        
+
+
         if(*pphContext != 0)
             {
             _Handle = NDRCContextBinding(( NDR_CCONTEXT  )*pphContext);;
-            
+
             }
-        
+
         _StubMsg.BufferLength = 20U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         NdrClientContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_CCONTEXT  )*pphContext,
                             0);
-        
+
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] );
-        
-        
+
+
       printf("Before NdrClientContextUnmarshall: Buflen=%d\nBuffer: ",  _StubMsg.BufferLength );
         for(buf = _StubMsg.Buffer, i = 0; i < _StubMsg.BufferLength; i++)
                printf("0x%x, ", buf[i] & 0x0FF);
         printf("\n\n");
-        
+
         NdrClientContextUnmarshall(
                               ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                               ( NDR_CCONTEXT __RPC_FAR * )pphContext,
                               _Handle);
-                            
+
+
                printf("\nNdrClientContextUnmarshall returned: handle=0x%p\n", *pphContext);
-               
-        
+
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
 int interactive = 0;
@@ -356,10 +356,10 @@ void main(int argc, char **argv)
        char *pszStringBinding = NULL;
        RPC_BINDING_HANDLE Handle =     0;
        char buffer[255];
-       
+
        int test_num = 0;
        int test_value = 31337;
-       
+
        if(argc<2)
        {
                printf("USAGE: client.exe <test_number> [test_value] [interactive]\n"
@@ -369,24 +369,24 @@ void main(int argc, char **argv)
                        "2. Context rundown routine");
                return;
        }
-       
+
        test_num = atoi(argv[1]);
        if(argc>2) test_value = atoi(argv[2]);
        if(argc>3) interactive = 1;
 
-       status = RpcStringBindingCompose(NULL, 
-               "ncacn_np", 
-               NULL, 
-               "\\pipe\\hello", 
-               NULL, 
+       status = RpcStringBindingCompose(NULL,
+               "ncacn_np",
+               NULL,
+               "\\pipe\\hello",
+               NULL,
                &pszStringBinding);
 
-       if (status) 
+       if (status)
        {
                printf("RpcStringBindingCompose %x\n", status);
                exit(status);
        }
-       
+
        status = RpcBindingFromStringBinding(pszStringBinding, &hBinding);
 
        if (status)
@@ -395,8 +395,8 @@ void main(int argc, char **argv)
                exit(status);
        }
 
-       RpcStringFree(&pszStringBinding); 
-       
+       RpcStringFree(&pszStringBinding);
+
        switch(test_num)
        {
        case 0:
@@ -417,10 +417,10 @@ void main(int argc, char **argv)
                {
                         printf("NDRCContextBinding(NULL) reported exception = %d\n", RpcExceptionCode());
                }
-               RpcEndExcept    
-               
+               RpcEndExcept
+
                m_CtxOpen2(&hContext, test_value);
-               
+
                /////////////////////////////////////////////////////////////////////////////////////////
                RpcTryExcept
                {
@@ -431,7 +431,7 @@ void main(int argc, char **argv)
                {
                         printf("NDRCContextMarshall(NULL) reported exception = %d\n", RpcExceptionCode());
                }
-               RpcEndExcept    
+               RpcEndExcept
                /////////////////////////////////////////////////////////////////////////////////////////
                break;
        case 2:
@@ -450,7 +450,7 @@ void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
 {
        return(malloc(len));
 }
+
 void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
 {
        free(ptr);
index f92edbe..3e6eee2 100644 (file)
@@ -9,8 +9,8 @@
  */
 /* Compiler settings for ctx.idl:
     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
-    error checks: allocation ref bounds_check enum stub_data 
-    VC __declspec() decoration level: 
+    error checks: allocation ref bounds_check enum stub_data
+    VC __declspec() decoration level:
          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
          DECLSPEC_UUID(), MIDL_INTERFACE()
 */
 #ifndef __ctx_h__
 #define __ctx_h__
 
-/* Forward Declarations */ 
+/* Forward Declarations */
 
 #ifdef __cplusplus
 extern "C"{
-#endif 
+#endif
 
 void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
-void __RPC_USER MIDL_user_free( void __RPC_FAR * ); 
+void __RPC_USER MIDL_user_free( void __RPC_FAR * );
 
 #ifndef __hello_INTERFACE_DEFINED__
 #define __hello_INTERFACE_DEFINED__
 
 /* interface hello */
-/* [implicit_handle][version][uuid] */ 
+/* [implicit_handle][version][uuid] */
 
 typedef long CTXTYPE;
 
 typedef /* [context_handle] */ CTXTYPE __RPC_FAR *PCTXTYPE;
 
-void CtxOpen( 
+void CtxOpen(
     /* [out] */ PCTXTYPE __RPC_FAR *pphContext,
     /* [in] */ long Value);
 
-void CtxHello( 
+void CtxHello(
     /* [in] */ PCTXTYPE phContext);
 
-void CtxClose( 
+void CtxClose(
     /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext);
 
 
index 69a8bd3..ae3cbc1 100644 (file)
@@ -9,8 +9,8 @@
  */
 /* Compiler settings for ctx.idl:
     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
-    error checks: allocation ref bounds_check enum stub_data 
-    VC __declspec() decoration level: 
+    error checks: allocation ref bounds_check enum stub_data
+    VC __declspec() decoration level:
          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
          DECLSPEC_UUID(), MIDL_INTERFACE()
 */
 
 #include "ctx.h"
 
-#define TYPE_FORMAT_STRING_SIZE   23                                
-#define PROC_FORMAT_STRING_SIZE   21                                
-#define TRANSMIT_AS_TABLE_SIZE    0            
-#define WIRE_MARSHAL_TABLE_SIZE   0            
+#define TYPE_FORMAT_STRING_SIZE   23
+#define PROC_FORMAT_STRING_SIZE   21
+#define TRANSMIT_AS_TABLE_SIZE    0
+#define WIRE_MARSHAL_TABLE_SIZE   0
 
 typedef struct _MIDL_TYPE_FORMAT_STRING
     {
@@ -45,7 +45,7 @@ typedef struct _MIDL_PROC_FORMAT_STRING
 extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
 extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
 
-#define GENERIC_BINDING_TABLE_SIZE   0            
+#define GENERIC_BINDING_TABLE_SIZE   0
 
 
 /* Standard interface: hello, ver. 1.0,
@@ -73,17 +73,17 @@ extern const MIDL_STUB_DESC hello_StubDesc;
 RPC_BINDING_HANDLE hello__MIDL_AutoBindHandle;
 
 
-void CtxOpen( 
+void CtxOpen(
     /* [out] */ PCTXTYPE __RPC_FAR *pphContext,
     /* [in] */ long Value)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
-    
+
     if(!pphContext)
         {
         RpcRaiseException(RPC_X_NULL_REF_POINTER);
@@ -95,48 +95,48 @@ void CtxOpen(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           0);
-        
-        
+
+
         _Handle = hBinding;
-        
-        
+
+
         _StubMsg.BufferLength = 4U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value;
-        
+
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
-        
+
         *pphContext = (void *)0;
         NdrClientContextUnmarshall(
                               ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                               ( NDR_CCONTEXT __RPC_FAR * )pphContext,
                               _Handle);
-        
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
 
-void CtxHello( 
+void CtxHello(
     /* [in] */ PCTXTYPE phContext)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
-    
+
     RpcTryFinally
         {
         NdrClientInitializeNew(
@@ -144,48 +144,48 @@ void CtxHello(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           1);
-        
-        
+
+
         if(phContext != 0)
             {
             _Handle = NDRCContextBinding(( NDR_CCONTEXT  )phContext);;
-            
+
             }
         else
             {
             RpcRaiseException(RPC_X_SS_IN_NULL_CONTEXT);
             }
-        
+
         _StubMsg.BufferLength = 20U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         NdrClientContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_CCONTEXT  )phContext,
                             1);
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
 
-void CtxClose( 
+void CtxClose(
     /* [out][in] */ PCTXTYPE __RPC_FAR *pphContext)
 {
 
     RPC_BINDING_HANDLE _Handle =       0;
-    
+
     RPC_MESSAGE _RpcMessage;
-    
+
     MIDL_STUB_MESSAGE _StubMsg;
-    
+
     if(!pphContext)
         {
         RpcRaiseException(RPC_X_NULL_REF_POINTER);
@@ -197,43 +197,43 @@ void CtxClose(
                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                           ( PMIDL_STUB_DESC  )&hello_StubDesc,
                           2);
-        
-        
+
+
         if(*pphContext != 0)
             {
             _Handle = NDRCContextBinding(( NDR_CCONTEXT  )*pphContext);;
-            
+
             }
-        
+
         _StubMsg.BufferLength = 20U;
         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
-        
+
         NdrClientContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_CCONTEXT  )*pphContext,
                             0);
         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
-        
+
         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] );
-        
+
         NdrClientContextUnmarshall(
                               ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                               ( NDR_CCONTEXT __RPC_FAR * )pphContext,
                               _Handle);
-        
+
         }
     RpcFinally
         {
         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
-        
+
         }
     RpcEndFinally
-    
+
 }
 
 
-const MIDL_STUB_DESC hello_StubDesc = 
+const MIDL_STUB_DESC hello_StubDesc =
     {
     (void __RPC_FAR *)& hello___RpcClientInterface,
     MIDL_user_allocate,
@@ -265,7 +265,7 @@ const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
     {
         0,
         {
-                       
+
                        0x51,           /* FC_OUT_PARAM */
 #ifndef _ALPHA_
                        0x1,            /* x86, MIPS & PPC stack size = 1 */
@@ -277,7 +277,7 @@ const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
                        0x8,            /* FC_LONG */
 /*  6 */       0x5b,           /* FC_END */
                        0x5c,           /* FC_PAD */
-/*  8 */       
+/*  8 */
                        0x4d,           /* FC_IN_PARAM */
 #ifndef _ALPHA_
                        0x1,            /* x86, MIPS & PPC stack size = 1 */
@@ -287,7 +287,7 @@ const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
 /* 10 */       NdrFcShort( 0xa ),      /* Type Offset=10 */
 /* 12 */       0x5b,           /* FC_END */
                        0x5c,           /* FC_PAD */
-/* 14 */       
+/* 14 */
                        0x50,           /* FC_IN_OUT_PARAM */
 #ifndef _ALPHA_
                        0x1,            /* x86, MIPS & PPC stack size = 1 */
@@ -307,7 +307,7 @@ const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
         0,
         {
                        NdrFcShort( 0x0 ),      /* 0 */
-/*  2 */       
+/*  2 */
                        0x11, 0x0,      /* FC_RP */
 /*  4 */       NdrFcShort( 0x2 ),      /* Offset= 2 (6) */
 /*  6 */       0x30,           /* FC_BIND_CONTEXT */
@@ -318,7 +318,7 @@ const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
                        0x41,           /* Ctxt flags:  in, can't be null */
 /* 12 */       0x0,            /* 0 */
                        0x0,            /* 0 */
-/* 14 */       
+/* 14 */
                        0x11, 0x0,      /* FC_RP */
 /* 16 */       NdrFcShort( 0x2 ),      /* Offset= 2 (18) */
 /* 18 */       0x30,           /* FC_BIND_CONTEXT */
index 81e610c..2c76871 100644 (file)
@@ -9,8 +9,8 @@
  */
 /* Compiler settings for ctx.idl:
     Os (OptLev=s), W1, Zp8, env=Win32 (32b run), ms_ext, c_ext
-    error checks: allocation ref bounds_check enum stub_data 
-    VC __declspec() decoration level: 
+    error checks: allocation ref bounds_check enum stub_data
+    VC __declspec() decoration level:
          __declspec(uuid()), __declspec(selectany), __declspec(novtable)
          DECLSPEC_UUID(), MIDL_INTERFACE()
 */
 #include <string.h>
 #include "ctx.h"
 
-#define TYPE_FORMAT_STRING_SIZE   23                                
-#define PROC_FORMAT_STRING_SIZE   21                                
-#define TRANSMIT_AS_TABLE_SIZE    0            
-#define WIRE_MARSHAL_TABLE_SIZE   0            
+#define TYPE_FORMAT_STRING_SIZE   23
+#define PROC_FORMAT_STRING_SIZE   21
+#define TRANSMIT_AS_TABLE_SIZE    0
+#define WIRE_MARSHAL_TABLE_SIZE   0
 
 typedef struct _MIDL_TYPE_FORMAT_STRING
     {
@@ -70,13 +70,13 @@ hello_CtxOpen(
     MIDL_STUB_MESSAGE _StubMsg;
     NDR_SCONTEXT pphContext;
     RPC_STATUS _Status;
-    
+
     ((void)(_Status));
     NdrServerInitializeNew(
                           _pRpcMessage,
                           &_StubMsg,
                           &hello_StubDesc);
-    
+
     ( PCTXTYPE __RPC_FAR * )pphContext = 0;
     RpcTryFinally
         {
@@ -84,9 +84,9 @@ hello_CtxOpen(
             {
             if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
-            
+
             Value = *(( long __RPC_FAR * )_StubMsg.Buffer)++;
-            
+
             if(_StubMsg.Buffer > _StubMsg.BufferEnd)
                 {
                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
@@ -97,33 +97,33 @@ hello_CtxOpen(
             RpcRaiseException(RPC_X_BAD_STUB_DATA);
             }
         RpcEndExcept
-        pphContext = NDRSContextUnmarshall( (char *)0, _pRpcMessage->DataRepresentation ); 
-        
-        
+        pphContext = NDRSContextUnmarshall( (char *)0, _pRpcMessage->DataRepresentation );
+
+
         CtxOpen(( PCTXTYPE __RPC_FAR * )NDRSContextValue(pphContext),Value);
-        
+
         _StubMsg.BufferLength = 20U;
         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
-        
-        _Status = I_RpcGetBuffer( _pRpcMessage ); 
+
+        _Status = I_RpcGetBuffer( _pRpcMessage );
         if ( _Status )
             RpcRaiseException( _Status );
-        
+
         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
-        
+
         NdrServerContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_SCONTEXT  )pphContext,
                             ( NDR_RUNDOWN  )PCTXTYPE_rundown);
-        
+
         }
     RpcFinally
         {
         }
     RpcEndFinally
-    _pRpcMessage->BufferLength = 
+    _pRpcMessage->BufferLength =
         (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer);
-    
+
 }
 
 void __RPC_STUB
@@ -133,22 +133,22 @@ hello_CtxHello(
     MIDL_STUB_MESSAGE _StubMsg;
     NDR_SCONTEXT phContext;
     RPC_STATUS _Status;
-    
+
     ((void)(_Status));
     NdrServerInitializeNew(
                           _pRpcMessage,
                           &_StubMsg,
                           &hello_StubDesc);
-    
+
     RpcTryFinally
         {
         RpcTryExcept
             {
             if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
-            
+
             phContext = NdrServerContextUnmarshall(( PMIDL_STUB_MESSAGE  )&_StubMsg);
-            
+
             if(_StubMsg.Buffer > _StubMsg.BufferEnd)
                 {
                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
@@ -159,17 +159,17 @@ hello_CtxHello(
             RpcRaiseException(RPC_X_BAD_STUB_DATA);
             }
         RpcEndExcept
-        
+
         CtxHello(( PCTXTYPE  )*NDRSContextValue(phContext));
-        
+
         }
     RpcFinally
         {
         }
     RpcEndFinally
-    _pRpcMessage->BufferLength = 
+    _pRpcMessage->BufferLength =
         (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer);
-    
+
 }
 
 void __RPC_STUB
@@ -179,13 +179,13 @@ hello_CtxClose(
     MIDL_STUB_MESSAGE _StubMsg;
     NDR_SCONTEXT pphContext;
     RPC_STATUS _Status;
-    
+
     ((void)(_Status));
     NdrServerInitializeNew(
                           _pRpcMessage,
                           &_StubMsg,
                           &hello_StubDesc);
-    
+
     ( PCTXTYPE __RPC_FAR * )pphContext = 0;
     RpcTryFinally
         {
@@ -193,9 +193,9 @@ hello_CtxClose(
             {
             if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[14] );
-            
+
             pphContext = NdrServerContextUnmarshall(( PMIDL_STUB_MESSAGE  )&_StubMsg);
-            
+
             if(_StubMsg.Buffer > _StubMsg.BufferEnd)
                 {
                 RpcRaiseException(RPC_X_BAD_STUB_DATA);
@@ -206,35 +206,35 @@ hello_CtxClose(
             RpcRaiseException(RPC_X_BAD_STUB_DATA);
             }
         RpcEndExcept
-        
+
         CtxClose(( PCTXTYPE __RPC_FAR * )NDRSContextValue(pphContext));
-        
+
         _StubMsg.BufferLength = 20U;
         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
-        
-        _Status = I_RpcGetBuffer( _pRpcMessage ); 
+
+        _Status = I_RpcGetBuffer( _pRpcMessage );
         if ( _Status )
             RpcRaiseException( _Status );
-        
+
         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
-        
+
         NdrServerContextMarshall(
                             ( PMIDL_STUB_MESSAGE  )&_StubMsg,
                             ( NDR_SCONTEXT  )pphContext,
                             ( NDR_RUNDOWN  )PCTXTYPE_rundown);
-        
+
         }
     RpcFinally
         {
         }
     RpcEndFinally
-    _pRpcMessage->BufferLength = 
+    _pRpcMessage->BufferLength =
         (unsigned int)(_StubMsg.Buffer - (unsigned char __RPC_FAR *)_pRpcMessage->Buffer);
-    
+
 }
 
 
-static const MIDL_STUB_DESC hello_StubDesc = 
+static const MIDL_STUB_DESC hello_StubDesc =
     {
     (void __RPC_FAR *)& hello___RpcServerInterface,
     MIDL_user_allocate,
@@ -265,7 +265,7 @@ static RPC_DISPATCH_FUNCTION hello_table[] =
     hello_CtxClose,
     0
     };
-RPC_DISPATCH_TABLE hello_v1_0_DispatchTable = 
+RPC_DISPATCH_TABLE hello_v1_0_DispatchTable =
     {
     3,
     hello_table
@@ -279,7 +279,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
     {
         0,
         {
-                       
+
                        0x51,           /* FC_OUT_PARAM */
 #ifndef _ALPHA_
                        0x1,            /* x86, MIPS & PPC stack size = 1 */
@@ -291,7 +291,7 @@ static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
                        0x8,            /* FC_LONG */
 /*  6 */       0x5b,           /* FC_END */
                        0x5c,           /* FC_PAD */
-/*  8 */       
+/*  8 */
                        0x4d,           /* FC_IN_PARAM */
 #ifndef _ALPHA_
                        0x1,      &