[REGEDIT]
[reactos.git] / reactos / base / applications / regedit / error.c
index 864094e..6313591 100644 (file)
 
 #include <regedit.h>
 
-int ErrorMessageBox(HWND hWnd, LPCTSTR lpTitle, DWORD dwErrorCode, ...)
+int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode, ...)
 {
     int iRet = 0;
-    LPTSTR lpMsgBuf = NULL;
+    LPWSTR lpMsgBuf = NULL;
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, dwErrorCode);
 
-    Status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
-                           NULL,
-                           dwErrorCode,
-                           MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                           (LPTSTR)&lpMsgBuf,
-                           0,
-                           &args);
+    Status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+                            NULL,
+                            dwErrorCode,
+                            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+                            (LPWSTR)&lpMsgBuf,
+                            0,
+                            &args);
 
     va_end(args);
 
-    iRet = MessageBox(hWnd, (Status && lpMsgBuf ? lpMsgBuf : TEXT("Error displaying error message.\n")), lpTitle, MB_OK | MB_ICONERROR);
+    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, MB_OK | MB_ICONERROR);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
-    /* Return the MessageBox information */
+    /* Return the MessageBoxW information */
     return iRet;
 }
 
-int InfoMessageBox(HWND hWnd, UINT uType, LPCTSTR lpTitle, LPCTSTR lpMessage, ...)
+int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage, ...)
 {
     int iRet = 0;
-    LPTSTR lpMsgBuf = NULL;
+    LPWSTR lpMsgBuf = NULL;
     DWORD Status = 0;
 
     va_list args = NULL;
     va_start(args, lpMessage);
 
-    Status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
-                           lpMessage,
-                           0,
-                           0,
-                           (LPTSTR)&lpMsgBuf,
-                           0,
-                           &args);
+    Status = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+                            lpMessage,
+                            0,
+                            0,
+                            (LPWSTR)&lpMsgBuf,
+                            0,
+                            &args);
 
     va_end(args);
 
-    iRet = MessageBox(hWnd, (Status && lpMsgBuf ? lpMsgBuf : TEXT("Error displaying error message.\n")), lpTitle, uType);
+    iRet = MessageBoxW(hWnd, (Status && lpMsgBuf ? lpMsgBuf : L"Error displaying error message.\n"), lpTitle, uType);
 
     if (lpMsgBuf) LocalFree(lpMsgBuf);
 
-    /* Return the MessageBox information */
+    /* Return the MessageBoxW information */
     return iRet;
 }