quote:
Originally posted by matty
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);
}
Debut.Trace( 'ShGetFileInfoW : ' + Interop.Call('shell32', 'ShGetFileInfoW', 'C:\\antivir.exe', 0x80, SHFILEINFO.DataPtr, 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.
(You wrote "Debut.Trace") It is failing for some reason, it is not specified why... (error code: 2147352567 on "Debug.Trace" line)
It gives error also using this only:
Interop.Call('shell32', 'ShGetFileInfoW', 'C:\\antivir.exe', 0x80, SHFILEINFO.DataPtr, 0x800);