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

Re: Re: Bad allocation of memory by source?

Forums › TWAIN Classic › Bad allocation of memory by source? › Re: Re: Bad allocation of memory by source?

January 13, 2012 at 6:46 pm #24557
peterp
Participant
  • Topics - 0
  • Replies - 30
  • Total Posts - 30

Noone could absolutely verify your theory is correct without having the same hardware and checking for themselves, but it does sound like you’re on the right track. When working on any software that deals with hardware, it always makes sense to check things on more than one device. It can help you narrow things down considerably.

Having said that, I’ll just mention that there are other issues that can cause problems such as you’re describing, although the fact that this doesn’t happen with all vendors does make it unlikely you’re running into any of them.

1 – It’s important that memory is allocated and deallocated using the same heap architecture, so it’s important that everyone involved in getting an image from a TWAIN device to an application use the GlobalFree and GlobalAlloc functions.

2 – The other main thing to ensure is that both the allocator and the freer use the same structure alignment during compile time. The TWAIN header files already have the appropriate compiler directives to ensure this, but if someone were to recreate those definitions for a new language, they might run into problems if they don’t pay attention to the alignment.

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

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • 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