Desktop Functions: Smart Device Functions:
|
Search Results for "SIZE" in [All]hid
Byte[] valueCaps = new Byte[ 1024 ]; // (the array size is a guess)
public Int32 Size;
Public Size As Int32
Specifies the size, in bytes, of the report buffer. The report buffer must be large enough to hold the output report -- excluding its report ID, if report IDs are used -- plus one additional byte that specifies a nonzero report ID or zero. 4: HIDP_CAPS
[MarshalAs(UnmanagedType.LPArray, SizeConst=17)]
Specifies the maximum size, in bytes, of all the input reports (including the report ID, if report IDs are used, which is prepended to the report data).
Specifies the maximum size, in bytes, of all the output reports (including the report ID, if report IDs are used, which is prepended to the report data). Callers of the HIDClass support routines use the information provided in this structure when a called routine requires, as input, the size of a report type, the number of link collection nodes, the number of control capabilities, or the number of data indices. oleaut325: VariantInit
'http://msdn.microsoft.com/en-us/library/aa246471%28v=vs.60%29.aspx http://www.cplusplus.com/reference/cstring/size_t/
Dim sizeVariant As Int32 = Marshal.SizeOf(GetType(Microsoft.VisualStudio.Package.Variant))
Dim ptrValue As IntPtr = Marshal.AllocHGlobal(sizeVariant)
memset(ptrValue, 0, sizeVariant) icmp6: 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); msi
uint valueSize = 1024;
var valueProductName = new string(new char[valueSize]);
MsiInterop.MsiGetProductInfo(code, MsiInstallerProperty.ProductName, valueProductName, ref valueSize);
uint valueSize = 1024;
var valueProductName = new string(new char[valueSize]);
MsiInterop.MsiGetProductInfo(code, MsiInstallerProperty.ProductName, valueProductName, ref valueSize);
public int dwFileHashInfoSize;
// Set the dwFileHashInfoSize to 20 i.e. 5*4
MSIFILEHASHINFO msifilehashinfo = new MSIFILEHASHINFO { dwFileHashInfoSize = 20 }; 10: MsiGetProperty int stringSize = 256; int value = MsiGetProperty(handle, "ProductVersion", out sb, ref stringSize);
static extern uint MsiProvideAssembly(string assembly, string context, uint mode, int info, System.Text.StringBuilder path, ref int pathSize); comctl3213: DoReaderMode
Dim cbSize As UInt32
Dim pnt As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(rect))
SetReaderModeInfo.cbSize = Marshal.SizeOf(SetReaderModeInfo) 14: ImageList_DrawEx
/// <param name="bounds">The bounds in which to draw the image. Set width and height to 0 to draw image at full size.</param>
static extern bool ImageList_GetIconSize(IntPtr himl, out int cx, out int cy);
Declare Function ImageList_GetIconSize Lib "comctl32.dll" (TODO) As TODO
Private Shared Function ImageList_GetIconSize(himl As IntPtr, ByRef cx As Integer, ByRef cy As Integer) As Boolean
ImageList_GetIconSize(himl,out iconWidth,out iconHeight);
static extern bool ImageList_GetIconSize(IntPtr himl, out int cx, out int cy);
Declare Function ImageList_GetIconSize Lib "comctl32.dll" (TODO) As TODO
ImageList_GetIconSize(himl,out iconWidth,out iconHeight);
static extern bool ImageList_SetIconSize(IntPtr hImageList, int cx, int cy);
Declare Function ImageList_SetIconSize Lib "comctl32.dll" (ByVal hImageList As IntPtr, ByVal cx As Integer, ByVal cy As Integer) As Boolean
/// <param name="bounds">The bounds in which to draw the image. Set width and height to 0 to draw image at full size.</param> 19: TaskDialog
public uint cbSize;
public uint cbSize; mapi3221: MAPISendMail
int size = Marshal.SizeOf(typeof(MapiFileDesc));
IntPtr intPtr = Marshal.AllocHGlobal(size);
ptr += size; 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 secur3225: GetUserNameEx
StringBuilder userName, ref int userNameSize);
userName As StringBuilder, ByRef userNameSize As Integer) As Integer
public static extern int GetUserNameEx (int nameFormat, StringBuilder userName, ref int userNameSize);
int userNameSize = userName.Capacity;
if(0 != GetUserNameEx((int)EXTENDED_NAME_FORMAT.NameSamCompatible, userName, ref userNameSize))
ByVal userName As System.Text.StringBuilder, ByRef userNameSize As Integer) As Integer
Dim userNameSize As Integer = UserName.Capacity
If GetUserNameExA(EXTENDED_NAME_FORMAT.NameSamCompatible, UserName, userNameSize) <> 0 Then
public SecBuffer(int bufferSize)
cbBuffer = bufferSize;
pvBuffer = Marshal.AllocHGlobal(bufferSize);
public SecBufferDesc(int bufferSize)
SecBuffer ThisSecBuffer = new SecBuffer(bufferSize);
pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));
pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));
pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SecBuffer)) * cBuffers);
int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
Marshal.WriteInt32(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer),ThisSecBuffer.BufferType);
Marshal.WriteIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer)+Marshal.SizeOf(ThisSecBuffer.BufferType),ThisSecBuffer.pvBuffer);
int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));
int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));
public struct SecPkgContext_Sizes
public uint cbBlockSize;
const int MAX_TOKEN_SIZE = 12288;
public const int SECPKG_ATTR_SIZES = 0;
out SecPkgContext_Sizes pContextAttributes);
SecBufferDesc ClientToken = new SecBufferDesc(MAX_TOKEN_SIZE);
SecBufferDesc ServerToken = new SecBufferDesc(MAX_TOKEN_SIZE);
SecPkgContext_Sizes ContextSizes = new SecPkgContext_Sizes();
if(QueryContextAttributes(ref EncryptionContext,SECPKG_ATTR_SIZES,out ContextSizes) != SEC_E_OK)
ThisSecHelper[1] = new MultipleSecBufferHelper(new byte[ContextSizes.cbSecurityTrailer],SecBufferType.SECBUFFER_TOKEN);
SecPkgContext_Sizes ContextSizes = new SecPkgContext_Sizes();
if(QueryContextAttributes(ref EncryptionContext,SECPKG_ATTR_SIZES,out ContextSizes) != SEC_E_OK)
ThisSecHelper[1] = new MultipleSecBufferHelper(new byte[ContextSizes.cbMaxSignature],SecBufferType.SECBUFFER_TOKEN);
public UInt32 Size;
iter = (IntPtr)((int)iter + Marshal.SizeOf(typeof(LUID))); //move the pointer forward 28: LsaLogonUser
[MarshalAs(UnmanagedType.ByValArray,SizeConst=8)] public byte[] SourceName;
UInt32 MinimumWorkingSetSize;
UInt32 MaximumWorkingSetSize;
_bufferLength = Marshal.SizeOf(typeof(KERB_S4U_LOGON)) + 2 * (clientUpnLen + clientRealmLen);
IntPtr curPtr = new IntPtr(_bufferContent.ToInt32()+Marshal.SizeOf(typeof(KERB_S4U_LOGON))); Retrieves information about a specified security package. This information includes the bounds on sizes of authentication information, credentials, and contexts. 30: TranslateName
int desiredFormat, StringBuilder translatedName, ref int userNameSize);
int desiredFormat, StringBuilder translatedName, ref int userNameSize);
int userNameSize = translatedName.Capacity;
translatedName, ref userNameSize)) ole32
/// be allocated with a size of zero. If hGlobal is NULL, CreateILockBytesOnHGlobal
/// internally allocates a new shared memory block of size zero.</param>
int SizeOfIstream = ByteSizeOfIPStreamInit(pPersistStream) * 2; // two bytes per value -- See my OleSaveToStream (ole32)
IntPtr nativePtr = Marshal.AllocHGlobal(SizeOfIstream); //buffer.Length); // allocate space on the native heap
Marshal.Copy(buffer, 0, nativePtr, SizeOfIstream); // copy byte array to native heap 34: OleCreate
int cObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,
int cPages, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,
UInt32 cObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,
UInt32 cPages, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID, 36: OleLoad
pStm.Read(data, sizeof(ushort), IntPtr.Zero);
pStm.Read(data, sizeof(ushort), IntPtr.Zero); 38: OleSave
public int ByteSizeOfIPStreamInit(IPersistStreamInit pPersistStream)
iSzOfStreamInBytes = IStreamSizeRead(IPtrStream);
public int IStreamSizeRead(IStream pOutStm)
pOutStm.Seek(0, 0, IntPtr.Zero);// Get size of the stream and read its contents to a byte array.
byte[] data = new byte[fileinfo.cbSize];
int sizeOfInt32 = Marshal.SizeOf(typeof(int));
IntPtr pRead = Marshal.AllocHGlobal(sizeOfInt32); 39: OleSaveToStream
public int ByteSizeOfIPStreamInit(IPersistStreamInit pPersistStream)
iSzOfStreamInBytes = IStreamSizeRead(IPtrStream);
public int IStreamSizeRead(IStream pOutStm)
pOutStm.Seek(0, 0, IntPtr.Zero);// Get size of the stream and read its contents to a byte array.
byte[] data = new byte[fileinfo.cbSize];
int sizeOfInt32 = Marshal.SizeOf(typeof(int));
IntPtr pRead = Marshal.AllocHGlobal(sizeOfInt32); Guids generated with this will return the name using the FmtIdToPropStgName Function, and can be used to generate a new IPropertyStorage interface with IPropertySetStorage.Create(). The name returned will be filled to 26 chars with the letter 'a' due to the fixed size of a Guid and the fact that we're passing all zeros in the BitArray after the name finishes to reach this size. 41: STGC Define the ulSectorSize member of the STGOPTIONS structure using type uint (which is 32-bits in C#) instead of ulong (which is 64-bits in C#). rpcrt442: UuidCreate
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=8)] gdiplus
int length, HandleRef fontFamily, int style, float emSize, 44: GdipComment
static extern int GdipComment(HandleRef graphics, int sizeData, byte[] data); 45: GdipEmfToWmfBits
/// <param name="_bufferSize">
/// The size of the buffer used to store the Windows Metafile bits returned
static extern IntPtr GdipEmfToWmfBits(HandleRef hEmf, uint uBufferSize,
ByVal bufferSize as UInteger, ByVal buffer() as byte, ByVal mappingMode as Integer, _ cards46: cdtDraw 47: cdtDrawExt mscorsn
out IntPtr minimalBuffer, out int minimalSize,
out IntPtr optionalBuffer, out int optionalSize,
out IntPtr refusedBuffer, out int refusedSize); Requires manual marshalling of parameters. The Size parameters refer to the length of the buffer in bytes, though the buffers contain Unicode characters.
int minSize, optSize, refSize;
out minBuf, out minSize,
out optBuf, out optSize,
out refBuf, out refSize);
string requestMinimum = Marshal.PtrToStringUni(minBuf, minSize/2); 49: StrongNameKeyGen
/// Generate a new key pair with the specified key size for strong name use
/// <param name="dwKeySize">desired key size</param>
/// <param name="pcbKeyBlob">[out] size of the generated blob</param>
wszKeyContainer, StrongNameKeyGenFlags dwFlags, int dwKeySize, /// Generate a new key pair with the specified key size for strong name use /// <param name="dwKeySize">desired key size</param> /// <param name="pcbKeyBlob">[out] size of the generated blob</param> public extern static bool StrongNameKeyGenEx([MarshalAs(UnmanagedType.LPWStr)]string wszKeyContainer, StrongNameKeyGenFlags dwFlags, int dwKeySize, Out IntPtr ppbKeyBlob, Out long pcbKeyBlob); misc51: Comments DWORD __stdcall CodecRead(int hRadio, void *Buf, DWORD Size); 52: FAQ For pointer-sized entities such as handles, they must be defined such that they will be 32 bits on a 32-bit machine and 64 bits on a 64-bit machine. IntPtr (or UIntPtr) accomplishes this. The use of int will appear to be fine if you only run the code on a 32-bit machine, but will likely cause your application/component to crash as soon as it gets on a 64-bit machine. mpr
public int dwOptDataSize;
ci.cbStructure = Marshal.SizeOf(ci); 54: WNetEnumResource
public static extern uint WNetEnumResource(IntPtr hEnum, ref int lpcCount, IntPtr lpBuffer, ref uint lpBufferSize);
Public Shared Function WNetEnumResource(hEnum As IntPtr, ByRef lpcCount As Integer, lpBuffer As IntPtr, ByRef lpBufferSize As UInteger) As UInteger
ref int lpBufferSize );
ptr += Marshal.SizeOf( nr );
Public Function WNetEnumResource(ByVal hEnum As IntPtr, ByRef lpcCount As Integer, ByVal lpBuffer As IntPtr, ByRef lpBufferSize As Integer) As Integer
ptr += Marshal.SizeOf(nr)
ptr += Marshal.SizeOf(nr)
ptr += Marshal.SizeOf(nr) If the call fails because the StringBuilder is not large enough, the call will return a value of 234, and the Length parameter will contain the required size. // Size for the buffer we will use int bsize=200; // Create a new stringbuilder, pre-sized as above StringBuilder rname = new StringBuilder(bsize); rc = WNetGetConnection("p:", rname, ref bsize); 56: WNetGetLastError
static extern TODO WNetGetLastErrorA(ref int lpError,ref string lpErrorBuf,int nErrorBufSize,string lpNameBuf,int nNameBufSize); Or you can initialize a stringbuilder with a given size: public static extern uint WNetGetLastError(ref int lpError,StringBuilder lpErrorBuf,int nErrorBufSize,StringBuilder lpNameBuf,int nNameBufSize); Declare Function WNetGetLastError Lib "mpr.dll" Alias "WNetGetLastErrorA" (ByRef lpError As Integer, ByVal lpErrorBuf As String, ByVal nErrorBufSize As Integer, ByVal lpNameBuf As String, ByVal nNameBufSize As Integer) As Integer
string lpBufferSize, credui
''' <param name="pcbPackedCredentials">The the size of the buffer.</param> To determine required buffer size, call first with pPackedCredentials = IntPtr.Zero. Should return error code 160, but pcbPackedCredentials will be populated with the expected buffer size. Use Marshal.AllocCoTaskMem() to allocate the appropriate buffer, then call again, this time passing the allocated buffer.
int inCredSize = 1024;
IntPtr inCredBuffer = Marshal.AllocCoTaskMem(inCredSize);
CredPackAuthenticationBuffer(0, username, password, inCredBuffer, ref inCredSize);
creditUI.cbSize = Marshal.SizeOf(creditUI);
creditUI.cbSize = Marshal.SizeOf(creditUI); Cut off search results after 60. Please refine your search. |