diff -r b3647f81f4f6 Makefile --- a/Makefile Tue Mar 20 03:45:36 2018 -0500 +++ b/Makefile Tue Apr 17 10:17:35 2018 +0100 @@ -38,6 +38,7 @@ clean: rm -f *.o */*.o */*.a *.a drawterm drawterm.exe +.PHONY: $(LIBS1) kern/libkern.a: (cd kern; $(MAKE)) diff -r b3647f81f4f6 gui-win32/screen.c --- a/gui-win32/screen.c Tue Mar 20 03:45:36 2018 -0500 +++ b/gui-win32/screen.c Tue Apr 17 10:17:35 2018 +0100 @@ -307,6 +307,32 @@ p[i] = i; } +void +togglefull(HWND hwnd) +{ + static int full; + static LONG style, exstyle; + static WINDOWPLACEMENT pl; + MONITORINFO mi; + + full = !full; + if(full){ + SendMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); + style = GetWindowLong(hwnd, GWL_STYLE); + exstyle = GetWindowLong(hwnd, GWL_EXSTYLE); + pl.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(hwnd, &pl); + SetWindowLong(hwnd, GWL_STYLE, style & ~(WS_CAPTION | WS_THICKFRAME)); + SetWindowLong(hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE)); + mi.cbSize = sizeof(MONITORINFO); + GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi); + SetWindowPos(hwnd, NULL, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right - mi.rcMonitor.left, mi.rcMonitor.bottom - mi.rcMonitor.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); + }else{ + SetWindowLong(hwnd, GWL_STYLE, style); + SetWindowLong(hwnd, GWL_EXSTYLE, exstyle); + SetWindowPlacement(hwnd, &pl); + } +} Rune vk2rune[256] = { [VK_CANCEL] Kbreak, @@ -409,6 +435,8 @@ break; case WM_SYSKEYUP: case WM_KEYUP: + if(wparam == VK_PAUSE) + togglefull(hwnd); i = (lparam>>16)&0xFF; k = scdown[i]; if(k != 0){ diff -r b3647f81f4f6 kern/devfs-win32.c --- a/kern/devfs-win32.c Tue Mar 20 03:45:36 2018 -0500 +++ b/kern/devfs-win32.c Tue Apr 17 10:17:35 2018 +0100 @@ -423,7 +423,7 @@ if(perm & DMDIR) { wchar_t *p; DIR *d; - if(m || t!=TPATH_FILE) + if(m || t==TPATH_ROOT) error(Eperm); if(!CreateDirectory(newpath, NULL)) oserror(); diff -r b3647f81f4f6 kern/devip-win32.c --- a/kern/devip-win32.c Tue Mar 20 03:45:36 2018 -0500 +++ b/kern/devip-win32.c Tue Apr 17 10:17:35 2018 +0100 @@ -1,3 +1,4 @@ +#define _WIN32_WINNT 0x0501 #include #include #include @@ -215,7 +216,7 @@ so_gethostbyname(char *host, char **hostv, int n) { char buf[INET6_ADDRSTRLEN]; - PADDRINFOA r, p; + struct addrinfo *r, *p; DWORD l; int i; diff -r b3647f81f4f6 kern/win32.c --- a/kern/win32.c Tue Mar 20 03:45:36 2018 -0500 +++ b/kern/win32.c Tue Apr 17 10:17:35 2018 +0100 @@ -126,12 +126,16 @@ ReleaseSemaphore(op->sema, 1, 0); } -#define RtlGenRandom SystemFunction036 -BOOLEAN WINAPI RtlGenRandom(PVOID, ULONG); +BOOLEAN WINAPI (*RtlGenRandom)(PVOID, ULONG); void randominit(void) { + HMODULE mod; + + mod = LoadLibraryW(L"ADVAPI32.DLL"); + if(mod != NULL) + RtlGenRandom = (void *) GetProcAddress(mod, "SystemFunction036"); } ulong