I am having trouble with the API Call "SetTcpEntry", For some reason, when ever call it, i get the error code 87, which is, The parameter is incorrect. I call it like this
TcpRow.MIB_TCPROW
; Set state to DELETE_TCB, to kill the connection
TcpRow\dwLocalAddr = inet_addr_(GetGadgetItemText(#List1,1,0))
TcpRow\dwLocalPort = htons_(GetGadgetItemText(#List1,1,1))
TcpRow\dwRemoteAddr = inet_addr_(GetGadgetItemText(#List1,1,2))
TcpRow\dwRemotePort = htons_(GetGadgetItemText(#List1,1,3))
TcpRow\dwState=12
Thats how i do it.. lol is there a problem doing it the way i did? im new to using API
*sigh* I debuged the output of dwLocalAddr, and its a negative number...but all the rest are positives.. The dwRemoteAddr is a positive number.. shouldnt dwLocalAddr be a positive. maybe ill look into a conversion? hmmm.. Thanks for your "help"
I made my own program matter of fact..you type in the error code and it looks up and gives out a message. But Like i said. Error code 87 = The parameter is incorrect. If you read my original post, I said this.
and it said : Overlapped I/O operation is in progress.
WTF? i wish i knew how to decode this message.. Overlapped? does that mean im somehow overflowwing a buffer? I/O is input/output lol i dunno..can anyone help me?
This is just a dumb guess but did you set the type for the items in the
structure to long? If not (like word or byte), then the value might be
passed as a negative number because of truncation.
8bit wrote:and it said : Overlapped I/O operation is in progress.
WTF? i wish i knew how to decode this message.. Overlapped? does that mean im somehow overflowwing a buffer? I/O is input/output lol i dunno..can anyone help me?
It means the operation is in progress and is running at the same time (asynchronously) as your own code. This is not a failure.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
tinman wrote:
It means the operation is in progress and is running at the same time (asynchronously) as your own code. This is not a failure.
Hmm.. So Im not really sure what all that means. Could you give me a link that explains it.. or explain it your self better? Thanks. Oh and yep all the variables are longs
tinman wrote:
It means the operation is in progress and is running at the same time (asynchronously) as your own code. This is not a failure.
Hmm.. So Im not really sure what all that means. Could you give me a link that explains it.. or explain it your self better? Thanks. Oh and yep all the variables are longs
I can't explain it with reference to your code because I can't test it here. And I just noticed that your original problem is different to the post I replied to so this probably isn't of any use to you. But I'll leave it in anyway :)
However, overlapped I/O is when Windows performs the I/O (or data transfer) at the same time as your thread runs. It does not stop your program running while the data transfer is taking place, so you can do other things in your program at the same time.
One example would be doing some network communications. If your program was stopped from running while the communications were taking place then the user would have to sit and wait for it to complete. However, because the communications are overlapped with your program, you can do other things such as allow the user to click on a "Cancel" button as your program will still be running to respond to it.
Well. If this is not a failure.. Then why doesnt it kill a connection? Ive even tried the SetTcpEntryToStack. Maybe this isnt the right program to be making in PureBasic.. The same code (modified a bit) Works fine in visual basic. Matter of fact, im just porting a application i made in Visual Basic into PureBasic, using the same API calls, and every thing.. Im just getting frusterated now.