PDA

View Full Version : My shmem utils


vod
09-24-2003, 09:30 PM
Incase anyone wants to look at it these are the shmem functions ive written (to see how bad of a programer i really am ;))

btw, theres no comments in the thing...

oh yea, its not even close to thread safe, so dont even think about it!

phoenixfr
09-25-2003, 12:08 PM
thx 4 sharing

darkone
09-26-2003, 11:48 AM
It would be even neater, if one had time to wrap these up in a dll with some simple api calls :)

ADDiCT
09-26-2003, 01:26 PM
yeah, i'd love to be able to use shmem in VB :)

(i was thinking of making a dll myself with my basic c knowledge, but i can't even get the samples compiled)

Mouton
09-28-2003, 02:22 PM
little thing u might wanna add to your getOnlineUser() function:

sometimes, the userid in the returned LPDC_ONLINEDATA structure is -1... that happens when the user is login in. you should return false then, or io will crash when u'll try to convert that invalid uid to a username later on...

was crashing ioftpd with that in ioBMonitor.

vod
09-29-2003, 04:44 PM
Originally posted by Mouton
little thing u might wanna add to your getOnlineUser() function:

sometimes, the userid in the returned LPDC_ONLINEDATA structure is -1... that happens when the user is login in. you should return false then, or io will crash when u'll try to convert that invalid uid to a username later on...

was crashing ioftpd with that in ioBMonitor.

weird, seems like it should not send back info with uid = -1, ill add a check for it, tho
i forget how it looks in the version i posted, but the updated one i have calls uidToName which takes unsigned int, then it mods it with 1024*1024-1 which prevents crashing io
of course, -1 will actually give info back if a user with id 4095 exists...which is not what is wanted :)

even though i really think that is should be impossiable to crash io via shmem...common for bounds checking dark!