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.

64 lines
1.6 KiB

  1. // SmStart.cpp : Implementation of CSmartStart
  2. #include "stdafx.h"
  3. #include "icwhelp.h"
  4. #include "SmStart.h"
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CSmartStart
  7. HRESULT CSmartStart::OnDraw(ATL_DRAWINFO& di)
  8. {
  9. return S_OK;
  10. }
  11. //+----------------------------------------------------------------------------
  12. //
  13. // Function: DoSmartStart
  14. //
  15. // Synopsis: This function will determine if the ICW should be run. The
  16. // decision is made based on the current state of the user's machine.
  17. //
  18. // Arguments: none
  19. //
  20. // Returns: Sets m_bIsInternetCapable.
  21. //
  22. // History: 1/12/98
  23. //
  24. //-----------------------------------------------------------------------------
  25. #define INETCFG_ISSMARTSTART "IsSmartStart"
  26. STDMETHODIMP CSmartStart::IsInternetCapable(BOOL *pbRetVal)
  27. {
  28. TraceMsg(TF_SMARTSTART, TEXT("ICWHELP: DoSmartStart\n"));
  29. // Set the initial state. Assume we are NOT internet capable
  30. *pbRetVal = FALSE;
  31. PFNISSMARTSTART fp = NULL;
  32. // Load the InetCfg library
  33. HINSTANCE hInetCfg = LoadLibrary(TEXT("inetcfg.dll"));
  34. if (!hInetCfg)
  35. {
  36. // Failure just means we run the wizard
  37. goto DoSmartStartExit;
  38. }
  39. // Load and call the smart start API
  40. if (NULL == (fp = (PFNISSMARTSTART)
  41. GetProcAddress(hInetCfg,INETCFG_ISSMARTSTART)))
  42. {
  43. goto DoSmartStartExit;
  44. }
  45. //
  46. // Call smart start
  47. //
  48. *pbRetVal = (BOOL)fp();
  49. DoSmartStartExit:
  50. if (hInetCfg)
  51. FreeLibrary(hInetCfg);
  52. return S_OK;
  53. }