NdisFreeString
DDK Documentation Error

 

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

 

Summary

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.

 

Discussion

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.

 

 

Status

November 2, 2000 Reported to Microsoft.

 

Comments

Please click the following link to send e-mail relating to this PCAUSA Knowledge Base topic:

<Send Mail To KB11020001 Technical Contact>

 

Keywords MICROSOFT DDK, DOC
Created November 2, 2000
Last Reviewed November 2, 2000

 
 

PCAUSA Home · Privacy Statement · Products · Ordering · Support · Utilities · Resources
Mailing Lists  · PCAUSA Newsletter · PCAUSA Discussion List
 
Rawether for Windows and WinDis 32 are trademarks of Printing Communications Assoc., Inc. (PCAUSA)
Microsoft, MS, Windows, Windows 95, Windows 98, Windows Millennium, Windows 2000, and Win32 are registered trademarks and Visual C++ and Windows NT are trademarks of the Microsoft Corporation.
Send mail to webmaster@pcausa.com with questions or comments about this web site.
Copyright © 1996-2010 Printing Communications Assoc., Inc. (PCAUSA)
Last modified: February 04, 2010