Leaked source code of windows server 2003
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.

59 lines
1.5 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. #define STRSAFE_LIB
  15. #include <strsafe.h>
  16. PVOLCTRLDESC PVCD_AddLine(
  17. PVOLCTRLDESC pvcd,
  18. int iDev,
  19. DWORD dwType,
  20. LPTSTR szShortName,
  21. LPTSTR szName,
  22. DWORD dwSupport,
  23. DWORD *cLines)
  24. {
  25. PVOLCTRLDESC pvcdNew;
  26. if (pvcd)
  27. {
  28. pvcdNew = (PVOLCTRLDESC)GlobalReAllocPtr(pvcd, (*cLines+1)*sizeof(VOLCTRLDESC), GHND );
  29. }
  30. else
  31. {
  32. pvcdNew = (PVOLCTRLDESC)GlobalAllocPtr(GHND, (*cLines+1)*sizeof(VOLCTRLDESC));
  33. }
  34. if (!pvcdNew)
  35. return NULL;
  36. pvcdNew[*cLines].iVCD = *cLines;
  37. pvcdNew[*cLines].iDeviceID = iDev;
  38. pvcdNew[*cLines].dwType = dwType;
  39. pvcdNew[*cLines].dwSupport = dwSupport;
  40. StringCchCopy(pvcdNew[*cLines].szShortName
  41. , SIZEOF(pvcdNew[*cLines].szShortName)
  42. , szShortName);
  43. StringCchCopy(pvcdNew[*cLines].szName
  44. , SIZEOF(pvcdNew[*cLines].szName)
  45. , szName);
  46. *cLines = *cLines + 1;
  47. return pvcdNew;
  48. }