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.

112 lines
2.2 KiB

  1. #include <inetreg.h>
  2. #define BLOB_BUFF_GRANULARITY 1024
  3. class CRegBlob
  4. {
  5. private:
  6. HKEY _hkey;
  7. BOOL _fWrite;
  8. BOOL _fCommit;
  9. DWORD _dwOffset;
  10. DWORD _dwBufferLimit;
  11. BYTE * _pBuffer;
  12. LPCSTR _pszValue;
  13. public:
  14. CRegBlob(BOOL fWrite);
  15. ~CRegBlob();
  16. DWORD Init(HKEY hBaseKey, LPCSTR pszSubKey, LPCSTR pszValue);
  17. DWORD Abandon();
  18. DWORD Commit();
  19. DWORD WriteString(LPCSTR pszString);
  20. DWORD ReadString(LPCSTR * ppszString);
  21. DWORD WriteBytes(LPCVOID pBytes, DWORD dwByteCount);
  22. DWORD ReadBytes(LPVOID pBytes, DWORD dwByteCount);
  23. private:
  24. DWORD Encrpyt();
  25. DWORD Decrypt();
  26. };
  27. typedef struct {
  28. //
  29. // dwStructSize - Structure size to handle growing list of new entries or priv/pub structures
  30. //
  31. DWORD dwStructSize;
  32. //
  33. // dwFlags - Proxy type flags
  34. //
  35. DWORD dwFlags;
  36. //
  37. // dwCurrentSettingsVersion - a counter incremented every time we change our settings
  38. //
  39. DWORD dwCurrentSettingsVersion;
  40. //
  41. // lpszConnectionName - name of the Connectoid for this connection
  42. //
  43. LPCSTR lpszConnectionName;
  44. //
  45. // lpszProxy - proxy server list
  46. //
  47. LPCSTR lpszProxy;
  48. //
  49. // lpszProxyBypass - proxy bypass list
  50. //
  51. LPCSTR lpszProxyBypass;
  52. } INTERNET_PROXY_INFO_EX, * LPINTERNET_PROXY_INFO_EX;
  53. // name of blob for saved legacy settings
  54. #define LEGACY_SAVE_NAME "SavedLegacySettings"
  55. DWORD
  56. LoadProxySettings();
  57. DWORD
  58. ReadProxySettings(
  59. LPINTERNET_PROXY_INFO_EX pInfo
  60. );
  61. void
  62. CleanProxyStruct(
  63. LPINTERNET_PROXY_INFO_EX pInfo
  64. );
  65. DWORD
  66. SetPerConnOptions(
  67. HINTERNET hInternet,
  68. BOOL fIsAutoProxyThread,
  69. LPINTERNET_PER_CONN_OPTION_LISTA pList
  70. );
  71. DWORD
  72. QueryPerConnOptions(
  73. HINTERNET hInternet,
  74. BOOL fIsAutoProxyThread,
  75. LPINTERNET_PER_CONN_OPTION_LISTA pList
  76. );
  77. BOOL
  78. IsConnectionMatch(
  79. LPCSTR lpszConnection1,
  80. LPCSTR lpszConnection2
  81. );
  82. HKEY
  83. FindBaseProxyKey(
  84. VOID
  85. );