private bool XLibraryLoad(string dllName, ref string errBuf) { string symName; int cl = 0; IntPtr pAddressOfFunctionToCall; if (isLoaded) return true; h = LoadLibrary(@dllName);; if (IntPtr.Zero == h) { errBuf = "Could not load shared library " + dllName; return false; } pAddressOfFunctionToCall = GetProcAddress(h, "xcreate"); if(pAddressOfFunctionToCall != IntPtr.Zero) xcreate = (xcreate_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xcreate_t)); else { symName = "xcreate"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "xfree"); if(pAddressOfFunctionToCall != IntPtr.Zero) xfree = (xfree_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xfree_t)); else { symName = "xfree"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "cxcheck"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_xcheck = (xcheck_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xcheck_t)); else { symName = "cxcheck"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "cxapiversion"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_xapiversion = (xapiversion_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xapiversion_t)); else { symName = "cxapiversion"; goto symMissing; } if (xapiversion(1,ref errBuf, ref cl) == 0) return false; {int[] s={3,1,11,3,12}; if (xcheck("gamsxRunExecDLL",4,s,ref errBuf) == 0) dll_gamsxRunExecDLL = d_gamsxRunExecDLL; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxrunexecdll"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxRunExecDLL = (gamsxRunExecDLL_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunExecDLL_t)); else { symName = "cgamsxRunExecDLL"; goto symMissing; }}} {int[] s={15,11,12,12,12}; if (xcheck("gamsxShowError",4,s,ref errBuf) == 0) dll_gamsxShowError = d_gamsxShowError; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxshowerror"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxShowError = (gamsxShowError_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxShowError_t)); else { symName = "cgamsxShowError"; goto symMissing; }}} {int[] s={0,11,3}; if (xcheck("gamsxAddBreakPoint",2,s,ref errBuf) == 0) dll_gamsxAddBreakPoint = d_gamsxAddBreakPoint; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxaddbreakpoint"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxAddBreakPoint = (gamsxAddBreakPoint_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxAddBreakPoint_t)); else { symName = "cgamsxAddBreakPoint"; goto symMissing; }}} {int[] s={0}; if (xcheck("gamsxClearBreakPoints",0,s,ref errBuf) == 0) dll_gamsxClearBreakPoints = d_gamsxClearBreakPoints; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxclearbreakpoints"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxClearBreakPoints = (gamsxClearBreakPoints_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxClearBreakPoints_t)); else { symName = "gamsxClearBreakPoints"; goto symMissing; }}} {int[] s={3,21,21}; if (xcheck("gamsxSystemInfo",2,s,ref errBuf) == 0) dll_gamsxSystemInfo = d_gamsxSystemInfo; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxsysteminfo"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxSystemInfo = (gamsxSystemInfo_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSystemInfo_t)); else { symName = "gamsxSystemInfo"; goto symMissing; }}} {int[] s={3,3,12,12,21,21,21,21}; if (xcheck("gamsxSymbolInfo",7,s,ref errBuf) == 0) dll_gamsxSymbolInfo = d_gamsxSymbolInfo; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxsymbolinfo"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxSymbolInfo = (gamsxSymbolInfo_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSymbolInfo_t)); else { symName = "cgamsxSymbolInfo"; goto symMissing; }}} {int[] s={12,3}; if (xcheck("gamsxUelName",1,s,ref errBuf) == 0) dll_gamsxUelName = d_gamsxUelName; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxuelname"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxUelName = (gamsxUelName_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxUelName_t)); else { symName = "cgamsxUelName"; goto symMissing; }}} {int[] s={3,11}; if (xcheck("gamsxFindSymbol",1,s,ref errBuf) == 0) dll_gamsxFindSymbol = d_gamsxFindSymbol; else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxfindsymbol"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxFindSymbol = (gamsxFindSymbol_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxFindSymbol_t)); else { symName = "cgamsxFindSymbol"; goto symMissing; }}} {int[] s={3,3,21}; if (xcheck("gamsxDataReadRawStart",2,s,ref errBuf) == 0) dll_gamsxDataReadRawStart = d_gamsxDataReadRawStart; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareadrawstart"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataReadRawStart = (gamsxDataReadRawStart_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadRawStart_t)); else { symName = "gamsxDataReadRawStart"; goto symMissing; }}} {int[] s={3,52,54,21}; if (xcheck("gamsxDataReadRaw",3,s,ref errBuf) == 0) dll_gamsxDataReadRaw = d_gamsxDataReadRaw; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareadraw"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataReadRaw = (gamsxDataReadRaw_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadRaw_t)); else { symName = "gamsxDataReadRaw"; goto symMissing; }}} {int[] s={3}; if (xcheck("gamsxDataReadDone",0,s,ref errBuf) == 0) dll_gamsxDataReadDone = d_gamsxDataReadDone; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareaddone"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataReadDone = (gamsxDataReadDone_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadDone_t)); else { symName = "gamsxDataReadDone"; goto symMissing; }}} {int[] s={3,3,15}; if (xcheck("gamsxDataWriteRawStart",2,s,ref errBuf) == 0) dll_gamsxDataWriteRawStart = d_gamsxDataWriteRawStart; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawriterawstart"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataWriteRawStart = (gamsxDataWriteRawStart_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteRawStart_t)); else { symName = "gamsxDataWriteRawStart"; goto symMissing; }}} {int[] s={3,51,53}; if (xcheck("gamsxDataWriteRaw",2,s,ref errBuf) == 0) dll_gamsxDataWriteRaw = d_gamsxDataWriteRaw; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawriteraw"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataWriteRaw = (gamsxDataWriteRaw_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteRaw_t)); else { symName = "gamsxDataWriteRaw"; goto symMissing; }}} {int[] s={3}; if (xcheck("gamsxDataWriteDone",0,s,ref errBuf) == 0) dll_gamsxDataWriteDone = d_gamsxDataWriteDone; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawritedone"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxDataWriteDone = (gamsxDataWriteDone_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteDone_t)); else { symName = "gamsxDataWriteDone"; goto symMissing; }}} {int[] s={0,59,1}; if (xcheck("gamsxRegisterCB1",2,s,ref errBuf) == 0) dll_gamsxRegisterCB1 = d_gamsxRegisterCB1; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxregistercb1"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxRegisterCB1 = (gamsxRegisterCB1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRegisterCB1_t)); else { symName = "gamsxRegisterCB1"; goto symMissing; }}} {int[] s={0,59,1,1}; if (xcheck("gamsxRegisterCB2",3,s,ref errBuf) == 0) dll_gamsxRegisterCB2 = d_gamsxRegisterCB2; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxregistercb2"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxRegisterCB2 = (gamsxRegisterCB2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRegisterCB2_t)); else { symName = "gamsxRegisterCB2"; goto symMissing; }}} {int[] s={59}; if (xcheck("gamsxGetCB1",0,s,ref errBuf) == 0) dll_gamsxGetCB1 = d_gamsxGetCB1; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb1"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxGetCB1 = (gamsxGetCB1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB1_t)); else { symName = "gamsxGetCB1"; goto symMissing; }}} {int[] s={59}; if (xcheck("gamsxGetCB2",0,s,ref errBuf) == 0) dll_gamsxGetCB2 = d_gamsxGetCB2; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxGetCB2 = (gamsxGetCB2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2_t)); else { symName = "gamsxGetCB2"; goto symMissing; }}} {int[] s={1}; if (xcheck("gamsxGetCB1UM",0,s,ref errBuf) == 0) dll_gamsxGetCB1UM = d_gamsxGetCB1UM; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb1um"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxGetCB1UM = (gamsxGetCB1UM_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB1UM_t)); else { symName = "gamsxGetCB1UM"; goto symMissing; }}} {int[] s={1}; if (xcheck("gamsxGetCB2UM1",0,s,ref errBuf) == 0) dll_gamsxGetCB2UM1 = d_gamsxGetCB2UM1; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2um1"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxGetCB2UM1 = (gamsxGetCB2UM1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2UM1_t)); else { symName = "gamsxGetCB2UM1"; goto symMissing; }}} {int[] s={1}; if (xcheck("gamsxGetCB2UM2",0,s,ref errBuf) == 0) dll_gamsxGetCB2UM2 = d_gamsxGetCB2UM2; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2um2"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxGetCB2UM2 = (gamsxGetCB2UM2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2UM2_t)); else { symName = "gamsxGetCB2UM2"; goto symMissing; }}} {int[] s={0,3}; if (xcheck("gamsxSWSet",1,s,ref errBuf) == 0) dll_gamsxSWSet = d_gamsxSWSet; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxswset"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxSWSet = (gamsxSWSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSWSet_t)); else { symName = "gamsxSWSet"; goto symMissing; }}} {int[] s={15}; if (xcheck("gamsxStepThrough",0,s,ref errBuf) == 0) dll_gamsxStepThrough = d_gamsxStepThrough; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxstepthrough"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxStepThrough = (gamsxStepThrough_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxStepThrough_t)); else { symName = "gamsxStepThrough"; goto symMissing; }}} {int[] s={0,15}; if (xcheck("gamsxStepThroughSet",1,s,ref errBuf) == 0) dll_gamsxStepThroughSet = d_gamsxStepThroughSet; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxstepthroughset"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxStepThroughSet = (gamsxStepThroughSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxStepThroughSet_t)); else { symName = "gamsxStepThroughSet"; goto symMissing; }}} {int[] s={15}; if (xcheck("gamsxRunToEnd",0,s,ref errBuf) == 0) dll_gamsxRunToEnd = d_gamsxRunToEnd; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxruntoend"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxRunToEnd = (gamsxRunToEnd_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunToEnd_t)); else { symName = "gamsxRunToEnd"; goto symMissing; }}} {int[] s={0,15}; if (xcheck("gamsxRunToEndSet",1,s,ref errBuf) == 0) dll_gamsxRunToEndSet = d_gamsxRunToEndSet; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxruntoendset"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxRunToEndSet = (gamsxRunToEndSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunToEndSet_t)); else { symName = "gamsxRunToEndSet"; goto symMissing; }}} {int[] s={15}; if (xcheck("gamsxCB1Defined",0,s,ref errBuf) == 0) dll_gamsxCB1Defined = d_gamsxCB1Defined; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxcb1defined"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxCB1Defined = (gamsxCB1Defined_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxCB1Defined_t)); else { symName = "gamsxCB1Defined"; goto symMissing; }}} {int[] s={15}; if (xcheck("gamsxCB2Defined",0,s,ref errBuf) == 0) dll_gamsxCB2Defined = d_gamsxCB2Defined; else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxcb2defined"); if(pAddressOfFunctionToCall != IntPtr.Zero) dll_gamsxCB2Defined = (gamsxCB2Defined_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxCB2Defined_t)); else { symName = "gamsxCB2Defined"; goto symMissing; }}} return true; symMissing: errBuf = "Could not load symbol '" + symName + "'"; return false; }
private bool XLibraryLoad(string dllName, ref string errBuf) { string symName; int cl = 0; IntPtr pAddressOfFunctionToCall; if (isLoaded) { return(true); } h = LoadLibrary(@dllName);; if (IntPtr.Zero == h) { errBuf = "Could not load shared library " + dllName; return(false); } pAddressOfFunctionToCall = GetProcAddress(h, "xcreate"); if (pAddressOfFunctionToCall != IntPtr.Zero) { xcreate = (xcreate_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xcreate_t)); } else { symName = "xcreate"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "xfree"); if (pAddressOfFunctionToCall != IntPtr.Zero) { xfree = (xfree_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xfree_t)); } else { symName = "xfree"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "cxcheck"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_xcheck = (xcheck_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xcheck_t)); } else { symName = "cxcheck"; goto symMissing; } pAddressOfFunctionToCall = GetProcAddress(h, "cxapiversion"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_xapiversion = (xapiversion_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(xapiversion_t)); } else { symName = "cxapiversion"; goto symMissing; } if (xapiversion(1, ref errBuf, ref cl) == 0) { return(false); } { int[] s = { 3, 1, 11, 3, 12 }; if (xcheck("gamsxRunExecDLL", 4, s, ref errBuf) == 0) { dll_gamsxRunExecDLL = d_gamsxRunExecDLL; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxrunexecdll"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxRunExecDLL = (gamsxRunExecDLL_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunExecDLL_t)); } else { symName = "cgamsxRunExecDLL"; goto symMissing; } } } { int[] s = { 15, 11, 12, 12, 12 }; if (xcheck("gamsxShowError", 4, s, ref errBuf) == 0) { dll_gamsxShowError = d_gamsxShowError; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxshowerror"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxShowError = (gamsxShowError_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxShowError_t)); } else { symName = "cgamsxShowError"; goto symMissing; } } } { int[] s = { 0, 11, 3 }; if (xcheck("gamsxAddBreakPoint", 2, s, ref errBuf) == 0) { dll_gamsxAddBreakPoint = d_gamsxAddBreakPoint; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxaddbreakpoint"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxAddBreakPoint = (gamsxAddBreakPoint_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxAddBreakPoint_t)); } else { symName = "cgamsxAddBreakPoint"; goto symMissing; } } } { int[] s = { 0 }; if (xcheck("gamsxClearBreakPoints", 0, s, ref errBuf) == 0) { dll_gamsxClearBreakPoints = d_gamsxClearBreakPoints; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxclearbreakpoints"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxClearBreakPoints = (gamsxClearBreakPoints_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxClearBreakPoints_t)); } else { symName = "gamsxClearBreakPoints"; goto symMissing; } } } { int[] s = { 3, 21, 21 }; if (xcheck("gamsxSystemInfo", 2, s, ref errBuf) == 0) { dll_gamsxSystemInfo = d_gamsxSystemInfo; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxsysteminfo"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxSystemInfo = (gamsxSystemInfo_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSystemInfo_t)); } else { symName = "gamsxSystemInfo"; goto symMissing; } } } { int[] s = { 3, 3, 12, 12, 21, 21, 21, 21 }; if (xcheck("gamsxSymbolInfo", 7, s, ref errBuf) == 0) { dll_gamsxSymbolInfo = d_gamsxSymbolInfo; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxsymbolinfo"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxSymbolInfo = (gamsxSymbolInfo_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSymbolInfo_t)); } else { symName = "cgamsxSymbolInfo"; goto symMissing; } } } { int[] s = { 12, 3 }; if (xcheck("gamsxUelName", 1, s, ref errBuf) == 0) { dll_gamsxUelName = d_gamsxUelName; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxuelname"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxUelName = (gamsxUelName_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxUelName_t)); } else { symName = "cgamsxUelName"; goto symMissing; } } } { int[] s = { 3, 11 }; if (xcheck("gamsxFindSymbol", 1, s, ref errBuf) == 0) { dll_gamsxFindSymbol = d_gamsxFindSymbol; } else { pAddressOfFunctionToCall = GetProcAddress(h, "cgamsxfindsymbol"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxFindSymbol = (gamsxFindSymbol_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxFindSymbol_t)); } else { symName = "cgamsxFindSymbol"; goto symMissing; } } } { int[] s = { 3, 3, 21 }; if (xcheck("gamsxDataReadRawStart", 2, s, ref errBuf) == 0) { dll_gamsxDataReadRawStart = d_gamsxDataReadRawStart; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareadrawstart"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataReadRawStart = (gamsxDataReadRawStart_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadRawStart_t)); } else { symName = "gamsxDataReadRawStart"; goto symMissing; } } } { int[] s = { 3, 52, 54, 21 }; if (xcheck("gamsxDataReadRaw", 3, s, ref errBuf) == 0) { dll_gamsxDataReadRaw = d_gamsxDataReadRaw; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareadraw"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataReadRaw = (gamsxDataReadRaw_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadRaw_t)); } else { symName = "gamsxDataReadRaw"; goto symMissing; } } } { int[] s = { 3 }; if (xcheck("gamsxDataReadDone", 0, s, ref errBuf) == 0) { dll_gamsxDataReadDone = d_gamsxDataReadDone; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatareaddone"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataReadDone = (gamsxDataReadDone_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataReadDone_t)); } else { symName = "gamsxDataReadDone"; goto symMissing; } } } { int[] s = { 3, 3, 15 }; if (xcheck("gamsxDataWriteRawStart", 2, s, ref errBuf) == 0) { dll_gamsxDataWriteRawStart = d_gamsxDataWriteRawStart; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawriterawstart"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataWriteRawStart = (gamsxDataWriteRawStart_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteRawStart_t)); } else { symName = "gamsxDataWriteRawStart"; goto symMissing; } } } { int[] s = { 3, 51, 53 }; if (xcheck("gamsxDataWriteRaw", 2, s, ref errBuf) == 0) { dll_gamsxDataWriteRaw = d_gamsxDataWriteRaw; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawriteraw"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataWriteRaw = (gamsxDataWriteRaw_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteRaw_t)); } else { symName = "gamsxDataWriteRaw"; goto symMissing; } } } { int[] s = { 3 }; if (xcheck("gamsxDataWriteDone", 0, s, ref errBuf) == 0) { dll_gamsxDataWriteDone = d_gamsxDataWriteDone; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxdatawritedone"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxDataWriteDone = (gamsxDataWriteDone_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxDataWriteDone_t)); } else { symName = "gamsxDataWriteDone"; goto symMissing; } } } { int[] s = { 0, 59, 1 }; if (xcheck("gamsxRegisterCB1", 2, s, ref errBuf) == 0) { dll_gamsxRegisterCB1 = d_gamsxRegisterCB1; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxregistercb1"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxRegisterCB1 = (gamsxRegisterCB1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRegisterCB1_t)); } else { symName = "gamsxRegisterCB1"; goto symMissing; } } } { int[] s = { 0, 59, 1, 1 }; if (xcheck("gamsxRegisterCB2", 3, s, ref errBuf) == 0) { dll_gamsxRegisterCB2 = d_gamsxRegisterCB2; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxregistercb2"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxRegisterCB2 = (gamsxRegisterCB2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRegisterCB2_t)); } else { symName = "gamsxRegisterCB2"; goto symMissing; } } } { int[] s = { 59 }; if (xcheck("gamsxGetCB1", 0, s, ref errBuf) == 0) { dll_gamsxGetCB1 = d_gamsxGetCB1; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb1"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxGetCB1 = (gamsxGetCB1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB1_t)); } else { symName = "gamsxGetCB1"; goto symMissing; } } } { int[] s = { 59 }; if (xcheck("gamsxGetCB2", 0, s, ref errBuf) == 0) { dll_gamsxGetCB2 = d_gamsxGetCB2; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxGetCB2 = (gamsxGetCB2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2_t)); } else { symName = "gamsxGetCB2"; goto symMissing; } } } { int[] s = { 1 }; if (xcheck("gamsxGetCB1UM", 0, s, ref errBuf) == 0) { dll_gamsxGetCB1UM = d_gamsxGetCB1UM; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb1um"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxGetCB1UM = (gamsxGetCB1UM_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB1UM_t)); } else { symName = "gamsxGetCB1UM"; goto symMissing; } } } { int[] s = { 1 }; if (xcheck("gamsxGetCB2UM1", 0, s, ref errBuf) == 0) { dll_gamsxGetCB2UM1 = d_gamsxGetCB2UM1; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2um1"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxGetCB2UM1 = (gamsxGetCB2UM1_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2UM1_t)); } else { symName = "gamsxGetCB2UM1"; goto symMissing; } } } { int[] s = { 1 }; if (xcheck("gamsxGetCB2UM2", 0, s, ref errBuf) == 0) { dll_gamsxGetCB2UM2 = d_gamsxGetCB2UM2; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxgetcb2um2"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxGetCB2UM2 = (gamsxGetCB2UM2_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxGetCB2UM2_t)); } else { symName = "gamsxGetCB2UM2"; goto symMissing; } } } { int[] s = { 0, 3 }; if (xcheck("gamsxSWSet", 1, s, ref errBuf) == 0) { dll_gamsxSWSet = d_gamsxSWSet; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxswset"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxSWSet = (gamsxSWSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxSWSet_t)); } else { symName = "gamsxSWSet"; goto symMissing; } } } { int[] s = { 15 }; if (xcheck("gamsxStepThrough", 0, s, ref errBuf) == 0) { dll_gamsxStepThrough = d_gamsxStepThrough; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxstepthrough"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxStepThrough = (gamsxStepThrough_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxStepThrough_t)); } else { symName = "gamsxStepThrough"; goto symMissing; } } } { int[] s = { 0, 15 }; if (xcheck("gamsxStepThroughSet", 1, s, ref errBuf) == 0) { dll_gamsxStepThroughSet = d_gamsxStepThroughSet; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxstepthroughset"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxStepThroughSet = (gamsxStepThroughSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxStepThroughSet_t)); } else { symName = "gamsxStepThroughSet"; goto symMissing; } } } { int[] s = { 15 }; if (xcheck("gamsxRunToEnd", 0, s, ref errBuf) == 0) { dll_gamsxRunToEnd = d_gamsxRunToEnd; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxruntoend"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxRunToEnd = (gamsxRunToEnd_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunToEnd_t)); } else { symName = "gamsxRunToEnd"; goto symMissing; } } } { int[] s = { 0, 15 }; if (xcheck("gamsxRunToEndSet", 1, s, ref errBuf) == 0) { dll_gamsxRunToEndSet = d_gamsxRunToEndSet; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxruntoendset"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxRunToEndSet = (gamsxRunToEndSet_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxRunToEndSet_t)); } else { symName = "gamsxRunToEndSet"; goto symMissing; } } } { int[] s = { 15 }; if (xcheck("gamsxCB1Defined", 0, s, ref errBuf) == 0) { dll_gamsxCB1Defined = d_gamsxCB1Defined; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxcb1defined"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxCB1Defined = (gamsxCB1Defined_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxCB1Defined_t)); } else { symName = "gamsxCB1Defined"; goto symMissing; } } } { int[] s = { 15 }; if (xcheck("gamsxCB2Defined", 0, s, ref errBuf) == 0) { dll_gamsxCB2Defined = d_gamsxCB2Defined; } else { pAddressOfFunctionToCall = GetProcAddress(h, "gamsxcb2defined"); if (pAddressOfFunctionToCall != IntPtr.Zero) { dll_gamsxCB2Defined = (gamsxCB2Defined_t)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(gamsxCB2Defined_t)); } else { symName = "gamsxCB2Defined"; goto symMissing; } } } return(true); symMissing: errBuf = "Could not load symbol '" + symName + "'"; return(false); } /* XLibraryLoad */