LAN Manager User Name

I am trying to write a program in BP 7.0 which needs to get the user's
LAN Manager User Name.  I know this can be done as I  have the C code to
an old program that does this.  I also have some code which does what I
want but it needs to access a routine in the NETAPI.DLL.  I only seem
able to access this function if I compile my program to be Windows based.  
When I try to compile it as DOS based, it doesn't like the declaration to
access the DLL (it want's a ; after the external and will not allow me to
specify the DLL name).

The function I'm trying to access is:

function NetWkstaGetInfo(  pszServer         : pChar;
                           sLevel            : Integer;
                           pbBuffer          : pChar;
                           cbBuffer          : Word;
                           pcbTotalAvail : pWord) : Word; far;
                              external 'NETAPI';

Can anyone
A.      Show me some code on how to get the LAN Manager User Name from a
        DOS based program.
B.      Tell me how to access the NETAPI.DLL from a DOS based program.

Any help will be greatly appreciated.  I'm trying to do this for a
program to run from the LOGON script for Windows for Workgroups clients,
this is why it must be DOS based.

I could also post or send the code to the old C program if that would be
of help.

Thanks a bunch for the help.

Tom Kellen