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.

139 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. stftest.c
  5. Abstract:
  6. Runs the STF migration code for development purposes.
  7. Author:
  8. Jim Schmidt (jimschm) 28-Sep-1998
  9. Revision History:
  10. <alias> <date> <comments>
  11. --*/
  12. #include "pch.h"
  13. BOOL
  14. Init (
  15. VOID
  16. )
  17. {
  18. HINSTANCE hInstance;
  19. DWORD dwReason;
  20. PVOID lpReserved;
  21. //
  22. // Simulate DllMain
  23. //
  24. hInstance = GetModuleHandle (NULL);
  25. dwReason = DLL_PROCESS_ATTACH;
  26. lpReserved = NULL;
  27. //
  28. // Initialize DLL globals
  29. //
  30. if (!FirstInitRoutine (hInstance)) {
  31. return FALSE;
  32. }
  33. //
  34. // Initialize all libraries
  35. //
  36. if (!InitLibs (hInstance, dwReason, lpReserved)) {
  37. return FALSE;
  38. }
  39. //
  40. // Final initialization
  41. //
  42. if (!FinalInitRoutine ()) {
  43. return FALSE;
  44. }
  45. return TRUE;
  46. }
  47. VOID
  48. Terminate (
  49. VOID
  50. )
  51. {
  52. HINSTANCE hInstance;
  53. DWORD dwReason;
  54. PVOID lpReserved;
  55. //
  56. // Simulate DllMain
  57. //
  58. hInstance = GetModuleHandle (NULL);
  59. dwReason = DLL_PROCESS_DETACH;
  60. lpReserved = NULL;
  61. //
  62. // Call the cleanup routine that requires library APIs
  63. //
  64. FirstCleanupRoutine();
  65. //
  66. // Clean up all libraries
  67. //
  68. TerminateLibs (hInstance, dwReason, lpReserved);
  69. //
  70. // Do any remaining clean up
  71. //
  72. FinalCleanupRoutine();
  73. }
  74. BOOL
  75. ProcessStfFiles (
  76. VOID
  77. );
  78. INT
  79. __cdecl
  80. wmain (
  81. INT argc,
  82. WCHAR *argv[]
  83. )
  84. {
  85. if (!Init()) {
  86. wprintf (L"Unable to initialize!\n");
  87. return 255;
  88. }
  89. MemDbLoad (TEXT("c:\\public\\ntsetup.dat"));
  90. MemDbDeleteTree (MEMDB_CATEGORY_STF);
  91. MemDbSetValueEx (MEMDB_CATEGORY_STF, TEXT("c:\\public\\stftest.stf"), NULL, NULL, 0, NULL);
  92. ProcessStfFiles();
  93. Terminate();
  94. return 0;
  95. }