How are you making the call?  In particular, how did you initialize the value 
you're passing for hashBuffer?  The routine is not going to allocate memory for 
the buffer; it's going to write data into the buffer you allocated and are 
passing in.

At 05:44 PM 8/12/2005, Russell McClure wrote
>I can't seem to get any value to return from the GetHashFromFile
>function in mscoree.dll.  Either my DllImport signature is incorrect or
>I'm not understanding what this function is supposed to do.  There is
>very little documentation on in on the web.
>
>The function is not generating a Win32 error.  It is completing
>successfully.  However my hash buffer always ends up as equal to null.
>
>Here is my current DllImport statement but I have tried many different
>variations:
>
>[DllImport("mscoree.dll", SetLastError=true)]
>private static extern int GetHashFromFile(
>        string filePath, uint hashAlgorithm,
>        out byte[] hashBuffer, uint maxHashBufferSize, out uint
>hashBufferSize);
>
>Thanks,
>
>Russ


J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to