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.

124 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. rxpnp.c
  5. Abstract:
  6. This module implements the PNP notification handling routines for RDBSS
  7. Revision History:
  8. Balan Sethu Raman [SethuR] 10-Apr-1996
  9. Notes:
  10. --*/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. #include "tdikrnl.h"
  14. HANDLE RxTdiNotificationHandle;
  15. VOID
  16. RxTdiBindTransportCallback(
  17. IN PUNICODE_STRING DeviceName
  18. )
  19. /*++
  20. Routine Description:
  21. TDI calls this routine whenever a transport creates a new device object.
  22. Arguments:
  23. DeviceName - the name of the newly created device object
  24. --*/
  25. {
  26. RX_BINDING_CONTEXT BindingContext;
  27. BindingContext.pTransportName = DeviceName;
  28. BindingContext.QualityOfService = 65534;
  29. //DbgPrint("$$$$$ Bind for transport %ws\n",DeviceName->Buffer);
  30. RxCeBindToTransport(&BindingContext);
  31. }
  32. VOID
  33. RxTdiUnbindTransportCallback(
  34. IN PUNICODE_STRING DeviceName
  35. )
  36. /*++
  37. Routine Description:
  38. TDI calls this routine whenever a transport deletes a device object
  39. Arguments:
  40. DeviceName = the name of the deleted device object
  41. --*/
  42. {
  43. RX_BINDING_CONTEXT BindingContext;
  44. BindingContext.pTransportName = DeviceName;
  45. RxCeUnbindFromTransport(&BindingContext);
  46. }
  47. NTSTATUS
  48. RxRegisterForPnpNotifications()
  49. /*++
  50. Routine Description:
  51. This routine registers with TDI for receiving transport notifications
  52. --*/
  53. {
  54. NTSTATUS status = STATUS_SUCCESS;
  55. if( RxTdiNotificationHandle == NULL ) {
  56. status = TdiRegisterNotificationHandler (
  57. RxTdiBindTransportCallback,
  58. RxTdiUnbindTransportCallback,
  59. &RxTdiNotificationHandle );
  60. }
  61. return status;
  62. }
  63. NTSTATUS
  64. RxDeregisterForPnpNotifications()
  65. /*++
  66. Routine Description:
  67. This routine deregisters the TDI notification mechanism
  68. Notes:
  69. --*/
  70. {
  71. NTSTATUS Status = STATUS_SUCCESS;
  72. if( RxTdiNotificationHandle != NULL ) {
  73. Status = TdiDeregisterNotificationHandler( RxTdiNotificationHandle );
  74. if( NT_SUCCESS( Status ) ) {
  75. RxTdiNotificationHandle = NULL;
  76. }
  77. }
  78. return Status;
  79. }
  80.