Hi, Slackner<br><br>Thanks for your so detailed reply and suggestions<br><br>I am working on error handling part of the code and I am a bit confused<br>I looked up RtlAnsiStringToUnicodeString function , and found it would return<br>3 different ERROR STATUS,  given below: <br>--snip--<br><br> * RETURNS<br> *  Success: STATUS_SUCCESS. uni contains the converted string<br> *  Failure: STATUS_BUFFER_OVERFLOW, if doalloc is FALSE and ansi is too small.<br> *           STATUS_NO_MEMORY, if doalloc is TRUE and the allocation fails.<br> *           STATUS_INVALID_PARAMETER_2, if the unicode string would be larger than 65535.<br> *<br><br>--snip--<br><br>For what error code will STATUS_INVALID_PARAMETER_2 Give , I can test by manually set the filename to a very long string, but I cannot test What ERROR code will be given<br>when STATUS_NO_MEMORY returned in Windows, I try to allocate the memory until no more memory can be allocated with while(malloc(1)); but I get the same error code as STATUS_INVALID_PARAMETER_2 give<br><br>And what's more, I found something maybe interesting ,or strange<br><br>* On wine When the filename length is 65536 , the RtlAnsiStringToUnicodeString will pass successfully<br>  and it will fail on RtlDosPathNameToNtPathName_U when the filename length is a bit shorter or equal 65535, it will fail on RtlAnsiStringToUnicodeString , why a longer string can pass the RtlAnsiStringToUnicodeString function, What I guess is overflow, but I haven't dig into it yet<br><br>* And another strange thing is On windows DumpFile_Test fail when the filename_length is longer than 218 chars(218 works well), On wine no errors happen until the filename length is longer than 255 (255 works well)<br><br>If no NTSTATUS ERRORCODE return and RtlDosPahNameToNtPathName_U return TRUE, I cannot set the errorcode , so when the filename length is between 218 to 255 , the pcap_dump_open will behave differently on win and wine, Should I use strlen to compare the string length of filename and set a errorcode when the filename length is longer than 218?<br><br><br><br>And By the way , I haven't correct my Memory leak problem, I will correct when send my patch :)