Memory Freeing!

Hello

THis question is related to basic SDK programming. Please pardon me if i m
asking in this group!

My question is can an EXE free a memory location allocated by a DLL?
I was assuming all along that both the exe and dll share the same memory
space and hence one should not have any problem in freeing the location.

It is to be noted that the exe loads the dll at startup!
The exe is implemented like this:

main ()
{
int *p = NULL;

func (&p);
free (p); //This place is causing an error!!!
}

The dll is implemented like this:

func (int **p)
{
*p = malloc (10 integers);
}

Where am I doing wrong?

TIA,
Venky


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Venky,

Look up article “Q94248 - HOWTO: Use the C Run-Time” in MSDN. Section 4 will
be of interest to you.

Aaron Stavens
NetMotion Wireless, Inc.

-----Original Message-----
From: Varadan Venkatesh [mailto:xxxxx@tataelxsi.co.in]
Sent: Monday, July 02, 2001 2:04 AM
To: NT Developers Interest List
Subject: [ntdev] Memory Freeing!

Hello

THis question is related to basic SDK programming. Please pardon me if i m
asking in this group!

My question is can an EXE free a memory location allocated by a DLL?
I was assuming all along that both the exe and dll share the same memory
space and hence one should not have any problem in freeing the location.

It is to be noted that the exe loads the dll at startup!
The exe is implemented like this:

main ()
{
int *p = NULL;

func (&p);
free (p); //This place is causing an error!!!
}

The dll is implemented like this:

func (int **p)
{
*p = malloc (10 integers);
}

Where am I doing wrong?

TIA,
Venky


You are currently subscribed to ntdev as: xxxxx@nmwco.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com