Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

ILockBytes (Interfaces)
 
.
Summary
TODO - a short description

C# Definition:

[ComVisible(false)]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000000A-0000-0000-C000-000000000046")]
public interface ILockBytes
{
    void ReadAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbRead);
    void WriteAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbWritten);
    void Flush();
    void SetSize(long cb);
    void LockRegion(long libOffset, long cb, int dwLockType);
    void UnlockRegion(long libOffset, long cb, int dwLockType);
    void Stat(ref System.Runtime.InteropServices.STATSTG pstatstg, int grfStatFlag);

}

VB Definition:

<ComImport> _
<Guid("0000000A-0000-0000-C000-000000000046")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface ILockBytes
   TODO
End Interface

User-Defined Types:

None.

Notes:

// read a chunk from the ILockBytes object
public int ReadAt(long offset, byte[] buffer, int bufferSize)
{
    IntPtr pv = Marshal.AllocHGlobal(bufferSize);
    UIntPtr pcbRead;

    ((ILockBytes)comPtr).ReadAt(offset, pv, bufferSize, out pcbRead);

    int length = (int)pcbRead.ToUInt32();
    Marshal.Copy(pv, buffer, 0, length);

    Marshal.FreeHGlobal(pv);
    return length;
}

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions