The program FortranDemo
Use Kernel32
Implicit None
Interface
SUBROUTINE GetDiskSerialNumber1 (drive, pout, poutsize)
! DEC $ATTRIBUTES STDCALL: : GetDiskSerialNumber1
! DEC $ATTRIBUTES Alias: 'GetDiskSerialNumber1' : : GetDiskSerialNumber1
! DEC $ATTRIBUTES REFERENCE: : pout, poutsize
INTEGER: : poutsize
CHARACTER: (len=1) : drive
CHARACTER: : pout (*)
End SUBROUTINE
SUBROUTINE DoReg (user, userlen, regid regidlen)
! DEC $ATTRIBUTES STDCALL: : DoReg
! DEC $ATTRIBUTES Alias: 'DoReg' : : DoReg
! DEC $ATTRIBUTES REFERENCE: : pout, poutsize
INTEGER: : userlen, regidlen
CHARACTER: the user (*), regid (*)
End SUBROUTINE
End Interface
CHARACTER (len=20) dllname
Logical RetLog
The INTEGER poutsize
CHARACTER drive
CHARACTER: : pout (100)
CHARACTER (len=100) : : user
CHARACTER (len=300) : : regid
The INTEGER userlen, regidlen
The Pointer (fGetDiskSerialNumber1 GetDiskSerialNumber1)
The Pointer (fDoReg DoReg)
! Under a 32-bit INTEGER (4), under a 64 - bit INTEGER (8)
! INTEGER (4) hLib
! DEC $IF DEFINED (_X86_)
INTEGER (4) hLib
Dllname="jydisk. DLL" C
Print *, 'the win32'
! DEC $ELSE
INTEGER (8) hLib
Dllname="jydisk64. DLL" C
Print *, 'win64'
! DEC $ENDIF
HLib=LoadLibrary (dllname)
FDoReg=GetProcAddress call (hLib, 'DoReg C)
Print *, 'DoReg=' fDoReg
FGetDiskSerialNumber1=GetProcAddress call (hLib, 'GetDiskSerialNumber1 C)
Print *, 'GetDiskSerialNumber1=' fGetDiskSerialNumber1
User="171833017 @qq.com"
Regid="telme"
Userlen=len (trim (user))
Regidlen=len (trim (regid))
Call DoReg (user, userlen, regid regidlen)
Drive="c"
PRINT *, '=' in, drive
Call GetDiskSerialNumber1 (drive, pout, poutsize)
! Print *, 'RetLog=' RetLog
PRINT *, 'OUTPUT (1)=', poutsize
PRINT *, 'OUTPUT (2)=', pout
RetLog=FreeLibrary (hLib)
End the program FortranDemo
CodePudding user response:
This also charge! ?