adding win32ksys the syscall lib for win32k
authorMagnus Olsen <magnus@greatlord.com>
Tue, 31 Jul 2007 21:38:52 +0000 (21:38 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Tue, 31 Jul 2007 21:38:52 +0000 (21:38 +0000)
waring
type make clean,
delete makefile.auto
make clean does not delete the gdi32/misc/i386 delete that folder and need delete it u self
make clean does not delete the user32/misc/i386 delete that folder and need delete it u self

svn path=/trunk/; revision=28057

reactos/dll/win32/gdi32/gdi32.rbuild
reactos/dll/win32/user32/user32.rbuild
reactos/lib/lib.rbuild
reactos/lib/win32ksys/win32ksys.rbuild [new file with mode: 0644]
reactos/subsystems/win32/csrss/win32csr/guiconsole.c
reactos/tools/nci/nci.mak

index fcabe1a..643f4ea 100644 (file)
@@ -9,6 +9,8 @@
        <library>ntdll</library>
        <library>kernel32</library>
        <library>advapi32</library>
+       <library>win32ksys</library>
+
        <directory name="include">
                <pch>precomp.h</pch>
        </directory>
                <file>stubs.c</file>
                <file>stubsa.c</file>
                <file>stubsw.c</file>
-               <file>wingl.c</file>
-               <if property="ARCH" value="i386">
-                       <directory name="i386">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
-               <if property="ARCH" value="powerpc">
-                       <directory name="powerpc">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
-               <if property="ARCH" value="mips">
-                       <directory name="mips">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
+               <file>wingl.c</file>            
        </directory>
        <directory name="objects">
                <file>bitmap.c</file>
index fd14611..4f0727f 100644 (file)
@@ -15,6 +15,8 @@
        <library>kernel32</library>
        <library>advapi32</library>
        <library>imm32</library>
+       <library>win32ksys</library>
+
        <directory name="include">
                <pch>user32.h</pch>
        </directory>
                <file>winhelp.c</file>
                <file>winsta.c</file>
                <file>wsprintf.c</file>
-               <if property="ARCH" value="i386">
-                       <directory name="i386">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
-               <if property="ARCH" value="powerpc">
-                       <directory name="powerpc">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
-               <if property="ARCH" value="mips">
-                       <directory name="mips">
-                               <file>win32k.S</file>
-                       </directory>
-               </if>
        </directory>
        <directory name="windows">
                <file>accel.c</file>
index 753624e..67f4bef 100644 (file)
@@ -40,5 +40,9 @@
     <directory name="smlib">
         <xi:include href="smlib/smlib.rbuild" />
     </directory>
+    <directory name="win32ksys">
+        <xi:include href="win32ksys/win32ksys.rbuild" />
+    </directory>
+
 </group>
 
diff --git a/reactos/lib/win32ksys/win32ksys.rbuild b/reactos/lib/win32ksys/win32ksys.rbuild
new file mode 100644 (file)
index 0000000..6d51489
--- /dev/null
@@ -0,0 +1,22 @@
+<module name="win32ksys" type="staticlibrary">
+       <define name="_DISABLE_TIDENTS" />
+       <define name="__REACTOS__" />
+       <define name="__USE_W32API" />
+
+               <if property="ARCH" value="i386">
+                       <directory name="i386">
+                               <file>win32k.S</file>
+                       </directory>
+               </if>
+               <if property="ARCH" value="powerpc">
+                       <directory name="powerpc">
+                               <file>win32k.S</file>
+                       </directory>
+               </if>
+               <if property="ARCH" value="mips">
+                       <directory name="mips">
+                               <file>win32k.S</file>
+                       </directory>
+               </if>
+
+</module>
index bc7ec14..6bf3f8e 100644 (file)
@@ -139,8 +139,8 @@ GuiConsoleAppendMenuItems(HMENU hMenu,
                     hSubMenu = CreatePopupMenu();
                     if (hSubMenu != NULL)
                     {
-                        GuiConsoleAppendMenuItems(hSubMenu,
-                                                  Items[i].SubMenu);
+                        /*GuiConsoleAppendMenuItems(hSubMenu,
+                                                  Items[i].SubMenu);*/
 
                         if (!AppendMenuW(hMenu,
                                          MF_STRING | MF_POPUP,
@@ -148,6 +148,7 @@ GuiConsoleAppendMenuItems(HMENU hMenu,
                                          szMenuString))
                         {
                             DestroyMenu(hSubMenu);
+                            DPRINT1("DestroyMenu \n");
                         }
                     }
                 }
@@ -179,9 +180,14 @@ GuiConsoleCreateSysMenu(PCSRSS_CONSOLE Console)
                           FALSE);
     if (hMenu != NULL)
     {
+        DPRINT1("adding menu\n");
         GuiConsoleAppendMenuItems(hMenu,
                                   GuiConsoleMainMenuItems);
     }
+    else
+    {
+      DPRINT1("This should never happen, GetSystemMenu == NULL \n");
+    }
 }
 
 static VOID FASTCALL
@@ -236,10 +242,12 @@ GuiConsoleOpenUserRegistryPathPerProcessId(DWORD ProcessId, PHANDLE hProcHandle,
   RtlFreeUnicodeString(&SidName);
 
   CloseHandle(hProcessToken);
-  if (hProcHandle)
-    *hProcHandle = hProcess;
-  else
-    CloseHandle(hProcess);
+  CloseHandle(hProcess);
+
+  //if (hProcHandle)
+  //  *hProcHandle = hProcess;
+  //else
+  //  CloseHandle(hProcess);
 
   if (res != ERROR_SUCCESS)
     return FALSE;
@@ -276,21 +284,26 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu
   
   DPRINT("GuiConsoleOpenUserSettings entered\n");
 
+  DPRINT1("ProcessId %d\n",ProcessId);
+
   if (!GuiConsoleOpenUserRegistryPathPerProcessId(ProcessId, &hProcess, &hKey, samDesired))
     {
-      DPRINT("GuiConsoleOpenUserRegistryPathPerProcessId failed\n"); 
+      DPRINT1("GuiConsoleOpenUserRegistryPathPerProcessId failed\n"); 
       return FALSE;
     }
+  
+  hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, ProcessId );
+
 
   /* FIXME we do not getting the process name so no menu will be loading, why ?*/
   fLength = GetProcessImageFileNameW(hProcess, szProcessName, sizeof(GuiData->szProcessName) / sizeof(WCHAR));
   CloseHandle(hProcess);
 
-  //DPRINT1("szProcessName3 : %S\n",szProcessName);
+  DPRINT1("szProcessName3 : %S\n",szProcessName);
 
   if (!fLength)
     {
-      DPRINT("GetProcessImageFileNameW failed(0x%x)ProcessId %d\n", GetLastError(),hProcess);
+      DPRINT1("GetProcessImageFileNameW failed(0x%x)ProcessId %d\n", GetLastError(),hProcess);
       return FALSE;
     }
   /*
@@ -658,6 +671,8 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create)
   if (Console->ProcessList.Flink != &Console->ProcessList)
     {
       ProcessData = CONTAINING_RECORD(Console->ProcessList.Flink, CSRSS_PROCESS_DATA, ProcessEntry);
+      DPRINT1("PtrToUlong(ProcessData->ProcessId) == %d",PtrToUlong(ProcessData->ProcessId));
+
       if (GuiConsoleOpenUserSettings(GuiData, PtrToUlong(ProcessData->ProcessId), &hKey, KEY_READ, FALSE))
         {
           GuiConsoleReadUserSettings(hKey, Console, GuiData, Console->ActiveBuffer);
@@ -1263,13 +1278,20 @@ GuiConsoleHandleNcDestroy(HWND hWnd)
 {
   PCSRSS_CONSOLE Console;
   PGUI_CONSOLE_DATA GuiData;
+  HMENU menu;
 
 
   GuiConsoleGetDataPointers(hWnd, &Console, &GuiData);
   KillTimer(hWnd, 1);
   Console->PrivateData = NULL;
   DeleteCriticalSection(&GuiData->Lock);
-  GetSystemMenu(hWnd, TRUE);
+
+  menu = GetSystemMenu(hWnd, TRUE);
+  if (menu == NULL)
+  {
+      DPRINT1("This should never happen, GetSystemMenu == NULL \n");
+  }
+
   if (GuiData->ConsoleLibrary)
     FreeLibrary(GuiData->ConsoleLibrary);
 
index 11b1e5c..80413e3 100644 (file)
@@ -44,8 +44,9 @@ clean: nci_clean
 # WIN32K.SYS
 WIN32K_SVC_DB = subsystems$(SEP)win32$(SEP)win32k$(SEP)w32ksvc.db
 WIN32K_SERVICE_TABLE = subsystems$(SEP)win32$(SEP)win32k$(SEP)include$(SEP)napi.h
-WIN32K_GDI_STUBS = dll$(SEP)win32$(SEP)gdi32$(SEP)misc$(SEP)$(ARCH)$(SEP)win32k.S
-WIN32K_USER_STUBS = dll$(SEP)win32$(SEP)user32$(SEP)misc$(SEP)$(ARCH)$(SEP)win32k.S
+WIN32K_GDI_STUBS = lib$(SEP)win32ksys$(SEP)$(ARCH)$(SEP)win32k.S
+WIN32K_USER_STUBS = lib$(SEP)win32ksys$(SEP)$(ARCH)$(SEP)win32k.S
+
 
 
 # NTOSKRNL.EXE
@@ -69,6 +70,7 @@ $(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB)
        ${mkdir} dll$(SEP)win32$(SEP)gdi32$(SEP)misc$(SEP)$(ARCH) 2>$(NUL)
        ${mkdir} dll$(SEP)win32$(SEP)user32$(SEP)misc$(SEP)$(ARCH) 2>$(NUL)
        ${mkdir} lib$(SEP)win32ksys$(SEP)$(ARCH) 2>$(NUL)
+
        $(Q)$(NCI_TARGET) -arch $(ARCH) \
                $(KERNEL_SVC_DB) \
                $(WIN32K_SVC_DB) \