|
|
1.1 root 1: /*++
2:
3: Copyright (c) 1989-1993 Microsoft Corporation
4:
5: Module Name:
6:
7: stprocs.h
8:
9: Abstract:
10:
11: This header file defines private functions for the NT Sample transport
12: provider.
13:
14: Author:
15:
16: David Beaver (dbeaver) 1-July-1991
17:
18: Revision History:
19:
20: --*/
21:
22: #ifndef _STPROCS_
23: #define _STPROCS_
24:
25: //
26: // MACROS.
27: //
28: //
29: // Debugging aids
30: //
31:
32: //
33: // VOID
34: // IF_STDBG(
35: // IN PSZ Message
36: // );
37: //
38:
39: #if DBG
40: #define IF_STDBG(flags) \
41: if (StDebug & (flags))
42: #else
43: #define IF_STDBG(flags) \
44: if (0)
45: #endif
46:
47: //
48: // VOID
49: // PANIC(
50: // IN PSZ Message
51: // );
52: //
53:
54: #if DBG
55: #define PANIC(Msg) \
56: DbgPrint ((Msg))
57: #else
58: #define PANIC(Msg)
59: #endif
60:
61:
62: //
63: // These are define to allow DbgPrints that disappear when
64: // DBG is 0.
65: //
66:
67: #if DBG
68: #define StPrint0(fmt) DbgPrint(fmt)
69: #define StPrint1(fmt,v0) DbgPrint(fmt,v0)
70: #define StPrint2(fmt,v0,v1) DbgPrint(fmt,v0,v1)
71: #define StPrint3(fmt,v0,v1,v2) DbgPrint(fmt,v0,v1,v2)
72: #define StPrint4(fmt,v0,v1,v2,v3) DbgPrint(fmt,v0,v1,v2,v3)
73: #define StPrint5(fmt,v0,v1,v2,v3,v4) DbgPrint(fmt,v0,v1,v2,v3,v4)
74: #define StPrint6(fmt,v0,v1,v2,v3,v4,v5) DbgPrint(fmt,v0,v1,v2,v3,v4,v5)
75: #else
76: #define StPrint0(fmt)
77: #define StPrint1(fmt,v0)
78: #define StPrint2(fmt,v0,v1)
79: #define StPrint3(fmt,v0,v1,v2)
80: #define StPrint4(fmt,v0,v1,v2,v3)
81: #define StPrint5(fmt,v0,v1,v2,v3,v4)
82: #define StPrint6(fmt,v0,v1,v2,v3,v4,v5)
83: #endif
84:
85: //
86: // The REFCOUNTS message take up a lot of room, so make
87: // removing them easy.
88: //
89:
90: #if 1
91: #define IF_REFDBG IF_STDBG (ST_DEBUG_REFCOUNTS)
92: #else
93: #define IF_REFDBG if (0)
94: #endif
95:
96: #define StReferenceConnection(Reason, Connection)\
97: StRefConnection (Connection)
98:
99: #define StDereferenceConnection(Reason, Connection)\
100: StDerefConnection (Connection)
101:
102: #define StDereferenceConnectionSpecial(Reason, Connection)\
103: StDerefConnectionSpecial (Connection)
104:
105: #define StReferenceRequest(Reason, Request)\
106: (VOID)ExInterlockedIncrementLong( \
107: &(Request)->ReferenceCount, \
108: (Request)->ProviderInterlock)
109:
110: #define StDereferenceRequest(Reason, Request)\
111: StDerefRequest (Request)
112:
113: #define StReferenceSendIrp(Reason, IrpSp)\
114: (VOID)ExInterlockedIncrementLong( \
115: &IRP_REFCOUNT(IrpSp), \
116: &(IRP_DEVICE_CONTEXT(IrpSp)->Interlock))
117:
118: #define StDereferenceSendIrp(Reason, IrpSp)\
119: StDerefSendIrp (IrpSp)
120:
121: #define StReferenceAddress(Reason, Address)\
122: (VOID)ExInterlockedIncrementLong( \
123: &(Address)->ReferenceCount, \
124: &(Address)->Provider->Interlock)
125:
126: #define StDereferenceAddress(Reason, Address)\
127: StDerefAddress (Address)
128:
129: #define StReferenceDeviceContext(Reason, DeviceContext)\
130: StRefDeviceContext (DeviceContext)
131:
132: #define StDereferenceDeviceContext(Reason, DeviceContext)\
133: StDerefDeviceContext (DeviceContext)
134:
135: #define StReferencePacket(Packet) \
136: (VOID)ExInterlockedIncrementLong( \
137: &(Packet)->ReferenceCount, \
138: (Packet)->ProviderInterlock)
139:
140:
141: //
142: // These macros are used to create and destroy packets, due
143: // to the allocation or deallocation of structure which
144: // need them.
145: //
146:
147:
148: #define StAddSendPacket(DeviceContext) { \
149: PTP_PACKET _SendPacket; \
150: StAllocateSendPacket ((DeviceContext), &_SendPacket); \
151: if (_SendPacket != NULL) { \
152: ExInterlockedPushEntryList( \
153: &(DeviceContext)->PacketPool, \
154: (PSINGLE_LIST_ENTRY)&_SendPacket->Linkage, \
155: &(DeviceContext)->Interlock); \
156: } \
157: }
158:
159: #define StRemoveSendPacket(DeviceContext) { \
160: PSINGLE_LIST_ENTRY s; \
161: if (DeviceContext->PacketAllocated > DeviceContext->PacketInitAllocated) { \
162: s = ExInterlockedPopEntryList( \
163: &(DeviceContext)->PacketPool, \
164: &(DeviceContext)->Interlock); \
165: if (s != NULL) { \
166: StDeallocateSendPacket((DeviceContext), \
167: (PTP_PACKET)CONTAINING_RECORD(s, TP_PACKET, Linkage)); \
168: } \
169: } \
170: }
171:
172:
173: #define StAddReceivePacket(DeviceContext) { \
174: PNDIS_PACKET _ReceivePacket; \
175: StAllocateReceivePacket ((DeviceContext), &_ReceivePacket); \
176: if (_ReceivePacket != NULL) { \
177: ExInterlockedPushEntryList( \
178: &(DeviceContext)->ReceivePacketPool, \
179: (PSINGLE_LIST_ENTRY)&((PRECEIVE_PACKET_TAG)_ReceivePacket->ProtocolReserved)->Linkage, \
180: &(DeviceContext)->Interlock); \
181: } \
182: }
183:
184: #define StRemoveReceivePacket(DeviceContext) { \
185: PSINGLE_LIST_ENTRY s; \
186: if (DeviceContext->ReceivePacketAllocated > DeviceContext->ReceivePacketInitAllocated) { \
187: s = ExInterlockedPopEntryList( \
188: &(DeviceContext)->ReceivePacketPool, \
189: &(DeviceContext)->Interlock); \
190: if (s != NULL) { \
191: StDeallocateReceivePacket((DeviceContext), \
192: (PNDIS_PACKET)CONTAINING_RECORD(s, NDIS_PACKET, ProtocolReserved[0])); \
193: } \
194: } \
195: }
196:
197:
198: #define StAddReceiveBuffer(DeviceContext) { \
199: PBUFFER_TAG _ReceiveBuffer; \
200: StAllocateReceiveBuffer ((DeviceContext), &_ReceiveBuffer); \
201: if (_ReceiveBuffer != NULL) { \
202: ExInterlockedPushEntryList( \
203: &(DeviceContext)->ReceiveBufferPool, \
204: &_ReceiveBuffer->Linkage, \
205: &(DeviceContext)->Interlock); \
206: } \
207: }
208:
209: #define StRemoveReceiveBuffer(DeviceContext) { \
210: PSINGLE_LIST_ENTRY s; \
211: if (DeviceContext->ReceiveBufferAllocated > DeviceContext->ReceiveBufferInitAllocated) { \
212: s = ExInterlockedPopEntryList( \
213: &(DeviceContext)->ReceiveBufferPool, \
214: &(DeviceContext)->Interlock); \
215: if (s != NULL) { \
216: StDeallocateReceiveBuffer(DeviceContext, \
217: (PBUFFER_TAG)CONTAINING_RECORD(s, BUFFER_TAG, Linkage)); \
218: } \
219: } \
220: }
221:
222:
223: //
224: // These routines are used to maintain counters that are
225: // locked using the interlocked routines.
226: //
227:
228: #define INCREMENT_COUNTER_LOCKED(_DeviceContext,_Field) \
229: ExInterlockedAddUlong( \
230: &((_DeviceContext)->_Field), \
231: 1, \
232: &((_DeviceContext)->StatisticsInterlock))
233:
234: #define INCREMENT_COUNTER(_DeviceContext,_Field) \
235: ++(_DeviceContext)->_Field
236:
237: #define DECREMENT_COUNTER_LOCKED(_DeviceContext,_Field) \
238: ExInterlockedAddUlong( \
239: &((_DeviceContext)->_Field), \
240: (ULONG)-1, \
241: &((_DeviceContext)->StatisticsInterlock))
242:
243: #define DECREMENT_COUNTER(_DeviceContext,_Field) \
244: --(_DeviceContext)->_Field
245:
246: //
247: // This macro adds a ULONG to a LARGE_INTEGER (should be
248: // called with a spinlock held).
249: //
250:
251: #define ADD_TO_LARGE_INTEGER(_LargeInteger,_Ulong,_Interlock) \
252: { \
253: LARGE_INTEGER TmpLarge; \
254: TmpLarge.HighPart = 0; \
255: TmpLarge.LowPart = (ULONG)(_Ulong); \
256: ExInterlockedAddLargeInteger( \
257: (_LargeInteger), \
258: TmpLarge, \
259: (_Interlock)); \
260: }
261:
262:
263:
264: //
265: // Routines in PACKET.C (TP_PACKET object manager).
266: //
267:
268: VOID
269: StAllocateSendPacket(
270: IN PDEVICE_CONTEXT DeviceContext,
271: OUT PTP_PACKET *TransportSendPacket
272: );
273:
274: VOID
275: StAllocateReceivePacket(
276: IN PDEVICE_CONTEXT DeviceContext,
277: OUT PNDIS_PACKET *TransportReceivePacket
278: );
279:
280: VOID
281: StAllocateReceiveBuffer(
282: IN PDEVICE_CONTEXT DeviceContext,
283: OUT PBUFFER_TAG *TransportReceiveBuffer
284: );
285:
286: VOID
287: StDeallocateSendPacket(
288: IN PDEVICE_CONTEXT DeviceContext,
289: IN PTP_PACKET TransportSendPacket
290: );
291:
292: VOID
293: StDeallocateReceivePacket(
294: IN PDEVICE_CONTEXT DeviceContext,
295: IN PNDIS_PACKET TransportReceivePacket
296: );
297:
298: VOID
299: StDeallocateReceiveBuffer(
300: IN PDEVICE_CONTEXT DeviceContext,
301: IN PBUFFER_TAG TransportReceiveBuffer
302: );
303:
304: NTSTATUS
305: StCreatePacket(
306: IN PDEVICE_CONTEXT DeviceContext,
307: OUT PTP_PACKET *Packet
308: );
309:
310: VOID
311: StDestroyPacket(
312: IN PTP_PACKET Packet
313: );
314:
315: VOID
316: StWaitPacket(
317: IN PTP_CONNECTION Connection,
318: IN ULONG Flags
319: );
320:
321: //
322: // Routines in RCVENG.C (Receive engine).
323: //
324:
325: VOID
326: AwakenReceive(
327: IN PTP_CONNECTION Connection
328: );
329:
330: VOID
331: ActivateReceive(
332: IN PTP_CONNECTION Connection
333: );
334:
335: VOID
336: CompleteReceive (
337: IN PTP_CONNECTION Connection,
338: IN BOOLEAN EndOfRecord,
339: KIRQL ConnectionIrql,
340: KIRQL CancelIrql
341: );
342:
343: VOID
344: StCancelReceive(
345: IN PDEVICE_OBJECT DeviceObject,
346: IN PIRP Irp
347: );
348:
349: //
350: // Routines in SENDENG.C (Send engine).
351: //
352:
353: VOID
354: InitializeSend(
355: PTP_CONNECTION Connection
356: );
357:
358: VOID
359: StartPacketizingConnection(
360: PTP_CONNECTION Connection,
361: IN BOOLEAN Immediate,
362: IN KIRQL ConnectionIrql,
363: IN KIRQL CancelIrql
364: );
365:
366: VOID
367: PacketizeConnections(
368: IN PDEVICE_CONTEXT DeviceContext
369: );
370:
371: VOID
372: PacketizeSend(
373: IN PTP_CONNECTION Connection
374: );
375:
376: VOID
377: CompleteSend(
378: IN PTP_CONNECTION Connection
379: );
380:
381: VOID
382: FailSend(
383: IN PTP_CONNECTION Connection,
384: IN NTSTATUS RequestStatus,
385: IN BOOLEAN StopConnection
386: );
387:
388: VOID
389: StCancelSend(
390: IN PDEVICE_OBJECT DeviceObject,
391: IN PIRP Irp
392: );
393:
394: VOID
395: StNdisSend(
396: IN PTP_PACKET Packet
397: );
398:
399: VOID
400: StSendCompletionHandler(
401: IN NDIS_HANDLE ProtocolBindingContext,
402: IN PNDIS_PACKET NdisPacket,
403: IN NDIS_STATUS NdisStatus
404: );
405:
406: NTSTATUS
407: BuildBufferChainFromMdlChain (
408: IN NDIS_HANDLE BufferPoolHandle,
409: IN PMDL CurrentMdl,
410: IN ULONG ByteOffset,
411: IN ULONG DesiredLength,
412: OUT PNDIS_BUFFER *Destination,
413: OUT PMDL *NewCurrentMdl,
414: OUT ULONG *NewByteOffset,
415: OUT ULONG *TrueLength
416: );
417:
418: //
419: // Routines in DEVCTX.C (TP_DEVCTX object manager).
420: //
421:
422: VOID
423: StRefDeviceContext(
424: IN PDEVICE_CONTEXT DeviceContext
425: );
426:
427: VOID
428: StDerefDeviceContext(
429: IN PDEVICE_CONTEXT DeviceContext
430: );
431:
432: NTSTATUS
433: StCreateDeviceContext(
434: IN PDRIVER_OBJECT DriverObject,
435: IN PUNICODE_STRING DeviceName,
436: IN OUT PDEVICE_CONTEXT *DeviceContext
437: );
438:
439: VOID
440: StDestroyDeviceContext(
441: IN PDEVICE_CONTEXT DeviceContext
442: );
443:
444:
445: //
446: // Routines in ADDRESS.C (TP_ADDRESS object manager).
447: //
448:
449: VOID
450: StRefAddress(
451: IN PTP_ADDRESS Address
452: );
453:
454: VOID
455: StDerefAddress(
456: IN PTP_ADDRESS Address
457: );
458:
459: VOID
460: StAllocateAddressFile(
461: IN PDEVICE_CONTEXT DeviceContext,
462: OUT PTP_ADDRESS_FILE *TransportAddressFile
463: );
464:
465: VOID
466: StDeallocateAddressFile(
467: IN PDEVICE_CONTEXT DeviceContext,
468: IN PTP_ADDRESS_FILE TransportAddressFile
469: );
470:
471: NTSTATUS
472: StCreateAddressFile(
473: IN PDEVICE_CONTEXT DeviceContext,
474: OUT PTP_ADDRESS_FILE * AddressFile
475: );
476:
477: VOID
478: StReferenceAddressFile(
479: IN PTP_ADDRESS_FILE AddressFile
480: );
481:
482: VOID
483: StDereferenceAddressFile(
484: IN PTP_ADDRESS_FILE AddressFile
485: );
486:
487: VOID
488: StStopAddress(
489: IN PTP_ADDRESS Address
490: );
491:
492: VOID
493: StRegisterAddress(
494: IN PTP_ADDRESS Address
495: );
496:
497: BOOLEAN
498: StMatchNetbiosAddress(
499: IN PTP_ADDRESS Address,
500: IN PUCHAR NetBIOSName
501: );
502:
503: VOID
504: StAllocateAddress(
505: IN PDEVICE_CONTEXT DeviceContext,
506: OUT PTP_ADDRESS *TransportAddress
507: );
508:
509: VOID
510: StDeallocateAddress(
511: IN PDEVICE_CONTEXT DeviceContext,
512: IN PTP_ADDRESS TransportAddress
513: );
514:
515: NTSTATUS
516: StCreateAddress(
517: IN PDEVICE_CONTEXT DeviceContext,
518: IN PST_NETBIOS_ADDRESS NetworkName,
519: OUT PTP_ADDRESS *Address
520: );
521:
522: PTP_ADDRESS
523: StLookupAddress(
524: IN PDEVICE_CONTEXT DeviceContext,
525: IN PST_NETBIOS_ADDRESS NetworkName
526: );
527:
528: PTP_CONNECTION
529: StLookupRemoteName(
530: IN PTP_ADDRESS Address,
531: IN PUCHAR RemoteName
532: );
533:
534: NTSTATUS
535: StStopAddressFile(
536: IN PTP_ADDRESS_FILE AddressFile,
537: IN PTP_ADDRESS Address
538: );
539:
540: NTSTATUS
541: StVerifyAddressObject (
542: IN PTP_ADDRESS_FILE AddressFile
543: );
544:
545: NTSTATUS
546: StSendDatagramsOnAddress(
547: PTP_ADDRESS Address
548: );
549:
550: //
551: //
552: // Routines in CONNOBJ.C (TP_CONNECTION object manager).
553: //
554:
555: VOID
556: StRefConnection(
557: IN PTP_CONNECTION TransportConnection
558: );
559:
560: VOID
561: StDerefConnection(
562: IN PTP_CONNECTION TransportConnection
563: );
564:
565: VOID
566: StDerefConnectionSpecial(
567: IN PTP_CONNECTION TransportConnection
568: );
569:
570: VOID
571: StStopConnection(
572: IN PTP_CONNECTION TransportConnection,
573: IN NTSTATUS Status
574: );
575:
576: VOID
577: StCancelConnection(
578: IN PDEVICE_OBJECT DeviceObject,
579: IN PIRP Irp
580: );
581:
582: PTP_CONNECTION
583: StLookupListeningConnection(
584: IN PTP_ADDRESS Address
585: );
586:
587: VOID
588: StAllocateConnection(
589: IN PDEVICE_CONTEXT DeviceContext,
590: OUT PTP_CONNECTION *TransportConnection
591: );
592:
593: VOID
594: StDeallocateConnection(
595: IN PDEVICE_CONTEXT DeviceContext,
596: IN PTP_CONNECTION TransportConnection
597: );
598:
599: NTSTATUS
600: StCreateConnection(
601: IN PDEVICE_CONTEXT DeviceContext,
602: OUT PTP_CONNECTION *TransportConnection
603: );
604:
605: PTP_CONNECTION
606: StLookupConnectionByContext(
607: IN PTP_ADDRESS Address,
608: IN CONNECTION_CONTEXT ConnectionContext
609: );
610:
611: PTP_CONNECTION
612: StFindConnection(
613: IN PDEVICE_CONTEXT DeviceContext,
614: IN PUCHAR LocalName,
615: IN PUCHAR RemoteName
616: );
617:
618: NTSTATUS
619: StVerifyConnectionObject (
620: IN PTP_CONNECTION Connection
621: );
622:
623: //
624: // Routines in REQUEST.C (TP_REQUEST object manager).
625: //
626:
627:
628: VOID
629: TdiRequestTimeoutHandler(
630: IN PKDPC Dpc,
631: IN PVOID DeferredContext,
632: IN PVOID SystemArgument1,
633: IN PVOID SystemArgument2
634: );
635:
636: VOID
637: StRefRequest(
638: IN PTP_REQUEST Request
639: );
640:
641: VOID
642: StDerefRequest(
643: IN PTP_REQUEST Request
644: );
645:
646: VOID
647: StCompleteRequest(
648: IN PTP_REQUEST Request,
649: IN NTSTATUS Status,
650: IN ULONG Information
651: );
652:
653: VOID
654: StRefSendIrp(
655: IN PIO_STACK_LOCATION IrpSp
656: );
657:
658: VOID
659: StDerefSendIrp(
660: IN PIO_STACK_LOCATION IrpSp
661: );
662:
663: VOID
664: StCompleteSendIrp(
665: IN PIRP Irp,
666: IN NTSTATUS Status,
667: IN ULONG Information
668: );
669:
670: VOID
671: StAllocateRequest(
672: IN PDEVICE_CONTEXT DeviceContext,
673: OUT PTP_REQUEST *TransportRequest
674: );
675:
676: VOID
677: StDeallocateRequest(
678: IN PDEVICE_CONTEXT DeviceContext,
679: IN PTP_REQUEST TransportRequest
680: );
681:
682: NTSTATUS
683: StCreateRequest(
684: IN PIRP Irp,
685: IN PVOID Context,
686: IN ULONG Flags,
687: IN PMDL Buffer2,
688: IN ULONG Buffer2Length,
689: IN LARGE_INTEGER Timeout,
690: OUT PTP_REQUEST * TpRequest
691: );
692:
693: //
694: // Routines in DLC.C (entrypoints from NDIS interface).
695: //
696:
697: NDIS_STATUS
698: StReceiveIndication(
699: IN NDIS_HANDLE BindingContext,
700: IN NDIS_HANDLE ReceiveContext,
701: IN PVOID HeaderBuffer,
702: IN UINT HeaderBufferSize,
703: IN PVOID LookaheadBuffer,
704: IN UINT LookaheadBufferSize,
705: IN UINT PacketSize
706: );
707:
708: NDIS_STATUS
709: StGeneralReceiveHandler (
710: IN PDEVICE_CONTEXT DeviceContext,
711: IN NDIS_HANDLE ReceiveContext,
712: IN PHARDWARE_ADDRESS SourceAddress,
713: IN PVOID HeaderBuffer,
714: IN UINT PacketSize,
715: IN PST_HEADER StHeader,
716: IN UINT StSize
717: );
718:
719: VOID
720: StReceiveComplete (
721: IN NDIS_HANDLE BindingContext
722: );
723:
724: VOID
725: StTransferDataComplete(
726: IN NDIS_HANDLE BindingContext,
727: IN PNDIS_PACKET NdisPacket,
728: IN NDIS_STATUS Status,
729: IN UINT BytesTransferred
730: );
731:
732: //
733: // Routines in UFRAMES.C, the UI-frame ST frame processor.
734: //
735:
736: NTSTATUS
737: StIndicateDatagram(
738: IN PDEVICE_CONTEXT DeviceContext,
739: IN PTP_ADDRESS Address,
740: IN PUCHAR Header,
741: IN ULONG Length
742: );
743:
744: NTSTATUS
745: StProcessConnectionless(
746: IN PDEVICE_CONTEXT DeviceContext,
747: IN PHARDWARE_ADDRESS SourceAddress,
748: IN PST_HEADER StHeader,
749: IN ULONG StLength,
750: IN PUCHAR SourceRouting,
751: IN UINT SourceRoutingLength,
752: OUT PTP_ADDRESS * DatagramAddress
753: );
754:
755: //
756: // Routines in IFRAMES.C, the I-frame ST frame processor.
757: //
758:
759: NTSTATUS
760: StProcessIIndicate(
761: IN PTP_CONNECTION Connection,
762: IN PST_HEADER StHeader,
763: IN UINT StIndicatedLength,
764: IN UINT StTotalLength,
765: IN NDIS_HANDLE ReceiveContext,
766: IN BOOLEAN Last
767: );
768:
769: //
770: // Routines in RCV.C (data copying routines for receives).
771: //
772:
773: NTSTATUS
774: StCopyMdlToBuffer(
775: IN PMDL SourceMdlChain,
776: IN ULONG SourceOffset,
777: IN PVOID DestinationBuffer,
778: IN ULONG DestinationOffset,
779: IN ULONG DestinationBufferSize,
780: IN PULONG BytesCopied
781: );
782:
783: //
784: // Routines in FRAMESND.C, the UI-frame (non-link) shipper.
785: //
786:
787: NTSTATUS
788: StSendConnect(
789: IN PTP_CONNECTION Connection
790: );
791:
792: NTSTATUS
793: StSendDisconnect(
794: IN PTP_CONNECTION Connection
795: );
796:
797: NTSTATUS
798: StSendAddressFrame(
799: IN PTP_ADDRESS Address
800: );
801:
802: VOID
803: StSendDatagramCompletion(
804: IN PTP_ADDRESS Address,
805: IN PNDIS_PACKET NdisPacket,
806: IN NDIS_STATUS NdisStatus
807: );
808:
809:
810: //
811: // Routines in stdrvr.c
812: //
813:
814: NTSTATUS
815: StDispatchOpenClose(
816: IN PDEVICE_OBJECT DeviceObject,
817: IN PIRP Irp
818: );
819:
820: NTSTATUS
821: StDispatchInternal(
822: IN PDEVICE_OBJECT DeviceObject,
823: IN PIRP Irp
824: );
825:
826: NTSTATUS
827: StDispatch(
828: IN PDEVICE_OBJECT DeviceObject,
829: IN PIRP Irp
830: );
831:
832: //
833: // Routine in stndis.c
834: //
835:
836: VOID
837: StOpenAdapterComplete(
838: IN NDIS_HANDLE NdisBindingContext,
839: IN NDIS_STATUS Status,
840: IN NDIS_STATUS OpenErrorStatus
841: );
842:
843: VOID
844: StCloseAdapterComplete(
845: IN NDIS_HANDLE NdisBindingContext,
846: IN NDIS_STATUS Status
847: );
848:
849: VOID
850: StResetComplete(
851: IN NDIS_HANDLE NdisBindingContext,
852: IN NDIS_STATUS Status
853: );
854:
855: VOID
856: StRequestComplete(
857: IN NDIS_HANDLE NdisBindingContext,
858: IN PNDIS_REQUEST NdisRequest,
859: IN NDIS_STATUS Status
860: );
861:
862: VOID
863: StStatusIndication (
864: IN NDIS_HANDLE NdisBindingContext,
865: IN NDIS_STATUS NdisStatus,
866: IN PVOID StatusBuffer,
867: IN UINT StatusBufferLength
868: );
869:
870: VOID
871: StStatusComplete (
872: IN NDIS_HANDLE NdisBindingContext
873: );
874:
875: #if DBG
876: PUCHAR
877: StGetNdisStatus (
878: IN NDIS_STATUS NdisStatus
879: );
880: #endif
881:
882: VOID
883: StWriteResourceErrorLog(
884: IN PDEVICE_CONTEXT DeviceContext,
885: IN ULONG BytesNeeded,
886: IN ULONG UniqueErrorValue
887: );
888:
889: VOID
890: StWriteGeneralErrorLog(
891: IN PDEVICE_CONTEXT DeviceContext,
892: IN NTSTATUS ErrorCode,
893: IN ULONG UniqueErrorValue,
894: IN NTSTATUS FinalStatus,
895: IN PWSTR SecondString,
896: IN ULONG DumpDataCount,
897: IN ULONG DumpData[]
898: );
899:
900: VOID
901: StWriteOidErrorLog(
902: IN PDEVICE_CONTEXT DeviceContext,
903: IN NTSTATUS ErrorCode,
904: IN NTSTATUS FinalStatus,
905: IN PWSTR AdapterString,
906: IN ULONG OidValue
907: );
908:
909: VOID
910: StFreeResources(
911: IN PDEVICE_CONTEXT DeviceContext
912: );
913:
914:
915: //
916: // routines in stcnfg.c
917: //
918:
919: NTSTATUS
920: StConfigureProvider(
921: IN PDEVICE_OBJECT DeviceObject,
922: IN PIRP Irp,
923: IN PIO_STACK_LOCATION IrpSp
924: );
925:
926: //
927: // Routines in stndis.c
928: //
929:
930: NTSTATUS
931: StRegisterProtocol (
932: IN STRING *NameString
933: );
934:
935: VOID
936: StDeregisterProtocol (
937: VOID
938: );
939:
940:
941: NTSTATUS
942: StInitializeNdis (
943: IN PDEVICE_CONTEXT DeviceContext,
944: IN PCONFIG_DATA ConfigInfo,
945: IN UINT ConfigInfoNameIndex
946: );
947:
948: VOID
949: StCloseNdis (
950: IN PDEVICE_CONTEXT DeviceContext
951: );
952:
953:
954: #endif // def _STPROCS_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.