comdlg32: Constify some variables.

This commit is contained in:
Andrew Talbot 2007-04-04 22:22:44 +01:00 committed by Alexandre Julliard
parent fc5f6d4bdc
commit 918c9d9ac1
4 changed files with 39 additions and 39 deletions

View File

@ -3580,7 +3580,7 @@ static BOOL CALLBACK FD32_Init(LPARAM lParam, PFD31_DATA lfs, DWORD data)
* *
* called from the common 16/32 code to call the appropriate hook * called from the common 16/32 code to call the appropriate hook
*/ */
static BOOL CALLBACK FD32_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wParam, static BOOL CALLBACK FD32_CallWindowProc(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
BOOL ret; BOOL ret;
@ -3608,7 +3608,7 @@ static BOOL CALLBACK FD32_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wPara
* FD32_UpdateResult [internal] * FD32_UpdateResult [internal]
* update the real client structures if any * update the real client structures if any
*/ */
static void CALLBACK FD32_UpdateResult(PFD31_DATA lfs) static void CALLBACK FD32_UpdateResult(const FD31_DATA *lfs)
{ {
PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632; PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -3628,7 +3628,7 @@ static void CALLBACK FD32_UpdateResult(PFD31_DATA lfs)
* FD32_UpdateFileTitle [internal] * FD32_UpdateFileTitle [internal]
* update the real client structures if any * update the real client structures if any
*/ */
static void CALLBACK FD32_UpdateFileTitle(PFD31_DATA lfs) static void CALLBACK FD32_UpdateFileTitle(const FD31_DATA *lfs)
{ {
PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632; PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -3646,7 +3646,7 @@ static void CALLBACK FD32_UpdateFileTitle(PFD31_DATA lfs)
* FD32_SendLbGetCurSel [internal] * FD32_SendLbGetCurSel [internal]
* retrieve selected listbox item * retrieve selected listbox item
*/ */
static LRESULT CALLBACK FD32_SendLbGetCurSel(PFD31_DATA lfs) static LRESULT CALLBACK FD32_SendLbGetCurSel(const FD31_DATA *lfs)
{ {
return SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0); return SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL, 0, 0);
} }
@ -3656,7 +3656,7 @@ static LRESULT CALLBACK FD32_SendLbGetCurSel(PFD31_DATA lfs)
* FD32_Destroy [internal] * FD32_Destroy [internal]
* called from the common 16/32 code to cleanup 32 bit data * called from the common 16/32 code to cleanup 32 bit data
*/ */
static void CALLBACK FD32_Destroy(PFD31_DATA lfs) static void CALLBACK FD32_Destroy(const FD31_DATA *lfs)
{ {
PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632; PFD32_PRIVATE priv = (PFD32_PRIVATE) lfs->private1632;

View File

@ -46,7 +46,7 @@ typedef struct tagFD16_PRIVATE
* FD16_MapOfnStruct16 [internal] * FD16_MapOfnStruct16 [internal]
* map a 16 bits structure to an Unicode one * map a 16 bits structure to an Unicode one
*/ */
static void FD16_MapOfnStruct16(LPOPENFILENAME16 ofn16, LPOPENFILENAMEW ofnW, BOOL open) static void FD16_MapOfnStruct16(const OPENFILENAME16 *ofn16, LPOPENFILENAMEW ofnW, BOOL open)
{ {
OPENFILENAMEA ofnA; OPENFILENAMEA ofnA;
/* first convert to linear pointers */ /* first convert to linear pointers */
@ -85,7 +85,7 @@ static void FD16_MapOfnStruct16(LPOPENFILENAME16 ofn16, LPOPENFILENAMEW ofnW, BO
* by a 16 bits application * by a 16 bits application
* *
*/ */
static BOOL FD16_GetTemplate(PFD31_DATA lfs) static BOOL FD16_GetTemplate(const FD31_DATA *lfs)
{ {
PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632; PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632;
LPOPENFILENAME16 ofn16 = priv->ofn16; LPOPENFILENAME16 ofn16 = priv->ofn16;
@ -183,7 +183,7 @@ static BOOL CALLBACK FD16_Init(LPARAM lParam, PFD31_DATA lfs, DWORD data)
* *
* called from the common 16/32 code to call the appropriate hook * called from the common 16/32 code to call the appropriate hook
*/ */
static BOOL CALLBACK FD16_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wParam, static BOOL CALLBACK FD16_CallWindowProc(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632; PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632;
@ -202,7 +202,7 @@ static BOOL CALLBACK FD16_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wPara
* FD31_UpdateResult [internal] * FD31_UpdateResult [internal]
* update the real client structures * update the real client structures
*/ */
static void CALLBACK FD16_UpdateResult(PFD31_DATA lfs) static void CALLBACK FD16_UpdateResult(const FD31_DATA *lfs)
{ {
PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632; PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -238,7 +238,7 @@ static void CALLBACK FD16_UpdateResult(PFD31_DATA lfs)
* FD16_UpdateFileTitle [internal] * FD16_UpdateFileTitle [internal]
* update the real client structures * update the real client structures
*/ */
static void CALLBACK FD16_UpdateFileTitle(PFD31_DATA lfs) static void CALLBACK FD16_UpdateFileTitle(const FD31_DATA *lfs)
{ {
PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632; PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -257,7 +257,7 @@ static void CALLBACK FD16_UpdateFileTitle(PFD31_DATA lfs)
* FD16_SendLbGetCurSel [internal] * FD16_SendLbGetCurSel [internal]
* retrieve selected listbox item * retrieve selected listbox item
*/ */
static LRESULT CALLBACK FD16_SendLbGetCurSel(PFD31_DATA lfs) static LRESULT CALLBACK FD16_SendLbGetCurSel(const FD31_DATA *lfs)
{ {
return SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL16, 0, 0); return SendDlgItemMessageW(lfs->hwnd, lst1, LB_GETCURSEL16, 0, 0);
} }
@ -267,7 +267,7 @@ static LRESULT CALLBACK FD16_SendLbGetCurSel(PFD31_DATA lfs)
* FD16_Destroy [internal] * FD16_Destroy [internal]
* called from the common 16/32 code to cleanup 32 bit data * called from the common 16/32 code to cleanup 32 bit data
*/ */
static void CALLBACK FD16_Destroy(PFD31_DATA lfs) static void CALLBACK FD16_Destroy(const FD31_DATA *lfs)
{ {
PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632; PFD16_PRIVATE priv = (PFD16_PRIVATE) lfs->private1632;
@ -299,7 +299,7 @@ static void FD16_SetupCallbacks(PFD31_CALLBACKS callbacks)
* FD16_MapDrawItemStruct [internal] * FD16_MapDrawItemStruct [internal]
* map a 16 bits drawitem struct to 32 * map a 16 bits drawitem struct to 32
*/ */
static void FD16_MapDrawItemStruct(LPDRAWITEMSTRUCT16 lpdis16, LPDRAWITEMSTRUCT lpdis) static void FD16_MapDrawItemStruct(const DRAWITEMSTRUCT16 *lpdis16, LPDRAWITEMSTRUCT lpdis)
{ {
lpdis->CtlType = lpdis16->CtlType; lpdis->CtlType = lpdis16->CtlType;
lpdis->CtlID = lpdis16->CtlID; lpdis->CtlID = lpdis16->CtlID;

View File

@ -107,7 +107,7 @@ static void FD31_StripEditControl(HWND hwnd)
* *
* Call the appropriate hook * Call the appropriate hook
*/ */
BOOL FD31_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wParam, BOOL FD31_CallWindowProc(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
return lfs->callbacks->CWP(lfs, wMsg, wParam, lParam); return lfs->callbacks->CWP(lfs, wMsg, wParam, lParam);
@ -116,7 +116,7 @@ BOOL FD31_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wParam,
/*********************************************************************** /***********************************************************************
* FD31_ScanDir [internal] * FD31_ScanDir [internal]
*/ */
static BOOL FD31_ScanDir(HWND hWnd, LPWSTR newPath) static BOOL FD31_ScanDir(HWND hWnd, LPCWSTR newPath)
{ {
WCHAR buffer[BUFFILE]; WCHAR buffer[BUFFILE];
HWND hdlg, hdlgDir; HWND hdlg, hdlgDir;
@ -194,7 +194,7 @@ static LPCWSTR FD31_GetFileType(LPCWSTR cfptr, LPCWSTR fptr, const WORD index)
* FD31_WMDrawItem [internal] * FD31_WMDrawItem [internal]
*/ */
LONG FD31_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, LONG FD31_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
int savedlg, LPDRAWITEMSTRUCT lpdis) int savedlg, const DRAWITEMSTRUCT *lpdis)
{ {
WCHAR *str; WCHAR *str;
HICON hIcon; HICON hIcon;
@ -299,7 +299,7 @@ LONG FD31_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
* FD31_UpdateResult [internal] * FD31_UpdateResult [internal]
* update the displayed file name (with path) * update the displayed file name (with path)
*/ */
static void FD31_UpdateResult(PFD31_DATA lfs, WCHAR *tmpstr) static void FD31_UpdateResult(const FD31_DATA *lfs, const WCHAR *tmpstr)
{ {
int lenstr2; int lenstr2;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -337,7 +337,7 @@ static void FD31_UpdateResult(PFD31_DATA lfs, WCHAR *tmpstr)
* FD31_UpdateFileTitle [internal] * FD31_UpdateFileTitle [internal]
* update the displayed file name (without path) * update the displayed file name (without path)
*/ */
static void FD31_UpdateFileTitle(PFD31_DATA lfs) static void FD31_UpdateFileTitle(const FD31_DATA *lfs)
{ {
LONG lRet; LONG lRet;
LPOPENFILENAMEW ofnW = lfs->ofnW; LPOPENFILENAMEW ofnW = lfs->ofnW;
@ -353,7 +353,7 @@ static void FD31_UpdateFileTitle(PFD31_DATA lfs)
/*********************************************************************** /***********************************************************************
* FD31_DirListDblClick [internal] * FD31_DirListDblClick [internal]
*/ */
static LRESULT FD31_DirListDblClick( PFD31_DATA lfs ) static LRESULT FD31_DirListDblClick( const FD31_DATA *lfs )
{ {
LONG lRet; LONG lRet;
HWND hWnd = lfs->hwnd; HWND hWnd = lfs->hwnd;
@ -391,7 +391,7 @@ static LRESULT FD31_DirListDblClick( PFD31_DATA lfs )
* FD31_FileListSelect [internal] * FD31_FileListSelect [internal]
* called when a new item is picked in the file list * called when a new item is picked in the file list
*/ */
static LRESULT FD31_FileListSelect( PFD31_DATA lfs ) static LRESULT FD31_FileListSelect( const FD31_DATA *lfs )
{ {
LONG lRet; LONG lRet;
HWND hWnd = lfs->hwnd; HWND hWnd = lfs->hwnd;
@ -424,7 +424,7 @@ static LRESULT FD31_FileListSelect( PFD31_DATA lfs )
* before accepting the file name, test if it includes wild cards * before accepting the file name, test if it includes wild cards
* tries to scan the directory and returns TRUE if no error. * tries to scan the directory and returns TRUE if no error.
*/ */
static LRESULT FD31_TestPath( PFD31_DATA lfs, LPWSTR path ) static LRESULT FD31_TestPath( const FD31_DATA *lfs, LPWSTR path )
{ {
HWND hWnd = lfs->hwnd; HWND hWnd = lfs->hwnd;
LPWSTR pBeginFileName, pstr2; LPWSTR pBeginFileName, pstr2;
@ -493,7 +493,7 @@ static LRESULT FD31_TestPath( PFD31_DATA lfs, LPWSTR path )
* FD31_Validate [internal] * FD31_Validate [internal]
* called on: click Ok button, Enter in edit, DoubleClick in file list * called on: click Ok button, Enter in edit, DoubleClick in file list
*/ */
static LRESULT FD31_Validate( PFD31_DATA lfs, LPWSTR path, UINT control, INT itemIndex, static LRESULT FD31_Validate( const FD31_DATA *lfs, LPCWSTR path, UINT control, INT itemIndex,
BOOL internalUse ) BOOL internalUse )
{ {
LONG lRet; LONG lRet;
@ -557,7 +557,7 @@ static LRESULT FD31_Validate( PFD31_DATA lfs, LPWSTR path, UINT control, INT ite
* FD31_DiskChange [internal] * FD31_DiskChange [internal]
* called when a new item is picked in the disk selection combo * called when a new item is picked in the disk selection combo
*/ */
static LRESULT FD31_DiskChange( PFD31_DATA lfs ) static LRESULT FD31_DiskChange( const FD31_DATA *lfs )
{ {
LONG lRet; LONG lRet;
HWND hWnd = lfs->hwnd; HWND hWnd = lfs->hwnd;
@ -581,7 +581,7 @@ static LRESULT FD31_DiskChange( PFD31_DATA lfs )
* FD31_FileTypeChange [internal] * FD31_FileTypeChange [internal]
* called when a new item is picked in the file type combo * called when a new item is picked in the file type combo
*/ */
static LRESULT FD31_FileTypeChange( PFD31_DATA lfs ) static LRESULT FD31_FileTypeChange( const FD31_DATA *lfs )
{ {
LONG lRet; LONG lRet;
LPWSTR pstr; LPWSTR pstr;
@ -600,7 +600,7 @@ static LRESULT FD31_FileTypeChange( PFD31_DATA lfs )
* FD31_WMCommand [internal] * FD31_WMCommand [internal]
*/ */
LRESULT FD31_WMCommand(HWND hWnd, LPARAM lParam, UINT notification, LRESULT FD31_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
UINT control, PFD31_DATA lfs ) UINT control, const FD31_DATA *lfs )
{ {
switch (control) switch (control)
{ {
@ -754,7 +754,7 @@ void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, BOOL op
* FD31_FreeOfnW [internal] * FD31_FreeOfnW [internal]
* Undo all allocations done by FD31_MapOfnStructA * Undo all allocations done by FD31_MapOfnStructA
*/ */
void FD31_FreeOfnW(LPOPENFILENAMEW ofnW) void FD31_FreeOfnW(const OPENFILENAMEW *ofnW)
{ {
HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrFilter); HeapFree(GetProcessHeap(), 0, (LPWSTR) ofnW->lpstrFilter);
HeapFree(GetProcessHeap(), 0, ofnW->lpstrCustomFilter); HeapFree(GetProcessHeap(), 0, ofnW->lpstrCustomFilter);

View File

@ -22,20 +22,20 @@
#define FD31_OFN_PROP "FILEDLG_OFN" #define FD31_OFN_PROP "FILEDLG_OFN"
/* Forward declare */ /* Forward declare */
typedef struct tagFD31_DATA *PFD31_DATA; typedef struct tagFD31_DATA FD31_DATA, *PFD31_DATA;
typedef struct tagFD31_CALLBACKS typedef struct tagFD31_CALLBACKS
{ {
BOOL (CALLBACK *Init)(LPARAM lParam, PFD31_DATA lfs, DWORD data); BOOL (CALLBACK *Init)(LPARAM lParam, PFD31_DATA lfs, DWORD data);
BOOL (CALLBACK *CWP)(PFD31_DATA lfs, UINT wMsg, WPARAM wParam, BOOL (CALLBACK *CWP)(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam,
LPARAM lParam); /* CWP instead of CallWindowProc to avoid macro expansion */ LPARAM lParam); /* CWP instead of CallWindowProc to avoid macro expansion */
void (CALLBACK *UpdateResult)(PFD31_DATA lfs); void (CALLBACK *UpdateResult)(const FD31_DATA *lfs);
void (CALLBACK *UpdateFileTitle)(PFD31_DATA lfs); void (CALLBACK *UpdateFileTitle)(const FD31_DATA *lfs);
LRESULT (CALLBACK *SendLbGetCurSel)(PFD31_DATA lfs); LRESULT (CALLBACK *SendLbGetCurSel)(const FD31_DATA *lfs);
void (CALLBACK *Destroy)(PFD31_DATA lfs); void (CALLBACK *Destroy)(const FD31_DATA *lfs);
} FD31_CALLBACKS, *PFD31_CALLBACKS; } FD31_CALLBACKS, *PFD31_CALLBACKS;
typedef struct tagFD31_DATA struct tagFD31_DATA
{ {
HWND hwnd; /* file dialog window handle */ HWND hwnd; /* file dialog window handle */
BOOL hook; /* TRUE if the dialog is hooked */ BOOL hook; /* TRUE if the dialog is hooked */
@ -48,21 +48,21 @@ typedef struct tagFD31_DATA
a W copy for A/16 API */ a W copy for A/16 API */
LPVOID private1632; /* 16/32 bit caller private data */ LPVOID private1632; /* 16/32 bit caller private data */
PFD31_CALLBACKS callbacks; /* callbacks to handle 16/32 bit differences */ PFD31_CALLBACKS callbacks; /* callbacks to handle 16/32 bit differences */
} FD31_DATA; };
extern BOOL FD31_Init(void); extern BOOL FD31_Init(void);
extern PFD31_DATA FD31_AllocPrivate(LPARAM lParam, UINT dlgType, extern PFD31_DATA FD31_AllocPrivate(LPARAM lParam, UINT dlgType,
PFD31_CALLBACKS callbacks, DWORD data); PFD31_CALLBACKS callbacks, DWORD data);
extern void FD31_DestroyPrivate(PFD31_DATA lfs); extern void FD31_DestroyPrivate(PFD31_DATA lfs);
extern void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, BOOL open); extern void FD31_MapOfnStructA(const OPENFILENAMEA *ofnA, LPOPENFILENAMEW ofnW, BOOL open);
extern void FD31_FreeOfnW(LPOPENFILENAMEW ofnW); extern void FD31_FreeOfnW(const OPENFILENAMEW *ofnW);
extern BOOL FD31_CallWindowProc(PFD31_DATA lfs, UINT wMsg, WPARAM wParam, extern BOOL FD31_CallWindowProc(const FD31_DATA *lfs, UINT wMsg, WPARAM wParam,
LPARAM lParam); LPARAM lParam);
extern LONG FD31_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam); extern LONG FD31_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam);
extern LONG FD31_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam, extern LONG FD31_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,
int savedlg, LPDRAWITEMSTRUCT lpdis); int savedlg, const DRAWITEMSTRUCT *lpdis);
extern LRESULT FD31_WMCommand(HWND hWnd, LPARAM lParam, UINT notification, extern LRESULT FD31_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
UINT control, PFD31_DATA lfs); UINT control, const FD31_DATA *lfs);
extern int FD31_GetFldrHeight(void); extern int FD31_GetFldrHeight(void);
#endif /* _WINE_DLL_FILEDLG31_H */ #endif /* _WINE_DLL_FILEDLG31_H */