--- mstools/samples/rpc/mandel/remote.c 2018/08/09 18:20:55 1.1.1.2 +++ mstools/samples/rpc/mandel/remote.c 2018/08/09 18:21:59 1.1.1.3 @@ -108,15 +108,6 @@ DWORD CalcThreshold( double ); BOOL InitRemote( HWND hWnd ) { -#ifdef RPC - RPC_STATUS status; // returned by RPC API function - unsigned char * pszUuid = "12345678-1234-1234-1234-123456789ABC"; - unsigned char * pszProtocolSequence = "ncacn_np"; - unsigned char * pszNetworkAddress = NULL; - unsigned char * pszEndpoint = "\\pipe\\mandel"; - unsigned char * pszOptions = NULL; - unsigned char * pszStringBinding; // long string -#endif #ifndef RPC UNREFERENCED_PARAMETER(hWnd); @@ -127,40 +118,6 @@ InitRemote( HWND hWnd ) strcpy(SvrTable[0].name, szLocal); SvrTable[0].iStatus = SS_LOCAL; -#ifdef RPC -/* Select named pipes as the transport type and provide the */ -/* path to the server and named pipe that is used for RPC. */ - -/* Call the Microsoft RPC V1.0 Beta API function that lets */ -/* the client establish a connection with the server. */ - - status = RpcStringBindingCompose(pszUuid, - pszProtocolSequence, - pszNetworkAddress, - pszEndpoint, - pszOptions, - &pszStringBinding); - sprintf(pszFail, "RpcStringBindingCompose returned 0x%x for %s\n", - status, pszStringBinding); - MessageBox(hWnd, pszFail, "Mandelbrot RPC Application", - MB_ICONINFORMATION | MB_SYSTEMMODAL); - if (status) { - PostMessage(hWnd, WM_DESTROY, 0, 0L); - return FALSE; - } - - status = RpcBindingFromStringBinding(pszStringBinding, - &hMandel); - - sprintf(pszFail, "RpcBindingFromStringBinding returned 0x%x for %s\n",\ - status, pszStringBinding); - MessageBox(hWnd, pszFail, "Mandelbrot RPC Application", - MB_ICONINFORMATION | MB_SYSTEMMODAL); - if (status) { - PostMessage(hWnd, WM_DESTROY, 0, 0L); - return FALSE; - } -#endif // good, we succeeded return TRUE; @@ -238,7 +195,11 @@ BOOL CheckDrawStatus( HWND hwnd) return TRUE; case SS_LOCAL: - // Do a chunk of work locally + // Do a chunk of work locally +#ifdef RPC + if (fBound == FALSE) + break; +#endif if ((long)dwCurrentLine > rclPicture.xRight) { if (fContinueZoom == TRUE) { @@ -367,7 +328,7 @@ CheckDrawingID( int id) */ static BOOL fBufferTaken = FALSE; -static HANDLE hSharedBuf = NULL; +static HANDLE hSharedBuf = (HANDLE)NULL; BOOL