mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
Added checkbox to toggle broadcasting to all subnets in configuration program.
This commit is contained in:
parent
3d72ad087d
commit
057a2aa844
@ -35,6 +35,7 @@
|
|||||||
#define ID_NIC_NODE 6
|
#define ID_NIC_NODE 6
|
||||||
#define ID_W95_BUG 7
|
#define ID_W95_BUG 7
|
||||||
#define ID_UDP_BTN 8
|
#define ID_UDP_BTN 8
|
||||||
|
#define ID_BCAST_ALL 9
|
||||||
|
|
||||||
#define ID_DIALOG_TXT 1
|
#define ID_DIALOG_TXT 1
|
||||||
#define ID_DIALOG_OK 2
|
#define ID_DIALOG_OK 2
|
||||||
@ -62,6 +63,7 @@ struct reg_value {
|
|||||||
struct reg_global {
|
struct reg_global {
|
||||||
uint16_t udp_port;
|
uint16_t udp_port;
|
||||||
unsigned char w95_bug;
|
unsigned char w95_bug;
|
||||||
|
unsigned char bcast_all;
|
||||||
} __attribute__((__packed__));
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
typedef std::vector<iface> iface_list;
|
typedef std::vector<iface> iface_list;
|
||||||
@ -98,6 +100,7 @@ static struct {
|
|||||||
|
|
||||||
HWND global_conf;
|
HWND global_conf;
|
||||||
HWND w95_bug;
|
HWND w95_bug;
|
||||||
|
HWND bcast_all;
|
||||||
|
|
||||||
HWND button_box;
|
HWND button_box;
|
||||||
} windows;
|
} windows;
|
||||||
@ -187,6 +190,10 @@ static LRESULT CALLBACK main_wproc(HWND window, UINT msg, WPARAM wp, LPARAM lp)
|
|||||||
addr_input_dialog("UDP port", NULL, 2);
|
addr_input_dialog("UDP port", NULL, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ID_BCAST_ALL:
|
||||||
|
global_conf.bcast_all = Button_GetCheck(windows.bcast_all) == BST_CHECKED;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -401,6 +408,7 @@ int main() {
|
|||||||
if(!regkey || RegQueryValueEx(regkey, "global", NULL, NULL, (BYTE*)&global_conf, &gsize) != ERROR_SUCCESS || gsize != sizeof(global_conf)) {
|
if(!regkey || RegQueryValueEx(regkey, "global", NULL, NULL, (BYTE*)&global_conf, &gsize) != ERROR_SUCCESS || gsize != sizeof(global_conf)) {
|
||||||
global_conf.udp_port = PORT;
|
global_conf.udp_port = PORT;
|
||||||
global_conf.w95_bug = 1;
|
global_conf.w95_bug = 1;
|
||||||
|
global_conf.bcast_all = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get_nics();
|
get_nics();
|
||||||
@ -596,12 +604,13 @@ static void init_windows() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
windows.global_conf = create_child(windows.main, 0, 0, 0, text_h + row_h + 10, "BUTTON", "Global settings", BS_GROUPBOX);
|
windows.global_conf = create_child(windows.main, 0, 0, 0, text_h + 2*row_h + 15, "BUTTON", "Global settings", BS_GROUPBOX);
|
||||||
|
|
||||||
int cbox_w = get_text_width(windows.global_conf, "Enable Win 95 SO_BROADCAST bug");
|
int cbox_w = get_text_width(windows.global_conf, "Enable Win 95 SO_BROADCAST bug");
|
||||||
|
|
||||||
create_child(windows.global_conf, 10, text_h, btn_w, row_h, "BUTTON", "Set UDP port...", BS_PUSHBUTTON | WS_TABSTOP, 0, ID_UDP_BTN);
|
create_child(windows.global_conf, 10, text_h, btn_w, row_h, "BUTTON", "Set UDP port...", BS_PUSHBUTTON | WS_TABSTOP, 0, ID_UDP_BTN);
|
||||||
windows.w95_bug = create_child(windows.global_conf, btn_w+20, text_h, cbox_w, row_h, "BUTTON", "Enable Win 95 SO_BROADCAST bug", BS_AUTOCHECKBOX | WS_TABSTOP, 0, ID_W95_BUG);
|
windows.w95_bug = create_child(windows.global_conf, btn_w+20, text_h, cbox_w, row_h, "BUTTON", "Enable Win 95 SO_BROADCAST bug", BS_AUTOCHECKBOX | WS_TABSTOP, 0, ID_W95_BUG);
|
||||||
|
windows.bcast_all = create_child(windows.global_conf, btn_w+20, text_h+row_h+5, cbox_w, row_h, "BUTTON", "Send broadcasts to all subnets", BS_AUTOCHECKBOX | WS_TABSTOP, 0, ID_BCAST_ALL);
|
||||||
Button_SetCheck(windows.w95_bug, global_conf.w95_bug ? BST_CHECKED : BST_UNCHECKED);
|
Button_SetCheck(windows.w95_bug, global_conf.w95_bug ? BST_CHECKED : BST_UNCHECKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user