From 69209c38968c6f4066a772e0a51a2928749217de Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 19:00:23 +0000 Subject: Re-indenting the code to use standard tabs. Yes, I know this is pretty pointless, but who cares? --- Stars45/NPClientWraps.cpp | 98 +++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'Stars45/NPClientWraps.cpp') diff --git a/Stars45/NPClientWraps.cpp b/Stars45/NPClientWraps.cpp index 015526c..c1d88d9 100644 --- a/Stars45/NPClientWraps.cpp +++ b/Stars45/NPClientWraps.cpp @@ -61,7 +61,7 @@ NPRESULT __stdcall NP_RegisterWindowHandle( HWND hWnd ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_RegisterWindowHandle ) - result = (*gpfNP_RegisterWindowHandle)( hWnd ); + result = (*gpfNP_RegisterWindowHandle)( hWnd ); return result; } // NP_RegisterWindowHandle() @@ -72,7 +72,7 @@ NPRESULT __stdcall NP_UnregisterWindowHandle() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_UnregisterWindowHandle ) - result = (*gpfNP_UnregisterWindowHandle)(); + result = (*gpfNP_UnregisterWindowHandle)(); return result; } // NP_UnregisterWindowHandle() @@ -83,7 +83,7 @@ NPRESULT __stdcall NP_RegisterProgramProfileID( unsigned short wPPID ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_RegisterProgramProfileID ) - result = (*gpfNP_RegisterProgramProfileID)( wPPID ); + result = (*gpfNP_RegisterProgramProfileID)( wPPID ); return result; } // NP_RegisterProgramProfileID() @@ -94,7 +94,7 @@ NPRESULT __stdcall NP_QueryVersion( unsigned short* pwVersion ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_QueryVersion ) - result = (*gpfNP_QueryVersion)( pwVersion ); + result = (*gpfNP_QueryVersion)( pwVersion ); return result; } // NP_QueryVersion() @@ -105,7 +105,7 @@ NPRESULT __stdcall NP_RequestData( unsigned short wDataReq ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_RequestData ) - result = (*gpfNP_RequestData)( wDataReq ); + result = (*gpfNP_RequestData)( wDataReq ); return result; } // NP_RequestData() @@ -115,7 +115,7 @@ NPRESULT __stdcall NP_GetSignature( LPTRACKIRSIGNATURE pSignature ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_GetSignature ) - result = (*gpfNP_GetSignature)( pSignature ); + result = (*gpfNP_GetSignature)( pSignature ); return result; } // NP_GetSignature() @@ -126,7 +126,7 @@ NPRESULT __stdcall NP_GetData( LPTRACKIRDATA pTID ) NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_GetData ) - result = (*gpfNP_GetData)( pTID ); + result = (*gpfNP_GetData)( pTID ); return result; } // NP_GetData() @@ -137,7 +137,7 @@ NPRESULT __stdcall NP_StartCursor() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_StartCursor ) - result = (*gpfNP_StartCursor)(); + result = (*gpfNP_StartCursor)(); return result; } // NP_StartCursor() @@ -148,7 +148,7 @@ NPRESULT __stdcall NP_StopCursor() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_StopCursor ) - result = (*gpfNP_StopCursor)(); + result = (*gpfNP_StopCursor)(); return result; } // NP_StopCursor() @@ -159,7 +159,7 @@ NPRESULT __stdcall NP_ReCenter() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_ReCenter ) - result = (*gpfNP_ReCenter)(); + result = (*gpfNP_ReCenter)(); return result; } // NP_ReCenter() @@ -170,7 +170,7 @@ NPRESULT __stdcall NP_StartDataTransmission() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_StartDataTransmission ) - result = (*gpfNP_StartDataTransmission)(); + result = (*gpfNP_StartDataTransmission)(); return result; } // NP_StartDataTransmission() @@ -181,7 +181,7 @@ NPRESULT __stdcall NP_StopDataTransmission() NPRESULT result = NP_ERR_DLL_NOT_FOUND; if( NULL != gpfNP_StopDataTransmission ) - result = (*gpfNP_StopDataTransmission)(); + result = (*gpfNP_StopDataTransmission)(); return result; } // NP_StopDataTransmission() @@ -197,54 +197,54 @@ NPRESULT NPClient_Init( const char* csDLLPath ) Text csNPClientDLLFullPath; if (csDLLPath && *csDLLPath) - csNPClientDLLFullPath = Text(csDLLPath) + "\\"; + csNPClientDLLFullPath = Text(csDLLPath) + "\\"; csNPClientDLLFullPath += "NPClient.dll"; ghNPClientDLL = ::LoadLibrary( csNPClientDLLFullPath.data() ); - if (NULL != ghNPClientDLL) { - // verify the dll signature - gpfNP_GetSignature = (PF_NP_GETSIGNATURE)::GetProcAddress( ghNPClientDLL, "NP_GetSignature" ); - - SIGNATUREDATA pSignature; - SIGNATUREDATA verifySignature; - // init the signatures - strcpy(verifySignature.DllSignature, "precise head tracking\n put your head into the game\n now go look around\n\n Copyright EyeControl Technologies"); - strcpy(verifySignature.AppSignature, "hardware camera\n software processing data\n track user movement\n\n Copyright EyeControl Technologies"); - // query the dll and compare the results - NPRESULT vresult = NP_GetSignature( &pSignature ); - if( vresult == NP_OK ) - { - if ((strcmp(verifySignature.DllSignature,pSignature.DllSignature)==0) + if (NULL != ghNPClientDLL) { + // verify the dll signature + gpfNP_GetSignature = (PF_NP_GETSIGNATURE)::GetProcAddress( ghNPClientDLL, "NP_GetSignature" ); + + SIGNATUREDATA pSignature; + SIGNATUREDATA verifySignature; + // init the signatures + strcpy(verifySignature.DllSignature, "precise head tracking\n put your head into the game\n now go look around\n\n Copyright EyeControl Technologies"); + strcpy(verifySignature.AppSignature, "hardware camera\n software processing data\n track user movement\n\n Copyright EyeControl Technologies"); + // query the dll and compare the results + NPRESULT vresult = NP_GetSignature( &pSignature ); + if( vresult == NP_OK ) + { + if ((strcmp(verifySignature.DllSignature,pSignature.DllSignature)==0) && (strcmp(verifySignature.AppSignature,pSignature.AppSignature)==0)) - { - result = NP_OK; - - // Get addresses of all exported functions - gpfNP_RegisterWindowHandle = (PF_NP_REGISTERWINDOWHANDLE)::GetProcAddress( ghNPClientDLL, "NP_RegisterWindowHandle" ); - gpfNP_UnregisterWindowHandle = (PF_NP_UNREGISTERWINDOWHANDLE)::GetProcAddress( ghNPClientDLL, "NP_UnregisterWindowHandle" ); - gpfNP_RegisterProgramProfileID = (PF_NP_REGISTERPROGRAMPROFILEID)::GetProcAddress( ghNPClientDLL, "NP_RegisterProgramProfileID" ); - gpfNP_QueryVersion = (PF_NP_QUERYVERSION)::GetProcAddress( ghNPClientDLL, "NP_QueryVersion" ); - gpfNP_RequestData = (PF_NP_REQUESTDATA)::GetProcAddress( ghNPClientDLL, "NP_RequestData" ); - gpfNP_GetData = (PF_NP_GETDATA)::GetProcAddress( ghNPClientDLL, "NP_GetData" ); - gpfNP_StartCursor = (PF_NP_STARTCURSOR)::GetProcAddress( ghNPClientDLL, "NP_StartCursor" ); - gpfNP_StopCursor = (PF_NP_STOPCURSOR)::GetProcAddress( ghNPClientDLL, "NP_StopCursor" ); - gpfNP_ReCenter = (PF_NP_RECENTER)::GetProcAddress( ghNPClientDLL, "NP_ReCenter" ); - gpfNP_StartDataTransmission = (PF_NP_STARTDATATRANSMISSION)::GetProcAddress( ghNPClientDLL, "NP_StartDataTransmission" ); - gpfNP_StopDataTransmission = (PF_NP_STOPDATATRANSMISSION)::GetProcAddress( ghNPClientDLL, "NP_StopDataTransmission" ); - } - else - { - result = NP_ERR_DLL_NOT_FOUND; - } + { + result = NP_OK; + + // Get addresses of all exported functions + gpfNP_RegisterWindowHandle = (PF_NP_REGISTERWINDOWHANDLE)::GetProcAddress( ghNPClientDLL, "NP_RegisterWindowHandle" ); + gpfNP_UnregisterWindowHandle = (PF_NP_UNREGISTERWINDOWHANDLE)::GetProcAddress( ghNPClientDLL, "NP_UnregisterWindowHandle" ); + gpfNP_RegisterProgramProfileID = (PF_NP_REGISTERPROGRAMPROFILEID)::GetProcAddress( ghNPClientDLL, "NP_RegisterProgramProfileID" ); + gpfNP_QueryVersion = (PF_NP_QUERYVERSION)::GetProcAddress( ghNPClientDLL, "NP_QueryVersion" ); + gpfNP_RequestData = (PF_NP_REQUESTDATA)::GetProcAddress( ghNPClientDLL, "NP_RequestData" ); + gpfNP_GetData = (PF_NP_GETDATA)::GetProcAddress( ghNPClientDLL, "NP_GetData" ); + gpfNP_StartCursor = (PF_NP_STARTCURSOR)::GetProcAddress( ghNPClientDLL, "NP_StartCursor" ); + gpfNP_StopCursor = (PF_NP_STOPCURSOR)::GetProcAddress( ghNPClientDLL, "NP_StopCursor" ); + gpfNP_ReCenter = (PF_NP_RECENTER)::GetProcAddress( ghNPClientDLL, "NP_ReCenter" ); + gpfNP_StartDataTransmission = (PF_NP_STARTDATATRANSMISSION)::GetProcAddress( ghNPClientDLL, "NP_StartDataTransmission" ); + gpfNP_StopDataTransmission = (PF_NP_STOPDATATRANSMISSION)::GetProcAddress( ghNPClientDLL, "NP_StopDataTransmission" ); } else - { + { result = NP_ERR_DLL_NOT_FOUND; } } else - result = NP_ERR_DLL_NOT_FOUND; + { + result = NP_ERR_DLL_NOT_FOUND; + } + } + else + result = NP_ERR_DLL_NOT_FOUND; return result; -- cgit v1.1