RogFleming Posted June 28, 2011 Share Posted June 28, 2011 working to get data out of a Vendor's dll application: All I get in return is 0 for each element. Anyone mind to point me in teh right direction? Source Code Documentation; XSOGetUserInfo Prototype: XSO_CODE XSOGetUserInfo(USER_INFO * userInfo) Arguments: userInfo The current user info to return Return Value: XSO_OK XSO_NOT_INITED XSO_NOT_RESPONDING XSO_INTERNAL_ERROR Remarks: Applications call this function after a successful call to XSOInit. This function will return the user information for the current logged in TestApp user. TestAppKeyID is a unique ID assigned to each TestApp badge. The application can use this ID to associate with its own user record. Applications can check the TestAppState to determine how it should grant or deny the access. For example, if the TestApp State is in “Manual Override”, the application may want to ask the user to provide an additional credential. USER_INFO typedef struct _USER_INFO { long TestAppKeyID; char SystemAccountName[MAX_NAME_LEN]; char PersonalName[MAX_NAME_LEN]; XSO_STATE TestAppState; } USER_INFO; TestAppKeyID This is the unique ID transmitted by, and printed on the TestApp badge (a.k.a. Key). SystemAccountName This is the operating system account name for the current logged in user. PersonalName This is the TestApp user’s personal name. TestAppState This is the current TestApp system state. See XSO_STATE for more detail. Autoit Code (Not working) $p = DllStructCreate("long TestAppKeyID;char SystemAccountName[126];char PersonalName[126];XSO_STATE TestAppState") DllStructSetData($p, "userInfo", DllStructGetSize($p)) ;make the DllCall $dll = DllOpen("XSO.DLL") $ret = DllCall($dll,"int","XSOGetUserInfo","ptr",DllStructGetPtr($p)) if Not $ret[0] Then MsgBox(0,"DllCall Error","DllCall Failed") exit EndIf ;get the returned values $TestAppID = DllStructGetData($p,"TestAppKeyID") $TestAppUser = DllStructGetData($p,"SystemAccountName") $PersonalName = DllStructGetData($p,"PersonalName") $TestAppState = DllStructGetData($p,"TestAppState") ;free the struct $p =0 msgbox(0,"","TestApp ID: " & $TestAppID & @CRLF & _ "TestAppUser: " & $TestAppUser & @CRLF & _ "PersonalName: " & $PersonalName & @CRLF & _ "TestAppState: " & $TestAppState) DllClose($dll) Exit Link to comment Share on other sites More sharing options...
jchd Posted June 28, 2011 Share Posted June 28, 2011 You might have to use cdecl calling convention (see DllCall help). Now, what type is XSO_STATE for DllCall ??? Test @error at calls! This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
RogFleming Posted June 28, 2011 Author Share Posted June 28, 2011 answer for 1st question: expandcollapse popup/* WSS API Version */ #define WSSAPI_VERSION_MAJOR 4 #define WSSAPI_VERSION_MINOR 1 #ifdef _WSS_EXPT #define WSS_DECL __declspec(dllexport) #else #define WSS_DECL #endif #define MAX_NAME_LEN 256 /* API Return Code */ /* User Info */ typedef struct _USER_INFO { long XyLocKeyID; /* Current XyLoc User's Wireless Key ID */ char SystemAccountName[MAX_NAME_LEN]; /* Current XyLoc User's System Account Name */ char PersonalName[MAX_NAME_LEN]; /* Current XyLoc User's Personal Name */ WSS_STATE XyLocState; /* Current XyLoc State */ } USER_INFO; Other maybe helpful: /**************************** FUNCTION PROROTYPES ***************************/ WSS_CODE WINAPI WSSInit(int verMajor, int verMinor); WSS_CODE WINAPI WSSTerminate(void); WSS_CODE WINAPI WSSRegisterEventHandler(WSSEventHandler pfnEventHandler); WSS_CODE WINAPI WSSRemoveEventHandler(void); WSS_CODE WINAPI WSSGetUserInfo(USER_INFO * userInfo); WSS_CODE WINAPI WSSReadParam(long idApplication, long idKey, char * param, int * len); WSS_CODE WINAPI WSSWriteParam(long idApplication, long idKey, const char * param, int len); WSS_CODE WINAPI WSSGetAmbientBadges(BADGES **pListofIDs); void WINAPI WSSDelete(void * pBuffer); void WINAPI WSSDeleteBadges(BADGES * pBuffer); WSS_CODE WINAPI WSSReadParamOffline(long idApplication, long idKey, char * param, int * len); WSS_CODE WINAPI WSSWriteParamOffline(long idApplication, long idKey, const char * param, int len); WSS_CODE WINAPI WSSRegisterWindowHandler(long hwndCallback, long msgNum); WSS_CODE WINAPI WSSRemoveWindowHandler(void); WSS_CODE WINAPI WSSXyLocAuthenticate(char * username, char * password); Not much to give me any clues: $p = DllStructCreate("long XyLocKeyID ; char SystemAccountName[256] ; char PersonalName[256] ; char WSS_STATE") DllStructSetData($p, "userInfo", DllStructGetSize($p)) ;make the DllCall $dll = DllOpen("ETWSS.DLL") if @error Then ConsoleWrite("Open Dll Error:"&@error&@CRLF) $XylocStart = DllCall($dll,"int:cdecl","WSSInit","int:cdecl","4","int:cdecl","1") if @error Then ConsoleWrite("Call Dll Error:"&@error&@CRLF) ConsoleWrite("Start ETWSS.dll: "&$XylocStart&@CRLF) $ret = DllCall($dll,"int","WSSGetUserInfo","int",DllStructGetPtr($p)) if @error Then ConsoleWrite("Get User Info Error:"&@error&@CRLF) if Not $ret[0] Then ConsoleWrite("DllCall Error") exit EndIf ;get the returned values $XylocID = DllStructGetData($p,"XyLocKeyID") $XylocUser = DllStructGetData($p,"SystemAccountName") $PersonalName = DllStructGetData($p,"PersonalName") $XylocState = DllStructGetData($p,"XyLocState") ;free the struct $p =0 ConsoleWrite("Xyloc ID: " & $XylocID & @CRLF) ConsoleWrite("XylocUser: " & $XylocUser & @CRLF) ConsoleWrite("PersonalName: " & $PersonalName & @CRLF) ConsoleWrite("XylocState: " & $XylocState&@CRLF) DllCall("ETWSS.DLL","int","WSSTerminate") DllClose($dll) Exit console said the following: Call Dll Error:1 -->@error: 1 unable to use the DLL file Start ETWSS.dll: 0 Xyloc ID: 0 XylocUser: 0 PersonalName: 0 XylocState: 0 Link to comment Share on other sites More sharing options...
trancexx Posted June 28, 2011 Share Posted June 28, 2011 Your system is 64 bit? Anyway, check for correct bitness. If the dll is 32 bit then run 32 bit AutoIt. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
RogFleming Posted June 28, 2011 Author Share Posted June 28, 2011 Your system is 64 bit?Anyway, check for correct bitness. If the dll is 32 bit then run 32 bit AutoIt.I guess I do nto understand you response. Window XP 32-bit with Autoit 32-bitjust to provide resultsInitialize Dll Error:1Starting ETWSS.dll: 0OS Arch:X86Xyloc ID: 0XylocUser: 0PersonalName: 0XylocState: 0 Link to comment Share on other sites More sharing options...
trancexx Posted June 28, 2011 Share Posted June 28, 2011 I guess I do nto understand you response.Really? How come? Is it grammatically incorrect? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
RogFleming Posted June 28, 2011 Author Share Posted June 28, 2011 Really? How come? Is it grammatically incorrect?ok,I have comfirmed everything is 32-bit, any ideas? is it possible the dllopen and the initialization dll requiremetn is conflicting in some way?$dll = DllOpen("ETWSS.DLL")if @error Then ConsoleWrite("Open Dll Error:"&@error&@CRLF)$XylocStart = DllCall("ETWSS.DLL","int:cdecl","WSSInit","int 4","int 1")if @error Then ConsoleWrite("Initialize Dll Error:"&@error&@CRLF) Link to comment Share on other sites More sharing options...
trancexx Posted June 28, 2011 Share Posted June 28, 2011 ok, I have comfirmed everything is 32-bit, any ideas? is it possible the dllopen and the initialization dll requiremetn is conflicting in some way? $dll = DllOpen("ETWSS.DLL") if @error Then ConsoleWrite("Open Dll Error:"&@error&@CRLF) $XylocStart = DllCall("ETWSS.DLL","int:cdecl","WSSInit","int 4","int 1") if @error Then ConsoleWrite("Initialize Dll Error:"&@error&@CRLF) What's console output with this: $dll = DllOpen("ETWSS.DLL") ConsoleWrite($dll & @CRLF) ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
smashly Posted June 28, 2011 Share Posted June 28, 2011 (edited) Hi, Try something likeGlobal $h_ETWSSDLL Global $XylocStart ;make the DllCall $h_ETWSSDLL = DllOpen("ETWSS.DLL") If $h_ETWSSDLL = -1 Then ConsoleWrite("OpenDll Failed: " & $h_ETWSSDLL & @LF) Exit EndIf ; call the dll to initiate $XylocStart = DllCall($h_ETWSSDLL, "int:cdecl", "WSSInit", "int", 4, "int", 1) If @error Then ConsoleWrite("AutoIt DllCall Error: " & @error & @LF) Exit EndIf ConsoleWrite("WSSInit Return: " & $XylocStart[0] & @CRLF) Cheers Edited June 28, 2011 by smashly Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 What's console output with this: $dll = DllOpen("ETWSS.DLL") ConsoleWrite($dll & @CRLF) Zero 0 Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 Hi, Try something likeGlobal $h_ETWSSDLL Global $XylocStart ;make the DllCall $h_ETWSSDLL = DllOpen("ETWSS.DLL") If $h_ETWSSDLL = -1 Then ConsoleWrite("OpenDll Failed: " & $h_ETWSSDLL & @LF) Exit EndIf ; call the dll to initiate $XylocStart = DllCall($h_ETWSSDLL, "int:cdecl", "WSSInit", "int", 4, "int", 1) If @error Then ConsoleWrite("AutoIt DllCall Error: " & @error & @LF) Exit EndIf ConsoleWrite("WSSInit Return: " & $XylocStart[0] & @CRLF) Cheers It just exited nothing was written to console Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 I modified the code a bit and got the following witht eh following code: #include<array.au3> Global $h_ETWSSDLL Global $XylocStart ;make the DllCall $h_ETWSSDLL = DllOpen("ETWSS.DLL") If $h_ETWSSDLL = -1 Then ConsoleWrite("OpenDll Failed: " & $h_ETWSSDLL & @LF) Exit EndIf ; call the dll to initiate $XylocStart = DllCall($h_ETWSSDLL, "int", "WSSInit", "int",4,"int",1) If @error Then ConsoleWrite("AutoIt DllCall Error: " & @error & @LF) Exit EndIf _ArrayDisplay($XylocStart,"Data") ConsoleWrite("WSSInit Return: " & $XylocStart[0] & @CRLF) It displayed an array [0] 0 [1] 4 [2] 1 Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 so far I have found 2 functions that work WSSInit(int verMajor, int verMinor); converts successfully to: DllCall($h_ETWSSDLL, "int", "WSSInit", "int",4,"int",1) as long as the 4 and 1 are present the dll return 0 if I make them something else it response with -1 (version mismatch) WSSTerminate(void); to DllCall($h_ETWSSDLL, "int","WSSTerminate") I just do not know how to convert the following WSSGetUserInfo(USER_INFO * userInfo) to the Dllcall function DllCall($h_ETWSSDLL,"???","WSSGetAmbientBadges","???","SystemAccountName") Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 Well this might be help to others if I use the follwoing Autoit crashes: $XylocUser = DllCall($h_ETWSSDLL, "int", "WSSGetUserInfo","long", "XyLocKeyID") Link to comment Share on other sites More sharing options...
jchd Posted June 29, 2011 Share Posted June 29, 2011 You're supposed to conform to the function prototype. The parameter it expects clearly is a pointer to a structure, not a long. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 I think I understand what you are saying, Once we have the ptr of the value then I guess we ask for the value? I guess I really hunting for a good example, I kinda lost int eh next step $p = DllStructCreate("long XyLocKeyID;char SystemAccountName;char PersonalName") DllStructSetData($p, "userInfo", DllStructGetSize($p)) $AddrPtr = DllCall($h_ETWSSDLL,"int","WSSGetUserInfo","ptr",DllStructGetPtr($p)) DllStructCreate ( "USER_INFO" ,$AddrPtr) DllStructGetData($AddrPtr,1) Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 well I think I getting the pointer with this code, but once the array displays the Autoit crashes [0][0] [1][0x019CDAD8] autoit3.exe has encountered a problem and needs to close. We are sorry for the inconvenience. expandcollapse popup#include<array.au3> Global $h_ETWSSDLL Global $XylocStart $p = DllStructCreate("long XyLocKeyID;char SystemAccountName;char PersonalName") DllStructSetData($p, "userInfo", DllStructGetSize($p)) ;make the DllCall $h_ETWSSDLL = DllOpen("ETWSS.DLL") If $h_ETWSSDLL = -1 Then ConsoleWrite("OpenDll Failed: " & $h_ETWSSDLL & @LF) Exit EndIf ; call the dll to initiate $XylocStart = DllCall($h_ETWSSDLL, "int", "WSSInit", "int",4,"int",1) ConsoleWrite("Starting ETWSS.dll: "&$XylocStart&@CRLF) $ret = DllCall($h_ETWSSDLL,"int","WSSGetUserInfo","ptr",DllStructGetPtr($p)) if @error Then ConsoleWrite("Get User Info Error:"&@error&@CRLF) _ArrayDisplay($ret) <---- Autoit if Not $ret[0] Then ConsoleWrite("DllCall Error"&@CRLF) exit EndIf ;get the returned values $XylocID = DllStructGetData($p,"XyLocKeyID") $XylocUser = DllStructGetData($p,"SystemAccountName") $PersonalName = DllStructGetData($p,"PersonalName") ;free the struct $p =0 ConsoleWrite("OS Arch:"&@OSArch&@CRLF) ConsoleWrite("Xyloc ID: " & $XylocID & @CRLF) ConsoleWrite("XylocUser: " & $XylocUser & @CRLF) ConsoleWrite("PersonalName: " & $PersonalName & @CRLF) DllCall($h_ETWSSDLL,"int","WSSTerminate") DllClose($h_ETWSSDLL) Exit Link to comment Share on other sites More sharing options...
jchd Posted June 29, 2011 Share Posted June 29, 2011 Sorry for delay, I keep being distracted elsewhere! Try this: expandcollapse popup#include<array.au3> #cs ; probably WSS_CODE return values ??? If so, should be equated to clean constants XSO_OK XSO_NOT_INITED XSO_NOT_RESPONDING XSO_INTERNAL_ERROR USER_INFO typedef struct _USER_INFO { long TestAppKeyID; char SystemAccountName[MAX_NAME_LEN]; char PersonalName[MAX_NAME_LEN]; XSO_STATE TestAppState; } USER_INFO; #ce ;; NOTE: you need to fetch precise information as to what XSO_STATE is. ;; It is probably another structure but without more knowledge we are on thin ice. ;; for now, let's say it's a 2048-byte area. Maybe it's enough to hold what's going to be written there, but maybe not! Global $h_ETWSSDLL Global $XylocStart $p = DllStructCreate("long XyLocKeyID; char SystemAccountName[126]; char PersonalName[126]; byte AppState[2048]") ;~ DllStructSetData($p, "userInfo", DllStructGetSize($p)) ;; doesn't make sense: which member is "userInfo"? ;make the DllCall $h_ETWSSDLL = DllOpen("ETWSS.DLL") If $h_ETWSSDLL = -1 Then ConsoleWrite("OpenDll Failed: " & $h_ETWSSDLL & @LF) Exit EndIf ; call the dll to initiate $XylocStart = DllCall($h_ETWSSDLL, "int", "WSSInit", "int", 4, "int", 1) ConsoleWrite("Starting ETWSS.dll: " & $XylocStart & @CRLF) $ret = DllCall($h_ETWSSDLL, "int", "WSSGetUserInfo", "ptr", DllStructGetPtr($p)) if @error Then ConsoleWrite("Get User Info Error:" & @error & @CRLF) _ArrayDisplay($ret) if Not $ret[0] Then ConsoleWrite("DllCall Error" & @CRLF) exit EndIf ;get the returned values $XylocID = DllStructGetData($p, "XyLocKeyID") $XylocUser = DllStructGetData($p, "SystemAccountName") $PersonalName = DllStructGetData($p, "PersonalName") $AppState = DllStructGetData($p, "AppState") ;free the struct $p = 0 ConsoleWrite("OS Arch:" & @OSArch & @CRLF) ConsoleWrite("Xyloc ID: " & $XylocID & @CRLF) ConsoleWrite("XylocUser: " & $XylocUser & @CRLF) ConsoleWrite("PersonalName: " & $PersonalName & @CRLF) ; need to have info on AppState to display meaningful data DllCall($h_ETWSSDLL, "int", "WSSTerminate") DllClose($h_ETWSSDLL) And try to gather information about the unkown type XSO_STATE This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 thanks for your help here is the source code if it helps: expandcollapse popup#ifndef __ETWSSAPI_H_ #define __ETWSSAPI_H_ #ifdef __cplusplus extern "C" { #endif /* WSS API Version */ #define WSSAPI_VERSION_MAJOR 4 #define WSSAPI_VERSION_MINOR 1 #ifdef _WSS_EXPT #define WSS_DECL __declspec(dllexport) #else #define WSS_DECL #endif #define MAX_NAME_LEN 256 /* API Return Code */ typedef enum WSS_CODE { WSS_OK = 0, /* WSS API no error */ WSS_VERSION_MISMATCH = -1, /* WSS API version mismatch */ WSS_NOT_INITED = -2, /* WSS API has not been initialized */ WSS_NOT_AVAILABLE = -3, /* XyLoc Service is not available */ WSS_NOT_RESPONDING = -4, /* XyLoc Service is not responding */ WSS_INTERNAL_ERROR = -5, /* WSS API internal error */ WSS_STORE_NOT_OPEN = -6, /* Cannot open param store */ WSS_STORE_ERROR_READ = -7, /* Cannot read from store */ WSS_STORE_ERROR_WRITE = -8, /* Cannot write to store */ WSS_PARAM_NOT_FOUND = -9, /* User-defined param not found */ WSS_PARAM_NOT_ENOUGH_SPACE = -10, /* Not enough space on user-defined param buffer */ WSS_PARAM_BUFFER_OVERFLOW = -11, /* Param buffer overflow*/ WSS_AUTH_FAIL = -12, /* XyLoc user authentication fail */ } WSS_CODE; /* Wireless Security Event */ typedef enum WSS_EVENT { WSS_EVENT_UNLOCK = 0, /* Wireless Security Unlock */ WSS_EVENT_LOCK, /* Wireless Security Lock */ } WSS_EVENT; typedef enum WSS_EVENT_TRIGGER { WSS_UNKNOWN_TRIGGER = 0, /* Unknown Trigger */ WSS_KEY_SIGNAL_STRENGTH, /* XyLoc key signal strength is out of unlock range */ WSS_KEY_TIMEOUT, /* XyLoc does not receive key signal within time limit */ WSS_LOCK_NOT_FOUND, /* XyLoc lock is not found */ WSS_MANUAL_LOCK, /* User manual lock the PC */ WSS_KEY_TURN_OFF, /* User turned off the key */ WSS_AUTHENTICATION_FAILED, /* XyLoc Security Server authentication failed */ WSS_PWDOVERRIDE_TIMEOUT, /* Password override grace period timeout */ WSS_STATIONARY_KEY_TIMEOUT, /* Stationary key timeout */ WSS_KEY_PRESENT, /* XyLoc Key is present */ WSS_MANUAL_OVERRIDE, /* Manual password override */ } WSS_EVENT_TRIGGER; typedef enum WSS_STATE { WSS_UNKNOWN_STATE = 0, /* Unknown State */ WSS_LOCKED, /* PC is locked */ WSS_UNLOCKED, /* PC is unlocked by XyLoc Key */ WSS_OVERRIDE, /* PC is unlocked by user manual override */ } WSS_STATE; /* User Info */ typedef struct _USER_INFO { long XyLocKeyID; /* Current XyLoc User's Wireless Key ID */ char SystemAccountName[MAX_NAME_LEN]; /* Current XyLoc User's System Account Name */ char PersonalName[MAX_NAME_LEN]; /* Current XyLoc User's Personal Name */ WSS_STATE XyLocState; /* Current XyLoc State */ } USER_INFO; typedef struct _BADGES { int count; /* number of badges */ long *ListofIDs; /* Array/list of IDS */ } BADGES; /* Prototype for event handler callback function */ typedef void (WINAPI *WSSEventHandler)(WSS_EVENT, WSS_EVENT_TRIGGER); typedef WSS_CODE (WINAPI *PFNWSSINIT)(int, int); typedef WSS_CODE (WINAPI *PFNWSSTERMINATE)(void); typedef WSS_CODE (WINAPI *PFNWSSREGISTEREVENTHANDLER)(WSSEventHandler); typedef WSS_CODE (WINAPI *PFNWSSREMOVEEVENTHANDLER)(void); typedef WSS_CODE (WINAPI *PFNWSSGetID)(long * id); typedef WSS_CODE (WINAPI *PFNWSSREADPARAM)(long, long, char *, int *); typedef WSS_CODE (WINAPI *PFNWSSWRITEPARAM)(long, long, const char *, int); typedef WSS_CODE (WINAPI *PFNWSSREADPARAMOFFLINE)(long, long, char *, int *); typedef WSS_CODE (WINAPI *PFNWSSWRITEPARAMOFFLINE)(long, long, const char *, int); typedef WSS_CODE (WINAPI *PFNWSSREGISTERWINDOWHANDLER)(long, long); typedef WSS_CODE (WINAPI *PFNWSSREMOVEWINDOWHANDLER)(void); typedef WSS_CODE (WINAPI *PFNWSSXYLOCAUTHENTICATE)(char *, char *); /**************************** FUNCTION PROROTYPES ***************************/ WSS_CODE WINAPI WSSInit(int verMajor, int verMinor); WSS_CODE WINAPI WSSTerminate(void); WSS_CODE WINAPI WSSRegisterEventHandler(WSSEventHandler pfnEventHandler); WSS_CODE WINAPI WSSRemoveEventHandler(void); WSS_CODE WINAPI WSSGetUserInfo(USER_INFO * userInfo); WSS_CODE WINAPI WSSReadParam(long idApplication, long idKey, char * param, int * len); WSS_CODE WINAPI WSSWriteParam(long idApplication, long idKey, const char * param, int len); WSS_CODE WINAPI WSSGetAmbientBadges(BADGES **pListofIDs); void WINAPI WSSDelete(void * pBuffer); void WINAPI WSSDeleteBadges(BADGES * pBuffer); WSS_CODE WINAPI WSSReadParamOffline(long idApplication, long idKey, char * param, int * len); WSS_CODE WINAPI WSSWriteParamOffline(long idApplication, long idKey, const char * param, int len); WSS_CODE WINAPI WSSRegisterWindowHandler(long hwndCallback, long msgNum); WSS_CODE WINAPI WSSRemoveWindowHandler(void); WSS_CODE WINAPI WSSXyLocAuthenticate(char * username, char * password); #ifdef __cplusplus } #endif #endif // __ETWSSAPI_H_ Link to comment Share on other sites More sharing options...
RogFleming Posted June 29, 2011 Author Share Posted June 29, 2011 From the SDK Read me 4.3 WSSGetUserInfo Prototype: WSS_CODE WSSGetUserInfo(USER_INFO * userInfo) Arguments: userInfo The current user info to return Return Value: WSS_OK WSS_NOT_INITED WSS_NOT_RESPONDING WSS_INTERNAL_ERROR Remarks: Applications call this function after a successful call to WSSInit. This function will return the user information for the current logged in XyLoc user. XyLocKeyID is a unique ID assigned to each XyLoc badge. The application can use this ID to associate with its own user record. Applications can check the XyLocState to determine how it should grant or deny the access. For example, if the XyLoc State is in “Manual Override”, the application may want to ask the user to provide an additional credential. 3 API Data A C language header file called ETWSSAPI.h contains all function prototypes, error codes and data definitions that are described below. 3.1 USER_INFO typedef struct _USER_INFO { long XyLocKeyID; char SystemAccountName[MAX_NAME_LEN]; char PersonalName[MAX_NAME_LEN]; WSS_STATE XyLocState; } USER_INFO; XyLocKeyID This is the unique ID transmitted by, and printed on the XyLoc badge (a.k.a. Key). SystemAccountName This is the operating system account name for the current logged in user. PersonalName This is the XyLoc user’s personal name. XyLocState This is the current XyLoc system state. See WSS_STATE for more detail. 3.5 WSS_STATE typedef enum WSS_STATE { WSS_UNKNOWN_STATE = 0, WSS_LOCKED, WSS_UNLOCKED, WSS_OVERRIDE, } WSS_STATE; WSS_UNKNOWN_STATE Unknown State WSS_LOCKED PC is locked WSS_UNLOCKED PC is unlocked by XyLoc Key WSS_OVERRIDE PC is unlocked by user manual override Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now