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.

52 lines
1.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. test.cpp
  5. Abstract:
  6. Test Function calls for migration dll
  7. Author:
  8. Xiaoyu Wu(xiaoyuw) 06-Sept-2001
  9. --*/
  10. #include "stdinc.h"
  11. #include "macros.h"
  12. #include <windows.h>
  13. extern FUSION_HEAP_HANDLE g_hHeap;
  14. typedef HRESULT (_stdcall * PFN_MigrateSingleFusionWin32AssemblyToXP)(PCWSTR filename);
  15. extern "C" int __cdecl wmain(int argc, wchar_t** argv)
  16. {
  17. HRESULT hr = S_OK;
  18. PFN_MigrateSingleFusionWin32AssemblyToXP pfn = NULL;
  19. HMODULE hd = LoadLibrary("..\\..\\..\\obj\\i386\\fusemig.dll");
  20. if (hd == NULL)
  21. {
  22. printf("hi, error to load library\n");
  23. SET_HRERR_AND_EXIT(::GetLastError());
  24. goto Exit;
  25. }
  26. g_hHeap = (FUSION_HEAP_HANDLE)GetProcessHeap();
  27. pfn = (PFN_MigrateSingleFusionWin32AssemblyToXP)GetProcAddress(hd, "MsiInstallerDirectoryDirWalk");
  28. if ( pfn == NULL)
  29. {
  30. printf("hi, error to load library\n");
  31. SET_HRERR_AND_EXIT(::GetLastError());
  32. goto Exit;
  33. }
  34. if (argc >=2)
  35. IFFAILED_EXIT(pfn(argv[1]));
  36. else
  37. IFFAILED_EXIT(pfn(NULL));
  38. Exit:
  39. FreeLibrary(hd);
  40. return hr;
  41. }