GlobalAlloc / GlobalFree problem on Windows 7

Posted on 2010-09-14
Last Modified: 2013-11-18
We receive strange errors when running our app on Windows 7 systems (we believe it is a Windows 7 problem). W7 runs as 32 Bit system, out app is VB6 based and calls some C++ DLLs, in one of which the error occurs. The app runs stable on 150 PCs (in majority Win2000 and Win XP).

This code fragment is a part of Chris Maunder's DataGridCtrl, where the complete grid shall be printed. See the code part and the error situation in the screenshot; GlobalFree causes an error.

I would try to use another allocating technique (if allocating an HGLOBAL can be done alternatively), but I'd like to understand what's the problem here in Windows 7.
Question by:PC-Alex
  • 3
  • 3
LVL 86

Expert Comment

ID: 33683126
"Break instruction exception" actually points to a an error condition being raised in 'datagrid.ocx' - you should rebuild that as 'Debug' with symbols to see what causes that. '0xc0000374' is 'STATUS_HEAP_CORRUPTION', see ("NTSTATUS values")

Author Comment

ID: 33683193

thanks for the comment ... we are *inside* datagrid.ocx there, where you see the code. This code is the code inside this ocx where the crash happens; this is the last place outside the Windows API or Kernel function until where I can track the error
LVL 86

Expert Comment

ID: 33683317
Yes, but the debugger also states "Cannot find symbols for datagrid.ocx", to a debug (or release) build with symbols might help tracking down the error.
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).


Author Comment

ID: 33683823
now I'm a little confused. I'm sure he knows where to access the .pdb file, otherwise he wouldn't show me the exact line of code. Or am I missing something ?

Is there more to the symbol information than the .pdb file ?

I've given him the path to the DebugU folder (where all compiler output is located) and reloaded, but nothing changed, see the screenshot.

I think he's missing symbols for the vb runtime ?
LVL 86

Accepted Solution

jkr earned 500 total points
ID: 33683893
Ah, OK, I might have missed that. The German variable names made me think it was the code that calls the OCX.

As a side note: There is no need to use 'GlobalAlloc()' for a DEVMODE struct, you can just declare it as

DEVMODE dmDevMode;

and use it. I wonder whether that would fix the whole problem or just the symptom...

Author Comment

ID: 33683913
OK, good Idea, I'll try and report ...

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 47
string initialization in java 11 103
has22 challenge 11 71
modThree challenge 4 64
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now