[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:01:24 UTC 2012
The following commit has been merged in the wheezy branch:
commit e5916d556337bb242e86999ba93b478bcf7d8932
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Mar 12 10:33:32 2012 +0100
kernel32: Implement the memory resource notification functions.
(cherry picked from commit aeaf18077e42b23ff96cbd1192cb47948c767708)
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index acbfab0..08ea8cc 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -2179,21 +2179,63 @@ BOOL WINAPI BindIoCompletionCallback( HANDLE FileHandle, LPOVERLAPPED_COMPLETION
/***********************************************************************
* CreateMemoryResourceNotification (KERNEL32.@)
*/
-HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE nt)
-{
- FIXME("(%d) stub\n", nt);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return NULL;
+HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE type)
+{
+ static const WCHAR lowmemW[] =
+ {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
+ '\\','L','o','w','M','e','m','o','r','y','C','o','n','d','i','t','i','o','n',0};
+ static const WCHAR highmemW[] =
+ {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s',
+ '\\','H','i','g','h','M','e','m','o','r','y','C','o','n','d','i','t','i','o','n',0};
+ HANDLE ret;
+ UNICODE_STRING nameW;
+ OBJECT_ATTRIBUTES attr;
+ NTSTATUS status;
+
+ switch (type)
+ {
+ case LowMemoryResourceNotification:
+ RtlInitUnicodeString( &nameW, lowmemW );
+ break;
+ case HighMemoryResourceNotification:
+ RtlInitUnicodeString( &nameW, highmemW );
+ break;
+ default:
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return 0;
+ }
+
+ attr.Length = sizeof(attr);
+ attr.RootDirectory = 0;
+ attr.ObjectName = &nameW;
+ attr.Attributes = 0;
+ attr.SecurityDescriptor = NULL;
+ attr.SecurityQualityOfService = NULL;
+ status = NtOpenEvent( &ret, EVENT_ALL_ACCESS, &attr );
+ if (status != STATUS_SUCCESS)
+ {
+ SetLastError( RtlNtStatusToDosError(status) );
+ return 0;
+ }
+ return ret;
}
/***********************************************************************
* QueryMemoryResourceNotification (KERNEL32.@)
*/
-BOOL WINAPI QueryMemoryResourceNotification(HANDLE rnh, PBOOL rs)
+BOOL WINAPI QueryMemoryResourceNotification(HANDLE handle, PBOOL state)
{
- FIXME("(%p, %p) stub\n", rnh, rs);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
+ switch (WaitForSingleObject( handle, 0 ))
+ {
+ case WAIT_OBJECT_0:
+ *state = TRUE;
+ return TRUE;
+ case WAIT_TIMEOUT:
+ *state = FALSE;
+ return TRUE;
+ }
+ SetLastError( ERROR_INVALID_PARAMETER );
+ return FALSE;
}
#ifdef __i386__
diff --git a/include/winbase.h b/include/winbase.h
index 6ec9230..492c63b 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2021,6 +2021,7 @@ WINBASEAPI BOOL WINAPI QueryFullProcessImageNameA(HANDLE,DWORD,LPSTR,PDWO
WINBASEAPI BOOL WINAPI QueryFullProcessImageNameW(HANDLE,DWORD,LPWSTR,PDWORD);
#define QueryFullProcessImageName WINELIB_NAME_AW(QueryFullProcessImageName)
WINBASEAPI BOOL WINAPI QueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,LPVOID,DWORD,DWORD*);
+WINBASEAPI BOOL WINAPI QueryMemoryResourceNotification(HANDLE,PBOOL);
WINBASEAPI BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER*);
WINBASEAPI BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER*);
WINBASEAPI DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list