|
|
NdisFreeString
|
|
Knowledge Base ID |
KB11020001 |
| Category | DDK DOCUMENTATION ERROR |
|
Effected Product |
Microsoft Windows Driver Development Kit (DDK) Documentation |
|
Effected Versions |
Through Windows 2000 DDK SP1 |
| Effected Platforms | All |
![]()
The DDK documentation for NdisFreeString states that:
"For each call it makes to an NdisXXXString function, the driver should make a corresponding call to NdisFreeString before its initialization function returns control."
The documentation also suggests that NdisFreeString should be called to release resources allocated by NdisInitAnsiString and NdisInitUnicodeString.
This is not correct...
NdisFreeString should only be called for specific NdisXXXString functions that automatically allocate storage for a string buffer.
NdisInitializeString is an example of a function that automatically allocates storage for a string buffer. As stated in the NdisInitializeString DDK documentation, the buffer allocated by this function should be released promptly with NdisFreeString.
On the other hand, NdisInitAnsiString and NdisInitUnicodeString do not allocate storage for a new string buffer. Instead, they simply make the string buffer point to the source string that is passed in. No memory is allocated; instead, the NDIS_ANSI_STRING or NDIS_STRING structure fields are simply initialized appropriately.
NdisFreeString should not be called after making calls to NdisInitAnsiString or NdisInitUnicodeString since neither of these two functions allocate storage.
| November 2, 2000 | Reported to Microsoft. |
Please click the following link to send e-mail relating to this PCAUSA Knowledge Base topic:
![]()
| Keywords | MICROSOFT DDK, DOC |
| Created | November 2, 2000 |
| Last Reviewed | November 2, 2000 |
![]()
|
PCAUSA Home ·
Privacy Statement ·
Products ·
Ordering ·
Support ·
Utilities ·
Resources
|