X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwinpgen.c;h=d767b233928ee1243f1a4931b226e38a05c23890;hb=49d2cf19accb059b3b68d1fc2b78e606a578c3e8;hp=dc9d27304944d5c74a0c048182600646608a3855;hpb=36fc6c0a76dc763509feaca48295a9befa7d5c4d;p=PuTTY.git diff --git a/windows/winpgen.c b/windows/winpgen.c index dc9d2730..d767b233 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -17,7 +17,7 @@ #define ICON_BIG 1 #endif -#define WM_DONEKEY (WM_XUSER + 1) +#define WM_DONEKEY (WM_APP + 1) #define DEFAULT_KEYSIZE 1024 @@ -801,8 +801,9 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, switch (msg) { case WM_INITDIALOG: if (help_path) - SetWindowLong(hwnd, GWL_EXSTYLE, - GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_CONTEXTHELP); + SetWindowLongPtr(hwnd, GWL_EXSTYLE, + GetWindowLongPtr(hwnd, GWL_EXSTYLE) | + WS_EX_CONTEXTHELP); else { /* * If we add a Help button, this is where we destroy it @@ -818,7 +819,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, state->collecting_entropy = FALSE; state->entropy = NULL; state->key_exists = FALSE; - SetWindowLong(hwnd, GWL_USERDATA, (LONG) state); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) state); { HMENU menu, menu1; @@ -943,7 +944,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, return 1; case WM_MOUSEMOVE: - state = (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + state = (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (state->collecting_entropy && state->entropy && state->entropy_got < state->entropy_required) { state->entropy[state->entropy_got++] = lParam; @@ -994,7 +995,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, case IDC_KEYSSH2DSA: { state = (struct MainDlgState *) - GetWindowLong(hwnd, GWL_USERDATA); + GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!IsDlgButtonChecked(hwnd, LOWORD(wParam))) CheckRadioButton(hwnd, IDC_KEYSSH1, IDC_KEYSSH2DSA, LOWORD(wParam)); @@ -1008,7 +1009,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, case IDC_COMMENTEDIT: if (HIWORD(wParam) == EN_CHANGE) { state = (struct MainDlgState *) - GetWindowLong(hwnd, GWL_USERDATA); + GetWindowLongPtr(hwnd, GWLP_USERDATA); if (state->key_exists) { HWND editctl = GetDlgItem(hwnd, IDC_COMMENTEDIT); int len = GetWindowTextLength(editctl); @@ -1047,7 +1048,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, HIWORD(wParam) != BN_DOUBLECLICKED) break; state = - (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!state->generation_thread_exists) { BOOL ok; state->keysize = GetDlgItemInt(hwnd, IDC_BITS, &ok, FALSE); @@ -1103,7 +1104,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, if (HIWORD(wParam) != BN_CLICKED) break; state = - (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (state->key_exists) { char filename[FILENAME_MAX]; char passphrase[PASSPHRASE_MAXLEN]; @@ -1198,7 +1199,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, if (HIWORD(wParam) != BN_CLICKED) break; state = - (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (state->key_exists) { char filename[FILENAME_MAX]; if (prompt_keyfile(hwnd, "Save public key as:", @@ -1233,7 +1234,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, if (HIWORD(wParam) != BN_CLICKED) break; state = - (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); if (!state->generation_thread_exists) { char filename[FILENAME_MAX]; if (prompt_keyfile(hwnd, "Load private key:", @@ -1245,7 +1246,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, } return 0; case WM_DONEKEY: - state = (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + state = (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); state->generation_thread_exists = FALSE; state->key_exists = TRUE; SendDlgItemMessage(hwnd, IDC_PROGRESS, PBM_SETRANGE, 0, @@ -1385,7 +1386,7 @@ static int CALLBACK MainDlgProc(HWND hwnd, UINT msg, } break; case WM_CLOSE: - state = (struct MainDlgState *) GetWindowLong(hwnd, GWL_USERDATA); + state = (struct MainDlgState *) GetWindowLongPtr(hwnd, GWLP_USERDATA); sfree(state); if (requested_help) { WinHelp(hwnd, help_path, HELP_QUIT, 0);