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.

107 lines
2.0 KiB

  1. #ifndef __CDDUMP_COMMON_H__
  2. #define __CDDUMP_COMMON_H__
  3. //
  4. // these headers are order-dependent
  5. //
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <assert.h>
  9. #include <windows.h>
  10. #include <devioctl.h>
  11. #include <ntddcdrm.h>
  12. #include <strsafe.h>
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif // __cplusplus
  16. #define STATUS_SUCCESS ( 0 )
  17. #define RAW_SECTOR_SIZE ( 2352 )
  18. #define SAMPLES_PER_SECTOR ( RAW_SECTOR_SIZE / sizeof(SAMPLE) )
  19. #define REDBOOK_INACCURACY ( 75 )
  20. #define TRY
  21. #define LEAVE goto __label;
  22. #define FINALLY __label:
  23. ////////////////////////////////////////////////////////////////////////////////
  24. #define MSF_TO_LBA(Minutes,Seconds,Frames) \
  25. (ULONG)((60 * 75 * (Minutes) ) + (75 * (Seconds)) + ((Frames) - 150))
  26. ////////////////////////////////////////////////////////////////////////////////
  27. typedef struct _SAMPLE {
  28. union {
  29. UCHAR Data[4];
  30. struct {
  31. SHORT Left;
  32. SHORT Right;
  33. };
  34. };
  35. ULONG32 AsUlong32;
  36. } SAMPLE, *PSAMPLE;
  37. ////////////////////////////////////////////////////////////////////////////////
  38. PCDROM_TOC
  39. CddumpGetToc(
  40. HANDLE device
  41. );
  42. ULONG
  43. CDDB_ID(
  44. PCDROM_TOC toc
  45. );
  46. ULONG32
  47. CddumpDumpLba(
  48. HANDLE CdromHandle,
  49. HANDLE OutHandle,
  50. ULONG StartAddress,
  51. ULONG EndAddress
  52. );
  53. ULONG32
  54. DumpWavHeader(
  55. HANDLE OutFile,
  56. ULONG32 Samples,
  57. ULONG32 SamplesPerSecond,
  58. USHORT Channels,
  59. USHORT BitsPerSample
  60. );
  61. VOID
  62. ReadWavHeader(
  63. HANDLE InFile
  64. );
  65. #if DBG
  66. extern LONG DebugLevel;
  67. #define DebugPrint(x) CddumpDebugPrint x
  68. VOID
  69. __cdecl
  70. CddumpDebugPrint(
  71. LONG DebugPrintLevel,
  72. PCHAR DebugMessage,
  73. ...
  74. );
  75. #else
  76. #define DebugPrint
  77. #endif
  78. ////////////////////////////////////////////////////////////////////////////////
  79. #ifdef __cplusplus
  80. }
  81. #endif // __cplusplus
  82. #endif // __CDDUMP_COMMON_H__