summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2013-01-04 20:50:05 +0100
committerJose <jose@zeroc.com>2013-01-04 20:50:05 +0100
commit267550c99b669ba1799c0b8cdef3730f578365e5 (patch)
tree82aabc0f3c662ec52f3ce6dd4ad93f9b89d49dd5 /cpp/src
parentUpdate WinRT install headers (diff)
downloadice-267550c99b669ba1799c0b8cdef3730f578365e5.tar.bz2
ice-267550c99b669ba1799c0b8cdef3730f578365e5.tar.xz
ice-267550c99b669ba1799c0b8cdef3730f578365e5.zip
Fixed (ICE-5058) - WinRT port Platform::AccessDeniedException
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Exception.cpp14
-rw-r--r--cpp/src/Ice/Network.cpp12
2 files changed, 24 insertions, 2 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index 177eb58e8a0..f3022d2880a 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -35,8 +35,18 @@ socketErrorToString(int error)
return "unknown error";
}
#ifdef ICE_OS_WINRT
- return IceUtil::wstringToString(
- static_cast<Windows::Networking::Sockets::SocketErrorStatus>(error).ToString()->Data());
+ if(error == E_ACCESSDENIED)
+ {
+ ostringstream os;
+ os << "access to a resource or feature is denied, ensure that you have requested the appropriate\n";
+ os << "capability and made the required declarations in the package manifest of your app.";
+ return os.str();
+ }
+ else
+ {
+ return IceUtil::wstringToString(
+ static_cast<Windows::Networking::Sockets::SocketErrorStatus>(error).ToString()->Data());
+ }
#else
return IceUtilInternal::errorToString(error);
#endif
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 7754e708c62..5c4767d533f 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -2093,6 +2093,12 @@ IceInternal::createPipe(SOCKET fds[2])
void
IceInternal::checkConnectErrorCode(const char* file, int line, HRESULT herr, HostName^ host)
{
+ if(herr == E_ACCESSDENIED)
+ {
+ SocketException ex(file, line);
+ ex.error = static_cast<int>(herr);
+ throw ex;
+ }
SocketErrorStatus error = SocketError::GetStatus(herr);
if(error == SocketErrorStatus::ConnectionRefused)
{
@@ -2129,6 +2135,12 @@ IceInternal::checkConnectErrorCode(const char* file, int line, HRESULT herr, Hos
void
IceInternal::checkErrorCode(const char* file, int line, HRESULT herr)
{
+ if(herr == E_ACCESSDENIED)
+ {
+ SocketException ex(file, line);
+ ex.error = static_cast<int>(herr);
+ throw ex;
+ }
SocketErrorStatus error = SocketError::GetStatus(herr);
if(error == SocketErrorStatus::NetworkDroppedConnectionOnReset ||
error == SocketErrorStatus::SoftwareCausedConnectionAbort ||