阅读:752回复:1
请问各位大虾一个关于空间释放的问题!!
我在驱动中定义了的变量:
char ArrayFileName[256]=0x00; UNICODE_STRING uniFileName; PFILE_BOTH_DIR_INFORMATION pFileInfo; PFILE_BOTH_DIR_INFORMATION pLastFileInfo; ... ZwQueryDirectoryFile(....) pFileInfo = (PFILE_BOTH_DIR_INFORMATION)FileInformationBuffer; RtlInitUnicodeString(&uniFileName,pFileInfo->FileName); .... 请问上面定义的变量需要释放吗???? [编辑 - 2/17/04 by zgc7622] |
|
沙发#
发布于:2004-02-17 11:56
VOID
RtlInitUnicodeString( OUT PUNICODE_STRING DestinationString, IN PCWSTR SourceString OPTIONAL ) /*++ Routine Description: The RtlInitUnicodeString function initializes an NT counted unicode string. The DestinationString is initialized to point to the SourceString and the Length and MaximumLength fields of DestinationString are initialized to the length of the SourceString, which is zero if SourceString is not specified. Arguments: DestinationString - Pointer to the counted string to initialize SourceString - Optional pointer to a null terminated unicode string that the counted string is to point to. Return Value: None. --*/ { ULONG Length; DestinationString->Buffer = (PWSTR)SourceString; if (ARGUMENT_PRESENT( SourceString )) { Length = wcslen( SourceString ) * sizeof( WCHAR ); DestinationString->Length = (USHORT)Length; DestinationString->MaximumLength = (USHORT)(Length + sizeof(UNICODE_NULL)); } else { DestinationString->MaximumLength = 0; DestinationString->Length = 0; } } SourceString;如果是你EXALLOCATEPOOL得来的就要释放,如果是你放在数据段或堆栈的就无须释放。 |
|
|