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.

100 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. dlltask.c
  5. Abstract:
  6. This module implements Csr DLL tasking routines
  7. Author:
  8. Mark Lucovsky (markl) 13-Nov-1990
  9. Revision History:
  10. --*/
  11. #include "csrdll.h"
  12. NTSTATUS
  13. CsrNewThread(
  14. VOID
  15. )
  16. /*++
  17. Routine Description:
  18. This function is called by each new thread (except the first thread in
  19. a process.) It's function is to call the subsystem to notify it that
  20. a new thread is starting.
  21. Arguments:
  22. None.
  23. Return Value:
  24. Status Code from either client or server
  25. --*/
  26. {
  27. return NtRegisterThreadTerminatePort( CsrPortHandle );
  28. }
  29. NTSTATUS
  30. CsrIdentifyAlertableThread( VOID )
  31. {
  32. NTSTATUS Status;
  33. CSR_API_MSG m;
  34. PCSR_IDENTIFY_ALERTABLE_MSG a = &m.u.IdentifyAlertable;
  35. a->ClientId = NtCurrentTeb()->ClientId;
  36. Status = CsrClientCallServer(
  37. &m,
  38. NULL,
  39. CSR_MAKE_API_NUMBER( CSRSRV_SERVERDLL_INDEX,
  40. CsrpIdentifyAlertable
  41. ),
  42. sizeof( *a )
  43. );
  44. return Status;
  45. }
  46. NTSTATUS
  47. CsrSetPriorityClass(
  48. IN HANDLE ProcessHandle,
  49. IN OUT PULONG PriorityClass
  50. )
  51. {
  52. NTSTATUS Status;
  53. CSR_API_MSG m;
  54. PCSR_SETPRIORITY_CLASS_MSG a = &m.u.PriorityClass;
  55. a->ProcessHandle = ProcessHandle;
  56. a->PriorityClass = *PriorityClass;
  57. Status = CsrClientCallServer(
  58. &m,
  59. NULL,
  60. CSR_MAKE_API_NUMBER( CSRSRV_SERVERDLL_INDEX,
  61. CsrpSetPriorityClass
  62. ),
  63. sizeof( *a )
  64. );
  65. if ( *PriorityClass == 0 ) {
  66. *PriorityClass = a->PriorityClass;
  67. }
  68. return Status;
  69. }