Skip to content

Commit

Permalink
Windows API name collision fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan386 committed Oct 30, 2013
1 parent 91592fb commit 985dfbe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion shareaza/BitziDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ BOOL CBitziDownloader::Start(CBitziDownloadDlg* pDlg)
{
if ( m_hInternet != NULL ) return FALSE;

m_hInternet = CNetwork::InternetOpen();
m_hInternet = CNetwork::CNInternetOpen();
if ( ! m_hInternet ) return FALSE;

m_hSession = NULL;
Expand Down
4 changes: 2 additions & 2 deletions shareaza/HttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ void CHttpRequest::OnRun()
ASSERT( m_sURL.GetLength() );
ASSERT( m_pResponse == NULL );

m_hInternet = CNetwork::InternetOpen();
m_hInternet = CNetwork::CNInternetOpen();
if ( m_hInternet )
{
HINTERNET hURL = CNetwork::InternetOpenUrl( m_hInternet, m_sURL,
HINTERNET hURL = CNetwork::CNInternetOpenUrl( m_hInternet, m_sURL,
m_sRequestHeaders, m_sRequestHeaders.GetLength(),
INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_RELOAD |
INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_NO_CACHE_WRITE |
Expand Down
8 changes: 4 additions & 4 deletions shareaza/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ BOOL CNetwork::IsSelfIP(const IN_ADDR& nAddress) const
return ( m_pHostAddresses.Find( nAddress.s_addr ) != NULL );
}

HINTERNET CNetwork::InternetOpen()
HINTERNET CNetwork::CNInternetOpen()
{
__try
{
Expand All @@ -236,7 +236,7 @@ HINTERNET CNetwork::InternetOpen()
return NULL;
}

bool CNetwork::InternetConnect()
bool CNetwork::CNInternetConnect()
{
__try
{
Expand Down Expand Up @@ -713,7 +713,7 @@ bool CNetwork::PreRun()
if ( Settings.Connection.ForceConnectedState )
{
INTERNET_CONNECTED_INFO ici = {};
HINTERNET hInternet = InternetOpen();
HINTERNET hInternet = CNInternetOpen();

ici.dwConnectedState = INTERNET_STATE_CONNECTED;
InternetSetOption( hInternet, INTERNET_OPTION_CONNECTED_STATE, &ici, sizeof(ici) );
Expand Down Expand Up @@ -1450,7 +1450,7 @@ int CNetwork::RecvFrom(SOCKET s, char* buf, int len, SOCKADDR_IN* pFrom)
}
}

HINTERNET CNetwork::InternetOpenUrl(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags)
HINTERNET CNetwork::CNInternetOpenUrl(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags)
{
__try // Fix against stupid firewalls like (iS3 Anti-Spyware or Norman Virus Control)
{
Expand Down
6 changes: 3 additions & 3 deletions shareaza/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CNetwork : public CComObject, public CThreadImpl
void ClearResolve();

// Restore WinINet connection to Internet
bool InternetConnect();
bool CNInternetConnect();

bool PreRun();
void OnRun();
Expand Down Expand Up @@ -247,9 +247,9 @@ class CNetwork : public CComObject, public CThreadImpl
// Safe way to receive UDP data
static int RecvFrom(SOCKET s, char* buf, int len, SOCKADDR_IN* pFrom);
// Safe way to call InternetOpen
static HINTERNET InternetOpen();
static HINTERNET CNInternetOpen();
// Safe way to call InternetOpenUrl
static HINTERNET InternetOpenUrl(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags);
static HINTERNET CNInternetOpenUrl(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags);
// Safe way to call WSACleanup
static void Cleanup();

Expand Down

0 comments on commit 985dfbe

Please sign in to comment.