[SHELL32] Deduplicate MAX_PROPERTY_SHEET_PAGE and AddPropSheetPageCallback(). #179

This commit is contained in:
Amine Khaldi 2017-12-25 13:22:03 +01:00
parent 0d35ee7ade
commit a3797dba7a
6 changed files with 18 additions and 35 deletions

View file

@ -144,7 +144,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define SHLINK_LOCAL 0
#define SHLINK_REMOTE 1
#define MAX_PROPERTY_SHEET_PAGE 32
/* link file formats */

View file

@ -21,8 +21,6 @@
#include "precomp.h"
#define MAX_PROPERTY_SHEET_PAGE 32
WINE_DEFAULT_DEBUG_CHANNEL(shell);
typedef struct
@ -109,18 +107,6 @@ GetDefaultClusterSize(LPWSTR szFs, PDWORD pClusterSize, PULARGE_INTEGER TotalNum
return TRUE;
}
static BOOL CALLBACK
AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
{
PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam;
if (ppsh->nPages < MAX_PROPERTY_SHEET_PAGE)
{
ppsh->phpage[ppsh->nPages++] = hPage;
return TRUE;
}
return FALSE;
}
typedef struct _DRIVE_PROP_PAGE
{
LPCSTR resname;

View file

@ -23,8 +23,6 @@
WINE_DEFAULT_DEBUG_CHANNEL (fprop);
#define MAX_PROPERTY_SHEET_PAGE (32)
/// Folder Options:
/// CLASSKEY = HKEY_CLASSES_ROOT\CLSID\{6DFD7C5C-2451-11d3-A299-00C04F8EF6AF}
/// DefaultIcon = %SystemRoot%\system32\SHELL32.dll,-210

View file

@ -22,26 +22,10 @@
#include "precomp.h"
#define MAX_PROPERTY_SHEET_PAGE 32
WINE_DEFAULT_DEBUG_CHANNEL(shell);
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
static BOOL CALLBACK
AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
{
PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam;
if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE)
{
pHeader->phpage[pHeader->nPages++] = hPage;
return TRUE;
}
return FALSE;
}
static UINT
LoadPropSheetHandlers(LPCWSTR pwszPath, PROPSHEETHEADERW *pHeader, UINT cMaxPages, HPSXA *phpsxa, IDataObject *pDataObj)
{

View file

@ -24,8 +24,6 @@
#include <mmsystem.h>
#include <ntquery.h>
#define MAX_PROPERTY_SHEET_PAGE 32
WINE_DEFAULT_DEBUG_CHANNEL(CRecycleBin);
typedef struct

View file

@ -93,4 +93,22 @@ extern const GUID CLSID_UnixDosFolder;
extern const GUID SHELL32_AdvtShortcutProduct;
extern const GUID SHELL32_AdvtShortcutComponent;
#define MAX_PROPERTY_SHEET_PAGE 32
extern inline
BOOL
CALLBACK
AddPropSheetPageCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
{
PROPSHEETHEADERW *pHeader = (PROPSHEETHEADERW *)lParam;
if (pHeader->nPages < MAX_PROPERTY_SHEET_PAGE)
{
pHeader->phpage[pHeader->nPages++] = hPage;
return TRUE;
}
return FALSE;
}
#endif /* _PRECOMP_H__ */