From f7b65c987fda52acc5df5594bc8d7aa491c4d555 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Thu, 19 Apr 2007 13:02:31 +0200 Subject: [PATCH] push f19c907ab00e303c34c91d18c0dfddd2e9ddf00c --- .gitignore | 1 + dlls/Makefile.in | 4 + dlls/advapi32/tests/registry.c | 133 +++++++++- dlls/d3d9/d3d9_private.h | 11 +- dlls/d3d9/device.c | 87 +++++-- dlls/d3d9/directx.c | 5 + dlls/d3d9/tests/vertexdeclaration.c | 25 +- dlls/d3d9/vertexdeclaration.c | 30 +-- dlls/dbghelp/dwarf.c | 18 +- dlls/dbghelp/minidump.c | 4 +- dlls/dbghelp/module.c | 2 +- dlls/dbghelp/msc.c | 9 +- dlls/dnsapi/query.c | 15 +- dlls/iphlpapi/iphlpapi_main.c | 14 +- dlls/kernel32/sync.c | 18 +- dlls/kernel32/tests/pipe.c | 3 + dlls/localspl/Makefile.in | 2 +- dlls/localspl/localmon.c | 93 ++++--- dlls/localui/Makefile.in | 2 +- dlls/localui/localui.c | 76 +++++- dlls/msvcrt/msvcrt.spec | 2 +- dlls/ntdll/file.c | 74 +----- dlls/ntdll/nt.c | 2 +- dlls/ntdll/ntdll_misc.h | 4 +- dlls/ntdll/process.c | 4 +- dlls/ntdll/server.c | 2 +- dlls/ntdll/sync.c | 51 ++-- dlls/ntdll/thread.c | 4 +- dlls/ntdll/time.c | 81 +----- dlls/shell32/shell32.spec | 6 +- dlls/shell32/shell32_main.c | 3 + dlls/shell32/shlexec.c | 24 +- dlls/shell32/tests/shlexec.c | 18 +- dlls/spoolss/Makefile.in | 1 + dlls/user32/message.c | 11 +- dlls/uxtheme/msstyles.h | 2 +- dlls/wined3d/drawprim.c | 4 +- dlls/wined3d/utils.c | 1 - dlls/winspool.drv/Es.rc | 38 +++ dlls/winspool.drv/winspool.rc | 1 + include/wine/server_protocol.h | 75 ++---- programs/taskmgr/Ja.rc | 501 ++++++++++++++++++++++++++++++++++++ programs/taskmgr/taskmgr.rc | 1 + server/async.c | 4 +- server/fd.c | 125 +++++---- server/file.h | 23 +- server/mailslot.c | 16 +- server/main.c | 8 +- server/named_pipe.c | 279 ++++++++++---------- server/object.h | 4 +- server/process.c | 18 +- server/process.h | 4 +- server/protocol.def | 58 ++--- server/queue.c | 25 +- server/registry.c | 7 +- server/request.c | 19 +- server/request.h | 4 - server/serial.c | 13 +- server/thread.c | 54 ++-- server/thread.h | 4 +- server/timer.c | 61 ++--- server/trace.c | 107 ++++---- server/winstation.c | 4 +- tools/make_requests | 3 +- 64 files changed, 1505 insertions(+), 797 deletions(-) create mode 100644 dlls/winspool.drv/Es.rc create mode 100644 programs/taskmgr/Ja.rc diff --git a/.gitignore b/.gitignore index 6ac3e499749..b4298a7b50c 100644 --- a/.gitignore +++ b/.gitignore @@ -510,6 +510,7 @@ dlls/snmpapi/tests/*.ok dlls/snmpapi/tests/snmpapi_crosstest.exe dlls/snmpapi/tests/testlist.c dlls/sound.drv16 +dlls/spoolss/libspoolss.def dlls/stdole2.tlb/rsrc.res dlls/stdole2.tlb/std_ole_v2.tlb dlls/stdole32.tlb/rsrc.res diff --git a/dlls/Makefile.in b/dlls/Makefile.in index f465d7ab538..7ec57113ff9 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -552,6 +552,7 @@ IMPORT_LIBS = \ shfolder/libshfolder.$(IMPLIBEXT) \ shlwapi/libshlwapi.$(IMPLIBEXT) \ snmpapi/libsnmpapi.$(IMPLIBEXT) \ + spoolss/libspoolss.$(IMPLIBEXT) \ sti/libsti.$(IMPLIBEXT) \ tapi32/libtapi32.$(IMPLIBEXT) \ unicows/libunicows.$(IMPLIBEXT) \ @@ -869,6 +870,9 @@ shlwapi/libshlwapi.$(IMPLIBEXT): shlwapi/shlwapi.spec $(WINEBUILD) snmpapi/libsnmpapi.$(IMPLIBEXT): snmpapi/snmpapi.spec $(WINEBUILD) @cd snmpapi && $(MAKE) libsnmpapi.$(IMPLIBEXT) +spoolss/libspoolss.$(IMPLIBEXT): spoolss/spoolss.spec $(WINEBUILD) + @cd spoolss && $(MAKE) libspoolss.$(IMPLIBEXT) + sti/libsti.$(IMPLIBEXT): sti/sti.spec $(WINEBUILD) @cd sti && $(MAKE) libsti.$(IMPLIBEXT) diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 26433349e7c..cf581d7e182 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -20,6 +20,7 @@ #include #include +#include #include "wine/test.h" #include "windef.h" #include "winbase.h" @@ -37,6 +38,127 @@ static HMODULE hadvapi32; static DWORD (WINAPI *pRegGetValueA)(HKEY,LPCSTR,LPCSTR,DWORD,LPDWORD,PVOID,LPDWORD); static DWORD (WINAPI *pRegDeleteTreeA)(HKEY,LPCSTR); + + +/* Debugging functions from wine/libs/wine/debug.c */ + +/* allocate some tmp string space */ +/* FIXME: this is not 100% thread-safe */ +static char *get_temp_buffer( int size ) +{ + static char *list[32]; + static long pos; + char *ret; + int idx; + + idx = ++pos % (sizeof(list)/sizeof(list[0])); + if ((ret = realloc( list[idx], size ))) list[idx] = ret; + return ret; +} + +/* default implementation of wine_dbgstr_an */ +static const char *wine_debugstr_an( const char *str, int n ) +{ + static const char hex[16] = "0123456789abcdef"; + char *dst, *res; + size_t size; + + if (!((ULONG_PTR)str >> 16)) + { + if (!str) return "(null)"; + res = get_temp_buffer( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); + return res; + } + if (n == -1) n = strlen(str); + if (n < 0) n = 0; + size = 10 + min( 300, n * 4 ); + dst = res = get_temp_buffer( size ); + *dst++ = '"'; + while (n-- > 0 && dst <= res + size - 9) + { + unsigned char c = *str++; + switch (c) + { + case '\n': *dst++ = '\\'; *dst++ = 'n'; break; + case '\r': *dst++ = '\\'; *dst++ = 'r'; break; + case '\t': *dst++ = '\\'; *dst++ = 't'; break; + case '"': *dst++ = '\\'; *dst++ = '"'; break; + case '\\': *dst++ = '\\'; *dst++ = '\\'; break; + default: + if (c >= ' ' && c <= 126) + *dst++ = c; + else + { + *dst++ = '\\'; + *dst++ = 'x'; + *dst++ = hex[(c >> 4) & 0x0f]; + *dst++ = hex[c & 0x0f]; + } + } + } + *dst++ = '"'; + if (n > 0) + { + *dst++ = '.'; + *dst++ = '.'; + *dst++ = '.'; + } + *dst++ = 0; + return res; +} + +/* default implementation of wine_dbgstr_wn */ +static const char *wine_debugstr_wn( const WCHAR *str, int n ) +{ + char *dst, *res; + + if (!HIWORD(str)) + { + if (!str) return "(null)"; + res = get_temp_buffer( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); + return res; + } + if (n == -1) n = lstrlenW(str); + if (n < 0) n = 0; + else if (n > 200) n = 200; + dst = res = get_temp_buffer( n * 5 + 7 ); + *dst++ = 'L'; + *dst++ = '"'; + while (n-- > 0) + { + WCHAR c = *str++; + switch (c) + { + case '\n': *dst++ = '\\'; *dst++ = 'n'; break; + case '\r': *dst++ = '\\'; *dst++ = 'r'; break; + case '\t': *dst++ = '\\'; *dst++ = 't'; break; + case '"': *dst++ = '\\'; *dst++ = '"'; break; + case '\\': *dst++ = '\\'; *dst++ = '\\'; break; + default: + if (c >= ' ' && c <= 126) + *dst++ = (char)c; + else + { + *dst++ = '\\'; + sprintf(dst,"%04x",c); + dst+=4; + } + } + } + *dst++ = '"'; + if (*str) + { + *dst++ = '.'; + *dst++ = '.'; + *dst++ = '.'; + } + *dst = 0; + return res; +} + + #define ADVAPI32_GET_PROC(func) \ p ## func = (void*)GetProcAddress(hadvapi32, #func); \ if(!p ## func) \ @@ -119,8 +241,9 @@ static void test_hkey_main_Value_A(LPCSTR name, LPCSTR string, } else { - ok(strcmp(value, string) == 0, "RegQueryValueExA failed: '%s' != '%s'\n", - value, string); + ok(memcmp(value, string, cbData) == 0, "RegQueryValueExA failed: %s/%d != %s/%d\n", + wine_debugstr_an(value, cbData), cbData, + wine_debugstr_an(string, full_byte_len), full_byte_len); } HeapFree(GetProcessHeap(), 0, value); } @@ -158,7 +281,9 @@ static void test_hkey_main_Value_W(LPCWSTR name, LPCWSTR string, /* When cbData == 0, RegQueryValueExW() should not modify the buffer */ string=nW; } - ok(lstrcmpW(value, string) == 0, "the string RegQueryValueExW is wrong\n"); + ok(memcmp(value, string, cbData) == 0, "RegQueryValueExW failed: %s/%d != %s/%d\n", + wine_debugstr_wn(value, cbData), cbData, + wine_debugstr_wn(string, full_byte_len), full_byte_len); HeapFree(GetProcessHeap(), 0, value); } @@ -170,7 +295,7 @@ static void test_set_value(void) static const WCHAR name2W[] = {'S','o','m','e','I','n','t','r','a','Z','e','r','o','e','d','S','t','r','i','n','g', 0}; static const WCHAR emptyW[] = {0}; static const WCHAR string1W[] = {'T','h','i','s','N','e','v','e','r','B','r','e','a','k','s', 0}; - static const WCHAR string2W[] = {'T','h','i','s', 0 ,'B','r','e','a','k','s', 0 , 0 ,'A', 0 , 0 , 0 , 0 ,'L','o','t', 0 , 0 , 0 , 0}; + static const WCHAR string2W[] = {'T','h','i','s', 0 ,'B','r','e','a','k','s', 0 , 0 ,'A', 0 , 0 , 0 , 'L','o','t', 0 , 0 , 0 , 0, 0}; static const char name1A[] = "CleanSingleString"; static const char name2A[] = "SomeIntraZeroedString"; diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index cef1c1f0f46..33c780bac4e 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -178,10 +178,8 @@ typedef struct IDirect3DDevice9Impl /* Avoids recursion with nested ReleaseRef to 0 */ BOOL inDestruction; - /* A vertex declaration was converted from setFVF. - * Keep track of it, so it can be properly freed - */ - IDirect3DVertexDeclaration9 *convertedDecl; + IDirect3DVertexDeclaration9 **convertedDecls; + unsigned int numConvertedDecls, declArraySize; } IDirect3DDevice9Impl; @@ -485,11 +483,14 @@ typedef struct IDirect3DVertexDeclaration9Impl { /* IDirect3DVertexDeclaration9 fields */ IWineD3DVertexDeclaration *wineD3DVertexDeclaration; - + DWORD convFVF; + /* Parent reference */ LPDIRECT3DDEVICE9 parentDevice; } IDirect3DVertexDeclaration9Impl; +void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface); + /* ---------------------- */ /* IDirect3DVertexShader9 */ /* ---------------------- */ diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 48e3b0decb7..5adec6b5bf7 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -61,8 +61,17 @@ static ULONG WINAPI IDirect3DDevice9Impl_Release(LPDIRECT3DDEVICE9 iface) { TRACE("(%p) : ReleaseRef to %d\n", This, ref); if (ref == 0) { + int i; This->inDestruction = TRUE; - IDirect3DDevice9_SetVertexDeclaration(iface, NULL); + + for(i = 0; i < This->numConvertedDecls; i++) { + /* Unless Wine is buggy or the app has a bug the refcount will be 0, because decls hold a reference to the + * device + */ + IDirect3DVertexDeclaration9Impl_Destroy(This->convertedDecls[i]); + } + HeapFree(GetProcessHeap(), 0, This->convertedDecls); + IWineD3DDevice_Uninit3D(This->WineD3DDevice, D3D9CB_DestroyDepthStencilSurface, D3D9CB_DestroySwapChain); IWineD3DDevice_Release(This->WineD3DDevice); HeapFree(GetProcessHeap(), 0, This); @@ -769,29 +778,77 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(LPDIRECT3DDEVICE9 i return IWineD3DDevice_ProcessVertices(This->WineD3DDevice,SrcStartIndex, DestIndex, VertexCount, ((IDirect3DVertexBuffer9Impl *)pDestBuffer)->wineD3DVertexBuffer, ((IDirect3DVertexBuffer9Impl *)pVertexDecl)->wineD3DVertexBuffer, Flags); } +IDirect3DVertexDeclaration9 *getConvertedDecl(IDirect3DDevice9Impl *This, DWORD fvf) { + HRESULT hr; + D3DVERTEXELEMENT9* elements = NULL; + IDirect3DVertexDeclaration9* pDecl = NULL; + int p, low, high; /* deliberately signed */ + IDirect3DVertexDeclaration9 **convertedDecls = This->convertedDecls; + + TRACE("Searching for declaration for fvf %08x... ", fvf); + + low = 0; + high = This->numConvertedDecls - 1; + while(low <= high) { + p = (low + high) >> 1; + TRACE("%d ", p); + if(((IDirect3DVertexDeclaration9Impl *) convertedDecls[p])->convFVF == fvf) { + TRACE("found %p\n", convertedDecls[p]); + return convertedDecls[p]; + } else if(((IDirect3DVertexDeclaration9Impl *) convertedDecls[p])->convFVF < fvf) { + low = p + 1; + } else { + high = p - 1; + } + } + TRACE("not found. Creating and inserting at position %d.\n", low); + + hr = vdecl_convert_fvf(fvf, &elements); + if (hr != S_OK) return NULL; + + hr = IDirect3DDevice9Impl_CreateVertexDeclaration((IDirect3DDevice9 *) This, elements, &pDecl); + if (hr != S_OK) return NULL; + + if(This->declArraySize == This->numConvertedDecls) { + int grow = max(This->declArraySize / 2, 8); + convertedDecls = HeapReAlloc(GetProcessHeap(), 0, convertedDecls, + sizeof(convertedDecls[0]) * (This->numConvertedDecls + grow)); + if(!convertedDecls) { + /* This will destroy it */ + IDirect3DVertexDeclaration9_Release(pDecl); + return NULL; + } + This->convertedDecls = convertedDecls; + This->declArraySize += grow; + } + + memmove(convertedDecls + low + 1, convertedDecls + low, sizeof(IDirect3DVertexDeclaration9Impl *) * (This->numConvertedDecls - low)); + convertedDecls[low] = pDecl; + This->numConvertedDecls++; + + /* Will prevent the decl from beeing destroyed */ + ((IDirect3DVertexDeclaration9Impl *) pDecl)->convFVF = fvf; + IDirect3DVertexDeclaration9_Release(pDecl); /* Does not destroy now */ + + TRACE("Returning %p. %d decls in array\n", pDecl, This->numConvertedDecls); + return pDecl; +} + HRESULT WINAPI IDirect3DDevice9Impl_SetFVF(LPDIRECT3DDEVICE9 iface, DWORD FVF) { IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; TRACE("(%p) Relay\n" , This); if (0 != FVF) { HRESULT hr; - D3DVERTEXELEMENT9* elements = NULL; - IDirect3DVertexDeclaration9* pDecl = NULL; - - hr = vdecl_convert_fvf(FVF, &elements); - if (hr != S_OK) goto exit; + IDirect3DVertexDeclaration9* pDecl = getConvertedDecl(This, FVF); - hr = IDirect3DDevice9Impl_CreateVertexDeclaration(iface, elements, &pDecl); - if (hr != S_OK) goto exit; + if(!pDecl) { + /* Any situation when this should happen, except out of memory? */ + ERR("Failed to create a converted vertex declaration\n"); + return D3DERR_DRIVERINTERNALERROR; + } hr = IDirect3DDevice9Impl_SetVertexDeclaration(iface, pDecl); - if (hr != S_OK) goto exit; - This->convertedDecl = pDecl; - - exit: - HeapFree(GetProcessHeap(), 0, elements); - /* If allocated and set correctly, this will reduce the refcount to 0, but not destroy the declaration */ - if (pDecl) IUnknown_Release(pDecl); if (hr != S_OK) return hr; } diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c index fd383e96a74..699daffd85c 100644 --- a/dlls/d3d9/directx.c +++ b/dlls/d3d9/directx.c @@ -400,6 +400,11 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9 iface, UINT Adapte *ppReturnedDeviceInterface = NULL; } + /* Initialize the converted declaration array. This creates a valid pointer and when adding decls HeapReAlloc + * can be used without further checking + */ + object->convertedDecls = HeapAlloc(GetProcessHeap(), 0, 0); + return hr; } diff --git a/dlls/d3d9/tests/vertexdeclaration.c b/dlls/d3d9/tests/vertexdeclaration.c index 57867f188ce..c8b7a099fd7 100644 --- a/dlls/d3d9/tests/vertexdeclaration.c +++ b/dlls/d3d9/tests/vertexdeclaration.c @@ -652,7 +652,8 @@ static void test_fvf_decl_management( IDirect3DVertexDeclaration9* result_decl1 = NULL; IDirect3DVertexDeclaration9* result_decl2 = NULL; IDirect3DVertexDeclaration9* result_decl3 = NULL; - int ref1, ref2, ref3; + IDirect3DVertexDeclaration9* result_decl4 = NULL; + int ref1, ref2, ref3, ref4; DWORD test_fvf1 = D3DFVF_XYZRHW; DWORD test_fvf2 = D3DFVF_NORMAL; @@ -703,19 +704,35 @@ static void test_fvf_decl_management( /* Re-Check if the first decl was overwritten by the new Get() */ VDECL_CHECK(compare_elements(result_decl1, test_elements1)); - /* The refcounts should all be 1 */ + hr = IDirect3DDevice9_SetFVF( device, test_fvf1); + ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); + if (FAILED(hr)) return; + + hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl4); + ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); + if (FAILED(hr)) return; + + ok(result_decl4 == result_decl1, "Setting an already used FVF over results in a different vertexdeclaration\n"); + ref1 = get_refcount((IUnknown*) result_decl1); ref2 = get_refcount((IUnknown*) result_decl2); ref3 = get_refcount((IUnknown*) result_decl3); - ok (ref1 == 2, "Refcount #1 is %d, expected 2\n", ref1); - ok (ref2 == 2, "Refcount #2 is %d, expected 2\n", ref2); + ref4 = get_refcount((IUnknown*) result_decl4); + ok (ref1 == 3, "Refcount #1 is %d, expected 3\n", ref1); + ok (ref2 == 3, "Refcount #2 is %d, expected 3\n", ref2); ok (ref3 == 1, "Refcount #3 is %d, expected 1\n", ref3); + ok (ref4 == 3, "Refcount #4 is %d, expected 3\n", ref4); /* Clear down any current vertex declaration */ hr = IDirect3DDevice9_SetVertexDeclaration ( device, NULL ); ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); if (FAILED(hr)) return; + IDirect3DVertexDeclaration9_Release(result_decl1); + IDirect3DVertexDeclaration9_Release(result_decl2); + IDirect3DVertexDeclaration9_Release(result_decl3); + IDirect3DVertexDeclaration9_Release(result_decl4); + return; } diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c index 892f8acaf9e..ab7d484a78e 100644 --- a/dlls/d3d9/vertexdeclaration.c +++ b/dlls/d3d9/vertexdeclaration.c @@ -209,6 +209,18 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_AddRef(LPDIRECT3DVERTEXDECLA return ref; } +void IDirect3DVertexDeclaration9Impl_Destroy(LPDIRECT3DVERTEXDECLARATION9 iface) { + IDirect3DVertexDeclaration9Impl *This = (IDirect3DVertexDeclaration9Impl *)iface; + + if(This->ref != 0) { + /* Should not happen unless wine has a bug or the application releases references it does not own */ + ERR("Destroying vdecl with ref != 0\n"); + } + IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration); + HeapFree(GetProcessHeap(), 0, This->elements); + HeapFree(GetProcessHeap(), 0, This); +} + static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECLARATION9 iface) { IDirect3DVertexDeclaration9Impl *This = (IDirect3DVertexDeclaration9Impl *)iface; ULONG ref = InterlockedDecrement(&This->ref); @@ -217,12 +229,9 @@ static ULONG WINAPI IDirect3DVertexDeclaration9Impl_Release(LPDIRECT3DVERTEXDECL if (ref == 0) { IDirect3DDevice9 *parentDevice = This->parentDevice; - BOOL converted = ((IDirect3DDevice9Impl *) parentDevice)->convertedDecl == iface; - if(!converted) { - IWineD3DVertexDeclaration_Release(This->wineD3DVertexDeclaration); - HeapFree(GetProcessHeap(), 0, This->elements); - HeapFree(GetProcessHeap(), 0, This); + if(!This->convFVF) { + IDirect3DVertexDeclaration9Impl_Release(iface); } IUnknown_Release(parentDevice); } @@ -371,17 +380,6 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(LPDIRECT3DDEVICE9 ifa TRACE("(%p) : Relay\n", iface); - if (This->convertedDecl && This->convertedDecl != pDecl) { - IDirect3DVertexDeclaration9Impl *iDecl = (IDirect3DVertexDeclaration9Impl *) This->convertedDecl; - - /* Will need locking once we claim to be thread safe */ - if(iDecl->ref == 0) { - IUnknown_AddRef(This->convertedDecl); - IUnknown_Release(This->convertedDecl); - } - This->convertedDecl = NULL; - } - hr = IWineD3DDevice_SetVertexDeclaration(This->WineD3DDevice, pDeclImpl == NULL ? NULL : pDeclImpl->wineD3DVertexDeclaration); return hr; } diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 12195221cce..45fe854320c 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -342,7 +342,7 @@ static const char* dwarf2_debug_di(const dwarf2_debug_info_t* di) } static dwarf2_abbrev_entry_t* -dwarf2_abbrev_table_find_entry(struct sparse_array* abbrev_table, +dwarf2_abbrev_table_find_entry(const struct sparse_array* abbrev_table, unsigned long entry_code) { assert( NULL != abbrev_table ); @@ -782,7 +782,7 @@ compute_location(dwarf2_traverse_context_t* ctx, struct location* loc, } static BOOL dwarf2_compute_location_attr(dwarf2_parse_context_t* ctx, - dwarf2_debug_info_t* di, + const dwarf2_debug_info_t* di, unsigned long dw, struct location* loc, const struct location* frame) @@ -1095,7 +1095,7 @@ static struct symt* dwarf2_parse_reference_type(dwarf2_parse_context_t* ctx, } static void dwarf2_parse_udt_member(dwarf2_parse_context_t* ctx, - dwarf2_debug_info_t* di, + const dwarf2_debug_info_t* di, struct symt_udt* parent) { struct symt* elt_type; @@ -1197,7 +1197,7 @@ static struct symt* dwarf2_parse_udt_type(dwarf2_parse_context_t* ctx, } static void dwarf2_parse_enumerator(dwarf2_parse_context_t* ctx, - dwarf2_debug_info_t* di, + const dwarf2_debug_info_t* di, struct symt_enum* parent) { struct attribute name; @@ -1372,7 +1372,7 @@ static void dwarf2_parse_variable(dwarf2_subprogram_t* subpgm, } static void dwarf2_parse_subprogram_label(dwarf2_subprogram_t* subpgm, - dwarf2_debug_info_t* di) + const dwarf2_debug_info_t* di) { struct attribute name; struct attribute low_pc; @@ -1392,11 +1392,11 @@ static void dwarf2_parse_subprogram_label(dwarf2_subprogram_t* subpgm, static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, struct symt_block* parent_block, - dwarf2_debug_info_t* di); + const dwarf2_debug_info_t* di); static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, struct symt_block* parent_block, - dwarf2_debug_info_t* di) + const dwarf2_debug_info_t* di) { struct symt_block* block; struct attribute low_pc; @@ -1447,7 +1447,7 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, struct symt_block* parent_block, - dwarf2_debug_info_t* di) + const dwarf2_debug_info_t* di) { struct symt_block* block; struct attribute low_pc; @@ -1743,7 +1743,7 @@ static void dwarf2_load_one_entry(dwarf2_parse_context_t* ctx, } static void dwarf2_set_line_number(struct module* module, unsigned long address, - struct vector* v, unsigned file, unsigned line) + const struct vector* v, unsigned file, unsigned line) { struct symt_function* func; struct symt_ht* symt; diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 7c3ec6fdb68..e2b034f5225 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -112,7 +112,7 @@ static BOOL fetch_process_info(struct dump_context* dc) return FALSE; } -static void fetch_thread_stack(struct dump_context* dc, void* teb_addr, +static void fetch_thread_stack(struct dump_context* dc, const void* teb_addr, const CONTEXT* ctx, MINIDUMP_MEMORY_DESCRIPTOR* mmd) { NT_TIB tib; @@ -327,7 +327,7 @@ static void add_memory_block(struct dump_context* dc, ULONG64 base, ULONG size, * * Writes a chunk of data at a given position in the minidump */ -static void writeat(struct dump_context* dc, RVA rva, void* data, unsigned size) +static void writeat(struct dump_context* dc, RVA rva, const void* data, unsigned size) { DWORD written; diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index 5b8718d998a..21c88308669 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -368,7 +368,7 @@ struct module* module_find_by_addr(const struct process* pcs, unsigned long addr * checks whether the ELF container, for a (supposed) PE builtin is * already loaded */ -static BOOL module_is_elf_container_loaded(struct process* pcs, +static BOOL module_is_elf_container_loaded(const struct process* pcs, const WCHAR* ImageName, DWORD base) { size_t len; diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index dcd24e92b3b..6b99ed4309b 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -321,7 +321,7 @@ struct codeview_type_parse DWORD num; }; -static inline const void* codeview_jump_to_type(struct codeview_type_parse* ctp, DWORD idx) +static inline const void* codeview_jump_to_type(const struct codeview_type_parse* ctp, DWORD idx) { if (idx < FIRST_DEFINABLE_TYPE) return NULL; idx -= FIRST_DEFINABLE_TYPE; @@ -1926,7 +1926,7 @@ static HANDLE open_pdb_file(const struct process* pcs, } static void pdb_process_types(const struct msc_debug_info* msc_dbg, - const char* image, struct pdb_lookup* pdb_lookup) + const char* image, const struct pdb_lookup* pdb_lookup) { BYTE* types_image = NULL; @@ -2098,9 +2098,10 @@ static BOOL pdb_process_internal(const struct process* pcs, static void pdb_process_symbol_imports(const struct process* pcs, const struct msc_debug_info* msc_dbg, - PDB_SYMBOLS* symbols, + const PDB_SYMBOLS* symbols, const void* symbols_image, - char* image, struct pdb_lookup* pdb_lookup, + const char* image, + const struct pdb_lookup* pdb_lookup, unsigned module_index) { if (module_index == -1 && symbols && symbols->pdbimport_size) diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c index 38f8801b295..5d9d6dbbdda 100644 --- a/dlls/dnsapi/query.c +++ b/dlls/dnsapi/query.c @@ -65,6 +65,17 @@ static CRITICAL_SECTION resolver_cs = { &resolver_cs_debug, -1, 0, 0, 0, 0 }; #define LOCK_RESOLVER() do { EnterCriticalSection( &resolver_cs ); } while (0) #define UNLOCK_RESOLVER() do { LeaveCriticalSection( &resolver_cs ); } while (0) +static int resolver_initialised; + +/* call res_init() just once because of a bug in Mac OSX 10.4 */ +static void initialise_resolver( void ) +{ + if (!resolver_initialised) + { + res_init(); + resolver_initialised = 1; + } +} static const char *dns_section_to_str( ns_sect section ) { @@ -699,7 +710,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PIP4_ARRA LOCK_RESOLVER(); - res_init(); + initialise_resolver(); _res.options |= dns_map_options( options ); if (servers && (ret = dns_set_serverlist( servers ))) @@ -817,7 +828,7 @@ DNS_STATUS WINAPI DnsQueryConfig( DNS_CONFIG_TYPE config, DWORD flag, PWSTR adap #ifdef HAVE_RESOLV LOCK_RESOLVER(); - res_init(); + initialise_resolver(); ret = dns_get_serverlist( buffer, len ); UNLOCK_RESOLVER(); diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index e4085471dbb..c80e1e0ed9c 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -50,6 +50,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); #define INADDR_NONE ~0UL #endif +static int resolver_initialised; + +/* call res_init() just once because of a bug in Mac OSX 10.4 */ +static void initialise_resolver(void) +{ + if (!resolver_initialised) + { + res_init(); + resolver_initialised = 1; + } +} + BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { @@ -1340,7 +1352,7 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen) if (!pOutBufLen) return ERROR_INVALID_PARAMETER; - res_init(); + initialise_resolver(); size = sizeof(FIXED_INFO) + (_res.nscount > 0 ? (_res.nscount - 1) * sizeof(IP_ADDR_STRING) : 0); if (!pFixedInfo || *pOutBufLen < size) { diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index 949e1b75b77..59562680306 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -1301,7 +1301,10 @@ BOOL WINAPI WaitNamedPipeW (LPCWSTR name, DWORD nTimeOut) } pipe_wait->TimeoutSpecified = !(nTimeOut == NMPWAIT_USE_DEFAULT_WAIT); - pipe_wait->Timeout.QuadPart = (ULONGLONG)nTimeOut * -10000; + if (nTimeOut == NMPWAIT_WAIT_FOREVER) + pipe_wait->Timeout.QuadPart = ((ULONGLONG)0x7fffffff << 32) | 0xffffffff; + else + pipe_wait->Timeout.QuadPart = (ULONGLONG)nTimeOut * -10000; pipe_wait->NameLength = nt_name.Length - sizeof(leadin); memcpy(pipe_wait->Name, nt_name.Buffer + sizeof(leadin)/sizeof(WCHAR), pipe_wait->NameLength); @@ -1771,8 +1774,12 @@ BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize, if( lpMessageCount ) *lpMessageCount = info.MessagesAvailable; if( lpReadTimeout ) - *lpReadTimeout = info.ReadTimeout.QuadPart / -10000; - + { + if (info.ReadTimeout.QuadPart == (((LONGLONG)0x7fffffff << 32) | 0xffffffff)) + *lpReadTimeout = MAILSLOT_WAIT_FOREVER; + else + *lpReadTimeout = info.ReadTimeout.QuadPart / -10000; + } return TRUE; } @@ -1798,7 +1805,10 @@ BOOL WINAPI SetMailslotInfo( HANDLE hMailslot, DWORD dwReadTimeout) TRACE("%p %d\n", hMailslot, dwReadTimeout); - info.ReadTimeout.QuadPart = dwReadTimeout * -10000; + if (dwReadTimeout != MAILSLOT_WAIT_FOREVER) + info.ReadTimeout.QuadPart = (ULONGLONG)dwReadTimeout * -10000; + else + info.ReadTimeout.QuadPart = ((LONGLONG)0x7fffffff << 32) | 0xffffffff; status = NtSetInformationFile( hMailslot, &iosb, &info, sizeof info, FileMailslotSetInformation ); if( status != STATUS_SUCCESS ) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 6127c1329d1..81159ab7993 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -99,6 +99,9 @@ static void test_CreateNamedPipe(int pipemode) hFile = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); ok(hFile != INVALID_HANDLE_VALUE, "CreateFile failed (%d)\n", GetLastError()); + ok(!WaitNamedPipeA(PIPENAME, 1000), "WaitNamedPipe succeeded\n"); + ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError()); + /* don't try to do i/o if one side couldn't be opened, as it hangs */ if (hFile != INVALID_HANDLE_VALUE) { HANDLE hFile2; diff --git a/dlls/localspl/Makefile.in b/dlls/localspl/Makefile.in index 06830de7d33..c3691e838be 100644 --- a/dlls/localspl/Makefile.in +++ b/dlls/localspl/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = localspl.dll -IMPORTS = user32 advapi32 kernel32 +IMPORTS = spoolss user32 advapi32 kernel32 C_SRCS = \ localmon.c \ diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index 7e13ace8fce..384e1f1742a 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -65,6 +65,7 @@ static struct list xcv_handles = LIST_INIT( xcv_handles ); /* ############################### */ +static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0}; static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0}; static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e', 'L','P','T','P','o','r','t', @@ -85,6 +86,7 @@ static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t', 'C','o','m','m','C','o','n','f','i','g',0}; static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0}; +static const WCHAR emptyW[] = {0}; static const WCHAR portname_LPT[] = {'L','P','T',0}; static const WCHAR portname_COM[] = {'C','O','M',0}; @@ -126,6 +128,44 @@ static void dlg_nothingtoconfig(HWND hWnd) } /****************************************************************** + * does_port_exist (internal) + * + * returns TRUE, when the Port already exists + * + */ +static BOOL does_port_exist(LPCWSTR myname) +{ + + LPPORT_INFO_1W pi; + DWORD needed = 0; + DWORD returned; + DWORD id; + + TRACE("(%s)\n", debugstr_w(myname)); + + id = EnumPortsW(NULL, 1, NULL, 0, &needed, &returned); + pi = spl_alloc(needed); + returned = 0; + if (pi) + id = EnumPortsW(NULL, 1, (LPBYTE) pi, needed, &needed, &returned); + + if (id && returned > 0) { + /* we got a number of valid names. */ + for (id = 0; id < returned; id++) + { + if (lstrcmpiW(myname, pi[id].pName) == 0) { + TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName)); + spl_free(pi); + return TRUE; + } + } + } + + spl_free(pi); + return FALSE; +} + +/****************************************************************** * enumerate the local Ports from the Registry (internal) * * See localmon_EnumPortsW. @@ -302,39 +342,6 @@ BOOL WINAPI localmon_ConfigurePortW(LPWSTR pName, HWND hWnd, LPWSTR pPortName) } /***************************************************** - * localmon_DeletePortW [exported through MONITOREX] - * - * Delete a specific Port - * - * PARAMS - * pName [I] Servername or NULL (local Computer) - * hWnd [I] Handle to parent Window - * pPortName [I] Name of the Port, that should be deleted - * - * RETURNS - * Success: TRUE - * Failure: FALSE - * - */ -BOOL WINAPI localmon_DeletePortW(LPWSTR pName, HWND hWnd, LPWSTR pPortName) -{ - DWORD res; - HKEY hroot; - - TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName)); - - if ((!pPortName) || (!pPortName[0])) return FALSE; - - res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot); - if (res == ERROR_SUCCESS) { - res = RegDeleteValueW(hroot, pPortName); - RegCloseKey(hroot); - } - TRACE("=> %d\n", (res == ERROR_SUCCESS)); - return (res == ERROR_SUCCESS); -} - -/***************************************************** * localmon_EnumPortsW [exported through MONITOREX] * * Enumerate all local Ports @@ -459,8 +466,22 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInput TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName), pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded); - /* Native localspl.dll crashes on w2k and xp, when XcvDataPort is called - with "AddPort" as command. We do not need to implement this */ + if (!lstrcmpW(pszDataName, cmd_AddPortW)) { + TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData)); + res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot); + if (res == ERROR_SUCCESS) { + if (does_port_exist((LPWSTR) pInputData)) { + RegCloseKey(hroot); + return ERROR_ALREADY_EXISTS; + } + res = RegSetValueExW(hroot, (LPWSTR) pInputData, 0, REG_SZ, (const BYTE *) emptyW, sizeof(emptyW)); + RegCloseKey(hroot); + SetLastError(ERROR_SUCCESS); + return res; + } + return res; + } + if (!lstrcmpW(pszDataName, cmd_ConfigureLPTPortCommandOKW)) { TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData)); @@ -631,7 +652,7 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot) NULL, /* localmon_AddPortW */ NULL, /* localmon_AddPortExW */ localmon_ConfigurePortW, - localmon_DeletePortW, + NULL, /* Use DeletePortUI in localui.dll */ NULL, /* localmon_GetPrinterDataFromPort */ NULL, /* localmon_SetPortTimeOuts */ localmon_XcvOpenPort, diff --git a/dlls/localui/Makefile.in b/dlls/localui/Makefile.in index f002e232862..2250333df10 100644 --- a/dlls/localui/Makefile.in +++ b/dlls/localui/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = localui.dll -IMPORTS = kernel32 +IMPORTS = winspool kernel32 C_SRCS = \ localui.c diff --git a/dlls/localui/localui.c b/dlls/localui/localui.c index ae512e06453..2153bccdd5f 100644 --- a/dlls/localui/localui.c +++ b/dlls/localui/localui.c @@ -36,6 +36,50 @@ WINE_DEFAULT_DEBUG_CHANNEL(localui); static HINSTANCE LOCALUI_hInstance; +static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0}; +static const WCHAR XcvPortW[] = {',','X','c','v','P','o','r','t',' ',0}; + +/***************************************************** + * strdupWW [internal] + */ + +static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix) +{ + LPWSTR ptr; + DWORD len; + + len = lstrlenW(pPrefix) + lstrlenW(pSuffix) + 1; + ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (ptr) { + lstrcpyW(ptr, pPrefix); + lstrcatW(ptr, pSuffix); + } + return ptr; +} + +/***************************************************** + * open_monitor_by_name [internal] + * + */ +static BOOL open_monitor_by_name(LPCWSTR pPrefix, LPCWSTR pPort, HANDLE * phandle) +{ + PRINTER_DEFAULTSW pd; + LPWSTR fullname; + BOOL res; + + * phandle = 0; + TRACE("(%s,%s)\n", debugstr_w(pPrefix),debugstr_w(pPort) ); + + fullname = strdupWW(pPrefix, pPort); + pd.pDatatype = NULL; + pd.pDevMode = NULL; + pd.DesiredAccess = SERVER_ACCESS_ADMINISTER; + + res = OpenPrinterW(fullname, phandle, &pd); + HeapFree(GetProcessHeap(), 0, fullname); + return res; +} + /***************************************************** * localui_AddPortUI [exported through MONITORUI] * @@ -94,11 +138,39 @@ static BOOL WINAPI localui_ConfigurePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPort * Success: TRUE * Failure: FALSE * + * NOTES + * Native localui does not allow to delete a COM / LPT - Port (ERROR_NOT_SUPPORTED) + * */ static BOOL WINAPI localui_DeletePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName) { - FIXME("(%s, %p, %s) stub\n", debugstr_w(pName), hWnd, debugstr_w(pPortName)); - return TRUE; + HANDLE hXcv; + DWORD dummy; + DWORD needed; + DWORD status; + + TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName)); + + if ((!pPortName) || (!pPortName[0])) { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) { + /* native localui tests here for LPT / COM - Ports and failed with + ERROR_NOT_SUPPORTED. */ + if (XcvDataW(hXcv, cmd_DeletePortW, (LPBYTE) pPortName, + (lstrlenW(pPortName)+1) * sizeof(WCHAR), (LPBYTE) &dummy, 0, &needed, &status)) { + + ClosePrinter(hXcv); + if (status != ERROR_SUCCESS) SetLastError(status); + return (status == ERROR_SUCCESS); + } + ClosePrinter(hXcv); + return FALSE; + } + SetLastError(ERROR_UNKNOWN_PORT); + return FALSE; } /***************************************************** diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 3ea78032ffb..66f2ededfb0 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -335,7 +335,7 @@ @ cdecl -ret64 _lseeki64(long double long) @ cdecl _ltoa(long ptr long) ntdll._ltoa @ cdecl _ltow(long ptr long) ntdll._ltow -@ cdecl _makepath(str str str str str) +@ cdecl _makepath(ptr str str str str) @ cdecl _matherr(ptr) MSVCRT__matherr @ cdecl _mbbtombc(long) @ cdecl _mbbtype(long long) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index cb895ab33c4..d0229af4ab7 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -430,7 +430,9 @@ static NTSTATUS get_io_timeouts( HANDLE handle, enum server_fd_type type, ULONG { req->handle = handle; req->flags = 0; - if (!(status = wine_server_call( req ))) timeouts->total = reply->read_timeout; + if (!(status = wine_server_call( req )) && + reply->read_timeout != TIMEOUT_INFINITE) + timeouts->total = reply->read_timeout / -10000; } SERVER_END_REQ; } @@ -1017,15 +1019,6 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, return status; } -/*********************************************************************** - * pipe_completion_wait (Internal) - */ -static NTSTATUS pipe_completion_wait(void *arg, PIO_STATUS_BLOCK iosb, NTSTATUS status) -{ - TRACE("for %p, status=%08x\n", iosb, status); - iosb->u.Status = status; - return status; -} /************************************************************************** * NtFsControlFile [NTDLL.@] @@ -1070,61 +1063,18 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc break; case FSCTL_PIPE_LISTEN: - { - HANDLE internal_event = 0; - - if(!event && !apc) - { - status = NtCreateEvent(&internal_event, EVENT_ALL_ACCESS, NULL, FALSE, FALSE); - if (status != STATUS_SUCCESS) break; - } - SERVER_START_REQ(connect_named_pipe) - { - req->handle = handle; - req->async.callback = pipe_completion_wait; - req->async.iosb = io; - req->async.arg = NULL; - req->async.apc = apc; - req->async.apc_arg = apc_context; - req->async.event = event ? event : internal_event; - status = wine_server_call(req); - } - SERVER_END_REQ; - - if (internal_event && status == STATUS_PENDING) - { - while (NtWaitForSingleObject(internal_event, TRUE, NULL) == STATUS_USER_APC) /*nothing*/ ; - status = io->u.Status; - } - if (internal_event) NtClose(internal_event); - } - break; - case FSCTL_PIPE_WAIT: { HANDLE internal_event = 0; - FILE_PIPE_WAIT_FOR_BUFFER *buff = in_buffer; if(!event && !apc) { status = NtCreateEvent(&internal_event, EVENT_ALL_ACCESS, NULL, FALSE, FALSE); if (status != STATUS_SUCCESS) break; + event = internal_event; } - SERVER_START_REQ(wait_named_pipe) - { - req->handle = handle; - req->timeout = buff->TimeoutSpecified ? buff->Timeout.QuadPart / -10000L - : NMPWAIT_USE_DEFAULT_WAIT; - req->async.callback = pipe_completion_wait; - req->async.iosb = io; - req->async.arg = NULL; - req->async.apc = apc; - req->async.apc_arg = apc_context; - req->async.event = event ? event : internal_event; - wine_server_add_data( req, buff->Name, buff->NameLength ); - status = wine_server_call( req ); - } - SERVER_END_REQ; + status = server_ioctl_file( handle, event, apc, apc_context, io, code, + in_buffer, in_size, out_buffer, out_size ); if (internal_event && status == STATUS_PENDING) { @@ -1467,7 +1417,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, info->MailslotQuota = 0; info->NextMessageSize = 0; info->MessagesAvailable = 0; - info->ReadTimeout.QuadPart = reply->read_timeout * -10000; + info->ReadTimeout.QuadPart = reply->read_timeout; } } SERVER_END_REQ; @@ -1660,7 +1610,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, { req->handle = handle; req->flags = MAILSLOT_SET_READ_TIMEOUT; - req->read_timeout = info->ReadTimeout.QuadPart / -10000; + req->read_timeout = info->ReadTimeout.QuadPart; io->u.Status = wine_server_call( req ); } SERVER_END_REQ; @@ -2186,8 +2136,8 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, options, pipe_type, read_mode, completion_mode, max_inst, inbound_quota, outbound_quota, timeout); - /* assume we only get relative timeout, and storable in a DWORD as ms */ - if (timeout->QuadPart > 0 || (timeout->QuadPart / -10000) >> 32) + /* assume we only get relative timeout */ + if (timeout->QuadPart > 0) FIXME("Wrong time %s\n", wine_dbgstr_longlong(timeout->QuadPart)); SERVER_START_REQ( create_named_pipe ) @@ -2203,7 +2153,7 @@ NTSTATUS WINAPI NtCreateNamedPipeFile( PHANDLE handle, ULONG access, req->maxinstances = max_inst; req->outsize = outbound_quota; req->insize = inbound_quota; - req->timeout = timeout->QuadPart / -10000; + req->timeout = timeout->QuadPart; wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); status = wine_server_call( req ); @@ -2306,7 +2256,7 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess, req->attributes = attr->Attributes; req->rootdir = attr->RootDirectory; req->max_msgsize = MaxMessageSize; - req->read_timeout = (timeout.QuadPart <= 0) ? timeout.QuadPart / -10000 : -1; + req->read_timeout = timeout.QuadPart; wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length ); ret = wine_server_call( req ); diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 4158f4ee4d7..3332821e095 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -696,7 +696,7 @@ NTSTATUS WINAPI NtQuerySystemInformation( memset(&sti, 0 , sizeof(sti)); /* liKeSystemTime, liExpTimeZoneBias, uCurrentTimeZoneId */ - NTDLL_from_server_abstime( &sti.liKeBootTime, &server_start_time ); + sti.liKeBootTime.QuadPart = server_start_time; if (Length <= sizeof(sti)) { diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 1dd5daf8efc..741aec4bba4 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -40,8 +40,6 @@ extern void set_cpu_context( const CONTEXT *context ); extern LPCSTR debugstr_us( const UNICODE_STRING *str ); extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes); -extern void NTDLL_get_server_abstime( abs_time_t *when, const LARGE_INTEGER *timeout ); -extern void NTDLL_from_server_abstime( LARGE_INTEGER *time, const abs_time_t *when ); extern NTSTATUS NTDLL_queue_process_apc( HANDLE process, const apc_call_t *call, apc_result_t *result ); extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UINT flags, const LARGE_INTEGER *timeout, HANDLE signal_object ); @@ -56,7 +54,7 @@ extern void virtual_init(void); extern void virtual_init_threading(void); /* server support */ -extern abs_time_t server_start_time; +extern timeout_t server_start_time; extern void server_init_process(void); extern NTSTATUS server_init_process_done(void); extern size_t server_init_thread( int unix_pid, int unix_tid, void *entry_point ); diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c index 5af750d2b40..a03b23e0e9e 100644 --- a/dlls/ntdll/process.c +++ b/dlls/ntdll/process.c @@ -236,8 +236,8 @@ NTSTATUS WINAPI NtQueryInformationProcess( req->handle = ProcessHandle; if ((ret = wine_server_call( req )) == STATUS_SUCCESS) { - NTDLL_from_server_abstime(&pti.CreateTime, &reply->start_time); - NTDLL_from_server_abstime(&pti.ExitTime, &reply->end_time); + pti.CreateTime.QuadPart = reply->start_time; + pti.ExitTime.QuadPart = reply->end_time; } } SERVER_END_REQ; diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 1e84a5a333f..e2d5d7c0a3b 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -85,7 +85,7 @@ struct cmsg_fd }; #endif /* HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS */ -abs_time_t server_start_time = { 0, 0 }; /* time of server startup */ +timeout_t server_start_time = 0; /* time of server startup */ extern struct wine_pthread_functions pthread_functions; diff --git a/dlls/ntdll/sync.c b/dlls/ntdll/sync.c index b2f4a278713..03f3a73271e 100644 --- a/dlls/ntdll/sync.c +++ b/dlls/ntdll/sync.c @@ -478,16 +478,9 @@ NTSTATUS WINAPI NtSetTimer(IN HANDLE handle, SERVER_START_REQ( set_timer ) { - if (!when->u.LowPart && !when->u.HighPart) - { - /* special case to start timeout on now+period without too many calculations */ - req->expire.sec = 0; - req->expire.usec = 0; - } - else NTDLL_get_server_abstime( &req->expire, when ); - req->handle = handle; req->period = period; + req->expire = when->QuadPart; req->callback = callback; req->arg = callback_arg; status = wine_server_call( req ); @@ -564,7 +557,7 @@ NTSTATUS WINAPI NtQueryTimer( status = wine_server_call(req); /* convert server time to absolute NTDLL time */ - NTDLL_from_server_abstime(&basic_info->RemainingTime, &reply->when); + basic_info->RemainingTime.QuadPart = reply->when; basic_info->TimerState = reply->signaled; } SERVER_END_REQ; @@ -670,15 +663,9 @@ static BOOL invoke_apc( const apc_call_t *call, apc_result_t *result ) user_apc = TRUE; break; case APC_TIMER: - { - LARGE_INTEGER time; - /* convert sec/usec to NT time */ - RtlSecondsSince1970ToTime( call->timer.time.sec, &time ); - time.QuadPart += call->timer.time.usec * 10; - call->timer.func( call->timer.arg, time.u.LowPart, time.u.HighPart ); + call->timer.func( call->timer.arg, (DWORD)call->timer.time, (DWORD)(call->timer.time >> 32) ); user_apc = TRUE; break; - } case APC_ASYNC_IO: result->type = call->type; result->async_io.status = call->async_io.func( call->async_io.user, @@ -895,10 +882,8 @@ NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UIN { NTSTATUS ret; int cookie; - abs_time_t abs_timeout; + timeout_t abs_timeout = timeout ? timeout->QuadPart : TIMEOUT_INFINITE; - NTDLL_get_server_abstime( &abs_timeout, timeout ); - if (timeout) flags |= SELECT_TIMEOUT; for (;;) { SERVER_START_REQ( select ) @@ -909,6 +894,7 @@ NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handles, UIN req->timeout = abs_timeout; wine_server_add_data( req, handles, count * sizeof(HANDLE) ); ret = wine_server_call( req ); + abs_timeout = reply->timeout; } SERVER_END_REQ; if (ret == STATUS_PENDING) ret = wait_reply( &cookie ); @@ -995,32 +981,33 @@ NTSTATUS WINAPI NtDelayExecution( BOOLEAN alertable, const LARGE_INTEGER *timeou return NTDLL_wait_for_multiple_objects( 0, NULL, flags, timeout, 0 ); } - if (!timeout) /* sleep forever */ + if (!timeout || timeout->QuadPart == TIMEOUT_INFINITE) /* sleep forever */ { for (;;) select( 0, NULL, NULL, NULL, NULL ); } else { - abs_time_t when; + LARGE_INTEGER now; + timeout_t when, diff; - NTDLL_get_server_abstime( &when, timeout ); + if ((when = timeout->QuadPart) < 0) + { + NtQuerySystemTime( &now ); + when = now.QuadPart - when; + } /* Note that we yield after establishing the desired timeout */ NtYieldExecution(); + if (!when) return STATUS_SUCCESS; for (;;) { struct timeval tv; - gettimeofday( &tv, 0 ); - tv.tv_sec = when.sec - tv.tv_sec; - if ((tv.tv_usec = when.usec - tv.tv_usec) < 0) - { - tv.tv_usec += 1000000; - tv.tv_sec--; - } - /* if our yield already passed enough time, we're done */ - if (tv.tv_sec < 0) break; - + NtQuerySystemTime( &now ); + diff = (when - now.QuadPart + 9) / 10; + if (diff <= 0) break; + tv.tv_sec = diff / 1000000; + tv.tv_usec = diff % 1000000; if (select( 0, NULL, NULL, NULL, &tv ) != -1) break; } } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 1fb0db61e03..fa30e539c9e 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -1186,8 +1186,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class, status = wine_server_call( req ); if (status == STATUS_SUCCESS) { - NTDLL_from_server_abstime( &kusrt.CreateTime, &reply->creation_time ); - NTDLL_from_server_abstime( &kusrt.ExitTime, &reply->exit_time ); + kusrt.CreateTime.QuadPart = reply->creation_time; + kusrt.ExitTime.QuadPart = reply->exit_time; } } SERVER_END_REQ; diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 2a05f09ec31..ea316d186e4 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -446,67 +446,6 @@ static inline int IsLeapYear(int Year) return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0; } -/*********************************************************************** - * NTDLL_get_server_abstime - * - * Convert a NTDLL time into an abs_time_t struct to send to the server. - */ -void NTDLL_get_server_abstime( abs_time_t *when, const LARGE_INTEGER *timeout ) -{ - UINT remainder; - - if (!timeout) /* infinite timeout */ - { - when->sec = when->usec = 0; - } - else if (timeout->QuadPart <= 0) /* relative timeout */ - { - struct timeval tv; - - if (-timeout->QuadPart > (LONGLONG)INT_MAX * TICKSPERSEC) - when->sec = when->usec = INT_MAX; - else - { - ULONG sec = RtlEnlargedUnsignedDivide( -timeout->QuadPart, TICKSPERSEC, &remainder ); - gettimeofday( &tv, 0 ); - when->sec = tv.tv_sec + sec; - if ((when->usec = tv.tv_usec + (remainder / 10)) >= 1000000) - { - when->usec -= 1000000; - when->sec++; - } - if (when->sec < tv.tv_sec) /* overflow */ - when->sec = when->usec = INT_MAX; - } - } - else /* absolute time */ - { - if (timeout->QuadPart < TICKS_1601_TO_1970) - when->sec = when->usec = 0; - else if (timeout->QuadPart > TICKS_1601_TO_UNIX_MAX) - when->sec = when->usec = INT_MAX; - else - { - when->sec = RtlEnlargedUnsignedDivide( timeout->QuadPart - TICKS_1601_TO_1970, - TICKSPERSEC, &remainder ); - when->usec = remainder / 10; - } - } -} - - -/*********************************************************************** - * NTDLL_from_server_abstime - * - * Convert a timeval struct from the server into an NTDLL time. - */ -void NTDLL_from_server_abstime( LARGE_INTEGER *time, const abs_time_t *when ) -{ - time->QuadPart = when->sec * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; - time->QuadPart += when->usec * 10; -} - - /****************************************************************************** * RtlTimeToTimeFields [NTDLL.@] * @@ -878,16 +817,15 @@ NTSTATUS WINAPI NtQuerySystemTime( PLARGE_INTEGER Time ) */ NTSTATUS WINAPI NtQueryPerformanceCounter( PLARGE_INTEGER Counter, PLARGE_INTEGER Frequency ) { - struct timeval now; + LARGE_INTEGER now; if (!Counter) return STATUS_ACCESS_VIOLATION; - gettimeofday( &now, 0 ); - /* convert a counter that increments at a rate of 1 MHz + + /* convert a counter that increments at a rate of 10 MHz * to one of 1.193182 MHz, with some care for arithmetic - * overflow ( will not overflow for 5000 years ) and - * good accuracy ( 105/88 = 1.19318182) */ - Counter->QuadPart = (((now.tv_sec - server_start_time.sec) * (ULONGLONG)1000000 + - (now.tv_usec - server_start_time.usec)) * 105) / 88; + * overflow and good accuracy (21/176 = 0.11931818) */ + NtQuerySystemTime( &now ); + Counter->QuadPart = ((now.QuadPart - server_start_time) * 21) / 176; if (Frequency) Frequency->QuadPart = 1193182; return STATUS_SUCCESS; } @@ -899,11 +837,10 @@ NTSTATUS WINAPI NtQueryPerformanceCounter( PLARGE_INTEGER Counter, PLARGE_INTEGE */ ULONG WINAPI NtGetTickCount(void) { - struct timeval current_time; + LARGE_INTEGER now; - gettimeofday(¤t_time, NULL); - return (current_time.tv_sec - server_start_time.sec) * 1000 + - (current_time.tv_usec - server_start_time.usec) / 1000; + NtQuerySystemTime( &now ); + return (now.QuadPart - server_start_time) / 10000; } diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 23004ce6074..415fe95798a 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -299,9 +299,9 @@ @ stub InternalExtractIconListA @ stub InternalExtractIconListW @ stub OCInstall -@ stub OpenAs_RunDLL -@ stub OpenAs_RunDLLA -@ stub OpenAs_RunDLLW +@ stdcall OpenAs_RunDLL(long long str long) OpenAs_RunDLLA +@ stdcall OpenAs_RunDLLA(long long str long) +@ stdcall OpenAs_RunDLLW(long long wstr long) @ stub PrintersGetCommand_RunDLL @ stub PrintersGetCommand_RunDLLA @ stub PrintersGetCommand_RunDLLW diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 70db342465d..ea4b5100c48 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -275,6 +275,9 @@ static DWORD shgfi_get_exe_type(LPCWSTR szFullPath) SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); CloseHandle( hfile ); + /* DLL files are not executable and should return 0 */ + if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL) + return 0; if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { return IMAGE_NT_SIGNATURE | diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 2d4a25e6740..6e38dbd958b 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1295,6 +1295,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) WCHAR wcmd[1024]; WCHAR buffer[MAX_PATH]; BOOL done; + BOOL appKnownSingular = FALSE; /* make a local copy of the LPSHELLEXECUTEINFO structure and work with this from now on */ memcpy(&sei_tmp, sei, sizeof(sei_tmp)); @@ -1322,6 +1323,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) memcpy(wszApplicationName, sei_tmp.lpFile+1, (l+1)*sizeof(WCHAR)); if (wszApplicationName[l-1] == '\"') wszApplicationName[l-1] = '\0'; + appKnownSingular = TRUE; TRACE("wszApplicationName=%s\n",debugstr_w(wszApplicationName)); } else { DWORD l = strlenW(sei_tmp.lpFile)+1; @@ -1370,6 +1372,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) } SHGetPathFromIDListW(sei_tmp.lpIDList, wszApplicationName); + appKnownSingular = TRUE; TRACE("-- idlist=%p (%s)\n", sei_tmp.lpIDList, debugstr_w(wszApplicationName)); } @@ -1419,6 +1422,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) /* open shell folder for the specified class GUID */ strcpyW(wszParameters, buffer); strcpyW(wszApplicationName, wExplorer); + appKnownSingular = TRUE; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; } else { @@ -1438,6 +1442,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) buffer, target, sei_tmp.lpIDList, NULL, &resultLen); if (resultLen > dwApplicationNameLen) ERR("Argify buffer not large enough... truncating\n"); + appKnownSingular = FALSE; } sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; } @@ -1455,6 +1460,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) HeapFree(GetProcessHeap(), 0, wszApplicationName); dwApplicationNameLen = len+1; wszApplicationName = buf; + /* appKnownSingular unmodified */ sei_tmp.lpFile = wszApplicationName; } @@ -1495,7 +1501,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir)); /* separate out command line arguments from executable file name */ - if (!*sei_tmp.lpParameters) { + if (!*sei_tmp.lpParameters && !appKnownSingular) { /* If the executable path is quoted, handle the rest of the command line as parameters. */ if (sei_tmp.lpFile[0] == '"') { LPWSTR src = wszApplicationName/*sei_tmp.lpFile*/ + 1; @@ -1756,3 +1762,19 @@ HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, SHELL_execute( &sei, SHELL_ExecuteW ); return sei.hInstApp; } + +/************************************************************************* + * OpenAs_RunDLLA [SHELL32.@] + */ +void WINAPI OpenAs_RunDLLA(HWND hwnd, HINSTANCE hinst, LPCSTR cmdline, int cmdshow) +{ + FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_a(cmdline), cmdshow); +} + +/************************************************************************* + * OpenAs_RunDLLW [SHELL32.@] + */ +void WINAPI OpenAs_RunDLLW(HWND hwnd, HINSTANCE hinst, LPCWSTR cmdline, int cmdshow) +{ + FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_w(cmdline), cmdshow); +} diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index f16cb721de2..a22666739be 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -480,6 +480,8 @@ static const char* testfiles[]= "%s\\test file.shl", "%s\\test file.shlfoo", "%s\\test file.sfe", + "%s\\masked file.shlexec", + "%s\\masked", NULL }; @@ -517,6 +519,11 @@ static filename_tests_t filename_tests[]= {"QuotedLowerL", "%s\\test file.shlexec", 0x0, 33}, {"QuotedUpperL", "%s\\test file.shlexec", 0x0, 33}, + /* Test file masked due to space */ + {NULL, "%s\\masked file.shlexec", 0x1, 33}, + /* Test if quoting prevents the masking */ + {NULL, "%s\\masked file.shlexec", 0x40, 33}, + {NULL, NULL, 0} }; @@ -551,7 +558,16 @@ static void test_filename(void) c++; } } - rc=shell_execute(test->verb, filename, NULL, NULL); + if ((test->todo & 0x40)==0) + { + rc=shell_execute(test->verb, filename, NULL, NULL); + } + else + { + char quoted[MAX_PATH + 2]; + sprintf(quoted, "\"%s\"", filename); + rc=shell_execute(test->verb, quoted, NULL, NULL); + } if (rc > 32) rc=33; if ((test->todo & 0x1)==0) diff --git a/dlls/spoolss/Makefile.in b/dlls/spoolss/Makefile.in index 5cca32e0a2b..6d2a310400a 100644 --- a/dlls/spoolss/Makefile.in +++ b/dlls/spoolss/Makefile.in @@ -3,6 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = spoolss.dll +IMPORTLIB = libspoolss.$(IMPLIBEXT) IMPORTS = winspool kernel32 C_SRCS = \ diff --git a/dlls/user32/message.c b/dlls/user32/message.c index f6122775458..ff451d1e331 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1399,7 +1399,7 @@ static BOOL post_dde_message( struct packed_message *data, const struct send_mes req->msg = info->msg; req->wparam = info->wparam; req->lparam = lp; - req->timeout = 0; + req->timeout = TIMEOUT_INFINITE; for (i = 0; i < data->count; i++) wine_server_add_data( req, data->data[i], data->size[i] ); if ((res = wine_server_call( req ))) @@ -2201,7 +2201,8 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t * struct packed_message data; message_data_t msg_data; unsigned int res; - int i, timeout = 0; + int i; + timeout_t timeout = TIMEOUT_INFINITE; /* Check for INFINITE timeout for compatibility with Win9x, * although Windows >= NT does not do so @@ -2209,8 +2210,12 @@ static BOOL put_message_in_queue( const struct send_message_info *info, size_t * if (info->type != MSG_NOTIFY && info->type != MSG_CALLBACK && info->type != MSG_POSTED && + info->timeout && info->timeout != INFINITE) - timeout = info->timeout; + { + /* timeout is signed despite the prototype */ + timeout = (timeout_t)max( 0, (int)info->timeout ) * -10000; + } data.count = 0; if (info->type == MSG_OTHER_PROCESS) diff --git a/dlls/uxtheme/msstyles.h b/dlls/uxtheme/msstyles.h index 0eef06c6c1e..1d02725e185 100644 --- a/dlls/uxtheme/msstyles.h +++ b/dlls/uxtheme/msstyles.h @@ -82,7 +82,7 @@ typedef struct _THEME_FILE { PTHEME_IMAGE images; } THEME_FILE, *PTHEME_FILE; -typedef void* PUXINI_FILE; +typedef struct _UXINI_FILE *PUXINI_FILE; HRESULT MSSTYLES_OpenThemeFile(LPCWSTR lpThemeFile, LPCWSTR pszColorName, LPCWSTR pszSizeName, PTHEME_FILE *tf); void MSSTYLES_CloseThemeFile(PTHEME_FILE tf); diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 9ec6142b186..dfed5c532c0 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -510,10 +510,10 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData if (sd->u.s.normal.lpData == NULL) { glNormal3f(0, 0, 1); } - if(sd->u.s.diffuse.lpData != NULL) { + if(sd->u.s.diffuse.lpData == NULL) { glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } - if(sd->u.s.specular.lpData != NULL) { + if(sd->u.s.specular.lpData == NULL) { if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); } diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index a9eb3eadab6..8817fd036e9 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -702,7 +702,6 @@ const char *debug_fbostatus(GLenum status) { FBOSTATUS_TO_STR(GL_FRAMEBUFFER_COMPLETE_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT); - FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT); diff --git a/dlls/winspool.drv/Es.rc b/dlls/winspool.drv/Es.rc new file mode 100644 index 00000000000..32d6e4d4880 --- /dev/null +++ b/dlls/winspool.drv/Es.rc @@ -0,0 +1,38 @@ +/* + * Spanish resources for winspool + * + * Copyright 2007 José Manuel Ferrer Ortiz + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL + +FILENAME_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION +CAPTION "Imprimir en archivo" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Nombre del archivo:", -1, 7, 13, 194, 13, WS_VISIBLE + EDITTEXT EDITBOX, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL + DEFPUSHBUTTON "Aceptar", IDOK, 199, 10, 40, 14, WS_VISIBLE + PUSHBUTTON "Cancelar", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE +END + +STRINGTABLE DISCARDABLE +{ + IDS_CAPTION "Puerto local" + IDS_FILE_EXISTS "El archivo de salida ya existe. Pulse Aceptar para sobreescribir." + IDS_CANNOT_OPEN "Incapaz de crear el archivo de salida." +} diff --git a/dlls/winspool.drv/winspool.rc b/dlls/winspool.drv/winspool.rc index 3ca9dda1e22..a5b4328a20c 100644 --- a/dlls/winspool.drv/winspool.rc +++ b/dlls/winspool.drv/winspool.rc @@ -43,6 +43,7 @@ #include "De.rc" #include "En.rc" #include "Eo.rc" +#include "Es.rc" #include "Fi.rc" #include "Fr.rc" #include "It.rc" diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 14b96474344..31f78de2101 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -21,6 +21,7 @@ typedef unsigned short atom_t; typedef unsigned int process_id_t; typedef unsigned int thread_id_t; typedef unsigned int data_size_t; +typedef unsigned int ioctl_code_t; struct request_header { @@ -133,11 +134,8 @@ struct wake_up_reply }; -typedef struct -{ - int sec; - int usec; -} abs_time_t; +typedef __int64 timeout_t; +#define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff) typedef struct @@ -257,7 +255,7 @@ typedef union { enum apc_type type; void (__stdcall *func)(void*, unsigned int, unsigned int); - abs_time_t time; + timeout_t time; void *arg; } timer; struct @@ -540,7 +538,7 @@ struct init_thread_reply process_id_t pid; thread_id_t tid; data_size_t info_size; - abs_time_t server_start; + timeout_t server_start; int version; }; @@ -589,8 +587,8 @@ struct get_process_info_reply int priority; int affinity; void* peb; - abs_time_t start_time; - abs_time_t end_time; + timeout_t start_time; + timeout_t end_time; }; @@ -627,8 +625,8 @@ struct get_thread_info_reply int exit_code; int priority; int affinity; - abs_time_t creation_time; - abs_time_t exit_time; + timeout_t creation_time; + timeout_t exit_time; int last; }; @@ -856,17 +854,17 @@ struct select_request int flags; void* cookie; obj_handle_t signal; - abs_time_t timeout; + timeout_t timeout; /* VARARG(handles,handles); */ }; struct select_reply { struct reply_header __header; + timeout_t timeout; }; #define SELECT_ALL 1 #define SELECT_ALERTABLE 2 #define SELECT_INTERRUPTIBLE 4 -#define SELECT_TIMEOUT 8 @@ -2181,7 +2179,7 @@ struct set_timer_request { struct request_header __header; obj_handle_t handle; - abs_time_t expire; + timeout_t expire; int period; void* callback; void* arg; @@ -2213,7 +2211,7 @@ struct get_timer_info_request struct get_timer_info_reply { struct reply_header __header; - abs_time_t when; + timeout_t when; int signaled; }; @@ -2442,7 +2440,7 @@ struct send_message_request unsigned int msg; unsigned long wparam; unsigned long lparam; - int timeout; + timeout_t timeout; /* VARARG(data,message_data); */ }; struct send_message_reply @@ -2671,7 +2669,7 @@ struct ioctl_request { struct request_header __header; obj_handle_t handle; - unsigned int code; + ioctl_code_t code; async_data_t async; /* VARARG(in_data,bytes); */ }; @@ -2694,7 +2692,7 @@ struct create_named_pipe_request unsigned int maxinstances; unsigned int outsize; unsigned int insize; - unsigned int timeout; + timeout_t timeout; /* VARARG(name,unicode_str); */ }; struct create_named_pipe_reply @@ -2710,33 +2708,6 @@ struct create_named_pipe_reply #define NAMED_PIPE_SERVER_END 0x8000 -struct connect_named_pipe_request -{ - struct request_header __header; - obj_handle_t handle; - async_data_t async; -}; -struct connect_named_pipe_reply -{ - struct reply_header __header; -}; - - - -struct wait_named_pipe_request -{ - struct request_header __header; - obj_handle_t handle; - async_data_t async; - unsigned int timeout; - /* VARARG(name,unicode_str); */ -}; -struct wait_named_pipe_reply -{ - struct reply_header __header; -}; - - struct get_named_pipe_info_request { struct request_header __header; @@ -3937,7 +3908,7 @@ struct create_mailslot_request unsigned int attributes; obj_handle_t rootdir; unsigned int max_msgsize; - int read_timeout; + timeout_t read_timeout; /* VARARG(name,unicode_str); */ }; struct create_mailslot_reply @@ -3953,13 +3924,13 @@ struct set_mailslot_info_request struct request_header __header; obj_handle_t handle; unsigned int flags; - int read_timeout; + timeout_t read_timeout; }; struct set_mailslot_info_reply { struct reply_header __header; unsigned int max_msgsize; - int read_timeout; + timeout_t read_timeout; }; #define MAILSLOT_SET_READ_TIMEOUT 1 @@ -4218,8 +4189,6 @@ enum request REQ_cancel_async, REQ_ioctl, REQ_create_named_pipe, - REQ_connect_named_pipe, - REQ_wait_named_pipe, REQ_get_named_pipe_info, REQ_create_cursor, REQ_destroy_cursor, @@ -4446,8 +4415,6 @@ union generic_request struct cancel_async_request cancel_async_request; struct ioctl_request ioctl_request; struct create_named_pipe_request create_named_pipe_request; - struct connect_named_pipe_request connect_named_pipe_request; - struct wait_named_pipe_request wait_named_pipe_request; struct get_named_pipe_info_request get_named_pipe_info_request; struct create_cursor_request create_cursor_request; struct destroy_cursor_request destroy_cursor_request; @@ -4672,8 +4639,6 @@ union generic_reply struct cancel_async_reply cancel_async_reply; struct ioctl_reply ioctl_reply; struct create_named_pipe_reply create_named_pipe_reply; - struct connect_named_pipe_reply connect_named_pipe_reply; - struct wait_named_pipe_reply wait_named_pipe_reply; struct get_named_pipe_info_reply get_named_pipe_info_reply; struct create_cursor_reply create_cursor_reply; struct destroy_cursor_reply destroy_cursor_reply; @@ -4759,6 +4724,6 @@ union generic_reply struct allocate_locally_unique_id_reply allocate_locally_unique_id_reply; }; -#define SERVER_PROTOCOL_VERSION 295 +#define SERVER_PROTOCOL_VERSION 298 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/programs/taskmgr/Ja.rc b/programs/taskmgr/Ja.rc new file mode 100644 index 00000000000..96717a0fc86 --- /dev/null +++ b/programs/taskmgr/Ja.rc @@ -0,0 +1,501 @@ +/* + * Task Manager + * + * Copyright 1999-2001 Brian Palmer + * Copyright 2007 Yutaka Ino + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT + +/* + Menu +*/ + +IDR_TASKMANAGER MENU DISCARDABLE +BEGIN + POPUP "ƒtƒ@ƒCƒ‹(&F)" + BEGIN + MENUITEM "�V‚µ‚¢ƒ^ƒXƒN‚ÌŽÀ�s(&N)...", ID_FILE_NEW + MENUITEM SEPARATOR + MENUITEM "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚Ì�I—¹(&X)", ID_FILE_EXIT + END + POPUP "ƒIƒvƒVƒ‡ƒ“(&O)" + BEGIN + MENUITEM "�í‚ÉŽè‘O‚É•\Ž¦(&A)", ID_OPTIONS_ALWAYSONTOP + , CHECKED + MENUITEM "–¢Žg—pŽž‚É�Å�¬‰»(&M)", ID_OPTIONS_MINIMIZEONUSE + , CHECKED + MENUITEM "�Å�¬‰»Žž‚ɉB‚·(&H)", ID_OPTIONS_HIDEWHENMINIMIZED + , CHECKED + MENUITEM "16bit ƒ^ƒXƒN‚Ì•\Ž¦(&S)", ID_OPTIONS_SHOW16BITTASKS + , CHECKED + END + POPUP "•\Ž¦(&V)" + BEGIN + MENUITEM "�Å�V‚Ì�î•ñ‚É�X�V(&R)", ID_VIEW_REFRESH + POPUP "�X�V‚Ì•p“x(&U)" + BEGIN + MENUITEM "�‚(&H)", ID_VIEW_UPDATESPEED_HIGH + MENUITEM "’Ê�í(&N)", ID_VIEW_UPDATESPEED_NORMAL + , CHECKED + MENUITEM "’á(&L)", ID_VIEW_UPDATESPEED_LOW + MENUITEM "ˆêŽž’âŽ~(&P)", ID_VIEW_UPDATESPEED_PAUSED + + END + MENUITEM SEPARATOR + MENUITEM "‘åƒAƒCƒRƒ“(&G)", ID_VIEW_LARGE + MENUITEM "�¬ƒAƒCƒRƒ“(&M)", ID_VIEW_SMALL + MENUITEM "�Ú�×(&D)", ID_VIEW_DETAILS, CHECKED + MENUITEM "—ñ‚Ì‘I‘ð(&S)...", ID_VIEW_SELECTCOLUMNS + POPUP "CPU ‚Ì—š—ð(&C)" + BEGIN + MENUITEM "‚·‚×‚Ä‚Ì CPU ‚Å 1 ƒOƒ‰ƒt(&O)", ID_VIEW_CPUHISTORY_ONEGRAPHALL + + MENUITEM "CPU ‚²‚Æ‚É 1 ƒOƒ‰ƒt(&P)", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU + , CHECKED + END + MENUITEM "ƒJ�[ƒlƒ‹ŽžŠÔ‚ð•\Ž¦‚·‚é(&S)", ID_VIEW_SHOWKERNELTIMES + END + POPUP "ƒEƒBƒ“ƒhƒE(&W)" + BEGIN + MENUITEM "�㉺‚É•À‚ׂĕ\Ž¦(&H)", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "�¶‰E‚É•À‚ׂĕ\Ž¦(&V)", ID_WINDOWS_TILEVERTICALLY + MENUITEM "�Å�¬‰»(&M)", ID_WINDOWS_MINIMIZE + MENUITEM "�ő剻(&X)", ID_WINDOWS_MAXIMIZE + MENUITEM "�d‚Ë‚Ä•\Ž¦(&C)", ID_WINDOWS_CASCADE + MENUITEM "Žè‘O‚É•\Ž¦(&B)", ID_WINDOWS_BRINGTOFRONT + END + POPUP "ƒwƒ‹ƒv(&H)" + BEGIN + MENUITEM "ƒgƒsƒbƒN‚ÌŒŸ�õ(&H)", ID_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "ƒo�[ƒWƒ‡ƒ“�î•ñ(&A)", ID_HELP_ABOUT + END +END + +IDR_WINDOWSMENU MENU DISCARDABLE +BEGIN + MENUITEM "�㉺‚É•À‚ׂĕ\Ž¦(&H)", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "�¶‰E‚É•À‚ׂĕ\Ž¦(&V)", ID_WINDOWS_TILEVERTICALLY + MENUITEM "�Å�¬‰»(&M)", ID_WINDOWS_MINIMIZE + MENUITEM "�ő剻(&X)", ID_WINDOWS_MAXIMIZE + MENUITEM "�d‚Ë‚Ä•\Ž¦(&C)", ID_WINDOWS_CASCADE + MENUITEM "Žè‘O‚É•\Ž¦(&B)", ID_WINDOWS_BRINGTOFRONT +END + +IDR_APPLICATION_PAGE_CONTEXT1 MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "�V‚µ‚¢ƒ^ƒXƒN‚ÌŽÀ�s(&N)...", ID_FILE_NEW + MENUITEM SEPARATOR + MENUITEM "‘åƒAƒCƒRƒ“(&G)", ID_VIEW_LARGE + MENUITEM "�¬ƒAƒCƒRƒ“(&M)", ID_VIEW_SMALL + MENUITEM "�Ú�×(&D)", ID_VIEW_DETAILS, CHECKED + END +END + +IDR_APPLICATION_PAGE_CONTEXT2 MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "�Ø‚è‘Ö‚¦(&S)", ID_APPLICATION_PAGE_SWITCHTO + MENUITEM "Žè‘O‚É•\Ž¦(&B)", ID_WINDOWS_BRINGTOFRONT + MENUITEM SEPARATOR + MENUITEM "�㉺‚É•À‚ׂĕ\Ž¦(&H)", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "�¶‰E‚É•À‚ׂĕ\Ž¦(&V)", ID_WINDOWS_TILEVERTICALLY + MENUITEM "�Å�¬‰»(&M)", ID_WINDOWS_MINIMIZE + MENUITEM "�ő剻(&X)", ID_WINDOWS_MAXIMIZE + MENUITEM "�d‚Ë‚Ä•\Ž¦(&C)", ID_WINDOWS_CASCADE + MENUITEM SEPARATOR + MENUITEM "ƒ^ƒXƒN‚Ì�I—¹(&E)", ID_APPLICATION_PAGE_ENDTASK + MENUITEM "ƒvƒ�ƒZƒX‚Ì•\Ž¦(&G)", ID_APPLICATION_PAGE_GOTOPROCESS + END +END + +IDR_TRAY_POPUP MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "Œ³‚̃TƒCƒY‚É–ß‚·(&R)", ID_RESTORE + MENUITEM "•Â‚¶‚é(&C)", ID_FILE_EXIT + MENUITEM SEPARATOR + MENUITEM "�í‚ÉŽè‘O‚É•\Ž¦(&A)", ID_OPTIONS_ALWAYSONTOP + END +END + +IDR_PROCESS_PAGE_CONTEXT MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "ƒvƒ�ƒZƒX‚Ì�I—¹(&E)", ID_PROCESS_PAGE_ENDPROCESS + MENUITEM "ƒvƒ�ƒZƒXƒcƒŠ�[‚Ì�I—¹(&T)", ID_PROCESS_PAGE_ENDPROCESSTREE + + MENUITEM "ƒfƒoƒbƒO(&D)", ID_PROCESS_PAGE_DEBUG + MENUITEM SEPARATOR + POPUP "—D�æ“x‚Ì�Ý’è(&P)" + BEGIN + MENUITEM "ƒŠƒAƒ‹ƒ^ƒCƒ€(&R)", ID_PROCESS_PAGE_SETPRIORITY_REALTIME + + MENUITEM "�‚(&H)", ID_PROCESS_PAGE_SETPRIORITY_HIGH + + MENUITEM "’Ê�íˆÈ�ã(&A)", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + + MENUITEM "’Ê�í(&N)", ID_PROCESS_PAGE_SETPRIORITY_NORMAL + + MENUITEM "’Ê�íˆÈ‰º(&B)", ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL + + MENUITEM "’á(&L)", ID_PROCESS_PAGE_SETPRIORITY_LOW + + END + MENUITEM "ŠÖŒW‚Ì�Ý’è(&A)...", ID_PROCESS_PAGE_SETAFFINITY + MENUITEM "ƒ_ƒ“ƒv ƒtƒ@ƒCƒ‹‚Ì�ì�¬(&C)...", ID_PROCESS_PAGE_DEBUGCHANNELS + END +END + +/* + Dialog +*/ + +IDD_ABOUTBOX DIALOG DISCARDABLE 22, 17, 259, 210 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ ‚̃o�[ƒWƒ‡ƒ“�î•ñ" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Task Manager v1.0\nCopyright (C) 1999 - 2001\nby Brian Palmer (brianp@reactos.org)", + IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,53,28, + 122,26 + DEFPUSHBUTTON "OK",IDOK,183,189,44,14,WS_GROUP + ICON IDI_TASKMANAGER,IDC_STATIC,19,30,20,20 + EDITTEXT IDC_LICENSE_EDIT,53,63,174,107,ES_MULTILINE | + ES_READONLY | WS_VSCROLL +END + +IDD_TASKMGR_DIALOG DIALOG DISCARDABLE 0, 0, 264, 246 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ" +MENU IDR_TASKMANAGER +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,3,3,257,228 +END + +IDD_APPLICATION_PAGE DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_APPLIST,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,233,177 + PUSHBUTTON "�V‚µ‚¢ƒ^ƒXƒN(&N)...",IDC_NEWTASK,187,189,53,14 + PUSHBUTTON "�Ø‚è‘Ö‚¦(&S)",IDC_SWITCHTO,131,189,53,14,WS_DISABLED + PUSHBUTTON "ƒ^ƒXƒN‚Ì�I—¹(&E)",IDC_ENDTASK,75,189,53,14,WS_DISABLED +END + +IDD_PROCESS_PAGE DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_PROCESSLIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDATA | + WS_BORDER | WS_TABSTOP,7,7,233,177 + PUSHBUTTON "ƒvƒ�ƒZƒX‚Ì�I—¹(&E)",IDC_ENDPROCESS,171,189,69,14 + CONTROL "‚·‚ׂẴ†�[ƒU�[‚̃vƒ�ƒZƒX‚ð•\Ž¦(&S)",IDC_SHOWALLPROCESSES, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,191,111,10 +END + +/*IDD_PERFORMANCE_PAGE DIALOGEX 0, 0, 247, 210*/ +IDD_PERFORMANCE_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "CPU Žg—p—¦",IDC_CPU_USAGE_FRAME,5,5,60,54,WS_TABSTOP, WS_EX_TRANSPARENT + GROUPBOX "ƒ�ƒ‚ƒŠ",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT + GROUPBOX "�‡Œv",IDC_TOTALS_FRAME,5,122,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "ƒRƒ~ƒbƒgƒ`ƒƒ�[ƒW (K)",IDC_COMMIT_CHARGE_FRAME,5,166,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "•¨—�ƒ�ƒ‚ƒŠPhysical Memory (K)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "ƒJ�[ƒlƒ‹ ƒ�ƒ‚ƒŠ (K)",IDC_KERNEL_MEMORY_FRAME,131,166,111,39,0,WS_EX_TRANSPARENT + LTEXT "ƒnƒ“ƒhƒ‹",IDS_TOTALS_HANDLE_COUNT,12,131,27,8 + LTEXT "ƒXƒŒƒbƒh",IDS_TOTALS_THREAD_COUNT,12,140,27,8 + LTEXT "ƒvƒ�ƒZƒX",IDS_TOTALS_PROCESS_COUNT,12,149,34,8 + EDITTEXT IDC_TOTALS_HANDLE_COUNT,65,131,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_TOTALS_THREAD_COUNT,65,140,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_TOTALS_PROCESS_COUNT,65,149,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "�‡Œv",IDS_COMMIT_CHARGE_TOTAL,12,175,27,8 + LTEXT "ƒŠƒ~ƒbƒg",IDS_COMMIT_CHARGE_LIMIT,12,184,15,8 + LTEXT "ƒs�[ƒN",IDS_COMMIT_CHARGE_PEAK,12,193,34,8 + EDITTEXT IDC_COMMIT_CHARGE_TOTAL,65,174,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_COMMIT_CHARGE_LIMIT,65,184,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_COMMIT_CHARGE_PEAK,65,193,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "�‡Œv",IDS_PHYSICAL_MEMORY_TOTAL,137,131,27,8 + LTEXT "—˜—p‰Â”\\",IDS_PHYSICAL_MEMORY_AVAILABLE,137,140,30,8 + LTEXT "ƒVƒXƒeƒ€ ƒLƒƒƒbƒVƒ…",IDS_PHYSICAL_MEMORY_SYSTEM_CACHE,137,149,46,8 + EDITTEXT IDC_PHYSICAL_MEMORY_TOTAL,185,131,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_PHYSICAL_MEMORY_AVAILABLE,185,140,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_PHYSICAL_MEMORY_SYSTEM_CACHE,185,149,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "�‡Œv",IDS_KERNEL_MEMORY_TOTAL,137,174,27,8 + LTEXT "ƒy�[ƒW",IDS_KERNEL_MEMORY_PAGED,137,184,21,8 + LTEXT "”ñƒy�[ƒW",IDS_KERNEL_MEMORY_NONPAGED,137,193,34,8 + EDITTEXT IDC_KERNEL_MEMORY_TOTAL,185,174,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_KERNEL_MEMORY_PAGED,185,184,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_KERNEL_MEMORY_NONPAGED,185,193,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + GROUPBOX "CPU Žg—p—¦‚Ì—š—ð",IDC_CPU_USAGE_HISTORY_FRAME,74,5,168,54,0,WS_EX_TRANSPARENT + GROUPBOX "•¨—�ƒ�ƒ‚ƒŠ‚ÌŽg—p—¦‚Ì—š—ð",IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT + PUSHBUTTON "CPU Žg—p—¦",IDC_CPU_USAGE_GRAPH,12,17,47,37,0, + WS_EX_CLIENTEDGE + PUSHBUTTON "ƒ�ƒ‚ƒŠ Žg—p—¦",IDC_MEM_USAGE_GRAPH,12,75,47,37,0, + WS_EX_CLIENTEDGE + PUSHBUTTON "CPU Žg—p—¦‚Ì—š—ð",IDC_CPU_USAGE_HISTORY_GRAPH,81,17, + 153,37,0,WS_EX_CLIENTEDGE + PUSHBUTTON "ƒ�ƒ‚ƒŠŽg—p—¦‚Ì—š—ð",IDC_MEM_USAGE_HISTORY_GRAPH,81,75, + 153,37,0,WS_EX_CLIENTEDGE +END + +IDD_DEBUG_CHANNELS_DIALOG DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒ_ƒ“ƒv‚̃vƒ�ƒZƒX" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_DEBUG_CHANNELS_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP | + LVS_SORTASCENDING,7,7,233,177 + PUSHBUTTON "•Â‚¶‚é",IDOK,171,189,69,14 +END + +IDD_AFFINITY_DIALOG DIALOG DISCARDABLE 0, 0, 231, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒvƒ�ƒZƒbƒT‚ÌŠÖŒW" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,120,133,50,14 + PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹",IDCANCEL,174,133,50,14 + LTEXT "ƒvƒ�ƒZƒbƒT‚ÌŠÖŒW‚Ì�Ý’è‚Í�A‚Ç‚Ì CPU ‚Ńvƒ�ƒZƒX‚ðŽÀ�s‚·‚é‚©‚ð�§Œä‚µ‚Ü‚·�B", + IDC_STATIC,5,5,220,16 + CONTROL "CPU 0",IDC_CPU0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,28,37,10 + CONTROL "CPU 1",IDC_CPU1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,41,37,10 + CONTROL "CPU 2",IDC_CPU2,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,54,37,10 + CONTROL "CPU 3",IDC_CPU3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,67,37,10 + CONTROL "CPU 4",IDC_CPU4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,80,37,10 + CONTROL "CPU 5",IDC_CPU5,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,93,37,10 + CONTROL "CPU 6",IDC_CPU6,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,106,37,10 + CONTROL "CPU 7",IDC_CPU7,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,119,37,10 + CONTROL "CPU 8",IDC_CPU8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,61,28,37,10 + CONTROL "CPU 9",IDC_CPU9,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,61,41,37,10 + CONTROL "CPU 10",IDC_CPU10,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,54,41,10 + CONTROL "CPU 11",IDC_CPU11,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,67,41,10 + CONTROL "CPU 12",IDC_CPU12,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,80,41,10 + CONTROL "CPU 13",IDC_CPU13,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,93,41,10 + CONTROL "CPU 14",IDC_CPU14,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,106,41,10 + CONTROL "CPU 15",IDC_CPU15,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,119,41,10 + CONTROL "CPU 16",IDC_CPU16,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,28,41,10 + CONTROL "CPU 17",IDC_CPU17,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,41,41,10 + CONTROL "CPU 18",IDC_CPU18,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,54,41,10 + CONTROL "CPU 19",IDC_CPU19,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,67,41,10 + CONTROL "CPU 20",IDC_CPU20,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,80,41,10 + CONTROL "CPU 21",IDC_CPU21,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,93,41,10 + CONTROL "CPU 22",IDC_CPU22,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,106,41,10 + CONTROL "CPU 23",IDC_CPU23,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,119,41,10 + CONTROL "CPU 24",IDC_CPU24,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,28,41,10 + CONTROL "CPU 25",IDC_CPU25,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,41,41,10 + CONTROL "CPU 26",IDC_CPU26,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,54,41,10 + CONTROL "CPU 27",IDC_CPU27,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,67,41,10 + CONTROL "CPU 28",IDC_CPU28,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,80,41,10 + CONTROL "CPU 29",IDC_CPU29,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,93,41,10 + CONTROL "CPU 30",IDC_CPU30,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,106,41,10 + CONTROL "CPU 31",IDC_CPU31,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,119,41,10 +END + +IDD_COLUMNS_DIALOG DIALOG DISCARDABLE 0, 0, 195, 199 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "ƒvƒ�ƒZƒXƒy�[ƒW‚Ì—ñ‚Ì‘I‘ð" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,84,178,50,14 + PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹",IDCANCEL,138,178,50,14 + LTEXT "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚Ì [ƒvƒ�ƒZƒX] ƒy�[ƒW‚É•\Ž¦‚·‚é—ñ‚ð‘I‘ð‚µ‚Ü‚·�B", + IDC_STATIC,7,7,181,17 + CONTROL "ƒCƒ��[ƒW ƒpƒX–¼(&I)",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,7,28,56,10 + CONTROL "PID (ƒvƒ�ƒZƒX ID)(&P)",IDC_PID,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,39,88,10 + CONTROL "CPU Žg—p—¦(&C)",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,50,53,10 + CONTROL "CPU ŽžŠÔ(&E)",IDC_CPUTIME,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,61,48,10 + CONTROL "ƒ�ƒ‚ƒŠ - ƒRƒ~ƒbƒgƒTƒCƒY(&M)",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,72,63,10 + CONTROL "ƒ�ƒ‚ƒŠ - ƒ��[ƒLƒ“ƒO ƒZƒbƒg ƒfƒ‹ƒ^(&D)",IDC_MEMORYUSAGEDELTA,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,83,82,10 + CONTROL "ƒ�ƒ‚ƒŠ - ƒs�[ƒN ƒ��[ƒLƒ“ƒO ƒZƒbƒg(&K)",IDC_PEAKMEMORYUSAGE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,94,82,10 + CONTROL "ƒy�[ƒW ƒtƒHƒ‹ƒg(&F)",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,105,53,10 + CONTROL "USER ƒIƒuƒWƒFƒNƒg(&U)",IDC_USEROBJECTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,116,62,10 + CONTROL "I/O “Ç‚ÝŽæ‚è",IDC_IOREADS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,127,49,10 + CONTROL "I/O “Ç‚ÝŽæ‚èƒoƒCƒg�”",IDC_IOREADBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,138,65,10 + CONTROL "ƒZƒbƒVƒ‡ƒ“ ID(&S)",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,149,50,10 + CONTROL "ƒ†�[ƒU�[–¼(&N)",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,160,51,10 + CONTROL "ƒy�[ƒW ƒtƒHƒ‹ƒg ƒfƒ‹ƒ^(&A)",IDC_PAGEFAULTSDELTA,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,28,72,10 + CONTROL "‰¼‘zƒ�ƒ‚ƒŠ ƒTƒCƒY(&V)",IDC_VIRTUALMEMORYSIZE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,39,77,10 + CONTROL "ƒ�ƒ‚ƒŠ - ƒy�[ƒW ƒv�[ƒ‹(&G)",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,50,53,10 + CONTROL "ƒ�ƒ‚ƒŠ - ”ñƒy�[ƒW ƒv�[ƒ‹(&O)",IDC_NONPAGEDPOOL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,61,67,10 + CONTROL "Šî–{—D�æ“x(&R)",IDC_BASEPRIORITY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,72,55,10 + CONTROL "ƒnƒ“ƒhƒ‹(&H)",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,83,59,10 + CONTROL "ƒXƒŒƒbƒh(&T)",IDC_THREADCOUNT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,94,59,10 + CONTROL "GDI ƒIƒuƒWƒFƒNƒg",IDC_GDIOBJECTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,105,55,10 + CONTROL "I/O �‘‚«�ž‚Ý",IDC_IOWRITES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,116,49,10 + CONTROL "I/O �‘‚«�ž‚݃oƒCƒg�”",IDC_IOWRITEBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,127,65,10 + CONTROL "I/O ‚»‚Ì‘¼",IDC_IOOTHER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,138,46,10 + CONTROL "I/O ‚»‚Ì‘¼‚̃oƒCƒg�”",IDC_IOOTHERBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,149,65,10 +END + +/* + String Table +*/ + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_TITLE "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ" + IDC_TASKMGR "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_NEW "�V‚µ‚¢ƒvƒ�ƒOƒ‰ƒ€‚ðŽÀ�s‚µ‚Ü‚·�B" + ID_OPTIONS_ALWAYSONTOP "�Å�¬‰»‚³‚ê‚È‚¢ŒÀ‚è�A�í‚Ƀ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚ª‚Ù‚©‚Ì‚·‚ׂẴEƒBƒ“ƒhƒE‚æ‚è‚àŽè‘O‚É•\Ž¦‚³‚ê‚Ü‚·�B" + ID_OPTIONS_MINIMIZEONUSE + "[�Ø‚è‘Ö‚¦] ‘€�ì‚ðŽÀ�s‚·‚é‚Æ�Aƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚ª�Å�¬‰»‚³‚ê‚Ü‚·�B" + ID_OPTIONS_HIDEWHENMINIMIZED "�Å�¬‰»‚³‚ꂽ‚Æ‚«‚É�Aƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚ð‰B‚µ‚Ü‚·�B" + ID_VIEW_REFRESH "[�X�V‚Ì•p“x] ‚Ì�Ý’è‚É‚©‚©‚í‚炸�A�¡‚·‚®ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚ð�X�V‚µ‚Ü‚·�B" + ID_VIEW_LARGE "ƒ^ƒXƒN‚Ì•\Ž¦‚É ‘åƒAƒCƒRƒ“ ‚ðŽg—p‚µ‚Ü‚·�B" + ID_VIEW_SMALL "ƒ^ƒXƒN‚Ì•\Ž¦‚É �¬ƒAƒCƒRƒ“ ‚ðŽg—p‚µ‚Ü‚·�B" + ID_VIEW_DETAILS "Šeƒ^ƒXƒN‚Ì�î•ñ‚ð•\Ž¦‚µ‚Ü‚·�B" + ID_VIEW_UPDATESPEED_HIGH "–ˆ•b 2‰ñ•\Ž¦‚ð�X�V‚µ‚Ü‚·�B" + ID_VIEW_UPDATESPEED_NORMAL "2•b‚É 1‰ñ•\Ž¦‚ð�X�V‚µ‚Ü‚·�B" + ID_VIEW_UPDATESPEED_LOW "4•b‚É 1‰ñ•\Ž¦‚ð�X�V‚µ‚Ü‚·�B" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_UPDATESPEED_PAUSED "•\Ž¦‚ðŽ©“®“I‚É�X�V‚µ‚Ü‚¹‚ñ�B" + ID_WINDOWS_TILEHORIZONTALLY + "ƒfƒXƒNƒgƒbƒv�ã‚ŃEƒBƒ“ƒhƒE‚ª�d‚È‚ç‚È‚¢‚悤‚É�㉺‚É•À‚ׂĕ\Ž¦‚µ‚Ü‚·�B" + ID_WINDOWS_TILEVERTICALLY "ƒfƒXƒNƒgƒbƒv�ã‚ŃEƒBƒ“ƒhƒE‚ª�d‚È‚ç‚È‚¢‚悤‚É�¶‰E‚É•À‚ׂĕ\Ž¦‚µ‚Ü‚·�B" + ID_WINDOWS_MINIMIZE "ƒEƒBƒ“ƒhƒE‚ð�Å�¬‰»‚µ‚Ü‚·�B" + ID_WINDOWS_MAXIMIZE "ƒEƒBƒ“ƒhƒE‚ð‰æ–Ê‚¢‚Á‚Ï‚¢‚ÉŠg‘債‚Ü‚·�B" + ID_WINDOWS_CASCADE "ƒfƒXƒNƒgƒbƒv�ã‚ŃEƒBƒ“ƒhƒE‚ð�d‚Ë‚Ä•\Ž¦‚µ‚Ü‚·�B" + ID_WINDOWS_BRINGTOFRONT "ƒEƒBƒ“ƒhƒE‚ðŽè‘O‚É•\Ž¦‚µ‚Ü‚·‚ª�A�Ø‚è‘Ö‚¦‚Ü‚¹‚ñ�B" + ID_HELP_TOPICS "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ‚̃wƒ‹ƒv ƒgƒsƒbƒN‚ð•\Ž¦‚µ‚Ü‚·�B" + ID_HELP_ABOUT "ƒvƒ�ƒOƒ‰ƒ€�î•ñ�Aƒo�[ƒWƒ‡ƒ“”Ô�†�A’˜�쌠‚ð•\Ž¦‚µ‚Ü‚·�B" + ID_FILE_EXIT "ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ ƒAƒvƒŠƒP�[ƒVƒ‡ƒ“‚ð�I—¹‚µ‚Ü‚·�B" + ID_OPTIONS_SHOW16BITTASKS + "16 ƒrƒbƒg Windows ƒ^ƒXƒN‚ð�AŠÖ˜A•t‚¯‚ç‚ꂽ ntvdm.exe ‚̉º‚É•\Ž¦‚µ‚Ü‚·�B" + ID_VIEW_SELECTCOLUMNS "[ƒvƒ�ƒZƒX] ƒy�[ƒW‚É•\Ž¦‚·‚é—ñ‚ð‘I‘ð‚µ‚Ü‚·�B" + ID_VIEW_SHOWKERNELTIMES "ƒJ�[ƒlƒ‹ŽžŠÔ‚ðƒpƒtƒH�[ƒ}ƒ“ƒXƒOƒ‰ƒt�ã‚É•\Ž¦‚µ‚Ü‚·�B" + ID_VIEW_CPUHISTORY_ONEGRAPHALL + "1 ‚‚̗š—ðƒOƒ‰ƒt‚Å CPU Žg—p—¦‚Ì�‡Œv‚ð•\Ž¦‚µ‚Ü‚·�B" + ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "CPU Žg—p—¦‚Ì—š—ð‚ð CPU ‚²‚ƂɃOƒ‰ƒt‚Å•\Ž¦‚µ‚Ü‚·�B" + ID_APPLICATION_PAGE_SWITCHTO + "‘I‘ð‚µ‚½ƒ^ƒXƒN‚ðŽè‘O‚É•\Ž¦‚µ‚Ä�Ø‚è‘Ö‚¦‚Ü‚·�B" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_ENDTASK "ƒ^ƒXƒN‚ð•Â‚¶‚Ü‚·�B" + ID_GOTOPROCESS "ƒtƒH�[ƒJƒX‚ð‘I‘ð‚µ‚½ƒ^ƒXƒN‚̃vƒ�ƒZƒX‚Ɉړ®‚µ‚Ü‚·�B" + ID_RESTORE "�Å�¬‰»�ó‘Ô‚©‚ç ƒ^ƒXƒN ƒ}ƒl�[ƒWƒƒ ‚𕜌³‚µ‚Ü‚·�B" + ID_PROCESS_PAGE_ENDPROCESS "‘I‘ð‚µ‚½ƒvƒ�ƒZƒX‚ð�I—¹‚µ‚Ü‚·�B" + ID_PROCESS_PAGE_ENDPROCESSTREE + "‘I‘ð‚µ‚½ƒvƒ�ƒZƒX‚¨‚æ‚Ñ�Aƒvƒ�ƒZƒX‚ÉŠÖ˜A‚·‚é‚·‚ׂẴvƒ�ƒZƒX‚ð�I—¹‚µ‚Ü‚·�B" + ID_PROCESS_PAGE_DEBUG "ƒfƒoƒbƒK‚ð‚±‚Ìƒvƒ�ƒZƒX‚É•t‚¯‚Ü‚·" + ID_PROCESS_PAGE_SETAFFINITY + "ƒvƒ�ƒZƒX‚ðŽÀ�s‚·‚éƒvƒ�ƒZƒbƒT‚ð�§Œä‚µ‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_REALTIME + "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚𠃊ƒAƒ‹ƒ^ƒCƒ€ ‚É�ݒ肵‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_HIGH "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚ð �‚ ‚É�ݒ肵‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚ð ’Ê�íˆÈ�ã ‚É�ݒ肵‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_NORMAL + "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚ð ’Ê�í ‚É�ݒ肵‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL + "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚ð ’Ê�íˆÈ‰º ‚É�ݒ肵‚Ü‚·�B" + ID_PROCESS_PAGE_SETPRIORITY_LOW "ƒvƒ�ƒZƒX‚Ì—D�æƒNƒ‰ƒX‚ð ’á ‚É�ݒ肵‚Ü‚·�B" + IDS_LICENSE "This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\r\n\r\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA." +END diff --git a/programs/taskmgr/taskmgr.rc b/programs/taskmgr/taskmgr.rc index 64cb16b98df..a89d66657fb 100644 --- a/programs/taskmgr/taskmgr.rc +++ b/programs/taskmgr/taskmgr.rc @@ -27,6 +27,7 @@ #include "De.rc" #include "En.rc" #include "Fr.rc" +#include "Ja.rc" #include "Ko.rc" #include "Nl.rc" #include "No.rc" diff --git a/server/async.c b/server/async.c index 8b3049cd476..043ed7d149e 100644 --- a/server/async.c +++ b/server/async.c @@ -214,10 +214,10 @@ struct async *create_async( struct thread *thread, struct async_queue *queue, co } /* set the timeout of an async operation */ -void async_set_timeout( struct async *async, const struct timeval *timeout, unsigned int status ) +void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ) { if (async->timeout) remove_timeout_user( async->timeout ); - if (timeout) async->timeout = add_timeout_user( timeout, async_timeout, async ); + if (timeout != TIMEOUT_INFINITE) async->timeout = add_timeout_user( timeout, async_timeout, async ); else async->timeout = NULL; async->timeout_status = status; } diff --git a/server/fd.c b/server/fd.c index adcaa20c9c6..656042f5475 100644 --- a/server/fd.c +++ b/server/fd.c @@ -170,9 +170,9 @@ struct fd unsigned int options; /* file options (FILE_DELETE_ON_CLOSE, FILE_SYNCHRONOUS...) */ unsigned int sharing; /* file sharing mode */ int unix_fd; /* unix file descriptor */ + unsigned int no_fd_status;/* status to return when unix_fd is -1 */ int signaled :1; /* is the fd signaled? */ int fs_locks :1; /* can we use filesystem locks for this fd? */ - int unmounted :1;/* has the device been unmounted? */ int poll_index; /* index of fd in poll array */ struct async_queue *read_q; /* async readers of this fd */ struct async_queue *write_q; /* async writers of this fd */ @@ -322,23 +322,30 @@ static file_pos_t max_unix_offset = OFF_T_MAX; struct timeout_user { struct list entry; /* entry in sorted timeout list */ - struct timeval when; /* timeout expiry (absolute time) */ + timeout_t when; /* timeout expiry (absolute time) */ timeout_callback callback; /* callback function */ void *private; /* callback private data */ }; static struct list timeout_list = LIST_INIT(timeout_list); /* sorted timeouts list */ -struct timeval current_time; +timeout_t current_time; + +static inline void set_current_time(void) +{ + static const timeout_t ticks_1601_to_1970 = (timeout_t)86400 * (369 * 365 + 89) * TICKS_PER_SEC; + struct timeval now; + gettimeofday( &now, NULL ); + current_time = (timeout_t)now.tv_sec * TICKS_PER_SEC + now.tv_usec * 10 + ticks_1601_to_1970; +} /* add a timeout user */ -struct timeout_user *add_timeout_user( const struct timeval *when, timeout_callback func, - void *private ) +struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private ) { struct timeout_user *user; struct list *ptr; if (!(user = mem_alloc( sizeof(*user) ))) return NULL; - user->when = *when; + user->when = (when > 0) ? when : current_time - when; user->callback = func; user->private = private; @@ -347,7 +354,7 @@ struct timeout_user *add_timeout_user( const struct timeval *when, timeout_callb LIST_FOR_EACH( ptr, &timeout_list ) { struct timeout_user *timeout = LIST_ENTRY( ptr, struct timeout_user, entry ); - if (!time_before( &timeout->when, when )) break; + if (timeout->when >= user->when) break; } list_add_before( ptr, &user->entry ); return user; @@ -360,19 +367,39 @@ void remove_timeout_user( struct timeout_user *user ) free( user ); } -/* add a timeout in milliseconds to an absolute time */ -void add_timeout( struct timeval *when, int timeout ) +/* return a text description of a timeout for debugging purposes */ +const char *get_timeout_str( timeout_t timeout ) { - if (timeout) + static char buffer[64]; + long secs, nsecs; + + if (!timeout) return "0"; + if (timeout == TIMEOUT_INFINITE) return "infinite"; + + if (timeout < 0) /* relative */ + { + secs = -timeout / TICKS_PER_SEC; + nsecs = -timeout % TICKS_PER_SEC; + sprintf( buffer, "+%ld.%07ld", secs, nsecs ); + } + else /* absolute */ { - long sec = timeout / 1000; - if ((when->tv_usec += (timeout - 1000*sec) * 1000) >= 1000000) + secs = (timeout - current_time) / TICKS_PER_SEC; + nsecs = (timeout - current_time) % TICKS_PER_SEC; + if (nsecs < 0) { - when->tv_usec -= 1000000; - when->tv_sec++; + nsecs += TICKS_PER_SEC; + secs--; } - when->tv_sec += sec; + if (secs >= 0) + sprintf( buffer, "%x%08x (+%ld.%07ld)", + (unsigned int)(timeout >> 32), (unsigned int)timeout, secs, nsecs ); + else + sprintf( buffer, "%x%08x (-%ld.%07ld)", + (unsigned int)(timeout >> 32), (unsigned int)timeout, + -(secs + 1), TICKS_PER_SEC - nsecs ); } + return buffer; } @@ -467,7 +494,7 @@ static inline void main_loop_epoll(void) if (epoll_fd == -1) break; /* an error occurred with epoll */ ret = epoll_wait( epoll_fd, events, sizeof(events)/sizeof(events[0]), timeout ); - gettimeofday( ¤t_time, NULL ); + set_current_time(); /* put the events into the pollfd array first, like poll does */ for (i = 0; i < ret; i++) @@ -573,7 +600,7 @@ static inline void main_loop_epoll(void) } else ret = kevent( kqueue_fd, NULL, 0, events, sizeof(events)/sizeof(events[0]), NULL ); - gettimeofday( ¤t_time, NULL ); + set_current_time(); /* put the events into the pollfd array first, like poll does */ for (i = 0; i < ret; i++) @@ -679,7 +706,7 @@ static int get_next_timeout(void) { struct timeout_user *timeout = LIST_ENTRY( ptr, struct timeout_user, entry ); - if (!time_before( ¤t_time, &timeout->when )) + if (timeout->when <= current_time) { list_remove( &timeout->entry ); list_add_tail( &expired_list, &timeout->entry ); @@ -700,8 +727,7 @@ static int get_next_timeout(void) if ((ptr = list_head( &timeout_list )) != NULL) { struct timeout_user *timeout = LIST_ENTRY( ptr, struct timeout_user, entry ); - int diff = (timeout->when.tv_sec - current_time.tv_sec) * 1000 - + (timeout->when.tv_usec - current_time.tv_usec + 999) / 1000; + int diff = (timeout->when - current_time + 9999) / 10000; if (diff < 0) diff = 0; return diff; } @@ -714,7 +740,8 @@ void main_loop(void) { int i, ret, timeout; - gettimeofday( ¤t_time, NULL ); + set_current_time(); + server_start_time = current_time; main_loop_epoll(); /* fall through to normal poll loop */ @@ -726,7 +753,7 @@ void main_loop(void) if (!active_users) break; /* last user removed by a timeout */ ret = poll( pollfd, nb_users, timeout ); - gettimeofday( ¤t_time, NULL ); + set_current_time(); if (ret > 0) { @@ -1341,7 +1368,7 @@ static inline void unmount_fd( struct fd *fd ) if (fd->unix_fd != -1) close( fd->unix_fd ); fd->unix_fd = -1; - fd->unmounted = 1; + fd->no_fd_status = STATUS_VOLUME_DISMOUNTED; fd->closed->unix_fd = -1; fd->closed->unlink[0] = 0; @@ -1366,7 +1393,6 @@ static struct fd *alloc_fd_object(void) fd->unix_fd = -1; fd->signaled = 1; fd->fs_locks = 1; - fd->unmounted = 0; fd->poll_index = -1; fd->read_q = NULL; fd->write_q = NULL; @@ -1398,16 +1424,22 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use fd->unix_fd = -1; fd->signaled = 0; fd->fs_locks = 0; - fd->unmounted = 0; fd->poll_index = -1; fd->read_q = NULL; fd->write_q = NULL; fd->wait_q = NULL; + fd->no_fd_status = STATUS_BAD_DEVICE_TYPE; list_init( &fd->inode_entry ); list_init( &fd->locks ); return fd; } +/* set the status to return when the fd has no associated unix fd */ +void set_no_fd_status( struct fd *fd, unsigned int status ) +{ + fd->no_fd_status = status; +} + /* check if the desired access is possible without violating */ /* the sharing mode of other opens of the same file */ static int check_sharing( struct fd *fd, unsigned int access, unsigned int sharing ) @@ -1605,11 +1637,7 @@ unsigned int get_fd_options( struct fd *fd ) /* retrieve the unix fd for an object */ int get_unix_fd( struct fd *fd ) { - if (fd->unix_fd == -1) - { - if (fd->unmounted) set_error( STATUS_VOLUME_DISMOUNTED ); - else set_error( STATUS_BAD_DEVICE_TYPE ); - } + if (fd->unix_fd == -1) set_error( fd->no_fd_status ); return fd->unix_fd; } @@ -1710,12 +1738,12 @@ struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type, assert(0); } - if ((async = create_async( current, queue, data ))) + if ((async = create_async( current, queue, data )) && type != ASYNC_TYPE_WAIT) { if (!fd->inode) set_fd_events( fd, fd->fd_ops->get_poll_events( fd ) ); else /* regular files are always ready for read and write */ - if (type != ASYNC_TYPE_WAIT) async_wake_up( queue, STATUS_ALERTED ); + async_wake_up( queue, STATUS_ALERTED ); } return async; } @@ -1828,7 +1856,7 @@ static void unmount_device( struct fd *device_fd ) } /* default ioctl() routine */ -void default_fd_ioctl( struct fd *fd, unsigned int code, const async_data_t *async, +void default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, const void *data, data_size_t size ) { switch(code) @@ -1905,19 +1933,15 @@ DECL_HANDLER(get_handle_fd) if ((fd = get_handle_fd_obj( current->process, req->handle, 0 ))) { - reply->type = fd->fd_ops->get_fd_type( fd ); - if (reply->type != FD_TYPE_INVALID) + int unix_fd = get_unix_fd( fd ); + if (unix_fd != -1) { - int unix_fd = get_unix_fd( fd ); - if (unix_fd != -1) - { - send_client_fd( current->process, unix_fd, req->handle ); - reply->removable = is_fd_removable(fd); - reply->options = fd->options; - reply->access = get_handle_access( current->process, req->handle ); - } + send_client_fd( current->process, unix_fd, req->handle ); + reply->type = fd->fd_ops->get_fd_type( fd ); + reply->removable = is_fd_removable(fd); + reply->options = fd->options; + reply->access = get_handle_access( current->process, req->handle ); } - else set_error( STATUS_OBJECT_TYPE_MISMATCH ); release_object( fd ); } } @@ -1956,7 +1980,7 @@ DECL_HANDLER(register_async) if ((fd = get_handle_fd_obj( current->process, req->handle, access ))) { - fd->fd_ops->queue_async( fd, &req->async, req->type, req->count ); + if (get_unix_fd( fd ) != -1) fd->fd_ops->queue_async( fd, &req->async, req->type, req->count ); release_object( fd ); } } @@ -1965,15 +1989,10 @@ DECL_HANDLER(register_async) DECL_HANDLER(cancel_async) { struct fd *fd = get_handle_fd_obj( current->process, req->handle, 0 ); + if (fd) { - /* Note: we don't kill the queued APC_ASYNC_IO on this thread because - * NtCancelIoFile() will force the pending APC to be run. Since, - * Windows only guarantees that the current thread will have no async - * operation on the current fd when NtCancelIoFile returns, this shall - * do the work. - */ - fd->fd_ops->cancel_async( fd ); + if (get_unix_fd( fd ) != -1) fd->fd_ops->cancel_async( fd ); release_object( fd ); - } + } } diff --git a/server/file.h b/server/file.h index 2c54e4d7985..09c90c3c311 100644 --- a/server/file.h +++ b/server/file.h @@ -40,7 +40,7 @@ struct fd_ops /* get file information */ enum server_fd_type (*get_fd_type)(struct fd *fd); /* perform an ioctl on the file */ - void (*ioctl)(struct fd *fd, unsigned int code, const async_data_t *async, + void (*ioctl)(struct fd *fd, ioctl_code_t code, const async_data_t *async, const void *data, data_size_t size); /* queue an async operation */ void (*queue_async)(struct fd *, const async_data_t *data, int type, int count); @@ -53,6 +53,7 @@ struct fd_ops /* file descriptor functions */ extern struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user ); +extern void set_no_fd_status( struct fd *fd, unsigned int status ); extern struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int access, unsigned int sharing, unsigned int options ); extern struct fd *create_anonymous_fd( const struct fd_ops *fd_user_ops, @@ -77,7 +78,7 @@ extern void default_poll_event( struct fd *fd, int event ); extern struct async *fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count ); extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status ); extern void fd_reselect_async( struct fd *fd, struct async_queue *queue ); -extern void default_fd_ioctl( struct fd *fd, unsigned int code, const async_data_t *async, +extern void default_fd_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, const void *data, data_size_t size ); extern void default_fd_queue_async( struct fd *fd, const async_data_t *data, int type, int count ); extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue ); @@ -91,20 +92,15 @@ static inline struct fd *get_obj_fd( struct object *obj ) { return obj->ops->get /* timeout functions */ struct timeout_user; -extern struct timeval current_time; +extern timeout_t current_time; + +#define TICKS_PER_SEC 10000000 typedef void (*timeout_callback)( void *private ); -extern struct timeout_user *add_timeout_user( const struct timeval *when, - timeout_callback func, void *private ); +extern struct timeout_user *add_timeout_user( timeout_t when, timeout_callback func, void *private ); extern void remove_timeout_user( struct timeout_user *user ); -extern void add_timeout( struct timeval *when, int timeout ); -/* return 1 if t1 is before t2 */ -static inline int time_before( const struct timeval *t1, const struct timeval *t2 ) -{ - return ((t1->tv_sec < t2->tv_sec) || - ((t1->tv_sec == t2->tv_sec) && (t1->tv_usec < t2->tv_usec))); -} +extern const char *get_timeout_str( timeout_t timeout ); /* file functions */ @@ -133,8 +129,7 @@ extern struct async_queue *create_async_queue( struct fd *fd ); extern void free_async_queue( struct async_queue *queue ); extern struct async *create_async( struct thread *thread, struct async_queue *queue, const async_data_t *data ); -extern void async_set_timeout( struct async *async, const struct timeval *timeout, - unsigned int status ); +extern void async_set_timeout( struct async *async, timeout_t timeout, unsigned int status ); extern void async_set_result( struct object *obj, unsigned int status ); extern int async_waiting( struct async_queue *queue ); extern void async_wake_up( struct async_queue *queue, unsigned int status ); diff --git a/server/mailslot.c b/server/mailslot.c index 94f7f340a07..8bcb723903e 100644 --- a/server/mailslot.c +++ b/server/mailslot.c @@ -58,7 +58,7 @@ struct mailslot struct fd *fd; int write_fd; unsigned int max_msgsize; - int read_timeout; + timeout_t read_timeout; struct list writers; }; @@ -214,8 +214,8 @@ static void mailslot_dump( struct object *obj, int verbose ) struct mailslot *mailslot = (struct mailslot *) obj; assert( obj->ops == &mailslot_ops ); - fprintf( stderr, "Mailslot max_msgsize=%d read_timeout=%d\n", - mailslot->max_msgsize, mailslot->read_timeout ); + fprintf( stderr, "Mailslot max_msgsize=%d read_timeout=%s\n", + mailslot->max_msgsize, get_timeout_str(mailslot->read_timeout) ); } static enum server_fd_type mailslot_get_fd_type( struct fd *fd ) @@ -299,12 +299,8 @@ static void mailslot_queue_async( struct fd *fd, const async_data_t *data, int t if ((async = fd_queue_async( fd, data, type, count ))) { - if (mailslot->read_timeout != -1) - { - struct timeval when = current_time; - add_timeout( &when, max(1,mailslot->read_timeout) ); - async_set_timeout( async, &when, STATUS_IO_TIMEOUT ); - } + async_set_timeout( async, mailslot->read_timeout ? mailslot->read_timeout : -1, + STATUS_IO_TIMEOUT ); release_object( async ); set_error( STATUS_PENDING ); } @@ -375,7 +371,7 @@ void create_mailslot_device( struct directory *root, const struct unicode_str *n static struct mailslot *create_mailslot( struct directory *root, const struct unicode_str *name, unsigned int attr, - int max_msgsize, int read_timeout ) + int max_msgsize, timeout_t read_timeout ) { struct object *obj; struct unicode_str new_name; diff --git a/server/main.c b/server/main.c index f96e2ee2c71..c839c18220f 100644 --- a/server/main.c +++ b/server/main.c @@ -36,8 +36,8 @@ /* command-line options */ int debug_level = 0; -int master_socket_timeout = 3; /* master socket timeout in seconds, default is 3 s */ int foreground = 0; +timeout_t master_socket_timeout = 3 * -TICKS_PER_SEC; /* master socket timeout, default is 3 seconds */ const char *server_argv0; /* parse-line args */ @@ -84,8 +84,10 @@ static void parse_args( int argc, char *argv[] ) else ret = kill_lock_owner(-1); exit( !ret ); case 'p': - if (isdigit(argv[i][2])) master_socket_timeout = atoi( argv[i] + 2 ); - else master_socket_timeout = -1; + if (isdigit(argv[i][2])) + master_socket_timeout = (timeout_t)atoi( argv[i] + 2 ) * -TICKS_PER_SEC; + else + master_socket_timeout = TIMEOUT_INFINITE; break; case 'v': fprintf( stderr, "%s\n", PACKAGE_STRING ); diff --git a/server/named_pipe.c b/server/named_pipe.c index 680e7db13ec..f2c794701d2 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -69,13 +69,13 @@ struct pipe_server { struct object obj; /* object header */ struct fd *fd; /* pipe file descriptor */ + struct fd *ioctl_fd; /* file descriptor for ioctls when not connected */ struct list entry; /* entry in named pipe servers list */ enum pipe_state state; /* server state */ struct pipe_client *client; /* client that this server is connected to */ struct named_pipe *pipe; struct timeout_user *flush_poll; struct event *event; - struct async_queue *wait_q; /* only a single one can be queued */ unsigned int options; /* pipe options */ }; @@ -94,8 +94,8 @@ struct named_pipe unsigned int maxinstances; unsigned int outsize; unsigned int insize; - unsigned int timeout; unsigned int instances; + timeout_t timeout; struct list servers; /* list of servers using this pipe */ struct async_queue *waiters; /* list of clients waiting to connect */ }; @@ -139,7 +139,7 @@ static struct fd *pipe_server_get_fd( struct object *obj ); static void pipe_server_destroy( struct object *obj); static void pipe_server_flush( struct fd *fd, struct event **event ); static enum server_fd_type pipe_server_get_fd_type( struct fd *fd ); -static void pipe_server_ioctl( struct fd *fd, unsigned int code, const async_data_t *async, +static void pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async, const void *data, data_size_t size ); static const struct object_ops pipe_server_ops = @@ -215,6 +215,8 @@ static struct object *named_pipe_device_open_file( struct object *obj, unsigned unsigned int sharing, unsigned int options ); static void named_pipe_device_destroy( struct object *obj ); static enum server_fd_type named_pipe_device_get_fd_type( struct fd *fd ); +static void named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, + const void *data, data_size_t size ); static const struct object_ops named_pipe_device_ops = { @@ -226,7 +228,7 @@ static const struct object_ops named_pipe_device_ops = no_satisfied, /* satisfied */ no_signal, /* signal */ named_pipe_device_get_fd, /* get_fd */ - pipe_map_access, /* map_access */ + no_map_access, /* map_access */ named_pipe_device_lookup_name, /* lookup_name */ named_pipe_device_open_file, /* open_file */ fd_close_handle, /* close_handle */ @@ -239,7 +241,7 @@ static const struct fd_ops named_pipe_device_fd_ops = default_poll_event, /* poll_event */ no_flush, /* flush */ named_pipe_device_get_fd_type, /* get_fd_type */ - default_fd_ioctl, /* ioctl */ + named_pipe_device_ioctl, /* ioctl */ default_fd_queue_async, /* queue_async */ default_fd_reselect_async, /* reselect_async */ default_fd_cancel_async /* cancel_async */ @@ -295,28 +297,34 @@ static struct fd *pipe_client_get_fd( struct object *obj ) return NULL; } -static struct fd *pipe_server_get_fd( struct object *obj ) +static void set_server_state( struct pipe_server *server, enum pipe_state state ) { - struct pipe_server *server = (struct pipe_server *) obj; + server->state = state; - switch(server->state) + switch(state) { case ps_connected_server: case ps_wait_disconnect: assert( server->fd ); - return (struct fd *) grab_object( server->fd ); - + break; case ps_wait_open: case ps_idle_server: - set_error( STATUS_PIPE_LISTENING ); + assert( !server->fd ); + set_no_fd_status( server->ioctl_fd, STATUS_PIPE_LISTENING ); break; - case ps_disconnected_server: case ps_wait_connect: - set_error( STATUS_PIPE_DISCONNECTED ); + assert( !server->fd ); + set_no_fd_status( server->ioctl_fd, STATUS_PIPE_DISCONNECTED ); break; } - return NULL; +} + +static struct fd *pipe_server_get_fd( struct object *obj ) +{ + struct pipe_server *server = (struct pipe_server *) obj; + + return (struct fd *)grab_object( server->fd ? server->fd : server->ioctl_fd ); } @@ -376,11 +384,10 @@ static void pipe_server_destroy( struct object *obj) server->client = NULL; } - free_async_queue( server->wait_q ); - assert( server->pipe->instances ); server->pipe->instances--; + if (server->ioctl_fd) release_object( server->ioctl_fd ); list_remove( &server->entry ); release_object( server->pipe ); } @@ -401,12 +408,10 @@ static void pipe_client_destroy( struct object *obj) case ps_connected_server: /* Don't destroy the server's fd here as we can't do a successful flush without it. */ - server->state = ps_wait_disconnect; - release_object( client->fd ); - client->fd = NULL; + set_server_state( server, ps_wait_disconnect ); break; case ps_disconnected_server: - server->state = ps_wait_connect; + set_server_state( server, ps_wait_connect ); break; case ps_idle_server: case ps_wait_open: @@ -418,7 +423,7 @@ static void pipe_client_destroy( struct object *obj) server->client = NULL; client->server = NULL; } - assert( !client->fd ); + if (client->fd) release_object( client->fd ); } static void named_pipe_device_dump( struct object *obj, int verbose ) @@ -512,9 +517,7 @@ static void check_flushed( void *arg ) assert( server->event ); if (pipe_data_remaining( server )) { - struct timeval tv = current_time; - add_timeout( &tv, 100 ); - server->flush_poll = add_timeout_user( &tv, check_flushed, server ); + server->flush_poll = add_timeout_user( -TICKS_PER_SEC / 10, check_flushed, server ); } else { @@ -538,14 +541,11 @@ static void pipe_server_flush( struct fd *fd, struct event **event ) if (pipe_data_remaining( server )) { - struct timeval tv = current_time; - - /* this kind of sux - + /* this kind of sux - there's no unix way to be alerted when a pipe becomes empty */ server->event = create_event( NULL, NULL, 0, 0, 0 ); if (!server->event) return; - add_timeout( &tv, 100 ); - server->flush_poll = add_timeout_user( &tv, check_flushed, server ); + server->flush_poll = add_timeout_user( -TICKS_PER_SEC / 10, check_flushed, server ); *event = server->event; } } @@ -570,13 +570,42 @@ static enum server_fd_type pipe_client_get_fd_type( struct fd *fd ) return FD_TYPE_PIPE; } -static void pipe_server_ioctl( struct fd *fd, unsigned int code, const async_data_t *async, +static void pipe_server_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, const void *data, data_size_t size ) { struct pipe_server *server = get_fd_user( fd ); + struct async *async; switch(code) { + case FSCTL_PIPE_LISTEN: + switch(server->state) + { + case ps_idle_server: + case ps_wait_connect: + set_server_state( server, ps_wait_open ); + if ((async = fd_queue_async( server->ioctl_fd, async_data, ASYNC_TYPE_WAIT, 0 ))) + { + if (server->pipe->waiters) async_wake_up( server->pipe->waiters, STATUS_SUCCESS ); + release_object( async ); + set_error( STATUS_PENDING ); + } + break; + case ps_connected_server: + set_error( STATUS_PIPE_CONNECTED ); + break; + case ps_disconnected_server: + set_error( STATUS_PIPE_BUSY ); + break; + case ps_wait_disconnect: + set_error( STATUS_NO_DATA_DETECTED ); + break; + case ps_wait_open: + set_error( STATUS_INVALID_HANDLE ); + break; + } + break; + case FSCTL_PIPE_DISCONNECT: switch(server->state) { @@ -588,24 +617,27 @@ static void pipe_server_ioctl( struct fd *fd, unsigned int code, const async_dat /* dump the client and server fds, but keep the pointers around - client loses all waiting data */ - server->state = ps_disconnected_server; do_disconnect( server ); + set_server_state( server, ps_disconnected_server ); break; case ps_wait_disconnect: assert( !server->client ); do_disconnect( server ); - server->state = ps_wait_connect; + set_server_state( server, ps_wait_connect ); break; case ps_idle_server: case ps_wait_open: + set_error( STATUS_PIPE_LISTENING ); + break; case ps_disconnected_server: case ps_wait_connect: - assert(0); /* shouldn't even get an fd */ + set_error( STATUS_PIPE_DISCONNECTED ); break; } break; + default: - default_fd_ioctl( fd, code, async, data, size ); + default_fd_ioctl( fd, code, async_data, data, size ); break; } } @@ -671,15 +703,18 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned server->fd = NULL; server->pipe = pipe; - server->state = ps_idle_server; server->client = NULL; server->flush_poll = NULL; server->options = options; - server->wait_q = create_async_queue( NULL ); list_add_head( &pipe->servers, &server->entry ); grab_object( pipe ); - + if (!(server->ioctl_fd = alloc_pseudo_fd( &pipe_server_fd_ops, &server->obj ))) + { + release_object( server ); + server = NULL; + } + set_server_state( server, ps_idle_server ); return server; } @@ -728,18 +763,13 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc { if (!socketpair( PF_UNIX, SOCK_STREAM, 0, fds )) { - int res = 0; - - assert( !client->fd ); assert( !server->fd ); /* for performance reasons, only set nonblocking mode when using * overlapped I/O. Otherwise, we will be doing too much busy * looping */ - if (is_overlapped( options )) - res = fcntl( fds[1], F_SETFL, O_NONBLOCK ); - if ((res != -1) && is_overlapped( server->options )) - res = fcntl( fds[0], F_SETFL, O_NONBLOCK ); + if (is_overlapped( options )) fcntl( fds[1], F_SETFL, O_NONBLOCK ); + if (is_overlapped( server->options )) fcntl( fds[0], F_SETFL, O_NONBLOCK ); if (pipe->insize) { @@ -754,22 +784,89 @@ static struct object *named_pipe_open_file( struct object *obj, unsigned int acc client->fd = create_anonymous_fd( &pipe_client_fd_ops, fds[1], &client->obj, options ); server->fd = create_anonymous_fd( &pipe_server_fd_ops, fds[0], &server->obj, server->options ); - if (client->fd && server->fd && res != 1) + if (client->fd && server->fd) { if (server->state == ps_wait_open) - async_wake_up( server->wait_q, STATUS_SUCCESS ); - server->state = ps_connected_server; + fd_async_wake_up( server->ioctl_fd, ASYNC_TYPE_WAIT, STATUS_SUCCESS ); + set_server_state( server, ps_connected_server ); server->client = client; client->server = server; } + else + { + release_object( client ); + client = NULL; + } } else + { file_set_error(); + release_object( client ); + client = NULL; + } } release_object( server ); return &client->obj; } +static void named_pipe_device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, + const void *data, data_size_t size ) +{ + struct named_pipe_device *device = get_fd_user( fd ); + + switch(code) + { + case FSCTL_PIPE_WAIT: + { + const FILE_PIPE_WAIT_FOR_BUFFER *buffer = data; + struct named_pipe *pipe; + struct pipe_server *server; + struct unicode_str name; + + if (size < sizeof(*buffer) || + size < FIELD_OFFSET(FILE_PIPE_WAIT_FOR_BUFFER, Name[buffer->NameLength/sizeof(WCHAR)])) + { + set_error( STATUS_INVALID_PARAMETER ); + break; + } + name.str = buffer->Name; + name.len = (buffer->NameLength / sizeof(WCHAR)) * sizeof(WCHAR); + if (!(pipe = (struct named_pipe *)find_object( device->pipes, &name, OBJ_CASE_INSENSITIVE ))) + { + set_error( STATUS_PIPE_NOT_AVAILABLE ); + break; + } + if (!(server = find_available_server( pipe ))) + { + struct async *async; + + if (!pipe->waiters && !(pipe->waiters = create_async_queue( NULL ))) + { + release_object( pipe ); + break; + } + + if ((async = create_async( current, pipe->waiters, async_data ))) + { + timeout_t when = buffer->TimeoutSpecified ? buffer->Timeout.QuadPart : pipe->timeout; + async_set_timeout( async, when, STATUS_IO_TIMEOUT ); + release_object( async ); + set_error( STATUS_PENDING ); + } + } + else release_object( server ); + + release_object( pipe ); + break; + } + + default: + default_fd_ioctl( fd, code, async_data, data, size ); + break; + } +} + + DECL_HANDLER(create_named_pipe) { struct named_pipe *pipe; @@ -829,94 +926,6 @@ DECL_HANDLER(create_named_pipe) release_object( pipe ); } -DECL_HANDLER(connect_named_pipe) -{ - struct pipe_server *server; - struct async *async; - - server = get_pipe_server_obj(current->process, req->handle, 0); - if (!server) - return; - - switch(server->state) - { - case ps_idle_server: - case ps_wait_connect: - assert( !server->fd ); - server->state = ps_wait_open; - if ((async = create_async( current, server->wait_q, &req->async ))) - { - if (server->pipe->waiters) async_wake_up( server->pipe->waiters, STATUS_SUCCESS ); - release_object( async ); - set_error( STATUS_PENDING ); - } - break; - case ps_connected_server: - assert( server->fd ); - set_error( STATUS_PIPE_CONNECTED ); - break; - case ps_disconnected_server: - set_error( STATUS_PIPE_BUSY ); - break; - case ps_wait_disconnect: - set_error( STATUS_NO_DATA_DETECTED ); - break; - case ps_wait_open: - set_error( STATUS_INVALID_HANDLE ); - break; - } - - release_object(server); -} - -DECL_HANDLER(wait_named_pipe) -{ - struct named_pipe_device *device; - struct named_pipe *pipe; - struct pipe_server *server; - struct unicode_str name; - - device = (struct named_pipe_device *)get_handle_obj( current->process, req->handle, - FILE_READ_ATTRIBUTES, &named_pipe_device_ops ); - if (!device) return; - - get_req_unicode_str( &name ); - pipe = (struct named_pipe *)find_object( device->pipes, &name, OBJ_CASE_INSENSITIVE ); - release_object( device ); - if (!pipe) - { - set_error( STATUS_PIPE_NOT_AVAILABLE ); - return; - } - server = find_available_server( pipe ); - if (!server) - { - struct async *async; - - if (!pipe->waiters && !(pipe->waiters = create_async_queue( NULL ))) - { - release_object( pipe ); - return; - } - - if ((async = create_async( current, pipe->waiters, &req->async ))) - { - if (req->timeout != NMPWAIT_WAIT_FOREVER) - { - struct timeval when = current_time; - if (req->timeout == NMPWAIT_USE_DEFAULT_WAIT) add_timeout( &when, pipe->timeout ); - else add_timeout( &when, req->timeout ); - async_set_timeout( async, &when, STATUS_TIMEOUT ); - } - release_object( async ); - set_error( STATUS_PENDING ); - } - } - else release_object( server ); - - release_object( pipe ); -} - DECL_HANDLER(get_named_pipe_info) { struct pipe_server *server; diff --git a/server/object.h b/server/object.h index a6632ba137c..ffb248687ff 100644 --- a/server/object.h +++ b/server/object.h @@ -214,11 +214,11 @@ extern void create_mailslot_device( struct directory *root, const struct unicode /* command-line options */ extern int debug_level; -extern int master_socket_timeout; extern int foreground; +extern timeout_t master_socket_timeout; extern const char *server_argv0; /* server start time used for GetTickCount() */ -extern struct timeval server_start_time; +extern timeout_t server_start_time; #endif /* __WINE_SERVER_OBJECT_H */ diff --git a/server/process.c b/server/process.c index 450b0799871..bb4037b09fb 100644 --- a/server/process.c +++ b/server/process.c @@ -244,13 +244,9 @@ static void start_sigkill_timer( struct process *process ) { grab_object( process ); if (process->unix_pid != -1 && process->msg_fd) - { - struct timeval when = current_time; - - add_timeout( &when, 1000 ); - process->sigkill_timeout = add_timeout_user( &when, process_sigkill, process ); - } - else process_died( process ); + process->sigkill_timeout = add_timeout_user( -TICKS_PER_SEC, process_sigkill, process ); + else + process_died( process ); } /* create a new process and its main thread */ @@ -295,7 +291,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit list_init( &process->dlls ); process->start_time = current_time; - process->end_time.tv_sec = process->end_time.tv_usec = 0; + process->end_time = 0; list_add_head( &process_list, &process->entry ); if (!(process->id = process->group_id = alloc_ptid( process ))) @@ -1014,10 +1010,8 @@ DECL_HANDLER(get_process_info) reply->priority = process->priority; reply->affinity = process->affinity; reply->peb = process->peb; - reply->start_time.sec = process->start_time.tv_sec; - reply->start_time.usec = process->start_time.tv_usec; - reply->end_time.sec = process->end_time.tv_sec; - reply->end_time.usec = process->end_time.tv_usec; + reply->start_time = process->start_time; + reply->end_time = process->end_time; release_object( process ); } } diff --git a/server/process.h b/server/process.h index 206d51cd749..c007bae9973 100644 --- a/server/process.h +++ b/server/process.h @@ -61,8 +61,8 @@ struct process int unix_pid; /* Unix pid for final SIGKILL */ int exit_code; /* process exit code */ int running_threads; /* number of threads running in this process */ - struct timeval start_time; /* absolute time at process start */ - struct timeval end_time; /* absolute time at process end */ + timeout_t start_time; /* absolute time at process start */ + timeout_t end_time; /* absolute time at process end */ int priority; /* priority class */ int affinity; /* process affinity mask */ int suspend; /* global process suspend count */ diff --git a/server/protocol.def b/server/protocol.def index 6c7ad043e42..570bd919432 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -37,6 +37,7 @@ typedef unsigned short atom_t; typedef unsigned int process_id_t; typedef unsigned int thread_id_t; typedef unsigned int data_size_t; +typedef unsigned int ioctl_code_t; struct request_header { @@ -148,12 +149,9 @@ struct wake_up_reply int signaled; /* wait result */ }; -/* structure for absolute timeouts */ -typedef struct -{ - int sec; /* seconds since Unix epoch */ - int usec; /* microseconds */ -} abs_time_t; +/* NT-style timeout, in 100ns units, negative means relative timeout */ +typedef __int64 timeout_t; +#define TIMEOUT_INFINITE (((timeout_t)0x7fffffff) << 32 | 0xffffffff) /* structure returned in the list of window properties */ typedef struct @@ -273,7 +271,7 @@ typedef union { enum apc_type type; /* APC_TIMER */ void (__stdcall *func)(void*, unsigned int, unsigned int); - abs_time_t time; /* absolute time of expiration */ + timeout_t time; /* absolute time of expiration */ void *arg; /* user argument */ } timer; struct @@ -525,7 +523,7 @@ typedef union process_id_t pid; /* process id of the new thread's process */ thread_id_t tid; /* thread id of the new thread */ data_size_t info_size; /* total size of startup info */ - abs_time_t server_start; /* server start time */ + timeout_t server_start; /* server start time */ int version; /* protocol version */ @END @@ -559,8 +557,8 @@ typedef union int priority; /* priority class */ int affinity; /* process affinity mask */ void* peb; /* PEB address in process address space */ - abs_time_t start_time; /* process start time */ - abs_time_t end_time; /* process end time */ + timeout_t start_time; /* process start time */ + timeout_t end_time; /* process end time */ @END @@ -586,8 +584,8 @@ typedef union int exit_code; /* thread exit code */ int priority; /* thread priority level */ int affinity; /* thread affinity mask */ - abs_time_t creation_time; /* thread creation time */ - abs_time_t exit_time; /* thread exit time */ + timeout_t creation_time; /* thread creation time */ + timeout_t exit_time; /* thread exit time */ int last; /* last thread in process */ @END @@ -739,13 +737,14 @@ typedef union int flags; /* wait flags (see below) */ void* cookie; /* magic cookie to return to client */ obj_handle_t signal; /* object to signal (0 if none) */ - abs_time_t timeout; /* absolute timeout */ + timeout_t timeout; /* timeout */ VARARG(handles,handles); /* handles to select on */ +@REPLY + timeout_t timeout; /* timeout converted to absolute */ @END #define SELECT_ALL 1 #define SELECT_ALERTABLE 2 #define SELECT_INTERRUPTIBLE 4 -#define SELECT_TIMEOUT 8 /* Create an event */ @@ -1647,7 +1646,7 @@ enum char_info_mode /* Set a waitable timer */ @REQ(set_timer) obj_handle_t handle; /* handle to the timer */ - abs_time_t expire; /* next expiration absolute time */ + timeout_t expire; /* next expiration absolute time */ int period; /* timer period in ms */ void* callback; /* callback function */ void* arg; /* callback argument */ @@ -1666,7 +1665,7 @@ enum char_info_mode @REQ(get_timer_info) obj_handle_t handle; /* handle to the timer */ @REPLY - abs_time_t when; /* absolute time when the timer next expires */ + timeout_t when; /* absolute time when the timer next expires */ int signaled; /* is the timer signaled? */ @END @@ -1814,7 +1813,7 @@ enum char_info_mode unsigned int msg; /* message code */ unsigned long wparam; /* parameters */ unsigned long lparam; /* parameters */ - int timeout; /* timeout for reply */ + timeout_t timeout; /* timeout for reply */ VARARG(data,message_data); /* message data for sent messages */ @END @@ -1969,7 +1968,7 @@ enum message_type /* Perform an ioctl on a file */ @REQ(ioctl) obj_handle_t handle; /* handle to the device */ - unsigned int code; /* ioctl code */ + ioctl_code_t code; /* ioctl code */ async_data_t async; /* async I/O parameters */ VARARG(in_data,bytes); /* ioctl input data */ @REPLY @@ -1987,7 +1986,7 @@ enum message_type unsigned int maxinstances; unsigned int outsize; unsigned int insize; - unsigned int timeout; + timeout_t timeout; VARARG(name,unicode_str); /* pipe name */ @REPLY obj_handle_t handle; /* handle to the pipe */ @@ -1999,21 +1998,6 @@ enum message_type #define NAMED_PIPE_NONBLOCKING_MODE 0x0004 #define NAMED_PIPE_SERVER_END 0x8000 -/* Connect to a named pipe */ -@REQ(connect_named_pipe) - obj_handle_t handle; - async_data_t async; /* async I/O parameters */ -@END - - -/* Wait for a named pipe */ -@REQ(wait_named_pipe) - obj_handle_t handle; - async_data_t async; /* async I/O parameters */ - unsigned int timeout; - VARARG(name,unicode_str); /* pipe name */ -@END - @REQ(get_named_pipe_info) obj_handle_t handle; @@ -2831,7 +2815,7 @@ enum message_type unsigned int attributes; /* object attributes */ obj_handle_t rootdir; /* root directory */ unsigned int max_msgsize; - int read_timeout; + timeout_t read_timeout; VARARG(name,unicode_str); /* mailslot name */ @REPLY obj_handle_t handle; /* handle to the mailslot */ @@ -2842,10 +2826,10 @@ enum message_type @REQ(set_mailslot_info) obj_handle_t handle; /* handle to the mailslot */ unsigned int flags; - int read_timeout; + timeout_t read_timeout; @REPLY unsigned int max_msgsize; - int read_timeout; + timeout_t read_timeout; @END #define MAILSLOT_SET_READ_TIMEOUT 1 diff --git a/server/queue.c b/server/queue.c index 85e08568e32..3220fcb6619 100644 --- a/server/queue.c +++ b/server/queue.c @@ -85,7 +85,7 @@ struct message struct timer { struct list entry; /* entry in timer list */ - struct timeval when; /* next expiration */ + timeout_t when; /* next expiration */ unsigned int rate; /* timer rate in ms */ user_handle_t win; /* window handle */ unsigned int msg; /* message to post */ @@ -131,7 +131,7 @@ struct msg_queue struct timeout_user *timeout; /* timeout for next timer to expire */ struct thread_input *input; /* thread input descriptor */ struct hook_table *hooks; /* hook table */ - struct timeval last_get_msg; /* time of last get message call */ + timeout_t last_get_msg; /* time of last get message call */ }; static void msg_queue_dump( struct object *obj, int verbose ); @@ -536,7 +536,7 @@ static void result_timeout( void *private ) /* allocate and fill a message result structure */ static struct message_result *alloc_message_result( struct msg_queue *send_queue, struct msg_queue *recv_queue, - struct message *msg, int timeout ) + struct message *msg, timeout_t timeout ) { struct message_result *result = mem_alloc( sizeof(*result) ); if (result) @@ -583,12 +583,8 @@ static struct message_result *alloc_message_result( struct msg_queue *send_queue list_add_head( &send_queue->send_result, &result->sender_entry ); } - if (timeout) - { - struct timeval when = current_time; - add_timeout( &when, timeout ); - result->timeout = add_timeout_user( &when, result_timeout, result ); - } + if (timeout != TIMEOUT_INFINITE) + result->timeout = add_timeout_user( timeout, result_timeout, result ); } return result; } @@ -766,7 +762,7 @@ static int is_queue_hung( struct msg_queue *queue ) { struct wait_queue_entry *entry; - if (current_time.tv_sec - queue->last_get_msg.tv_sec <= 5) + if (current_time - queue->last_get_msg <= 5 * TICKS_PER_SEC) return 0; /* less than 5 seconds since last get message -> not hung */ LIST_FOR_EACH_ENTRY( entry, &queue->obj.wait_queue, struct wait_queue_entry, entry ) @@ -997,7 +993,7 @@ static void set_next_timer( struct msg_queue *queue ) if ((ptr = list_head( &queue->pending_timers ))) { struct timer *timer = LIST_ENTRY( ptr, struct timer, entry ); - queue->timeout = add_timeout_user( &timer->when, timer_callback, queue ); + queue->timeout = add_timeout_user( timer->when, timer_callback, queue ); } /* set/clear QS_TIMER bit */ if (list_empty( &queue->expired_timers )) @@ -1049,7 +1045,7 @@ static void link_timer( struct msg_queue *queue, struct timer *timer ) for (ptr = queue->pending_timers.next; ptr != &queue->pending_timers; ptr = ptr->next) { struct timer *t = LIST_ENTRY( ptr, struct timer, entry ); - if (!time_before( &t->when, &timer->when )) break; + if (t->when >= timer->when) break; } list_add_before( ptr, &timer->entry ); } @@ -1066,7 +1062,7 @@ static void free_timer( struct msg_queue *queue, struct timer *timer ) static void restart_timer( struct msg_queue *queue, struct timer *timer ) { list_remove( &timer->entry ); - while (!time_before( ¤t_time, &timer->when )) add_timeout( &timer->when, timer->rate ); + while (timer->when <= current_time) timer->when += (timeout_t)timer->rate * 10000; link_timer( queue, timer ); set_next_timer( queue ); } @@ -1098,8 +1094,7 @@ static struct timer *set_timer( struct msg_queue *queue, unsigned int rate ) if (timer) { timer->rate = max( rate, 1 ); - timer->when = current_time; - add_timeout( &timer->when, rate ); + timer->when = current_time + (timeout_t)timer->rate * 10000; link_timer( queue, timer ); /* check if we replaced the next timer */ if (list_head( &queue->pending_timers ) == &timer->entry) set_next_timer( queue ); diff --git a/server/registry.c b/server/registry.c index 6e5e767f69a..8d1730939ec 100644 --- a/server/registry.c +++ b/server/registry.c @@ -103,7 +103,7 @@ struct key_value /* the root of the registry tree */ static struct key *root_key; -static const int save_period = 30000; /* delay between periodic saves (in ms) */ +static const timeout_t save_period = 30 * -TICKS_PER_SEC; /* delay between periodic saves */ static struct timeout_user *save_timeout_user; /* saving timer */ static void set_periodic_save_timer(void); @@ -1683,11 +1683,8 @@ static void periodic_save( void *arg ) /* start the periodic save timer */ static void set_periodic_save_timer(void) { - struct timeval next = current_time; - - add_timeout( &next, save_period ); if (save_timeout_user) remove_timeout_user( save_timeout_user ); - save_timeout_user = add_timeout_user( &next, periodic_save, NULL ); + save_timeout_user = add_timeout_user( save_period, periodic_save, NULL ); } /* save the modified registry branches to disk */ diff --git a/server/request.c b/server/request.c index 4c4036a0a17..2f15b9e10b8 100644 --- a/server/request.c +++ b/server/request.c @@ -117,7 +117,7 @@ static const struct fd_ops master_socket_fd_ops = struct thread *current = NULL; /* thread handling the current request */ unsigned int global_error = 0; /* global error code for when no thread is current */ -struct timeval server_start_time = { 0, 0 }; /* server startup time */ +timeout_t server_start_time = 0; /* server startup time */ static struct master_socket *master_socket; /* the master socket object */ static int force_shutdown; @@ -468,8 +468,7 @@ int send_client_fd( struct process *process, int fd, obj_handle_t handle ) /* get current tick count to return to client */ unsigned int get_tick_count(void) { - return ((current_time.tv_sec - server_start_time.tv_sec) * 1000) + - ((current_time.tv_usec - server_start_time.tv_usec) / 1000); + return (current_time - server_start_time) / 10000; } static void master_socket_dump( struct object *obj, int verbose ) @@ -801,9 +800,6 @@ void open_master_socket(void) msghdr.msg_iov = &myiovec; msghdr.msg_iovlen = 1; - /* init startup time */ - gettimeofday( &server_start_time, NULL ); - /* init the process tracing mechanism */ init_tracing_mechanism(); } @@ -828,15 +824,12 @@ static void close_socket_timeout( void *arg ) /* close the master socket and stop waiting for new clients */ void close_master_socket(void) { - if (master_socket_timeout == -1) return; /* just keep running forever */ + if (master_socket_timeout == TIMEOUT_INFINITE) return; /* just keep running forever */ if (master_socket_timeout) - { - struct timeval when = current_time; - add_timeout( &when, master_socket_timeout * 1000 ); - master_socket->timeout = add_timeout_user( &when, close_socket_timeout, NULL ); - } - else close_socket_timeout( NULL ); /* close it right away */ + master_socket->timeout = add_timeout_user( master_socket_timeout, close_socket_timeout, NULL ); + else + close_socket_timeout( NULL ); /* close it right away */ } /* forced shutdown, used for wineserver -k */ diff --git a/server/request.h b/server/request.h index 1634d4cc241..5035fbbcdf9 100644 --- a/server/request.h +++ b/server/request.h @@ -246,8 +246,6 @@ DECL_HANDLER(register_async); DECL_HANDLER(cancel_async); DECL_HANDLER(ioctl); DECL_HANDLER(create_named_pipe); -DECL_HANDLER(connect_named_pipe); -DECL_HANDLER(wait_named_pipe); DECL_HANDLER(get_named_pipe_info); DECL_HANDLER(create_cursor); DECL_HANDLER(destroy_cursor); @@ -473,8 +471,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_cancel_async, (req_handler)req_ioctl, (req_handler)req_create_named_pipe, - (req_handler)req_connect_named_pipe, - (req_handler)req_wait_named_pipe, (req_handler)req_get_named_pipe_info, (req_handler)req_create_cursor, (req_handler)req_destroy_cursor, diff --git a/server/serial.c b/server/serial.c index d677d171e86..628db5a36d3 100644 --- a/server/serial.c +++ b/server/serial.c @@ -180,7 +180,7 @@ static enum server_fd_type serial_get_fd_type( struct fd *fd ) static void serial_queue_async( struct fd *fd, const async_data_t *data, int type, int count ) { struct serial *serial = get_fd_user( fd ); - int timeout = 0; + timeout_t timeout = 0; struct async *async; assert(serial->obj.ops == &serial_ops); @@ -188,21 +188,16 @@ static void serial_queue_async( struct fd *fd, const async_data_t *data, int typ switch (type) { case ASYNC_TYPE_READ: - timeout = serial->readconst + serial->readmult*count; + timeout = serial->readconst + (timeout_t)serial->readmult*count; break; case ASYNC_TYPE_WRITE: - timeout = serial->writeconst + serial->writemult*count; + timeout = serial->writeconst + (timeout_t)serial->writemult*count; break; } if ((async = fd_queue_async( fd, data, type, count ))) { - if (timeout) - { - struct timeval when = current_time; - add_timeout( &when, timeout ); - async_set_timeout( async, &when, STATUS_TIMEOUT ); - } + if (timeout) async_set_timeout( async, timeout * -10000, STATUS_TIMEOUT ); release_object( async ); set_error( STATUS_PENDING ); } diff --git a/server/thread.c b/server/thread.c index 04fcdcef2ba..f6939050db3 100644 --- a/server/thread.c +++ b/server/thread.c @@ -62,7 +62,7 @@ struct thread_wait int count; /* count of objects */ int flags; void *cookie; /* magic cookie to return to client */ - struct timeval timeout; + timeout_t timeout; struct timeout_user *user; struct wait_queue_entry queues[1]; }; @@ -174,7 +174,7 @@ static inline void init_thread_structure( struct thread *thread ) thread->token = NULL; thread->creation_time = current_time; - thread->exit_time.tv_sec = thread->exit_time.tv_usec = 0; + thread->exit_time = 0; list_init( &thread->mutex_list ); list_init( &thread->system_apc ); @@ -523,24 +523,20 @@ static void end_wait( struct thread *thread ) } /* build the thread wait structure */ -static int wait_on( int count, struct object *objects[], int flags, const abs_time_t *timeout ) +static int wait_on( unsigned int count, struct object *objects[], int flags, timeout_t timeout ) { struct thread_wait *wait; struct wait_queue_entry *entry; - int i; + unsigned int i; - if (!(wait = mem_alloc( sizeof(*wait) + (count-1) * sizeof(*entry) ))) return 0; + if (!(wait = mem_alloc( FIELD_OFFSET(struct thread_wait, queues[count]) ))) return 0; wait->next = current->wait; wait->thread = current; wait->count = count; wait->flags = flags; wait->user = NULL; + wait->timeout = timeout; current->wait = wait; - if (flags & SELECT_TIMEOUT) - { - wait->timeout.tv_sec = timeout->sec; - wait->timeout.tv_usec = timeout->usec; - } for (i = 0, entry = wait->queues; i < count; i++, entry++) { @@ -603,10 +599,7 @@ static int check_wait( struct thread *thread ) other_checks: if ((wait->flags & SELECT_INTERRUPTIBLE) && !list_empty(&thread->system_apc)) return STATUS_USER_APC; if ((wait->flags & SELECT_ALERTABLE) && !list_empty(&thread->user_apc)) return STATUS_USER_APC; - if (wait->flags & SELECT_TIMEOUT) - { - if (!time_before( ¤t_time, &wait->timeout )) return STATUS_TIMEOUT; - } + if (wait->timeout <= current_time) return STATUS_TIMEOUT; return -1; } @@ -685,16 +678,19 @@ static int signal_object( obj_handle_t handle ) } /* select on a list of handles */ -static void select_on( int count, void *cookie, const obj_handle_t *handles, - int flags, const abs_time_t *timeout, obj_handle_t signal_obj ) +static timeout_t select_on( unsigned int count, void *cookie, const obj_handle_t *handles, + int flags, timeout_t timeout, obj_handle_t signal_obj ) { - int ret, i; + int ret; + unsigned int i; struct object *objects[MAXIMUM_WAIT_OBJECTS]; - if ((count < 0) || (count > MAXIMUM_WAIT_OBJECTS)) + if (timeout <= 0) timeout = current_time - timeout; + + if (count > MAXIMUM_WAIT_OBJECTS) { set_error( STATUS_INVALID_PARAMETER ); - return; + return 0; } for (i = 0; i < count; i++) { @@ -726,9 +722,9 @@ static void select_on( int count, void *cookie, const obj_handle_t *handles, } /* now we need to wait */ - if (flags & SELECT_TIMEOUT) + if (current->wait->timeout != TIMEOUT_INFINITE) { - if (!(current->wait->user = add_timeout_user( ¤t->wait->timeout, + if (!(current->wait->user = add_timeout_user( current->wait->timeout, thread_timeout, current->wait ))) { end_wait( current ); @@ -739,7 +735,8 @@ static void select_on( int count, void *cookie, const obj_handle_t *handles, set_error( STATUS_PENDING ); done: - while (--i >= 0) release_object( objects[i] ); + while (i > 0) release_object( objects[--i] ); + return timeout; } /* attempt to wake threads sleeping on the object wait queue */ @@ -1101,8 +1098,7 @@ DECL_HANDLER(init_thread) reply->pid = get_process_id( process ); reply->tid = get_thread_id( current ); reply->version = SERVER_PROTOCOL_VERSION; - reply->server_start.sec = server_start_time.tv_sec; - reply->server_start.usec = server_start_time.tv_usec; + reply->server_start = server_start_time; return; error: @@ -1160,10 +1156,8 @@ DECL_HANDLER(get_thread_info) reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STATUS_PENDING; reply->priority = thread->priority; reply->affinity = thread->affinity; - reply->creation_time.sec = thread->creation_time.tv_sec; - reply->creation_time.usec = thread->creation_time.tv_usec; - reply->exit_time.sec = thread->exit_time.tv_sec; - reply->exit_time.usec = thread->exit_time.tv_usec; + reply->creation_time = thread->creation_time; + reply->exit_time = thread->exit_time; reply->last = thread->process->running_threads == 1; release_object( thread ); @@ -1211,8 +1205,8 @@ DECL_HANDLER(resume_thread) /* select on a handle list */ DECL_HANDLER(select) { - int count = get_req_data_size() / sizeof(obj_handle_t); - select_on( count, req->cookie, get_req_data(), req->flags, &req->timeout, req->signal ); + unsigned int count = get_req_data_size() / sizeof(obj_handle_t); + reply->timeout = select_on( count, req->cookie, get_req_data(), req->flags, req->timeout, req->signal ); } /* queue an APC for a thread or process */ diff --git a/server/thread.h b/server/thread.h index e09c11b4507..94a2c6ab2cb 100644 --- a/server/thread.h +++ b/server/thread.h @@ -84,8 +84,8 @@ struct thread int suspend; /* suspend count */ obj_handle_t desktop; /* desktop handle */ int desktop_users; /* number of objects using the thread desktop */ - struct timeval creation_time; /* Thread creation time */ - struct timeval exit_time; /* Thread exit time */ + timeout_t creation_time; /* Thread creation time */ + timeout_t exit_time; /* Thread exit time */ struct token *token; /* security token associated with this thread */ }; diff --git a/server/timer.c b/server/timer.c index dd53020b445..088a063b30b 100644 --- a/server/timer.c +++ b/server/timer.c @@ -42,8 +42,8 @@ struct timer struct object obj; /* object header */ int manual; /* manual reset */ int signaled; /* current signaled state */ - int period; /* timer period in ms */ - struct timeval when; /* next expiration */ + unsigned int period; /* timer period in ms */ + timeout_t when; /* next expiration */ struct timeout_user *timeout; /* timeout user */ struct thread *thread; /* thread that set the APC function */ void *callback; /* callback APC function */ @@ -85,13 +85,12 @@ static struct timer *create_timer( struct directory *root, const struct unicode_ if (get_error() != STATUS_OBJECT_NAME_EXISTS) { /* initialize it if it didn't already exist */ - timer->manual = manual; - timer->signaled = 0; - timer->when.tv_sec = 0; - timer->when.tv_usec = 0; - timer->period = 0; - timer->timeout = NULL; - timer->thread = NULL; + timer->manual = manual; + timer->signaled = 0; + timer->when = 0; + timer->period = 0; + timer->timeout = NULL; + timer->thread = NULL; } } return timer; @@ -110,11 +109,10 @@ static void timer_callback( void *private ) memset( &data, 0, sizeof(data) ); if (timer->callback) { - data.type = APC_TIMER; - data.timer.func = timer->callback; - data.timer.time.sec = timer->when.tv_sec; - data.timer.time.usec = timer->when.tv_usec; - data.timer.arg = timer->arg; + data.type = APC_TIMER; + data.timer.func = timer->callback; + data.timer.time = timer->when; + data.timer.arg = timer->arg; } else data.type = APC_NONE; /* wake up only */ @@ -127,8 +125,8 @@ static void timer_callback( void *private ) if (timer->period) /* schedule the next expiration */ { - add_timeout( &timer->when, timer->period ); - timer->timeout = add_timeout_user( &timer->when, timer_callback, timer ); + timer->when += (timeout_t)timer->period * 10000; + timer->timeout = add_timeout_user( timer->when, timer_callback, timer ); } else timer->timeout = NULL; @@ -157,7 +155,7 @@ static int cancel_timer( struct timer *timer ) } /* set the timer expiration and period */ -static int set_timer( struct timer *timer, const abs_time_t *expire, int period, +static int set_timer( struct timer *timer, timeout_t expire, unsigned int period, void *callback, void *arg ) { int signaled = cancel_timer( timer ); @@ -166,22 +164,12 @@ static int set_timer( struct timer *timer, const abs_time_t *expire, int period, period = 0; /* period doesn't make any sense for a manual timer */ timer->signaled = 0; } - if (!expire->sec && !expire->usec) - { - /* special case: use now + period as first expiration */ - timer->when = current_time; - add_timeout( &timer->when, period ); - } - else - { - timer->when.tv_sec = expire->sec; - timer->when.tv_usec = expire->usec; - } - timer->period = period; - timer->callback = callback; - timer->arg = arg; + + timer->period = period; + timer->callback = callback; + timer->arg = arg; if (callback) timer->thread = (struct thread *)grab_object( current ); - timer->timeout = add_timeout_user( &timer->when, timer_callback, timer ); + timer->timeout = add_timeout_user( timer->when, timer_callback, timer ); return signaled; } @@ -189,8 +177,8 @@ static void timer_dump( struct object *obj, int verbose ) { struct timer *timer = (struct timer *)obj; assert( obj->ops == &timer_ops ); - fprintf( stderr, "Timer manual=%d when=%ld.%06u period=%d ", - timer->manual, timer->when.tv_sec, (unsigned int)timer->when.tv_usec, timer->period ); + fprintf( stderr, "Timer manual=%d when=%s period=%u ", + timer->manual, get_timeout_str(timer->when), timer->period ); dump_object_name( &timer->obj ); fputc( '\n', stderr ); } @@ -277,7 +265,7 @@ DECL_HANDLER(set_timer) if ((timer = (struct timer *)get_handle_obj( current->process, req->handle, TIMER_MODIFY_STATE, &timer_ops ))) { - reply->signaled = set_timer( timer, &req->expire, req->period, req->callback, req->arg ); + reply->signaled = set_timer( timer, req->expire, req->period, req->callback, req->arg ); release_object( timer ); } } @@ -303,8 +291,7 @@ DECL_HANDLER(get_timer_info) if ((timer = (struct timer *)get_handle_obj( current->process, req->handle, TIMER_QUERY_STATE, &timer_ops ))) { - reply->when.sec = timer->when.tv_sec; - reply->when.usec = timer->when.tv_usec; + reply->when = timer->when; reply->signaled = timer->signaled; release_object( timer ); } diff --git a/server/trace.c b/server/trace.c index ab8bb062c3f..85abb152c05 100644 --- a/server/trace.c +++ b/server/trace.c @@ -36,6 +36,7 @@ #include "winbase.h" #include "wincon.h" #include "winternl.h" +#include "winioctl.h" #include "file.h" #include "request.h" #include "unicode.h" @@ -64,25 +65,9 @@ static void dump_uints( const int *ptr, int len ) fputc( '}', stderr ); } -static void dump_abs_time( const abs_time_t *time ) +static void dump_timeout( const timeout_t *time ) { - int secs, usecs; - - if (!time->sec && !time->usec) - { - fprintf( stderr, "0" ); - return; - } - secs = time->sec - current_time.tv_sec; - if ((usecs = time->usec - current_time.tv_usec) < 0) - { - usecs += 1000000; - secs--; - } - if (secs > 0 || (secs == 0 && usecs >= 0)) - fprintf( stderr, "%d.%06d (+%d.%06d)", time->sec, time->usec, secs, usecs ); - else - fprintf( stderr, "%d.%06d (-%d.%06d)", time->sec, time->usec, abs(secs+1), 1000000-usecs ); + fprintf( stderr, get_timeout_str(*time) ); } static void dump_rectangle( const rectangle_t *rect ) @@ -98,6 +83,20 @@ static void dump_char_info( const char_info_t *info ) fprintf( stderr, "',%04x}", info->attr ); } +static void dump_ioctl_code( const ioctl_code_t *code ) +{ + switch(*code) + { +#define CASE(c) case c: fputs( #c, stderr ); break + CASE(FSCTL_DISMOUNT_VOLUME); + CASE(FSCTL_PIPE_DISCONNECT); + CASE(FSCTL_PIPE_LISTEN); + CASE(FSCTL_PIPE_WAIT); + default: fprintf( stderr, "%08x", *code ); break; +#undef CASE + } +} + static void dump_apc_call( const apc_call_t *call ) { fputc( '{', stderr ); @@ -112,7 +111,7 @@ static void dump_apc_call( const apc_call_t *call ) break; case APC_TIMER: fprintf( stderr, "APC_TIMER,time=" ); - dump_abs_time( &call->timer.time ); + dump_timeout( &call->timer.time ); fprintf( stderr, ",arg=%p", call->timer.arg ); break; case APC_ASYNC_IO: @@ -862,7 +861,7 @@ static void dump_init_thread_reply( const struct init_thread_reply *req ) fprintf( stderr, " tid=%04x,", req->tid ); fprintf( stderr, " info_size=%u,", req->info_size ); fprintf( stderr, " server_start=" ); - dump_abs_time( &req->server_start ); + dump_timeout( &req->server_start ); fprintf( stderr, "," ); fprintf( stderr, " version=%d", req->version ); } @@ -904,10 +903,10 @@ static void dump_get_process_info_reply( const struct get_process_info_reply *re fprintf( stderr, " affinity=%d,", req->affinity ); fprintf( stderr, " peb=%p,", req->peb ); fprintf( stderr, " start_time=" ); - dump_abs_time( &req->start_time ); + dump_timeout( &req->start_time ); fprintf( stderr, "," ); fprintf( stderr, " end_time=" ); - dump_abs_time( &req->end_time ); + dump_timeout( &req->end_time ); } static void dump_set_process_info_request( const struct set_process_info_request *req ) @@ -933,10 +932,10 @@ static void dump_get_thread_info_reply( const struct get_thread_info_reply *req fprintf( stderr, " priority=%d,", req->priority ); fprintf( stderr, " affinity=%d,", req->affinity ); fprintf( stderr, " creation_time=" ); - dump_abs_time( &req->creation_time ); + dump_timeout( &req->creation_time ); fprintf( stderr, "," ); fprintf( stderr, " exit_time=" ); - dump_abs_time( &req->exit_time ); + dump_timeout( &req->exit_time ); fprintf( stderr, "," ); fprintf( stderr, " last=%d", req->last ); } @@ -1105,12 +1104,18 @@ static void dump_select_request( const struct select_request *req ) fprintf( stderr, " cookie=%p,", req->cookie ); fprintf( stderr, " signal=%p,", req->signal ); fprintf( stderr, " timeout=" ); - dump_abs_time( &req->timeout ); + dump_timeout( &req->timeout ); fprintf( stderr, "," ); fprintf( stderr, " handles=" ); dump_varargs_handles( cur_size ); } +static void dump_select_reply( const struct select_reply *req ) +{ + fprintf( stderr, " timeout=" ); + dump_timeout( &req->timeout ); +} + static void dump_create_event_request( const struct create_event_request *req ) { fprintf( stderr, " access=%08x,", req->access ); @@ -2056,7 +2061,7 @@ static void dump_set_timer_request( const struct set_timer_request *req ) { fprintf( stderr, " handle=%p,", req->handle ); fprintf( stderr, " expire=" ); - dump_abs_time( &req->expire ); + dump_timeout( &req->expire ); fprintf( stderr, "," ); fprintf( stderr, " period=%d,", req->period ); fprintf( stderr, " callback=%p,", req->callback ); @@ -2086,7 +2091,7 @@ static void dump_get_timer_info_request( const struct get_timer_info_request *re static void dump_get_timer_info_reply( const struct get_timer_info_reply *req ) { fprintf( stderr, " when=" ); - dump_abs_time( &req->when ); + dump_timeout( &req->when ); fprintf( stderr, "," ); fprintf( stderr, " signaled=%d", req->signaled ); } @@ -2257,7 +2262,9 @@ static void dump_send_message_request( const struct send_message_request *req ) fprintf( stderr, " msg=%08x,", req->msg ); fprintf( stderr, " wparam=%lx,", req->wparam ); fprintf( stderr, " lparam=%lx,", req->lparam ); - fprintf( stderr, " timeout=%d,", req->timeout ); + fprintf( stderr, " timeout=" ); + dump_timeout( &req->timeout ); + fprintf( stderr, "," ); fprintf( stderr, " data=" ); dump_varargs_message_data( cur_size ); } @@ -2399,7 +2406,9 @@ static void dump_cancel_async_request( const struct cancel_async_request *req ) static void dump_ioctl_request( const struct ioctl_request *req ) { fprintf( stderr, " handle=%p,", req->handle ); - fprintf( stderr, " code=%08x,", req->code ); + fprintf( stderr, " code=" ); + dump_ioctl_code( &req->code ); + fprintf( stderr, "," ); fprintf( stderr, " async=" ); dump_async_data( &req->async ); fprintf( stderr, "," ); @@ -2423,7 +2432,9 @@ static void dump_create_named_pipe_request( const struct create_named_pipe_reque fprintf( stderr, " maxinstances=%08x,", req->maxinstances ); fprintf( stderr, " outsize=%08x,", req->outsize ); fprintf( stderr, " insize=%08x,", req->insize ); - fprintf( stderr, " timeout=%08x,", req->timeout ); + fprintf( stderr, " timeout=" ); + dump_timeout( &req->timeout ); + fprintf( stderr, "," ); fprintf( stderr, " name=" ); dump_varargs_unicode_str( cur_size ); } @@ -2433,24 +2444,6 @@ static void dump_create_named_pipe_reply( const struct create_named_pipe_reply * fprintf( stderr, " handle=%p", req->handle ); } -static void dump_connect_named_pipe_request( const struct connect_named_pipe_request *req ) -{ - fprintf( stderr, " handle=%p,", req->handle ); - fprintf( stderr, " async=" ); - dump_async_data( &req->async ); -} - -static void dump_wait_named_pipe_request( const struct wait_named_pipe_request *req ) -{ - fprintf( stderr, " handle=%p,", req->handle ); - fprintf( stderr, " async=" ); - dump_async_data( &req->async ); - fprintf( stderr, "," ); - fprintf( stderr, " timeout=%08x,", req->timeout ); - fprintf( stderr, " name=" ); - dump_varargs_unicode_str( cur_size ); -} - static void dump_get_named_pipe_info_request( const struct get_named_pipe_info_request *req ) { fprintf( stderr, " handle=%p", req->handle ); @@ -3399,7 +3392,9 @@ static void dump_create_mailslot_request( const struct create_mailslot_request * fprintf( stderr, " attributes=%08x,", req->attributes ); fprintf( stderr, " rootdir=%p,", req->rootdir ); fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize ); - fprintf( stderr, " read_timeout=%d,", req->read_timeout ); + fprintf( stderr, " read_timeout=" ); + dump_timeout( &req->read_timeout ); + fprintf( stderr, "," ); fprintf( stderr, " name=" ); dump_varargs_unicode_str( cur_size ); } @@ -3413,13 +3408,15 @@ static void dump_set_mailslot_info_request( const struct set_mailslot_info_reque { fprintf( stderr, " handle=%p,", req->handle ); fprintf( stderr, " flags=%08x,", req->flags ); - fprintf( stderr, " read_timeout=%d", req->read_timeout ); + fprintf( stderr, " read_timeout=" ); + dump_timeout( &req->read_timeout ); } static void dump_set_mailslot_info_reply( const struct set_mailslot_info_reply *req ) { fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize ); - fprintf( stderr, " read_timeout=%d", req->read_timeout ); + fprintf( stderr, " read_timeout=" ); + dump_timeout( &req->read_timeout ); } static void dump_create_directory_request( const struct create_directory_request *req ) @@ -3661,8 +3658,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_cancel_async_request, (dump_func)dump_ioctl_request, (dump_func)dump_create_named_pipe_request, - (dump_func)dump_connect_named_pipe_request, - (dump_func)dump_wait_named_pipe_request, (dump_func)dump_get_named_pipe_info_request, (dump_func)dump_create_cursor_request, (dump_func)dump_destroy_cursor_request, @@ -3774,7 +3769,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_dup_handle_reply, (dump_func)dump_open_process_reply, (dump_func)dump_open_thread_reply, - (dump_func)0, + (dump_func)dump_select_reply, (dump_func)dump_create_event_reply, (dump_func)0, (dump_func)dump_open_event_reply, @@ -3885,8 +3880,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)0, (dump_func)dump_ioctl_reply, (dump_func)dump_create_named_pipe_reply, - (dump_func)0, - (dump_func)0, (dump_func)dump_get_named_pipe_info_reply, (dump_func)dump_create_cursor_reply, (dump_func)0, @@ -4109,8 +4102,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "cancel_async", "ioctl", "create_named_pipe", - "connect_named_pipe", - "wait_named_pipe", "get_named_pipe_info", "create_cursor", "destroy_cursor", diff --git a/server/winstation.c b/server/winstation.c index 14abb3c9061..64ae7183809 100644 --- a/server/winstation.c +++ b/server/winstation.c @@ -363,10 +363,8 @@ void close_process_desktop( struct process *process ) /* if we have one remaining user, it has to be the manager of the desktop window */ if (desktop->users == 1 && get_top_window_owner( desktop )) { - struct timeval when = current_time; - add_timeout( &when, 1000 ); assert( !desktop->close_timeout ); - desktop->close_timeout = add_timeout_user( &when, close_desktop_timeout, desktop ); + desktop->close_timeout = add_timeout_user( -TICKS_PER_SEC, close_desktop_timeout, desktop ); } release_object( desktop ); } diff --git a/tools/make_requests b/tools/make_requests index d5364d920a1..e735de6d50e 100755 --- a/tools/make_requests +++ b/tools/make_requests @@ -39,13 +39,14 @@ my %formats = "user_handle_t" => "%p", "process_id_t" => "%04x", "thread_id_t" => "%04x", - "abs_time_t" => "&dump_abs_time", + "timeout_t" => "&dump_timeout", "rectangle_t" => "&dump_rectangle", "char_info_t" => "&dump_char_info", "apc_call_t" => "&dump_apc_call", "apc_result_t" => "&dump_apc_result", "async_data_t" => "&dump_async_data", "luid_t" => "&dump_luid", + "ioctl_code_t" => "&dump_ioctl_code", ); my @requests = (); -- 2.11.4.GIT