Sync with trunk r63174.
[reactos.git] / dll / win32 / msgsm32.acm / msgsm32.c
index 12dfef9..be09b90 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "config.h"
-#include <wine/port.h>
+#define WIN32_NO_STATUS
 
-#include <assert.h>
+#include <config.h>
+//#include <wine/port.h>
+
+//#include <assert.h>
 #include <stdarg.h>
-#include <string.h>
+//#include <string.h>
 
 #ifdef HAVE_GSM_GSM_H
 #include <gsm/gsm.h>
 #include <gsm.h>
 #endif
 
-#include "windef.h"
-#include "winbase.h"
-#include "wingdi.h"
-#include "winuser.h"
-#include "winnls.h"
-#include "mmsystem.h"
-#include "mmreg.h"
-#include "msacm.h"
-#include "msacmdrv.h"
-#include "wine/library.h"
-#include "wine/debug.h"
+#include <windef.h>
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
+#include <winnls.h>
+//#include "mmsystem.h"
+//#include "mmreg.h"
+//#include "msacm.h"
+#include <msacmdrv.h>
+//#include "wine/library.h"
+#include <wine/debug.h>
 
 WINE_DEFAULT_DEBUG_CHANNEL(gsm);
 
@@ -61,13 +63,13 @@ FUNCPTR(gsm_decode);
     if((p##f = wine_dlsym(libgsm_handle, #f, NULL, 0)) == NULL) { \
         wine_dlclose(libgsm_handle, NULL, 0); \
         libgsm_handle = NULL; \
-        return 0; \
+        return FALSE; \
     }
 
 /***********************************************************************
  *           GSM_drvLoad
  */
-static LRESULT GSM_drvLoad(void)
+static BOOL GSM_drvLoad(void)
 {
     char error[128];
 
@@ -79,12 +81,12 @@ static LRESULT GSM_drvLoad(void)
         LOAD_FUNCPTR(gsm_option);
         LOAD_FUNCPTR(gsm_encode);
         LOAD_FUNCPTR(gsm_decode);
-        return 1;
+        return TRUE;
     }
     else
     {
         ERR("Couldn't load " SONAME_LIBGSM ": %s\n", error);
-        return 0;
+        return FALSE;
     }
 }
 
@@ -137,10 +139,10 @@ static    LRESULT GSM_DriverDetails(PACMDRIVERDETAILSW add)
 }
 
 /* Validate a WAVEFORMATEX structure */
-static DWORD GSM_FormatValidate(const WAVEFORMATEX *wfx)
+static BOOL GSM_FormatValidate(const WAVEFORMATEX *wfx)
 {
     if (wfx->nChannels != 1)
-        return 0;
+        return FALSE;
 
     switch (wfx->wFormatTag)
     {
@@ -148,54 +150,54 @@ static DWORD GSM_FormatValidate(const WAVEFORMATEX *wfx)
         if (wfx->wBitsPerSample != 16)
         {
             WARN("PCM wBitsPerSample %u\n", wfx->wBitsPerSample);
-            return 0;
+            return FALSE;
         }
         if (wfx->nBlockAlign != 2)
         {
             WARN("PCM nBlockAlign %u\n", wfx->nBlockAlign);
-            return 0;
+            return FALSE;
         }
         if (wfx->nAvgBytesPerSec != wfx->nBlockAlign * wfx->nSamplesPerSec)
         {
             WARN("PCM nAvgBytesPerSec %u/%u\n",
                  wfx->nAvgBytesPerSec,
                  wfx->nBlockAlign * wfx->nSamplesPerSec);
-            return 0;
+            return FALSE;
         }
-        return 1;
+        return TRUE;
     case WAVE_FORMAT_GSM610:
         if (wfx->cbSize < sizeof(WORD))
         {
             WARN("GSM cbSize %u\n", wfx->cbSize);
-            return 0;
+            return FALSE;
         }
         if (wfx->wBitsPerSample != 0)
         {
             WARN("GSM wBitsPerSample %u\n", wfx->wBitsPerSample);
-            return 0;
+            return FALSE;
         }
         if (wfx->nBlockAlign != 65)
         {
             WARN("GSM nBlockAlign %u\n", wfx->nBlockAlign);
-            return 0;
+            return FALSE;
         }
         if (((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320)
         {
             WARN("GSM wSamplesPerBlock %u\n",
                  ((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock);
-            return 0;
+            return FALSE;
         }
         if (wfx->nAvgBytesPerSec != wfx->nSamplesPerSec * 65 / 320)
         {
             WARN("GSM nAvgBytesPerSec %d / %d\n",
                  wfx->nAvgBytesPerSec, wfx->nSamplesPerSec * 65 / 320);
-            return 0;
+            return FALSE;
         }
-        return 1;
+        return TRUE;
     default:
-        return 0;
+        return FALSE;
     }
-    return 0;
+    return FALSE;
 }
 
 static const DWORD gsm_rates[] = { 8000, 11025, 22050, 44100, 48000, 96000 };
@@ -221,7 +223,7 @@ static      LRESULT GSM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
             aftd->dwFormatTagIndex = 1;
            break;
        }
-       /* fall thru */
+       /* fall through */
     case ACM_FORMATTAGDETAILSF_FORMATTAG:
        switch (aftd->dwFormatTag)
         {
@@ -510,7 +512,7 @@ static LRESULT GSM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER
             return ACMERR_NOTPOSSIBLE;
         }
 
-        /* The packing algorythm writes 32 bytes, then 33 bytes,
+        /* The packing algorithm writes 32 bytes, then 33 bytes,
          * and it seems to pad to align to 65 bytes always
          * adding extra data where necessary
          */
@@ -618,7 +620,7 @@ LRESULT CALLBACK GSM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
     case ACMDM_STREAM_CONVERT:
        return GSM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
 #else
-    case ACMDM_STREAM_OPEN: ERR("libgsm support not compiled in!\n");
+    case ACMDM_STREAM_OPEN: WARN("libgsm support not compiled in!\n");
     case ACMDM_STREAM_CLOSE:
     case ACMDM_STREAM_SIZE:
     case ACMDM_STREAM_CONVERT: