72 references to Kernel32
System.Private.CoreLib (72)
src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
82
return Interop.
Kernel32
.GetMessage(errorCode);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeWaitHandle.Windows.cs (1)
8
protected override bool ReleaseHandle() => Interop.
Kernel32
.CloseHandle(handle);
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (5)
18
while ((length = Interop.
Kernel32
.GetEnvironmentVariable(variable, ref builder.GetPinnableReference(), (uint)builder.Capacity)) > builder.Capacity)
37
uint length = Interop.
Kernel32
.GetEnvironmentVariable(variable, ref MemoryMarshal.GetReference(span), (uint)span.Length);
45
if (!Interop.
Kernel32
.SetEnvironmentVariable(variable, value))
84
char* stringPtr = Interop.
Kernel32
.GetEnvironmentStringsW();
129
Interop.BOOL success = Interop.
Kernel32
.FreeEnvironmentStringsW(stringPtr);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (2)
29
return Interop.
Kernel32
.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType | CAL_RETURN_NUMBER, IntPtr.Zero, 0, out data) != 0;
39
int ret = Interop.
Kernel32
.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType, (IntPtr)buffer, BUFFER_LENGTH, IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (20)
26
int ret = Interop.
Kernel32
.LCMapStringEx(cultureName, Interop.
Kernel32
.LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero);
34
ret = Interop.
Kernel32
.LCMapStringEx(null, Interop.
Kernel32
.LCMAP_HASH, &a, 1, &hashValue, sizeof(int), null, null, handle);
60
int ret = Interop.
Kernel32
.FindStringOrdinal(
140
int sortKeyLength = Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
162
if (Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
199
int result = Interop.
Kernel32
.CompareStringOrdinal(char1, count1, char2, count2, bIgnoreCase: true);
237
int result = Interop.
Kernel32
.CompareStringEx(
288
int result = Interop.
Kernel32
.FindNLSStringEx(
395
int sortKeyLength = Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
409
if (Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
494
actualSortKeyLength = Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
546
sortKeyLength = Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName,
574
return Interop.
Kernel32
.IsNLSDefinedString(Interop.
Kernel32
.COMPARE_STRING, 0, IntPtr.Zero, pText, text.Length);
624
Interop.
Kernel32
.NlsVersionInfoEx nlsVersion = default;
625
nlsVersion.dwNLSVersionInfoSize = sizeof(Interop.
Kernel32
.NlsVersionInfoEx);
626
Interop.
Kernel32
.GetNLSVersionEx(Interop.
Kernel32
.COMPARE_STRING, _sortName, &nlsVersion);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (27)
34
field |= Interop.
Kernel32
.LOCALE_RETURN_NUMBER;
44
return Interop.
Kernel32
.GetLocaleInfoEx(lpLocaleName, lcType, lpLCData, cchData);
72
lctype |= Interop.
Kernel32
.LOCALE_NOUSEROVERRIDE;
91
return GetLocaleInfoExInt(name, Interop.
Kernel32
.LOCALE_ICONSTRUCTEDLOCALE) != 1;
98
return ReescapeWin32String(GetLocaleInfoFromLCType(_sRealName, Interop.
Kernel32
.LOCALE_STIMEFORMAT, _bUseOverrides));
106
int result = GetLocaleInfoExInt(_sRealName, Interop.
Kernel32
.LOCALE_IFIRSTDAYOFWEEK | (!_bUseOverrides ? Interop.
Kernel32
.LOCALE_NOUSEROVERRIDE : 0));
126
Interop.
Kernel32
.EnumSystemLocalesEx(&EnumSystemLocalesProc, Interop.
Kernel32
.LOCALE_SPECIFICDATA | Interop.
Kernel32
.LOCALE_SUPPLEMENTAL, &context, IntPtr.Zero);
181
lctype |= Interop.
Kernel32
.LOCALE_NOUSEROVERRIDE;
354
string? regionName = GetLocaleInfoEx(cultureName, Interop.
Kernel32
.LOCALE_SISO3166CTRYNAME);
411
Interop.
Kernel32
.EnumTimeFormatsEx(&EnumTimeCallback, localeName, dwFlags, &data);
426
uint lcType = (dwFlags == Interop.
Kernel32
.TIME_NOSECONDS) ? Interop.
Kernel32
.LOCALE_SSHORTTIME : Interop.
Kernel32
.LOCALE_STIMEFORMAT;
449
return Interop.
Kernel32
.LocaleNameToLCID(cultureName, Interop.
Kernel32
.LOCALE_ALLOW_NEUTRAL_NAMES);
468
flags |= Interop.
Kernel32
.LOCALE_NEUTRALDATA | Interop.
Kernel32
.LOCALE_SPECIFICDATA;
474
flags |= Interop.
Kernel32
.LOCALE_NEUTRALDATA;
479
flags |= Interop.
Kernel32
.LOCALE_SPECIFICDATA;
484
flags |= Interop.
Kernel32
.LOCALE_SUPPLEMENTAL;
489
flags |= Interop.
Kernel32
.LOCALE_SUPPLEMENTAL;
497
Interop.
Kernel32
.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, flags, &context, IntPtr.Zero);
525
Interop.
Kernel32
.EnumSystemLocalesEx(&EnumAllSystemLocalesProc, Interop.
Kernel32
.LOCALE_REPLACEMENT, &context, IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (1)
25
int ret = Interop.
Kernel32
.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _textInfoName,
src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.Windows.cs (9)
12
private const uint AccessRights = (uint)Interop.
Kernel32
.MAXIMUM_ALLOWED | Interop.
Kernel32
.SYNCHRONIZE | Interop.
Kernel32
.EVENT_MODIFY_STATE;
25
uint eventFlags = initialState ? Interop.
Kernel32
.CREATE_EVENT_INITIAL_SET : 0;
27
eventFlags |= (uint)Interop.
Kernel32
.CREATE_EVENT_MANUAL_RESET;
29
SafeWaitHandle handle = Interop.
Kernel32
.CreateEventEx(IntPtr.Zero, name, eventFlags, AccessRights);
76
bool res = Interop.
Kernel32
.ResetEvent(SafeWaitHandle);
84
bool res = Interop.
Kernel32
.SetEvent(SafeWaitHandle);
92
return Interop.
Kernel32
.SetEvent(waitHandle);
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.Windows.cs (5)
13
private const uint AccessRights = (uint)Interop.
Kernel32
.MAXIMUM_ALLOWED | Interop.
Kernel32
.SYNCHRONIZE | Interop.
Kernel32
.SEMAPHORE_MODIFY_STATE;
30
SafeWaitHandle myHandle = Interop.
Kernel32
.CreateSemaphoreEx(IntPtr.Zero, initialCount, maximumCount, name, 0, AccessRights);
81
if (!Interop.
Kernel32
.ReleaseSemaphore(SafeWaitHandle!, releaseCount, out int previousCount))
src\System\Threading\Mutex.CoreCLR.Unix.cs (1)
75
if (!Interop.
Kernel32
.ReleaseMutex(SafeWaitHandle))