TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Failure w/TwainDSM.dll on OPENDSM when ProductName is NULL

Forums › TWAIN Classic › Failure w/TwainDSM.dll on OPENDSM when ProductName is NULL

  • This topic has 1 reply, 2 voices, and was last updated 11 years, 4 months ago by retro.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 17, 2009 at 9:11 pm #22558 Reply
    Travis
    Participant
    • Topics - 3
    • Replies - 1
    • Total Posts - 4

    When loading Twain_32.dll, I was able to pass a TW_IDENTITY structure representing the application (pOrigin) with the bare minimum values. All TW_STR32 values were initialized to NULL. A call to DG_CONTROL, DAT_PARENT, MSG_OPENDSM would succeed.

    When loading TwainDSM.dll, passing the same initialized TW_IDENTITY structure representing the application (pOrigin) results in the twain function returning TWRC_FAILURE. If I simply put one character in the ProductName field, then the triplet succeeds.

    Is this a bug or by design?

    I’m using TWAINDSM.dll – 2.0.9.0

    TW_IDENTITY AppID;

    ZeroMemory(&AppID, sizeof(TW_IDENTITY));
    AppID.Version.MajorNum = 1;
    AppID.Version.MinorNum = 0;
    AppID.Version.Language = TWLG_ENGLISH_USA;
    AppID.Version.Country = TWCY_USA;
    AppID.ProtocolMajor = TWON_PROTOCOLMAJOR;
    AppID.ProtocolMinor = TWON_PROTOCOLMINOR;
    AppID.SupportedGroups = DG_IMAGE | DG_CONTROL;

    lstrcpy (AppID.Version.Info, _T("Version 1.0"));
    lstrcpy(AppID.Manufacturer, _T("Manufacturer"));
    lstrcpy(AppID.ProductFamily, _T("Product Family"));

    Works:

    lstrcpy(AppID.ProductName, "a");

    Doesn’t not work:

    lstrcpy(AppID.ProductName, ""); 
    December 14, 2009 at 10:30 am #25088 Reply
    retro
    Participant
    • Topics - 1
    • Replies - 3
    • Total Posts - 4

    Hi,

    i am not a designer of twain, but according to the spec, which says:

    The application must allocate a structure of type TW_IDENTITY and fill in all fields except
    for the Id field. Once the structure is prepared, this
    pOrigin parameter should point at that structure.

    I would asume that it is expected that the Product name is not NULL.

    I have seen this behavior myself and have corrected the TW_IDENTITY structure which is given to twain.

    Nice regards,
    Martin Haimberger

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Failure w/TwainDSM.dll on OPENDSM when ProductName is NULL
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • PDF/R For who and where?
  • Making searchable PDF with PDF/R
  • Backward compatibility with PDF/A and traditional PDF
  • could not open the twain source. Make sure there is a valid source for your sca
  • Changing TWAIN driver defaults
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.