Implement enough connmgr support, loading the dll and getting proc

addresses by name, to successfully bring up cellular connection for
rest of networking to use when it's down.  This is a start: eventually
the stuff in connmgr.h (being added here) should be replaced by
support added to cegcc (including link info so the proc ptrs go away.)
Still to do: figure out how to detect when phone is turned on so can
try again without user needing to restart the app.
This commit is contained in:
ehouse 2009-12-21 06:43:21 +00:00
parent 3fb3616e6c
commit 098cd1b297
7 changed files with 443 additions and 30 deletions

View file

@ -56,6 +56,7 @@
#include "cesms.h"
#include "cesockwr.h"
#include "ceresstr.h"
#include "connmgr.h"
#include "dbgutil.h"
@ -1328,6 +1329,34 @@ getOSInfo( CEAppGlobals* globals )
#define getOSInfo( g )
#endif
#ifndef XWFEATURE_STANDALONE_ONLY
#ifdef _WIN32_WCE
# define LOAD_PTR( typ, name ) { \
typ proc; \
proc = (typ)GetProcAddress( hcellDll, TEXT(#name));\
XP_ASSERT( !!proc ); \
globals->cmProcs.name = proc; \
}
static void
initConnMgr( CEAppGlobals* globals )
{
HINSTANCE hcellDll = LoadLibrary(TEXT("cellcore.dll"));
if ( !!hcellDll ) {
globals->hcellDll = hcellDll;
LOAD_PTR( ConnMgrEstablishConnectionProc, ConnMgrEstablishConnection );
LOAD_PTR( ConnMgrConnectionStatusProc, ConnMgrConnectionStatus );
LOAD_PTR( ConnMgrMapURLProc, ConnMgrMapURL );
LOAD_PTR( ConnMgrReleaseConnectionProc, ConnMgrReleaseConnection );
}
}
# undef LOAD_PTR
#endif
#endif
//
// FUNCTION: InitInstance(HANDLE, int)
//
@ -1508,6 +1537,10 @@ InitInstance(HINSTANCE hInstance, int nCmdShow
trapBackspaceKey( hWnd );
#ifdef _WIN32_WCE
initConnMgr( globals );
#endif
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
#ifdef _WIN32_WCE
@ -1673,6 +1706,10 @@ ceFlattenState( const CEAppGlobals* globals )
case CE_IPST_START:
/* state = CENSTATE_NONE; */
break;
#ifdef _WIN32_WCE
case CE_IPST_OPENING_NETWORK:
case CE_IPST_NETWORK_OPENED:
#endif
case CE_IPST_RESOLVINGHOST:
case CE_IPST_HOSTRESOLVED:
case CE_IPST_CONNECTING:
@ -2107,6 +2144,13 @@ freeGlobals( CEAppGlobals* globals )
globals->socketWrap = NULL;
}
WSACleanup();
# ifdef _WIN32_WCE
if ( !!globals->hcellDll ) {
FreeLibrary( globals->hcellDll );
globals->hcellDll = NULL;
}
# endif
#endif
if ( !!globals->vtMgr ) {
@ -2403,6 +2447,23 @@ doAbout( CEAppGlobals* globals )
MB_OK | MB_ICONINFORMATION );
}
static void
connEvtAndError( CEAppGlobals* globals, WPARAM wParam )
{
ConnMgrErr userErr;
ce_connmgr_event( globals->socketWrap, wParam, &userErr );
switch( userErr ) {
case CONN_ERR_NONE:
break;
case CONN_ERR_PHONE_OFF:
ceOopsId( globals, IDS_PHONE_OFF );
break;
case CONN_ERR_NONET:
ceOopsId( globals, IDS_NETWORK_FAILED );
break;
}
}
LRESULT CALLBACK
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
@ -2793,6 +2854,11 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
draw = ce_sockwrap_event( globals->socketWrap, wParam, lParam );
}
break;
#ifdef _WIN32_WCE
case XWWM_CONNMGR_EVT:
connEvtAndError( globals, wParam );
break;
#endif
#endif
default:
@ -3191,10 +3257,11 @@ ce_send_proc( const XP_U8* buf, XP_U16 len, const CommsAddrRec* addrp,
case COMMS_CONN_RELAY:
if ( !globals->exiting ) {
if ( !globals->socketWrap ) {
globals->socketWrap = ce_sockwrap_new( MPPARM(globals->mpool)
globals->hWnd,
got_data_proc,
sock_state_change, globals );
globals->socketWrap
= ce_sockwrap_new( MPPARM(globals->mpool)
globals->hWnd,
got_data_proc,sock_state_change,
&globals->cmProcs, globals );
}
nSent = ce_sockwrap_send( globals->socketWrap, buf, len, addrp );

View file

@ -28,6 +28,7 @@
#include "util.h"
#include "mempool.h"
#include "cesockwr.h"
#include "connmgr.h"
#define LCROSSWORDS_DIR_NODBG L"Crosswords"
#define CE_GAMEFILE_VERSION1 0x01 /* means draw gets to save/restore */
@ -137,6 +138,12 @@ typedef struct _CEAppGlobals {
HMENU softKeyMenu; /* so can check/uncheck duplicated items */
#endif
#if defined _WIN32_WCE && ! defined CEGCC_DOES_CONNMGR
HINSTANCE hcellDll;
/* UINT connmgrMsg; */
CMProcs cmProcs;
#endif
struct CEDrawCtx* draw;
XWGame game;
CurGameInfo gameInfo;
@ -209,6 +216,9 @@ enum {
,XWWM_RELAY_REQ_NEW
,XWWM_RELAY_REQ_CONN
,XWWM_SOCKET_EVT
#ifdef _WIN32_WCE
,XWWM_CONNMGR_EVT
#endif
};
#define CE_NUM_EDITABLE_COLORS CE_BLACK_COLOR

View file

@ -28,6 +28,7 @@
#include "cemain.h"
#include "cedebug.h"
#include "debhacks.h"
#include "connmgr.h"
/* This object owns all network activity: sending and receiving packets. It
@ -38,16 +39,16 @@
order.
*/
enum { WRITER_THREAD,
READER_THREAD,
N_THREADS };
#define MAX_QUEUE_SIZE 6
struct CeSocketWrapper {
HWND hWnd;
DataRecvProc dataProc;
StateChangeProc stateProc;
#ifdef _WIN32_WCE
const CMProcs* cmProcs;
HANDLE connMgrHandle;
#endif
void* closure;
union {
@ -84,6 +85,10 @@ ConnState2Str( CeConnState connState )
#define CASESTR(s) case (s): return #s
switch( connState ) {
CASESTR( CE_IPST_START );
#ifdef _WIN32_WCE
CASESTR( CE_IPST_OPENING_NETWORK );
CASESTR( CE_IPST_NETWORK_OPENED );
#endif
CASESTR( CE_IPST_RESOLVINGHOST );
CASESTR( CE_IPST_HOSTRESOLVED );
CASESTR( CE_IPST_CONNECTING );
@ -96,6 +101,8 @@ ConnState2Str( CeConnState connState )
# define ConnState2Str(s)
#endif
/* Forward decls */
static void getHostAddr( CeSocketWrapper* self );
static XP_Bool connectIfNot( CeSocketWrapper* self );
static XP_Bool
@ -161,6 +168,13 @@ stateChanged( CeSocketWrapper* self, CeConnState newState )
switch( newState ) {
case CE_IPST_START:
break;
#ifdef _WIN32_WCE
case CE_IPST_OPENING_NETWORK:
break;
case CE_IPST_NETWORK_OPENED:
getHostAddr( self );
break;
#endif
case CE_IPST_RESOLVINGHOST:
break;
case CE_IPST_HOSTRESOLVED:
@ -199,7 +213,10 @@ connectSocket( CeSocketWrapper* self )
name.sin_port = XP_HTONS( self->addrRec.u.ip_relay.port );
name.sin_addr.S_un.S_addr = XP_HTONL(self->addrRec.u.ip_relay.ipAddr);
XP_LOGF( "%s: calling WSAConnect", __func__ );
XP_LOGF( "%s: calling WSAConnect: port=%d; host=%lx", __func__,
self->addrRec.u.ip_relay.port,
self->addrRec.u.ip_relay.ipAddr );
if ( SOCKET_ERROR != WSAConnect( sock, (struct sockaddr *)&name,
sizeof(name), NULL, NULL,
NULL, NULL ) ) {
@ -250,6 +267,50 @@ closeConnection( CeSocketWrapper* self )
stateChanged( self, CE_IPST_START );
} /* closeConnection */
#ifdef _WIN32_WCE
static void
openNetwork( CeSocketWrapper* self )
{
HRESULT res;
if ( !!self->connMgrHandle ) { /* already have a connection? */
DWORD status;
res = (*self->cmProcs->ConnMgrConnectionStatus)( self->connMgrHandle,
&status );
if ( SUCCEEDED(res) && status == CONNMGR_STATUS_CONNECTED ) {
stateChanged( self, CE_IPST_NETWORK_OPENED );
} else {
(*self->cmProcs->ConnMgrReleaseConnection)( self->connMgrHandle, 1 );
self->connMgrHandle = NULL;
}
}
if ( !self->connMgrHandle ) {
CONNMGR_CONNECTIONINFO cmi;
HANDLE hand;
XP_MEMSET( &cmi, 0, sizeof(cmi) );
res = (*self->cmProcs->ConnMgrMapURL)( L"http://google.com",
&cmi.guidDestNet, NULL );
if ( SUCCEEDED(res) ) {
cmi.cbSize = sizeof(cmi);
cmi.bExclusive = FALSE;
cmi.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;
cmi.dwParams = CONNMGR_PARAM_GUIDDESTNET;
cmi.dwFlags = CONNMGR_FLAG_PROXY_HTTP;
cmi.hWnd = self->hWnd;
cmi.uMsg = XWWM_CONNMGR_EVT;
res = (*self->cmProcs->ConnMgrEstablishConnection)( &cmi, &hand );
if ( SUCCEEDED(res) ) {
self->connMgrHandle = hand;
stateChanged( self, CE_IPST_OPENING_NETWORK );
}
}
}
} /* openNetwork */
#endif
static void
getHostAddr( CeSocketWrapper* self )
{
@ -273,7 +334,11 @@ getHostAddr( CeSocketWrapper* self )
CeSocketWrapper*
ce_sockwrap_new( MPFORMAL HWND hWnd, DataRecvProc dataCB,
StateChangeProc stateCB, void* closure )
StateChangeProc stateCB,
#ifdef _WIN32_WCE
const CMProcs* cmProcs,
#endif
void* closure )
{
CeSocketWrapper* self = NULL;
@ -283,6 +348,9 @@ ce_sockwrap_new( MPFORMAL HWND hWnd, DataRecvProc dataCB,
self->hWnd = hWnd;
self->dataProc = dataCB;
self->stateProc = stateCB;
#ifdef _WIN32_WCE
self->cmProcs = cmProcs;
#endif
self->closure = closure;
MPASSIGN(self->mpool, mpool );
self->socket = -1;
@ -300,6 +368,13 @@ ce_sockwrap_delete( CeSocketWrapper* self )
some other way */
closeConnection( self );
#ifdef _WIN32_WCE
if ( !!self->connMgrHandle ) {
(*self->cmProcs->ConnMgrReleaseConnection)( self->connMgrHandle, 1 );
self->connMgrHandle = NULL;
}
#endif
XP_FREE( self->mpool, self );
} /* ce_sockwrap_delete */
@ -341,8 +416,6 @@ ce_sockwrap_hostname( CeSocketWrapper* self, WPARAM wParam, LPARAM lParam )
/* WSANO_RECOVERY */
/* WSANO_DATA */
}
LOG_RETURN_VOID();
} /* ce_sockwrap_hostname */
static XP_Bool
@ -471,6 +544,55 @@ ce_sockwrap_event( CeSocketWrapper* self, WPARAM wParam, LPARAM lParam )
return draw;
} /* ce_sockwrap_event */
#ifdef _WIN32_WCE
void
ce_connmgr_event( CeSocketWrapper* self, WPARAM wParam, ConnMgrErr* userErr )
{
XP_LOGF( "%s: wParam=%x", __func__, wParam );
*userErr = CONN_ERR_NONE;
switch( wParam ) {
case CONNMGR_STATUS_CONNECTED:
stateChanged( self, CE_IPST_NETWORK_OPENED );
break;
/* no recovery from any of these */
case CONNMGR_STATUS_NOPATHTODESTINATION:
case CONNMGR_STATUS_CONNECTIONCANCELED:
case CONNMGR_STATUS_CONNECTIONLINKFAILED:
case CONNMGR_STATUS_CONNECTIONDISABLED:
case CONNMGR_STATUS_AUTHENTICATIONFAILED:
(*self->cmProcs->ConnMgrReleaseConnection)( self->connMgrHandle, 1 );
stateChanged( self, CE_IPST_START );
self->connMgrHandle = NULL;
*userErr = CONN_ERR_NONET;
break;
/* Error the user can fix.... */
case CONNMGR_STATUS_PHONEOFF:
*userErr = CONN_ERR_PHONE_OFF;
break;
case CONNMGR_STATUS_UNKNOWN:
case CONNMGR_STATUS_DISCONNECTED:
case CONNMGR_STATUS_CONNECTIONFAILED:
case CONNMGR_STATUS_WAITINGFORPATH:
case CONNMGR_STATUS_WAITINGFORPHONE:
case CONNMGR_STATUS_EXCLUSIVECONFLICT:
case CONNMGR_STATUS_WAITINGCONNECTION:
case CONNMGR_STATUS_WAITINGFORRESOURCE:
case CONNMGR_STATUS_WAITINGFORNETWORK:
case CONNMGR_STATUS_WAITINGDISCONNECTION:
case CONNMGR_STATUS_WAITINGCONNECTIONABORT:
case CONNMGR_STATUS_NOPATHWITHPROPERTY:
break;
default:
XP_LOGF( "unknown status: %x", wParam );
}
}
#endif
XP_S16
ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
const CommsAddrRec* addr )
@ -492,7 +614,11 @@ ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
}
if ( CE_IPST_START == self->connState ) {
#ifdef _WIN32_WCE
openNetwork( self ); /* kicks off connection process */
#else
getHostAddr( self ); /* kicks off connection process */
#endif
}
/* What if we're stuck in some other state? Kick those here too? */

View file

@ -23,28 +23,47 @@
#include "comms.h"
#include "mempool.h"
#include "connmgr.h"
typedef enum {
CE_IPST_START
#ifdef _WIN32_WCE
,CE_IPST_OPENING_NETWORK
,CE_IPST_NETWORK_OPENED
#endif
,CE_IPST_RESOLVINGHOST
,CE_IPST_HOSTRESOLVED
,CE_IPST_CONNECTING
,CE_IPST_CONNECTED
} CeConnState;
/* Errors to tell the user about */
typedef enum {
CONN_ERR_NONE
,CONN_ERR_PHONE_OFF
,CONN_ERR_NONET
} ConnMgrErr;
typedef struct CeSocketWrapper CeSocketWrapper; /* forward */
typedef XP_Bool (*DataRecvProc)( XP_U8* data, XP_U16 len, void* closure );
typedef void (*StateChangeProc)( void* closure, CeConnState oldState,
CeConnState newState );
CeSocketWrapper* ce_sockwrap_new( MPFORMAL HWND hWnd, DataRecvProc dataCB,
StateChangeProc stateCB, void* globals );
StateChangeProc stateCB,
#ifdef _WIN32_WCE
const CMProcs* cmProcs,
#endif
void* globals );
void ce_sockwrap_delete( CeSocketWrapper* self );
void ce_sockwrap_hostname( CeSocketWrapper* self, WPARAM wParam, LPARAM lParam );
void ce_sockwrap_hostname( CeSocketWrapper* self, WPARAM wParam,
LPARAM lParam );
XP_Bool ce_sockwrap_event( CeSocketWrapper* self, WPARAM wParam, LPARAM lParam );
XP_S16 ce_sockwrap_send( CeSocketWrapper* self, const XP_U8* buf, XP_U16 len,
const CommsAddrRec* addr );
void ce_connmgr_event( CeSocketWrapper* self, WPARAM wParam,
ConnMgrErr* userErr );
#endif

182
xwords4/wince/connmgr.h Normal file
View file

@ -0,0 +1,182 @@
/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */
/*
* Copyright 2005-2009 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* This should eventually be contributed to cegcc. Everything it in comes
* from MSDN
*/
#ifndef _CONNMGR_H_
#define _CONNMGR_H_
#include <winuser.h>
/* from http://hi.baidu.com/53_54/blog/index/1 */
#ifndef S_OK
# define S_OK 0
#endif
#ifndef CONNMGR_PARAM_GUIDDESTNET
# define CONNMGR_PARAM_GUIDDESTNET 0x1
#endif
#ifndef CONNMGR_FLAG_PROXY_HTTP
# define CONNMGR_FLAG_PROXY_HTTP 0x1
#endif
#ifndef CONNMGR_PRIORITY_USERINTERACTIVE
# define CONNMGR_PRIORITY_USERINTERACTIVE 0x08000
#endif
#ifndef CONNMGR_STATUS_CONNECTED
# define CONNMGR_STATUS_CONNECTED 0x10
#endif
#if 0
/* from http://www.dotnet247.com/247reference/msgs/53/267570.aspx */
public const uint CONNMGR_STATUS_UNKNOWN = 0x00; // Unknown status
public const uint CONNMGR_STATUS_CONNECTED = 0x10; // Connection is up
public const uint CONNMGR_STATUS_DISCONNECTED = 0x20; // Connection is disconnected
public const uint CONNMGR_STATUS_CONNECTIONFAILED = 0x21; // Connection failed and cannot not be reestablished
public const uint CONNMGR_STATUS_CONNECTIONCANCELED = 0x22; // User aborted connection
public const uint CONNMGR_STATUS_CONNECTIONDISABLED = 0x23; // Connection is ready to connect but disabled
public const uint CONNMGR_STATUS_NOPATHTODESTINATION = 0x24; // No path could be found to destination
public const uint CONNMGR_STATUS_WAITINGFORPATH = 0x25; // Waiting for a path to the destination
public const uint CONNMGR_STATUS_WAITINGFORPHONE = 0x26; // Voice call is in progress
public const uint CONNMGR_STATUS_WAITINGCONNECTION = 0x40; // Attempting to connect
public const uint CONNMGR_STATUS_WAITINGFORRESOURCE = 0x41; // Resource is in use by another connection
public const uint CONNMGR_STATUS_WAITINGFORNETWORK = 0x42; // No path could be found to destination
public const uint CONNMGR_STATUS_WAITINGDISCONNECTION = 0x80; // Connection is being brought down
public const uint CONNMGR_STATUS_WAITINGCONNECTIONABORT = 0x81; // Aborting connection attempt
#endif
/*
A bunch of these constants are from:
http://74.125.155.132/search?q=cache:fZImjloe6fsJ:download.microsoft.com/download/6/B/C/6BC8CDA8-9035-43AC-AFB8-B5B7DC550949/OCS%25202007%2520R2%2520Technical%2520Reference%2520for%2520Clients.doc+define+CONNMGR_STATUS_PHONEOFF&cd=1&hl=en&ct=clnk&gl=us&client=iceweasel-a
*/
/* this URL provides the following definitions
http://technet.microsoft.com/en-us/library/dd637175%28office.13%29.aspx
CONNMGR_STATUS_CONNECTIONLINKFAILED(0x2A)
CONNMGR_STATUS_CONNECTIONFAILED(0x21)
CONNMGR_STATUS_EXCLUSIVECONFLICT(0x28)
CONNMGR_STATUS_NOPATHTODESTINATION(0x24)
CONNMGR_STATUS_CONNECTIONCANCELED(0x22)
CONNMGR_STATUS_WAITINGFORPATH(0x25)
CONNMGR_STATUS_PHONEOFF(0x27)
CONNMGR_STATUS_WAITINGFORPHONE(0x26)
CONNMGR_STATUS_AUTHENTICATIONFAILED(0x2B)
CONNMGR_STATUS_NOPATHWITHPROPERTY(0x2C)
CONNMGR_STATUS_UNKNOWN( 0X00)
*/
#ifndef CONNMGR_STATUS_UNKNOWN
# define CONNMGR_STATUS_UNKNOWN 0x00
#endif
#ifndef CONNMGR_STATUS_CONNECTED
# define CONNMGR_STATUS_CONNECTED 0x10
#endif
// CONNMGR_STATUS_SUSPENDED
#ifndef CONNMGR_STATUS_DISCONNECTED
# define CONNMGR_STATUS_DISCONNECTED 0x20
#endif
#ifndef CONNMGR_STATUS_CONNECTIONFAILED
# define CONNMGR_STATUS_CONNECTIONFAILED 0x21
#endif
#ifndef CONNMGR_STATUS_CONNECTIONCANCELED
# define CONNMGR_STATUS_CONNECTIONCANCELED 0x22
#endif
#ifndef CONNMGR_STATUS_CONNECTIONDISABLED
# define CONNMGR_STATUS_CONNECTIONDISABLED 0x23
#endif
#ifndef CONNMGR_STATUS_NOPATHTODESTINATION
# define CONNMGR_STATUS_NOPATHTODESTINATION 0x24
#endif
#ifndef CONNMGR_STATUS_WAITINGFORPATH
# define CONNMGR_STATUS_WAITINGFORPATH 0x25
#endif
#ifndef CONNMGR_STATUS_WAITINGFORPHONE
# define CONNMGR_STATUS_WAITINGFORPHONE 0x26
#endif
#ifndef CONNMGR_STATUS_PHONEOFF
# define CONNMGR_STATUS_PHONEOFF 0x27
#endif
#ifndef CONNMGR_STATUS_EXCLUSIVECONFLICT
# define CONNMGR_STATUS_EXCLUSIVECONFLICT 0x28
#endif
// CONNMGR_STATUS_NORESOURCES
#ifndef CONNMGR_STATUS_CONNECTIONLINKFAILED
# define CONNMGR_STATUS_CONNECTIONLINKFAILED 0x2A
#endif
#ifndef CONNMGR_STATUS_AUTHENTICATIONFAILED
# define CONNMGR_STATUS_AUTHENTICATIONFAILED 0x2B
#endif
#ifndef CONNMGR_STATUS_WAITINGCONNECTION
# define CONNMGR_STATUS_WAITINGCONNECTION 0x40
#endif
#ifndef CONNMGR_STATUS_WAITINGFORRESOURCE
# define CONNMGR_STATUS_WAITINGFORRESOURCE 0x41
#endif
#ifndef CONNMGR_STATUS_WAITINGFORNETWORK
# define CONNMGR_STATUS_WAITINGFORNETWORK 0x42
#endif
#ifndef CONNMGR_STATUS_WAITINGDISCONNECTION
# define CONNMGR_STATUS_WAITINGDISCONNECTION 0x80
#endif
#ifndef CONNMGR_STATUS_WAITINGCONNECTIONABORT
# define CONNMGR_STATUS_WAITINGCONNECTIONABORT 0x81
#endif
#ifndef CONNMGR_STATUS_NOPATHWITHPROPERTY
# define CONNMGR_STATUS_NOPATHWITHPROPERTY 0x2C
#endif
typedef struct _CONNMGR_CONNECTIONINFO {
DWORD cbSize;
DWORD dwParams;
DWORD dwFlags;
DWORD dwPriority;
BOOL bExclusive;
BOOL bDisabled;
GUID guidDestNet;
HWND hWnd;
UINT uMsg;
LPARAM lParam;
ULONG ulMaxCost;
ULONG ulMinRcvBw;
ULONG ulMaxConnLatency;
} CONNMGR_CONNECTIONINFO;
/* procptr typedefs since we're loading by name */
typedef HRESULT (*ConnMgrRegisterForStatusChangeNotificationProc)( BOOL, HWND );
/* Returns S_OK if successful or returns an error code if the function call
failed.*/
typedef HRESULT (*ConnMgrEstablishConnectionProc)( CONNMGR_CONNECTIONINFO*,
HANDLE* );
typedef HRESULT (*ConnMgrConnectionStatusProc)( HANDLE, DWORD* );
typedef HRESULT (*ConnMgrMapURLProc)( LPTSTR, GUID*, DWORD* );
typedef HRESULT (*ConnMgrReleaseConnectionProc)( HANDLE, LONG );
typedef struct _CMProcs {
ConnMgrEstablishConnectionProc ConnMgrEstablishConnection;
ConnMgrConnectionStatusProc ConnMgrConnectionStatus;
ConnMgrMapURLProc ConnMgrMapURL;
ConnMgrReleaseConnectionProc ConnMgrReleaseConnection;
} CMProcs;
#endif

View file

@ -1001,7 +1001,13 @@ BEGIN
IDS_LANG_CHANGE_RESTART "You will see the new language after you restart Crosswords."
#ifndef XWFEATURE_STANDALONE_ONLY
IDS_RESEND_STANDALONE "This is a standalone game. There is nothing to resend."
IDS_RESEND_STANDALONE "This is a standalone game. There is nothing to "\
"resend."
IDS_PHONE_OFF "Crosswords cannot connect because the phone "\
"appears to be off. Please restart Crosswords "\
"after turning it on."
IDS_NETWORK_FAILED "Unable to bring up networking."
IDS_CONN_RELAY_L "Relay"
IDS_CONN_DIRECT "Direct connection"
IDS_LOCALPLAYERS "Local players:"

View file

@ -12,7 +12,7 @@
* whether a given resource can be trusted. Up it when changing the order of
* strings. Which do only when unavoidable.
*/
#define CUR_DLL_VERSION 0x0002
#define CUR_DLL_VERSION 0x0003
#define CE_FIRST_RES_ID 40002
@ -108,32 +108,35 @@
# define IDS_SERVER_DICT_WINS 40088
# define IDS_REG_SERVER_SANS_REMOTE 40089
# define IDS_RESEND_STANDALONE 40090
# define IDS_PHONE_OFF 40091
# define IDS_NETWORK_FAILED 40092
# ifdef XWFEATURE_SMS
# define IDS_SMS_CONN_L 40091
# define IDS_SMS_CONN_L 40093
# endif
# ifdef XWFEATURE_IP_DIRECT
# define IDS_DIRECT_CONN_L 40092
# define IDS_DIRECT_CONN_L 40094
# endif
# ifdef XWFEATURE_RELAY
# define IDS_XWRELAY_ERROR_TIMEOUT 40093
# define IDS_ERROR_HEART_YOU 40094
# define IDS_XWRELAY_ERROR_HEART_OTHER 40095
# define IDS_XWRELAY_ERROR_LOST_OTHER 40096
# define IDS_XWRELAY_RELAY_INCOMPAT 40097
# define IDS_RELAY_ALLHERE 40098
# define IDS_RELAY_HOST_WAITINGD 40099
# define IDS_RELAY_GUEST_WAITINGD 40100
# define IDS_ERROR_NO_ROOM 40101
# define IDS_ERROR_DUP_ROOM 40102
# define IDS_ERROR_TOO_MANY 40103
# define IDS_XWRELAY_ERROR_TIMEOUT 40095
# define IDS_ERROR_HEART_YOU 40096
# define IDS_XWRELAY_ERROR_HEART_OTHER 40097
# define IDS_XWRELAY_ERROR_LOST_OTHER 40098
# define IDS_XWRELAY_RELAY_INCOMPAT 40099
# define IDS_RELAY_ALLHERE 40100
# define IDS_RELAY_HOST_WAITINGD 40101
# define IDS_RELAY_GUEST_WAITINGD 40102
# define IDS_ERROR_NO_ROOM 40103
# define IDS_ERROR_DUP_ROOM 40104
# define IDS_ERROR_TOO_MANY 40105
# endif
#endif
#if ! defined XWFEATURE_STANDALONE_ONLY
# define CE_LAST_RES_ID 40104
# define CE_LAST_RES_ID 40106
#else
# define CE_LAST_RES_ID 40082
#endif