Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "LocalFree" in [All]

kernel32

.

    lpMsgBuf= LocalFree( lpMsgBuf );

.

    lpMsgBuf= LocalFree( lpMsgBuf );

.

    Public Shared Function LocalFree(ByVal hMem As IntPtr) As IntPtr

.

    FORMAT_MESSAGE_ALLOCATE_BUFFER = &H100 'The caller should use the LocalFree function to free the buffer when it is no longer needed

.

    'The caller should use the LocalFree function to free the buffer when it is no longer needed

.

    If LocalFree(lpMsgBuf) <> 0 Then

.

Once allocated, use the LocalFree function to free memory allocated with this function. If you do not do this, you have created a memory leak.

.

static extern IntPtr LocalFree(IntPtr hMem);

.
Documentation
[LocalFree] on MSDN

advapi32

.

As explained [here], memory for the returned unmanaged string must be freed by calling LocalFree. Therefore, you must define the string as an IntPtr in managed code and call LocalFree yourself. Otherwise, the marshaler would call CoTaskMemFree which is not correct in this case.

.
Dissent
Don't use an IntPtr like above, just use a System.Text.StringBuilder. You shouldn't need to worry about calling LocalFree in this case either, but I have not confirmed this 100%.
.

     LocalFree(ptrSid);

.

     LocalFree(ptrSID)

.

        LocalFree(pSid);

.

The caller needs to call LocalFree() on the pointer to the security descriptor returned from this call.

.

    LocalFree(psd);

.

    internal static extern IntPtr LocalFree(

.

        LocalFree(securityDescriptor);

.

        static extern IntPtr LocalFree(IntPtr hMem);

.

                LocalFree(pstr);

.

    static extern IntPtr LocalFree(IntPtr hMem);

.

            LocalFree(ptrSid);

.

        static extern IntPtr LocalFree(IntPtr hMem);

.

                    LocalFree(ptrSid);

.

        LocalFree(ptrSidString)

netapi32

.

The caller must free this memory when it is no longer required by calling LocalFree.

shell32

.

            LocalFree(ptrToSplitArgs);

.

    static extern IntPtr LocalFree(IntPtr hMem);

Structures

.

Remember that DATA_BLOB.pbData for the output parameters of the CryptProtectData and CryptUnprotectData functions will point to a block of unmanaged memory that needs to be cleaned up using a call to LocalFree from kernel32. You will of course have to use pinvoke to call LocalFree.

rapi

.

    LocalFree( pInput );


 
Access PInvoke.net directly from VS: