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.

134 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. w9xtool.c
  5. Abstract:
  6. Implements a stub tool that is designed to run with Win9x-side
  7. upgrade code.
  8. Author:
  9. <full name> (<alias>) <date>
  10. Revision History:
  11. <alias> <date> <comments>
  12. --*/
  13. #include "pch.h"
  14. BOOL
  15. Init (
  16. VOID
  17. )
  18. {
  19. HINSTANCE hInstance;
  20. DWORD dwReason;
  21. PVOID lpReserved;
  22. //
  23. // Simulate DllMain
  24. //
  25. hInstance = GetModuleHandle (NULL);
  26. dwReason = DLL_PROCESS_ATTACH;
  27. lpReserved = NULL;
  28. //
  29. // Initialize DLL globals
  30. //
  31. if (!FirstInitRoutine (hInstance)) {
  32. return FALSE;
  33. }
  34. //
  35. // Initialize all libraries
  36. //
  37. if (!InitLibs (hInstance, dwReason, lpReserved)) {
  38. return FALSE;
  39. }
  40. //
  41. // Final initialization
  42. //
  43. if (!FinalInitRoutine ()) {
  44. return FALSE;
  45. }
  46. return TRUE;
  47. }
  48. VOID
  49. Terminate (
  50. VOID
  51. )
  52. {
  53. HINSTANCE hInstance;
  54. DWORD dwReason;
  55. PVOID lpReserved;
  56. //
  57. // Simulate DllMain
  58. //
  59. hInstance = GetModuleHandle (NULL);
  60. dwReason = DLL_PROCESS_DETACH;
  61. lpReserved = NULL;
  62. //
  63. // Call the cleanup routine that requires library APIs
  64. //
  65. FirstCleanupRoutine();
  66. //
  67. // Clean up all libraries
  68. //
  69. TerminateLibs (hInstance, dwReason, lpReserved);
  70. //
  71. // Do any remaining clean up
  72. //
  73. FinalCleanupRoutine();
  74. }
  75. INT
  76. __cdecl
  77. main (
  78. INT argc,
  79. CHAR *argv[]
  80. )
  81. {
  82. if (argc != 3) {
  83. printf ("Usage:\n\ndomain <domain_to_query> <computer_name>\n\n");
  84. return 1;
  85. }
  86. if (!Init()) {
  87. printf ("Unable to initialize!\n");
  88. return 255;
  89. }
  90. if (DoesComputerAccountExistOnDomain (argv[1], argv[2], TRUE)) {
  91. printf ("%s on %s exists\n", argv[2], argv[1]);
  92. } else {
  93. printf ("%s on %s does not exist\n", argv[2], argv[1]);
  94. }
  95. Terminate();
  96. return 0;
  97. }