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.

93 lines
1.7 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation
  6. //
  7. // File: kpinit.cxx
  8. //
  9. // Contents: Handles the startup and shutdown of the extension.
  10. //
  11. // History: 10-Jul-2001 t-ryanj Created
  12. //
  13. //------------------------------------------------------------------------
  14. #include "kpinit.h"
  15. #include "kpkdc.h"
  16. //+-------------------------------------------------------------------------
  17. //
  18. // Function: KpStartup
  19. //
  20. // Synopsis: Initializes resources
  21. //
  22. // Effects:
  23. //
  24. // Arguments:
  25. //
  26. // Requires:
  27. //
  28. // Returns: Success value. If startup is unsuccessful, FALSE is
  29. // returned, and no resources are allocated.
  30. //
  31. // Notes:
  32. //
  33. //
  34. //--------------------------------------------------------------------------
  35. BOOL
  36. KpStartup(
  37. VOID
  38. )
  39. {
  40. //
  41. // Initialize debug stuff
  42. //
  43. KpInitDebug();
  44. //
  45. // Initialize Memory
  46. //
  47. if( !KpInitMem() )
  48. goto Error;
  49. if( !KpInitWinsock() )
  50. goto Error;
  51. return TRUE;
  52. Error:
  53. KpShutdown();
  54. return FALSE;
  55. }
  56. //+-------------------------------------------------------------------------
  57. //
  58. // Function: KpShutdown
  59. //
  60. // Synopsis: Cleans up resources
  61. //
  62. // Effects:
  63. //
  64. // Arguments:
  65. //
  66. // Requires:
  67. //
  68. // Returns:
  69. //
  70. // Notes: No cleanup in this routine should assume that the resource
  71. // being cleanup us was successfully allocated.
  72. //
  73. //
  74. //--------------------------------------------------------------------------
  75. VOID
  76. KpShutdown(
  77. VOID
  78. )
  79. {
  80. KpCleanupWinsock();
  81. KpCleanupMem();
  82. }