PDA

View Full Version : Static structure changes - suggestions


darkone
05-29-2003, 10:29 PM
Here's a suggestion for SHMEM_WHO structure (previous known as STATIC structure)

typedef struct _SHMEM_WHO
{
INT32 Uid; // -1 = Not logged in

DWORD dwFlags; // DEAD & HALT
TCHAR ServiceName[MAX_NAME]; // Name of service
TCHAR LastAction[64]; // User's last action

ULONG ulClientIp; // Client ip - host byte order
USHORT usClientPort; // Client port
TCHAR HostName[MAX_HOSTNAME]; // Hostname

TCHAR VirtualPath[_MAX_PWD + 1]; // Virtual path
LPTSTR RealPath; // Real path

time_t Login; // Login Time
DWORD dwIdleBegin; // Idle begin - GetTickCount()

BYTE Transfer; // (0 Inactive, 1 Upload, 2 Download, 3 List)
ULONG ulDataClientIp;
USHORT usDataClientPort;
sockaddr_in DataHost; // Client's data sockets (if any) internet address

TCHAR VirtualDataPath[_MAX_PWD + 1]; // File being transfered
LPTSTR RealDataPath; // Real data path

DWORD dwTransferBegin;
DWORD dwBytesTransfered; // Bytes transfered during interval
DWORD dwIntervalDuration; // Length of interval in Milliseconds
INT64 i64TotalBytesTransfered; // Total bytes transfered during transfer

} SHMEM_WHO, * PSHMEM_WHO;

Both real path's are in dynamic length... allocation will be similar to those used in datacopy examples for vfs context reading.

Lunatik
05-30-2003, 08:19 AM
Userfile?
GID?

darkone
05-30-2003, 11:17 AM
Userfile can be read by sending another message in.

dasOp
05-30-2003, 05:30 PM
Um, perhaps you should tell us if you have _UNICODE or not defined since you use TCHAR.. could create lots of mistakes, especially for beginner coders ;)

If those are always unicode, then use WCHAR if the header is for public use to avoid anal people like me asking weird questios ;P

darkone
05-30-2003, 08:13 PM
It's not enabled atm, as I haven't had time to go through all functions/variables nor can I test it at home... There will be two builds of io at some point: one with unicode & one without... but not in the foreseeable future :)