🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3596

Re: Port sharing/splitting?

#3596
From: Mike Collins
Date: Fri, 19 May 2006 15:56
57 lines
3753 bytes
There are many ways to achieve this depending on how complex or robust you 
want to make it.  If you are writing a system that needs to be deployed on 
many different systems then your best options is to write some sort of 
filter driver.  However this is not a straightforward task and requires the 
MS DDK which is costly and complicated.

Another option is to use DLL-injection and API hooking.  If it is aimed at 
capturing one specific application then this shouldn't be a big deal.  You 
need to determine how the legacy application is communicating with the com 
port and then inject into it's process space and hook the api that it uses. 
Once this is done, you hook / callback procedure will be called before the 
API in question, and it will give you the facility to achieve the data and 
reject or relay the call on to the real api.

If you feel this is an option that you would like to pursue then post back 
with your e-mail address and i can contact you.  I can provide you with some 
information and some starting points, although i can't actually provide you 
with source code as my injection system is based on another's that i have 
licensing for.  As a starting point, look at www.codeproject.com and do a 
search for dll-injection and api hooking.

HTH, Mike C



"Jim Dodd" <bcbuilderboy@yahoo.com> wrote in message 
news:446dd227$1@newsgroups.borland.com...
> Zahir wrote:
>> Oops! sorry guys had problems with my internet link, i am back now...
>> I want to sort-of intercept the data going to the printer, archive it and 
>> let the printer also make a hard copy. i mean something like to be able 
>> to make my app read the port memory without interfearing with the 
>> application that sent this data.
>> Why i need this? to save alarms from an old automation system that does 
>> not have an OPC server. Assist please.
>
> There must be a way to do this but I don't know how. However, there is a
> utility at SysInternals called PortMon that will show activity and data
> on serial and parallel ports. I don't know how to get it to give you the
> data but perhaps you can get them to tell you how they did it.
>
> Link to the utility:
> http://www.sysinternals.com/Utilities/Portmon.html
>
> Description:
> Portmon is a utility that monitors and displays all serial and parallel
> port activity on a system. It has advanced filtering and search
> capabilities that make it a powerful tool for exploring the way Windows
> works, seeing how applications use ports, or tracking down problems in
> system or application configurations.
>
> Portmon works on NT 4.0, Win2K, XP and Server 2003, Windows 95 and
> Windows 98.
>
> Regards,
> Jim Dodd
> Onset Computer Corp. 
Technical Details
Message-ID: <446deab1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4464ade6$1@newsgroups.borland.com> <446b06f4$1@newsgroups.borland.com> <446dd227$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,377c765ac90d6829
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4464ade6$1@newsgroups.borland.com> <446b06f4$1@newsgroups.borland.com> <446dd227$1@newsgroups.borland.com>
Subject: Re: Port sharing/splitting?
Date: Fri, 19 May 2006 16:56:28 +0100
Lines: 59
Organization: SDA Ltd
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.2663
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2663
NNTP-Posting-Host: 81.2.92.14
Message-ID: <446deab1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1148054193 81.2.92.14 (19 May 2006 08:56:33 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail