From: <lab...@us...> - 2017-09-28 08:17:58
|
Revision: 1547 http://sourceforge.net/p/opengtoolkit/svn/1547 Author: labviewer Date: 2017-09-28 08:17:55 +0000 (Thu, 28 Sep 2017) Log Message: ----------- Updated entire package Modified Paths: -------------- trunk/lvpipe/build ogpipe 61.vi trunk/lvpipe/build_support/pipes.rev trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE - VI TREE__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Close Pipe__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Execute System Command__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Kill Process__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open Pipe__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Read From Pipe__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE RefNum__ogtk.ctl trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Write To Pipe__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipes.dll trunk/lvpipe/built/ogpipe.log trunk/lvpipe/c_source/pipes.c trunk/lvpipe/c_source/pipes.h trunk/lvpipe/c_source/pipes.rc trunk/lvpipe/change-log.txt trunk/lvpipe/ogpipe 61.spec trunk/lvpipe/ogpipe.ogbld trunk/lvpipe/source/ogpipe.llb/OGPIPE - VI TREE.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Close Pipe.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Execute System Command.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Kill Process.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Open Pipe.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE Read From Pipe.vi trunk/lvpipe/source/ogpipe.llb/OGPIPE RefNum.ctl trunk/lvpipe/source/ogpipe.llb/OGPIPE Write To Pipe.vi trunk/lvpipe/tests/PipeClient.vi trunk/lvpipe/tests/Simple Pipe Test.vi trunk/lvpipe/tests/System Command (cmd.exe) Test.vi trunk/lvpipe/tests/System Command Pipe Python Test.vi trunk/lvpipe/tests/System Command Pipe Test.vi Added Paths: ----------- trunk/lvpipe/PostInstall.vi trunk/lvpipe/PreUninstall.vi trunk/lvpipe/build ogpipe 70.vi trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi trunk/lvpipe/built/ogpipe/ogpipes64.dll trunk/lvpipe/ogpipe.ogpb trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi trunk/lvpipe/source/ogpipes.dll trunk/lvpipe/source/ogpipes64.dll trunk/lvpipe/source/readme.txt trunk/lvpipe/tests/Start Plink.vi Removed Paths: ------------- trunk/lvpipe/source/ogpipes.dll Added: trunk/lvpipe/PostInstall.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/PostInstall.vi =================================================================== --- trunk/lvpipe/PostInstall.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/PostInstall.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/PostInstall.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/lvpipe/PreUninstall.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/PreUninstall.vi =================================================================== --- trunk/lvpipe/PreUninstall.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/PreUninstall.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/PreUninstall.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/build ogpipe 61.vi =================================================================== (Binary files differ) Added: trunk/lvpipe/build ogpipe 70.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/build ogpipe 70.vi =================================================================== --- trunk/lvpipe/build ogpipe 70.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/build ogpipe 70.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/build ogpipe 70.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/build_support/pipes.rev =================================================================== --- trunk/lvpipe/build_support/pipes.rev 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/build_support/pipes.rev 2017-09-28 08:17:55 UTC (rev 1547) @@ -1,8 +1,8 @@ [ogpipe.ogbld] Version=0.0.0 -Build_Number=13 -Build_Date="02-Apr-10 8:20:31" +Build_Number=16 +Build_Date="28-9-2017 00:00:19" Status=OK Warnings=0 -Log_File=/C/Work/OpenG/opengtoolkit/pipe/built/ogpipe.log +Log_File="/P/Work/OpenG/Openg Toolkit/lvpipe/built/ogpipe.log" Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE - VI TREE__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Close Pipe__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Execute System Command__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Kill Process__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open Pipe__ogtk.vi =================================================================== (Binary files differ) Added: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi =================================================================== --- trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command As User__ogtk.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Open System Command__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Read From Pipe__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE RefNum__ogtk.ctl =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipe.llb/OGPIPE Write To Pipe__ogtk.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/built/ogpipe/ogpipes.dll =================================================================== (Binary files differ) Added: trunk/lvpipe/built/ogpipe/ogpipes64.dll =================================================================== (Binary files differ) Index: trunk/lvpipe/built/ogpipe/ogpipes64.dll =================================================================== --- trunk/lvpipe/built/ogpipe/ogpipes64.dll 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/built/ogpipe/ogpipes64.dll 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/built/ogpipe/ogpipes64.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/built/ogpipe.log =================================================================== --- trunk/lvpipe/built/ogpipe.log 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/built/ogpipe.log 2017-09-28 08:17:55 UTC (rev 1547) @@ -1,52 +1,54 @@ -*** 08:20:31.2 : Build started [02-Apr-10] File: ogpipe.ogbld +*** 00:00:19.7 : Build started [28-9-2017] File: ogpipe.ogbld ->>> 08:20:31.2 : DEAB Read Build File started +>>> 00:00:19.7 : DEAB Read Build File started ->>> 08:20:31.4 : Load Call-Back VI(s) started +>>> 00:00:19.9 : Load Call-Back VI(s) started ->>> 08:20:31.4 : DEAB Expand & Verify TL&D VI Paths started +>>> 00:00:20.1 : DEAB Expand & Verify TL&D VI Paths started ->>> 08:20:31.5 : Load VIs into Memory started +>>> 00:00:20.2 : Load VIs into Memory started -9 VIs have been loaded +11 VIs have been loaded ->>> 08:20:31.8 : Test VIs need be Unloaded started +>>> 00:00:20.3 : Test VIs need be Unloaded started ->>> 08:20:31.8 : Test for VI Unsaved Changes started +>>> 00:00:20.4 : Test for VI Unsaved Changes started ->>> 08:20:31.9 : Generate Resources Copy Info started +>>> 00:00:20.4 : Generate Resources Copy Info started ->>> 08:20:31.9 : Generate VI Building Info started +>>> 00:00:20.5 : Generate VI Building Info started ->>> 08:20:32.1 : Revise Ambiguous VIs Destination started +>>> 00:00:20.6 : Revise Ambiguous VIs Destination started ->>> 08:20:32.1 : Verify if Sources can be Removed started +>>> 00:00:20.7 : Verify if Sources can be Removed started ->>> 08:20:32.2 : Create Target Dirs and LLBs started +>>> 00:00:20.7 : Create Target Dirs and LLBs started ->>> 08:20:32.3 : Set VI Properties started +>>> 00:00:20.8 : Set VI Properties started ->>> 08:20:32.3 : Save VIs to Destination started +>>> 00:00:20.9 : Set Custom VI Properties started -9 VIs have been saved +>>> 00:00:20.9 : Save VIs to Destination started ->>> 08:20:33.4 : UnLoad Top-Level and Dynamic VIs started +10 VIs have been saved ->>> 08:20:33.5 : Copy Resource Files and Relink VIs started +>>> 00:00:21.2 : UnLoad Top-Level and Dynamic VIs started +>>> 00:00:21.3 : Copy Resource Files and Relink VIs started + 1 Resource files have been copied ->>> 08:20:34.2 : Set Top Level VIs in LLBs started +>>> 00:00:21.5 : Set Top Level VIs in LLBs started ->>> 08:20:34.3 : Convert LLBs to EXEs started +>>> 00:00:21.5 : Convert LLBs to EXEs started ->>> 08:20:34.3 : Copy Support Files started +>>> 00:00:21.6 : Copy Support Files started 2 Support files have been copied -*** 08:20:34.4 : Build finished +*** 00:00:21.7 : Build finished ######################### @@ -60,7 +62,7 @@ VIs not included to build ######################### -None +1 : C:\Program Files (x86)\National Instruments\LabVIEW 7.0\user.lib\_OpenG.lib\error\error.llb\Build Error Cluster__ogtk.vi ############################# Modified: trunk/lvpipe/c_source/pipes.c =================================================================== --- trunk/lvpipe/c_source/pipes.c 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/c_source/pipes.c 2017-09-28 08:17:55 UTC (rev 1547) @@ -1,9 +1,9 @@ /* * Pipe shared library for LabVIEW * - * Copyright (C) 2004 Rolf Kalbermatter, r.k...@hc... + * Copyright (C) 2004-2017 Rolf Kalbermatter, rol...@ka... * - * Please visit http://www.OpenG.org to learn about the + * Please visit https://lavag.org/forum/45-openg/ to learn about the * Open Source LabVIEW software movement. * * This library is free software; you can redistribute it and/or @@ -23,61 +23,12 @@ #include <stdio.h> #include <io.h> #include <fcntl.h> +#include <signal.h> #include "extcode.h" #include "hosttype.h" #include "pipes.h" -#if defined(_DEBUG) - #if Win32 - #if defined(_CVI_DEBUG_) - #define DoDebugger() - #elif _MSC_VER >= 1400 - #define DoDebugger() __debugbreak() - #else - #define DoDebugger() {__asm int 3} - #endif - #elif MacOS - #define DoDebugger() Debugger() - #else - #define DoDebugger() - #endif - #define DEBUGPRINTF(args) DbgPrintf args -#else - #define DoDebugger() - #define DEBUGPRINTF(args) -/* long DebugPrintf(char* fmt, ...); - long DebugPrintf(char* fmt, ...) - { - return 0; - } -*/ -#endif -#if defined(PIPES_EXPORTS) -#define LibAPI __declspec(dllexport) __cdecl -#else -#define LibAPI __declspec(dllimport) __cdecl -#endif - -typedef enum -{ - kNone, - kReadMode, - kWriteMode, - kReadWriteMode -} Modes; - -MgErr LibAPI PipeOpen(CStr name, uInt16 mode, LVRefNum *refnum); -MgErr LibAPI PipeOpenCmd(CStr name, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, - LVRefNum *refnumErr, uInt32 *processID); -MgErr LibAPI PipeOpenCmdAsUser(CStr username, CStr password, CStr cmd, uInt16 mode, - LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID); -MgErr LibAPI PipeClose(LVRefNum *refnum); -MgErr LibAPI PipeRead(LVRefNum *refnum, uInt32 offset, uInt32 *bytesRead, LStrHandle data, uInt32 *eof); -MgErr LibAPI PipeWrite(LVRefNum *refnum, uInt32 offset, uInt32 *bytesWritten, LStrHandle data); - -MgErr LibAPI KillProcess(uInt32 pid, int32 exitCode); - #if defined(MSWin) #define STANDARD_IN STD_INPUT_HANDLE #define STANDARD_OUT STD_OUTPUT_HANDLE @@ -107,7 +58,7 @@ static MgErr closeRefnum(LVRefNum refnum); -MgErr LibAPI PipeOpen(CStr name, uInt16 mode, LVRefNum *refnum) +LibAPI(MgErr) PipeOpen(CStr name, uInt16 mode, LVRefNum *refnum) { MgErr err = noErr; #if defined(MSWin) @@ -219,12 +170,12 @@ } -MgErr LibAPI PipeOpenCmd(CStr cmd, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID) +LibAPI(MgErr) PipeOpenCmd(CStr cmd, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID) { return PipeOpenCmdAsUser(NULL, NULL, cmd, mode, refnumIn, refnumOut, refnumErr, processID); } -MgErr LibAPI PipeOpenCmdAsUser(CStr username, CStr password, CStr cmd, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID) +LibAPI(MgErr) PipeOpenCmdAsUser(CStr username, CStr password, CStr cmd, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID) { MgErr err = dvOpenErr; #if defined(MSWin) @@ -293,10 +244,25 @@ return err; } -MgErr LibAPI KillProcess(uInt32 pid, int32 exitCode) +LibAPI(MgErr) ExecuteCommand(CStr command, CStr verb, CStr param, uInt32 *processID) { MgErr err = noErr; #if defined(MSWin) + err = (int32)ShellExecuteA(NULL, verb, command, param[0] ? param : NULL, NULL, SW_HIDE); + if (err <= 32) + err = Win32ToLVErr(err); + else + err = noErr; +#elif Unix + err = mgNotSupported; +#endif + return err; +} + +LibAPI(MgErr) KillProcess(uInt32 pid, int32 exitCode) +{ + MgErr err = noErr; +#if defined(MSWin) HANDLE handle; HANDLE hToken; LUID sedebugnameValue; @@ -337,7 +303,7 @@ return err; } -MgErr LibAPI PipeClose(LVRefNum *refnum) +LibAPI(MgErr) PipeClose(LVRefNum *refnum) { pipe_handle fd; MgErr err = accessRefnum(*refnum, &fd); @@ -349,7 +315,7 @@ return err; } -MgErr LibAPI PipeRead(LVRefNum *refnum, uInt32 offset, uInt32 *bytesRead, LStrHandle data, uInt32 *eof) +LibAPI(MgErr) PipeRead(LVRefNum *refnum, uInt32 offset, uInt32 *bytesRead, uInt16 mode, LStrHandle data, uInt32 *eof, LVRefNum *context) { pipe_handle fd; MgErr err = accessRefnum(*refnum, &fd); @@ -426,7 +392,7 @@ return err; } -MgErr LibAPI PipeWrite(LVRefNum *refnum, uInt32 offset, uInt32 *bytesWritten, LStrHandle data) +LibAPI(MgErr) PipeWrite(LVRefNum *refnum, uInt32 offset, uInt32 *bytesWritten, LStrHandle data) { pipe_handle fd; MgErr err = accessRefnum(*refnum, &fd); @@ -456,44 +422,110 @@ static const WORD MAX_CONSOLE_LINES = 500; -MgErr LibAPI InitializeStandardIO(std_handle *stdIn, std_handle *stdOut, std_handle *stdErr) +LibAPI(MgErr) InitializeStandardIO(uInt32 processID, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr) { MgErr err = noErr; #if defined(MSWin) + BOOL retVal; int hConHandle; - HANDLE lStdHandle; + HANDLE stdHandle; CONSOLE_SCREEN_BUFFER_INFO coninfo; FILE *fp; - // allocate a console for this app - AllocConsole(); + if (processID) + { + retVal = AttachConsole(processID); + if (!retVal) + { + // if we called AttachConsole() and there was an ERROR_ACCESS_DENIED error, we already had + // a console and can continue with that + err = Win32ToLVErr(GetLastError()); + if (err && err != fNoPerm) + return err; + } + } + else + { + // allocate a console for this app, if we already created one then the function will return with an error + retVal = AllocConsole(); + if (!retVal) + { + err = Win32ToLVErr(GetLastError()); + } + } + stdHandle = GetStdHandle(STD_OUTPUT_HANDLE); + if (stdHandle == INVALID_HANDLE_VALUE || stdHandle == NULL) + { + // handle could not be retrieved or console doesn't have a standard output handle + if (!err) + FreeConsole(); + return fIOErr; + } + // set the screen buffer to be big enough to let us scroll text - GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo); + GetConsoleScreenBufferInfo(stdHandle, &coninfo); coninfo.dwSize.Y = MAX_CONSOLE_LINES; - SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize); + SetConsoleScreenBufferSize(stdHandle, coninfo.dwSize); - // redirect unbuffered STDOUT to the console - lStdHandle = GetStdHandle(STD_OUTPUT_HANDLE); - hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stdout = *fp; - setvbuf( stdout, NULL, _IONBF, 0 ); + if (refnumOut) + { + *refnumOut = kNotAMagicCookie; - // redirect unbuffered STDIN to the console - lStdHandle = GetStdHandle(STD_INPUT_HANDLE); - hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "r" ); - *stdin = *fp; - setvbuf( stdin, NULL, _IONBF, 0 ); + // redirect unbuffered STDOUT to the console + hConHandle = _open_osfhandle((intptr_t)stdHandle, _O_TEXT); + if (hConHandle != -1) + { + fp = _fdopen(hConHandle, "w"); + if (fp != 0) + { + setvbuf(fp, NULL, _IONBF, 0); + } + } + err = createRefnum(stdHandle, refnumOut); + } - // redirect unbuffered STDERR to the console - lStdHandle = GetStdHandle(STD_ERROR_HANDLE); - hConHandle = _open_osfhandle((intptr_t)lStdHandle, _O_TEXT); - fp = _fdopen( hConHandle, "w" ); - *stderr = *fp; - setvbuf( stderr, NULL, _IONBF, 0 ); + if (refnumIn) + { + *refnumIn = kNotAMagicCookie; + + // redirect unbuffered STDIN to the console + stdHandle = GetStdHandle(STD_INPUT_HANDLE); + if (stdHandle != INVALID_HANDLE_VALUE && stdHandle != NULL) + { + hConHandle = _open_osfhandle((intptr_t)stdHandle, _O_TEXT); + if (hConHandle != -1) + { + fp = _fdopen(hConHandle, "r"); + if (fp != 0) + { + setvbuf(fp, NULL, _IONBF, 0); + } + } + err = createRefnum(stdHandle, refnumIn); + } + } + if (refnumErr) + { + *refnumErr = kNotAMagicCookie; + + // redirect unbuffered STDERR to the console + stdHandle = GetStdHandle(STD_ERROR_HANDLE); + if (stdHandle != INVALID_HANDLE_VALUE && stdHandle != NULL) + { + hConHandle = _open_osfhandle((intptr_t)stdHandle, _O_TEXT); + if (hConHandle != -1) + { + fp = _fdopen(hConHandle, "w"); + if (fp != 0) + { + setvbuf(stderr, NULL, _IONBF, 0); + } + } + err = createRefnum(stdHandle, refnumErr); + } + } // make cout, wcout, cin, wcin, wcerr, cerr, wclog and clog // point to console as well // ios::sync_with_stdio(); @@ -744,7 +776,7 @@ /* We can't really support execution under a different user easily */ if (username || *username || password || *password) - return mgArgErr; + return mgNotSupported; /* parse command line into arguments */ while (*cmdline != '\0' && i < 64) @@ -838,55 +870,61 @@ }; static struct errentry errtable[] = { - {ERROR_INVALID_FUNCTION, mgArgErr }, /* 1 */ - {ERROR_FILE_NOT_FOUND, fNotFound }, /* 2 */ - {ERROR_PATH_NOT_FOUND, fNotFound }, /* 3 */ - {ERROR_TOO_MANY_OPEN_FILES, fTMFOpen }, /* 4 */ - {ERROR_ACCESS_DENIED, fNoPerm }, /* 5 */ - {ERROR_INVALID_HANDLE, mgArgErr }, /* 6 */ - {ERROR_ARENA_TRASHED, mFullErr }, /* 7 */ - {ERROR_NOT_ENOUGH_MEMORY, mFullErr }, /* 8 */ - {ERROR_INVALID_BLOCK, mFullErr }, /* 9 */ - {ERROR_BAD_ENVIRONMENT, fNotEnabled }, /* 10 */ - {ERROR_BAD_FORMAT, fNotEnabled }, /* 11 */ - {ERROR_INVALID_ACCESS, mgArgErr }, /* 12 */ - {ERROR_INVALID_DATA, mgArgErr }, /* 13 */ - {ERROR_INVALID_DRIVE, fNotFound }, /* 15 */ - {ERROR_CURRENT_DIRECTORY, fNoPerm }, /* 16 */ - {ERROR_NOT_SAME_DEVICE, fIOErr }, /* 17 */ - {ERROR_NO_MORE_FILES, fNotFound }, /* 18 */ - {ERROR_LOCK_VIOLATION, fNoPerm }, /* 33 */ - {ERROR_BAD_NETPATH, fNotFound }, /* 53 */ - {ERROR_NETWORK_ACCESS_DENIED, fNoPerm }, /* 65 */ - {ERROR_BAD_NET_NAME, fNotFound }, /* 67 */ - {ERROR_FILE_EXISTS, fDupPath }, /* 80 */ - {ERROR_CANNOT_MAKE, fNoPerm }, /* 82 */ - {ERROR_FAIL_I24, fNoPerm }, /* 83 */ - {ERROR_INVALID_PARAMETER, mgArgErr }, /* 87 */ - {ERROR_NO_PROC_SLOTS, mFullErr }, /* 89 */ - {ERROR_DRIVE_LOCKED, fNoPerm }, /* 108 */ - {ERROR_BROKEN_PIPE, fIOErr }, /* 109 */ - {ERROR_DISK_FULL, fDiskFull }, /* 112 */ - {ERROR_INVALID_TARGET_HANDLE, mgArgErr }, /* 114 */ - {ERROR_INVALID_HANDLE, mgArgErr }, /* 124 */ - {ERROR_WAIT_NO_CHILDREN, fNotEnabled }, /* 128 */ - {ERROR_CHILD_NOT_COMPLETE, fNotEnabled }, /* 129 */ - {ERROR_DIRECT_ACCESS_HANDLE, mgArgErr }, /* 130 */ - {ERROR_NEGATIVE_SEEK, mgArgErr }, /* 131 */ - {ERROR_SEEK_ON_DEVICE, fNoPerm }, /* 132 */ - {ERROR_DIR_NOT_EMPTY, fNoPerm }, /* 145 */ - {ERROR_NOT_LOCKED, fNoPerm }, /* 158 */ - {ERROR_BAD_PATHNAME, fNotFound }, /* 161 */ - {ERROR_MAX_THRDS_REACHED, mFullErr }, /* 164 */ - {ERROR_LOCK_FAILED, fNoPerm }, /* 167 */ - {ERROR_ALREADY_EXISTS, fDupPath }, /* 183 */ - {ERROR_FILENAME_EXCED_RANGE, fNotFound }, /* 206 */ - {ERROR_NESTING_NOT_ALLOWED, mFullErr }, /* 215 */ - {ERROR_PIPE_BUSY, ncBusyErr }, /* 231 */ - {ERROR_NO_DATA, fEOF }, /* 232 */ - {ERROR_PIPE_NOT_CONNECTED, ncNotConnectedErr }, /* 233 */ - {ERROR_MORE_DATA, ncInProgress }, /* 234 */ - {ERROR_NOT_ENOUGH_QUOTA, mFullErr } /* 1816 */ + {ERROR_INVALID_FUNCTION, mgArgErr }, /* 1 */ + {ERROR_FILE_NOT_FOUND, fNotFound }, /* 2 */ + {ERROR_PATH_NOT_FOUND, fNotFound }, /* 3 */ + {ERROR_TOO_MANY_OPEN_FILES, fTMFOpen }, /* 4 */ + {ERROR_ACCESS_DENIED, fNoPerm }, /* 5 */ + {ERROR_INVALID_HANDLE, mgArgErr }, /* 6 */ + {ERROR_ARENA_TRASHED, mFullErr }, /* 7 */ + {ERROR_NOT_ENOUGH_MEMORY, mFullErr }, /* 8 */ + {ERROR_INVALID_BLOCK, mFullErr }, /* 9 */ + {ERROR_BAD_ENVIRONMENT, fNotEnabled }, /* 10 */ + {ERROR_BAD_FORMAT, fNotEnabled }, /* 11 */ + {ERROR_INVALID_ACCESS, mgArgErr }, /* 12 */ + {ERROR_INVALID_DATA, mgArgErr }, /* 13 */ + {ERROR_INVALID_DRIVE, fNotFound }, /* 15 */ + {ERROR_CURRENT_DIRECTORY, fNoPerm }, /* 16 */ + {ERROR_NOT_SAME_DEVICE, fIOErr }, /* 17 */ + {ERROR_NO_MORE_FILES, fNotFound }, /* 18 */ + {SE_ERR_SHARE, fNoPerm }, /* 26 */ + {SE_ERR_ASSOCINCOMPLETE, fNotFound }, /* 27 */ + {SE_ERR_DDETIMEOUT, fIOErr }, /* 28 */ + {SE_ERR_DDEFAIL, fIOErr }, /* 29 */ + {SE_ERR_DDEBUSY, fIOErr }, /* 30 */ + {SE_ERR_NOASSOC, fNotFound }, /* 31 */ + {SE_ERR_DLLNOTFOUND, fNotFound }, /* 32 */ + {ERROR_LOCK_VIOLATION, fNoPerm }, /* 33 */ + {ERROR_BAD_NETPATH, fNotFound }, /* 53 */ + {ERROR_NETWORK_ACCESS_DENIED, fNoPerm }, /* 65 */ + {ERROR_BAD_NET_NAME, fNotFound }, /* 67 */ + {ERROR_FILE_EXISTS, fDupPath }, /* 80 */ + {ERROR_CANNOT_MAKE, fNoPerm }, /* 82 */ + {ERROR_FAIL_I24, fNoPerm }, /* 83 */ + {ERROR_INVALID_PARAMETER, mgArgErr }, /* 87 */ + {ERROR_NO_PROC_SLOTS, mFullErr }, /* 89 */ + {ERROR_DRIVE_LOCKED, fNoPerm }, /* 108 */ + {ERROR_BROKEN_PIPE, fIOErr }, /* 109 */ + {ERROR_DISK_FULL, fDiskFull }, /* 112 */ + {ERROR_INVALID_TARGET_HANDLE, mgArgErr }, /* 114 */ + {ERROR_WAIT_NO_CHILDREN, fNotEnabled }, /* 128 */ + {ERROR_CHILD_NOT_COMPLETE, fNotEnabled }, /* 129 */ + {ERROR_DIRECT_ACCESS_HANDLE, mgArgErr }, /* 130 */ + {ERROR_NEGATIVE_SEEK, mgArgErr }, /* 131 */ + {ERROR_SEEK_ON_DEVICE, fNoPerm }, /* 132 */ + {ERROR_DIR_NOT_EMPTY, fNoPerm }, /* 145 */ + {ERROR_NOT_LOCKED, fNoPerm }, /* 158 */ + {ERROR_BAD_PATHNAME, fNotFound }, /* 161 */ + {ERROR_MAX_THRDS_REACHED, mFullErr }, /* 164 */ + {ERROR_LOCK_FAILED, fNoPerm }, /* 167 */ + {ERROR_ALREADY_EXISTS, fDupPath }, /* 183 */ + {ERROR_FILENAME_EXCED_RANGE, fNotFound }, /* 206 */ + {ERROR_NESTING_NOT_ALLOWED, mFullErr }, /* 215 */ + {ERROR_PIPE_BUSY, ncBusyErr }, /* 231 */ + {ERROR_NO_DATA, fEOF }, /* 232 */ + {ERROR_PIPE_NOT_CONNECTED, ncNotConnectedErr }, /* 233 */ + {ERROR_MORE_DATA, ncInProgress }, /* 234 */ + {ERROR_NOT_ENOUGH_QUOTA, mFullErr } /* 1816 */ }; /* The following two constants must be the minimum and maximum Modified: trunk/lvpipe/c_source/pipes.h =================================================================== --- trunk/lvpipe/c_source/pipes.h 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/c_source/pipes.h 2017-09-28 08:17:55 UTC (rev 1547) @@ -35,3 +35,55 @@ typedef int32 (*CleanupProcPtr)(UPtr); int32 RTSetCleanupProc(CleanupProcPtr, UPtr, int32); +#if defined(_DEBUG) + #if Win32 + #if defined(_CVI_DEBUG_) + #define DoDebugger() + #elif _MSC_VER >= 1400 + #define DoDebugger() __debugbreak() + #else + #define DoDebugger() {__asm int 3} + #endif + #elif MacOS + #define DoDebugger() Debugger() + #else + #define DoDebugger() + #endif + #define DEBUGPRINTF(args) DbgPrintf args +#else + #define DoDebugger() + #define DEBUGPRINTF(args) +/* long DebugPrintf(char* fmt, ...); + long DebugPrintf(char* fmt, ...) + { + return 0; + } +*/ +#endif + +#if defined(PIPES_EXPORTS) +#define LibAPI(type) __declspec(dllexport) type __cdecl +#else +#define LibAPI(type) __declspec(dllimport) type __cdecl +#endif + +typedef enum +{ + kNone, + kReadMode, + kWriteMode, + kReadWriteMode +} Modes; + +LibAPI(MgErr) PipeOpen(CStr name, uInt16 mode, LVRefNum *refnum); +LibAPI(MgErr) PipeOpenCmd(CStr command, uInt16 mode, LVRefNum *refnumIn, LVRefNum *refnumOut, + LVRefNum *refnumErr, uInt32 *processID); +LibAPI(MgErr) PipeOpenCmdAsUser(CStr username, CStr password, CStr command, uInt16 mode, + LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr, uInt32 *processID); +LibAPI(MgErr) PipeClose(LVRefNum *refnum); +LibAPI(MgErr) PipeRead(LVRefNum *refnum, uInt32 offset, uInt32 *bytesRead, uInt16 mode, LStrHandle data, uInt32 *eof, LVRefNum *context); +LibAPI(MgErr) PipeWrite(LVRefNum *refnum, uInt32 offset, uInt32 *bytesWritten, LStrHandle data); +LibAPI(MgErr) InitializeStandardIO(uInt32 processID, LVRefNum *refnumIn, LVRefNum *refnumOut, LVRefNum *refnumErr); + +LibAPI(MgErr) ExecuteCommand(CStr command, CStr verb, CStr param, uInt32 *processID); +LibAPI(MgErr) KillProcess(uInt32 pid, int32 exitCode); Modified: trunk/lvpipe/c_source/pipes.rc =================================================================== --- trunk/lvpipe/c_source/pipes.rc 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/c_source/pipes.rc 2017-09-28 08:17:55 UTC (rev 1547) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1,2,0,11 - PRODUCTVERSION 1,2,0,11 + FILEVERSION 1,2,0,13 + PRODUCTVERSION 1,2,0,13 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,12 +17,12 @@ BEGIN VALUE "FileDescription", "OpenG Pipe support library\0" - VALUE "FileVersion", "1.2.0.11\0" + VALUE "FileVersion", "1.2.0.13\0" VALUE "InternalName", "ogpipes\0" VALUE "OriginalFilename", "ogpipes.dll\0" VALUE "ProductName", "ogpipes.dll\0" VALUE "Comments","LabVIEW support library to implement pipe operations\0" - VALUE "LegalCopyright", "(C) 2004-2016 Rolf Kalbermatter\0" + VALUE "LegalCopyright", "(C) 2004-2017 Rolf Kalbermatter\0" END END BLOCK "VarFileInfo" Modified: trunk/lvpipe/change-log.txt =================================================================== --- trunk/lvpipe/change-log.txt 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/change-log.txt 2017-09-28 08:17:55 UTC (rev 1547) @@ -1,6 +1,11 @@ +-= oglib_pipe-1.2.0-1.ogp =- + +[NEW] Added Open System Command As User.vi +[MOD] Change the implementation of the refnum in the DLL so it also works for 64 bit + -= oglib_pipe-1.0-1.ogp =- -[NEW] Added kill process function +[NEW] Added Kill Process,vi function [MOD] changed Create Commmand process to allow for no pipes to open to create only a process that can be killed later through its ID. Modified: trunk/lvpipe/ogpipe 61.spec =================================================================== --- trunk/lvpipe/ogpipe 61.spec 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/ogpipe 61.spec 2017-09-28 08:17:55 UTC (rev 1547) @@ -20,7 +20,7 @@ AutoReqProv=FALSE [Platform] -Exclusive_LabVIEW_Version= >=6.1 +Exclusive_LabVIEW_Version= >=7.0 Exclusive_LabVIEW_System=All Exclusive_OS=All @@ -49,8 +49,9 @@ Target Dir=<user.lib>/_OpenG.lib/ogpipe Exclusive_OS=Windows NT, Windows 9x Replace Mode=Always -Num Files=1 +Num Files=2 File 0=ogpipes.dll +File 0=ogpipes64.dll [File Group 2] Source Dir=built/ogpipe @@ -59,6 +60,7 @@ Replace Mode=Always Num Files=1 File 0=ogpipes.so +File 0=ogpipes64.so [File Group 1] Source Dir="Dynamic Palette MNUs" Modified: trunk/lvpipe/ogpipe.ogbld =================================================================== --- trunk/lvpipe/ogpipe.ogbld 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/ogpipe.ogbld 2017-09-28 08:17:55 UTC (rev 1547) @@ -85,3 +85,4 @@ Recursive=FALSE Exclude=FALSE SourceFile 1=ogpipes.* +SourceFile 2=ogpipes64.* Added: trunk/lvpipe/ogpipe.ogpb =================================================================== --- trunk/lvpipe/ogpipe.ogpb (rev 0) +++ trunk/lvpipe/ogpipe.ogpb 2017-09-28 08:17:55 UTC (rev 1547) @@ -0,0 +1,114 @@ +[OGPB Header] +File Version=1.0.0 + +[Package Name] +Name=oglib_pipe +Version=1.1.0 +Release=1 +Display Name="OpenG Pipe Library" + +[Description] +Description="The pipe package contains several routines for supporting pipe communication.\0D\0AThis is typically used for interprocess communication. It also has a function start an external command line utility and redirect its standard IO to pipes to use them for communication with that utility from within LabVIEW." +Summary="OpenG Pipe Tools" +License="BSD (VIs), LGPL (Shared Library)" +Copyright="2004 - 2017 Rolf Kalbermatter" +Distribution="OpenG Toolkit" +Vendor=OpenG.org +URL=http://openg.org/ogpipe +Packager="Rolf Kalbermatter <rol...@ka...>" +Release Notes="Version 1.1: First official release." +Demo=FALSE +System Package=FALSE +Sub Package=FALSE +close labview before install=FALSE +restart labview after install=FALSE +skip mass compile after install=FALSE + +[Package Info] +Icon=ogpipe.bmp +License File="" + +[Platform] +Exclusive_LabVIEW_Version=>=7.0 +Exclusive_LabVIEW_System=All +Exclusive_OS=All + +[Script VIs] +Source Dir="" +PreInstall="" +PostInstall=PostInstall.vi +PreUninstall=PreUninstall.vi +PostUninstall="" +Verify="" +PreBuild="" +PostBuild="" + +[Dependencies] +AutoReqProv=FALSE +Requires=oglib_error>=2.0,oglib_file>=2.5 +Conflicts="" + +[Files] +Num File Groups=5 +Source Dir="" +Target Dir="" +Passwords.<size(s)>=0 +Documentation="" +NameMode=2 +PPFix=ogtk +Doc Groups="" + +[File Group 0] +Source Dir=source +DirMode=0 +NameMode=0 +PPFix="" +Target Dir=<OpenG.lib>/ogpipe +Replace Mode=Always +Num Files=1 +File 0=readme.txt + +[File Group 1] +Source Dir=built/ogpipe/ogpipe.llb +DirMode=0 +NameMode=0 +PPFix="" +Target Dir=<OpenG.lib>/ogpipe/ogpipe.llb +Replace Mode=Always +Num Files=2 +File 0=*.vi +File 1=*.ctl + +[File Group 2] +Source Dir=source +DirMode=0 +NameMode=0 +PPFix="" +Target Dir=<OpenG.lib>/ogpipe +Replace Mode=Always +Exclusive_OS="Windows NT,Windows 9x,Windows x64" +Num Files=1 +File 0=*.dll + +[File Group 3] +Source Dir=source +DirMode=0 +NameMode=0 +PPFix="" +Target Dir=<OpenG.lib>/ogpipe +Replace Mode=Always +Exclusive_OS="Linux,Linux x64" +Num Files=1 +File 0=*.so + +[File Group 4] +Source Dir=source +DirMode=0 +NameMode=0 +PPFix="" +Target Dir=<OpenG.lib>/ogpipe +Replace Mode=Always +Exclusive_OS="Mac OS>=10" +Num Files=1 +File 0=ogpipe.framework.zip + Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE - VI TREE.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Close Pipe.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Execute System Command.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Kill Process.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Open Pipe.vi =================================================================== (Binary files differ) Added: trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi =================================================================== --- trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command As User.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Open System Command.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Read From Pipe.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE RefNum.ctl =================================================================== (Binary files differ) Modified: trunk/lvpipe/source/ogpipe.llb/OGPIPE Write To Pipe.vi =================================================================== (Binary files differ) Deleted: trunk/lvpipe/source/ogpipes.dll =================================================================== (Binary files differ) Added: trunk/lvpipe/source/ogpipes.dll =================================================================== (Binary files differ) Index: trunk/lvpipe/source/ogpipes.dll =================================================================== --- trunk/lvpipe/source/ogpipes.dll 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/source/ogpipes.dll 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/source/ogpipes.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/lvpipe/source/ogpipes64.dll =================================================================== (Binary files differ) Index: trunk/lvpipe/source/ogpipes64.dll =================================================================== --- trunk/lvpipe/source/ogpipes64.dll 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/source/ogpipes64.dll 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/source/ogpipes64.dll ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Added: trunk/lvpipe/source/readme.txt =================================================================== --- trunk/lvpipe/source/readme.txt (rev 0) +++ trunk/lvpipe/source/readme.txt 2017-09-28 08:17:55 UTC (rev 1547) @@ -0,0 +1,16 @@ +LabVIEW Pipe library, version 1.1.0 +---------------------------------- + +Copyright 2002-2017 Rolf Kalbermatter + + + +Release 1.1.0, Released: Oct. 05, 2017 +====================================== +First official release for a library which allows to support pipes in a LabVIEW application. +Pipes are communication channels which are well known from Unix systems. Under Unix standard-IO +of command line tools can be redirected to pipes and then used from other programs to read from +and write to them. + +With this library this functionality is also available under Windows. In addition the library +also supports named pipes, which are sometimes used for interapplication communication. \ No newline at end of file Modified: trunk/lvpipe/tests/PipeClient.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/tests/Simple Pipe Test.vi =================================================================== (Binary files differ) Added: trunk/lvpipe/tests/Start Plink.vi =================================================================== (Binary files differ) Index: trunk/lvpipe/tests/Start Plink.vi =================================================================== --- trunk/lvpipe/tests/Start Plink.vi 2017-04-10 21:54:22 UTC (rev 1546) +++ trunk/lvpipe/tests/Start Plink.vi 2017-09-28 08:17:55 UTC (rev 1547) Property changes on: trunk/lvpipe/tests/Start Plink.vi ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/lvpipe/tests/System Command (cmd.exe) Test.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/tests/System Command Pipe Python Test.vi =================================================================== (Binary files differ) Modified: trunk/lvpipe/tests/System Command Pipe Test.vi =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |