Skip to content

Instantly share code, notes, and snippets.

@vvs
Created October 25, 2009 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvs/218122 to your computer and use it in GitHub Desktop.
Save vvs/218122 to your computer and use it in GitHub Desktop.
public class FileTime extends Struct {
public final Unsigned32 dwLowDateTime = new Unsigned32();
public final Unsigned32 dwHighDateTime = new Unsigned32();
public long get() {
return (dwHighDateTime.get() << 32) | dwLowDateTime.get();
}
}
public class WinApiFileStat extends BaseHeapFileStat {
public final Unsigned32 dwFileAttributes = new Unsigned32();
public final FileTime ftCreationTime = new FileTime(); // doesn't work
public final Unsigned64 ftLastAccessTime = new Unsigned64(); // works, but inconvenient
public final Unsigned64 ftLastWriteTime = new Unsigned64();
public final Unsigned32 dwVolumeSerialNumber = new Unsigned32();
public final Unsigned32 nFileSizeHigh = new Unsigned32();
public final Unsigned32 nFileSizeLow = new Unsigned32();
public final Unsigned32 nNumberOfLinks = new Unsigned32();
public final Unsigned32 nFileIndexHigh = new Unsigned32();
public final Unsigned32 nFileIndexLow = new Unsigned32();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment