of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0" "All Files (*.*)\0*\0\0\0";
of.lpstrFilter = FILTER_KEY_FILES;
static void prompt_add_keyfile(void){    OPENFILENAME of;    char filename[FILENAME_MAX];    char *filelist = snewn(8192, char);    char *filewalker;    int n, dirlen;	    memset(&of, 0, sizeof(of));#ifdef OPENFILENAME_SIZE_VERSION_400    of.lStructSize = OPENFILENAME_SIZE_VERSION_400;#else    of.lStructSize = sizeof(of);#endif    of.hwndOwner = main_hwnd;    of.lpstrFilter = "PuTTY Private Key Files (*.ppk)\0*.ppk\0"	"All Files (*.*)\0*\0\0\0";    of.lpstrCustomFilter = NULL;    of.nFilterIndex = 1;    of.lpstrFile = filelist;    *filelist = '\0';    of.nMaxFile = FILENAME_MAX;    of.lpstrFileTitle = NULL;    of.lpstrInitialDir = NULL;    of.lpstrTitle = "Select Private Key File";    of.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;    if (GetOpenFileName(&of)) {	if(strlen(filelist) > of.nFileOffset)	    /* Only one filename returned? */	    add_keyfile(filename_from_str(filelist));	else {	    /* we are returned a bunch of strings, end to	     * end. first string is the directory, the	     * rest the filenames. terminated with an	     * empty string.	     */	    filewalker = filelist;	    dirlen = strlen(filewalker);	    if(dirlen > FILENAME_MAX - 8) return;	    memcpy(filename, filewalker, dirlen);	    filewalker += dirlen + 1;	    filename[dirlen++] = '\\';	    /* then go over names one by one */	    for(;;) {		n = strlen(filewalker) + 1;		/* end of the list */		if(n == 1)		    break;		/* too big, shouldn't happen */		if(n + dirlen > FILENAME_MAX)		    break;		memcpy(filename + dirlen, filewalker, n);		filewalker += n;		add_keyfile(filename_from_str(filename));	    }	}	keylist_update();	forget_passphrases();    }    sfree(filelist);}