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