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.

87 lines
1.5 KiB

  1. /*++
  2. Copyright (c) 1990-2002 Microsoft Corporation
  3. Module Name:
  4. pool.hxx
  5. Abstract:
  6. Header for Thread pool for asynchronous OpenPrinter calls.
  7. Author:
  8. Ali Naqvi (alinaqvi) 3-May-2002
  9. Revision History:
  10. --*/
  11. #ifndef _THREAD_POOL_HXX_
  12. #define _THREAD_POOL_HXX_
  13. class TThreadPool
  14. {
  15. public:
  16. TThreadPool();
  17. ~TThreadPool();
  18. HRESULT
  19. CreateThreadEntry(
  20. IN LPWSTR pName,
  21. IN PPRINTER_DEFAULTS pDefaults,
  22. OUT PWIN32THREAD *ppThread
  23. );
  24. HRESULT
  25. DeleteThreadEntry(
  26. IN PWIN32THREAD pThread
  27. );
  28. HRESULT
  29. UseThread(
  30. IN LPWSTR pName,
  31. IN PWIN32THREAD *ppThread,
  32. IN ACCESS_MASK DesiredAccess
  33. );
  34. HRESULT
  35. ReturnThread(
  36. IN PWIN32THREAD pThread
  37. );
  38. VOID
  39. FreeThread(
  40. IN PWIN32THREAD pThread
  41. );
  42. private:
  43. PWIN32THREAD pHead;
  44. BOOL
  45. IsValid(
  46. IN PWIN32THREAD pThread
  47. );
  48. HRESULT
  49. GetThreadSid(
  50. IN OUT PWIN32THREAD pThread
  51. );
  52. BOOL
  53. IsValidUser(
  54. IN PWIN32THREAD pThread,
  55. IN PVOID CurrentTokenInformation
  56. );
  57. HRESULT
  58. GetUserTokenInformation(
  59. IN OUT PVOID *pUserTokenInformation,
  60. IN DWORD dwInformationLength
  61. );
  62. };
  63. #endif // _THREAD_POOL_HXX_