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.

68 lines
1.9 KiB

  1. //
  2. // Client.cpp - client implementation
  3. //
  4. #include <objbase.h>
  5. #include <iostream.h>
  6. #include <assert.h>
  7. #include "fusenet.h"
  8. //#include "Util.h"
  9. #include "server.h"
  10. //#include "Iface.h"
  11. #define INITGUID
  12. #include <guiddef.h>
  13. DEFINE_GUID(IID_IAssemblyUpdate,
  14. 0x301b3415,0xf52d,0x4d40,0xbd,0xf7,0x31,0xd8,0x27,0x12,0xc2,0xdc);
  15. DEFINE_GUID(LIBID_ServerLib,
  16. 0xd3011ee0,0xb997,0x11cf,0xa6,0xbb,0x00,0x80,0xc7,0xb2,0xd6,0x82);
  17. DEFINE_GUID(CLSID_CAssemblyUpdate,
  18. 0x37b088b8,0x70ef,0x4ecf,0xb1,0x1e,0x1f,0x3f,0x4d,0x10,0x5f,0xdd);
  19. int __cdecl main()
  20. {
  21. HRESULT hr;
  22. DWORD clsctx = CLSCTX_LOCAL_SERVER ;
  23. cout << "Client Running..." << endl;
  24. cout << "Attempt to create local component.";
  25. hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
  26. IAssemblyUpdate *pAssemblyUpdate = NULL;
  27. // IAssemblyDownload *pDownload = NULL;
  28. hr = CoCreateInstance(CLSID_CAssemblyUpdate,
  29. NULL, clsctx,
  30. IID_IAssemblyUpdate, (void**)&pAssemblyUpdate) ;
  31. if (SUCCEEDED(hr))
  32. {
  33. cout << "Successfully created component." << endl;
  34. cout << "Use interface IAssemblyUpdate." << endl;
  35. // hr = CreateAssemblyDownload(&pDownload);
  36. // pDownload->DownloadManifestAndDependencies(L"http://adriaanc5/msnsubscription.manifest",
  37. // NULL, DOWNLOAD_FLAGS_PROGRESS_UI);
  38. hr = pAssemblyUpdate->RegisterAssemblySubscriptionEx(L"MARS Version 1.0",
  39. L"http://adriaanc5/msnsubscription.manifest", 1, 1, 0, FALSE);
  40. cout << "hr for pAssemblyUpdate->RegisterAssemblySubscription() is " << hr << endl;
  41. cout << "Release IAssemblyUpdate." << endl;
  42. pAssemblyUpdate->Release() ;
  43. }
  44. else
  45. {
  46. cout << "Could not create component." << endl;
  47. }
  48. // Uninitialize COM Library
  49. CoUninitialize() ;
  50. return 0 ;
  51. }