-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGateKeeper.cpp
More file actions
55 lines (37 loc) · 1.05 KB
/
GateKeeper.cpp
File metadata and controls
55 lines (37 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// GateKeeper.cpp : Implementation of CGateKeeper
#include "stdafx.h"
#include "PointTPoint.h"
#include "GateKeeper.h"
/////////////////////////////////////////////////////////////////////////////
// CGateKeeper
STDMETHODIMP CGateKeeper::Server(BSTR *configLocation, long *rval)
{
SOMETIMES_USES_CONVERSION;
char* cfgLocation = CW2A( *configLocation );
PTP_Server( rval, cfgLocation );
return S_OK;
}
STDMETHODIMP CGateKeeper::Shutdown(BSTR *configLocation, long *rval)
{
SOMETIMES_USES_CONVERSION;
char* cfgLocation = CW2A( *configLocation );
WORD wVersionRequested;
WSADATA wsaData;
// Setup windows sockets
wVersionRequested = MAKEWORD( 0x01, 0x01 );
// No error checking here....
if ( WSAStartup( wVersionRequested, &wsaData ) != 0x00 )
{
*rval = 0;
}
else
{
PTP_Shutdown( rval, &m_ShutdownTimeout, cfgLocation );
}
return S_OK;
}
STDMETHODIMP CGateKeeper::put_ShutdownTimeout(long newVal)
{
m_ShutdownTimeout = newVal;
return S_OK;
}