Commit in reactos on MAIN
include/ntos/zw.h+20-201.32 -> 1.33
ntoskrnl/nt/profile.c+28-281.17 -> 1.18
+48-48
2 modified files
fixed prototypes of NtCreateProfile() and NtQueryIntervalProfile()

reactos/include/ntos
zw.h 1.32 -> 1.33
diff -u -r1.32 -r1.33
--- zw.h	24 Oct 2004 16:49:48 -0000	1.32
+++ zw.h	24 Oct 2004 17:14:26 -0000	1.33
@@ -1,5 +1,5 @@
 
-/* $Id: zw.h,v 1.32 2004/10/24 16:49:48 weiden Exp $
+/* $Id: zw.h,v 1.33 2004/10/24 17:14:26 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -5193,14 +5193,14 @@
 NTSTATUS 
 STDCALL
 NtCreateProfile(OUT PHANDLE ProfileHandle, 
-		IN HANDLE ProcessHandle,
+		IN HANDLE Process  OPTIONAL,
 		IN PVOID ImageBase, 
 		IN ULONG ImageSize, 
-		IN ULONG Granularity,
-		OUT PULONG Buffer, 
-		IN ULONG ProfilingSize,
-		IN KPROFILE_SOURCE Source,
-		IN ULONG ProcessorMask);
+		IN ULONG BucketSize,
+		IN PVOID Buffer,
+		IN ULONG BufferSize,
+		IN KPROFILE_SOURCE ProfileSource,
+		IN KAFFINITY Affinity);
 
 /*
  * FUNCTION: Creates a user mode thread
@@ -5423,8 +5423,8 @@
 NTSTATUS
 STDCALL
 NtQueryIntervalProfile(
-	OUT PULONG Interval,
-	OUT KPROFILE_SOURCE ClockSource
+	IN  KPROFILE_SOURCE ProfileSource,
+	OUT PULONG Interval
 	);
 
 /*
@@ -6124,8 +6124,8 @@
 NTSTATUS
 STDCALL
 ZwQueryIntervalProfile(
-	OUT PULONG Interval,
-	OUT KPROFILE_SOURCE ClockSource
+	IN  KPROFILE_SOURCE ProfileSource,
+	OUT PULONG Interval
 	);
 
 /*
@@ -6410,15 +6410,15 @@
 NTSTATUS 
 STDCALL
 ZwCreateProfile(
-	OUT PHANDLE ProfileHandle, 
-	IN POBJECT_ATTRIBUTES ObjectAttributes,
-	IN ULONG ImageBase, 
-	IN ULONG ImageSize, 
-	IN ULONG Granularity,
-	OUT PVOID Buffer, 
-	IN ULONG ProfilingSize,
-	IN ULONG ClockSource,
-	IN ULONG ProcessorMask
+	OUT PHANDLE ProfileHandle,
+	IN HANDLE Process  OPTIONAL,
+	IN PVOID ImageBase,
+	IN ULONG ImageSize,
+	IN ULONG BucketSize,
+	IN PVOID Buffer,
+	IN ULONG BufferSize,
+	IN KPROFILE_SOURCE ProfileSource,
+	IN KAFFINITY Affinity
 	);
 
 /*

reactos/ntoskrnl/nt
profile.c 1.17 -> 1.18
diff -u -r1.17 -r1.18
--- profile.c	15 Aug 2004 16:39:09 -0000	1.17
+++ profile.c	24 Oct 2004 17:14:27 -0000	1.18
@@ -392,31 +392,31 @@
 }
 
 NTSTATUS STDCALL 
-NtCreateProfile(OUT PHANDLE UnsafeProfileHandle, 
-		IN HANDLE ProcessHandle,
+NtCreateProfile(OUT PHANDLE ProfileHandle,
+		IN HANDLE Process  OPTIONAL,
 		IN PVOID ImageBase, 
 		IN ULONG ImageSize, 
-		IN ULONG Granularity,
-		OUT PULONG Buffer, 
+		IN ULONG BucketSize,
+		IN PVOID Buffer,
 		IN ULONG BufferSize,
-		IN KPROFILE_SOURCE Source,
-		IN ULONG ProcessorMask)
+		IN KPROFILE_SOURCE ProfileSource,
+		IN KAFFINITY Affinity)
 {
-  HANDLE ProfileHandle;
+  HANDLE SafeProfileHandle;
   NTSTATUS Status;
   PKPROFILE Profile;
-  PEPROCESS Process;
+  PEPROCESS pProcess;
 
   /*
    * Reference the associated process
    */
-  if (ProcessHandle != NULL)
+  if (Process != NULL)
     {
-      Status = ObReferenceObjectByHandle(ProcessHandle,
+      Status = ObReferenceObjectByHandle(Process,
 					 PROCESS_QUERY_INFORMATION,
 					 PsProcessType,
 					 UserMode,
-					 (PVOID*)&Process,
+					 (PVOID*)&pProcess,
 					 NULL);
       if (!NT_SUCCESS(Status))
 	{
@@ -425,27 +425,27 @@
     }
   else
     {
-      Process = NULL;
+      pProcess = NULL;
       /* FIXME: Check privilege. */
     }
 
   /*
    * Check the parameters
    */
-  if ((Process == NULL && ImageBase < (PVOID)KERNEL_BASE) ||
-      (Process != NULL && ImageBase >= (PVOID)KERNEL_BASE))
+  if ((pProcess == NULL && ImageBase < (PVOID)KERNEL_BASE) ||
+      (pProcess != NULL && ImageBase >= (PVOID)KERNEL_BASE))
     {
       return(STATUS_INVALID_PARAMETER_3);
     }
-  if (((ImageSize >> Granularity) * 4) >= BufferSize)
+  if (((ImageSize >> BucketSize) * 4) >= BufferSize)
     {
       return(STATUS_BUFFER_TOO_SMALL);
     }
-  if (Source != ProfileTime)
+  if (ProfileSource != ProfileTime)
     {
       return(STATUS_INVALID_PARAMETER_9);
     }
-  if (ProcessorMask != 0)
+  if (Affinity != 0)
     {
       return(STATUS_INVALID_PARAMETER_10);
     }
@@ -472,7 +472,7 @@
    */
   Profile->Base = ImageBase;
   Profile->Size = ImageSize;
-  Profile->BucketShift = Granularity;
+  Profile->BucketShift = BucketSize;
   Profile->BufferMdl = MmCreateMdl(NULL, Buffer, BufferSize);
   if(Profile->BufferMdl == NULL) {
 	DPRINT("MmCreateMdl: Out of memory!");
@@ -481,9 +481,9 @@
   MmProbeAndLockPages(Profile->BufferMdl, UserMode, IoWriteAccess);
   Profile->Buffer = MmGetSystemAddressForMdl(Profile->BufferMdl);
   Profile->BufferSize = BufferSize;
-  Profile->ProcessorMask = ProcessorMask;
+  Profile->ProcessorMask = Affinity;
   Profile->Started = FALSE;
-  Profile->Process = Process;
+  Profile->Process = pProcess;
 
   /*
    * Insert the profile into the profile list data structures
@@ -495,7 +495,7 @@
 			   STANDARD_RIGHTS_ALL,
 			   0,
 			   NULL,
-			   &ProfileHandle);
+			   &SafeProfileHandle);
   if (!NT_SUCCESS(Status))
     {
       ObDereferenceObject (Profile);
@@ -505,7 +505,7 @@
   /*
    * Copy the created handle back to the caller
    */
-  Status = MmCopyToCaller(UnsafeProfileHandle, &ProfileHandle, sizeof(HANDLE));
+  Status = MmCopyToCaller(ProfileHandle, &SafeProfileHandle, sizeof(HANDLE));
   if (!NT_SUCCESS(Status))
      {
        ObDereferenceObject(Profile);
@@ -519,18 +519,18 @@
 }
 
 NTSTATUS STDCALL 
-NtQueryIntervalProfile(OUT PULONG UnsafeInterval,
-		       OUT KPROFILE_SOURCE Source)
+NtQueryIntervalProfile(IN  KPROFILE_SOURCE ProfileSource,
+		       OUT PULONG Interval)
 {
   NTSTATUS Status;
 
-  if (Source == ProfileTime)
+  if (ProfileSource == ProfileTime)
     {
-      ULONG Interval;
+      ULONG SafeInterval;
 
       /* FIXME: What units does this use, for now nanoseconds */
-      Interval = 100;
-      Status = MmCopyToCaller(UnsafeInterval, &Interval, sizeof(ULONG));
+      SafeInterval = 100;
+      Status = MmCopyToCaller(Interval, &SafeInterval, sizeof(ULONG));
       if (!NT_SUCCESS(Status))
 	{
 	  return(Status);
CVSspam 0.2.8