[ros-diffs] [dchapyshev] 40865: - Convert some stuff to unicode

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Sat May 9 14:37:17 CEST 2009


Author: dchapyshev
Date: Sat May  9 16:37:16 2009
New Revision: 40865

URL: http://svn.reactos.org/svn/reactos?rev=40865&view=rev
Log:
- Convert some stuff to unicode

Modified:
    trunk/reactos/dll/win32/shell32/changenotify.c
    trunk/reactos/dll/win32/shell32/classes.c
    trunk/reactos/dll/win32/shell32/control.c
    trunk/reactos/dll/win32/shell32/desktop.c

Modified: trunk/reactos/dll/win32/shell32/changenotify.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/changenotify.c?rev=40865&r1=40864&r2=40865&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/changenotify.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/changenotify.c [iso-8859-1] Sat May  9 16:37:16 2009
@@ -380,9 +380,9 @@
         ptr->wSignalledEvent |= wEventId;
 
         if (ptr->dwFlags  & SHCNRF_NewDelivery)
-            SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM) ptr, (LPARAM) GetCurrentProcessId());
+            SendMessageW(ptr->hwnd, ptr->uMsg, (WPARAM) ptr, (LPARAM) GetCurrentProcessId());
         else
-            SendMessageA(ptr->hwnd, ptr->uMsg, (WPARAM)Pidls, wEventId);
+            SendMessageW(ptr->hwnd, ptr->uMsg, (WPARAM)Pidls, wEventId);
 
         TRACE("notifying %s, event %s(%x) after\n", NodeName( ptr ), DumpEvent(
                 wEventId ),wEventId );

Modified: trunk/reactos/dll/win32/shell32/classes.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/classes.c?rev=40865&r1=40864&r2=40865&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/classes.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/classes.c [iso-8859-1] Sat May  9 16:37:16 2009
@@ -197,15 +197,15 @@
 */
 static BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey)
 {
-	char	xriid[50];
-    sprintf( xriid, "CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
+	WCHAR xriid[50];
+    swprintf( xriid, L"CLSID\\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
                  riid->Data1, riid->Data2, riid->Data3,
                  riid->Data4[0], riid->Data4[1], riid->Data4[2], riid->Data4[3],
                  riid->Data4[4], riid->Data4[5], riid->Data4[6], riid->Data4[7] );
 
- 	TRACE("%s\n",xriid );
-
-	return !RegOpenKeyExA(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
+ 	TRACE("%S\n",xriid );
+
+	return !RegOpenKeyExW(HKEY_CLASSES_ROOT, xriid, 0, KEY_READ, hkey);
 }
 
 static BOOL HCR_RegGetDefaultIconW(HKEY hkey, LPWSTR szDest, DWORD len, int* picon_idx)

Modified: trunk/reactos/dll/win32/shell32/control.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/control.c?rev=40865&r1=40864&r2=40865&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/control.c [iso-8859-1] Sat May  9 16:37:16 2009
@@ -72,7 +72,7 @@
 
     for (i = 0; i < applet->count; i++) {
        ZeroMemory(&newinfo, sizeof(newinfo));
-       newinfo.dwSize = sizeof(NEWCPLINFOA);
+       newinfo.dwSize = sizeof(NEWCPLINFOW);
        applet->info[i].dwSize = sizeof(NEWCPLINFOW);
        /* proc is supposed to return a null value upon success for
 	* CPL_INQUIRE and CPL_NEWINQUIRE
@@ -102,21 +102,12 @@
        else
        {
            CopyMemory(&applet->info[i], &newinfo, newinfo.dwSize);
-	   if (newinfo.dwSize != sizeof(NEWCPLINFOW))
+	       if (newinfo.dwSize != sizeof(NEWCPLINFOW))
            {
-	       applet->info[i].dwSize = sizeof(NEWCPLINFOW);
-               MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szName,
-	                           sizeof(((LPNEWCPLINFOA)&newinfo)->szName) / sizeof(CHAR),
-			           applet->info[i].szName,
-			           sizeof(applet->info[i].szName) / sizeof(WCHAR));
-               MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szInfo,
-	                           sizeof(((LPNEWCPLINFOA)&newinfo)->szInfo) / sizeof(CHAR),
-			           applet->info[i].szInfo,
-			           sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
-               MultiByteToWideChar(CP_ACP, 0, ((LPNEWCPLINFOA)&newinfo)->szHelpFile,
-	                           sizeof(((LPNEWCPLINFOA)&newinfo)->szHelpFile) / sizeof(CHAR),
-			           applet->info[i].szHelpFile,
-			           sizeof(applet->info[i].szHelpFile) / sizeof(WCHAR));
+	            applet->info[i].dwSize = sizeof(NEWCPLINFOW);
+		        lstrcpyW(applet->info[i].szName, newinfo.szName);
+				lstrcpyW(applet->info[i].szInfo, newinfo.szInfo);
+				lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile);
            }
        }
     }
@@ -131,11 +122,11 @@
     return NULL;
 }
 
-static void 	 Control_WndProc_Create(HWND hWnd, const CREATESTRUCTA* cs)
+static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs)
 {
    CPanel*	panel = (CPanel*)cs->lpCreateParams;
 
-   SetWindowLongPtrA(hWnd, 0, (LONG_PTR)panel);
+   SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel);
    panel->status = 0;
    panel->hWnd = hWnd;
 }
@@ -226,12 +217,12 @@
 static LRESULT WINAPI	Control_WndProc(HWND hWnd, UINT wMsg,
 					WPARAM lParam1, LPARAM lParam2)
 {
-   CPanel*	panel = (CPanel*)GetWindowLongPtrA(hWnd, 0);
+   CPanel*	panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
 
    if (panel || wMsg == WM_CREATE) {
       switch (wMsg) {
       case WM_CREATE:
-	 Control_WndProc_Create(hWnd, (CREATESTRUCTA*)lParam2);
+	 Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2);
 	 return 0;
       case WM_DESTROY:
          {
@@ -252,14 +243,14 @@
       }
    }
 
-   return DefWindowProcA(hWnd, wMsg, lParam1, lParam2);
-}
-
-static void    Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
-{
-    WNDCLASSA	wc;
-    MSG		msg;
-    const CHAR* appName = "Wine Control Panel";
+   return DefWindowProcW(hWnd, wMsg, lParam1, lParam2);
+}
+
+static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
+{
+    WNDCLASSW	wc;
+    MSG	msg;
+    const WCHAR* appName = L"ReactOS Control Panel";
     wc.style = CS_HREDRAW|CS_VREDRAW;
     wc.lpfnWndProc = Control_WndProc;
     wc.cbClsExtra = 0;
@@ -269,11 +260,11 @@
     wc.hCursor = 0;
     wc.hbrBackground = GetStockObject(WHITE_BRUSH);
     wc.lpszMenuName = NULL;
-    wc.lpszClassName = "Shell_Control_WndClass";
-
-    if (!RegisterClassA(&wc)) return;
-
-    CreateWindowExA(0, wc.lpszClassName, appName,
+    wc.lpszClassName = L"Shell_Control_WndClass";
+
+    if (!RegisterClassW(&wc)) return;
+
+    CreateWindowExW(0, wc.lpszClassName, appName,
 		    WS_OVERLAPPEDWINDOW | WS_VISIBLE,
 		    CW_USEDEFAULT, CW_USEDEFAULT,
 		    CW_USEDEFAULT, CW_USEDEFAULT,
@@ -282,17 +273,17 @@
 
     if (!panel->first) {
 	/* FIXME appName & message should be localized  */
-	MessageBoxA(panel->hWnd, "Cannot load any applets", appName, MB_OK);
+	MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK);
 	return;
     }
 
-    while (GetMessageA(&msg, panel->hWnd, 0, 0)) {
+    while (GetMessageW(&msg, panel->hWnd, 0, 0)) {
         TranslateMessage(&msg);
-        DispatchMessageA(&msg);
-    }
-}
-
-static	void	Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
+        DispatchMessageW(&msg);
+    }
+}
+
+static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 {
     HANDLE		h;
     WIN32_FIND_DATAW	fd;
@@ -424,7 +415,7 @@
           }
        }
        if (applet->info[sp].dwSize) {
-	  if (!applet->proc(applet->hWnd, CPL_STARTWPARMSA, sp, (LPARAM)extraPmts))
+	  if (!applet->proc(applet->hWnd, CPL_STARTWPARMSW, sp, (LPARAM)extraPmts))
 	     applet->proc(applet->hWnd, CPL_DBLCLK, sp, applet->info[sp].lData);
        }
        Control_UnloadApplet(applet);

Modified: trunk/reactos/dll/win32/shell32/desktop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/desktop.c?rev=40865&r1=40864&r2=40865&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/desktop.c [iso-8859-1] Sat May  9 16:37:16 2009
@@ -258,7 +258,7 @@
 static HWND
 SHDESK_FindDesktopListView (SHDESK *This)
 {
-    return FindWindowEx (This->hWndShellView,
+    return FindWindowExW(This->hWndShellView,
                          NULL,
                          WC_LISTVIEW,
                          NULL);
@@ -410,10 +410,10 @@
                                    id);
     if (hWnd != NULL)
     {
-        *pret = SendMessage(hWnd,
-                            uMsg,
-                            wParam,
-                            lParam);
+        *pret = SendMessageW(hWnd,
+                             uMsg,
+                             wParam,
+                             lParam);
         return S_OK;
     }
 
@@ -552,12 +552,12 @@
     MSG Msg;
     BOOL bRet;
 
-    while ((bRet = GetMessage(&Msg, NULL, 0, 0)) != 0)
+    while ((bRet = GetMessageW(&Msg, NULL, 0, 0)) != 0)
     {
         if (bRet != -1)
         {
             TranslateMessage(&Msg);
-            DispatchMessage(&Msg);
+            DispatchMessageW(&Msg);
         }
     }
 
@@ -684,7 +684,7 @@
     wcProgman.cbWndExtra = sizeof(PSHDESK);
     wcProgman.hInstance = shell32_hInstance;
     wcProgman.hIcon = NULL;
-    wcProgman.hCursor = LoadCursor(NULL,
+    wcProgman.hCursor = LoadCursorW(NULL,
                                    IDC_ARROW);
     wcProgman.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
     wcProgman.lpszMenuName = NULL;
@@ -732,7 +732,7 @@
         rcDesk.left, rcDesk.top, rcDesk.right, rcDesk.bottom,
         NULL, NULL, shell32_hInstance, (LPVOID)ShellDesk);
     if (hWndDesk != NULL)
-        return (HANDLE)GetWindowLongPtr(hWndDesk, 0);
+        return (HANDLE)GetWindowLongPtrW(hWndDesk, 0);
 
     return NULL;
 }



More information about the Ros-diffs mailing list