DevHelp AllocReqPacket: Difference between revisions
Appearance
Created page with "This service returns a pointer to an empty request packet. ==Syntax== ===C=== <PRE> USHORT APIENTRY DevHelp_AllocReqPacket( USHORT WaitFlag, ..." |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:DevHelp_AllocReqPacket}} | |||
This service returns a pointer to an empty request packet. | This service returns a pointer to an empty request packet. | ||
Line 19: | Line 20: | ||
==Parameters== | ==Parameters== | ||
===C=== | ===C=== | ||
; WaitFlag (USHORT: Wait for available request packet. | ; ''WaitFlag'' ([[USHORT]]) - input: Wait for available request packet. | ||
::WAIT_NOT_ALLOWED 0 | ::WAIT_NOT_ALLOWED 0 | ||
::WAIT_IS_ALLOWED 1 | ::WAIT_IS_ALLOWED 1 | ||
; ReqPktAddr (PBYTE FAR *): Virtual address of allocated request packet to be returned. | ; ''ReqPktAddr'' (PBYTE FAR *) - input: Virtual address of allocated request packet to be returned. | ||
==Return Code== | ==Return Code== | ||
Line 55: | Line 53: | ||
PBYTE FAR *ReqPktAddr ); | PBYTE FAR *ReqPktAddr ); | ||
</PRE> | </PRE> | ||
[[Category:DevHlps]] | [[Category:DevHlps]] |
Latest revision as of 18:10, 23 May 2025
This service returns a pointer to an empty request packet.
Syntax
C
USHORT APIENTRY DevHelp_AllocReqPacket( USHORT WaitFlag, PBYTE FAR *ReqPktAddr );
Assembler
MOV DH,wait_flag ; Wait for available request packet ; 0 = if to wait ; 1 = if not to wait MOV DL,DevHlp_AllocReqPacket CALL [Device_Help]
Parameters
C
- WaitFlag (USHORT) - input
- Wait for available request packet.
- WAIT_NOT_ALLOWED 0
- WAIT_IS_ALLOWED 1
- ReqPktAddr (PBYTE FAR *) - input
- Virtual address of allocated request packet to be returned.
Return Code
C
Success Indicator: 0
Possible errors: None.
Assembler
'C' Clear if a request packet was allocated. ES:BX = The virtual address of the allocated request packet. 'C' Set if a request packet was not allocated. This function does not return any specific error code.
Remarks
Some device drivers, notably the physical disk device driver, need to have additional request packets to service task-time requests. Request packets that were allocated by AllocReqPacket can be placed in the request packet linked list. Request packets allocated in this manner should be returned to the kernel as soon as possible through the DevHlp_FreeReqPacket. The system has a limited number of request packets, so it is important that a physical device driver not allocate request packets and hold them for future use.
The state of the interrupt flag is not preserved across calls to AllocReqPacket.
Example Code
C
#include "dhcalls.h" USHORT APIENTRY DevHelp_AllocReqPacket( USHORT WaitFlag, PBYTE FAR *ReqPktAddr );