Security and Privacy on the U3 Platform

Be Smart with U3

A bit of Background …

Anyone who has programmed in basic and used the INPUT and OUTPUT statements would expect them to run in the Visual Basic environment too, but fortunately or unfortunately it is not the case.
The Visual Basic language doesn’t support for direct hardware access and if the application (no matter what language is used to develop it) won’t be able to access hardware directly if it’s running on a secure system from the Windows NT family (i.e. NT, 2000, XP etc).
These functions are crucial for PC hardware developers and programmers because they allow you to read and write to ports in environments like DOS or Windows 95 and 98. Thus without INPUT or OUPUT you can’t read from or write to your device.
Fortunately the concept of dynamic link libraries or DLLs comes to rescue. DLLs allow VB to link to them (you can write a DLL in any language like Delphi, Borland C++ or Microsoft’s Visual C++) during run-time (dynamically).
VC++ has port I/O (input and output) read/write functions. Also VC++ compiler allows you to create DLLs apart from executable EXE files. Thus you can
  • Write VC++ code that uses these read/write functions
  • Compile it into a DLL (instead of an executable EXE file) file
  • Call your functions from VB
  • Make use of the facilities that a DLL provides; Like notifying you and providing you with a place to put your code that executes when a process loads it or unloads it.
  • Modify the DLL to make any desirable changes to the behavior of functions and you need not build the whole application again.

The list is very long and for more details on features of DLLs you can refer to DLLs, Processes, and Threads section in the MSDN library.

Now lets suppose that you’re a developer willing to develop an application that needs to communicate to a hardware port, say for acquisition card, or perhaps a motor controller or even a robotic arm that you’ve just created! And you’ve never written an application that does so. Futher you just have programmed in Visual Basic.

At this point the major challenges that you have are:

  • How do I access these ports?
  • What should I do so that my applications run on Windows NT family of operating systems, as they’d do on Windows 95 or 98?

I’m emphasizing on the difference between the two operating system families because they’ve a very different way to treat port I/O, as we’ll see shortly.

So now we know that what we intend to develop and more importantly why. So let’s get started!
Before you get started, you’ll probably want to download the support files/sample code from www.onsmartcards.com articles section.

-The Editor (editor@onsmartcards.com)
http://www.onsmartcards.com/

Advertisements

November 11, 2006 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: