T
Tony Johansson
Hi!
Here is an example from MSDN
I have two questions concering this text.
1. Why do they have brackets around some out prefix parameter. Is [Out]
lpBuffer the same as out lpBuffer ?
2. They also have brackets around In like this [In]. What does that mean ?
Class Backup
{
[DllImport("kernel32.dll")]
static extern bool BackupRead(IntPtr hFile, [Out] byte[] lpBuffer,
uint nNumberOfBytesToRead, out uint
lpNumberOfBytesRead, bool bAbort, bool bProcessSecurity, out
IntPtr lpContext);
[DllImport("kernel32.dll")]
static extern bool WriteFile(IntPtr hFile, byte[] lpBuffer, uint
nNumberOfBytesToWrite,
out uint lpNumberOfBytesWritten, [In] ref
System.Threading.NativeOverlapped lpOverlapped);
}
//Tony
Here is an example from MSDN
I have two questions concering this text.
1. Why do they have brackets around some out prefix parameter. Is [Out]
lpBuffer the same as out lpBuffer ?
2. They also have brackets around In like this [In]. What does that mean ?
Class Backup
{
[DllImport("kernel32.dll")]
static extern bool BackupRead(IntPtr hFile, [Out] byte[] lpBuffer,
uint nNumberOfBytesToRead, out uint
lpNumberOfBytesRead, bool bAbort, bool bProcessSecurity, out
IntPtr lpContext);
[DllImport("kernel32.dll")]
static extern bool WriteFile(IntPtr hFile, byte[] lpBuffer, uint
nNumberOfBytesToWrite,
out uint lpNumberOfBytesWritten, [In] ref
System.Threading.NativeOverlapped lpOverlapped);
}
//Tony