78 references to NativeMethods
Microsoft.AspNetCore.Server.IIS (78)
Core\IISHttpContext.cs (19)
82
: base((HTTP_REQUEST_V1*)
NativeMethods
.HttpGetRawRequest(pInProcessHandler), useLatin1: useLatin1)
317
NativeMethods
.HttpSetManagedContext(_requestNativeHandle, (IntPtr)_thisHandle);
424
var statusCode =
NativeMethods
.HttpQueryRequestProperty(
434
if (statusCode ==
NativeMethods
.HR_OK)
447
var statusCode =
NativeMethods
.HttpQueryRequestProperty(
457
return statusCode ==
NativeMethods
.HR_OK ? Marshal.PtrToStructure<HTTP_REQUEST_PROPERTY_SNI>((IntPtr)pBuffer) : default;
597
NativeMethods
.HttpHasResponse4(_requestNativeHandle);
606
NativeMethods
.HttpSetResponseStatusCode(_requestNativeHandle, (ushort)StatusCode, reasonPhrase);
613
NativeMethods
.HttpSetNeedGoAway(_requestNativeHandle);
647
NativeMethods
.HttpResponseSetUnknownHeader(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst);
652
NativeMethods
.HttpResponseSetKnownHeader(_requestNativeHandle, knownHeaderIndex, pHeaderValue, (ushort)headerValueBytes.Length, fReplace: isFirst);
686
NativeMethods
.HttpResponseSetTrailer(_requestNativeHandle, pHeaderName, pHeaderValue, (ushort)headerValueBytes.Length, replace: isFirst);
814
public void PostCompletion(
NativeMethods
.REQUEST_NOTIFICATION_STATUS requestNotificationStatus)
816
NativeMethods
.HttpSetCompletionStatus(_requestNativeHandle, requestNotificationStatus);
817
NativeMethods
.HttpPostCompletion(_requestNativeHandle, 0);
870
NativeMethods
.HttpGetAuthenticationInformation(_requestNativeHandle, out var authenticationType, out var token);
923
private static
NativeMethods
.REQUEST_NOTIFICATION_STATUS ConvertRequestCompletionResults(bool success)
925
return success ?
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_CONTINUE
926
:
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_FINISH_REQUEST;
Core\IISHttpContext.FeatureCollection.cs (4)
294
return
NativeMethods
.HttpTryGetServerVariable(_requestNativeHandle, variableName, out var value) ? value : null;
306
NativeMethods
.HttpSetServerVariable(_requestNativeHandle, variableName, value);
502
NativeMethods
.HttpResetStream(_requestNativeHandle, (ulong)errorCode);
507
NativeMethods
.HttpDisableBuffering(_requestNativeHandle);
Core\IISHttpContext.IO.cs (1)
292
NativeMethods
.HttpCloseConnection(_requestNativeHandle);
Core\IISHttpServer.cs (10)
52
_websocketAvailable =
NativeMethods
.HttpTryGetServerVariable(pInProcessHandler, WebSocketVersionString, out var webSocketsSupported)
110
var iisConfigData =
NativeMethods
.HttpGetApplicationProperties();
151
private static
NativeMethods
.REQUEST_NOTIFICATION_STATUS HandleRequest(IntPtr pInProcessHandler, IntPtr pvRequestContext)
162
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_FINISH_REQUEST;
172
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_PENDING;
178
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_FINISH_REQUEST;
229
private static
NativeMethods
.REQUEST_NOTIFICATION_STATUS OnAsyncCompletion(IntPtr pvManagedHttpContext, int hr, int bytes)
239
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_FINISH_REQUEST;
243
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_PENDING;
249
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_FINISH_REQUEST;
Core\IISNativeApplication.cs (5)
23
NativeMethods
.HttpStopIncomingRequests(_nativeApplication);
39
NativeMethods
.HttpStopCallsIntoManaged(_nativeApplication);
48
delegate* unmanaged<IntPtr, IntPtr,
NativeMethods
.REQUEST_NOTIFICATION_STATUS> requestCallback,
51
delegate* unmanaged<IntPtr, int, int,
NativeMethods
.REQUEST_NOTIFICATION_STATUS> asyncCallback,
58
NativeMethods
.HttpRegisterCallbacks(
Core\IO\AsyncIOEngine.cs (4)
124
ioOperation.Complete(
NativeMethods
.ERROR_OPERATION_ABORTED, 0);
137
NativeMethods
.HttpTryCancelIO(_handler);
188
nextContinuation = next.Complete(
NativeMethods
.ERROR_OPERATION_ABORTED, 0);
216
NativeMethods
.HttpTryCancelIO(_handler);
Core\IO\AsyncIOEngine.Flush.cs (1)
33
hr =
NativeMethods
.HttpFlushResponseBytes(_requestHandler, _moreData, out var fCompletionExpected);
Core\IO\AsyncIOEngine.Read.cs (2)
37
hr =
NativeMethods
.HttpReadRequestBytes(
64
protected override bool IsSuccessfulResult(int hr) => hr ==
NativeMethods
.ERROR_HANDLE_EOF;
Core\IO\AsyncIOEngine.Write.cs (1)
22
return
NativeMethods
.HttpWriteResponseBytes(requestHandler, dataChunks, chunkCount, out completionExpected);
Core\IO\AsyncIOOperation.cs (2)
98
if (hr !=
NativeMethods
.ERROR_OPERATION_ABORTED)
101
if (hr !=
NativeMethods
.HR_OK && !IsSuccessfulResult(hr))
Core\IO\WebSocketsAsyncIOEngine.cs (2)
70
NativeMethods
.HttpEnableWebsockets(_handler);
122
NativeMethods
.HttpTryCancelIO(_handler);
Core\IO\WebSocketsAsyncIOEngine.Initialize.cs (1)
29
hr =
NativeMethods
.HttpFlushResponseBytes(_requestHandler, fMoreData: true, out var completionExpected);
Core\IO\WebSocketsAsyncIOEngine.Read.cs (5)
15
public static
NativeMethods
.REQUEST_NOTIFICATION_STATUS ReadCallback(IntPtr httpContext, IntPtr completionInfo, IntPtr completionContext)
19
NativeMethods
.HttpGetCompletionInfo(completionInfo, out var cbBytes, out var hr);
25
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_PENDING;
46
hr =
NativeMethods
.HttpWebsocketsReadBytes(
79
protected override bool IsSuccessfulResult(int hr) => hr ==
NativeMethods
.ERROR_HANDLE_EOF;
Core\IO\WebSocketsAsyncIOEngine.Write.cs (4)
14
private static
NativeMethods
.REQUEST_NOTIFICATION_STATUS WriteCallback(IntPtr httpContext, IntPtr completionInfo, IntPtr completionContext)
18
NativeMethods
.HttpGetCompletionInfo(completionInfo, out var cbBytes, out var hr);
23
return
NativeMethods
.REQUEST_NOTIFICATION_STATUS.RQ_NOTIFICATION_PENDING;
37
return
NativeMethods
.HttpWebsocketsWriteBytes(requestHandler, dataChunks, chunkCount, &WriteCallback, (IntPtr)_thisHandle, out completionExpected);
LibraryImports.g.cs (12)
92
private static partial int http_set_completion_status(global::Microsoft.AspNetCore.Server.IIS.Core.NativeSafeHandle pInProcessHandler, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS rquestNotificationStatus)
117
static extern unsafe int __PInvoke(nint __pInProcessHandler_native, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS __rquestNotificationStatus_native);
127
private static partial void http_indicate_completion(global::Microsoft.AspNetCore.Server.IIS.Core.NativeSafeHandle pInProcessHandler, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS notificationStatus)
150
static extern unsafe void __PInvoke(nint __pInProcessHandler_native, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS __notificationStatus_native);
160
private static unsafe partial int register_callbacks(global::Microsoft.AspNetCore.Server.IIS.Core.NativeSafeHandle pInProcessApplication, delegate* unmanaged<nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> requestCallback, delegate* unmanaged<nint, int> shutdownCallback, delegate* unmanaged<nint, void> disconnectCallback, delegate* unmanaged<nint, int, int, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> asyncCallback, delegate* unmanaged<nint, void> requestsDrainedHandler, nint pvRequestContext, nint pvShutdownContext)
185
static extern unsafe int __PInvoke(nint __pInProcessApplication_native, delegate* unmanaged<nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> __requestCallback_native, delegate* unmanaged<nint, int> __shutdownCallback_native, delegate* unmanaged<nint, void> __disconnectCallback_native, delegate* unmanaged<nint, int, int, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> __asyncCallback_native, delegate* unmanaged<nint, void> __requestsDrainedHandler_native, nint __pvRequestContext_native, nint __pvShutdownContext_native);
699
private static unsafe partial int http_websockets_read_bytes(global::Microsoft.AspNetCore.Server.IIS.Core.NativeSafeHandle pInProcessHandler, byte* pvBuffer, int cbBuffer, delegate* unmanaged<nint, nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> pfnCompletionCallback, nint pvCompletionContext, out int dwBytesReceived, out bool fCompletionExpected)
732
static extern unsafe int __PInvoke(nint __pInProcessHandler_native, byte* __pvBuffer_native, int __cbBuffer_native, delegate* unmanaged<nint, nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> __pfnCompletionCallback_native, nint __pvCompletionContext_native, int* __dwBytesReceived_native, int* __fCompletionExpected_native);
742
private static unsafe partial int http_websockets_write_bytes(global::Microsoft.AspNetCore.Server.IIS.Core.NativeSafeHandle pInProcessHandler, global::Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* pDataChunks, int nChunks, delegate* unmanaged<nint, nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> pfnCompletionCallback, nint pvCompletionContext, out bool fCompletionExpected)
772
static extern unsafe int __PInvoke(nint __pInProcessHandler_native, global::Windows.Win32.Networking.HttpServer.HTTP_DATA_CHUNK* __pDataChunks_native, int __nChunks_native, delegate* unmanaged<nint, nint, nint, global::Microsoft.AspNetCore.Server.IIS.
NativeMethods
.REQUEST_NOTIFICATION_STATUS> __pfnCompletionCallback_native, nint __pvCompletionContext_native, int* __fCompletionExpected_native);
StartupHook.cs (3)
21
if (!
NativeMethods
.IsAspNetCoreModuleLoaded())
49
var iisConfigData =
NativeMethods
.HttpGetApplicationProperties();
71
NativeMethods
.HttpSetStartupErrorPageContent(content);
WebHostBuilderIISExtensions.cs (2)
30
if (OperatingSystem.IsWindows() &&
NativeMethods
.IsAspNetCoreModuleLoaded())
32
var iisConfigData =
NativeMethods
.HttpGetApplicationProperties();