Terminate Subst procedure not working

Hi,

I making a network adminstration program using Delphi 2.0. Working with
this program
I was very happy to discover a assembler code in the Delphi help file
that would
remove a DOS disk-substitution. However when I write this code I get a
General
Protection Fault Error. Can anybody explain to me why and what I should
do to make it work?

Jimmy Thomsen
Bergen College
Norway

Quote from Delphi:

Quote
> [New - Windows 95]
> mov ax, 71aah            ; SUBST
> mov bh, 1                ; Terminate Subst
> mov bl, DriveNum         ; see below
> int 21h
> jc error
> Terminate the association between a path and a drive letter.
> Clears the carry flag if successful. Otherwise, the function sets the carry flag and returns an error value in the AX register.
> DriveNum
> Drive to terminate SUBST. This parameter can 1 for A, 2 for B, and so on. Note that DriveNum cannot be 0 to indicate the default drive.