Desktop Functions: Smart Device Functions:
|
Search Results for "SIZE" in [All]cfgmgr32
static extern uint CM_Get_Device_Interface_List_Size(out uint size, ref Guid interfaceClassGuid, string deviceID, uint flags);
static extern uint CM_Get_Device_Interface_List_Size(out uint size, ref Guid interfaceClassGuid, string deviceID, uint flags);
InvalidStructureSize = 0x0000003B gsapi
gsapi_revision(ref version, Marshal.SizeOf(version));
Declare Auto Function gsapi_revision Lib "gsdll32.dll" (ByRef pVer As GSVersion, ByVal pSize As Integer) As Integer
gsapi_revision(ref gsVer, Marshal.SizeOf(gsVer));
lResult = gsapi_revision(lVer, Marshal.SizeOf(lVer)) urlmon6: CopyMemory
// const int size = 200;
// IntPtr memorySource = Marshal.AllocHGlobal(size);
// IntPtr memoryTarget = Marshal.AllocHGlobal(size);
// CopyMemory(memoryTarget,memorySource,size);
int size = data.Length * sizeof(int);
byte[] dst = new byte[size]
fixed (byte* pd = dst){ fixed(int* ps = data){ CopyMemory(pd, ps, size); } }
BitConverter.ToInt32(dst, dst.GetUpperBound(0) - sizeof(int)) == data[data.GetUpperBound(0)]);
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I1, SizeParamIndex=3)]
int cbSize,
<MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.I1, SizeParamIndex:=3)> ByVal _
ByVal cbSize As Integer, _
cbSize As Long, _ winscard
// ref int nStringSize);
request.cbPciLength = System.Runtime.InteropServices.Marshal.SizeOf(typeof(UnsafeNativeMethods.SCARD_IO_REQUEST)); 10: WinSCard
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] kernel3211: ActivateActCtx
public int cbSize;
actCtx.cbSize = Marshal.SizeOf(typeof(ACTCTX)); 12: 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! 13: 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; 14: 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, _ 15: 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, _ 16: CreateFiber
static extern IntPtr CreateFiber(uint dwStackSize, 17: 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; 19: CreateMailslot
static extern IntPtr CreateMailslot(string lpName, uint nMaxMessageSize,
ByVal nMaxMessageSize As UInt32, _ 20: CreateMutex
public byte size;
secAttribs.nLength = Marshal.SizeOf( secAttribs );
securityDescPtr = Marshal.AllocCoTaskMem( Marshal.SizeOf( securityDesc ) );
mutexAttributesPtr = Marshal.AllocCoTaskMem( Marshal.SizeOf( secAttribs ) ); 21: 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, 22: 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 23: 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: 25: 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)); 27: 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 36: 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 37: GetAtomName
static extern uint GetAtomName(ushort nAtom, [Out] StringBuilder lpBuffer, int nSize); 38: GetCommConfig
ref uint lpdwSize);
static extern uint GetCompressedFileSize(string lpFileName,
out uint lpFileSizeHigh);
Private Declare Function GetCompressedFileSize Lib "kernel32" Alias "GetCompressedFileSizeA" (ByVal lpFileName As String, ByVal lpFileSizeHigh As IntPtr) As UInt32
Private Declare Function GetCompressedFileSize Lib "kernel32" Alias "GetCompressedFileSizeA" (ByVal lpFileName As String, lpFileSizeHigh As Long) As Long The code below correctly obtains the compressed file size also if above 4GB. (Fixed VB and C# code, 2012 Eske Rahn)
[DllImport("kernel32.dll", SetLastError=true, EntryPoint="GetCompressedFileSize")]
static extern uint GetCompressedFileSizeAPI(string lpFileName, out uint lpFileSizeHigh);
public ulong GetCompressedFileSize(string filename)
low = GetCompressedFileSizeAPI(filename, out high);
Public Function CompressedFileSize(ByVal path As String) As Long
' Return Convert.ToInt64(GetCompressedFileSize(path, IntPtr.Zero))
Dim filelength as Long = Convert.ToInt64(GetCompressedFileSize(path, ptr))
If Err <> 0 Then Throw New IOException("Exception getting compressed size: " & Err.ToString)
Throw New IOException("The compressed size of the specified file could not be determined.")
Private Sub GetFileSize(ByVal strPath As String)
MsgBox "The size of " + strPath " is " + CStr(GetCompressedFileSize(strPath, ByVal 0&)) + " bytes " 40: GetComputerName
StringBuilder lpBuffer, ref uint lpnSize);
Private Shared Function GetComputerNameEx(ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As StringBuilder, ByRef lpnSize As UInt32) As Boolean
StringBuilder lpBuffer, ref uint lpnSize);
uint size = 260;
success = GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameDnsDomain, name, ref size);
StringBuilder lpBuffer, ref uint lpnSize);
Private Shared Function GetComputerNameEx(ByVal NameType As COMPUTER_NAME_FORMAT, ByVal lpBuffer As StringBuilder, ByRef lpnSize As UInt32) As Boolean
out StringBuilder lpBuffer, ref uint lpnSize);
uint size = 260;
success = GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameDnsDomain, name, ref size);
/* Retrieves information about the size and visibility of the cursor,
static extern Coord GetConsoleFontSize( Here's a method that uses this method in conjunction with GetCurrentConsoleFont to return the size of the currently selected console font.
private Coord GetCurrentFontSize()
//Use that index to obtain font size
Coord coord = GetConsoleFontSize(_consoleOutputHandle, currentFont.nFont);
ushort cbSize;
ushort HistoryBufferSize;
DWORD nSize);
public uint cbSize;
public COORD dwSize;
public COORD dwMaximumWindowSize;
// [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)] cbSize must be initialized - ConsoleScreenBufferInfo.cbSize = (uint)sizeof(CONSOLE_SCREEN_BUFFER_INFO_EX);
public uint cbSize;
public COORD dwSize;
public COORD dwMaximumWindowSize;
// [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)] 48: GetConsoleTitle
DWORD nSize 49: GetCPInfo
public int MaxCharSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DEFAULTCHAR)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_LEADBYTES)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] 50: GetCPInfoEx
public int MaxCharSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DEFAULTCHAR)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_LEADBYTES)]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
//Find out the size of the converted string..
//Shouldn't be here, we should have received the size of the converted string.
private int cbSize;
cbSize = Marshal.SizeOf(typeof(CONSOLE_FONT_INFO_EX));
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
private int cbSize;
cbSize = Marshal.SizeOf(typeof(CONSOLE_FONT_INFOEX));
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 54: GetCurrentThread
var size = (high - low) / 1024; 55: GetDateFormat
static extern int GetDateFormat(uint locale, uint dwFlags, ref SystemTime date, string format, StringBuilder sb, int sbSize);
ref uint lpdwSize);
static extern bool GetDefaultCommConfig(string lpszName, [In, Out] ref COMMCONFIG lpCC, ref uint lpdwSize);
public Byte ByteSize;
public Int32 dwSize;
public Int32 dwProviderSize;
uint sz = (uint)Marshal.SizeOf(cc);
[Out] StringBuilder lpBuffer, uint nSize);
private static extern bool GetFileInformationByHandleEx(IntPtr hFile, FILE_INFO_BY_HANDLE_CLASS infoClass, out FILE_ID_BOTH_DIR_INFO dirInfo, uint dwBufferSize);
GetFileInformationByHandleEx(handle, FILE_INFO_BY_HANDLE_CLASS.FileIdBothDirectoryInfo, out fileStruct, (uint)Marshal.SizeOf(fileStruct));
private static extern bool GetFileInformationByHandleEx(IntPtr hFile, FILE_INFO_BY_HANDLE_CLASS infoClass, out FILE_ID_BOTH_DIR_INFO dirInfo, uint dwBufferSize);
GetFileInformationByHandleEx(handle, FILE_INFO_BY_HANDLE_CLASS.FileIdBothDirectoryInfo, out fileStruct, (uint)Marshal.SizeOf(fileStruct)); 60: GetFileSize
static extern bool GetFileSizeEx(IntPtr hFile, out long lpFileSize);
Public Shared Function GetFileSizeEx( _
<[In](), Out()> ByRef lpFileSize As Long) As Boolean
long fileSize;
bool result = GetFileSizeEx(handle, out fileSize); Cut off search results after 60. Please refine your search. |