ReactOS  0.4.13-dev-563-g0561610
format.c
Go to the documentation of this file.
1 /*
2  * MSACM32 library
3  *
4  * Copyright 1998 Patrik Stridvall
5  * 2000 Eric Pouech
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #include <stdarg.h>
23 #include <string.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winnls.h"
27 #include "winerror.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "wine/unicode.h"
31 #include "wine/debug.h"
32 #include "mmsystem.h"
33 #include "mmreg.h"
34 #include "msacm.h"
35 #include "msacmdrv.h"
36 #include "wineacm.h"
37 
39 
42 #define WINE_ACMFF_TAG 0
43 #define WINE_ACMFF_FORMAT 1
44 #define WINE_ACMFF_WFX 2
45  int mode;
49 };
50 
51 static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid,
53  DWORD_PTR dwInstance,
54  DWORD fdwSupport)
55 {
56  struct MSACM_FillFormatData* affd = (struct MSACM_FillFormatData*)dwInstance;
57 
58  switch (affd->mode) {
59  case WINE_ACMFF_TAG:
60  if (paftd->cStandardFormats > 0)
61  {
64  (LPARAM)paftd->szFormatTag) == CB_ERR)
65  {
67  CB_ADDSTRING, 0, (LPARAM)paftd->szFormatTag);
69  (paftd->dwFormatTag == affd->afc->pwfx->wFormatTag)) ||
71  (paftd->dwFormatTag == WAVE_FORMAT_PCM)))
73  CB_SETCURSEL, index, 0);
74  }
75  }
76  break;
77  case WINE_ACMFF_FORMAT:
78  if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) {
79  HACMDRIVER had;
80 
81  if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) {
82  ACMFORMATDETAILSW afd = {0};
83  unsigned int i, len;
84  MMRESULT mmr;
86 
87  afd.cbStruct = sizeof(afd);
88  afd.dwFormatTag = paftd->dwFormatTag;
89  afd.pwfx = HeapAlloc(MSACM_hHeap, 0, paftd->cbFormatSize);
90  if (!afd.pwfx) return FALSE;
91  afd.pwfx->wFormatTag = paftd->dwFormatTag;
92  if (paftd->dwFormatTag != WAVE_FORMAT_PCM)
93  afd.pwfx->cbSize = paftd->cbFormatSize - sizeof(WAVEFORMATEX);
94  afd.cbwfx = paftd->cbFormatSize;
95 
96  for (i = 0; i < paftd->cStandardFormats; i++) {
97  static const WCHAR fmtW[] = {'%','d',' ','K','o','/','s','\0'};
98  int j, index;
99 
100  afd.dwFormatIndex = i;
101  afd.fdwSupport = 0;
103  if (mmr == MMSYSERR_NOERROR) {
105  len = strlenW(buffer);
107  buffer[j] = ' ';
109  fmtW, (afd.pwfx->nAvgBytesPerSec + 512) / 1024);
112  CB_ADDSTRING, 0, (LPARAM)buffer);
114  affd->afc->cbwfx >= paftd->cbFormatSize &&
115  !memcmp(afd.pwfx, affd->afc->pwfx, paftd->cbFormatSize))
117  CB_SETCURSEL, index, 0);
118  }
119  }
120  acmDriverClose(had, 0);
121  HeapFree(MSACM_hHeap, 0, afd.pwfx);
122  }
123  }
124  break;
125  case WINE_ACMFF_WFX:
126  if (strcmpW(affd->szFormatTag, paftd->szFormatTag) == 0) {
127  HACMDRIVER had;
128 
129  if (acmDriverOpen(&had, hadid, 0) == MMSYSERR_NOERROR) {
130  ACMFORMATDETAILSW afd = {0};
131 
132  afd.cbStruct = sizeof(afd);
133  afd.dwFormatTag = paftd->dwFormatTag;
134  afd.pwfx = affd->afc->pwfx;
135  afd.cbwfx = affd->afc->cbwfx;
136 
138  CB_GETCURSEL, 0, 0);
139  affd->ret = acmFormatDetailsW(had, &afd, ACM_FORMATDETAILSF_INDEX);
140  acmDriverClose(had, 0);
141  return TRUE;
142  }
143  }
144  break;
145  default:
146  FIXME("Unknown mode (%d)\n", affd->mode);
147  break;
148  }
149  return TRUE;
150 }
151 
153 {
155  struct MSACM_FillFormatData affd;
156 
157  memset(&aftd, 0, sizeof(aftd));
158  aftd.cbStruct = sizeof(aftd);
159 
160  affd.hWnd = hWnd;
161  affd.mode = WINE_ACMFF_TAG;
162  affd.afc = afc;
163 
167  return TRUE;
168 }
169 
171 {
173  struct MSACM_FillFormatData affd;
174 
176 
177  memset(&aftd, 0, sizeof(aftd));
178  aftd.cbStruct = sizeof(aftd);
179 
180  affd.hWnd = hWnd;
181  affd.mode = WINE_ACMFF_FORMAT;
182  affd.afc = afc;
184  CB_GETLBTEXT,
186  CB_GETCURSEL, 0, 0),
187  (LPARAM)affd.szFormatTag);
188 
192  return TRUE;
193 }
194 
196 {
198  struct MSACM_FillFormatData affd;
199 
200  memset(&aftd, 0, sizeof(aftd));
201  aftd.cbStruct = sizeof(aftd);
202 
203  affd.hWnd = hWnd;
204  affd.mode = WINE_ACMFF_WFX;
205  affd.afc = afc;
206  affd.ret = MMSYSERR_NOERROR;
208  CB_GETLBTEXT,
210  CB_GETCURSEL, 0, 0),
211  (LPARAM)affd.szFormatTag);
212 
214  return affd.ret;
215 }
216 
217 static const WCHAR fmt_prop[] = {'a','c','m','p','r','o','p','\0'};
218 
221 {
223 
224  TRACE("hwnd=%p msg=%i 0x%08lx 0x%08lx\n", hWnd, msg, wParam, lParam);
225 
226  switch (msg) {
227  case WM_INITDIALOG:
237  FIXME("Unsupported style %08x\n", afc->fdwStyle);
240  return TRUE;
241 
242  case WM_COMMAND:
243  switch (LOWORD(wParam)) {
244  case IDOK:
246  return TRUE;
247  case IDCANCEL:
249  return TRUE;
251  switch (HIWORD(wParam)) {
252  case CBN_SELCHANGE:
254  break;
255  default:
256  TRACE("Dropped dlgNotif (fmtTag): 0x%08x 0x%08lx\n",
257  HIWORD(wParam), lParam);
258  break;
259  }
260  break;
265  break;
266 
267  default:
268  TRACE("Dropped dlgCmd: ctl=%d ntf=0x%04x 0x%08lx\n",
270  break;
271  }
272  break;
273  case WM_CONTEXTMENU:
277  wParam, lParam);
278  break;
279 #if defined(WM_CONTEXTHELP)
280  case WM_CONTEXTHELP:
284  wParam, lParam);
285  break;
286 #endif
287  default:
288  TRACE("Dropped dlgMsg: hwnd=%p msg=%i 0x%08lx 0x%08lx\n",
289  hWnd, msg, wParam, lParam );
290  break;
291  }
292  return FALSE;
293 }
294 
295 /***********************************************************************
296  * acmFormatChooseA (MSACM32.@)
297  */
299 {
300  ACMFORMATCHOOSEW afcw;
301  MMRESULT ret;
302  LPWSTR title = NULL;
303  LPWSTR name = NULL;
304  LPWSTR templ = NULL;
305  DWORD sz;
306 
307  if (pafmtc->cbStruct < sizeof(ACMFORMATCHOOSEA))
308  return MMSYSERR_INVALPARAM;
309 
310  afcw.cbStruct = sizeof(afcw);
311  afcw.fdwStyle = pafmtc->fdwStyle;
312  afcw.hwndOwner = pafmtc->hwndOwner;
313  afcw.pwfx = pafmtc->pwfx;
314  afcw.cbwfx = pafmtc->cbwfx;
315  if (pafmtc->pszTitle)
316  {
317  sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTitle, -1, NULL, 0);
318  if (!(title = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
319  {
321  goto done;
322  }
323  MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTitle, -1, title, sz);
324  }
325  afcw.pszTitle = title;
326  if (pafmtc->pszName)
327  {
328  sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszName, -1, NULL, 0);
329  if (!(name = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
330  {
332  goto done;
333  }
334  MultiByteToWideChar(CP_ACP, 0, pafmtc->pszName, -1, name, sz);
335  }
336  afcw.pszName = name;
337  afcw.cchName = pafmtc->cchName;
338  afcw.fdwEnum = pafmtc->fdwEnum;
339  afcw.pwfxEnum = pafmtc->pwfxEnum;
340  afcw.hInstance = pafmtc->hInstance;
341  if (pafmtc->pszTemplateName)
342  {
343  sz = MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTemplateName, -1, NULL, 0);
344  if (!(templ = HeapAlloc(GetProcessHeap(), 0, sz * sizeof(WCHAR))))
345  {
347  goto done;
348  }
349  MultiByteToWideChar(CP_ACP, 0, pafmtc->pszTemplateName, -1, templ, sz);
350  }
351  afcw.pszTemplateName = templ;
352  /* FIXME: hook procs not supported yet */
353  if (pafmtc->pfnHook)
354  {
355  FIXME("Unsupported hook procs\n");
357  goto done;
358  }
359  ret = acmFormatChooseW(&afcw);
360  if (ret == MMSYSERR_NOERROR)
361  {
362  WideCharToMultiByte(CP_ACP, 0, afcw.szFormatTag, -1, pafmtc->szFormatTag, sizeof(pafmtc->szFormatTag),
363  NULL, NULL);
364  WideCharToMultiByte(CP_ACP, 0, afcw.szFormat, -1, pafmtc->szFormat, sizeof(pafmtc->szFormat),
365  NULL, NULL);
366  if (pafmtc->pszName)
367  WideCharToMultiByte(CP_ACP, 0, afcw.pszName, -1, pafmtc->pszName, pafmtc->cchName, NULL, NULL);
368  }
369 done:
372  HeapFree(GetProcessHeap(), 0, templ);
373  return ret;
374 }
375 
376 /***********************************************************************
377  * acmFormatChooseW (MSACM32.@)
378  */
380 {
381  if (pafmtc->cbStruct < sizeof(ACMFORMATCHOOSEW))
382  return MMSYSERR_INVALPARAM;
383 
384  if (!pafmtc->pwfx)
385  return MMSYSERR_INVALPARAM;
386 
389  pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);
390 
391  if (pafmtc->fdwStyle & ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE)
392  return DialogBoxParamW(pafmtc->hInstance, pafmtc->pszTemplateName,
393  pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);
394 
396  pafmtc->hwndOwner, FormatChooseDlgProc, (LPARAM)pafmtc);
397 }
398 
399 /***********************************************************************
400  * acmFormatDetailsA (MSACM32.@)
401  */
403  DWORD fdwDetails)
404 {
405  ACMFORMATDETAILSW afdw;
406  MMRESULT mmr;
407 
408  if (!pafd)
409  return MMSYSERR_INVALPARAM;
410 
411  memset(&afdw, 0, sizeof(afdw));
412  afdw.cbStruct = sizeof(afdw);
413  afdw.dwFormatIndex = pafd->dwFormatIndex;
414  afdw.dwFormatTag = pafd->dwFormatTag;
415  afdw.fdwSupport = pafd->fdwSupport;
416  afdw.pwfx = pafd->pwfx;
417  afdw.cbwfx = pafd->cbwfx;
418 
419  mmr = acmFormatDetailsW(had, &afdw, fdwDetails);
420  if (mmr == MMSYSERR_NOERROR) {
421  pafd->dwFormatTag = afdw.dwFormatTag;
422  pafd->fdwSupport = afdw.fdwSupport;
423  WideCharToMultiByte( CP_ACP, 0, afdw.szFormat, -1,
424  pafd->szFormat, sizeof(pafd->szFormat), NULL, NULL );
425  }
426  return mmr;
427 }
428 
429 /***********************************************************************
430  * acmFormatDetailsW (MSACM32.@)
431  */
432 MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD fdwDetails)
433 {
434  MMRESULT mmr;
435  static const WCHAR fmt1[] = {'%','d',' ','H','z',0};
436  static const WCHAR fmt2[] = {';',' ','%','d',' ','b','i','t','s',0};
437  ACMFORMATTAGDETAILSW aftd = {0};
438 
439  TRACE("(%p, %p, %d)\n", had, pafd, fdwDetails);
440 
441  if (!pafd)
442  return MMSYSERR_INVALPARAM;
443 
444  if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
445 
446  if (!pafd->pwfx)
447  return MMSYSERR_INVALPARAM;
448 
449  if (pafd->cbwfx < sizeof(PCMWAVEFORMAT))
450  return MMSYSERR_INVALPARAM;
451 
452  if (pafd->fdwSupport)
453  return MMSYSERR_INVALPARAM;
454 
455  if (pafd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
456  return MMSYSERR_INVALPARAM;
457 
458  switch (fdwDetails) {
460  if (pafd->dwFormatTag != pafd->pwfx->wFormatTag) {
461  mmr = MMSYSERR_INVALPARAM;
462  break;
463  }
464  if (had == NULL) {
465  PWINE_ACMDRIVERID padid;
466 
467  mmr = ACMERR_NOTPOSSIBLE;
468  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
469  /* should check for codec only */
471  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
472  mmr = MSACM_Message(had, ACMDM_FORMAT_DETAILS, (LPARAM)pafd, fdwDetails);
473  acmDriverClose(had, 0);
474  if (mmr == MMSYSERR_NOERROR) break;
475  }
476  }
477  } else {
478  mmr = MSACM_Message(had, ACMDM_FORMAT_DETAILS, (LPARAM)pafd, fdwDetails);
479  }
480  break;
482  aftd.cbStruct = sizeof(aftd);
483  aftd.dwFormatTag = pafd->dwFormatTag;
485  if (mmr != MMSYSERR_NOERROR)
486  break;
487  if (pafd->dwFormatIndex >= aftd.cStandardFormats)
488  {
489  mmr = MMSYSERR_INVALPARAM;
490  break;
491  }
492  mmr = MSACM_Message(had, ACMDM_FORMAT_DETAILS, (LPARAM)pafd, fdwDetails);
493  break;
494  default:
495  WARN("Unknown fdwDetails %08x\n", fdwDetails);
496  mmr = MMSYSERR_INVALFLAG;
497  break;
498  }
499 
500  if (mmr == MMSYSERR_NOERROR && pafd->szFormat[0] == 0) {
501  wsprintfW(pafd->szFormat, fmt1, pafd->pwfx->nSamplesPerSec);
502  if (pafd->pwfx->wBitsPerSample) {
503  wsprintfW(pafd->szFormat + lstrlenW(pafd->szFormat), fmt2,
504  pafd->pwfx->wBitsPerSample);
505  }
506  MultiByteToWideChar(CP_ACP, 0, (pafd->pwfx->nChannels == 1) ? "; Mono" : "; Stereo", -1,
507  pafd->szFormat + strlenW(pafd->szFormat),
508  ARRAY_SIZE(pafd->szFormat) - strlenW(pafd->szFormat));
509  }
510 
511  TRACE("=> %d\n", mmr);
512  return mmr;
513 }
514 
519 };
520 
521 static BOOL CALLBACK MSACM_FormatEnumCallbackWtoA(HACMDRIVERID hadid,
522  PACMFORMATDETAILSW pafdw,
523  DWORD_PTR dwInstance,
524  DWORD fdwSupport)
525 {
526  struct MSACM_FormatEnumWtoA_Instance* pafei;
527 
528  pafei = (struct MSACM_FormatEnumWtoA_Instance*)dwInstance;
529 
530  pafei->pafda->dwFormatIndex = pafdw->dwFormatIndex;
531  pafei->pafda->dwFormatTag = pafdw->dwFormatTag;
532  pafei->pafda->fdwSupport = pafdw->fdwSupport;
533  WideCharToMultiByte( CP_ACP, 0, pafdw->szFormat, -1,
534  pafei->pafda->szFormat, sizeof(pafei->pafda->szFormat), NULL, NULL );
535 
536  return (pafei->fnCallback)(hadid, pafei->pafda,
537  pafei->dwInstance, fdwSupport);
538 }
539 
540 /***********************************************************************
541  * acmFormatEnumA (MSACM32.@)
542  */
545  DWORD_PTR dwInstance, DWORD fdwEnum)
546 {
547  ACMFORMATDETAILSW afdw;
548  struct MSACM_FormatEnumWtoA_Instance afei;
549 
550  if (!pafda)
551  return MMSYSERR_INVALPARAM;
552 
553  if (!fnCallback)
554  return MMSYSERR_INVALPARAM;
555 
556  if (pafda->cbStruct < sizeof(*pafda))
557  return MMSYSERR_INVALPARAM;
558 
559  memset(&afdw, 0, sizeof(afdw));
560  afdw.cbStruct = sizeof(afdw);
562  afdw.dwFormatTag = pafda->dwFormatTag;
563  afdw.fdwSupport = pafda->fdwSupport;
564  afdw.pwfx = pafda->pwfx;
565  afdw.cbwfx = pafda->cbwfx;
566 
567  afei.pafda = pafda;
568  afei.dwInstance = dwInstance;
569  afei.fnCallback = fnCallback;
570 
571  return acmFormatEnumW(had, &afdw, MSACM_FormatEnumCallbackWtoA,
572  (DWORD_PTR)&afei, fdwEnum);
573 }
574 
575 /***********************************************************************
576  * acmFormatEnumW (MSACM32.@)
577  */
578 static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
579  PACMFORMATDETAILSW pafd, PWAVEFORMATEX pwfxRef,
581  DWORD_PTR dwInstance, DWORD fdwEnum)
582 {
584  unsigned int i, j;
585 
586  if (fdwEnum & ACM_FORMATENUMF_SUGGEST) {
587  HDRVR hdrvr;
588  ACMDRVFORMATSUGGEST adfs;
589  pafd->dwFormatIndex = 0;
590  memset(&aftd, 0, sizeof(aftd));
591  aftd.cbStruct = sizeof(aftd);
592  memset(&adfs, 0, sizeof(adfs));
593  adfs.cbStruct = sizeof(adfs);
594 
595  for (i = 0; i < padid->cFormatTags; i++) {
596  aftd.dwFormatTag = i;
597  pafd->dwFormatTag = aftd.dwFormatTag;
598  pafd->pwfx->wFormatTag = pafd->dwFormatTag;
599 
601  continue;
602 
603  adfs.cbwfxSrc = aftd.cbFormatSize;
604  adfs.cbwfxDst = aftd.cbFormatSize;
605  adfs.pwfxSrc = pwfxRef;
606  adfs.pwfxDst = pafd->pwfx;
607  pafd->fdwSupport = padid->fdwSupport;
608 
609  if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) &&
610  aftd.dwFormatTag != pwfxRef->wFormatTag)
611  continue;
612 
613  if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
615  continue;
616 
617  hdrvr = OpenDriver(padid->pszFileName,0,0);
618  SendDriverMessage(hdrvr,ACMDM_FORMAT_SUGGEST,(LPARAM)&adfs,(fdwEnum & 0x000000FFL));
619 
621  continue;
622 
623  pafd->cbwfx = sizeof(*(pafd->pwfx));
624 
625  if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
626  return FALSE;
627  }
628  } else {
629  for (i = 0; i < padid->cFormatTags; i++) {
630  memset(&aftd, 0, sizeof(aftd));
631  aftd.cbStruct = sizeof(aftd);
632  aftd.dwFormatTagIndex = i;
634  continue;
635 
636  if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) && aftd.dwFormatTag != pwfxRef->wFormatTag)
637  continue;
638 
639  for (j = 0; j < aftd.cStandardFormats; j++) {
640  pafd->dwFormatIndex = j;
641  pafd->dwFormatTag = aftd.dwFormatTag;
642  pafd->fdwSupport = 0;
644  continue;
645 
646  if ((fdwEnum & ACM_FORMATENUMF_NCHANNELS) &&
647  pafd->pwfx->nChannels != pwfxRef->nChannels)
648  continue;
649  if ((fdwEnum & ACM_FORMATENUMF_NSAMPLESPERSEC) &&
650  pafd->pwfx->nSamplesPerSec != pwfxRef->nSamplesPerSec)
651  continue;
652  if ((fdwEnum & ACM_FORMATENUMF_WBITSPERSAMPLE) &&
653  pafd->pwfx->wBitsPerSample != pwfxRef->wBitsPerSample)
654  continue;
655  if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
657  continue;
658 
659  /* more checks to be done on fdwEnum */
660 
661  if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
662  return FALSE;
663  }
664  /* the "formats" used by the filters are also reported */
665  }
666  }
667  return TRUE;
668 }
669 
670 /**********************************************************************/
671 
674  DWORD_PTR dwInstance, DWORD fdwEnum)
675 {
676  PWINE_ACMDRIVERID padid;
677  WAVEFORMATEX wfxRef;
678  BOOL ret;
679  DWORD cbwfxMax;
680  MMRESULT mmr;
681 
682  TRACE("(%p, %p, %p, %ld, %d)\n",
683  had, pafd, fnCallback, dwInstance, fdwEnum);
684 
685  if (!pafd)
686  return MMSYSERR_INVALPARAM;
687 
688  if (!fnCallback)
689  return MMSYSERR_INVALPARAM;
690 
691  if (pafd->cbStruct < sizeof(*pafd))
692  return MMSYSERR_INVALPARAM;
693 
694  if (pafd->fdwSupport)
695  return MMSYSERR_INVALPARAM;
696 
697  if (!pafd->pwfx)
698  return MMSYSERR_INVALPARAM;
699 
703  wfxRef = *pafd->pwfx;
704 
705  if ((fdwEnum & ACM_FORMATENUMF_HARDWARE) &&
707  return MMSYSERR_INVALPARAM;
708 
709  if ((fdwEnum & ACM_FORMATENUMF_WFORMATTAG) &&
710  (pafd->dwFormatTag != pafd->pwfx->wFormatTag))
711  return MMSYSERR_INVALPARAM;
712 
714  FIXME("Unsupported fdwEnum values %08x\n", fdwEnum);
715 
716  mmr = acmMetrics((HACMOBJ)had, ACM_METRIC_MAX_SIZE_FORMAT, &cbwfxMax);
717  if (mmr != MMSYSERR_NOERROR)
718  return mmr;
719  if (pafd->cbwfx < cbwfxMax)
720  return MMSYSERR_INVALPARAM;
721 
722  if (had) {
723  HACMDRIVERID hadid;
724 
725  if (acmDriverID((HACMOBJ)had, &hadid, 0) != MMSYSERR_NOERROR)
726  return MMSYSERR_INVALHANDLE;
727  MSACM_FormatEnumHelper(MSACM_GetDriverID(hadid), had, pafd, &wfxRef,
728  fnCallback, dwInstance, fdwEnum);
729  return MMSYSERR_NOERROR;
730  }
731  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
732  /* should check for codec only */
734  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
735  continue;
736  ret = MSACM_FormatEnumHelper(padid, had, pafd, &wfxRef,
737  fnCallback, dwInstance, fdwEnum);
738  acmDriverClose(had, 0);
739  if (!ret) break;
740  }
741  return MMSYSERR_NOERROR;
742 }
743 
744 /***********************************************************************
745  * acmFormatSuggest (MSACM32.@)
746  */
748  PWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest)
749 {
750  ACMFORMATTAGDETAILSW aftd = {0};
751  ACMDRVFORMATSUGGEST adfg;
752  MMRESULT mmr;
753 
754  TRACE("(%p, %p, %p, %d, %d)\n",
755  had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest);
756 
757  if (!pwfxSrc || !pwfxDst)
758  return MMSYSERR_INVALPARAM;
759 
762  return MMSYSERR_INVALFLAG;
763 
764  /* if we were given PCM, try to convert to PCM */
765  if (pwfxSrc->wFormatTag == WAVE_FORMAT_PCM && !had &&
766  !(fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG))
767  {
768  ACMFORMATDETAILSW afd = {0};
769  afd.cbStruct = sizeof(afd);
771  afd.pwfx = pwfxSrc;
772  afd.cbwfx = sizeof(PCMWAVEFORMAT);
774  {
775  memcpy(pwfxDst, pwfxSrc, sizeof(PCMWAVEFORMAT));
776  return MMSYSERR_NOERROR;
777  }
778  }
779 
780  aftd.cbStruct = sizeof(aftd);
781  if (fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)
782  aftd.dwFormatTag = pwfxDst->wFormatTag;
784  if ((fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG) && mmr == ACMERR_NOTPOSSIBLE)
785  return ACMERR_NOTPOSSIBLE;
786 
787  if (cbwfxDst < aftd.cbFormatSize)
788  return MMSYSERR_INVALPARAM;
789 
790  adfg.cbStruct = sizeof(adfg);
791  adfg.fdwSuggest = fdwSuggest;
792  adfg.pwfxSrc = pwfxSrc;
793  adfg.cbwfxSrc = (pwfxSrc->wFormatTag == WAVE_FORMAT_PCM) ?
794  sizeof(WAVEFORMATEX) : (sizeof(WAVEFORMATEX) + pwfxSrc->cbSize);
795  adfg.pwfxDst = pwfxDst;
796  adfg.cbwfxDst = cbwfxDst;
797 
798  if (had == NULL) {
799  PWINE_ACMDRIVERID padid;
800 
801  /* MS doc says: ACM finds the best suggestion.
802  * Well, first found will be the "best"
803  */
804  mmr = ACMERR_NOTPOSSIBLE;
805  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
806  /* should check for codec only */
808  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
809  continue;
810 
812  mmr = MMSYSERR_NOERROR;
813  break;
814  }
815  acmDriverClose(had, 0);
816  }
817  } else {
818  mmr = MSACM_Message(had, ACMDM_FORMAT_SUGGEST, (LPARAM)&adfg, 0L);
819  }
820  return mmr;
821 }
822 
823 /***********************************************************************
824  * acmFormatTagDetailsA (MSACM32.@)
825  */
827  DWORD fdwDetails)
828 {
829  ACMFORMATTAGDETAILSW aftdw;
830  MMRESULT mmr;
831 
832  memset(&aftdw, 0, sizeof(aftdw));
833  aftdw.cbStruct = sizeof(aftdw);
834  aftdw.dwFormatTagIndex = paftda->dwFormatTagIndex;
835  aftdw.dwFormatTag = paftda->dwFormatTag;
836 
837  mmr = acmFormatTagDetailsW(had, &aftdw, fdwDetails);
838  if (mmr == MMSYSERR_NOERROR) {
839  paftda->dwFormatTag = aftdw.dwFormatTag;
840  paftda->dwFormatTagIndex = aftdw.dwFormatTagIndex;
841  paftda->cbFormatSize = aftdw.cbFormatSize;
842  paftda->fdwSupport = aftdw.fdwSupport;
843  paftda->cStandardFormats = aftdw.cStandardFormats;
844  WideCharToMultiByte( CP_ACP, 0, aftdw.szFormatTag, -1, paftda->szFormatTag,
845  sizeof(paftda->szFormatTag), NULL, NULL );
846  }
847  return mmr;
848 }
849 
850 /***********************************************************************
851  * acmFormatTagDetailsW (MSACM32.@)
852  */
854  DWORD fdwDetails)
855 {
856  PWINE_ACMDRIVERID padid;
858 
859  TRACE("(%p, %p, %d)\n", had, paftd, fdwDetails);
860 
863  return MMSYSERR_INVALFLAG;
864 
865  switch (fdwDetails) {
867  if (had == NULL) {
868  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
869  /* should check for codec only */
871  MSACM_FindFormatTagInCache(padid, paftd->dwFormatTag, NULL) &&
872  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
873  mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails);
874  acmDriverClose(had, 0);
875  if (mmr == MMSYSERR_NOERROR) break;
876  }
877  }
878  } else {
880 
881  if (pad && MSACM_FindFormatTagInCache(pad->obj.pACMDriverID, paftd->dwFormatTag, NULL))
882  mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails);
883  }
884  break;
885 
887  if (had != NULL) {
889 
890  if (pad && paftd->dwFormatTagIndex < pad->obj.pACMDriverID->cFormatTags)
891  mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails);
892  }
893  break;
894 
896  if (had == NULL) {
898  DWORD ft = paftd->dwFormatTag;
899 
900  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
901  /* should check for codec only */
903  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
904 
905  memset(&tmp, 0, sizeof(tmp));
906  tmp.cbStruct = sizeof(tmp);
907  tmp.dwFormatTag = ft;
908 
910  (LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) {
911  if (mmr == ACMERR_NOTPOSSIBLE ||
912  paftd->cbFormatSize < tmp.cbFormatSize) {
913  *paftd = tmp;
914  mmr = MMSYSERR_NOERROR;
915  }
916  }
917  acmDriverClose(had, 0);
918  }
919  }
920  } else {
921  mmr = MSACM_Message(had, ACMDM_FORMATTAG_DETAILS, (LPARAM)paftd, fdwDetails);
922  }
923  break;
924 
925  default:
926  WARN("Unsupported fdwDetails=%08x\n", fdwDetails);
927  mmr = MMSYSERR_ERROR;
928  }
929 
930  if (mmr == MMSYSERR_NOERROR &&
931  paftd->dwFormatTag == WAVE_FORMAT_PCM && paftd->szFormatTag[0] == 0)
932  MultiByteToWideChar(CP_ACP, 0, "PCM", -1, paftd->szFormatTag,
933  ARRAY_SIZE(paftd->szFormatTag));
934 
935  return mmr;
936 }
937 
942 };
943 
945  PACMFORMATTAGDETAILSW paftdw,
946  DWORD_PTR dwInstance,
947  DWORD fdwSupport)
948 {
949  struct MSACM_FormatTagEnumWtoA_Instance* paftei;
950 
952 
953  paftei->paftda->dwFormatTagIndex = paftdw->dwFormatTagIndex;
954  paftei->paftda->dwFormatTag = paftdw->dwFormatTag;
955  paftei->paftda->cbFormatSize = paftdw->cbFormatSize;
956  paftei->paftda->fdwSupport = paftdw->fdwSupport;
957  paftei->paftda->cStandardFormats = paftdw->cStandardFormats;
958  WideCharToMultiByte( CP_ACP, 0, paftdw->szFormatTag, -1, paftei->paftda->szFormatTag,
959  sizeof(paftei->paftda->szFormatTag), NULL, NULL );
960 
961  return (paftei->fnCallback)(hadid, paftei->paftda,
962  paftei->dwInstance, fdwSupport);
963 }
964 
965 /***********************************************************************
966  * acmFormatTagEnumA (MSACM32.@)
967  */
970  DWORD_PTR dwInstance, DWORD fdwEnum)
971 {
972  ACMFORMATTAGDETAILSW aftdw;
974 
975  if (!paftda)
976  return MMSYSERR_INVALPARAM;
977 
978  if (paftda->cbStruct < sizeof(*paftda))
979  return MMSYSERR_INVALPARAM;
980 
981  if (fdwEnum != 0)
982  return MMSYSERR_INVALFLAG;
983 
984  memset(&aftdw, 0, sizeof(aftdw));
985  aftdw.cbStruct = sizeof(aftdw);
987  aftdw.dwFormatTag = paftda->dwFormatTag;
988 
989  aftei.paftda = paftda;
990  aftei.dwInstance = dwInstance;
991  aftei.fnCallback = fnCallback;
992 
994  (DWORD_PTR)&aftei, fdwEnum);
995 }
996 
997 /***********************************************************************
998  * acmFormatTagEnumW (MSACM32.@)
999  */
1002  DWORD_PTR dwInstance, DWORD fdwEnum)
1003 {
1004  PWINE_ACMDRIVERID padid;
1005  unsigned int i;
1006  BOOL bPcmDone = FALSE;
1007 
1008  TRACE("(%p, %p, %p, %ld, %d)\n",
1009  had, paftd, fnCallback, dwInstance, fdwEnum);
1010 
1011  if (!paftd)
1012  return MMSYSERR_INVALPARAM;
1013 
1014  if (paftd->cbStruct < sizeof(*paftd))
1015  return MMSYSERR_INVALPARAM;
1016 
1017  if (fdwEnum != 0)
1018  return MMSYSERR_INVALFLAG;
1019 
1020  /* (WS) MSDN info page says that if had != 0, then we should find
1021  * the specific driver to get its tags from. Therefore I'm removing
1022  * the FIXME call and adding a search block below. It also seems
1023  * that the lack of this functionality was the responsible for
1024  * codecs to be multiply and incorrectly listed.
1025  */
1026 
1027  /* if (had) FIXME("had != NULL, not supported\n"); */
1028 
1029  if (had) {
1030  if (acmDriverID((HACMOBJ)had, (HACMDRIVERID *)&padid, 0) != MMSYSERR_NOERROR)
1031  return MMSYSERR_INVALHANDLE;
1032 
1033  for (i = 0; i < padid->cFormatTags; i++) {
1034  paftd->dwFormatTagIndex = i;
1037  if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
1038  if (paftd->szFormatTag[0] == 0)
1039  MultiByteToWideChar(CP_ACP, 0, "PCM", -1, paftd->szFormatTag,
1040  ARRAY_SIZE(paftd->szFormatTag));
1041  /* (WS) I'm preserving this PCM hack since it seems to be
1042  * correct. Please notice this block was borrowed from
1043  * below.
1044  */
1045  if (bPcmDone) continue;
1046  bPcmDone = TRUE;
1047  }
1048  if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport))
1049  return MMSYSERR_NOERROR;
1050  }
1051  }
1052  }
1053  /* if had==0 then search for the first suitable driver */
1054  else {
1055  for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
1056  /* should check for codec only */
1058  acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
1059  for (i = 0; i < padid->cFormatTags; i++) {
1060  paftd->dwFormatTagIndex = i;
1063  if (paftd->dwFormatTag == WAVE_FORMAT_PCM) {
1064  if (paftd->szFormatTag[0] == 0)
1065  MultiByteToWideChar(CP_ACP, 0, "PCM", -1, paftd->szFormatTag,
1066  ARRAY_SIZE(paftd->szFormatTag));
1067  /* FIXME (EPP): I'm not sure this is the correct
1068  * algorithm (should make more sense to apply the same
1069  * for all already loaded formats, but this will do
1070  * for now
1071  */
1072  if (bPcmDone) continue;
1073  bPcmDone = TRUE;
1074  }
1075  if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) {
1076  acmDriverClose(had, 0);
1077  return MMSYSERR_NOERROR;
1078  }
1079  }
1080  }
1081  acmDriverClose(had, 0);
1082  }
1083  }
1084  }
1085  return MMSYSERR_NOERROR;
1086 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static BOOL MSACM_FillFormat(HWND hWnd, PACMFORMATCHOOSEW afc)
Definition: format.c:170
static BOOL CALLBACK MSACM_FillFormatTagsCB(HACMDRIVERID hadid, PACMFORMATTAGDETAILSW paftd, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: format.c:51
#define ACMFORMATDETAILS_FORMAT_CHARS
Definition: msacm.h:158
PWAVEFORMATEX pwfx
Definition: msacm.h:507
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:131
DWORD cbStruct
Definition: msacm.h:436
DWORD fdwSupport
Definition: wineacm.h:97
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL(CALLBACK * ACMFORMATTAGENUMCBA)(HACMDRIVERID hadid, PACMFORMATTAGDETAILSA paftd, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: msacm.h:606
#define ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATEHANDLE
Definition: msacm.h:154
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WideCharToMultiByte
Definition: compat.h:101
#define ACM_FORMATENUMF_SUGGEST
Definition: msacm.h:169
static const WCHAR fmt_prop[]
Definition: format.c:217
PACMFORMATTAGDETAILSA paftda
Definition: format.c:939
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: format.c:46
DWORD cbStruct
Definition: msacm.h:492
#define ACM_FORMATENUMF_NCHANNELS
Definition: msacm.h:165
DWORD cbStruct
Definition: msacm.h:462
#define CB_GETLBTEXT
Definition: winuser.h:1913
#define SW_HIDE
Definition: winuser.h:762
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153
#define CP_ACP
Definition: compat.h:99
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:472
WORD nChannels
Definition: mmreg.h:79
#define WARN(fmt,...)
Definition: debug.h:111
#define WINE_ACMFF_WFX
Definition: format.c:44
#define CALLBACK
Definition: compat.h:27
DWORD cFormatTags
Definition: wineacm.h:96
HWND hWnd
Definition: settings.c:17
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
MMRESULT WINAPI acmFormatTagEnumA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, ACMFORMATTAGENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum)
Definition: format.c:968
MMRESULT WINAPI acmFormatChooseW(PACMFORMATCHOOSEW pafmtc)
Definition: format.c:379
static BOOL CALLBACK MSACM_FormatTagEnumCallbackWtoA(HACMDRIVERID hadid, PACMFORMATTAGDETAILSW paftdw, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: format.c:944
ACMFORMATTAGENUMCBA fnCallback
Definition: format.c:941
UINT MMRESULT
Definition: mmsystem.h:962
GLuint buffer
Definition: glext.h:5915
struct tWAVEFORMATEX WAVEFORMATEX
Definition: austream.idl:23
HWND hwndOwner
Definition: msacm.h:439
UINT_PTR WPARAM
Definition: windef.h:207
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define IDD_ACMFORMATCHOOSE_BTN_HELP
Definition: msacmdlg.h:24
CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:524
MMRESULT WINAPI acmFormatDetailsA(HACMDRIVER had, PACMFORMATDETAILSA pafd, DWORD fdwDetails)
Definition: format.c:402
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int32_t INT_PTR
Definition: typedefs.h:62
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
HDRVR WINAPI OpenDriver(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lParam)
Definition: driver.c:400
struct pcmwaveformat_tag PCMWAVEFORMAT
#define lstrlenW
Definition: compat.h:407
DWORD dwFormatTagIndex
Definition: msacm.h:519
LPCWSTR pszTitle
Definition: msacm.h:469
#define DLG_ACMFORMATCHOOSE_ID
Definition: msacmdlg.h:23
#define CB_GETCURSEL
Definition: winuser.h:1904
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
PACMFORMATCHOOSEW afc
Definition: format.c:47
BOOL(CALLBACK * ACMFORMATENUMCBW)(HACMDRIVERID hadid, PACMFORMATDETAILSW pafd, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: msacm.h:599
#define lstrcpynW
Definition: compat.h:397
BOOL MSACM_FindFormatTagInCache(const WINE_ACMDRIVERID *padid, DWORD fmtTag, LPDWORD idx)
Definition: internal.c:116
ACMFORMATENUMCBA fnCallback
Definition: format.c:518
#define ACMDM_FORMAT_SUGGEST
Definition: msacmdrv.h:53
MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
Definition: driver.c:182
LPCSTR pszTitle
Definition: msacm.h:443
DWORD fdwStyle
Definition: msacm.h:463
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
#define ACMFORMATCHOOSE_STYLEF_CONTEXTHELP
Definition: msacm.h:156
#define WAVE_FORMAT_PCM
Definition: constants.h:425
static BOOL CALLBACK MSACM_FormatEnumCallbackWtoA(HACMDRIVERID hadid, PACMFORMATDETAILSW pafdw, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: format.c:521
#define ACM_FORMATENUMF_INPUT
Definition: msacm.h:171
PWAVEFORMATEX pwfx
Definition: msacm.h:496
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
unsigned int BOOL
Definition: ntddk_ex.h:94
HWND hwndOwner
Definition: msacm.h:465
MMRESULT WINAPI acmFormatTagDetailsA(HACMDRIVER had, PACMFORMATTAGDETAILSA paftda, DWORD fdwDetails)
Definition: format.c:826
PWAVEFORMATEX pwfx
Definition: msacm.h:467
static INT_PTR CALLBACK FormatChooseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: format.c:219
#define ACMERR_CANCELED
Definition: msacm.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
LPCWSTR pszTemplateName
Definition: msacm.h:481
HANDLE MSACM_hHeap
Definition: internal.c:45
MMRESULT WINAPI acmMetrics(HACMOBJ hao, UINT uMetric, LPVOID pMetric)
Definition: msacm32_main.c:106
#define CB_ADDSTRING
Definition: winuser.h:1897
DWORD cStandardFormats
Definition: msacm.h:534
smooth NULL
Definition: ftsmooth.c:416
DWORD fdwEnum
Definition: msacm.h:477
static const WCHAR ACMHELPMSGCONTEXTMENUW[]
Definition: msacm.h:127
LONG_PTR LPARAM
Definition: windef.h:208
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
DWORD cchName
Definition: msacm.h:449
DWORD dwFormatIndex
Definition: msacm.h:493
GLuint index
Definition: glext.h:6031
#define CB_RESETCONTENT
Definition: winuser.h:1920
#define CB_ERR
Definition: winuser.h:2389
PWINE_ACMDRIVERID pNextACMDriverID
Definition: wineacm.h:92
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define ACM_FORMATENUMF_WFORMATTAG
Definition: msacm.h:164
#define IDD_ACMFORMATCHOOSE_CMB_FORMATTAG
Definition: msacmdlg.h:26
MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID)
Definition: driver.c:355
static void pad(Char *s)
Definition: bzip2.c:908
static const WCHAR ACMHELPMSGSTRINGW[]
Definition: msacm.h:115
#define TRACE(s)
Definition: solgame.cpp:4
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:471
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MMSYSERR_ERROR
Definition: mmsystem.h:97
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
static const WCHAR ACMHELPMSGCONTEXTHELPW[]
Definition: msacm.h:139
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define ACMDRIVERDETAILS_SUPPORTF_HARDWARE
Definition: msacm.h:64
MMRESULT WINAPI acmFormatTagDetailsW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, DWORD fdwDetails)
Definition: format.c:853
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
#define ACM_FORMATENUMF_NSAMPLESPERSEC
Definition: msacm.h:166
CHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:445
#define IDD_ACMFORMATCHOOSE_CMB_FORMAT
Definition: msacmdlg.h:27
#define WINAPI
Definition: msvc.h:8
BOOL(CALLBACK * ACMFORMATENUMCBA)(HACMDRIVERID hadid, PACMFORMATDETAILSA pafd, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: msacm.h:594
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen)
Definition: driver.c:494
static BOOL MSACM_FormatEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had, PACMFORMATDETAILSW pafd, PWAVEFORMATEX pwfxRef, ACMFORMATENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum)
Definition: format.c:578
MMRESULT MSACM_Message(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: internal.c:865
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
PACMFORMATDETAILSA pafda
Definition: format.c:516
PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
Definition: internal.c:837
WORD wFormatTag
Definition: mmreg.h:78
DWORD dwFormatIndex
Definition: msacm.h:504
int ret
#define index(s, c)
Definition: various.h:29
static const WCHAR L[]
Definition: oid.c:1250
DWORD cStandardFormats
Definition: msacm.h:523
PWINE_ACMDRIVERID MSACM_pFirstACMDriverID
Definition: internal.c:46
#define ACMFORMATCHOOSE_STYLEF_SHOWHELP
Definition: msacm.h:151
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ACM_FORMATENUMF_CONVERT
Definition: msacm.h:168
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:498
#define CB_SETCURSEL
Definition: winuser.h:1922
DWORD fdwSupport
Definition: msacm.h:495
#define ACM_FORMATENUMF_HARDWARE
Definition: msacm.h:170
#define WM_COMMAND
Definition: winuser.h:1716
DWORD dwFormatTagIndex
Definition: msacm.h:530
uint32_t DWORD_PTR
Definition: typedefs.h:63
DWORD dwFormatTag
Definition: msacm.h:494
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
MMRESULT WINAPI acmFormatDetailsW(HACMDRIVER had, PACMFORMATDETAILSW pafd, DWORD fdwDetails)
Definition: format.c:432
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
MMRESULT WINAPI acmFormatEnumA(HACMDRIVER had, PACMFORMATDETAILSA pafda, ACMFORMATENUMCBA fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum)
Definition: format.c:543
CHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:446
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define WINE_ACMFF_FORMAT
Definition: format.c:43
#define ARRAY_SIZE(a)
Definition: main.h:24
DWORD fdwSupport
Definition: msacm.h:506
MMRESULT WINAPI acmFormatSuggest(HACMDRIVER had, PWAVEFORMATEX pwfxSrc, PWAVEFORMATEX pwfxDst, DWORD cbwfxDst, DWORD fdwSuggest)
Definition: format.c:747
static BOOL MSACM_FillFormatTags(HWND hWnd, PACMFORMATCHOOSEW afc)
Definition: format.c:152
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD cbSize
Definition: mmreg.h:84
ACMFORMATCHOOSEHOOKPROCA pfnHook
Definition: msacm.h:457
DWORD cbStruct
Definition: msacm.h:503
DWORD cchName
Definition: msacm.h:475
PWAVEFORMATEX pwfx
Definition: msacm.h:441
INT_PTR WINAPI DialogBoxIndirectParamW(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
HINSTANCE hInstance
Definition: msacm.h:480
PWAVEFORMATEX pwfxEnum
Definition: msacm.h:452
MMRESULT WINAPI acmFormatEnumW(HACMDRIVER had, PACMFORMATDETAILSW pafd, ACMFORMATENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum)
Definition: format.c:672
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
MMRESULT WINAPI acmFormatTagEnumW(HACMDRIVER had, PACMFORMATTAGDETAILSW paftd, ACMFORMATTAGENUMCBW fnCallback, DWORD_PTR dwInstance, DWORD fdwEnum)
Definition: format.c:1000
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
#define CBN_SELCHANGE
Definition: winuser.h:1940
struct _ACMFORMATCHOOSEW * PACMFORMATCHOOSEW
BOOL(CALLBACK * ACMFORMATTAGENUMCBW)(HACMDRIVERID hadid, PACMFORMATTAGDETAILSW paftd, DWORD_PTR dwInstance, DWORD fdwSupport)
Definition: msacm.h:611
#define MultiByteToWideChar
Definition: compat.h:100
#define ACMDRIVERDETAILS_SUPPORTF_DISABLED
Definition: msacm.h:67
MMRESULT WINAPI acmFormatChooseA(PACMFORMATCHOOSEA pafmtc)
Definition: format.c:298
DWORD nSamplesPerSec
Definition: mmreg.h:80
#define msg(x)
Definition: auth_time.c:54
LPSTR pszName
Definition: msacm.h:448
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
DWORD fdwEnum
Definition: msacm.h:451
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
WORD wBitsPerSample
Definition: mmreg.h:83
#define ACMFORMATCHOOSE_STYLEF_ENABLETEMPLATE
Definition: msacm.h:153
#define HIWORD(l)
Definition: typedefs.h:246
int i
Definition: format.c:271
LPCSTR pszTemplateName
Definition: msacm.h:455
#define ACM_FORMATENUMF_OUTPUT
Definition: msacm.h:172
LPWSTR pszFileName
Definition: wineacm.h:89
#define ACMFORMATTAGDETAILS_FORMATTAG_CHARS
Definition: msacm.h:180
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
Definition: internal.c:829
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
HINSTANCE MSACM_hInstance32
Definition: msacm32_main.c:40
DWORD dwFormatTag
Definition: msacm.h:505
#define memset(x, y, z)
Definition: compat.h:39
LPWSTR pszName
Definition: msacm.h:474
static MMRESULT MSACM_GetWFX(HWND hWnd, PACMFORMATCHOOSEW afc)
Definition: format.c:195
WINE_DEFAULT_DEBUG_CHANNEL(msacm)
#define WM_INITDIALOG
Definition: winuser.h:1715
DWORD fdwStyle
Definition: msacm.h:437
#define ACM_METRIC_MAX_SIZE_FORMAT
Definition: msacm.h:200
LPARAM lParam
Definition: combotst.c:139
static char title[]
Definition: ps.c:92
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT
Definition: msacm.h:155
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
HINSTANCE hInstance
Definition: msacm.h:454
#define ACM_FORMATENUMF_WBITSPERSAMPLE
Definition: msacm.h:167
LPWAVEFORMATEX pwfxEnum
Definition: msacm.h:478
#define WINE_ACMFF_TAG
Definition: format.c:42
GLuint const GLchar * name
Definition: glext.h:6031
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1901