Windows NT 4.0 source code leak
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.

86 lines
1.6 KiB

4 years ago
  1. /* --------------------------------------------------------------------
  2. Microsoft OS/2 LAN Manager
  3. Copyright(c) Microsoft Corp., 1990
  4. -------------------------------------------------------------------- */
  5. /* --------------------------------------------------------------------
  6. File: threads.hxx
  7. Description:
  8. This file provides a system independent threads package.
  9. History:
  10. 5/24/90 [mikemon] File created.
  11. -------------------------------------------------------------------- */
  12. #ifndef __THREADS__
  13. #define __THREADS__
  14. START_C_EXTERN
  15. #include <dosdll.h>
  16. typedef void (*THREAD_PROC)(void *Param);
  17. extern noThreadsForDos(void);
  18. typedef int THREAD_IDENTIFIER;
  19. extern void PauseExecution(unsigned long time);
  20. #define GetThreadIdentifier() 1
  21. END_C_EXTERN
  22. class THREAD
  23. {
  24. public:
  25. // Construct a new thread which will execute the procedure specified, taking
  26. // Param as the argument.
  27. THREAD() {}
  28. THREAD(THREAD_PROC Procedure, void *Param) {
  29. (void)(Procedure);
  30. (void)(Param);
  31. noThreadsForDos();
  32. }
  33. };
  34. extern THREAD ThreadStatic;
  35. inline THREAD * ThreadSelf()
  36. {
  37. return (&ThreadStatic);
  38. }
  39. // This class represents a dynamic link library. When it is constructed,
  40. // the dll is loaded, and when it is destructed, the dll is unloaded.
  41. // The only operation is obtaining the address of an entry point into
  42. // the dll.
  43. class DLL
  44. {
  45. private:
  46. unsigned long ulHandle;
  47. public:
  48. DLL ( IN unsigned char * DLLName,
  49. OUT RPC_STATUS * retstatus
  50. );
  51. ~DLL ();
  52. void PAPI * GetEntryPoint ( IN unsigned char * Procedure);
  53. };
  54. #endif // __THREADS__