Ignore:
Timestamp:
Jun 24, 1999, 9:27:49 PM (26 years ago)
Author:
phaller
Message:

Add: even more SHELL32 APIs ... and some corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/misc.cpp

    r168 r183  
    1 /* $Id: misc.cpp,v 1.1 1999-06-23 22:17:52 phaller Exp $ */
     1/* $Id: misc.cpp,v 1.2 1999-06-24 19:27:48 phaller Exp $ */
    22
    33/*
     
    1717#include <os2win.h>
    1818#include <shellapi.h>
     19#include <wchar.h>
     20#include <wcstr.h>
     21#include <winnls.h>
    1922#include "shell32.h"
    2023#include <misc.h>
     
    352355}
    353356
     357
     358/*****************************************************************************
     359 * Name      : ParseField
     360 * Purpose   :
     361 * Parameters:
     362 * Variables :
     363 * Result    :
     364 * Remark    : SHELL32.58
     365 * Status    : UNTESTED UNKNOWN STUB
     366 *
     367 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     368 *****************************************************************************/
     369
     370DWORD WIN32API ParseFieldA(LPCSTR src,
     371                           DWORD  field,
     372                           LPSTR  dst,
     373                           DWORD  len)
     374{
     375  dprintf(("SHELL32: ParseFieldA(%s,%08xh,%08xh,%08xh) not correctly implemented.\n",
     376           src,
     377           field,
     378           dst,
     379           len));
     380
     381  if (!src || !src[0] || !dst || !len)
     382    return 0;
     383
     384  if (field >1)
     385  {
     386    field--;
     387    while (field)
     388    {
     389      if (*src==0x0) return FALSE;
     390      if (*src==',') field--;
     391      src++;
     392    }
     393  }
     394
     395  while (*src!=0x00 && *src!=',' && len>0)
     396  {
     397    *dst=*src; dst++, src++; len--;
     398  }
     399  *dst=0x0;
     400  return TRUE;
     401}
     402
     403
     404/*****************************************************************************
     405 * Name      : PickIconDlg
     406 * Purpose   :
     407 * Parameters:
     408 * Variables :
     409 * Result    :
     410 * Remark    : SHELL32.62
     411 * Status    : UNTESTED UNKNOWN STUB
     412 *
     413 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     414 *****************************************************************************/
     415
     416DWORD WIN32API PickIconDlg(DWORD x,DWORD y,DWORD z,DWORD a)
     417{
     418  dprintf(("SHELL32: PickIconDlg(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     419           x,
     420           y,
     421           z,
     422           a));
     423
     424  return 0xffffffff;
     425}
     426
     427
     428/*****************************************************************************
     429 * Name      : GetFileNameFromBrowse
     430 * Purpose   :
     431 * Parameters:
     432 * Variables :
     433 * Result    :
     434 * Remark    : SHELL32.63
     435 * Status    : UNTESTED UNKNOWN STUB
     436 *
     437 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     438 *****************************************************************************/
     439
     440DWORD WIN32API GetFileNameFromBrowse(HWND   howner,
     441                                     LPSTR  targetbuf,
     442                                     DWORD  len,
     443                                     DWORD  x,
     444                                     LPCSTR suffix,
     445                                     LPCSTR y,
     446                                     LPCSTR cmd)
     447{
     448  dprintf(("SHELL32: GetFileNameFromBrowse(%08xh,  %08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     449           howner,
     450           targetbuf,
     451           len,
     452           x,
     453           suffix,
     454           y,
     455           cmd));
     456
     457  /* puts up a Open Dialog and requests input into targetbuf */
     458  /* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
     459  strcpy(targetbuf,
     460         "x:\\dummy.exe");
     461
     462  return 1;
     463}
     464
     465
     466/*****************************************************************************
     467 * Name      : OleStrToStrN
     468 * Purpose   :
     469 * Parameters:
     470 * Variables :
     471 * Result    :
     472 * Remark    : SHELL32.78
     473 * Status    : UNTESTED UNKNOWN STUB
     474 *
     475 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     476 *****************************************************************************/
     477
     478BOOL WIN32API OleStrToStrN (LPSTR   lpMulti,
     479                            INT     nMulti,
     480                            LPCWSTR lpWide,
     481                            INT     nWide)
     482{
     483  dprintf(("SHELL32: OleStrToStrN(%08xh,%08xh,%08xh,%08xh)\n",
     484           lpMulti,
     485           nMulti,
     486           lpWide,
     487           nWide));
     488
     489  return WideCharToMultiByte (0,
     490                              0,
     491                              lpWide,
     492                              nWide,
     493                              lpMulti,
     494                              nMulti,
     495                              NULL,
     496                              NULL);
     497}
     498
     499
     500/*****************************************************************************
     501 * Name      : StrToOleStrN
     502 * Purpose   :
     503 * Parameters:
     504 * Variables :
     505 * Result    :
     506 * Remark    : SHELL32.79
     507 * Status    : UNTESTED UNKNOWN STUB
     508 *
     509 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     510 *****************************************************************************/
     511
     512BOOL WIN32API StrToOleStrN (LPWSTR lpWide,
     513                            INT    nWide,
     514                            LPCSTR lpMulti,
     515                            INT    nMulti)
     516{
     517  dprintf(("SHELL32: StrToOleStrN(%08xh,%08xh,%08xh,%08xh)\n",
     518           lpWide,
     519           nWide,
     520           lpMulti,
     521           nMulti));
     522
     523  return MultiByteToWideChar (0,
     524                              0,
     525                              lpMulti,
     526                              nMulti,
     527                              lpWide,
     528                              nWide);
     529}
     530
     531
     532/*****************************************************************************
     533 * Name      : RegisterShellHook
     534 * Purpose   :
     535 * Parameters:
     536 * Variables :
     537 * Result    :
     538 * Remark    : SHELL32.181
     539 * Status    : UNTESTED UNKNOWN STUB
     540 *
     541 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     542 *
     543 * PARAMS
     544 *      hwnd [I]  window handle
     545 *      y    [I]  flag ????
     546 *
     547 * NOTES
     548 *     exported by ordinal
     549 */
     550
     551void WIN32API RegisterShellHook(HWND  hwnd,
     552                                DWORD y)
     553{
     554  dprintf(("SHELL32: RegisterShellHook(%08xh, %08xh) not implemented.\n",
     555           hwnd,
     556           y));
     557}
     558
     559
     560/*****************************************************************************
     561 * Name      : RunFileDlg
     562 * Purpose   :
     563 * Parameters:
     564 * Variables :
     565 * Result    :
     566 * Remark    : SHELL32.61
     567 * Status    : UNTESTED UNKNOWN STUB
     568 *
     569 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     570 *****************************************************************************/
     571
     572DWORD WIN32API RunFileDlg (HWND  hwndOwner,
     573                           DWORD dwParam1,
     574                           DWORD dwParam2,
     575                           LPSTR lpszTitle,
     576                           LPSTR lpszPrompt,
     577                           UINT  uFlags)
     578{
     579  dprintf(("SHELL32: RunFileDlg(%08xh,%08xh,%08xh,%s,%s,%08xh) not implemented.\n",
     580           hwndOwner,
     581           dwParam1,
     582           dwParam2,
     583           lpszTitle,
     584           lpszPrompt,
     585           uFlags));
     586
     587  return 0;
     588}
     589
     590
     591/*****************************************************************************
     592 * Name      : ExitWindowsDialog
     593 * Purpose   :
     594 * Parameters:
     595 * Variables :
     596 * Result    :
     597 * Remark    : SHELL32.60
     598 * Status    : UNTESTED UNKNOWN STUB
     599 *
     600 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     601 *****************************************************************************/
     602
     603void WIN32API ExitWindowsDialog (HWND hWndOwner)
     604{
     605  dprintf(("SHELL32: ExitWindowsDialog(%08xh)\n",
     606           hWndOwner));
     607
     608   if (MessageBoxA(hWndOwner,
     609                   "Do you want to exit ODIN?",
     610                   "Shutdown",
     611                   MB_YESNO|MB_ICONQUESTION)
     612       == IDOK)
     613   {
     614     SendMessageA (hWndOwner,
     615                   WM_QUIT,
     616                   0,
     617                   0);
     618   }
     619}
     620
     621
     622/*****************************************************************************
     623 * Name      : ArrangeWindows
     624 * Purpose   :
     625 * Parameters:
     626 * Variables :
     627 * Result    :
     628 * Remark    : SHELL32.184
     629 * Status    : UNTESTED UNKNOWN STUB
     630 *
     631 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     632 *****************************************************************************/
     633
     634DWORD WIN32API ArrangeWindows (DWORD dwParam1,
     635                               DWORD dwParam2,
     636                               DWORD dwParam3,
     637                               DWORD dwParam4,
     638                               DWORD dwParam5)
     639{
     640  dprintf(("SHELL32: ArrangeWindows(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     641           dwParam1,
     642           dwParam2,
     643           dwParam3,
     644           dwParam4,
     645           dwParam5));
     646
     647  return 0;
     648}
     649
     650
     651/*****************************************************************************
     652 * Name      : SignalFileOpen
     653 * Purpose   :
     654 * Parameters:
     655 * Variables :
     656 * Result    :
     657 * Remark    : SHELL32.103
     658 * Status    : UNTESTED UNKNOWN STUB
     659 *
     660 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     661 *****************************************************************************/
     662
     663DWORD WIN32API SignalFileOpen (DWORD dwParam1)
     664{
     665  dprintf(("SHELL32: SignalFileOpen(%08xh) not implemented.\n",
     666           dwParam1));
     667
     668  return 0;
     669}
     670
     671
     672/*****************************************************************************
     673 * Name      : DAD_ShowDrawImage
     674 * Purpose   :
     675 * Parameters:
     676 * Variables :
     677 * Result    :
     678 * Remark    : SHELL32.137
     679 * Status    : UNTESTED UNKNOWN STUB
     680 *
     681 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     682 *****************************************************************************/
     683
     684HRESULT WIN32API DAD_ShowDragImage (DWORD u)
     685{
     686  dprintf(("SHELL32: DAD_ShowDragImage(%08xh) not implemented.\n",
     687           u));
     688
     689  return 0;
     690}
     691
     692
     693/*****************************************************************************
     694 * Name      : ReadCabinetState
     695 * Purpose   :
     696 * Parameters:
     697 * Variables :
     698 * Result    :
     699 * Remark    : SHELL32.651
     700 * Status    : UNTESTED UNKNOWN STUB
     701 *
     702 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     703 *****************************************************************************/
     704
     705HRESULT WIN32API ReadCabinetState(DWORD u,
     706                                  DWORD v)
     707{
     708  dprintf(("SHELL32: ReadCabinetState(%08xh, %08xh) not implemented.\n",
     709           u,
     710           v));
     711
     712  return 0;
     713}
     714
     715
     716/*****************************************************************************
     717 * Name      : WriteCabinetState
     718 * Purpose   :
     719 * Parameters:
     720 * Variables :
     721 * Result    :
     722 * Remark    : SHELL32.652
     723 * Status    : UNTESTED UNKNOWN STUB
     724 *
     725 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     726 *****************************************************************************/
     727
     728HRESULT WIN32API WriteCabinetState(DWORD u)
     729{
     730  dprintf(("SHELL32: WriteCabinetState(%08xh) not implemented.\n",
     731           u));
     732
     733  return 0;
     734}
     735
     736
     737/*****************************************************************************
     738 * Name      : FileIconInit
     739 * Purpose   :
     740 * Parameters:
     741 * Variables :
     742 * Result    :
     743 * Remark    : SHELL32.660
     744 * Status    : UNTESTED UNKNOWN STUB
     745 *
     746 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     747 *****************************************************************************/
     748
     749BOOL WIN32API FileIconInit(BOOL bFullInit)
     750{
     751  dprintf(("SHELL32: FileIconInit(%08xh) not implemented.\n",
     752           bFullInit));
     753
     754  return 0;
     755}
     756
     757
     758/*****************************************************************************
     759 * Name      : IsUserAdmin
     760 * Purpose   :
     761 * Parameters:
     762 * Variables :
     763 * Result    :
     764 * Remark    : SHELL32.680
     765 * Status    : UNTESTED UNKNOWN STUB
     766 *
     767 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     768 *****************************************************************************/
     769
     770HRESULT WIN32API IsUserAdmin(void)
     771{
     772  dprintf(("SHELL32: IsUserAdmin() not implmented. Yes, user is admin ;-)\n"));
     773
     774  return TRUE;
     775}
     776
     777
     778/*****************************************************************************
     779 * Name      : StrRetToStrN
     780 * Purpose   : converts a STRRET to a normal string
     781 * Parameters: the pidl is for STRRET OFFSET
     782 * Variables :
     783 * Result    :
     784 * Remark    : SHELL32.96
     785 * Status    : UNTESTED UNKNOWN STUB
     786 *
     787 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     788 *****************************************************************************/
     789
     790HRESULT WIN32API StrRetToStrN (LPVOID       dest,
     791                               DWORD        len,
     792                               LPSTRRET     src,
     793                               LPITEMIDLIST pidl)
     794{
     795  dprintf(("SHELL32: StrRetToStrN(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     796           dest,
     797           len,
     798           src,
     799           pidl));
     800
     801  switch (src->uType)
     802  {
     803    case STRRET_WSTR:
     804      WideCharToMultiByte(CP_ACP,
     805                          0,
     806                          src->u.pOleStr,
     807                          -1,
     808                          (LPSTR)dest,
     809                          len,
     810                          NULL,
     811                          NULL);
     812      SHFree(src->u.pOleStr);
     813      break;
     814
     815    case STRRET_CSTRA:
     816      //if (VERSION_OsIsUnicode())
     817      //  lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
     818      //else
     819        strncpy((LPSTR)dest,
     820                src->u.cStr,
     821                len);
     822      break;
     823
     824    case STRRET_OFFSETA:
     825      if (pidl)
     826      {
     827        //if(VERSION_OsIsUnicode())
     828        //  lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
     829        //else
     830          strncpy((LPSTR)dest,
     831                  ((LPCSTR)&pidl->mkid)+src->u.uOffset,
     832                  len);
     833        break;
     834      }
     835
     836    default:
     837      dprintf(("SHELL32: StrRetToStrN: unknown type!\n"));
     838
     839      if (len)
     840        *(LPSTR)dest = '\0';
     841
     842      return(FALSE);
     843  }
     844  return(TRUE);
     845}
     846
     847/*****************************************************************************
     848 * Name      : StrChrW
     849 * Purpose   :
     850 * Parameters:
     851 * Variables :
     852 * Result    :
     853 * Remark    : SHELL32.651
     854 * Status    : UNTESTED UNKNOWN STUB
     855 *
     856 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     857 *****************************************************************************/
     858
     859LPWSTR WIN32API StrChrW (LPWSTR str,
     860                         WCHAR  x)
     861{
     862  dprintf (("SHELL32: StrChrW(%08xh, %08xh)\n",
     863            str,
     864            x));
     865
     866  return ((LPWSTR)wcschr((const wchar_t*)str,
     867                         x));
     868}
     869
     870
     871/*****************************************************************************
     872 * Name      : StrChrNIW
     873 * Purpose   :
     874 * Parameters:
     875 * Variables :
     876 * Result    :
     877 * Remark    : SHELL32.?
     878 * Status    : UNTESTED UNKNOWN STUB
     879 *
     880 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     881 *****************************************************************************/
     882
     883INT WIN32API StrCmpNIW (LPWSTR wstr1,
     884                        LPWSTR wstr2,
     885                        INT    len)
     886{
     887  dprintf(("SHELL32: StrCmpNIW(%08xh,%08xh,%08xh) not correctly implemented.\n",
     888           wstr1,
     889           wstr2,
     890           len));
     891
     892  return (wcsncmp((const wchar_t*)wstr1,
     893                  (const wchar_t*)wstr2,
     894                  len));
     895}
     896
     897
     898/*****************************************************************************
     899 * Name      : DriveType
     900 * Purpose   :
     901 * Parameters:
     902 * Variables :
     903 * Result    :
     904 * Remark    : SHELL32.64
     905 * Status    : UNTESTED UNKNOWN STUB
     906 *
     907 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     908 *****************************************************************************/
     909
     910HRESULT WIN32API DriveType(DWORD u)
     911{
     912  dprintf(("SHELL32: DriveType(%08xh) not implemented.\n",
     913           u));
     914
     915  return 0;
     916}
     917
     918
     919/*****************************************************************************
     920 * Name      : StrRChrW
     921 * Purpose   :
     922 * Parameters:
     923 * Variables :
     924 * Result    :
     925 * Remark    : SHELL32.320, wcsrchr does not work?
     926 * Status    : UNTESTED UNKNOWN STUB
     927 *
     928 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     929 *****************************************************************************/
     930
     931LPWSTR WIN32API StrRChrW(LPWSTR lpStart,
     932                         LPWSTR lpEnd,
     933                         DWORD  wMatch)
     934{
     935  LPWSTR wptr=NULL;
     936
     937  dprintf(("SHELL32: StrRChrW(%08xh,%08xh,%08xh)\n",
     938           lpStart,
     939           lpEnd,
     940           wMatch));
     941
     942  /* if the end not given, search*/
     943  if (!lpEnd)
     944  {
     945    lpEnd=lpStart;
     946    while (*lpEnd)
     947      lpEnd++;
     948  }
     949
     950  do
     951  {
     952    if (*lpStart==(WCHAR)wMatch)
     953      wptr = lpStart;
     954    lpStart++;
     955  }
     956  while ( lpStart<=lpEnd );
     957  return wptr;
     958}
     959
     960
     961/*****************************************************************************
     962 * Name      : Control_FillCache_RunDLL
     963 * Purpose   :
     964 * Parameters:
     965 * Variables :
     966 * Result    :
     967 * Remark    : SHELL32.8
     968 * Status    : UNTESTED UNKNOWN STUB
     969 *
     970 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     971 *****************************************************************************/
     972
     973HRESULT WIN32API Control_FillCache_RunDLL(HWND   hWnd,
     974                                          HANDLE hModule,
     975                                          DWORD  w,
     976                                          DWORD  x)
     977{
     978  dprintf(("SHELL32: Control_FillCache_RunDLL(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     979           hWnd,
     980           hModule,
     981           w,
     982           x));
     983
     984  return 0;
     985}
     986
     987
     988/*****************************************************************************
     989 * Name      : RunDLL_CallEntry16
     990 * Purpose   :
     991 * Parameters:
     992 * Variables :
     993 * Result    :
     994 * Remark    : SHELL32.122 - the name is propably wrong
     995 * Status    : UNTESTED UNKNOWN STUB
     996 *
     997 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     998 *****************************************************************************/
     999
     1000HRESULT WIN32API RunDLL_CallEntry16(DWORD v,
     1001                                    DWORD w,
     1002                                    DWORD x,
     1003                                    DWORD y,
     1004                                    DWORD z)
     1005{
     1006  dprintf(("SHELL32: RunDLL_CallEntry16(%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
     1007           v,
     1008           w,
     1009           x,
     1010           y,
     1011           z));
     1012
     1013  return 0;
     1014}
     1015
     1016
     1017/*****************************************************************************
     1018 * Name      : SHELL32_654
     1019 * Purpose   :
     1020 * Parameters:
     1021 * Variables :
     1022 * Result    :
     1023 * Remark    : SHELL32.654
     1024 * Status    : UNTESTED UNKNOWN STUB
     1025 *
     1026 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     1027 *****************************************************************************/
     1028
     1029HRESULT WIN32API SHELL32_654 (DWORD x,
     1030                              DWORD y)
     1031{
     1032  dprintf(("SHELL32: SHELL32_654(%08xh,%08xh) not implemented.\n",
     1033           x,
     1034           y));
     1035  return 0;
     1036}
     1037
     1038
     1039/*****************************************************************************
     1040 * Name      : RLBuildListOfPaths
     1041 * Purpose   :
     1042 * Parameters:
     1043 * Variables :
     1044 * Result    :
     1045 * Remark    : SHELL32.146 - builds a DPA
     1046 * Status    : UNTESTED UNKNOWN STUB
     1047 *
     1048 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     1049 *****************************************************************************/
     1050
     1051DWORD WIN32API RLBuildListOfPaths ()
     1052{
     1053  dprintf(("SHELL32: RLBuildListOfPaths() not implemented.\n"));
     1054  return 0;
     1055}
     1056
     1057
     1058/*****************************************************************************
     1059 * Name      : StrToOleStr
     1060 * Purpose   :
     1061 * Parameters:
     1062 * Variables :
     1063 * Result    :
     1064 * Remark    : SHELL32.163
     1065 * Status    : UNTESTED UNKNOWN STUB
     1066 *
     1067 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     1068 *****************************************************************************/
     1069
     1070int WIN32API StrToOleStr (LPWSTR lpWideCharStr,
     1071                          LPCSTR lpMultiByteString)
     1072{
     1073  dprintf(("SHELL32: StrToOleStr(%08xh,%08xh)\n",
     1074           lpWideCharStr,
     1075           lpMultiByteString));
     1076
     1077  return MultiByteToWideChar(0,
     1078                             0,
     1079                             lpMultiByteString,
     1080                             -1,
     1081                             lpWideCharStr,
     1082                             MAX_PATH);
     1083}
     1084
     1085
     1086/*****************************************************************************
     1087 * Name      : SetAppStartingCursor
     1088 * Purpose   :
     1089 * Parameters:
     1090 * Variables :
     1091 * Result    :
     1092 * Remark    : SHELL32.99
     1093 * Status    : UNTESTED UNKNOWN STUB
     1094 *
     1095 * Author    : Patrick Haller [Tue, 1998/06/15 03:00]
     1096 *****************************************************************************/
     1097
     1098HRESULT WIN32API SetAppStartingCursor(HWND  u,
     1099                                      DWORD v)
     1100{
     1101  dprintf(("SHELL32: SetAppStartingCursor (SHELL32.99): (%08xh,%08xh) not implemented.\n",
     1102           u,
     1103           v));
     1104
     1105  return 0;
     1106}
     1107
Note: See TracChangeset for help on using the changeset viewer.