summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/inspircd_namedpipe.cpp21
-rw-r--r--win/inspircd_win32wrapper.cpp4
2 files changed, 13 insertions, 12 deletions
diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp
index f86af73e2..06649d103 100644
--- a/win/inspircd_namedpipe.cpp
+++ b/win/inspircd_namedpipe.cpp
@@ -8,7 +8,8 @@
IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)
{
- initwmi();
+ if (!initwmi())
+ ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available.");
}
IPCThread::~IPCThread()
@@ -23,15 +24,15 @@ void IPCThread::Run()
while (GetExitFlag() == false)
{
Pipe = CreateNamedPipe (Pipename,
- PIPE_ACCESS_DUPLEX, // read/write access
- PIPE_TYPE_MESSAGE | // message type pipe
- PIPE_READMODE_MESSAGE | // message-read mode
- PIPE_WAIT, // blocking mode
- PIPE_UNLIMITED_INSTANCES, // max. instances
- MAXBUF, // output buffer size
- MAXBUF, // input buffer size
- 1000, // client time-out
- NULL); // no security attribute
+ PIPE_ACCESS_DUPLEX, // read/write access
+ PIPE_TYPE_MESSAGE | // message type pipe
+ PIPE_READMODE_MESSAGE | // message-read mode
+ PIPE_WAIT, // blocking mode
+ PIPE_UNLIMITED_INSTANCES, // max. instances
+ MAXBUF, // output buffer size
+ MAXBUF, // input buffer size
+ 1000, // client time-out
+ NULL); // no security attribute
if (Pipe == INVALID_HANDLE_VALUE)
{
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp
index 37da9c0b3..62d9ff329 100644
--- a/win/inspircd_win32wrapper.cpp
+++ b/win/inspircd_win32wrapper.cpp
@@ -753,7 +753,7 @@ int getcpu()
&pEnumerator);
if (FAILED(hres))
- return 0;
+ return -1;
IWbemClassObject *pclsObj = NULL;
ULONG uReturn = 0;
@@ -790,5 +790,5 @@ int getcpu()
}
pEnumerator->Release();
pclsObj->Release();
- return 0;
+ return -1;
}