Hi,
I want to change UnmapViewOfFile() (in kernel) to take a LPCVOID, as per
the SDK. To do that, I first need to constify one of the parameters of
NtUnmapViewOfSection() (in ntdll), but changing it from PVOID to PCVOID in
winternl.h breaks compilation (in the "make depend" stage), thus:
In file included from ../../include/thread.h:29,
from relay.c:30:
../../include/winternl.h:1933: error: expected declaration specifiers or ... before PCVOID
make[2]: *** [relay.o] Error 1
make[1]: *** [winebuild] Error 2
make: *** [tools] Error 2
What am I doing wrong, please? The patch I want to submit is as follows:
Changelog:
ntdll: Constify a formal parameter.
diff -urN a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
--- a/dlls/ntdll/virtual.c 2006-07-31 17:30:58.000000000 +0100
+++ b/dlls/ntdll/virtual.c 2006-09-06 15:04:25.000000000 +0100
@@ -1925,7 +1925,7 @@
* NtUnmapViewOfSection (NTDLL.@)
* ZwUnmapViewOfSection (NTDLL.@)
*/
-NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
+NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PCVOID addr )
{
FILE_VIEW *view;
NTSTATUS status = STATUS_INVALID_PARAMETER;
diff -urN a/include/winternl.h b/include/winternl.h
--- a/include/winternl.h 2006-08-04 17:17:26.000000000 +0100
+++ b/include/winternl.h 2006-09-06 14:57:29.000000000 +0100
@@ -1930,7 +1930,7 @@
NTSTATUS WINAPI NtUnloadKeyEx(POBJECT_ATTRIBUTES,HANDLE);
NTSTATUS WINAPI NtUnlockFile(HANDLE,PIO_STATUS_BLOCK,PLARGE_INTEGER,PLARGE_INTEGER,PULONG);
NTSTATUS WINAPI NtUnlockVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG);
-NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PVOID);
+NTSTATUS WINAPI NtUnmapViewOfSection(HANDLE,PCVOID);
NTSTATUS WINAPI NtVdmControl(ULONG,PVOID);
NTSTATUS WINAPI NtWaitForSingleObject(HANDLE,BOOLEAN,const LARGE_INTEGER*);
NTSTATUS WINAPI NtWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
Thanks,
-- Andy.