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.4 KiB

  1. #pragma once
  2. #define DCP_CUSTOM_ERROR_ACCESSDENIED L"800"
  3. #define DCP_ERROR_CONNECTIONSETUPFAILED L"704"
  4. HRESULT SetUPnPError(LPOLESTR pszError);
  5. VOID SetProxyBlanket(IUnknown *pUnk);
  6. DWORD WINAPI INET_ADDR( LPCWSTR szAddressW );
  7. WCHAR * WINAPI INET_NTOW( ULONG addr );
  8. WCHAR * WINAPI INET_NTOW_TS( ULONG addr );
  9. class CSwitchSecurityContext
  10. {
  11. public:
  12. CSwitchSecurityContext();
  13. ~CSwitchSecurityContext()
  14. {
  15. CoRevertToSelf();
  16. };
  17. static HRESULT ObtainImpersonationToken();
  18. static DestroyImpersonationToken()
  19. {
  20. CloseHandle( m_hImpersonationToken );
  21. m_hImpersonationToken = NULL;
  22. };
  23. private:
  24. static HANDLE m_hImpersonationToken;
  25. };
  26. inline BOOL IsAllowedBeaconOSType (void)
  27. //
  28. // Look for the Workstation SKUs;
  29. // WinNT, Win2K, XP - Workstations are allowed (Per/Pro), returns TRUE
  30. // Everything else returns FALSE
  31. //
  32. {
  33. #ifndef _WIN64 // On IA64, all homenet technologies are unavailable.
  34. OSVERSIONINFOEXW verInfo = {0};
  35. ULONGLONG ConditionMask = 0;
  36. verInfo.dwOSVersionInfoSize = sizeof(verInfo);
  37. verInfo.wProductType = VER_NT_WORKSTATION;
  38. VER_SET_CONDITION(ConditionMask, VER_PRODUCT_TYPE, VER_EQUAL);
  39. if ( VerifyVersionInfo(&verInfo, VER_PRODUCT_TYPE, ConditionMask) )
  40. return TRUE;
  41. #endif
  42. return FALSE;
  43. };