Skip to main content

[archive] Detecting 64 bit (Windows) OS

  • April 21, 2010
  • 9 replies
  • 0 views

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC

9 replies

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
You can use this API function from the kernel32.dll:

01 ProcHandle PIC X(4) COMP-N.
01 BoolValue PIC X(4) COMP-N.
...
CALL "GetCurrentProcess" GIVING ProcHandle.
CALL "IsWow64Process" USING
  BY VALUE ProcHandle
  BY REFERENCE BoolValue.
IF BoolValue = 0
return 0 | Not 64
ELSE
return 1 | Is 64
END-IF

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Thanks!
Sal

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Thanks!
Sal

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Thanks!
Sal

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
This isn't entirely accurate, though is it? Doesn't this function check for the current process to see if it's running 64-bit? So, if you were running a 32-bit Acu runtime on a 64-bit server, wouldn't it return 0? Just making sure I understand.

I'm trying to determine if the system is 64-bit (regardless of the runtime process being 32 or 64). I thought I would need to get something like wProcessorArchitecture from SYSTEM_INFO. However, I'm at a bit of a loss as to how to do that in COBOL.

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
9.0 has addition fields for determining the version of Windows

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Rob, you are correct.

There are ways to determine whether your platform is 64bit. Don't have COBOL code readily for that though.

As Steve says, it comes around in 9.0. If you cannot wait, how about taking on the challenge of translating this example code ;-)

http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Rob, you are correct.

There are ways to determine whether your platform is 64bit. Don't have COBOL code readily for that though.

As Steve says, it comes around in 9.0. If you cannot wait, how about taking on the challenge of translating this example code ;-)

http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx

Dominique Sacre
Forum|alt.badge.img+2

[Migrated content. Thread originally posted on 20 April 2010]

Is there a foolproof way to detect within an AcuCOBOL program if it is being run on a 64 bit workstation? Our very mature software sometimes calls 16 bit applications such as PKZIP, and it would be nice know when those programs will fail before calling them.
Thanks,
Sal
UBCC
Rob, you are correct.

There are ways to determine whether your platform is 64bit. Don't have COBOL code readily for that though.

As Steve says, it comes around in 9.0. If you cannot wait, how about taking on the challenge of translating this example code ;-)

http://msdn.microsoft.com/en-us/library/ms724429(VS.85).aspx