Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Question about DLL

I am provided with a DLL which was compiled to run on Win31/NT/Win95 OSes. I need to use it for WinXP as the target OS now. i am getting unexpected return codes from functions, that I access in Java via JNA. JNA works as expected with examples.

So, my question is is a DLL for Win31/NT/Win95 usable on WinXP ?
If it can be, what could be the cause of the invalid return codes and no action in response to certain functions? The DLL is for controlling a printer via a serial port connection by issueing the commands from the DLL functions. Is WinXP disabling direct access via RS232?




  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    Is this a 16bit DLL? If it ran on Windows 3.11, it almost assuredly is. If this is the case, your program may have to be 16bit. I have never tried using 16bit DLLs with a 32bit executable. It may be possible, but if so you would need to type-cast access to that DLL as 16bit variable types.

  • ak08820ak08820 Member Posts: 2
    One of the items in PE Viewer output is as follows.

    PE Format:PE32

    Wonder if that means 32 bit.


    File Headers
    DOS EXE:true
    NT EXE:true
    Dos STUB size:64 bytes
    DOS Header
    e_magic:5a4dh (23,117)
    e_cblp:90h (144)
    e_cp:3h (3)
    e_crlc:0h (0)
    e_cparhdr:4h (4)
    e_minalloc:0h (0)
    e_maxalloc:ffffh (65,535)
    e_ss:0h (0)
    e_sp:b8h (184)
    e_csum:0h (0)
    e_ip:0h (0)
    e_cs:0h (0)
    e_lfarlc:40h (64)
    e_ovno:0h (0)
    e_res:0h (0)
    e_oemid:0h (0)
    e_oeminfo:0h (0)
    e_res2:0h (0)
    e_lfanew:80h (128)

    COFF File Header (Object & Image)
    Machine:Intel 386 or later, and compatible processors
    NumberOfSections:6h (6)
    TimeDateStamp:Thu May 25 08:04:20 EDT 2000
    PointerToSymbolTable:0h (0)
    NumberOfSymbols:0h (0)
    SizeOfOptionalHeader:e0h (224)

    Optional Header (Usually Image Only)
    PE Format:PE32
    Standard fields
    MajorLinkerVersion:5h (5)
    MinorLinkerVersion:0h (0)
    SizeOfCode:6a00h (27,136)
    SizeOfInitializedData:5e00h (24,064)
    SizeOfUninitializedData:0h (0)
    AddressOfEntryPoint:4c70h (19,568)
    BaseOfCode:1000h (4,096)
    BaseOfData:8000h (32,768)
    NT additional fields
    ImageBase:10000000h (268,435,456)
    SectionAlignment:1000h (4,096)
    FileAlignment:200h (512)
    MajorOperatingSystemVersion:4h (4)
    MinorOperatingSystemVersion:0h (0)
    MajorImageVersion:0h (0)
    MinorImageVersion:0h (0)
    MajorSubsystemVersion:4h (4)
    MinorSubsystemVersion:0h (0)
    SizeOfImage:10000h (65,536)
    SizeOfHeaders:400h (1,024)
    CheckSum:0h (0)
    Subsystem:Image runs in the Windows
  • SephirothSephiroth Fayetteville, NC, USAMember Posts: 1,035
    It may, but I don't know. If that is a 32bit DLL then I doubt it would run on 16bit Windows (Win3.11 and prior). You may need the help of a Windows guru here for this problem. I've personally never run into it with the same style architecture (ie: 32bit with 32bit or 64bit with 64bit).

Sign In or Register to comment.