Jump to content

DevHelp FreeLIDEntry: Difference between revisions

From EDM2
Created page with "This service releases physical memory allocated by the DevHlp_AllocPhys. ==Syntax== ===C=== <PRE> USHORT APIENTRY DevHelp_FreePhys(PULONG PhysAddr) </PRE> ===Assembler=== <P..."
 
No edit summary
Line 1: Line 1:
This service releases physical memory allocated by the DevHlp_AllocPhys.  
This service releases a Logical ID (LID). This must be done at uninstall or termination time.  
==Syntax==
==Syntax==
===C===
===C===
<PRE>
<PRE>
USHORT APIENTRY DevHelp_FreePhys(PULONG PhysAddr)
USHORT APIENTRY DevHelp_FreeLIDEntry (USHORT LIDNumber)
</PRE>
</PRE>


===Assembler===
===Assembler===
<PRE>
<PRE>
MOV  BX,address_low          ; 32-bit physical address
MOV  AX,LID                  ; Logical ID from GetLIDEntry
MOV  AX,address_high        ;
MOV  DL,DevHlp_FreeLIDEntry
MOV  DL,DevHlp_FreePhys


CALL  [Device_Help]
CALL  [Device_Help]
Line 16: Line 15:
==Parameters==
==Parameters==
===C===
===C===
; PhysAddr (PULONG) - input : Pointer to the 32 bit physical address of memory to be freed.
; LIDNumber (USHORT) - input : Logical ID from GetLIDEntry


===Assembler===
===Assembler===
<PRE>
<PRE>
MOV  BX,address_low          ; 32-bit physical address
MOV  AX,LID                  ; Logical ID from GetLIDEntry
MOV  AX,address_high        ;
</PRE>
</PRE>


==Return Code==
==Return Code==
===C===
===C===
; Success Indicator: 0
; Success indicator:


; Possible errors:
; Possible errors:
::Memory not freed
:: ERROR_LID_DOES_NOT_EXIST    (0x02)
:: ERROR_ABIOS_NOT_PRESENT      (0x03)
:: ERROR_NOT_YOUR_LID          (0x04)


===Assembler===
===Assembler===
<PRE>
<PRE>
   'C' Clear if memory freed.
   'C' Clear if successful.
  'C' Set if memory not freed.
 
  'C' Set if error.
      AX = Error code.
            Possible errors:
              ERROR_LID_DOES_NOT_EXIST    (0x02)
              ERROR_ABIOS_NOT_PRESENT      (0x03)
              ERROR_NOT_YOUR_LID          (0x04)
</PRE>
</PRE>


==Remarks==
==Remarks==
Any memory that the physical device driver allocated by way of the DevHlp_AllocPhys should be released prior to device driver termination. Memory that was not allocated with AllocPhys cannot be freed.  
The attempt to free a Logical ID can fail if the physical device driver does not own the LID or if the LID does not exist.
 
DS must point to the data segment of the physical device driver. If DS was previously used in a call to PhysToVirt, it must be reset to the data segment of the physical device driver.
 
 


==Example Code==
==Example Code==
Line 45: Line 55:
#include  "dhcalls.h"
#include  "dhcalls.h"


USHORT APIENTRY DevHelp_FreePhys(PULONG PhysAddr)
USHORT APIENTRY DevHelp_FreeLIDEntry (USHORT LIDNumber)
 
</PRE>
</PRE>



Revision as of 16:43, 4 December 2017

This service releases a Logical ID (LID). This must be done at uninstall or termination time.

Syntax

C

USHORT APIENTRY DevHelp_FreeLIDEntry (USHORT LIDNumber)

Assembler

MOV   AX,LID                  ; Logical ID from GetLIDEntry
MOV   DL,DevHlp_FreeLIDEntry

CALL  [Device_Help]

Parameters

C

LIDNumber (USHORT) - input
Logical ID from GetLIDEntry

Assembler

MOV   AX,LID                  ; Logical ID from GetLIDEntry

Return Code

C

Success indicator
Possible errors
ERROR_LID_DOES_NOT_EXIST (0x02)
ERROR_ABIOS_NOT_PRESENT (0x03)
ERROR_NOT_YOUR_LID (0x04)

Assembler

  'C' Clear if successful.

   'C' Set if error.
       AX = Error code.
            Possible errors:
               ERROR_LID_DOES_NOT_EXIST     (0x02)
               ERROR_ABIOS_NOT_PRESENT      (0x03)
               ERROR_NOT_YOUR_LID           (0x04)

Remarks

The attempt to free a Logical ID can fail if the physical device driver does not own the LID or if the LID does not exist.

DS must point to the data segment of the physical device driver. If DS was previously used in a call to PhysToVirt, it must be reset to the data segment of the physical device driver.


Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_FreeLIDEntry (USHORT LIDNumber)

Related Functions