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.

97 lines
2.9 KiB

  1. /************************************************************************
  2. * *
  3. * INTEL CORPORATION PROPRIETARY INFORMATION *
  4. * *
  5. * This software is supplied under the terms of a license *
  6. * agreement or non-disclosure agreement with Intel Corporation *
  7. * and may not be copied or disclosed except in accordance *
  8. * with the terms of that agreement. *
  9. * *
  10. * Copyright (C) 1997 Intel Corp. All Rights Reserved *
  11. * *
  12. * $Archive: S:\sturgeon\src\gki\vcs\gkiunreg.cpv $
  13. * *
  14. * $Revision: 1.6 $
  15. * $Date: 12 Feb 1997 01:11:02 $
  16. * *
  17. * $Author: CHULME $
  18. * *
  19. * $Log: S:\sturgeon\src\gki\vcs\gkiunreg.cpv $
  20. //
  21. // Rev 1.6 12 Feb 1997 01:11:02 CHULME
  22. // Redid thread synchronization to use Gatekeeper.Lock
  23. //
  24. // Rev 1.5 17 Jan 1997 09:02:20 CHULME
  25. // Changed reg.h to gkreg.h to avoid name conflict with inc directory
  26. //
  27. // Rev 1.4 10 Jan 1997 16:15:44 CHULME
  28. // Removed MFC dependency
  29. //
  30. // Rev 1.3 20 Dec 1996 16:38:16 CHULME
  31. // Fixed access synchronization with Gatekeeper lock
  32. //
  33. // Rev 1.2 02 Dec 1996 23:50:48 CHULME
  34. // Added premptive synchronization code
  35. //
  36. // Rev 1.1 22 Nov 1996 15:22:12 CHULME
  37. // Added VCS log to the header
  38. *************************************************************************/
  39. // gkiunregistration.cpp : Handles the GKI_UnregistrationRequest API
  40. //
  41. #include "precomp.h"
  42. #include <process.h>
  43. #include <winsock.h>
  44. #include "GKICOM.H"
  45. #include "dspider.h"
  46. #include "dgkilit.h"
  47. #include "DGKIPROT.H"
  48. #include "GATEKPR.H"
  49. #include "gksocket.h"
  50. #include "GKREG.H"
  51. #include "h225asn.h"
  52. #include "coder.hpp"
  53. #include "dgkiext.h"
  54. #ifdef _DEBUG
  55. #undef THIS_FILE
  56. static char THIS_FILE[] = __FILE__;
  57. #endif
  58. extern "C" HRESULT DLL_EXPORT
  59. GKI_UnregistrationRequest(void)
  60. {
  61. // ABSTRACT: This function is exported. It is called by the client application
  62. // to unregister with the Gatekeeper. The handle supplied by the client
  63. // is actually a pointer to the CRegistration object, which will be
  64. // deleted
  65. // AUTHOR: Colin Hulme
  66. HRESULT hResult;
  67. #ifdef _DEBUG
  68. char szGKDebug[80];
  69. #endif
  70. SPIDER_TRACE(SP_FUNC, "GKI_UnregistrationRequest()\n", 0);
  71. SPIDER_TRACE(SP_GKI, "GKI_UnregistrationRequest()\n", 0);
  72. // Create a Gatekeeper lock object on the stack
  73. // It's constructor will lock pGK and when we return
  74. // from any path, its destructor will unlock pGK
  75. CGatekeeperLock GKLock(g_pGatekeeper);
  76. if (g_pReg == 0)
  77. return (GKI_NOT_REG);
  78. // Protect against concurrent PDUs
  79. if (g_pReg->GetRasMessage() != 0)
  80. return (GKI_BUSY);
  81. // Create UnregistrationRequest structure - Encode and send PDU
  82. hResult = g_pReg->UnregistrationRequest();
  83. return (hResult);
  84. }