Index: sipXportLib/src/os/Wnt/OsTaskWnt.cpp
===================================================================
--- sipXportLib/src/os/Wnt/OsTaskWnt.cpp    (revision 9892)
+++ sipXportLib/src/os/Wnt/OsTaskWnt.cpp    (working copy)
@@ -470,7 +470,9 @@
       // Unlike VxWorks, the priority is not an argument in the creation call,
       // so we have to set it explicitly ourselves.  To that end, we start
       // the thread "suspended" and release it after setting its priority.
-      setPriority(mPriority);
+      //setPriority(mPriority);
+      setPriority(THREAD_PRIORITY_HIGHEST);
+
       ResumeThread(mThreadH);
       return TRUE;
    }
Index: sipXmediaLib/include/mp/dmaTask.h
===================================================================
--- sipXmediaLib/include/mp/dmaTask.h    (revision 9892)
+++ sipXmediaLib/include/mp/dmaTask.h    (working copy)
@@ -211,4 +211,9 @@
 };
 
 /*************************************************************************/
+
+// Messsage queues
+extern DWORD _nw32MicQid;
+extern DWORD _nw32SpkrQid;
+
 #endif /* _INCLUDED_DMATASK_H ] */
Index: sipXmediaLib/src/rtcp/RTCPTimer.cpp
===================================================================
--- sipXmediaLib/src/rtcp/RTCPTimer.cpp    (revision 9892)
+++ sipXmediaLib/src/rtcp/RTCPTimer.cpp    (working copy)
@@ -271,7 +271,7 @@
                           0,                // Default Stack Size
                           (LPTHREAD_START_ROUTINE) TimerThreadProc,  // Thread Function
                           this,             // Argument to the thread function
-                          0,                // Run immediately
+                          CREATE_SUSPENDED, // Run immediately
                           &iThreadID);      // Thread identifier returned
 
 
@@ -280,6 +280,9 @@
     if (m_hTimerThread == NULL)
         return (FALSE);
 
+    // CREATE_SUSPENDED
+    SetThreadPriority(m_hTimerThread, THREAD_PRIORITY_HIGHEST);
+    ResumeThread(m_hTimerThread);
 
     return(TRUE);
 
Index: sipXmediaLib/src/rtcp/MsgQueue.cpp
===================================================================
--- sipXmediaLib/src/rtcp/MsgQueue.cpp    (revision 9892)
+++ sipXmediaLib/src/rtcp/MsgQueue.cpp    (working copy)
@@ -522,7 +522,7 @@
                 0,                   // Default Stack Size
                 (LPTHREAD_START_ROUTINE) InitMessageThread,   // Thread Function
                 this,                // Argument to the thread function
-                0 ,                  // Run immediately
+                CREATE_SUSPENDED ,   // Run immediately
                 &iMessageThreadID);  // Thread identifier returned
 
 
@@ -533,6 +533,9 @@
         return (FALSE);
     }
 
+    // CREATE_SUSPENDED
+    SetThreadPriority(m_hMessageThread, THREAD_PRIORITY_HIGHEST);
+    ResumeThread(m_hMessageThread);
 
     // Now let's wait for the Thread thread to notify
     // us that its initialization is complete.
Index: sipXmediaLib/src/mp/dmaTaskWnt.cpp
===================================================================
--- sipXmediaLib/src/mp/dmaTaskWnt.cpp    (revision 9892)
+++ sipXmediaLib/src/mp/dmaTaskWnt.cpp    (working copy)
@@ -31,6 +31,7 @@
 #include "mp/MpMediaTask.h"
 #include "mp/dmaTask.h"
 #include "os/OsMsgPool.h"
+#include "nw32/NonWin32Queue.h"
 
 // DEFINES
 
@@ -61,6 +62,10 @@
 DWORD dwMicThreadID;
 DWORD dwSpkrThreadID;
 
+// Message queues
+DWORD _nw32MicQid  = 0;
+DWORD _nw32SpkrQid = 0;
+
 /* ============================ FUNCTIONS ================================= */
 
 int DmaTask_setSpkrQPreload(int qlen)
@@ -200,7 +205,13 @@
         // fire off alt heartbeat mechanism.        
     }
 
+    // Create message queues
+    _nw32MicQid = Nw32QueueInit();
+    assert(_nw32MicQid);
 
+    _nw32SpkrQid = Nw32QueueInit();
+    assert(_nw32SpkrQid);
+
     // start a thread to receive microphone input
     // mic thread will prime the device input queue
 //    hMicThread = (void *)_beginthreadex(
@@ -265,14 +276,29 @@
  */
 void dmaShutdown()
 {    
-    PostThreadMessage(dwMicThreadID, WIM_CLOSE, 0, 0L);
+    //PostThreadMessage(dwMicThreadID, WIM_CLOSE, 0, 0L);
+    Nw32PostMessage(_nw32MicQid, WIM_CLOSE, 0, 0L);
     WaitForSingleObject(hMicThread, INFINITE);
-    PostThreadMessage(dwSpkrThreadID, WOM_CLOSE, 0, 0L);
+    //PostThreadMessage(dwSpkrThreadID, WOM_CLOSE, 0, 0L);
+    Nw32PostMessage(_nw32SpkrQid, WOM_CLOSE, 0, 0L);
     WaitForSingleObject(hSpkrThread, INFINITE);
+
+    // Delete queues
+    if (_nw32MicQid) 
+    {
+      Nw32QueueExit(_nw32MicQid);
+      _nw32MicQid = 0;
+    }
+    if (_nw32SpkrQid) 
+    {
+      Nw32QueueExit(_nw32SpkrQid);
+      _nw32SpkrQid = 0;
+    }
 }
 
 void dmaSignalMicDeviceChange()
 {
     // We do simple signal WIM_DATA without data
-    PostThreadMessage(dwMicThreadID, WIM_DATA, 0, 0L);
+    //PostThreadMessage(dwMicThreadID, WIM_DATA, 0, 0L);
+    Nw32PostMessage(_nw32MicQid, WIM_DATA, 0, 0L);
 }
\ No newline at end of file
Index: sipXmediaLib/src/mp/MicThreadWnt.cpp
===================================================================
--- sipXmediaLib/src/mp/MicThreadWnt.cpp    (revision 9892)
+++ sipXmediaLib/src/mp/MicThreadWnt.cpp    (working copy)
@@ -28,6 +28,7 @@
 #include "mp/MprToSpkr.h"
 #include "mp/MpMediaTask.h"
 #include "os/OsMsgPool.h"
+#include "nw32/NonWin32Queue.h"
 #include "os/OsDefs.h"
 
 #ifdef RTL_ENABLED
@@ -71,12 +72,14 @@
    }
 #endif /* HISTORY ] */
 
-   int retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+   //int retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+   int retval = Nw32PostMessage(dwInstance, wMsg, dwParam, GetTickCount());
 
    if (retval == 0)
    {
       Sleep(500);
-      retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+      //retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+      retval = Nw32PostMessage(dwInstance, wMsg, dwParam, GetTickCount());
       if (retval == 0)
          osPrintf("Could not PostTheadMessage after two tries.\n");
    }
@@ -132,7 +135,8 @@
       gMicDeviceId,            // attempt to open the "in call" device
       &fmt,                   // format
       (DWORD) micOutCallBackProc,// callback entry
-      GetCurrentThreadId(),   // instance data
+      //GetCurrentThreadId(),   // instance data
+      _nw32MicQid,
       CALLBACK_FUNCTION);     // callback function specified
    
    //if we fail to open the audio device above, then we 
@@ -144,7 +148,8 @@
       WAVE_MAPPER,            // select any device able to handle this format
       &fmt,                   // format
       (DWORD) micOutCallBackProc,// callback entry
-      GetCurrentThreadId(),   // instance data
+      //GetCurrentThreadId(),   // instance data
+      _nw32MicQid,
       CALLBACK_FUNCTION);     // callback function specified
 
       if (res == MMSYSERR_NOERROR)
@@ -382,7 +387,8 @@
 
     do 
     {
-        bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        bSuccess = Nw32GetMessage(_nw32MicQid, &tMsg) ;
     } while (bSuccess && (tMsg.message != WIM_OPEN)) ;
 
     ret = waveInStart(audioInH);
@@ -466,7 +472,8 @@
 
     do 
     {
-        bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        bSuccess = Nw32GetMessage(_nw32MicQid, &tMsg) ;
     } while (bSuccess && (tMsg.message != WIM_CLOSE)) ;
 
     audioInH = NULL;
@@ -538,7 +545,8 @@
     bDone = false ;
     while (!bDone) 
     {
-        bGotMsg = GetMessage(&tMsg, NULL, 0, 0);
+        //bGotMsg = GetMessage(&tMsg, NULL, 0, 0);
+        bGotMsg = Nw32GetMessage(_nw32MicQid, &tMsg) ;
         if (bGotMsg) 
         {
             switch (tMsg.message) 
Index: sipXmediaLib/src/mp/SpeakerThreadWnt.cpp
===================================================================
--- sipXmediaLib/src/mp/SpeakerThreadWnt.cpp    (revision 9892)
+++ sipXmediaLib/src/mp/SpeakerThreadWnt.cpp    (working copy)
@@ -27,6 +27,7 @@
 #include "mp/MpBuf.h"
 #include "mp/MprToSpkr.h"
 #include "mp/MpMediaTask.h"
+#include "nw32/NonWin32Queue.h"
 #include "os/OsDefs.h"
 
 #ifdef RTL_ENABLED
@@ -92,11 +93,13 @@
 
 static void CALLBACK TimerCallbackProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, DWORD dw2) 
 {    
-    int retval = PostThreadMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
+    //int retval = PostThreadMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
+    int retval = Nw32PostMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
     if (retval == 0)
     {
         Sleep(500);
-        retval = PostThreadMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
+        //retval = PostThreadMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
+        retval = Nw32PostMessage(dwUser, WM_ALT_HEARTBEAT, 0, GetTickCount());
         if (retval == 0)
             osPrintf("Could not PostTheadMessage after two tries.\n");
     }
@@ -112,12 +115,14 @@
    }
 #endif /* OHISTORY ] */
 
-   int retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+   //int retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+   int retval = Nw32PostMessage(dwInstance, wMsg, dwParam, GetTickCount());
 
    if (retval == 0)
    {
       Sleep(500);
-      retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+      //retval = PostThreadMessage(dwInstance, wMsg, dwParam, GetTickCount());
+      retval = Nw32PostMessage(dwInstance, wMsg, dwParam, GetTickCount());
       if (retval == 0)
          osPrintf("Could not PostTheadMessage after two tries.\n");
    }
@@ -149,19 +154,21 @@
       desiredDeviceId,        // select the device specified by user
       &fmt,                   // format
       (DWORD) speakerCallbackProc,// callback entry
-      GetCurrentThreadId(),   // instance data
+      //GetCurrentThreadId(),   // instance data
+      _nw32SpkrQid,
       CALLBACK_FUNCTION);     // callback function specified
 
    //if we fail to open the audio device above, then we 
    //will try to open any device that will hande the requested format
    if (res != MMSYSERR_NOERROR)
-      res = waveOutOpen(
-         pAudioOutH,             // handle (will be filled in)
-         WAVE_MAPPER,            // select any device able to handle this format
-         &fmt,                   // format
-         (DWORD) speakerCallbackProc,// callback entry
-         GetCurrentThreadId(),   // instance data
-         CALLBACK_FUNCTION);     // callback function specified
+       res = waveOutOpen(
+          pAudioOutH,             // handle (will be filled in)
+          WAVE_MAPPER,            // select any device able to handle this format
+          &fmt,                   // format
+          (DWORD) speakerCallbackProc,// callback entry
+          //GetCurrentThreadId(),   // instance data
+          _nw32SpkrQid,
+          CALLBACK_FUNCTION);     // callback function specified
    
    if (res != MMSYSERR_NOERROR)
    {
@@ -370,7 +377,8 @@
 
     do 
     {
-        bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        bSuccess = Nw32GetMessage(_nw32SpkrQid, &tMsg) ;
     } while (bSuccess && (tMsg.message != WOM_OPEN)) ;
 
 
@@ -386,7 +394,8 @@
 
     do 
     {
-        bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+        bSuccess = Nw32GetMessage(_nw32SpkrQid, &tMsg) ;
     } while (bSuccess && tMsg.message != WOM_OPEN) ;
 
 
@@ -455,7 +464,8 @@
 
         do 
         {
-            bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+            //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+            bSuccess = Nw32GetMessage(_nw32SpkrQid, &tMsg) ;
         } while (bSuccess && (tMsg.message != WOM_CLOSE)) ;
     }
 
@@ -491,7 +501,8 @@
 
         do 
         {
-            bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+            //bSuccess = GetMessage(&tMsg, NULL, 0, 0) ;
+            bSuccess = Nw32GetMessage(_nw32SpkrQid, &tMsg) ;
         } while (bSuccess && (tMsg.message != WOM_CLOSE)) ;
     }
 }
@@ -552,15 +563,19 @@
     {
         // NOT using a sound card
         // Set up a 10ms timer to call back to this routine
-        timerId = timeSetEvent(10, 0, TimerCallbackProc, GetCurrentThreadId(), TIME_PERIODIC);
+        timerId = timeSetEvent(10, 0, TimerCallbackProc, 
+            //GetCurrentThreadId(),
+            _nw32SpkrQid,
+            TIME_PERIODIC);
     }
 
     played = 0;   
     bDone = false ;
     while (!bDone)
     {
-        bGotMsg = GetMessage(&tMsg, NULL, 0, 0);
-              
+        //bGotMsg = GetMessage(&tMsg, NULL, 0, 0);
+        bGotMsg = Nw32GetMessage(_nw32SpkrQid, &tMsg) ;
+
         // when switching devices, ringer to in-call we need to make 
         // sure any outstanding buffers are flushed
         if (sLastRingerEnabled != DmaTask::isRingerEnabled())
@@ -632,7 +647,10 @@
                     if (openSpeakerDevices(pWH, hOut))
                     {
                         // Open failed - so start the heartbeat timer
-                        timerId = timeSetEvent(10, 0, TimerCallbackProc, GetCurrentThreadId(), TIME_PERIODIC);                    
+                        timerId = timeSetEvent(10, 0, TimerCallbackProc, 
+                            //GetCurrentThreadId(), 
+                            _nw32SpkrQid,
+                            TIME_PERIODIC);                    
                     }
                     continue ;                    
                 }
@@ -669,7 +687,10 @@
                     {
                         if (timerId>0)
                             timeKillEvent(timerId);
-                        timerId = timeSetEvent(10, 0, TimerCallbackProc, GetCurrentThreadId(), TIME_PERIODIC);                    
+                        timerId = timeSetEvent(10, 0, TimerCallbackProc, 
+                            //GetCurrentThreadId(), 
+                            _nw32SpkrQid,
+                            TIME_PERIODIC);                    
                     }
                     continue ;                    
                 }
