sync rosapps to r44454
authorSamuel Serapion <samuel.serapion@gmail.com>
Mon, 7 Dec 2009 18:24:19 +0000 (18:24 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Mon, 7 Dec 2009 18:24:19 +0000 (18:24 +0000)
svn path=/branches/ros-amd64-bringup/; revision=44455

1  2 
rosapps/applications/cmdutils/comp/comp.rbuild
rosapps/applications/devutils/gdihv/proclist.c
rosapps/applications/net/tditest/tditest/tditest.c
rosapps/applications/sysutils/man/man.c
rosapps/applications/sysutils/systeminfo/systeminfo.c
rosapps/applications/sysutils/utils/ps/ps.rbuild
rosapps/applications/sysutils/utils/rosperf/rosperf.rbuild
rosapps/applications/winfile/winefile.c

@@@ -1,6 -1,4 +1,4 @@@
  <module name="comp" type="win32cui" installbase="system32" installname="comp.exe" allowwarnings="true">\r
-     <library>kernel32</library>\r
 -      <file>comp.c</file>\r
 -      <file>comp.rc</file>\r
 +    <file>comp.c</file>\r
 +    <file>comp.rc</file>\r
  </module>\r
\r
@@@ -70,9 -70,18 +70,18 @@@ ProcessList_Update(HWND hListCtrl
        item.pszText = L"<deleted>";\r
        (void)ListView_InsertItem(hListCtrl, &item);\r
        item.pszText = strText;\r
 -      wsprintf(strText, L"%#08x", 1);\r
 +      wsprintf(strText, L"%#08x",1);\r
        ListView_SetItemText(hListCtrl, 1, 1, strText);\r
  \r
+       /* Insert "all" */\r
+       item.iItem = 2;\r
+       item.lParam = 2;\r
+       item.pszText = L"<all>";\r
+       (void)ListView_InsertItem(hListCtrl, &item);\r
+       item.pszText = strText;\r
+       wsprintf(strText, L"%#08x", 2);\r
+       ListView_SetItemText(hListCtrl, 1, 1, strText);\r
\r
        if (!EnumProcesses(ProcessIds, sizeof(ProcessIds), &BytesReturned ))\r
        {\r
                return;\r
@@@ -544,22 -545,18 +545,18 @@@ NTSTATUS TdiSendDatagram
                        return STATUS_INSUFFICIENT_RESOURCES;
                }
  
- #ifdef _MSC_VER
-       try
+       _SEH2_TRY
 -      {
 -              MmProbeAndLockPages(Mdl, KernelMode, IoModifyAccess);
 -      }
 +              {
- #endif
 +                      MmProbeAndLockPages(Mdl, KernelMode, IoModifyAccess);
- #ifdef _MSC_VER
 +              }
-       except(EXCEPTION_EXECUTE_HANDLER)
+       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
 -      {
 -              TDI_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
 -              IoFreeMdl(Mdl);
 -              IoFreeIrp(Irp);
 -              ExFreePool(ConnectInfo);
 -              return STATUS_UNSUCCESSFUL;
 +              {
 +                      TDI_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
 +                      IoFreeMdl(Mdl);
 +                      IoFreeIrp(Irp);
 +                      ExFreePool(ConnectInfo);
 +                      return STATUS_UNSUCCESSFUL;
-               }
- #endif
+       } _SEH2_END;
  
        TdiBuildSendDatagram(
                Irp,               /* I/O Request Packet */
@@@ -675,23 -672,19 +672,19 @@@ NTSTATUS TdiReceiveDatagram
                        return STATUS_INSUFFICIENT_RESOURCES;
                }
  
- #ifdef _MSC_VER
-       try
+       _SEH2_TRY
 -      {
 -              MmProbeAndLockPages(Mdl, KernelMode, IoModifyAccess);
 -      }
 +              {
- #endif
 +                      MmProbeAndLockPages(Mdl, KernelMode, IoModifyAccess);
- #ifdef _MSC_VER
 +              }
-       except (EXCEPTION_EXECUTE_HANDLER)
+       _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
 -      {
 -              TDI_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
 -              IoFreeMdl(Mdl);
 -              IoFreeIrp(Irp);
 -              ExFreePool(MdlBuffer);
 -              ExFreePool(ReceiveInfo);
 -              return STATUS_INSUFFICIENT_RESOURCES;
 +              {
 +                      TDI_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
 +                      IoFreeMdl(Mdl);
 +                      IoFreeIrp(Irp);
 +                      ExFreePool(MdlBuffer);
 +                      ExFreePool(ReceiveInfo);
 +                      return STATUS_INSUFFICIENT_RESOURCES;
-               }
- #endif
+       } _SEH2_END;
  
        TdiBuildReceiveDatagram(
                Irp,                    /* I/O Request Packet */
@@@ -119,49 -119,52 +119,52 @@@ AnalyzeArgv(char *argument
      return element;
  }
  
- int
- AnalyzeFile()
+ void sh_outp(char *cur_string)
  {
-     char *cur_string=(char*)malloc(sizeof(char)*MAXLINE);
-     int symbol=0;
-     char *THtag=(char*)malloc(sizeof(char)*MAXLINE);
-     void sh_outp(void)
-      {
+     int symbol;
 -    putchar('\n');
 -    putchar('\n');
 -    for(symbol=3;putchar(cur_string[symbol]); symbol++);
 -}
 +      putchar('\n');
 +      putchar('\n');
 +      for(symbol=3;putchar(cur_string[symbol]); symbol++);
 +     }
  
    void th_outp(void)
void th_outp(char *cur_string, char *THtag)
 -{
 +     {
+     int symbol;
 -    putchar('\n');
 -    putchar('\n');
 -    putchar('\t');
 -    putchar('\t');
 -    SetCl(ITALIC);
 -     for(symbol=3;putchar(THtag[symbol]); symbol++);
 -    putchar('\n');
 -    SetCl(NORMAL);
 -}
 +      putchar('\n');
 +      putchar('\n');
 +      putchar('\t');
 +      putchar('\t');
 +      SetCl(ITALIC);
 +       for(symbol=3;putchar(THtag[symbol]); symbol++);
 +      putchar('\n');
 +      SetCl(NORMAL);
 +     }
  
    void text_outp(void)
void text_outp(char *cur_string)
 -{
 -    char TagFlag=0;
 +     {
 +      char TagFlag=0;
-       symbol=0;
+     int symbol=0;
  
 -    if(cur_string[0]=='.')
 -        while(cur_string[symbol]!=' ')
 -            symbol++;
 +      if(cur_string[0]=='.')
 +       while(cur_string[symbol]!=' ')
 +        symbol++;
  
 -    if(symbol) TagFlag=1;
 +     if(symbol) TagFlag=1;
  
 -    for(;cur_string[symbol]!='\n'; symbol++)
 +     for(;cur_string[symbol]!='\n'; symbol++)
          putchar(cur_string[symbol]);
          putchar(' ');
 -}
 +     }
  
+ int
+ AnalyzeFile()
+ {
+     char *cur_string=(char*)malloc(sizeof(char)*MAXLINE);
+     char *THtag=(char*)malloc(sizeof(char)*MAXLINE);
      while(fgets(cur_string,MAXLINE,manfile))
  
  /* TAGs processing */
@@@ -356,9 -356,9 +356,9 @@@ AllSysInfo(VOID
  
  /* Main program */
  int
 -main(int argc, char *argv[])
 +main(int argc,char *argv[])
  {
-       if (argc > 1 && argv[1] == "/?")
+       if (argc > 1 && !strcmp(argv[1], "/?"))
        {
                Usage();
                return 0;
@@@ -1,7 -1,6 +1,6 @@@
  <module name="ps" type="win32cui" installbase="bin" installname="ps.exe">
 -      <include base="ps">.</include>
 -      <library>user32</library>
 -      <library>ntdll</library>
 -      <file>ps.c</file>
 +    <include base="ps">.</include>
 +    <library>user32</library>
-     <library>kernel32</library>
 +    <library>ntdll</library>
 +    <file>ps.c</file>
- </module>
+ </module>
@@@ -1,21 -1,20 +1,20 @@@
  <module name="rosperf" type="win32cui" installbase="system32" installname="rosperf.exe">
 -      <include base="rosperf">.</include>
 -      <define name="UNICODE" />
 -      <library>version</library>
 -      <library>msimg32</library>
 -      <library>gdi32</library>
 -      <library>shell32</library>
 -      <library>advapi32</library>
 -      <library>user32</library>
 -      <library>ntdll</library>
 -      <file>rosperf.c</file>
 -      <file>lines.c</file>
 -      <file>fill.c</file>
 +    <include base="rosperf">.</include>
 +    <define name="UNICODE" />
-     <define name="WINVER">0x0501</define>
 +    <library>version</library>
 +    <library>msimg32</library>
 +    <library>gdi32</library>
 +    <library>shell32</library>
 +    <library>advapi32</library>
 +    <library>user32</library>
-     <library>kernel32</library>
 +    <library>ntdll</library>
 +    <file>rosperf.c</file>
 +    <file>lines.c</file>
 +    <file>fill.c</file>
+       <file>scroll.c</file>
 -      <file>text.c</file>
 -      <file>alphablend.c</file>
 -      <file>testlist.c</file>
 -      <file>gradient.c</file>
 -      <file>rosperf.rc</file>
 +    <file>text.c</file>
 +    <file>alphablend.c</file>
 +    <file>testlist.c</file>
 +    <file>gradient.c</file>
 +    <file>rosperf.rc</file>
  </module>
@@@ -1424,15 -1309,15 +1309,15 @@@ static Entry* read_tree(Root* root, LPC
  #if !defined(_NO_EXTENSIONS) && defined(__WINE__)
        if (*path == '/')
        {
 -              /* read unix file system tree */
 +               /* read unix file system tree */
-               root->drive_type = GetDriveType(path);
+               root->drive_type = GetDriveTypeW(path);
  
-               lstrcat(drv, sSlash);
-               load_string(root->volname, IDS_ROOT_FS);
+               lstrcatW(drv, sSlash);
+               load_string(root->volname, sizeof(root->volname)/sizeof(root->volname[0]), IDS_ROOT_FS);
                root->fs_flags = 0;
-               load_string(root->fs, IDS_UNIXFS);
+               load_string(root->fs, sizeof(root->fs)/sizeof(root->fs[0]), IDS_UNIXFS);
  
-               lstrcpy(root->path, sSlash);
+               lstrcpyW(root->path, sSlash);
  
                return read_tree_unix(root, path, sortOrder, hwnd);
        }
@@@ -3824,8 -3697,15 +3697,15 @@@ static void refresh_child(ChildWnd* chi
        scan_entry(child, &child->root.entry, 0, child->hwnd);
  
  #ifdef _SHELL_FOLDERS
        if (child->root.entry.etype == ET_SHELL)
-               entry = read_tree(&child->root, NULL, get_path_pidl(path,child->hwnd), drv, child->sortOrder, child->hwnd);
+       {
+               LPITEMIDLIST local_pidl = get_path_pidl(path,child->hwnd);
+               if (local_pidl)
+                       entry = read_tree(&child->root, NULL, local_pidl , drv, child->sortOrder, child->hwnd);
 -              else
++      else
+                       entry = NULL;
+       }
        else
  #endif
                entry = read_tree(&child->root, path, NULL, drv, child->sortOrder, child->hwnd);
@@@ -4107,10 -3987,10 +3987,10 @@@ static BOOL is_directory(LPCWSTR target
  
        return target_attr&FILE_ATTRIBUTE_DIRECTORY? TRUE: FALSE;
  }
 -
 +      
- static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
+ static BOOL prompt_target(Pane* pane, LPWSTR source, LPWSTR target)
  {
-       TCHAR path[MAX_PATH];
+       WCHAR path[MAX_PATH];
        int len;
  
        get_path(pane->cur, path);
@@@ -4918,15 -4796,19 +4796,19 @@@ static int find_window_class(LPCWSTR cl
  
  #endif
  
- static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCTSTR path)
+ static int winefile_main(HINSTANCE hinstance, int cmdshow, LPCWSTR path)
  {
        MSG msg;
 -
 +  
        InitInstance(hinstance);
  
-       show_frame(0, cmdshow, path);
+       if( !show_frame(0, cmdshow, path) )
+       {
+               ExitInstance();
+               return 1;
+       }
  
-       while(GetMessage(&msg, 0, 0, 0)) {
+       while(GetMessageW(&msg, 0, 0, 0)) {
                if (Globals.hmdiclient && TranslateMDISysAccel(Globals.hmdiclient, &msg))
                        continue;