15 writes to Capacity
mscorlib (5)
system\environment.cs (3)
500blob.Capacity = currentSize; 529blob.Capacity = currentSize; 642blob.Capacity = requiredSize;
system\io\pathhelper.cs (1)
281sb.Capacity = m_capacity;
system\text\stringbuilder.cs (1)
325Capacity = capacity;
System (3)
compmod\system\componentmodel\MaskedTextProvider.cs (1)
451this.testString.Capacity = this.testString.Length;
compmod\system\componentmodel\Win32Exception.cs (1)
145sb.Capacity *= 4;
services\monitoring\system\diagnosticts\EventLog.cs (1)
1318buf.Capacity = buf.Capacity * 2;
System.Core (1)
System\Diagnostics\Eventing\Reader\NativeWrapper.cs (1)
363buffer.Capacity = buffUsed;
System.Data (2)
fx\src\data\System\Data\Odbc\Odbc32.cs (1)
751message.Capacity = cchActual+1;
fx\src\data\System\Data\SQLTypes\UnsafeNativeMethods.cs (1)
85buffer.Capacity = cchRequiredSize;
System.Management (2)
Instrumentation\MetaDataInfo.cs (2)
131sb.Capacity = 0; 133sb.Capacity = (int)cchName;
System.Windows.Forms (2)
winforms\Managed\System\WinForms\Control.cs (1)
2939sb.Capacity = len + 5;
winforms\Managed\System\WinForms\Help.cs (1)
215newPath.Capacity = (int)requiredStringSize;
134 references to Capacity
mscorlib (24)
microsoft\win32\win32native.cs (1)
746IntPtr.Zero, errorCode, 0, sb, sb.Capacity, IntPtr.Zero);
system\environment.cs (6)
632int requiredSize = Win32Native.GetEnvironmentVariable(variable, blob, blob.Capacity); 641while (requiredSize > blob.Capacity) { // need to retry since the environment variable might be changed 644requiredSize = Win32Native.GetEnvironmentVariable(variable, blob, blob.Capacity); 1398int size = sb.Capacity; 1568uint domainNameLen = (uint) domainName.Capacity; 1579domainNameLen = (uint) domainName.Capacity;
system\io\directory.cs (2)
1109if (Win32Native.GetCurrentDirectory(sb.Capacity, sb) == 0) 1117int r = Win32Native.GetLongPathName(currentDirectory, sb, sb.Capacity);
system\stubhelpers.cs (3)
1147StubHelpers.CheckStringLength(pManagedHome.Capacity); 1150int allocSize = (pManagedHome.Capacity * Marshal.SystemMaxDBCSCharSize) + 4; 1186int allocSize = (pManagedHome.Capacity * 2) + 4;
system\text\stringbuilder.cs (10)
252info.AddValue(CapacityField, Capacity); 300if (Capacity != value) { 324if (Capacity < capacity) 326return Capacity; 472int originalCapacity = Capacity; 478Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 510Contract.Assert(Capacity >= originalCapacity, "setting the Length should never decrease the Capacity"); 1494if (Capacity != sb.Capacity || MaxCapacity != sb.MaxCapacity || Length != sb.Length) 1964Contract.Requires(Capacity == Length, "Expand expect to be called only when there is no space left"); // We are currently full
system\text\stringbuildercache.cs (2)
59if(capacity <= sb.Capacity) 72if (sb.Capacity <= MAX_BUILDER_SIZE)
PresentationCore (4)
Core\CSharp\System\Windows\Automation\Peers\GenericRootAutomationPeer.cs (1)
60UnsafeNativeMethods.GetWindowText(new HandleRef(null, hwnd), sb, sb.Capacity);
Core\CSharp\System\Windows\DataFormats.cs (1)
412if (UnsafeNativeMethods.GetClipboardFormatName(id, sb, sb.Capacity) == 0)
Core\CSharp\System\Windows\DataObject.cs (1)
3526if (UnsafeNativeMethods.DragQueryFile(new HandleRef(this, hdrop), i, sb, sb.Capacity) != 0)
Core\CSharp\System\Windows\Media\GlyphsSerializer.cs (1)
79* _glyphStringBuider.Capacity
PresentationFramework (18)
src\Framework\Microsoft\Win32\FileDialog.cs (1)
1774sb.Capacity /* max # of chars to copy before truncation occurs */
src\Framework\MS\Internal\AppModel\ShellProvider.cs (1)
995HRESULT hr = NativeMethods2.SHGetFolderPathEx(ref knownFolder, 0, IntPtr.Zero, pathBuilder, (uint)pathBuilder.Capacity);
src\Framework\MS\Win32\UxThemeWrapper.cs (2)
268if (UnsafeNativeMethods.GetCurrentThemeName(themeNameSB, themeNameSB.Capacity, 269themeColorSB, themeColorSB.Capacity,
src\Framework\System\Windows\Automation\Peers\WindowAutomationPeer.cs (1)
52UnsafeNativeMethods.GetWindowText(new HandleRef(null, window.CriticalHandle), sb, sb.Capacity);
src\Framework\System\Windows\Shell\JumpList.cs (7)
1169shellLink.GetPath(pathBuilder, pathBuilder.Capacity, null, SLGP.RAWPATH); 1171shellLink.GetArguments(argsBuilder, argsBuilder.Capacity); 1173shellLink.GetDescription(descBuilder, descBuilder.Capacity); 1176shellLink.GetIconLocation(iconBuilder, iconBuilder.Capacity, out iconIndex); 1178shellLink.GetWorkingDirectory(dirBuilder, dirBuilder.Capacity); 1218shellLink.GetPath(pathBuilder, pathBuilder.Capacity, null, SLGP.RAWPATH); 1234shellLink.GetArguments(argsBuilder, argsBuilder.Capacity);
src\Framework\System\Windows\Standard\NativeMethods.cs (6)
3009_GetCurrentThemeName(fileNameBuilder, fileNameBuilder.Capacity, 3010colorBuilder, colorBuilder.Capacity, 3011sizeBuilder, sizeBuilder.Capacity) 3053int size = _GetModuleFileName(hModule, buffer, buffer.Capacity); 3061if (size == buffer.Capacity) 3064buffer.EnsureCapacity(buffer.Capacity * 2);
System (15)
compmod\microsoft\win32\SystemEvents.cs (1)
1255UnsafeNativeMethods.GetModuleFileName(NativeMethods.NullHandleRef, sb, sb.Capacity);
compmod\system\componentmodel\Win32Exception.cs (2)
99IntPtr.Zero, (uint) error, 0, sb, sb.Capacity + 1, 148while (sb.Capacity < MaxAllowedBufferSize);
compmod\system\security\permissions\ResourcePermissionBase.cs (1)
78int len = sb.Capacity;
net\System\Net\DNS.cs (1)
1209hostname.Capacity,
security\system\security\cryptography\x509\x509utils.cs (1)
599(uint)strMessage.Capacity,
services\monitoring\system\diagnosticts\EventLog.cs (2)
1312buf.Capacity, 1318buf.Capacity = buf.Capacity * 2;
services\monitoring\system\diagnosticts\FileVersionInfo.cs (1)
343UnsafeNativeMethods.VerLanguageName( langid, lang, lang.Capacity );
services\monitoring\system\diagnosticts\PerformanceCounterLib.cs (1)
84SafeNativeMethods.GetComputerName(sb, new int[] {sb.Capacity});
services\monitoring\system\diagnosticts\Process.cs (1)
459NativeMethods.GetWindowText(new HandleRef(this, handle), builder, builder.Capacity);
services\monitoring\system\diagnosticts\ProcessManager.cs (3)
322SafeNativeMethods.GetComputerName(sb, new int[] {sb.Capacity}); 676ret = NativeMethods.GetModuleBaseName(processHandle, new HandleRef(null, moduleHandle), baseName, baseName.Capacity * 2); 681ret = NativeMethods.GetModuleFileNameEx(processHandle, new HandleRef(null, moduleHandle), fileName, fileName.Capacity * 2);
sys\system\io\ports\InternalResources.cs (1)
40IntPtr.Zero, (uint) errorCode, 0, sb, sb.Capacity, null);
System.Configuration (3)
System\Configuration\ClientConfigPaths.cs (3)
118while (((length = UnsafeNativeMethods.GetModuleFileName(new HandleRef(null, IntPtr.Zero), sb, sb.Capacity)) == sb.Capacity) 120&& sb.Capacity < MAX_UNICODESTRING_LEN) {
System.Core (4)
Microsoft\Win32\UnsafeNativeMethods.cs (1)
261UnsafeNativeMethods.NULL, errorCode, 0, sb, sb.Capacity, UnsafeNativeMethods.NULL);
System\Diagnostics\Eventing\Reader\NativeWrapper.cs (2)
357bool status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Capacity, buffer, out buffUsed, out propCount); 364status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Capacity, buffer, out buffUsed, out propCount);
System\IO\Pipes\Pipe.cs (1)
872UnsafeNativeMethods.NULL, UnsafeNativeMethods.NULL, userName, userName.Capacity)) {
System.Data (11)
fx\src\data\System\Data\Common\AdapterUtil.cs (1)
2092length = buffer.Capacity;
fx\src\data\System\Data\Odbc\Odbc32.cs (1)
750if ((RetCode.SUCCESS_WITH_INFO == retcode) && (message.Capacity-1 < cchActual)) {
fx\src\data\System\Data\Odbc\OdbcHandle.cs (2)
182checked((short)(2*sb.Capacity)), // expects number of bytes, see \\kbinternal\kb\articles\294\1\69.HTM 197ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetDiagRecW(HandleType, this, record, sb, out nativeError, message, checked((short)message.Capacity), out cchActual);
fx\src\data\System\Data\SqlClient\LocalDBAPI.cs (2)
192UInt32 len = (UInt32)buffer.Capacity; 204len = (UInt32) buffer.Capacity;
fx\src\data\System\Data\SQLTypes\UnsafeNativeMethods.cs (5)
79int cchRequiredSize = GetFullPathName(path, buffer.Capacity, buffer, IntPtr.Zero); 82if (cchRequiredSize > buffer.Capacity) 86cchRequiredSize = GetFullPathName(path, buffer.Capacity, buffer, IntPtr.Zero); 111Debug.Assert(cchRequiredSize <= buffer.Capacity, string.Format( 115buffer.Capacity));
System.Data.SqlXml (4)
System\Xml\Xsl\Runtime\XsltFunctions.cs (4)
357int res = GetDateFormat(locale, 0, ref st, format, sb, sb.Capacity); 362res = GetDateFormat(locale, 0, ref st, format, sb, sb.Capacity); 366int res = GetTimeFormat(locale, 0, ref st, format, sb, sb.Capacity); 371res = GetTimeFormat(locale, 0, ref st, format, sb, sb.Capacity);
System.IO.Log (2)
System\IO\Log\LogArchiveSnapshot.cs (1)
39baseLogFileName.Capacity,
System\IO\Log\UnsafeNativeMethods.cs (1)
109builder.Capacity,
System.Management (2)
Instrumentation\MetaDataInfo.cs (2)
132importInterface.GetScopeProps(sb, (UInt32)sb.Capacity, out cchName, out mvid); 134importInterface.GetScopeProps(sb, (UInt32)sb.Capacity, out cchName, out mvid);
System.Messaging (2)
System\Messaging\MessageQueue.cs (1)
456SafeNativeMethods.GetComputerName(sb, new int[] { sb.Capacity });
System\Messaging\MessageQueueException.cs (1)
89IntPtr.Zero, error, 0, sb, sb.Capacity + 1, IntPtr.Zero);
System.Runtime.Remoting (1)
channels\ipc\ipcport.cs (1)
178NativePipe.NULL, errorCode, 0, sb, sb.Capacity, NativePipe.NULL);
System.ServiceModel (3)
System\ServiceModel\Channels\PipeConnection.cs (1)
2890IntPtr.Zero, error, CultureInfo.CurrentCulture.LCID, stringBuilder, stringBuilder.Capacity, IntPtr.Zero) != 0)
System\ServiceModel\MsmqException.cs (2)
177stringBuilder.Capacity, 192stringBuilder.Capacity,
System.Web (8)
Configuration\MetabaseServerConfig.cs (7)
355int r = UnsafeNativeMethods.IsapiAppHostGetSiteName(appID, sb, sb.Capacity); 368int r = UnsafeNativeMethods.IsapiAppHostGetSiteId(siteName, sb, sb.Capacity); 388r = UnsafeNativeMethods.IsapiAppHostMapPath(appID, path, sb, sb.Capacity); 424int r = UnsafeNativeMethods.IsapiAppHostGetNextVirtualSubdir(aboPath, inApp, ref index, sb, sb.Capacity); 440int r = UnsafeNativeMethods.IsapiAppHostGetUncUser(aboPath, usr, usr.Capacity, pwd, pwd.Capacity); 459int r = UnsafeNativeMethods.IsapiAppHostGetAppPath(aboPath, buf, buf.Capacity);
Security\ADMembershipProvider.cs (1)
43990, (int)temp, 0, sb, sb.Capacity + 1, 0);
System.Windows.Forms (28)
winforms\Managed\System\WinForms\Control.cs (3)
2938if (len > sb.Capacity) { 2941UnsafeNativeMethods.GetClassName(new HandleRef(null, lastParentHandle), sb, sb.Capacity); 4546UnsafeNativeMethods.GetWindowText(new HandleRef(window, Handle), sb, sb.Capacity);
winforms\Managed\System\WinForms\DataFormats.cs (1)
265if (0 == SafeNativeMethods.GetClipboardFormatName(id, s, s.Capacity)) {
winforms\Managed\System\WinForms\FileDialog.cs (1)
212UnsafeNativeMethods.GetWindowText(new HandleRef(this, dialogHWnd), sb, sb.Capacity);
winforms\Managed\System\WinForms\InputLanguage.cs (1)
317uint res = UnsafeNativeMethods.SHLoadIndirectString(layoutDisplayName, sb, (uint)sb.Capacity, IntPtr.Zero);
winforms\Managed\System\WinForms\Printing\PageSetupDialog.cs (1)
374int result = UnsafeNativeMethods.GetLocaleInfo(NativeMethods.LOCALE_USER_DEFAULT,NativeMethods.LOCALE_IMEASURE, sb,sb.Capacity);
winforms\Managed\System\WinForms\SystemInformation.cs (2)
1100UnsafeNativeMethods.GetComputerName(sb, new int[] {sb.Capacity}); 1163UnsafeNativeMethods.GetUserName(sb, new int[] {sb.Capacity});
winforms\Managed\System\WinForms\UnsafeNativeMethods.cs (7)
369if (null != lpszFile && 0 != lpszFile.Capacity && iFile != unchecked((int)0xFFFFFFFF)) 375if ((resultValue = DragQueryFile(hDrop, iFile, lpszFile, lpszFile.Capacity)) == lpszFile.Capacity) 396return DragQueryFile(hDrop, iFile, lpszFile, lpszFile.Capacity); 532while (((length = GetModuleFileName(hModule, buffer, buffer.Capacity)) == buffer.Capacity) 534&& buffer.Capacity < NativeMethods.MAX_UNICODESTRING_LEN)
winforms\Managed\System\WinForms\VisualStyles\VisualStyleInformation.cs (10)
71SafeNativeMethods.GetCurrentThemeName(filename, filename.Capacity, null, 0, null, 0); 87SafeNativeMethods.GetCurrentThemeName(null, 0, colorScheme, colorScheme.Capacity, null, 0); 103SafeNativeMethods.GetCurrentThemeName(null, 0, null, 0, size, size.Capacity); 119SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.DisplayName, name, name.Capacity); 135SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Company, company, company.Capacity); 151SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Author, author, author.Capacity); 167SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Copyright, copyright, copyright.Capacity); 185SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Url, url, url.Capacity); 201SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Version, version, version.Capacity); 217SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Description, description, description.Capacity);
winforms\Managed\System\WinForms\VisualStyles\VisualStyleRenderer.cs (2)
656lastHResult = SafeNativeMethods.GetThemeFilename(new HandleRef(this, Handle), part, state, (int)prop, filename, filename.Capacity); 855lastHResult = SafeNativeMethods.GetThemeString(new HandleRef(this, Handle), part, state, (int)prop, aString, aString.Capacity);
UIAutomationClientsideProviders (2)
MS\Internal\AutomationProxies\Misc.cs (1)
1189ProxySendMessage(hwnd, NativeMethods.WM_GETTEXT, (IntPtr)str.Capacity, str);
MS\Internal\AutomationProxies\WindowsAltTab.cs (1)
260cchItemText = (uint)itemText.Capacity;
WindowsBase (3)
Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (3)
483int size = IntGetModuleFileName(hModule, buffer, buffer.Capacity); 491if (size == buffer.Capacity) 494buffer.EnsureCapacity(buffer.Capacity * 2);