Source code of Windows XP (NT5)
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.

60 lines
1.4 KiB

  1. // Turns off "string too long - truncated to 255 characters in the debug
  2. // information, debugger cannot evaluate symbol."
  3. //
  4. #pragma warning (disable: 4786)
  5. #include <windows.h>
  6. #include <stdlib.h>
  7. #include <tchar.h>
  8. #include <ncnetcfg.h>
  9. #include <initguid.h>
  10. #include <devguid.h>
  11. #include <netcfg_i.c>
  12. #include "rasphone.rch"
  13. EXTERN_C
  14. VOID
  15. Install(
  16. IN HINSTANCE hinst,
  17. IN HWND hwndOwner,
  18. INetCfg* pNetCfg )
  19. /* Runs the RAS install program. 'HwndOwner' is the owning window or NULL
  20. ** if none. 'PNetCfg' is the initialized net configuration object.
  21. */
  22. {
  23. HRESULT hr;
  24. /* Install RAS.
  25. */
  26. hr = HrInstallComponentOboUser(
  27. pNetCfg, GUID_DEVCLASS_NETSERVICE,
  28. NETCFG_SERVICE_CID_MS_RASCLI,
  29. NULL );
  30. if (SUCCEEDED(hr))
  31. {
  32. hr = HrValidateAndApplyOrCancelINetCfg (pNetCfg, hwndOwner);
  33. if (NETCFG_S_REBOOT == hr)
  34. {
  35. LPCTSTR pszCaption = SzLoadString(hinst, SID_PopupTitle);
  36. LPCTSTR pszText = SzLoadString(hinst, SID_RestartText1);
  37. MessageBox (hwndOwner, pszText, pszCaption, MB_OK);
  38. }
  39. }
  40. }
  41. EXTERN_C
  42. HRESULT HrCreateAndInitINetCfg (BOOL fInitCom, INetCfg** ppnc)
  43. {
  44. return HrCreateAndInitializeINetCfg (fInitCom, ppnc);
  45. }
  46. EXTERN_C
  47. HRESULT HrUninitAndReleaseINetCfg (BOOL fUninitCom, INetCfg* pnc)
  48. {
  49. return HrUninitializeAndReleaseINetCfg (fUninitCom, pnc);
  50. }