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.

116 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. main.c
  5. Abstract:
  6. <TODO: fill in abstract>
  7. Author:
  8. TODO: <full name> (<alias>) <date>
  9. Revision History:
  10. <full name> (<alias>) <date> <comments>
  11. --*/
  12. #include "pch.h"
  13. #include "wininet.h"
  14. #include <lm.h>
  15. HANDLE g_hHeap;
  16. HINSTANCE g_hInst;
  17. BOOL WINAPI MigUtil_Entry (HINSTANCE, DWORD, PVOID);
  18. BOOL
  19. pCallEntryPoints (
  20. DWORD Reason
  21. )
  22. {
  23. switch (Reason) {
  24. case DLL_PROCESS_ATTACH:
  25. UtInitialize (NULL);
  26. break;
  27. case DLL_PROCESS_DETACH:
  28. UtTerminate ();
  29. break;
  30. }
  31. return TRUE;
  32. }
  33. BOOL
  34. Init (
  35. VOID
  36. )
  37. {
  38. g_hHeap = GetProcessHeap();
  39. g_hInst = GetModuleHandle (NULL);
  40. return pCallEntryPoints (DLL_PROCESS_ATTACH);
  41. }
  42. VOID
  43. Terminate (
  44. VOID
  45. )
  46. {
  47. pCallEntryPoints (DLL_PROCESS_DETACH);
  48. }
  49. INT
  50. __cdecl
  51. _tmain (
  52. INT argc,
  53. PCTSTR argv[]
  54. )
  55. {
  56. INT i;
  57. PCTSTR FileArg;
  58. //
  59. // Begin processing
  60. //
  61. if (!Init()) {
  62. return 0;
  63. }
  64. {
  65. OSVERSIONINFO versionInfo;
  66. ZeroMemory (&versionInfo, sizeof (OSVERSIONINFO));
  67. versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
  68. if (GetVersionEx (&versionInfo)) {
  69. printf ("OS version information:\n");
  70. printf ("OS major version no :%d\n", versionInfo.dwMajorVersion);
  71. printf ("OS minor version no :%d\n", versionInfo.dwMinorVersion);
  72. printf ("OS build no :%d\n", versionInfo.dwBuildNumber);
  73. printf ("OS platform ID :%d\n", versionInfo.dwPlatformId);
  74. printf ("OS string :%s\n", versionInfo.szCSDVersion);
  75. } else {
  76. printf ("Version information could not be retrieved: %d\n", GetLastError ());
  77. }
  78. }
  79. //
  80. // End of processing
  81. //
  82. Terminate();
  83. return 0;
  84. }