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.

73 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1991 - 1999
  6. //
  7. // File: testhlp.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. Microsoft OS/2 LAN Manager
  12. Copyright(c) Microsoft Corp., 1990
  13. -------------------------------------------------------------------- */
  14. /* --------------------------------------------------------------------
  15. File : testhlp.cxx
  16. Description :
  17. These are the operating system specific helper routines for NT. This
  18. isolates all of the operating system specific stuff from the testing
  19. code.
  20. History :
  21. mikemon 01-14-91 Created this file.
  22. -------------------------------------------------------------------- */
  23. #include <ntos2.h>
  24. #include <ntrtl.h>
  25. #include <nturtl.h>
  26. #include <testhlp.hxx>
  27. void
  28. TestHlpResumeThread (
  29. int Thread
  30. )
  31. {
  32. ULONG SuspendCount;
  33. NtResumeThread((HANDLE) Thread,&SuspendCount);
  34. }
  35. int
  36. TestHlpCurrentThread (
  37. )
  38. {
  39. TEB * pTeb;
  40. OBJECT_ATTRIBUTES ObjectAttributes;
  41. void * Thread;
  42. InitializeObjectAttributes(&ObjectAttributes,(PSTRING) 0,0,(HANDLE) 0,0);
  43. pTeb = NtCurrentTeb();
  44. NtOpenThread(&Thread,THREAD_ALL_ACCESS,&ObjectAttributes,
  45. &(pTeb->ClientId));
  46. return((int) Thread);
  47. }
  48. void
  49. TestHlpSuspendThread (
  50. int Thread
  51. )
  52. {
  53. ULONG SuspendCount;
  54. NtSuspendThread((HANDLE) Thread,&SuspendCount);
  55. }