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