Odd problem with called function in DLL

Discussion in 'C Programming' started by Jake Thompson, Jan 6, 2006.

  1. all psz fields are char *

    I am doing this


    gencm.pszDBName = cszConnect_s;
    gencm.pszApplicationName = NULL;
    gencm.pszUserID = cu_dbvi__szUserName;
    gencm.pszPassword = cu_dbvi__szPassword;
    gencm.pszNewPassword = (strlen(cu_dbvi__szNewPassword) ?
    cu_dbvi__szNewPassword : NULL);
    gencm.pszProxyID = NULL;
    gencm.pszProxyScope = NULL;
    gencm.fSession = SIM_SS_NORMAL;
    gencm.pAsyncCtl = NULL;
    //lstat = SimLibLogon(cszConnect_s, NULL, cu_dbvi__szUserName,
    cu_dbvi__szPassword,
    // (strlen(cu_dbvi__szNewPassword) ? cu_dbvi__szNewPassword : NULL),
    NULL, NULL, SIM_SS_NORMAL, NULL, &rc
    );

    lstat = u_generic_cm_call(L"Logon", gencm, &rc);

    When I set the code up to go to the Generic call it goes to the dll and
    finds the generic call and looks and finds Logon
    All the values are what they should be in the exe and in the dll. When
    it finds the tag logon it perfoms

    l_stat = SimLibLogoff( gencmdll.hSession, gencmdll.pAsyncCtl, pRC );

    that in turn does the following - Something that was not changed

    ULONG SIMENTRY SimLibLogon( pszDBName, pszApplicationName, pszUserID,
    pszPassword, pszNewPassword,
    pszProxyID, pszProxyScope, fSession, pAsyncCtl, pRC )

    PSZ pszDBName, pszApplicationName, pszUserID, pszPassword,
    pszNewPassword;
    PSZ pszProxyID, pszProxyScope;
    BITS fSession;
    PASYNCCTLSTRUCT pAsyncCtl;
    PRCSTRUCT pRC;
    {
    if(!hLibrary)
    {
    if(u_lib_init(TRUE))
    return(1);
    }
    return(u_SimLibLogon( pszDBName, pszApplicationName, pszUserID,
    pszPassword, pszNewPassword,
    pszProxyID, pszProxyScope, fSession, pAsyncCtl, pRC ));

    When I run it comes back with a 6081 saying I can't login however
    if I swap out the code to call directly

    lstat = SimLibLogon(cszConnect_s, NULL, cu_dbvi__szUserName,
    cu_dbvi__szPassword,
    (strlen(cu_dbvi__szNewPassword) ? cu_dbvi__szNewPassword : NULL),
    NULL, NULL, SIM_SS_NORMAL, NULL, &rc
    );

    then it returns sucessfully

    I don't get it both are sending the same data however one is going
    through an initial generic call and the other one is not. Do you guys
    have any ideas? At first I thought it was data related but as I said
    everything is passed properly and the only fields that are really used
    are the cszConnect, cu_dbvi__szUserName, cu_dbvi__szPassword, and the
    (strlen(cu_dbvi__szNewPassword) ? cu_dbvi__szNewPassword : NULL)

    The values of what is passed

    cszConnect = L for the first value of "LIBSRVN"
    cu_dbvi__szPassword = j for "jake"
    cu_dbvi__szPassword = p for "password" <----not actual password :)
    cu_dbvi__szPassword, and the (strlen(cu_dbvi__szNewPassword) ?
    cu_dbvi__szNewPassword : NULL) = Null because I don't have a new
    password

    Ideas?

    Thanks
    Jake
    Jake Thompson, Jan 6, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anushi
    Replies:
    5
    Views:
    8,625
  2. Jake Thompson

    odd problem in called function

    Jake Thompson, Jan 6, 2006, in forum: C Programming
    Replies:
    0
    Views:
    275
    Jake Thompson
    Jan 6, 2006
  3. Michael Speer

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,062
    Richard Heathfield
    Feb 18, 2007
  4. Felix
    Replies:
    1
    Views:
    328
    Felix
    Sep 29, 2006
  5. H. Simpson
    Replies:
    4
    Views:
    244
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page