DHCP Callout API Memory Allocation
From: Duckmonkeyman (Duckmonkeyman_at_discussions.microsoft.com)
Date: 02/28/05
- Next message: Alun Jones [MSFT]: "Re: how to upload a file with chinese filename to ftp server in vb."
- Previous message: Morris: "Re: Service on XP fails accessing a file on the network"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 28 Feb 2005 11:59:04 -0800
I'm using LocalAlloc() and LocalFree() in the DhcpNewPktHook and
DhcpPktSendHook functions to manage both the PktContext and the Packet.
- Is LocalAlloc() and LocalFree() what I should be using in the callout DLL
to allocate and free memory? Or should I allocate dynamic memory a different
way?
- Do I need to deallocate the *Packet passed in if I resize it, reallocate,
and return a new Packet? Right now, doing an LocalFree(*Packet) causes the
DHCP server to crash. Removing this LocalFree() stops the crashing, but am I
then leaking memory? In other words, does the DHCP Server handle
deallocating the *Packet passed in? Does it also deallocate the *PktContext?
Thanks.
- Next message: Alun Jones [MSFT]: "Re: how to upload a file with chinese filename to ftp server in vb."
- Previous message: Morris: "Re: Service on XP fails accessing a file on the network"
- Messages sorted by: [ date ] [ thread ]