Desktop Functions: Smart Device Functions:
|
Search Results for "SIZE" in [All]msvcrt1: fwrite
static extern IntPtr fwrite(byte[] buffer, IntPtr size, IntPtr number, IntPtr file);
Declare Function fwrite Lib "msvcrt.dll" (byte[] buffer, IntPtr size, IntPtr number, IntPtr file) As IntPtr 2: memcmp
3: memcpy
Dim size As Integer = Marshal.SizeOf(managedArray1(0)) * managedArray1.Length
Dim pnt1 As IntPtr = Marshal.AllocHGlobal(size)
Dim pnt2 As IntPtr = Marshal.AllocHGlobal(size)
CopyMemory(pnt2, pnt1, size * 2)
// get source image size 4: _pipe
static extern int _pipe(int[] pfds, uint psize, int textmode); 5: _stat
public uint st_size; gdi32Please note that this API method needs to be called twice! 1st to get the size of the enh meta file and 2nd to fill the buffer.
uint bufferSize = GetEnhMetaFileBits(hMf, 0, null); // Get required buffer size specifying 0 and NULL.
if (bufferSize == 0)
byte[] buffer = new byte[bufferSize];
if (GetEnhMetaFileBits(hMf, bufferSize, buffer) == 0) // Get raw metafile data. dwOffset specifies the offset from the beginning of the file mapping object referenced by hSection where storage for the bitmap’s bit values is to begin (ignored if hSection is NULL). The bitmap’s bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the size of a DWORD.
IntPtr plogFont = Marshal.AllocHGlobal(Marshal.SizeOf(lf));
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
int ntmSizeEM;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public const Int32 LF_FACESIZE = 32; // ref WinGDI.h
public const Int32 LF_FULLFACESIZE = 64; // ref WinGDI.h
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FULLFACESIZE)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]
public UInt32 ntmSizeEM;
IntPtr plogFont = Marshal.AllocHGlobal(Marshal.SizeOf(lf));
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
int ntmSizeEM;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public const Int32 LF_FACESIZE = 32; // ref WinGDI.h
public const Int32 LF_FULLFACESIZE = 64; // ref WinGDI.h
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FULLFACESIZE)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]
public UInt32 ntmSizeEM;
public int StructSize;
rs.StructSize = Marshal.SizeOf(typeof(GCP_RESULTS)); 11: GetDeviceCaps
/// Horizontal size in millimeters
HORZSIZE = 4,
/// Vertical size in millimeters
VERTSIZE = 6,
/// Size required for device descriptor
PDEVICESIZE = 26,
SIZEPALETTE = 104,
''' Horizontal size in millimeters
HORZSIZE = 4
''' Vertical size in millimeters
VERTSIZE = 6
''' Size required for device descriptor
PDEVICESIZE = 26
SIZEPALETTE = 104
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)] 13: GetEnhMetaFile
var bufferSize = GetEnhMetaFileBits(enhMetafileHandle, 0, null);
var buffer = new byte[bufferSize];
GetEnhMetaFileBits(enhMetafileHandle, bufferSize, buffer);
var bufferSize = GetEnhMetaFileBits(enhMetafileHandle, 0, null);
var buffer = new byte[bufferSize];
GetEnhMetaFileBits(enhMetafileHandle, bufferSize, buffer); 15: GetFontData
/// If this value is greater than or equal to the size of the table, an error occurs.</param>
/// <param name="lpvBuffer">Points to a lpvBuffer to receive the font information. If this parameter is NULL, the function returns the size of the <paramref name="lpvBuffer"/> required for the font data.</param>
/// If this parameter is zero, GetFontData returns the size of the font metrics table specified in the <paramref name="dwTable"/> parameter. </param>
uint size = GetFontUnicodeRanges(hdc, IntPtr.Zero);
IntPtr glyphSet = Marshal.AllocHGlobal((int)size); 17: GetGlyphOutline
int bufferSize = (int)GetGlyphOutline(hdc, (uint)c, (uint)2, out metrics, 0, IntPtr.Zero, ref matrix);
IntPtr buffer = Marshal.AllocHGlobal(bufferSize);
if((ret = GetGlyphOutline(hdc, (uint)c, (uint)2, out metrics, (uint)bufferSize, buffer, ref matrix)) > 0)
int polygonHeaderSize = Marshal.SizeOf(typeof(TTPOLYGONHEADER));
int curveHeaderSize = Marshal.SizeOf(typeof(TTPOLYCURVEHEADER));
int pointFxSize = Marshal.SizeOf(typeof(POINTFX));
while(index < bufferSize)
index+=polygonHeaderSize;
index+=curveHeaderSize;
index+=pointFxSize; 18: GetObject GDI32.GetObject(hBitmap, Marshal.SizeOf<GDI32.BITMAP>(), ptrToBitmap); First call returns needed buffer size the second fills buffer by actual data. 20: GetPath
[Out] byte [] lpTypes, int nSize); 21: GetRegionData
// The return from this call should be the size of buffer
int dataSize = GetRegionData(hRgn, 0, IntPtr.Zero);
if (dataSize != 0)
bytes = Marshal.AllocCoTaskMem(dataSize);
int retValue = GetRegionData(hRgn, dataSize, bytes);
// header size and start reading rectangles.
int rectOffset = header->dwSize;
rects[i] = *((RECT *)((byte *)bytes+rectOffset+(Marshal.SizeOf(typeof(RECT)) *i)));
int cchString, int nMaxExtent, out int lpnFit, int[] alpDx, out SIZE lpSize); Graphics.MeasureString Method (String, Font, SizeF, StringFormat, out Int32, out Int32) http://msdn.microsoft.com/en-us/library/957webty(v=VS.100).aspx
int cbString, out SIZE lpSize);
static extern bool GetTextExtentPoint32(IntPtr hdc, string lpString, int cbString, out SIZE lpSize);
public Size getExtent(string text, Graphics graphics, Font font)
Size sz = Size.Empty;
Size size=TextRenderer.MeasureText(g, str, f, new Size(), TextFormatFlags.NoPadding); Since .NET padding has been added to font's height and width. So you need to make use of the format flag TextFormatFlags.NoPadding to get the real size of the text.
new Size() - just a dummy parameter
int cbString, out SIZE lpSize);
int cbString, out SIZE lpSize); public Size getExtent(string text, Graphics graphics, Font font)
Size sz = Size.Empty;
Size size=TextRenderer.MeasureText(g, str, f, new Size(), TextFormatFlags.NoPadding); Since .NET padding has been added to font's height and width. So you need to make use of the format flag TextFormatFlags.NoPadding to get the real size of the text.
new Size() - just a dummy parameter 25: GetViewportExtEx
static extern bool GetViewportExtEx(IntPtr hdc, out SIZE lpSize); 26: GetWindowExtEx
static extern bool GetWindowExtEx(IntPtr hdc, out SIZE lpSize); 27: GradientFill
uint dwNumMesh, // size of gradient array
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]
[ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)] 29: SetMapMode
static extern bool SetViewportExtEx(IntPtr hDC, int nExtentX, int nExtentY, Size[] prevSize);
static extern bool SetWindowExtEx(IntPtr hDC, int nExtentX, int nExtentY, Size[] prevSize); Size[] size = new Size[1];
size);
size);
static extern IntPtr SetMetaFileBitsEx(uint nSize, byte [] lpData);
Shared Function SetMetaFileBitsEx(ByVal nSize As UInteger, ByVal lpData As Byte()) As IntPtr 31: StretchBlt
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.AutoScrollMinSize = bmp.Size;
private void Form1_Resize(object sender, System.EventArgs e)
this.AutoScrollMinSize = bmp.Size; 32: TextOut
int cbString, ref Size lpSize);
//You may want to meassure the string's size for layout purposes.
Size MeasureSize = new Size(0, 0);
GetTextExtentPoint(HDC, line, line.Length, ref MeasureSize);
y_pos += MeasureSize.Height;
//You can use the MeasureSize.Width property to implement icmp33: IcmpSendEcho
static extern Int32 IcmpSendEcho(IntPtr icmpHandle, Int32 destinationAddress, IntPtr requestData, Int16 requestSize, IntPtr requestOptions, IntPtr replyBuffer, Int32 replySize, Int32 timeout);
Declare Function IcmpSendEcho Lib "icmp.dll" (icmpHandle as IntPtr, destinationAddress as Int32, requestData as IntPtr, requestSize as Int16, requestOptions as IntPtr, replyBuffer as IntPtr, replySize as Int32, timeout as Int32) As Int32
public byte OptionsSize;
public short DataSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=250)]
private static extern int IcmpSendEcho(IntPtr icmpHandle, int destinationAddress, string requestData, short requestSize, ref ICMP_OPTIONS requestOptions, ref ICMP_ECHO_REPLY replyBuffer, int replySize, int timeout);
int iReplies = IcmpSendEcho(icmpHandle, BitConverter.ToInt32(ip.GetAddressBytes(), 0), sData, (short)sData.Length, ref icmpOptions, ref icmpReply, Marshal.SizeOf(icmpReply), 30);
UCHAR OptionsSize;
USHORT DataSize;
LPVOID RequestData, WORD RequestSize,
DWORD ReplySize,DWORD Timeout);
DWORD ReplySize = 0;
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);
ReplyBuffer = (VOID*) malloc(ReplySize);
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),
NULL, ReplyBuffer, ReplySize, maxMsec); kernel3234: ActivateActCtx
public int cbSize;
actCtx.cbSize = Marshal.SizeOf(typeof(ACTCTX)); 35: APIGetVersionEx
public uint dwOSVersionInfoSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
Public dwOSVersionInfoSize As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _
osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)
osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)
don't forget to set the dwOSVersionInfoSize
osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(osVersionInfo); // don't forget this line, please! 36: ConsoleFunctions
// http://pinvoke.net/default.aspx/kernel32/GetConsoleFontSize.html
static extern COORD GetConsoleFontSize(
uint Size
uint nSize
// http://pinvoke.net/default.aspx/kernel32/GetLargestConsoleWindowSize.html
static extern COORD GetLargestConsoleWindowSize(
COORD dwBufferSize,
// http://pinvoke.net/default.aspx/kernel32/SetConsoleScreenBufferSize.html
static extern bool SetConsoleScreenBufferSize(
COORD dwSize
COORD dwBufferSize,
public COORD dwSize;
public COORD dwMaximumWindowSize;
public uint cbSize;
public COORD dwSize;
public COORD dwMaximumWindowSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
return new CONSOLE_SCREEN_BUFFER_INFO_EX { cbSize = 96 };
public COORD dwFontSize;
public uint cbSize;
public COORD dwFontSize;
fixed char FaceName[LF_FACESIZE];
const uint LF_FACESIZE = 32;
public WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
public struct WINDOW_BUFFER_SIZE_RECORD
public COORD dwSize;
public WINDOW_BUFFER_SIZE_RECORD(short x, short y)
dwSize = new COORD();
dwSize.X = x;
dwSize.Y = y;
uint Size;
ushort cbSize;
ushort HistoryBufferSize; 37: CopyFile
long TotalFileSize,
long StreamSize,
private CopyProgressResult CopyProgressHandler(long total, long transferred, long streamSize, long StreamByteTrans, uint dwStreamNumber,CopyProgressCallbackReason reason, IntPtr hSourceFile, IntPtr hDestinationFile, IntPtr lpData)
Private Delegate Function CopyProgressRoutine(ByVal TotalFileSize As Long, _
ByVal TotalBytesTransferred As Long, ByVal StreamSize As Long, ByVal StreamBytesTransferred As Long, _
Private Function CopyProgressHandler(ByVal total As Long, ByVal transferred As Long, ByVal streamSize As Long, ByVal StreamByteTrans As Long, ByVal dwStreamNumber As UInteger, ByVal reason As CopyProgressCallbackReason, _ 38: CopyFileEx
long TotalFileSize,
long StreamSize,
private CopyProgressResult CopyProgressHandler(long total, long transferred, long streamSize, long StreamByteTrans, uint dwStreamNumber,CopyProgressCallbackReason reason, IntPtr hSourceFile, IntPtr hDestinationFile, IntPtr lpData)
Private Delegate Function CopyProgressRoutine(ByVal TotalFileSize As Long, _
ByVal TotalBytesTransferred As Long, ByVal StreamSize As Long, ByVal StreamBytesTransferred As Long, _
Private Function CopyProgressHandler(ByVal total As Long, ByVal transferred As Long, ByVal streamSize As Long, ByVal StreamByteTrans As Long, ByVal dwStreamNumber As UInteger, ByVal reason As CopyProgressCallbackReason, _ 39: CreateFiber
static extern IntPtr CreateFiber(uint dwStackSize, 40: CreateFile
uint dwMaximumSizeHigh,
uint dwMaximumSizeLow,
dwMaximumSizeHigh As UInteger, _
dwMaximumSizeLow As UInteger, _
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapWrite, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Write);
Win32API.FlushViewOfFile(hMVF, (Int32)MapViewSize);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapRead, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Read);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapWrite, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Write);
Win32API.FlushViewOfFile(hMVF, (Int32)MapViewSize);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapRead, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Read);
/// returns the streamed size of an object
public long Size(Object T)
private static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpAttributes, FileMapProtection flProtect, Int32 dwMaxSizeHi, Int32 dwMaxSizeLow, string lpName);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
int Hi = (Int32)(ddMaxSize / Int32.MaxValue);
int Lo = (Int32)(ddMaxSize % Int32.MaxValue);
public uint dwPageSize;
uint dwMaximumSizeHigh,
uint dwMaximumSizeLow,
dwMaximumSizeHigh As UInteger, _
dwMaximumSizeLow As UInteger, _
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapWrite, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Write);
Win32API.FlushViewOfFile(hMVF, (Int32)MapViewSize);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapRead, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Read);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapWrite, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Write);
Win32API.FlushViewOfFile(hMVF, (Int32)MapViewSize);
Int64 MapViewSize = (AtOffset % _AllocationGranularity) + _AllocationGranularity;
hMVF = Win32API.MapViewOfFile(_hMMF, Win32API.FileMapAccess.FileMapRead, FileMapStart, (Int32)MapViewSize);
UnmanagedMemoryStream ums = new UnmanagedMemoryStream(p, MapViewSize, MapViewSize, FileAccess.Read);
/// returns the streamed size of an object
public long Size(Object T)
private static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpAttributes, FileMapProtection flProtect, Int32 dwMaxSizeHi, Int32 dwMaxSizeLow, string lpName);
internal static IntPtr CreateFileMapping(System.IO.FileStream File, FileMapProtection flProtect, Int64 ddMaxSize, string lpName)
int Hi = (Int32)(ddMaxSize / Int32.MaxValue);
int Lo = (Int32)(ddMaxSize % Int32.MaxValue);
public uint dwPageSize; 42: CreateMailslot
static extern IntPtr CreateMailslot(string lpName, uint nMaxMessageSize,
ByVal nMaxMessageSize As UInt32, _ 43: CreateMutex
public byte size;
secAttribs.nLength = Marshal.SizeOf( secAttribs );
securityDescPtr = Marshal.AllocCoTaskMem( Marshal.SizeOf( securityDesc ) );
mutexAttributesPtr = Marshal.AllocCoTaskMem( Marshal.SizeOf( secAttribs ) ); 44: CreateNamedPipe
uint dwPipeMode, uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize,
uint dwPipeMode, uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize,
uint nOutBufferSize, // output buffer size
uint nInBufferSize, // input buffer size
byte[] buffer, uint nBufferSize, ref uint bytesRead, 45: CreatePipe
ref SECURITY_ATTRIBUTES lpPipeAttributes, uint nSize);
Function CreatePipe Lib "kernel32" (phReadPipe As Long, phWritePipe As Long, lpPipeAttributes As Any, ByVal nSize As Long) As Long 46: CreateProcess
pSec.nLength = Marshal.SizeOf(pSec);
tSec.nLength = Marshal.SizeOf(tSec);
pSec.nLength = Marshal.SizeOf(pSec)
tSec.nLength = Marshal.SizeOf(tSec)
IntPtr lpThreadAttributes, uint dwStackSize, ThreadStartDelegate
IntPtr lpThreadAttributes, uint dwStackSize, IntPtr lpStartAddress,
static def CreateRemoteThread(hProcess as IntPtr, lpThreadAttributes as IntPtr, dwStackSize as int, lpStartAddress as IntPtr, lpParameter as IntPtr, dwCreationFlags as uint, ref lpThreadId as int) as IntPtr: 48: CreateThread Warning: All signatures on this page are wrong as of 2014-01-24. dwStackSize is SIZE_T and ThreadStart has the wrong delegate signature. It only works by coincidence.
uint dwStackSize,
unsafe uint StartThread(StartThread ThreadFunc, int StackSize)
uint dwHandle = CreateThread(null, (uint)StackSize, ThreadFunc, lpParam, 0, out lpThreadID);
SecurityAttributes, uint StackSize, System.Threading.ThreadStart StartFunction,
internal UInt32 dwSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
procEntry.dwSize = (UInt32)Marshal.SizeOf(typeof(PROCESSENTRY32)); 50: DeviceIoControl
IntPtr lpInBuffer, uint nInBufferSize,
IntPtr lpOutBuffer, uint nOutBufferSize,
int nInBufferSize,
int nOutBufferSize,
uint nInBufferSize,
uint nOutBufferSize,
Shared Function DeviceIoControl(ByVal hDevice As IntPtr, ByVal dwIoControlCode As UInteger, ByVal lpInBuffer As IntPtr, ByVal nInBufferSize As UInteger, ByVal lpOutBuffer As IntPtr, ByVal nOutBufferSize As UInteger, ByRef lpBytesReturned As UInteger, ByVal lpOverlapped As IntPtr) As Boolean
ByVal nInBufferSize As Integer, ByRef OutBuffer As Long, _
ByVal nOutBufferSize As Integer, ByRef pBytesReturned As Integer, _
ByVal nInBufferSize As UInteger, <MarshalAs(UnmanagedType.AsAny), _
Out()> ByVal OutBuffer As Object, ByVal nOutBufferSize As UInteger, _
public bool DeviceIoControl( IntPtr hDevice, uint dwIoControlCode, ref long buffer, int bufferSize, ref NativeOverlapped pOverlapped)
return DeviceIoControl( hDevice, dwIoControlCode, ref buffer, bufferSize, ref buffer, bufferSize, ref NoReturn, ref pOverlapped );
IntPtr.Zero, 0, out diskGeo, Marshal.SizeOf(diskGeo), out dummy, IntPtr.Zero);
IntPtr.Zero, 0, out partInfo, Marshal.SizeOf(partInfo), out dummy, IntPtr.Zero);
if (length != len) Array.Resize(ref data, len);
DiskUpdateDriveSize = (EFileDevice.Disk << 16) | (0x0032 << 2) | EMethod.Buffered | (FileAccess.ReadWrite << 14),
uint nInBufferSize,
uint nOutBufferSize,
mPtrOverlapped = Marshal.AllocHGlobal(Marshal.SizeOf(typeof (NativeOverlapped)));
DeviceIoControl(hDevice, iCtlCode, inBuffer, inSize, outBuffer, outSize, out ret, deviceIoOverlapped.GlobalOverlapped)
Public Const READ_ATTRIBUTE_BUFFER_SIZE As Integer = 512
Public Const IDENTIFY_BUFFER_SIZE As Integer = 512
Public Const READ_THRESHOLD_BUFFER_SIZE As Integer = 512
Public Const OUTPUT_DATA_SIZE As Integer = IDENTIFY_BUFFER_SIZE + 16
Private Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Integer, ByVal dwIoControlCode As Integer, ByRef lpInBuffer As IntPtr, ByVal nInBufferSize As Integer, ByRef lpOutBuffer As IntPtr, ByVal nOutBufferSize As Integer, ByRef lpBytesReturned As Integer, ByVal lpOverlapped As IntPtr) As Integer
Private Declare Ansi Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Integer, ByVal dwIoControlCode As Integer, ByVal lpInBuffer As Integer, ByVal nInBufferSize As Integer, ByRef lpOutBuffer As Integer, ByVal nOutBufferSize As Integer, ByRef lpBytesReturned As Integer, ByVal lpOverlapped As Integer) As Integer
Private Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Integer, ByVal dwIoControlCode As Integer, ByRef lpInBuffer As IntPtr, ByVal nInBufferSize As Integer, ByRef lpOutBuffer As DISK_GEOMETRY, ByVal nOutBufferSize As Integer, ByRef lpBytesReturned As Integer, ByVal lpOverlapped As IntPtr) As Integer
Private Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Integer, ByVal dwIoControlCode As Integer, ByRef lpInBuffer As IntPtr, ByVal nInBufferSize As Integer, ByRef lpOutBuffer As GETVERSIONOUTPARAMS, ByVal nOutBufferSize As Integer, ByRef lpBytesReturned As Integer, ByVal lpOverlapped As IntPtr) As Integer
Private Declare Function DeviceIoControl Lib "kernel32" (ByVal hDevice As Integer, ByVal dwIoControlCode As Integer, ByRef lpInBuffer As SENDCMDINPARAMS, ByVal nInBufferSize As Integer, ByRef lpOutBuffer As IntPtr, ByVal nOutBufferSize As Integer, ByRef lpBytesReturned As Integer, ByVal lpOverlapped As IntPtr) As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> _
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> _
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=19)> _
Dim wBufferSize As Short
Dim wECCSize As Short
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=7)> _
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=39)> _
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=127)> _
Dim cBufferSize As Integer ' Buffer size in bytes
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> _
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> _
Public dwOSVersionInfoSize As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _
Dim bArrOut(OUTPUT_DATA_SIZE - 1) As Byte
For i = 0 To OUTPUT_DATA_SIZE - 1
.cBufferSize = IDENTIFY_BUFFER_SIZE
Dim arraySize As Integer = bArrOut.Length
Dim buffer As IntPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(arraySize) * bArrOut.Length)
If DeviceIoControl(hdrive, DFP_RECEIVE_DRIVE_DATA, SCIP, 32, buffer, OUTPUT_DATA_SIZE, lpcbBytesReturned, IntPtr.Zero) Then
Marshal.Copy(buffer, bArrOut, 0, arraySize)
[Out] StringBuilder ComputerName, ref uint nSize);
ref uint nSize); Returns ERROR_SUCCESS on success or an error code on failure. Unless only the primary computer name is requested, the buffer will be filled with a series of null-terminated strings followed by a final null terminator. To measure the required number of characters, not including the final null terminator, use a null buffer and a zero size. This function is similar to GetComputerNameEx, and delegates to it to obtain the primary computer name.
LOCALE_IPAPERSIZE =0x0000100A, // 1 = letter, 5 = legal, 8 = a3, 9 = a4
LOCALE_IPAPERSIZE =0x0000100A, // 1 = letter, 5 = legal, 8 = a3, 9 = a4
public static extern int ExpandEnvironmentStrings([MarshalAs(UnmanagedType.LPTStr)] String source, [Out] StringBuilder destination, int size);
nSize As integer ) As Integer
Public Declare Function ExpandEnvironmentStrings Lib "kernel32.dll" Alias "ExpandEnvironmentStringsW" (ByVal lpSrc As String, ByVal lpDst As String, ByVal nSize As Long) As Long FILE_NOTIFY_CHANGE_SIZE 0x00000008
UIntPtr dwSize);
Shared Function FlushInstructionCache(hProcess As IntPtr, lpBaseAddress As IntPtr, dwSize As UIntPtr) As Boolean
uint nSize, IntPtr Arguments);
uint nSize, IntPtr pArguments);
uint nSize, string[] Arguments);
static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, uint nSize, string[] Arguments);
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByRef lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As [String], ByVal nSize As Integer, ByRef Arguments As IntPtr) As Integer
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, <MarshalAs(UnmanageType.LPWStr)> ByRef lpBuffer As String, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As StringBuilder, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer 59: FormatMessage
uint nSize, IntPtr Arguments);
uint nSize, IntPtr pArguments);
uint nSize, string[] Arguments);
static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer, uint nSize, string[] Arguments);
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByRef lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As [String], ByVal nSize As Integer, ByRef Arguments As IntPtr) As Integer
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, <MarshalAs(UnmanageType.LPWStr)> ByRef lpBuffer As String, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByVal lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As StringBuilder, ByVal nSize As Integer, ByVal Arguments As IntPtr) As Integer
Public Shared Function FormatMessage(ByVal dwFlags As Integer, ByRef lpSource As IntPtr, ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, ByRef lpBuffer As IntPtr, ByVal nSize As Integer, ByRef Arguments As IntPtr) As Integer 60: GetAtomName
static extern uint GetAtomName(ushort nAtom, [Out] StringBuilder lpBuffer, int nSize); Cut off search results after 60. Please refine your search. |