Desktop Functions: Smart Device Functions:
|
Search Results for "StringBuilder" in [All]oleacc1: GetRoleText
public static extern uint GetRoleText( uint dwRole, [Out] StringBuilder lpszRole, uint cchRoleMax);
Private Shared Function GetRoleText(ByVal role As Integer, ByVal outRole As StringBuilder, ByVal outRoleSize As Integer) As Integer 2: GetStateText
public static extern uint GetStateText( uint dwStateBit, [Out] StringBuilder lpszStateBit, uint cchStateBitMax ); userenv
StringBuilder testData = new StringBuilder("");
static extern int CreateProfile( [MarshalAs(UnmanagedType.LPWStr)] String pszUserSid, [MarshalAs(UnmanagedType.LPWStr)] String pszUserName, [Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszProfilePath, uint cchProfilePath);
System.Text.StringBuilder s= new System.Text.StringBuilder(260);
public static extern int CreateProfile([MarshalAs(UnmanagedType.LPWStr)] String pszUserSid, [MarshalAs(UnmanagedType.LPWStr)] String pszUserName, [Out, MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszProfilePath, uint cchProfilePath);
$ProfilePath = New-Object System.Text.StringBuilder($intSizeOfProfilePath)
static extern bool GetProfilesDirectory(StringBuilder path, ref int size);
StringBuilder path = new StringBuilder(4*1024); mapi326: MAPIFindNext
string lpszSeedMessageID, uint flFlags, uint ulReserved, StringBuilder lpszMessageID); hid
StringBuilder Buffer,
ByVal Buffer As System.Text.StringBuilder, _ Use of StringBuilder to create a variable to obtain the Manufacturer string instead of using MarshalAs. This approach is cleaner and doesn't require defining a Struct.
StringBuilder manufacturerString = new StringBuilder(128); winfax
[Out] StringBuilder buffer, out int BufferSize,
[Out] StringBuilder RoutingInfoBuffer, out int RoutingInfoBufferSize);
[Out] StringBuilder RoutingInfoBuffer, int RoutingInfoBufferSize); credui
StringBuilder user,
StringBuilder domain,
StringBuilder userBuilder = new StringBuilder();
StringBuilder domainBuilder = new StringBuilder();
StringBuilder userName,
StringBuilder password,
byval UserName as StringBuilder, _
byval password AS StringBuilder, _
StringBuilder user = new StringBuilder(MAX_USER_NAME);
StringBuilder pwd = new StringBuilder(MAX_PASSWORD);
StringBuilder userName,
StringBuilder password,
byref UserName as StringBuilder, _
byref password AS StringBuilder, _
StringBuilder user = new StringBuilder(MAX_USER_NAME);
StringBuilder pwd = new StringBuilder(MAX_PASSWORD);
private static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, uint cbAuthBuffer, StringBuilder pszUserName, ref int pcchMaxUserName, StringBuilder pszDomainName, ref int pcchMaxDomainame, StringBuilder pszPassword, ref int pcchMaxPassword);
ByVal pszUserName As StringBuilder, ByRef pcchMaxUserName As UInt32, _
ByVal pszDomainName As StringBuilder, ByRef pcchMaxDomainName As UInt32, _
ByVal pszPassword As StringBuilder, ByRef pcchMaxPassword As UInt32) As <MarshalAs(UnmanagedType.Bool)> Boolean
private static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, uint cbAuthBuffer, StringBuilder pszUserName, ref int pcchMaxUserName, StringBuilder pszDomainName, ref int pcchMaxDomainame, StringBuilder pszPassword, ref int pcchMaxPassword);
var usernameBuf = new StringBuilder(100);
var passwordBuf = new StringBuilder(100);
var domainBuf = new StringBuilder(100); kernel3215: ConsoleFunctions
out StringBuilder TargetBuffer,
StringBuilder[] lpTargetBuffer,
out StringBuilder ExeNameBuffer,
out StringBuilder ConsoleTitle,
[Out] StringBuilder lpConsoleTitle,
[Out] StringBuilder lpBuffer,
[Out] StringBuilder lpCharacter,
[Out] StringBuilder ComputerName, ref uint nSize);
StringBuilder data = new StringBuilder(500);
StringBuilder data = new StringBuilder(500);
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);
public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);
StringBuilder data = new StringBuilder(500);
StringBuilder data = new StringBuilder(500);
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);
public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);
public static extern int ExpandEnvironmentStrings([MarshalAs(UnmanagedType.LPTStr)] String source, [Out] StringBuilder destination, int size);
<MarshalAs(UnmanagedType.LPTStr)>lpDst As System.Text.StringBuilder, _ 20: FindFirstVolume
static extern IntPtr FindFirstVolume([Out] StringBuilder lpszVolumeName,
Declare Function FindFirstVolumeW Lib "kernel32.dll" (ByVal lpszVolumeName As System.Text.StringBuilder, ByVal cchBufferLength As UInteger) As IntPtr
static extern FindVolumeSafeHandle FindFirstVolume([Out] StringBuilder lpszVolumeName, uint cchBufferLength);
static extern bool FindNextVolume(FindVolumeSafeHandle hFindVolume, [Out] StringBuilder lpszVolumeName, uint cchBufferLength);
StringBuilder volume = new StringBuilder((int)bufferLength, (int)bufferLength); 21: FindNextVolume
static extern bool FindNextVolume(IntPtr hFindVolume, [Out] StringBuilder
uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer,
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, 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
StringBuilder msgBuilder = new StringBuilder(101); 23: FormatMessage
uint dwMessageId, uint dwLanguageId, [Out] StringBuilder lpBuffer,
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, 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
StringBuilder msgBuilder = new StringBuilder(101);
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder sbAppUserModelID);
StringBuilder sbName = new StringBuilder((int)cchLen);
sbName = new StringBuilder((int)cchLen); 25: GetAtomName
static extern uint GetAtomName(ushort nAtom, [Out] StringBuilder lpBuffer, int nSize); 26: 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);
StringBuilder name = new StringBuilder(260);
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);
StringBuilder name = new StringBuilder(260);
out StringBuilder ExeNameBuffer,
StringBuilder lpConsoleTitle, 30: GetConsoleTitle
StringBuilder lpConsoleTitle,
[MarshalAs(UnmanagedType.LPWStr)] StringBuilder sbAppUserModelID);
[Out] StringBuilder lpBuffer); static extern uint GetCurrentDirectoryW(uint nBufferLength, StringBuilder lpBuffer); StringBuilder nameBuffer = new StringBuilder((int)MAX_DEEP_PATH + 3); 33: GetDateFormat
static extern int GetDateFormat(uint locale, uint dwFlags, ref SystemTime date, string format, StringBuilder sb, int sbSize);
string lpFormat, StringBuilder lpDateStr, int cchDate
StringBuilder sb = new StringBuilder(format.Length + 16);
sb = new StringBuilder(res);
[Out] StringBuilder lpBuffer, uint nSize); 35: GetFullPathName
[Out] StringBuilder lpBuffer, out StringBuilder lpFilePart);
Shared Function GetFullPathName(ByVal lpFileName As String, ByVal nBufferLength As Int32, <Out()> ByVal lpBuffer As System.Text.StringBuilder, <Out()> ByVal lpFilePart As System.Text.StringBuilder) As Int32
StringBuilder sbFull = new StringBuilder(bufsz); // Full resolved path will go here
StringBuilder sbFile = new StringBuilder(bufsz); // Filename will go here
sbFull = new StringBuilder(bufsz); // Re-create objects w/ proper size
sbFile = new StringBuilder(bufsz); // " 36: GetLocaleInfo
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);
StringBuilder data = new StringBuilder(500);
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData); 37: GetLocaleInfoEx
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData);
StringBuilder data = new StringBuilder(500);
public static extern int GetLocaleInfoEx(String lpLocaleName, LCTYPE LCType, StringBuilder lpLCData, int cchData); 38: GetLogicalDrives DO NOT define using a StringBuilder, because only the first string would be returned.
static extern uint GetLogicalDriveStrings(uint bufferLength, [Out] StringBuilder buffer);
// [Out] StringBuilder lpBuffer); --- Don't do this!
// if we were to use the StringBuilder, only the first string would be returned 40: GetLongPathName
StringBuilder lpszLongPath,
StringBuilder builder = new StringBuilder(255);
builder = new StringBuilder(result);
StringBuilder lpFilename,
Public Function GetModuleFileName(<[In]()> ByVal hModule As IntPtr, <Out()> ByVal lpFilename As StringBuilder, <[In]()> <MarshalAs(UnmanagedType.U4)> ByVal nSize As Integer) As UInteger
StringBuilder fileName = new StringBuilder(255);
Dim sb As New StringBuilder
Dim sb As New StringBuilder
StringBuilder lpReturnedString,
ByVal lpReturnedString As StringBuilder, _
StringBuilder^ lpReturnedString, To avoid casting of the StringBuilder.Capacity to uint you can also declare the nSize parameter as int. If you need to get all the section names by passing a null lpAppName or all the key names by passing a null lpKeyName, then you'll need to use a technique like is shown for [GetPrivateProfileSection] to handle the double null-terminated result. .NET's marshaler will truncate the StringBuilder at the first null it finds, so to get back the full double null-terminated result string, you have to manage your own memory buffer. An alternative to the technique above is to use a char[] in place of a StringBuilder when you need to obtain all key names or all section names. The char[] will not truncate at the first null it finds.
StringBuilder sb = new StringBuilder(500);
string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);
ByVal lpReturnedString As StringBuilder, _
Dim sb As StringBuilder
sb = New StringBuilder(500) 45: GetShortPathName
StringBuilder lpszShortPath,
static extern int GetShortPathName(string pathName, System.Text.StringBuilder shortName, int cbShortName);
<MarshalAs(UnmanagedType.LPTStr)> ByVal ShortPath As System.Text.StringBuilder, _
Declare Unicode Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameW" (ByVal longPath As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal ShortPath As System.Text.StringBuilder, <MarshalAs(UnmanagedType.U4)> ByVal bufferSize As Integer) As Integer
System::Text::StringBuilder^ lpszShortPath,
// don´t allocate stringbuilder here but outside of the function for fast access
StringBuilder shortNameBuffer = new StringBuilder((int)bufferSize);
var sb = new StringBuilder(sz + 1);
ByVal ShortPath As System.Text.StringBuilder, _
Dim sb As New System.Text.StringBuilder(1024)
static extern uint GetSystemDirectory([Out] StringBuilder lpBuffer,
Public Function GetSystemDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _
StringBuilder sbSystemDir = new StringBuilder(256);
StringBuilder pwszLanguagesBuffer,
StringBuilder languagesBuffer = new StringBuilder();
public static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
private static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
var buffer = new StringBuilder(260); // MAX_PATH 49: GetTempFileName
uint uUnique, [Out] StringBuilder lpTempFileName);
static extern uint GetTempFileName(string lpPathName, string lpPrefixString, uint uUnique, [Out] StringBuilder lpTempFileName);
StringBuilder sb = new StringBuilder(260); 50: GetTempPath
[Out] StringBuilder lpBuffer);
<Out> lpBuffer As StringBuilder) As Integer
Dim tempPath As New StringBuilder(MAX_PATH - 14)
Dim tempName As New StringBuilder(MAX_PATH)
Dim shortPath As New StringBuilder(TempFile.MAX_PATH) 51: GetTimeFormat
static extern int GetTimeFormat(uint locale, uint dwFlags, ref SystemTime time, string format, StringBuilder sb, int sbSize);
StringBuilder pwszLanguagesBuffer,
StringBuilder languagesBuffer = new StringBuilder();
StringBuilder volumeNameBuffer,
StringBuilder fileSystemNameBuffer,
ByVal VolumeNameBuffer As System.Text.StringBuilder, _
ByVal FileSystemNameBuffer As System.Text.StringBuilder, _
StringBuilder volname = new StringBuilder(261);
StringBuilder fsname = new StringBuilder(261);
Dim volname As New System.Text.StringBuilder(MAX_PATH + 1)
Dim fsname As New System.Text.StringBuilder(MAX_PATH + 1)
lpszVolumeMountPoint, [Out] StringBuilder lpszVolumeName,
StringBuilder sb = new StringBuilder(MaxVolumeNameLength); The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test. Updated: VB code now uses IntPtr instead of StringBuilder - see sample below Using StringBuilder for the buffer does not work since this function returns the names as a bunch of strings separated by the null character ('\0'). So StringBuilder would only report the first item. Therefore we store it in a char array, which can later be converted to a bunch of strings.
' Have to use Pointer to return pathnames, StringBuilder only returns first NULL-terminated string The VB Code was generated by the tool at http://clrinterop.codeplex.com/releases/view/14120. I believe this to be the same tool referenced at http://blogs.msdn.com/b/vbteam/archive/2008/03/14/making-pinvoke-easy.aspx. The StringBuilder limitation appears to apply to this code as well, and it will only return the first path/mountpoint found, but the method does work inside that limitation. I will post updated code as soon as I code and test. Updated: VB code now uses IntPtr instead of StringBuilder - see sample below Using StringBuilder for the buffer does not work since this function returns the names as a bunch of strings separated by the null character ('\0'). So StringBuilder would only report the first item. Therefore we store it in a char array, which can later be converted to a bunch of strings.
' Have to use Pointer to return pathnames, StringBuilder only returns first NULL-terminated stgring
static extern uint GetWindowsDirectory(StringBuilder lpBuffer,
Public Function GetWindowsDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _
Dim sb As StringBuilder =new StringBuilder(100)
StringBuilder sb = new StringBuilder(MaxPathLength);
StringBuilder sb =new StringBuilder(100);
static extern uint GlobalGetAtomName(ushort nAtom, StringBuilder lpBuffer, int nSize);
static extern uint GlobalGetAtomName(ushort nAtom, StringBuilder lpBuffer, int nSize);
StringBuilder AtomName = new StringBuilder(nSize); 59: LCIDToLocaleName
public static extern int LCIDToLocaleName(uint Locale, StringBuilder lpName, int cchName, int dwFlags);
StringBuilder data = new StringBuilder(500); 60: lstrcat
static extern IntPtr lstrcat(StringBuilder lpString1, string lpString2);
static extern IntPtr lstrcat(StringBuilder lpString1, string lpString2);
StringBuilder aString = new StringBuilder(); [System.Text.StringBuilder] Cut off search results after 60. Please refine your search. |