Reactos

[HEADERS] Move some helpers from undocshell.h to shellutils.h as they didn't cover anything undocumented. Merge traycmd.h in undocshell.h as both contain just undocumented shell definitions.

+165 -218
-1
base/shell/explorer/traywnd.cpp
··· 21 21 22 22 #include "precomp.h" 23 23 #include <commoncontrols.h> 24 - #include <traycmd.h> 25 24 26 25 HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); 27 26
-30
dll/shellext/acppage/ACPPage.cpp
··· 83 83 }; 84 84 85 85 EXTERN_C 86 - inline ULONG 87 - Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) 88 - { 89 - char Buffer[512]; 90 - char* Current = Buffer; 91 - size_t Length = _countof(Buffer); 92 - const char* fname = strrchr(filename, '\\'); 93 - if (fname == NULL) 94 - { 95 - fname = strrchr(filename, '/'); 96 - if (fname != NULL) 97 - fname++; 98 - } 99 - else 100 - fname++; 101 - 102 - if (fname == NULL) 103 - fname = filename; 104 - 105 - StringCchPrintfExA(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, "%s:%d: ", fname, line); 106 - va_list ArgList; 107 - va_start(ArgList, lpFormat); 108 - StringCchVPrintfExA(Current, Length, &Current, &Length, STRSAFE_NULL_ON_FAILURE, lpFormat, ArgList); 109 - va_end(ArgList); 110 - OutputDebugStringA(Buffer); 111 - return 0; 112 - } 113 - 114 - 115 - EXTERN_C 116 86 BOOL WINAPI GetExeFromLnk(PCWSTR pszLnk, PWSTR pszExe, size_t cchSize) 117 87 { 118 88 CCoInit init;
-1
dll/shellext/zipfldr/precomp.h
··· 37 37 extern LONG g_ModuleRefCnt; 38 38 39 39 40 - #define Win32DbgPrint(file, line, warn, func) DbgPrint("(%s:%d) " warn, file, line, func) 41 40 WCHAR* guid2string(REFCLSID iid); 42 41 43 42
-1
dll/win32/shell32/CShellDispatch.cpp
··· 8 8 9 9 #include "precomp.h" 10 10 #include "winsvc.h" 11 - #include <traycmd.h> // tray commands 12 11 13 12 WINE_DEFAULT_DEBUG_CHANNEL(shell); 14 13
+1
modules/rostests/apitests/browseui/ACListISF.cpp
··· 17 17 // Yes, gcc at it again, let's validate everything found inside unused templates! 18 18 ULONG DbgPrint(PCH Format,...); 19 19 20 + #include <stdio.h> 20 21 #include <shellutils.h> 21 22 #include <shlwapi.h> 22 23 #include <strsafe.h>
+1
modules/rostests/apitests/shell32/CFSFolder.cpp
··· 9 9 10 10 #define NDEBUG 11 11 #include <debug.h> 12 + #include <stdio.h> 12 13 #include <shellutils.h> 13 14 14 15 LPITEMIDLIST _CreateDummyPidl()
+1
modules/rostests/apitests/shell32/CMyComputer.cpp
··· 9 9 10 10 #define NDEBUG 11 11 #include <debug.h> 12 + #include <stdio.h> 12 13 #include <shellutils.h> 13 14 14 15 #define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
+1
modules/rostests/apitests/shell32/CShellDesktop.cpp
··· 9 9 #include "shelltest.h" 10 10 11 11 #include <ndk/rtlfuncs.h> 12 + #include <stdio.h> 12 13 #include <shellutils.h> 13 14 14 15 // We would normally use S_LESSTHAN and S_GREATERTHAN, but w2k3 returns numbers like 3 and -3...
+1
modules/rostests/apitests/shell32/CShellLink.cpp
··· 9 9 10 10 #define NDEBUG 11 11 #include <debug.h> 12 + #include <stdio.h> 12 13 #include <shellutils.h> 13 14 14 15 /* Test IShellLink::SetPath with environment-variables, existing, non-existing, ...*/
+1 -2
modules/rostests/apitests/shell32/SHCreateFileExtractIconW.cpp
··· 9 9 10 10 #include <wincon.h> 11 11 #include <wingdi.h> 12 - 13 - ULONG DbgPrint(PCH Format,...); 12 + #include <stdio.h> 14 13 #include <shellutils.h> 15 14 16 15 HRESULT (STDAPICALLTYPE *pSHCreateFileExtractIconW)(LPCWSTR pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
+1
modules/rostests/apitests/shell32/ShellState.cpp
··· 8 8 9 9 #define NDEBUG 10 10 #include <debug.h> 11 + #include <stdio.h> 11 12 #include <shellutils.h> 12 13 #include <strsafe.h> 13 14
+133
sdk/include/reactos/shellutils.h
··· 23 23 extern "C" { 24 24 #endif /* defined(__cplusplus) */ 25 25 26 + static inline ULONG 27 + Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) 28 + { 29 + char szMsg[512]; 30 + char *szMsgStart; 31 + const char *fname; 32 + va_list vl; 33 + ULONG uRet; 34 + 35 + fname = strrchr(filename, '\\'); 36 + if (fname == NULL) 37 + { 38 + fname = strrchr(filename, '/'); 39 + if (fname != NULL) 40 + fname++; 41 + } 42 + else 43 + fname++; 44 + 45 + if (fname == NULL) 46 + fname = filename; 47 + 48 + szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line); 49 + 50 + va_start(vl, lpFormat); 51 + uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl); 52 + va_end(vl); 53 + 54 + OutputDebugStringA(szMsg); 55 + 56 + return uRet; 57 + } 58 + 59 + #define DbgPrint(fmt, ...) \ 60 + Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__) 61 + 26 62 #ifdef __cplusplus 27 63 # define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType))) 28 64 # define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType))) ··· 370 406 return E_FAIL; 371 407 372 408 return SHSetStrRet(pStrRet, Buffer); 409 + } 410 + 411 + static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel) 412 + { 413 + WCHAR label[128]; 414 + int i; 415 + int count = GetMenuItemCount(hmenu); 416 + 417 + padding[padlevel] = '.'; 418 + padding[padlevel + 1] = '.'; 419 + padding[padlevel + 2] = 0; 420 + 421 + for (i = 0; i < count; i++) 422 + { 423 + MENUITEMINFOW mii = { 0 }; 424 + 425 + mii.cbSize = sizeof(mii); 426 + mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID; 427 + mii.dwTypeData = label; 428 + mii.cch = _countof(label); 429 + 430 + GetMenuItemInfoW(hmenu, i, TRUE, &mii); 431 + 432 + if (mii.fType & MFT_BITMAP) 433 + DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); 434 + else if (mii.fType & MFT_SEPARATOR) 435 + DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID); 436 + else 437 + DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); 438 + 439 + if (mii.hSubMenu) 440 + DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2); 441 + 442 + } 443 + 444 + padding[padlevel] = 0; 445 + } 446 + 447 + static __inline void DbgDumpMenu(HMENU hmenu) 448 + { 449 + char padding[128]; 450 + DbgDumpMenuInternal(hmenu, padding, 0); 451 + } 452 + 453 + 454 + static inline 455 + void DumpIdList(LPCITEMIDLIST pcidl) 456 + { 457 + DbgPrint("Begin IDList Dump\n"); 458 + 459 + for (; pcidl != NULL; pcidl = ILGetNext(pcidl)) 460 + { 461 + int i; 462 + int cb = pcidl->mkid.cb; 463 + BYTE * sh = (BYTE*) &(pcidl->mkid); 464 + if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID. 465 + break; 466 + DbgPrint("Begin SHITEMID (cb=%d)\n", cb); 467 + if ((cb & 3) != 0) 468 + DbgPrint(" - WARNING: cb is not a multiple of 4\n"); 469 + for (i = 0; (i + 4) <= cb; i += 4) 470 + { 471 + DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n", 472 + i, 473 + sh[i + 0], 474 + sh[i + 1], 475 + sh[i + 2], 476 + sh[i + 3]); 477 + } 478 + if (i < cb) 479 + { 480 + cb -= i; 481 + if (cb == 3) 482 + { 483 + DbgPrint(" - abID[%08x]: %02x %02x %02x --\n", 484 + i, 485 + sh[i + 0], 486 + sh[i + 1], 487 + sh[i + 2]); 488 + } 489 + else if (cb == 2) 490 + { 491 + DbgPrint(" - abID[%08x]: %02x %02x -- --\n", 492 + i, 493 + sh[i + 0], 494 + sh[i + 1]); 495 + } 496 + else if (cb == 1) 497 + { 498 + DbgPrint(" - abID[%08x]: %02x -- -- --\n", 499 + i, 500 + sh[i + 0]); 501 + } 502 + } 503 + DbgPrint("End SHITEMID\n"); 504 + } 505 + DbgPrint("End IDList Dump.\n"); 373 506 } 374 507 375 508 #endif /* __cplusplus */
-49
sdk/include/reactos/traycmd.h
··· 1 - /* 2 - * Tray Commands 3 - * 4 - * Copyright 2018 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com> 5 - * 6 - * this library is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU Lesser General Public 8 - * License as published by the Free Software Foundation; either 9 - * version 2.1 of the License, or (at your option) any later version. 10 - * 11 - * this library is distributed in the hope that it will be useful, 12 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 - * Lesser General Public License for more details. 15 - * 16 - * You should have received a copy of the GNU Lesser General Public 17 - * License along with this library; if not, write to the Free Software 18 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 - */ 20 - 21 - #ifndef TRAYCMD_H_ 22 - #define TRAYCMD_H_ 23 - 24 - /* TODO: Add more and implement them */ 25 - #define TRAYCMD_STARTMENU 305 /* Same as IDMA_START. */ 26 - #define TRAYCMD_RUN_DIALOG 401 /* Implemented. Same as IDM_RUN. */ 27 - #define TRAYCMD_LOGOFF_DIALOG 402 /* Implemented. Same as IDM_LOGOFF. */ 28 - #define TRAYCMD_CASCADE 403 /* */ 29 - #define TRAYCMD_TILE_H 404 /* */ 30 - #define TRAYCMD_TILE_V 405 /* */ 31 - #define TRAYCMD_TOGGLE_DESKTOP 407 /* Implemented. */ 32 - #define TRAYCMD_DATE_AND_TIME 408 /* Implemented. */ 33 - #define TRAYCMD_TASKBAR_PROPERTIES 413 /* Implemented. Same as IDM_TASKBARANDSTARTMENU. */ 34 - #define TRAYCMD_MINIMIZE_ALL 415 /* Implemented. */ 35 - #define TRAYCMD_RESTORE_ALL 416 /* Implemented. Same as IDMA_RESTORE_OPEN. */ 36 - #define TRAYCMD_SHOW_DESKTOP 419 /* Implemented. */ 37 - #define TRAYCMD_SHOW_TASK_MGR 420 /* Implemented. */ 38 - #define TRAYCMD_CUSTOMIZE_TASKBAR 421 /* */ 39 - #define TRAYCMD_LOCK_TASKBAR 424 /* Implemented. */ 40 - #define TRAYCMD_HELP_AND_SUPPORT 503 /* Implemented. Same as IDM_HELPANDSUPPORT. */ 41 - #define TRAYCMD_CONTROL_PANEL 505 /* Same as IDM_CONTROLPANEL. */ 42 - #define TRAYCMD_SHUTDOWN_DIALOG 506 /* Implemented. Same as IDM_SHUTDOWN. */ 43 - #define TRAYCMD_PRINTERS_AND_FAXES 510 /* Same as IDM_PRINTERSANDFAXES. */ 44 - #define TRAYCMD_LOCK_DESKTOP 517 /* */ 45 - #define TRAYCMD_SWITCH_USER_DIALOG 5000 /* */ 46 - #define TRAYCMD_SEARCH_FILES 41093 /* Implemented. Same as IDMA_SEARCH. */ 47 - #define TRAYCMD_SEARCH_COMPUTERS 41094 /* Implemented. */ 48 - 49 - #endif /* ndef TRAYCMD_H_ */
+25 -134
sdk/include/reactos/undocshell.h
··· 618 618 _Out_ LPGUID pguid 619 619 ); 620 620 621 - static inline ULONG 622 - Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) 623 - { 624 - char szMsg[512]; 625 - char *szMsgStart; 626 - const char *fname; 627 - va_list vl; 628 - ULONG uRet; 629 - 630 - fname = strrchr(filename, '\\'); 631 - if (fname == NULL) 632 - { 633 - fname = strrchr(filename, '/'); 634 - if (fname != NULL) 635 - fname++; 636 - } 637 - else 638 - fname++; 639 - 640 - if (fname == NULL) 641 - fname = filename; 642 - 643 - szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line); 644 - 645 - va_start(vl, lpFormat); 646 - uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl); 647 - va_end(vl); 648 - 649 - OutputDebugStringA(szMsg); 650 - 651 - return uRet; 652 - } 653 - 654 - #define DbgPrint(fmt, ...) \ 655 - Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__) 656 - 657 - static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel) 658 - { 659 - WCHAR label[128]; 660 - int i; 661 - int count = GetMenuItemCount(hmenu); 662 - 663 - padding[padlevel] = '.'; 664 - padding[padlevel + 1] = '.'; 665 - padding[padlevel + 2] = 0; 666 - 667 - for (i = 0; i < count; i++) 668 - { 669 - MENUITEMINFOW mii = { 0 }; 670 - 671 - mii.cbSize = sizeof(mii); 672 - mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID; 673 - mii.dwTypeData = label; 674 - mii.cch = _countof(label); 675 - 676 - GetMenuItemInfoW(hmenu, i, TRUE, &mii); 677 - 678 - if (mii.fType & MFT_BITMAP) 679 - DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); 680 - else if (mii.fType & MFT_SEPARATOR) 681 - DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID); 682 - else 683 - DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); 684 - 685 - if (mii.hSubMenu) 686 - DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2); 687 - 688 - } 689 - 690 - padding[padlevel] = 0; 691 - } 692 - 693 - static __inline void DbgDumpMenu(HMENU hmenu) 694 - { 695 - char padding[128]; 696 - DbgDumpMenuInternal(hmenu, padding, 0); 697 - } 698 - 699 - 700 - static inline 701 - void DumpIdList(LPCITEMIDLIST pcidl) 702 - { 703 - DbgPrint("Begin IDList Dump\n"); 704 - 705 - for (; pcidl != NULL; pcidl = ILGetNext(pcidl)) 706 - { 707 - int i; 708 - int cb = pcidl->mkid.cb; 709 - BYTE * sh = (BYTE*) &(pcidl->mkid); 710 - if (cb == 0) // ITEMIDLISTs are terminatedwith a null SHITEMID. 711 - break; 712 - DbgPrint("Begin SHITEMID (cb=%d)\n", cb); 713 - if ((cb & 3) != 0) 714 - DbgPrint(" - WARNING: cb is not a multiple of 4\n"); 715 - for (i = 0; (i + 4) <= cb; i += 4) 716 - { 717 - DbgPrint(" - abID[%08x]: %02x %02x %02x %02x\n", 718 - i, 719 - sh[i + 0], 720 - sh[i + 1], 721 - sh[i + 2], 722 - sh[i + 3]); 723 - } 724 - if (i < cb) 725 - { 726 - cb -= i; 727 - if (cb == 3) 728 - { 729 - DbgPrint(" - abID[%08x]: %02x %02x %02x --\n", 730 - i, 731 - sh[i + 0], 732 - sh[i + 1], 733 - sh[i + 2]); 734 - } 735 - else if (cb == 2) 736 - { 737 - DbgPrint(" - abID[%08x]: %02x %02x -- --\n", 738 - i, 739 - sh[i + 0], 740 - sh[i + 1]); 741 - } 742 - else if (cb == 1) 743 - { 744 - DbgPrint(" - abID[%08x]: %02x -- -- --\n", 745 - i, 746 - sh[i + 0]); 747 - } 748 - } 749 - DbgPrint("End SHITEMID\n"); 750 - } 751 - DbgPrint("End IDList Dump.\n"); 752 - } 753 - 754 - 755 621 /***************************************************************************** 756 622 * Shell32 resources 757 623 */ ··· 784 650 // undocumented flags for IShellMenu::SetShellFolder 785 651 #define SMSET_UNKNOWN08 0x08 786 652 #define SMSET_UNKNOWN10 0x10 653 + 654 + // explorer tray commands 655 + #define TRAYCMD_STARTMENU 305 656 + #define TRAYCMD_RUN_DIALOG 401 657 + #define TRAYCMD_LOGOFF_DIALOG 402 658 + #define TRAYCMD_CASCADE 403 659 + #define TRAYCMD_TILE_H 404 660 + #define TRAYCMD_TILE_V 405 661 + #define TRAYCMD_TOGGLE_DESKTOP 407 662 + #define TRAYCMD_DATE_AND_TIME 408 663 + #define TRAYCMD_TASKBAR_PROPERTIES 413 664 + #define TRAYCMD_MINIMIZE_ALL 415 665 + #define TRAYCMD_RESTORE_ALL 416 666 + #define TRAYCMD_SHOW_DESKTOP 419 667 + #define TRAYCMD_SHOW_TASK_MGR 420 668 + #define TRAYCMD_CUSTOMIZE_TASKBAR 421 669 + #define TRAYCMD_LOCK_TASKBAR 424 670 + #define TRAYCMD_HELP_AND_SUPPORT 503 671 + #define TRAYCMD_CONTROL_PANEL 505 672 + #define TRAYCMD_SHUTDOWN_DIALOG 506 673 + #define TRAYCMD_PRINTERS_AND_FAXES 510 674 + #define TRAYCMD_LOCK_DESKTOP 517 675 + #define TRAYCMD_SWITCH_USER_DIALOG 5000 676 + #define TRAYCMD_SEARCH_FILES 41093 677 + #define TRAYCMD_SEARCH_COMPUTERS 41094 787 678 788 679 void WINAPI ShellDDEInit(BOOL bInit); 789 680 DWORD WINAPI WinList_Init(void);