* Sync to trunk HEAD (r53473).
[reactos.git] / subsystems / win32 / win32k / ntuser / misc.c
index 92f50b4..036c0ce 100644 (file)
@@ -10,9 +10,7 @@
 
 #include <win32k.h>
 
-#define NDEBUG
-#include <debug.h>
-
+DBG_DEFAULT_CHANNEL(UserMisc);
 
 SHORT
 FASTCALL
@@ -56,7 +54,7 @@ IntGdiGetLanguageID(VOID)
     }
     ZwClose(KeyHandle);
   }
-  DPRINT("Language ID = %x\n",Ret);
+  TRACE("Language ID = %x\n",Ret);
   return (SHORT) Ret;
 }
 
@@ -69,7 +67,7 @@ NtUserGetThreadState(
 {
    DWORD_PTR ret = 0;
 
-   DPRINT("Enter NtUserGetThreadState\n");
+   TRACE("Enter NtUserGetThreadState\n");
    if (Routine != THREADSTATE_GETTHREADINFO)
    {
        UserEnterShared();
@@ -104,7 +102,7 @@ NtUserGetThreadState(
          {
            PUSER_SENT_MESSAGE Message = 
                 ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->pusmCurrent;
-           DPRINT1("THREADSTATE_INSENDMESSAGE\n");
+           ERR("THREADSTATE_INSENDMESSAGE\n");
 
            ret = ISMEX_NOSEND;
            if (Message)
@@ -144,7 +142,7 @@ NtUserGetThreadState(
          break;
    }
 
-   DPRINT("Leave NtUserGetThreadState, ret=%i\n", ret);
+   TRACE("Leave NtUserGetThreadState, ret=%i\n", ret);
    UserLeave();
 
    return ret;
@@ -183,13 +181,13 @@ NtUserGetDoubleClickTime(VOID)
 {
    UINT Result;
 
-   DPRINT("Enter NtUserGetDoubleClickTime\n");
+   TRACE("Enter NtUserGetDoubleClickTime\n");
    UserEnterShared();
 
    // FIXME: Check if this works on non-interactive winsta
    Result = gspv.iDblClickTime;
 
-   DPRINT("Leave NtUserGetDoubleClickTime, ret=%i\n", Result);
+   TRACE("Leave NtUserGetDoubleClickTime, ret=%i\n", Result);
    UserLeave();
    return Result;
 }
@@ -210,7 +208,7 @@ NtUserGetGUIThreadInfo(
 
    DECLARE_RETURN(BOOLEAN);
 
-   DPRINT("Enter NtUserGetGUIThreadInfo\n");
+   TRACE("Enter NtUserGetGUIThreadInfo\n");
    UserEnterShared();
 
    Status = MmCopyFromCaller(&SafeGui, lpgui, sizeof(DWORD));
@@ -296,7 +294,7 @@ NtUserGetGUIThreadInfo(
    RETURN( TRUE);
 
 CLEANUP:
-   DPRINT("Leave NtUserGetGUIThreadInfo, ret=%i\n",_ret_);
+   TRACE("Leave NtUserGetGUIThreadInfo, ret=%i\n",_ret_);
    UserLeave();
    END_CLEANUP;
 }
@@ -314,7 +312,7 @@ NtUserGetGuiResources(
    DWORD Ret = 0;
    DECLARE_RETURN(DWORD);
 
-   DPRINT("Enter NtUserGetGuiResources\n");
+   TRACE("Enter NtUserGetGuiResources\n");
    UserEnterShared();
 
    Status = ObReferenceObjectByHandle(hProcess,
@@ -362,7 +360,7 @@ NtUserGetGuiResources(
    RETURN( Ret);
 
 CLEANUP:
-   DPRINT("Leave NtUserGetGuiResources, ret=%i\n",_ret_);
+   TRACE("Leave NtUserGetGuiResources, ret=%i\n",_ret_);
    UserLeave();
    END_CLEANUP;
 }
@@ -463,37 +461,6 @@ IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest,
    return STATUS_SUCCESS;
 }
 
-NTSTATUS FASTCALL
-IntUnicodeStringToNULLTerminated(PWSTR *Dest, PUNICODE_STRING Src)
-{
-   if (Src->Length + sizeof(WCHAR) <= Src->MaximumLength
-         && L'\0' == Src->Buffer[Src->Length / sizeof(WCHAR)])
-   {
-      /* The unicode_string is already nul terminated. Just reuse it. */
-      *Dest = Src->Buffer;
-      return STATUS_SUCCESS;
-   }
-
-   *Dest = ExAllocatePoolWithTag(PagedPool, Src->Length + sizeof(WCHAR), TAG_STRING);
-   if (NULL == *Dest)
-   {
-      return STATUS_NO_MEMORY;
-   }
-   RtlCopyMemory(*Dest, Src->Buffer, Src->Length);
-   (*Dest)[Src->Length / 2] = L'\0';
-
-   return STATUS_SUCCESS;
-}
-
-void FASTCALL
-IntFreeNULLTerminatedFromUnicodeString(PWSTR NullTerminated, PUNICODE_STRING UnicodeString)
-{
-   if (NullTerminated != UnicodeString->Buffer)
-   {
-      ExFreePool(NullTerminated);
-   }
-}
-
 PPROCESSINFO
 GetW32ProcessInfo(VOID)
 {