[fpc-pascal] TAP-Win32

Jorge Aldo G. de F. Junior jagfj80 at gmail.com
Fri May 14 00:11:44 CEST 2010


handle still returns -1

2010/5/13 José Mejuto <joshyfun at gmail.com>:
> Hello FPC-Pascal,
>
> Thursday, May 13, 2010, 10:42:37 PM, you wrote:
>
> JAGdFJ>         Handle := CreateFile(PChar(TAP_Device), GENERIC_READ Or
> JAGdFJ> GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM Or
> JAGdFJ> FILE_FLAG_OVERLAPPED, 0);
>
> Try using:
>
> Handle:=CreateFileA(PChar(TAP_Device), GENERIC_READ or GENERIC_WRITE,
>                     0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
>
> Overlapped attribute is an error for sure as non overlapped structure
> is being passed. In fact I think that no FILE_xxxx is needed at all.
>
> JAGdFJ> (translated from a C# example)
>
> Maybe the example is wrong ;)
>
> --
> Best regards,
>  José
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list