- Add missing svn:eol-style properties.
authorDmitry Gorbachev <gorbachev@reactos.org>
Wed, 28 Oct 2009 20:13:23 +0000 (20:13 +0000)
committerDmitry Gorbachev <gorbachev@reactos.org>
Wed, 28 Oct 2009 20:13:23 +0000 (20:13 +0000)
- Use consistent newline style.
- Update file COPYING.

svn path=/trunk/; revision=43817

13 files changed:
rostests/COPYING [moved from rostests/copying with 95% similarity]
rostests/dxtest/ddraw/ddraw.rbuild
rostests/dxtest/win32kdxtest/NtGdiDdCanCreateSurface.c
rostests/dxtest/win32kdxtest/NtGdiDdGetScanLine.c
rostests/dxtest/win32kdxtest/NtGdiDdWaitForVerticalBlank.c
rostests/tests/Imagelistviewer/imagelistviewer.rbuild
rostests/tests/Imagelistviewer/main.c
rostests/tests/Imagelistviewer/resource.h
rostests/tests/readconsole/main.c
rostests/win32/user32/kbdlayout/kbdlayout.c
rostests/win32/user32/kbdlayout/kbdlayout.rbuild
rostests/win32/user32/kbdlayout/resource.h
rostests/winetests/rpcrt4/warningfix.diff

similarity index 95%
rename from rostests/copying
rename to rostests/COPYING
index dc63aac..d159169 100644 (file)
@@ -1,13 +1,12 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                          675 Mass Ave, Cambridge, MA 02139, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                           Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -56,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -111,7 +110,7 @@ above, provided that you also meet all of these conditions:
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-\f
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -169,7 +168,7 @@ access to copy from a designated place, then offering equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-\f
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -226,7 +225,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-\f
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -256,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -278,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
-\f
-       Appendix: How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -292,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
 the "copyright" line and a pointer to where the full notice is found.
 
     <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
+    Copyright (C) <year>  <name of author>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -304,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
 If the program is interactive, make it output a short notice like this
 when it starts in an interactive mode:
 
-    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision version 69, Copyright (C) year name of author
     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@ necessary.  Here is a sample; alter the names:
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
index ba4507e..d4b66fe 100644 (file)
@@ -1,12 +1,12 @@
-<module name="ddraw_test" type="win32cui" allowwarnings="false">\r
-       <include base="ddraw_test">.</include>\r
-       <library>kernel32</library>\r
-       <library>user32</library>\r
-       <library>gdi32</library>\r
-       <library>ole32</library>\r
-       <library>ddraw</library>\r
-       <library>dxguid</library>\r
-       <file>ddraw_test.cpp</file>\r
-       <file>helper.cpp</file>\r
-       <file>testlist.cpp</file>\r
-</module>\r
+<module name="ddraw_test" type="win32cui" allowwarnings="false">
+       <include base="ddraw_test">.</include>
+       <library>kernel32</library>
+       <library>user32</library>
+       <library>gdi32</library>
+       <library>ole32</library>
+       <library>ddraw</library>
+       <library>dxguid</library>
+       <file>ddraw_test.cpp</file>
+       <file>helper.cpp</file>
+       <file>testlist.cpp</file>
+</module>
index bab5f4d..b183275 100644 (file)
@@ -1,45 +1,45 @@
-\r
-#include <stdio.h>\r
-/* SDK/DDK/NDK Headers. */\r
-#include <windows.h>\r
-#include <wingdi.h>\r
-#include <winddi.h>\r
-#include <d3dnthal.h>\r
-#include <dll/directx/d3d8thk.h>\r
-#include <ddrawi.h>\r
-#include "test.h"\r
-\r
-/*\r
- * Test see if we can delete a DirectDrawObject from win32k\r
- *\r
- */\r
-void\r
-test_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)\r
-{\r
-    int fails=0;\r
-    BOOL retValue=FALSE;\r
-    DDHAL_CANCREATESURFACEDATA pCanCreateSurface;\r
-    DDSURFACEDESC2 desc;\r
-\r
-    RtlZeroMemory(&pCanCreateSurface,sizeof(DDHAL_CANCREATESURFACEDATA));\r
-    RtlZeroMemory(&desc,sizeof(DDSURFACEDESC2));\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
-\r
-    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,NULL);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdCanCreateSurface(hDirectDrawLocal,NULL);\0");\r
-\r
-    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");\r
-\r
-    pCanCreateSurface.lpDDSurfaceDesc = (DDSURFACEDESC*)&desc;\r
-    desc.dwSize = sizeof(DDSURFACEDESC2);\r
-\r
-    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"4. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");\r
-\r
-}\r
-\r
-\r
+
+#include <stdio.h>
+/* SDK/DDK/NDK Headers. */
+#include <windows.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <d3dnthal.h>
+#include <dll/directx/d3d8thk.h>
+#include <ddrawi.h>
+#include "test.h"
+
+/*
+ * Test see if we can delete a DirectDrawObject from win32k
+ *
+ */
+void
+test_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)
+{
+    int fails=0;
+    BOOL retValue=FALSE;
+    DDHAL_CANCREATESURFACEDATA pCanCreateSurface;
+    DDSURFACEDESC2 desc;
+
+    RtlZeroMemory(&pCanCreateSurface,sizeof(DDHAL_CANCREATESURFACEDATA));
+    RtlZeroMemory(&desc,sizeof(DDSURFACEDESC2));
+
+    /* crash in windows 2000 */
+    retValue = OsThunkDdCanCreateSurface(NULL,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdCanCreateSurface(NULL,NULL);\0");
+
+    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdCanCreateSurface(hDirectDrawLocal,NULL);\0");
+
+    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");
+
+    pCanCreateSurface.lpDDSurfaceDesc = (DDSURFACEDESC*)&desc;
+    desc.dwSize = sizeof(DDSURFACEDESC2);
+
+    retValue = OsThunkDdCanCreateSurface(hDirectDrawLocal,(PDD_CANCREATESURFACEDATA)&pCanCreateSurface);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"4. NtGdiDdCanCreateSurface(hDirectDrawLocal,pCanCreateSurface);\0");
+
+}
+
+
index cc13bdb..b536782 100644 (file)
@@ -1,40 +1,40 @@
-#include <stdio.h>\r
-/* SDK/DDK/NDK Headers. */\r
-#include <windows.h>\r
-#include <wingdi.h>\r
-#include <winddi.h>\r
-#include <d3dnthal.h>\r
-#include <dll/directx/d3d8thk.h>\r
-#include "test.h"\r
-\r
-/*\r
- * Test see if we can delete a DirectDrawObject from win32k\r
- *\r
- */\r
-void\r
-test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)\r
-{\r
-    int fails=0;\r
-    BOOL retValue=FALSE;\r
-    DD_GETSCANLINEDATA puGetScanLineData;\r
-\r
-    printf("Start testing of NtGdiDdGetScanLine\n");\r
-    RtlZeroMemory(&puGetScanLineData,sizeof(DD_GETSCANLINEDATA));\r
-\r
-    retValue = OsThunkDdGetScanLine(NULL,NULL);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdGetScanLine(NULL,NULL);\0");\r
-\r
-    retValue = OsThunkDdGetScanLine(hDirectDrawLocal,NULL);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdGetScanLine(hDirectDrawLocal,NULL);\0");\r
-\r
-    puGetScanLineData.ddRVal = DDERR_GENERIC;\r
-    retValue = OsThunkDdGetScanLine(hDirectDrawLocal,&puGetScanLineData);\r
-    testing_eq(retValue,DDHAL_DRIVER_NOTHANDLED,fails,"3. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");\r
-    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
-    /* FIXME DDERR_VERTICALBLANKINPROGRESS test */\r
-\r
-    show_status(fails, "NtGdiDdGetScanLine\0");\r
-}\r
+#include <stdio.h>
+/* SDK/DDK/NDK Headers. */
+#include <windows.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <d3dnthal.h>
+#include <dll/directx/d3d8thk.h>
+#include "test.h"
+
+/*
+ * Test see if we can delete a DirectDrawObject from win32k
+ *
+ */
+void
+test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)
+{
+    int fails=0;
+    BOOL retValue=FALSE;
+    DD_GETSCANLINEDATA puGetScanLineData;
+
+    printf("Start testing of NtGdiDdGetScanLine\n");
+    RtlZeroMemory(&puGetScanLineData,sizeof(DD_GETSCANLINEDATA));
+
+    retValue = OsThunkDdGetScanLine(NULL,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdGetScanLine(NULL,NULL);\0");
+
+    retValue = OsThunkDdGetScanLine(hDirectDrawLocal,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdGetScanLine(hDirectDrawLocal,NULL);\0");
+
+    puGetScanLineData.ddRVal = DDERR_GENERIC;
+    retValue = OsThunkDdGetScanLine(hDirectDrawLocal,&puGetScanLineData);
+    testing_eq(retValue,DDHAL_DRIVER_NOTHANDLED,fails,"3. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
+    testing_noteq(puGetScanLineData.ddRVal,DD_OK,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
+    testing_eq(puGetScanLineData.dwScanLine,0,fails,"4. NtGdiDdGetScanLine(hDirectDrawLocal,puGetScanLineData);\0");
+
+
+    /* FIXME DDERR_VERTICALBLANKINPROGRESS test */
+
+    show_status(fails, "NtGdiDdGetScanLine\0");
+}
index 2f7eae7..22b2896 100644 (file)
@@ -1,46 +1,46 @@
-#include <stdio.h>\r
-/* SDK/DDK/NDK Headers. */\r
-#include <windows.h>\r
-#include <wingdi.h>\r
-#include <winddi.h>\r
-#include <d3dnthal.h>\r
-#include <dll/directx/d3d8thk.h>\r
-\r
-#include <ddrawi.h>\r
-#include "test.h"\r
-\r
-/*\r
- * Test see if we can delete a DirectDrawObject from win32k\r
- *\r
- */\r
-void\r
-test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)\r
-{\r
-    int fails=0;\r
-    BOOL retValue=FALSE;\r
-    DDHAL_WAITFORVERTICALBLANKDATA pDdWaitForVerticalBlankData;\r
-\r
-    RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));\r
-\r
-    retValue = OsThunkDdWaitForVerticalBlank(NULL,NULL);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdWaitForVerticalBlank(NULL,NULL);\0");\r
-\r
-    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");\r
-\r
-    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);\r
-    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");\r
-    testing_eq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"4. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");\r
-\r
-    RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));\r
-    pDdWaitForVerticalBlankData.dwFlags = DDWAITVB_I_TESTVB;\r
-    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);\r
-\r
-    testing_eq(retValue, DDHAL_DRIVER_NOTHANDLED,fails,"5. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");\r
-    testing_noteq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"6. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");\r
-\r
-    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);\r
-\r
-    show_status(fails, "NtGdiDdWaitForVerticalBlank\0");\r
-}\r
-\r
+#include <stdio.h>
+/* SDK/DDK/NDK Headers. */
+#include <windows.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <d3dnthal.h>
+#include <dll/directx/d3d8thk.h>
+
+#include <ddrawi.h>
+#include "test.h"
+
+/*
+ * Test see if we can delete a DirectDrawObject from win32k
+ *
+ */
+void
+test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)
+{
+    int fails=0;
+    BOOL retValue=FALSE;
+    DDHAL_WAITFORVERTICALBLANKDATA pDdWaitForVerticalBlankData;
+
+    RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));
+
+    retValue = OsThunkDdWaitForVerticalBlank(NULL,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"1. NtGdiDdWaitForVerticalBlank(NULL,NULL);\0");
+
+    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,NULL);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"2. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
+
+    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
+    testing_eq(retValue, DDHAL_DRIVER_HANDLED,fails,"3. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
+    testing_eq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"4. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
+
+    RtlZeroMemory(&pDdWaitForVerticalBlankData,sizeof(DDHAL_WAITFORVERTICALBLANKDATA));
+    pDdWaitForVerticalBlankData.dwFlags = DDWAITVB_I_TESTVB;
+    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
+
+    testing_eq(retValue, DDHAL_DRIVER_NOTHANDLED,fails,"5. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
+    testing_noteq(pDdWaitForVerticalBlankData.ddRVal, DD_OK,fails,"6. NtGdiDdWaitForVerticalBlank(hDirectDrawLocal,NULL);\0");
+
+    retValue = OsThunkDdWaitForVerticalBlank(hDirectDrawLocal,(PDD_WAITFORVERTICALBLANKDATA)&pDdWaitForVerticalBlankData);
+
+    show_status(fails, "NtGdiDdWaitForVerticalBlank\0");
+}
+
index 8dc1073..633413c 100644 (file)
@@ -1,9 +1,9 @@
-<module name="Imagelistviewer" type="win32gui" installbase="bin" installname="Imagelistviewer.exe">\r
-       <include base="Imagelistviewer">.</include>\r
-       <library>kernel32</library>\r
-       <library>user32</library>\r
-       <library>setupapi</library>\r
-       <library>comctl32</library>\r
-       <file>main.c</file>\r
-       <file>res.rc</file>\r
-</module>\r
+<module name="Imagelistviewer" type="win32gui" installbase="bin" installname="Imagelistviewer.exe">
+       <include base="Imagelistviewer">.</include>
+       <library>kernel32</library>
+       <library>user32</library>
+       <library>setupapi</library>
+       <library>comctl32</library>
+       <file>main.c</file>
+       <file>res.rc</file>
+</module>
index 741342e..f283290 100644 (file)
-#include <windows.h>\r
-#include <setupapi.h>\r
-#include <tchar.h>\r
-#include <stdlib.h>\r
-#include "resource.h"\r
-\r
-typedef BOOL (WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall);\r
-typedef BOOL (WINAPI * FII_PROC)(BOOL fFullInit);\r
-\r
-/*** Shell32 undoc'd functions ***/\r
-  /* Shell_GetImageLists  @71  */\r
-  /* FileIconInit         @660 */\r
-\r
-BOOL\r
-DisplayImageList(HWND hwnd,\r
-                 UINT uID)\r
-{\r
-    HWND hLV;\r
-    SP_CLASSIMAGELIST_DATA ImageListData;\r
-    LV_ITEM lvItem;\r
-    TCHAR Buf[6];\r
-    INT ImageListCount = -1;\r
-    INT i = 0;\r
-\r
-    hLV = GetDlgItem(hwnd, IDC_LSTVIEW);\r
-    (void)ListView_DeleteAllItems(hLV);\r
-\r
-    if (uID == IDC_SYSTEM)\r
-    {\r
-        HIMAGELIST hLarge, hSmall;\r
-        HMODULE      hShell32;\r
-        SH_GIL_PROC  Shell_GetImageLists;\r
-        FII_PROC     FileIconInit;\r
-\r
-        hShell32 = LoadLibrary(_T("shell32.dll"));\r
-        if(hShell32 == NULL)\r
-            return FALSE;\r
-\r
-        Shell_GetImageLists = (SH_GIL_PROC)GetProcAddress(hShell32, (LPCSTR)71);\r
-        FileIconInit = (FII_PROC)GetProcAddress(hShell32, (LPCSTR)660);\r
-\r
-        if(Shell_GetImageLists == NULL || FileIconInit == NULL)\r
-        {\r
-            FreeLibrary(hShell32);\r
-            return FALSE;\r
-        }\r
-\r
-        FileIconInit(TRUE);\r
-\r
-        Shell_GetImageLists(&hLarge, &hSmall);\r
-\r
-        ImageListCount = ImageList_GetImageCount(hSmall);\r
-\r
-        (void)ListView_SetImageList(hLV,\r
-                                    hSmall,\r
-                                    LVSIL_SMALL);\r
-\r
-        FreeLibrary(hShell32);\r
-    }\r
-    else if (uID == IDC_DEVICE)\r
-    {\r
-        ImageListData.cbSize = sizeof(SP_CLASSIMAGELIST_DATA);\r
-        SetupDiGetClassImageList(&ImageListData);\r
-\r
-        ImageListCount = ImageList_GetImageCount(ImageListData.ImageList);\r
-\r
-        (void)ListView_SetImageList(hLV,\r
-                                    ImageListData.ImageList,\r
-                                    LVSIL_SMALL);\r
-    }\r
-    else\r
-        return FALSE;\r
-\r
-    lvItem.mask = LVIF_TEXT | LVIF_IMAGE;\r
-\r
-    while (i <= ImageListCount)\r
-    {\r
-        lvItem.iItem = i;\r
-        lvItem.iSubItem = 0;\r
-        lvItem.pszText = _itot(i, Buf, 10);\r
-        lvItem.iImage = i;\r
-\r
-        (void)ListView_InsertItem(hLV, &lvItem);\r
-\r
-        i++;\r
-    }\r
-\r
-    return TRUE;\r
-}\r
-\r
-\r
-BOOL CALLBACK\r
-DlgProc(HWND hwnd,\r
-        UINT message,\r
-        WPARAM wParam,\r
-        LPARAM lParam)\r
-{\r
-    switch (message)\r
-    {\r
-        case WM_INITDIALOG:\r
-            DisplayImageList(hwnd, IDC_SYSTEM);\r
-            return TRUE;\r
-\r
-        case WM_CLOSE:\r
-            EndDialog(hwnd, 0);\r
-            return TRUE;\r
-\r
-        case WM_COMMAND:\r
-        {\r
-            switch(LOWORD(wParam))\r
-            {\r
-                case IDOK:\r
-                    EndDialog(hwnd, 0);\r
-                    return TRUE;\r
-\r
-                case IDC_SYSTEM:\r
-                    DisplayImageList(hwnd, IDC_SYSTEM);\r
-                    return TRUE;\r
-\r
-                case IDC_DEVICE:\r
-                    DisplayImageList(hwnd, IDC_DEVICE);\r
-                    return TRUE;\r
-            }\r
-        }\r
-    }\r
-\r
-    return FALSE;\r
-}\r
-\r
-int WINAPI\r
-WinMain(HINSTANCE hThisInstance,\r
-        HINSTANCE hPrevInstance,\r
-        LPSTR lpszArgument,\r
-        int nCmdShow)\r
-{\r
-    INITCOMMONCONTROLSEX icex;\r
-\r
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);\r
-    icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;\r
-    InitCommonControlsEx(&icex);\r
-\r
-    return DialogBox(hThisInstance,\r
-                     MAKEINTRESOURCE(IDD_IMGLST),\r
-                     NULL,\r
-                     (DLGPROC)DlgProc);\r
-}\r
+#include <windows.h>
+#include <setupapi.h>
+#include <tchar.h>
+#include <stdlib.h>
+#include "resource.h"
+
+typedef BOOL (WINAPI * SH_GIL_PROC)(HIMAGELIST *phLarge, HIMAGELIST *phSmall);
+typedef BOOL (WINAPI * FII_PROC)(BOOL fFullInit);
+
+/*** Shell32 undoc'd functions ***/
+  /* Shell_GetImageLists  @71  */
+  /* FileIconInit         @660 */
+
+BOOL
+DisplayImageList(HWND hwnd,
+                 UINT uID)
+{
+    HWND hLV;
+    SP_CLASSIMAGELIST_DATA ImageListData;
+    LV_ITEM lvItem;
+    TCHAR Buf[6];
+    INT ImageListCount = -1;
+    INT i = 0;
+
+    hLV = GetDlgItem(hwnd, IDC_LSTVIEW);
+    (void)ListView_DeleteAllItems(hLV);
+
+    if (uID == IDC_SYSTEM)
+    {
+        HIMAGELIST hLarge, hSmall;
+        HMODULE      hShell32;
+        SH_GIL_PROC  Shell_GetImageLists;
+        FII_PROC     FileIconInit;
+
+        hShell32 = LoadLibrary(_T("shell32.dll"));
+        if(hShell32 == NULL)
+            return FALSE;
+
+        Shell_GetImageLists = (SH_GIL_PROC)GetProcAddress(hShell32, (LPCSTR)71);
+        FileIconInit = (FII_PROC)GetProcAddress(hShell32, (LPCSTR)660);
+
+        if(Shell_GetImageLists == NULL || FileIconInit == NULL)
+        {
+            FreeLibrary(hShell32);
+            return FALSE;
+        }
+
+        FileIconInit(TRUE);
+
+        Shell_GetImageLists(&hLarge, &hSmall);
+
+        ImageListCount = ImageList_GetImageCount(hSmall);
+
+        (void)ListView_SetImageList(hLV,
+                                    hSmall,
+                                    LVSIL_SMALL);
+
+        FreeLibrary(hShell32);
+    }
+    else if (uID == IDC_DEVICE)
+    {
+        ImageListData.cbSize = sizeof(SP_CLASSIMAGELIST_DATA);
+        SetupDiGetClassImageList(&ImageListData);
+
+        ImageListCount = ImageList_GetImageCount(ImageListData.ImageList);
+
+        (void)ListView_SetImageList(hLV,
+                                    ImageListData.ImageList,
+                                    LVSIL_SMALL);
+    }
+    else
+        return FALSE;
+
+    lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
+
+    while (i <= ImageListCount)
+    {
+        lvItem.iItem = i;
+        lvItem.iSubItem = 0;
+        lvItem.pszText = _itot(i, Buf, 10);
+        lvItem.iImage = i;
+
+        (void)ListView_InsertItem(hLV, &lvItem);
+
+        i++;
+    }
+
+    return TRUE;
+}
+
+
+BOOL CALLBACK
+DlgProc(HWND hwnd,
+        UINT message,
+        WPARAM wParam,
+        LPARAM lParam)
+{
+    switch (message)
+    {
+        case WM_INITDIALOG:
+            DisplayImageList(hwnd, IDC_SYSTEM);
+            return TRUE;
+
+        case WM_CLOSE:
+            EndDialog(hwnd, 0);
+            return TRUE;
+
+        case WM_COMMAND:
+        {
+            switch(LOWORD(wParam))
+            {
+                case IDOK:
+                    EndDialog(hwnd, 0);
+                    return TRUE;
+
+                case IDC_SYSTEM:
+                    DisplayImageList(hwnd, IDC_SYSTEM);
+                    return TRUE;
+
+                case IDC_DEVICE:
+                    DisplayImageList(hwnd, IDC_DEVICE);
+                    return TRUE;
+            }
+        }
+    }
+
+    return FALSE;
+}
+
+int WINAPI
+WinMain(HINSTANCE hThisInstance,
+        HINSTANCE hPrevInstance,
+        LPSTR lpszArgument,
+        int nCmdShow)
+{
+    INITCOMMONCONTROLSEX icex;
+
+    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+    icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
+    InitCommonControlsEx(&icex);
+
+    return DialogBox(hThisInstance,
+                     MAKEINTRESOURCE(IDD_IMGLST),
+                     NULL,
+                     (DLGPROC)DlgProc);
+}
index 6875d1d..aa606bf 100644 (file)
@@ -1,4 +1,4 @@
-#define IDD_IMGLST  1000\r
-#define IDC_LSTVIEW 1001\r
-#define IDC_SYSTEM  1002\r
-#define IDC_DEVICE  1003\r
+#define IDD_IMGLST  1000
+#define IDC_LSTVIEW 1001
+#define IDC_SYSTEM  1002
+#define IDC_DEVICE  1003
index bc33134..0eb98f9 100644 (file)
@@ -1,33 +1,33 @@
-#include <stdio.h>\r
-#include <tchar.h>\r
-#include <windows.h>\r
-\r
-int main()\r
-{\r
-    TCHAR Buffer = 0;\r
-    DWORD Count = 0;\r
-\r
-    //\r
-    // We clear the mode, most importantly turn off ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT\r
-    // This is the same mode as that is set up by getch() when trying to get a char\r
-    //\r
-    SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),0);\r
-\r
-    //\r
-    // We read one char from the input and then return\r
-    //\r
-    ReadConsole(GetStdHandle(STD_INPUT_HANDLE),&Buffer,1,&Count,NULL);\r
-\r
-    //\r
-    // We print out this char as an int to show that infact a backspace does count as input\r
-    //\r
-    _tprintf(TEXT("You printed %c :: "), Buffer);\r
-    _tprintf(TEXT("With a value %d :: "), Buffer);\r
-    _tprintf(TEXT("Number of chars recieved %lu :: "), Count);\r
-    _tprintf(TEXT("Char equal to backspace %d \n"), (Buffer == TEXT('\b')));\r
-\r
-    //\r
-    // :)\r
-    //\r
-    return 0;\r
-}\r
+#include <stdio.h>
+#include <tchar.h>
+#include <windows.h>
+
+int main()
+{
+    TCHAR Buffer = 0;
+    DWORD Count = 0;
+
+    //
+    // We clear the mode, most importantly turn off ENABLE_ECHO_INPUT and ENABLE_LINE_INPUT
+    // This is the same mode as that is set up by getch() when trying to get a char
+    //
+    SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),0);
+
+    //
+    // We read one char from the input and then return
+    //
+    ReadConsole(GetStdHandle(STD_INPUT_HANDLE),&Buffer,1,&Count,NULL);
+
+    //
+    // We print out this char as an int to show that infact a backspace does count as input
+    //
+    _tprintf(TEXT("You printed %c :: "), Buffer);
+    _tprintf(TEXT("With a value %d :: "), Buffer);
+    _tprintf(TEXT("Number of chars recieved %lu :: "), Count);
+    _tprintf(TEXT("Char equal to backspace %d \n"), (Buffer == TEXT('\b')));
+
+    //
+    // :)
+    //
+    return 0;
+}
index 58e7bbb..28dc32f 100644 (file)
-/*\r
- * PROJECT:         ReactOS\r
- * LICENSE:         GPL - See COPYING in the top level directory\r
- * FILE:            base/applications/testset/user32/kbdlayout/kbdlayout.c\r
- * PURPOSE:         Keyboard layout testapp\r
- * COPYRIGHT:       Copyright 2007 Saveliy Tretiakov\r
- */\r
-\r
-#define UNICODE\r
-#include<wchar.h>\r
-#include <windows.h>\r
-#include "resource.h"\r
-\r
-\r
-\r
-LRESULT MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);\r
-\r
-\r
-HINSTANCE hInst;\r
-HWND hMainDlg;\r
-\r
-\r
-typedef struct {\r
-       WNDPROC OrigProc;\r
-       WCHAR WndName[25];\r
-} WND_DATA;\r
-\r
-DWORD WINAPI ThreadProc(LPVOID lpParam)\r
-{\r
-\r
-       DialogBoxParam(hInst,\r
-               MAKEINTRESOURCE(IDD_MAINDIALOG),\r
-               NULL,\r
-               (DLGPROC)MainDialogProc,\r
-               (LPARAM)NULL);\r
-\r
-       return 0;\r
-}\r
-\r
-INT WINAPI WinMain(HINSTANCE hInstance,\r
-    HINSTANCE hPrevInstance,\r
-    LPSTR lpCmdLine,\r
-    int nCmdShow)\r
-{\r
-\r
-\r
-       hInst = hInstance;\r
-\r
-       ThreadProc(0);\r
-\r
-       return 0;\r
-}\r
-\r
-\r
-int GetKlList(HKL **list)\r
-{\r
-       HKL *ret;\r
-       int n;\r
-\r
-       n = GetKeyboardLayoutList(0, NULL);\r
-       ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HKL)*n);\r
-       GetKeyboardLayoutList(n, ret);\r
-       *list = ret;\r
-       return n;\r
-}\r
-\r
-void FreeKlList(HKL *list)\r
-{\r
-       HeapFree(GetProcessHeap(), 0, list);\r
-}\r
-\r
-\r
-void UpdateData(HWND hDlg)\r
-{\r
-       WCHAR buf[KL_NAMELENGTH];\r
-       WCHAR buf2[512];\r
-\r
-       HWND hList;\r
-       HKL *klList, hKl;\r
-       int n, i,j;\r
-\r
-       GetKeyboardLayoutName(buf);\r
-       swprintf(buf2, L"Active: %s (%x)", buf, GetKeyboardLayout(0));\r
-       SetWindowText(GetDlgItem(hDlg, IDC_ACTIVE), buf2);\r
-\r
-       hList = GetDlgItem(hDlg, IDC_LIST);\r
-       SendMessage(hList, LB_RESETCONTENT, 0, 0);\r
-\r
-       n = GetKlList(&klList);\r
-       hKl = GetKeyboardLayout(0);\r
-       for(i = 0; i < n; i++)\r
-       {\r
-               swprintf(buf, L"%x", klList[i] );\r
-               j = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM) buf);\r
-               SendMessage(hList, LB_SETITEMDATA, j, (LPARAM) klList[i]);\r
-               if(klList[i] == hKl) SendMessage(hList, LB_SETCURSEL, j, 0);\r
-       }\r
-\r
-       FreeKlList(klList);\r
-}\r
-\r
-void FormatMsg(WCHAR *format, ...)\r
-{\r
-       WCHAR buf[255];\r
-       va_list argptr;\r
-       va_start(argptr, format);\r
-       _vsnwprintf(buf, sizeof(buf)-1, format, argptr);\r
-       MessageBox(0, buf, L"msg", 0);\r
-       va_end(argptr);\r
-}\r
-\r
-void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format, ...)\r
-{\r
-       WCHAR buf[255];\r
-       va_list argptr;\r
-       va_start(argptr, Format);\r
-       _vsnwprintf(buf, sizeof(buf)-1, Format, argptr);\r
-       MessageBox(hWnd, buf, Caption, Flags);\r
-       va_end(argptr);\r
-}\r
-\r
-\r
-LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-{\r
-       WND_DATA *data = (WND_DATA*)GetWindowLong(hwnd, GWL_USERDATA);\r
-\r
-       if(uMsg == WM_INPUTLANGCHANGE)\r
-       {\r
-               FormatMsg(L"%s: WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", data->WndName, lParam, wParam);\r
-               UpdateData(hMainDlg);\r
-               //Pass message to defwindowproc\r
-       }\r
-       else if(uMsg == WM_INPUTLANGCHANGEREQUEST)\r
-       {\r
-               FormatMsg(L"%s: WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", data->WndName, lParam, wParam);\r
-               UpdateData(hMainDlg);\r
-               //Pass message to defwindowproc\r
-       }\r
-\r
-       return ( CallWindowProc( data->OrigProc, hwnd, uMsg, wParam, lParam) );\r
-}\r
-\r
-void SubclassWnd(HWND hWnd, WCHAR* Name)\r
-{\r
-       WND_DATA *data = HeapAlloc(GetProcessHeap(), 0, sizeof(WND_DATA));\r
-       data->OrigProc = (WNDPROC)SetWindowLong( hWnd, GWL_WNDPROC, (LONG)WndSubclassProc);\r
-       wcsncpy(data->WndName, Name, 25);\r
-       SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);\r
-       return;\r
-}\r
-\r
-DWORD GetActivateFlags(HWND hDlg)\r
-{\r
-       DWORD ret = 0;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDC_KLF_REORDER))\r
-               ret |= KLF_REORDER;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDC_KLF_RESET))\r
-               ret |= KLF_RESET;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDC_KLF_SHIFTLOCK))\r
-               ret |= KLF_SHIFTLOCK;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDC_KLF_SETFORPROCESS))\r
-               ret |= KLF_SETFORPROCESS;\r
-\r
-       return ret;\r
-\r
-}\r
-\r
-DWORD GetLoadFlags(HWND hDlg)\r
-{\r
-       DWORD ret = 0;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_ACTIVATE))\r
-               ret |= KLF_ACTIVATE;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_NOTELLSHELL))\r
-               ret |= KLF_NOTELLSHELL;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_REORDER))\r
-               ret |= KLF_REORDER;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_REPLACELANG))\r
-               ret |= KLF_REPLACELANG;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_SUBSTITUTE_OK))\r
-               ret |= KLF_SUBSTITUTE_OK;\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDL_KLF_SETFORPROCESS))\r
-               ret |= KLF_SETFORPROCESS;\r
-\r
-       return ret;\r
-}\r
-\r
-UINT GetDelayMilliseconds(HWND hDlg)\r
-{\r
-       WCHAR Buf[255];\r
-       UINT ret;\r
-\r
-       GetWindowText(GetDlgItem(hDlg, IDC_DELAY), Buf, sizeof(Buf));\r
-\r
-       swscanf(Buf, L"%d", &ret);\r
-\r
-       return ret*1000;\r
-}\r
-\r
-HKL GetSelectedLayout(HWND hDlg)\r
-{\r
-       int n;\r
-       HWND hList;\r
-       hList = GetDlgItem(hDlg, IDC_LIST);\r
-       if((n = SendMessage(hList, LB_GETCURSEL, 0, 0)) != LB_ERR)\r
-               return (HKL) SendMessage(hList, LB_GETITEMDATA, n, 0);\r
-       else return INVALID_HANDLE_VALUE;\r
-}\r
-\r
-HKL GetActivateHandle(HWND hDlg)\r
-{\r
-\r
-       if(IsDlgButtonChecked(hDlg, IDC_FROMLIST))\r
-               return GetSelectedLayout(hDlg);\r
-       else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))\r
-               return (HKL)HKL_NEXT;\r
-\r
-       return (HKL)HKL_PREV;\r
-\r
-}\r
-\r
-\r
-/***************************************************\r
- * MainDialogProc                                  *\r
- ***************************************************/\r
-\r
-LRESULT MainDialogProc(HWND hDlg,\r
-       UINT Msg,\r
-       WPARAM wParam,\r
-       LPARAM lParam)\r
-{\r
-       HKL hKl;\r
-\r
-       switch (Msg)\r
-       {\r
-               case WM_INITDIALOG:\r
-               {\r
-                       WCHAR Buf[255];\r
-                       UpdateData(hDlg);\r
-                       hMainDlg = hDlg;\r
-\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_LIST), L"List");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_EDIT1), L"Edit1");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_KLID), L"Klid");\r
-                       SubclassWnd(GetDlgItem(hDlg, ID_CANCEL), L"CancelB");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_ACTIVATE), L"ActivateB");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_REFRESH), L"RefreshB");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_UNLOAD), L"UnloadB");\r
-                       SubclassWnd(GetDlgItem(hDlg, IDC_LOAD), L"LoadB");\r
-\r
-                       CheckRadioButton(hDlg, IDC_FROMLIST, IDC_FROMEDIT, IDC_FROMLIST);\r
-                       SetWindowText(GetDlgItem(hDlg, IDC_KLID), L"00000419");\r
-\r
-                       swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());\r
-                       SetWindowText(GetDlgItem(hDlg, IDC_CURTHREAD), Buf);\r
-\r
-                       SetWindowText(GetDlgItem(hDlg, IDC_DELAY), L"0");\r
-\r
-                       return 0;\r
-               } /* WM_INITDIALOG */\r
-\r
-               case WM_COMMAND:\r
-               {\r
-                       switch(LOWORD(wParam))\r
-                       {\r
-                               case ID_CANCEL:\r
-                               {\r
-                                       EndDialog(hDlg, ERROR_CANCELLED);\r
-                                       break;\r
-                               }\r
-\r
-                               case IDC_ACTIVATE:\r
-                               {\r
-                                       if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)\r
-                                       {\r
-                                               Sleep(GetDelayMilliseconds(hDlg));\r
-                                               if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))\r
-                                                       FormatBox(hDlg, MB_ICONERROR, L"Error",\r
-                                                               L"ActivateKeyboardLayout() failed. %d", GetLastError());\r
-                                               else UpdateData(hDlg);\r
-                                               //FormatBox(hDlg, 0, L"Activated", L"Prev - %x, err - %d.", hKl,\r
-                                               // GetLastError());\r
-                                       }\r
-                                       else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);\r
-                                       break;\r
-                               }\r
-\r
-                               case IDC_UNLOAD:\r
-                               {\r
-                                       if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)\r
-                                       {\r
-                                               Sleep(GetDelayMilliseconds(hDlg));\r
-                                               if(!UnloadKeyboardLayout(hKl))\r
-                                                       FormatBox(hDlg, MB_ICONERROR, L"Error",\r
-                                                               L"UnloadKeyboardLayout() failed. %d",\r
-                                                               GetLastError());\r
-                                               else UpdateData(hDlg);\r
-                                       }\r
-                                       else MessageBox(hDlg,  L"No item selected", L"Error", MB_ICONERROR);\r
-                                       break;\r
-                               }\r
-\r
-                               case IDC_LOAD:\r
-                               {\r
-                                       WCHAR buf[255];\r
-                                       GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));\r
-                                       Sleep(GetDelayMilliseconds(hDlg));\r
-                                       if(!LoadKeyboardLayout(buf, GetLoadFlags(hDlg)))\r
-                                               FormatBox(hDlg, MB_ICONERROR, L"Error",\r
-                                                       L"LoadKeyboardLayout() failed. %d",\r
-                                                       GetLastError());\r
-                                       else UpdateData(hDlg);\r
-                                       break;\r
-                               }\r
-\r
-                               case IDC_REFRESH:\r
-                               {\r
-                                       UpdateData(hDlg);\r
-                                       break;\r
-                               }\r
-\r
-                               case IDC_NEWTHREAD:\r
-                               {\r
-                                       if(!CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL))\r
-                                       {\r
-                                               FormatBox(hDlg, MB_ICONERROR, L"Error!",\r
-                                                       L"Can not create thread (%d).", GetLastError());\r
-                                       }\r
-                               }\r
-\r
-                               case IDC_LIST:\r
-                               {\r
-                                       if(HIWORD(wParam) == LBN_SELCHANGE)\r
-                                       {\r
-                                               WCHAR buf[25];\r
-                                               if((hKl = GetSelectedLayout(hDlg)) != NULL)\r
-                                               {\r
-                                                       swprintf(buf, L"%x", hKl);\r
-                                                       SetWindowText(GetDlgItem(hDlg, IDC_HANDLE), buf);\r
-                                               }\r
-                                       }\r
-                                       break;\r
-                               }\r
-\r
-                       }\r
-\r
-                       return TRUE;\r
-               } /* WM_COMMAND */\r
-\r
-\r
-               case WM_INPUTLANGCHANGE:\r
-               {\r
-                       FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);\r
-                       return FALSE;\r
-               }\r
-\r
-               case WM_INPUTLANGCHANGEREQUEST:\r
-               {\r
-                       FormatMsg(L"dlg WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", lParam, wParam);\r
-                       UpdateData(hDlg);\r
-                       return FALSE;\r
-               }\r
-\r
-               case WM_CLOSE:\r
-               {\r
-                       EndDialog(hDlg, ERROR_CANCELLED);\r
-                       return TRUE;\r
-               } /* WM_CLOSE */\r
-\r
-               default:\r
-                       return FALSE;\r
-       }\r
-\r
-}\r
-\r
-\r
-\r
-\r
+/*
+ * PROJECT:         ReactOS
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * FILE:            base/applications/testset/user32/kbdlayout/kbdlayout.c
+ * PURPOSE:         Keyboard layout testapp
+ * COPYRIGHT:       Copyright 2007 Saveliy Tretiakov
+ */
+
+#define UNICODE
+#include<wchar.h>
+#include <windows.h>
+#include "resource.h"
+
+
+
+LRESULT MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
+
+
+HINSTANCE hInst;
+HWND hMainDlg;
+
+
+typedef struct {
+       WNDPROC OrigProc;
+       WCHAR WndName[25];
+} WND_DATA;
+
+DWORD WINAPI ThreadProc(LPVOID lpParam)
+{
+
+       DialogBoxParam(hInst,
+               MAKEINTRESOURCE(IDD_MAINDIALOG),
+               NULL,
+               (DLGPROC)MainDialogProc,
+               (LPARAM)NULL);
+
+       return 0;
+}
+
+INT WINAPI WinMain(HINSTANCE hInstance,
+    HINSTANCE hPrevInstance,
+    LPSTR lpCmdLine,
+    int nCmdShow)
+{
+
+
+       hInst = hInstance;
+
+       ThreadProc(0);
+
+       return 0;
+}
+
+
+int GetKlList(HKL **list)
+{
+       HKL *ret;
+       int n;
+
+       n = GetKeyboardLayoutList(0, NULL);
+       ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HKL)*n);
+       GetKeyboardLayoutList(n, ret);
+       *list = ret;
+       return n;
+}
+
+void FreeKlList(HKL *list)
+{
+       HeapFree(GetProcessHeap(), 0, list);
+}
+
+
+void UpdateData(HWND hDlg)
+{
+       WCHAR buf[KL_NAMELENGTH];
+       WCHAR buf2[512];
+
+       HWND hList;
+       HKL *klList, hKl;
+       int n, i,j;
+
+       GetKeyboardLayoutName(buf);
+       swprintf(buf2, L"Active: %s (%x)", buf, GetKeyboardLayout(0));
+       SetWindowText(GetDlgItem(hDlg, IDC_ACTIVE), buf2);
+
+       hList = GetDlgItem(hDlg, IDC_LIST);
+       SendMessage(hList, LB_RESETCONTENT, 0, 0);
+
+       n = GetKlList(&klList);
+       hKl = GetKeyboardLayout(0);
+       for(i = 0; i < n; i++)
+       {
+               swprintf(buf, L"%x", klList[i] );
+               j = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM) buf);
+               SendMessage(hList, LB_SETITEMDATA, j, (LPARAM) klList[i]);
+               if(klList[i] == hKl) SendMessage(hList, LB_SETCURSEL, j, 0);
+       }
+
+       FreeKlList(klList);
+}
+
+void FormatMsg(WCHAR *format, ...)
+{
+       WCHAR buf[255];
+       va_list argptr;
+       va_start(argptr, format);
+       _vsnwprintf(buf, sizeof(buf)-1, format, argptr);
+       MessageBox(0, buf, L"msg", 0);
+       va_end(argptr);
+}
+
+void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format, ...)
+{
+       WCHAR buf[255];
+       va_list argptr;
+       va_start(argptr, Format);
+       _vsnwprintf(buf, sizeof(buf)-1, Format, argptr);
+       MessageBox(hWnd, buf, Caption, Flags);
+       va_end(argptr);
+}
+
+
+LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+       WND_DATA *data = (WND_DATA*)GetWindowLong(hwnd, GWL_USERDATA);
+
+       if(uMsg == WM_INPUTLANGCHANGE)
+       {
+               FormatMsg(L"%s: WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
+               UpdateData(hMainDlg);
+               //Pass message to defwindowproc
+       }
+       else if(uMsg == WM_INPUTLANGCHANGEREQUEST)
+       {
+               FormatMsg(L"%s: WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
+               UpdateData(hMainDlg);
+               //Pass message to defwindowproc
+       }
+
+       return ( CallWindowProc( data->OrigProc, hwnd, uMsg, wParam, lParam) );
+}
+
+void SubclassWnd(HWND hWnd, WCHAR* Name)
+{
+       WND_DATA *data = HeapAlloc(GetProcessHeap(), 0, sizeof(WND_DATA));
+       data->OrigProc = (WNDPROC)SetWindowLong( hWnd, GWL_WNDPROC, (LONG)WndSubclassProc);
+       wcsncpy(data->WndName, Name, 25);
+       SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
+       return;
+}
+
+DWORD GetActivateFlags(HWND hDlg)
+{
+       DWORD ret = 0;
+
+       if(IsDlgButtonChecked(hDlg, IDC_KLF_REORDER))
+               ret |= KLF_REORDER;
+
+       if(IsDlgButtonChecked(hDlg, IDC_KLF_RESET))
+               ret |= KLF_RESET;
+
+       if(IsDlgButtonChecked(hDlg, IDC_KLF_SHIFTLOCK))
+               ret |= KLF_SHIFTLOCK;
+
+       if(IsDlgButtonChecked(hDlg, IDC_KLF_SETFORPROCESS))
+               ret |= KLF_SETFORPROCESS;
+
+       return ret;
+
+}
+
+DWORD GetLoadFlags(HWND hDlg)
+{
+       DWORD ret = 0;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_ACTIVATE))
+               ret |= KLF_ACTIVATE;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_NOTELLSHELL))
+               ret |= KLF_NOTELLSHELL;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_REORDER))
+               ret |= KLF_REORDER;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_REPLACELANG))
+               ret |= KLF_REPLACELANG;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_SUBSTITUTE_OK))
+               ret |= KLF_SUBSTITUTE_OK;
+
+       if(IsDlgButtonChecked(hDlg, IDL_KLF_SETFORPROCESS))
+               ret |= KLF_SETFORPROCESS;
+
+       return ret;
+}
+
+UINT GetDelayMilliseconds(HWND hDlg)
+{
+       WCHAR Buf[255];
+       UINT ret;
+
+       GetWindowText(GetDlgItem(hDlg, IDC_DELAY), Buf, sizeof(Buf));
+
+       swscanf(Buf, L"%d", &ret);
+
+       return ret*1000;
+}
+
+HKL GetSelectedLayout(HWND hDlg)
+{
+       int n;
+       HWND hList;
+       hList = GetDlgItem(hDlg, IDC_LIST);
+       if((n = SendMessage(hList, LB_GETCURSEL, 0, 0)) != LB_ERR)
+               return (HKL) SendMessage(hList, LB_GETITEMDATA, n, 0);
+       else return INVALID_HANDLE_VALUE;
+}
+
+HKL GetActivateHandle(HWND hDlg)
+{
+
+       if(IsDlgButtonChecked(hDlg, IDC_FROMLIST))
+               return GetSelectedLayout(hDlg);
+       else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))
+               return (HKL)HKL_NEXT;
+
+       return (HKL)HKL_PREV;
+
+}
+
+
+/***************************************************
+ * MainDialogProc                                  *
+ ***************************************************/
+
+LRESULT MainDialogProc(HWND hDlg,
+       UINT Msg,
+       WPARAM wParam,
+       LPARAM lParam)
+{
+       HKL hKl;
+
+       switch (Msg)
+       {
+               case WM_INITDIALOG:
+               {
+                       WCHAR Buf[255];
+                       UpdateData(hDlg);
+                       hMainDlg = hDlg;
+
+                       SubclassWnd(GetDlgItem(hDlg, IDC_LIST), L"List");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_EDIT1), L"Edit1");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_KLID), L"Klid");
+                       SubclassWnd(GetDlgItem(hDlg, ID_CANCEL), L"CancelB");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_ACTIVATE), L"ActivateB");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_REFRESH), L"RefreshB");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_UNLOAD), L"UnloadB");
+                       SubclassWnd(GetDlgItem(hDlg, IDC_LOAD), L"LoadB");
+
+                       CheckRadioButton(hDlg, IDC_FROMLIST, IDC_FROMEDIT, IDC_FROMLIST);
+                       SetWindowText(GetDlgItem(hDlg, IDC_KLID), L"00000419");
+
+                       swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());
+                       SetWindowText(GetDlgItem(hDlg, IDC_CURTHREAD), Buf);
+
+                       SetWindowText(GetDlgItem(hDlg, IDC_DELAY), L"0");
+
+                       return 0;
+               } /* WM_INITDIALOG */
+
+               case WM_COMMAND:
+               {
+                       switch(LOWORD(wParam))
+                       {
+                               case ID_CANCEL:
+                               {
+                                       EndDialog(hDlg, ERROR_CANCELLED);
+                                       break;
+                               }
+
+                               case IDC_ACTIVATE:
+                               {
+                                       if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)
+                                       {
+                                               Sleep(GetDelayMilliseconds(hDlg));
+                                               if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))
+                                                       FormatBox(hDlg, MB_ICONERROR, L"Error",
+                                                               L"ActivateKeyboardLayout() failed. %d", GetLastError());
+                                               else UpdateData(hDlg);
+                                               //FormatBox(hDlg, 0, L"Activated", L"Prev - %x, err - %d.", hKl,
+                                               // GetLastError());
+                                       }
+                                       else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);
+                                       break;
+                               }
+
+                               case IDC_UNLOAD:
+                               {
+                                       if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)
+                                       {
+                                               Sleep(GetDelayMilliseconds(hDlg));
+                                               if(!UnloadKeyboardLayout(hKl))
+                                                       FormatBox(hDlg, MB_ICONERROR, L"Error",
+                                                               L"UnloadKeyboardLayout() failed. %d",
+                                                               GetLastError());
+                                               else UpdateData(hDlg);
+                                       }
+                                       else MessageBox(hDlg,  L"No item selected", L"Error", MB_ICONERROR);
+                                       break;
+                               }
+
+                               case IDC_LOAD:
+                               {
+                                       WCHAR buf[255];
+                                       GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));
+                                       Sleep(GetDelayMilliseconds(hDlg));
+                                       if(!LoadKeyboardLayout(buf, GetLoadFlags(hDlg)))
+                                               FormatBox(hDlg, MB_ICONERROR, L"Error",
+                                                       L"LoadKeyboardLayout() failed. %d",
+                                                       GetLastError());
+                                       else UpdateData(hDlg);
+                                       break;
+                               }
+
+                               case IDC_REFRESH:
+                               {
+                                       UpdateData(hDlg);
+                                       break;
+                               }
+
+                               case IDC_NEWTHREAD:
+                               {
+                                       if(!CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL))
+                                       {
+                                               FormatBox(hDlg, MB_ICONERROR, L"Error!",
+                                                       L"Can not create thread (%d).", GetLastError());
+                                       }
+                               }
+
+                               case IDC_LIST:
+                               {
+                                       if(HIWORD(wParam) == LBN_SELCHANGE)
+                                       {
+                                               WCHAR buf[25];
+                                               if((hKl = GetSelectedLayout(hDlg)) != NULL)
+                                               {
+                                                       swprintf(buf, L"%x", hKl);
+                                                       SetWindowText(GetDlgItem(hDlg, IDC_HANDLE), buf);
+                                               }
+                                       }
+                                       break;
+                               }
+
+                       }
+
+                       return TRUE;
+               } /* WM_COMMAND */
+
+
+               case WM_INPUTLANGCHANGE:
+               {
+                       FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);
+                       return FALSE;
+               }
+
+               case WM_INPUTLANGCHANGEREQUEST:
+               {
+                       FormatMsg(L"dlg WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", lParam, wParam);
+                       UpdateData(hDlg);
+                       return FALSE;
+               }
+
+               case WM_CLOSE:
+               {
+                       EndDialog(hDlg, ERROR_CANCELLED);
+                       return TRUE;
+               } /* WM_CLOSE */
+
+               default:
+                       return FALSE;
+       }
+
+}
+
+
+
+
index d2d1b58..b7b6245 100644 (file)
@@ -1,8 +1,8 @@
-<module name="kbdlayout" type="win32gui" installbase="system32" installname="kbdlayout.exe">\r
-       <include base="kbdlayout">.</include>\r
-       <library>kernel32</library>\r
-       <library>user32</library>\r
-       <library>gdi32</library>\r
-       <file>kbdlayout.c</file>\r
-       <file>kbdlayout.rc</file>\r
-</module>\r
+<module name="kbdlayout" type="win32gui" installbase="system32" installname="kbdlayout.exe">
+       <include base="kbdlayout">.</include>
+       <library>kernel32</library>
+       <library>user32</library>
+       <library>gdi32</library>
+       <file>kbdlayout.c</file>
+       <file>kbdlayout.rc</file>
+</module>
index a245b7f..91e056e 100644 (file)
@@ -1,46 +1,46 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Developer Studio generated include file.\r
-// Used by kbdlayout.rc\r
-//\r
-#define IDD_MAINDIALOG                  101\r
-#define ID_CANCEL                       1000\r
-#define IDC_EDIT1                       1021\r
-#define IDC_LIST                        1022\r
-#define IDC_ACTIVE                      1023\r
-#define IDC_EDIT2                       1024\r
-#define IDC_DELAY                       1024\r
-#define IDC_UNLOAD                      1025\r
-#define IDC_ACTIVATE                    1026\r
-#define IDC_KLF_REORDER                 1027\r
-#define IDC_KLF_RESET                   1028\r
-#define IDC_KLF_SETFORPROCESS           1029\r
-#define IDC_KLF_SHIFTLOCK               1030\r
-#define IDC_FROMLIST                    1032\r
-#define IDC_HKL_NEXT                    1033\r
-#define IDC_HKL_PREV                    1034\r
-#define IDL_KLF_ACTIVATE                1035\r
-#define IDL_KLF_NOTELLSHELL             1036\r
-#define IDC_KLID                        1037\r
-#define IDL_KLF_REORDER                 1038\r
-#define IDL_KLF_REPLACELANG             1039\r
-#define IDL_KLF_SUBSTITUTE_OK           1040\r
-#define IDL_KLF_SETFORPROCESS           1041\r
-#define IDC_HKL_PREV2                   1042\r
-#define IDC_FROMEDIT                    1042\r
-#define IDC_LOAD                        1043\r
-#define IDC_REFRESH                     1044\r
-#define IDC_HANDLE                      1046\r
-#define IDC_CURTHREAD                   1049\r
-#define IDC_NEWTHREAD                   1050\r
-\r
-// Next default values for new objects\r
-//\r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NO_MFC                     1\r
-#define _APS_NEXT_RESOURCE_VALUE        105\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1051\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by kbdlayout.rc
+//
+#define IDD_MAINDIALOG                  101
+#define ID_CANCEL                       1000
+#define IDC_EDIT1                       1021
+#define IDC_LIST                        1022
+#define IDC_ACTIVE                      1023
+#define IDC_EDIT2                       1024
+#define IDC_DELAY                       1024
+#define IDC_UNLOAD                      1025
+#define IDC_ACTIVATE                    1026
+#define IDC_KLF_REORDER                 1027
+#define IDC_KLF_RESET                   1028
+#define IDC_KLF_SETFORPROCESS           1029
+#define IDC_KLF_SHIFTLOCK               1030
+#define IDC_FROMLIST                    1032
+#define IDC_HKL_NEXT                    1033
+#define IDC_HKL_PREV                    1034
+#define IDL_KLF_ACTIVATE                1035
+#define IDL_KLF_NOTELLSHELL             1036
+#define IDC_KLID                        1037
+#define IDL_KLF_REORDER                 1038
+#define IDL_KLF_REPLACELANG             1039
+#define IDL_KLF_SUBSTITUTE_OK           1040
+#define IDL_KLF_SETFORPROCESS           1041
+#define IDC_HKL_PREV2                   1042
+#define IDC_FROMEDIT                    1042
+#define IDC_LOAD                        1043
+#define IDC_REFRESH                     1044
+#define IDC_HANDLE                      1046
+#define IDC_CURTHREAD                   1049
+#define IDC_NEWTHREAD                   1050
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC                     1
+#define _APS_NEXT_RESOURCE_VALUE        105
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1051
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index 3982629..ba36e4b 100644 (file)
@@ -1,8 +1,8 @@
-Index: server.c\r
-===================================================================\r
---- server.c   (revision 38883)\r
-+++ server.c   (working copy)\r
-@@ -352,12 +352,6 @@\r
+Index: server.c
+===================================================================
+--- server.c   (revision 38883)
++++ server.c   (working copy)
+@@ -352,12 +352,6 @@
  }
  
  int
@@ -15,7 +15,7 @@ Index: server.c
  s_sum_pcarr(int *a[], int n)
  {
    int i, s = 0;
-@@ -367,6 +361,12 @@\r
+@@ -367,6 +361,12 @@
  }
  
  int