Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28455 Discussions

Fortran Access of Registry or Hardware Info

Intel_C_Intel
Employee
1,357 Views
I'm writing a security module for a PC Fortran application - it must be Fortran - it must not be run on unauthorized PCs by unauthorized users.

How can I access PC registry information ?

How can I access PC hardware information ?

I'm hoping that there's an equivalent to DEC's SYS$GETDVIW. Is there ?

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,357 Views
The Win32 API routines are the equvalent of VMS system services. There are routines for registry manipulation and for returning info about the system. I've used many of these from Fortran.

Now, SYS$GETDVIW gets information about devices. Is that really what you want? What sort of security are you planning?

Steve
0 Kudos
tomballard
Beginner
1,357 Views
Use RegOpenKeyEx, RegCloseKey and RegQueryValueEx for query of registry entries. Use GetVolumeInformation for disk volume information. Use GetWindowsDirectory to get windows directory. To get the id of the network adapter, for node lock licensing, you will need to do a little bit more work. I had to use a C++ routine to get this information.

Good Luck...
0 Kudos
james1
Beginner
1,357 Views
The answer to your question is, as it typical any time you talk about security, highly dependent by what level of security you expect and the target platforms. For example, it matters if you are targeting Win9X systems or not.

If you are porting VMS system services, you can ask about rought equivalents. In the case of SYS$GETDVIW you don't really have a single equivalent but rather you would need to know what type of device is being queried before selecting an appropriate Win32 replacement.

James
0 Kudos
hbell
Beginner
1,357 Views
You can get all the information there is to obtain from the CPU using the CPUID instruction (see Intel Reference on the CPUID instruction) if you're willing to do some assembler. There are various signatures obtainable via this route but I'm not sure how unique they would be.

Harry Bell
0 Kudos
tomballard
Beginner
1,357 Views
Unfortunately, the ID of the cpu is not universally supplied by the chip manufacturer. I don't think this existed before P4 and I don't think Athlon has this feature (I may be wrong on this however). Almost all vendors are using the network card ID for license locks. This is refered to as "node lock". This is supposed to be a unique ID for every network adapter, so it is probably the best way to insure that the program is not running on a non-licensed machine.
0 Kudos
Steven_L_Intel1
Employee
1,357 Views
Don't confuse the processor serial number with the CPUID instruction. The CPUID instruction will return a wide variety of data about the processor, though decoding it takes quite a bit of effort and knowledge of each chip vendor's way of doing things.

The processor serial number is effectively not there, as it has to be explicitly enabled by the user in the BIOS.

Tying software to a specific hardware ID is not a good idea in general - it causes more problems for legitimate customers than it is worth. There are other licensing schemes that work better - Polyhedron has an inexpensive software licensing mechanism you might want to look into.

We (Intel/Compaq) use FLEXlm from Macrovision (formerly Globetrotter).

Steve
0 Kudos
Reply