Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

  1. /*****************************************************************************
  2. *
  3. * Component: sndvol32.exe
  4. * File: pvcd.c
  5. * Purpose: volume control line meta description
  6. *
  7. * Copyright (c) 1985-1995 Microsoft Corporation
  8. *
  9. *****************************************************************************/
  10. #include <windows.h>
  11. #include <mmsystem.h>
  12. #include <windowsx.h>
  13. #include "volumei.h"
  14. PVOLCTRLDESC PVCD_AddLine(
  15. PVOLCTRLDESC pvcd,
  16. int iDev,
  17. DWORD dwType,
  18. LPTSTR szShortName,
  19. LPTSTR szName,
  20. DWORD dwSupport,
  21. DWORD *cLines)
  22. {
  23. PVOLCTRLDESC pvcdNew;
  24. if (pvcd)
  25. {
  26. pvcdNew = (PVOLCTRLDESC)GlobalReAllocPtr(pvcd, (*cLines+1)*sizeof(VOLCTRLDESC), GHND );
  27. }
  28. else
  29. {
  30. pvcdNew = (PVOLCTRLDESC)GlobalAllocPtr(GHND, (*cLines+1)*sizeof(VOLCTRLDESC));
  31. }
  32. if (!pvcdNew)
  33. return NULL;
  34. pvcdNew[*cLines].iVCD = *cLines;
  35. pvcdNew[*cLines].iDeviceID = iDev;
  36. pvcdNew[*cLines].dwType = dwType;
  37. pvcdNew[*cLines].dwSupport = dwSupport;
  38. lstrcpyn(pvcdNew[*cLines].szShortName
  39. , szShortName
  40. , MIXER_SHORT_NAME_CHARS);
  41. lstrcpyn(pvcdNew[*cLines].szName
  42. , szName
  43. , MIXER_LONG_NAME_CHARS);
  44. *cLines = *cLines + 1;
  45. return pvcdNew;
  46. }