int ui_passwd_cb(char *buf, int size, int rwflag, void *userdata) {
    int len;

    (void)rwflag; /* squash the unused parameter warning */
    (void)userdata; /* squash the unused parameter warning */
    if(!DialogBox(ghInst, TEXT("PassBox"), hwnd, (DLGPROC)pass_proc))
        return 0; /* dialog cancelled or failed */
    len=(int)strlen(ui_pass);
    if(len<0 || size<0) /* the API uses signed integers */
        return 0;
    if(len>size) /* truncate the returned data if needed */
        len=size;
    memcpy(buf, ui_pass, (size_t)len);
    memset(ui_pass, 0, sizeof ui_pass);
    return len;
}
int ui_passwd_cb(char *buf, int size, int rwflag, void *userdata) {
    int len;

    (void)rwflag;  
    (void)userdata;  
    if(!DialogBox(ghInst, TEXT("PassBox"), hwnd, (DLGPROC)pass_proc))
        return 0;  
    len=(int)strlen(ui_pass);
    if(len<0 || size<0)  
        return 0;
    if(len>size)  
        len=size;
    memcpy(buf, ui_pass, (size_t)len);
    memset(ui_pass, 0, sizeof ui_pass);
    return len;
}