[fpc-pascal] TAP-Win32

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


This is the C# example i found :

http://www.varsanofiev.com/inside/TunTest.cs

2010/5/13 Jorge Aldo G. de F. Junior <jagfj80 at gmail.com>:
> 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