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.

48 lines
1.3 KiB

  1. // MT.h: interface for the CMT class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MT_H__1D7004F3_0458_11D1_A438_00C04FB99B01__INCLUDED_)
  5. #define AFX_MT_H__1D7004F3_0458_11D1_A438_00C04FB99B01__INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #include <process.h>
  10. class CMT
  11. {
  12. public:
  13. CMT();
  14. virtual ~CMT();
  15. };
  16. // typedefs and inline func to handle buggy _beginthreadex prototype
  17. typedef unsigned (WINAPI *P_BEGINTHREADEX_THREADPROC)(LPVOID lpThreadParameter);
  18. typedef unsigned *P_BEGINTHREADEX_THREADID;
  19. inline HANDLE _beginthreadex(
  20. LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes
  21. DWORD dwStackSize, // initial thread stack size, in bytes
  22. LPTHREAD_START_ROUTINE lpStartAddress, // pointer to thread function
  23. LPVOID lpParameter, // argument for new thread
  24. DWORD dwCreationFlags, // creation flags
  25. LPDWORD lpThreadId // pointer to returned thread identifier
  26. )
  27. {
  28. return (HANDLE)::_beginthreadex(
  29. lpThreadAttributes,
  30. dwStackSize,
  31. (P_BEGINTHREADEX_THREADPROC)lpStartAddress,
  32. lpParameter,
  33. dwCreationFlags,
  34. (P_BEGINTHREADEX_THREADID)lpThreadId
  35. );
  36. }
  37. #endif // !defined(AFX_MT_H__1D7004F3_0458_11D1_A438_00C04FB99B01__INCLUDED_)