Ok you need to review a bit about memory allocations.
js code:
var szDisplayName = Interop.Allocate(512);
var szTypeName= Interop.Allocate(162);
var SHFILEINFO = Interop.Allocate(18);
with ( SHFILEINFO ) {
WriteDWORD(10, szDisplayName.DataPtr);
WriteDWORD(14, szTypeName.DataPtr);
Debug.Trace( 'ShGetFileInfoW : ' + ( Interop.Call('shell32', 'ShGetFileInfoW', 'C:\\antivir.exe', 0x80, SHFILEINFO.DataPtr, Size, 0x800 ) === 0 ? 'Passed' : 'Failed' ) );
}
And obviously I have no way of testing the above it is just a guideline... but do research a bit more.