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.

69 lines
1.4 KiB

  1. /***
  2. *slbeep.c - Sleep and beep
  3. *
  4. * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _sleep() and _beep()
  8. *
  9. *Revision History:
  10. * 08-22-91 BWM Wrote module.
  11. * 09-29-93 GJF Resurrected for compatibility with NT SDK (which had
  12. * the function). Replaced _CALLTYPE1 with __cdecl and
  13. * removed Cruiser support.
  14. *
  15. *******************************************************************************/
  16. #include <cruntime.h>
  17. #include <oscalls.h>
  18. #include <stdlib.h>
  19. /***
  20. *void _sleep(duration) - Length of sleep
  21. *
  22. *Purpose:
  23. *
  24. *Entry:
  25. * unsigned long duration - length of sleep in milliseconds or
  26. * one of the following special values:
  27. *
  28. * _SLEEP_MINIMUM - Sends a yield message without any delay
  29. * _SLEEP_FOREVER - Never return
  30. *
  31. *Exit:
  32. * None
  33. *
  34. *Exceptions:
  35. *
  36. *******************************************************************************/
  37. void __cdecl _sleep(unsigned long dwDuration)
  38. {
  39. if (dwDuration == 0) {
  40. dwDuration++;
  41. }
  42. Sleep(dwDuration);
  43. }
  44. /***
  45. *void _beep(frequency, duration) - Length of sleep
  46. *
  47. *Purpose:
  48. *
  49. *Entry:
  50. * unsigned frequency - frequency in hertz
  51. * unsigned duration - length of beep in milliseconds
  52. *
  53. *Exit:
  54. * None
  55. *
  56. *Exceptions:
  57. *
  58. *******************************************************************************/
  59. void __cdecl _beep(unsigned dwFrequency, unsigned dwDuration)
  60. {
  61. Beep(dwFrequency, dwDuration);
  62. }