Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
358cc8b0
Commit
358cc8b0
authored
Dec 03, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use delayed imports instead of explicit GetProcAddress calls.
parent
6f1a7da4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
294 deletions
+1
-294
Makefile.in
programs/regedit/Makefile.in
+1
-0
main.c
programs/regedit/main.c
+0
-118
main.h
programs/regedit/main.h
+0
-176
No files found.
programs/regedit/Makefile.in
View file @
358cc8b0
...
...
@@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE
=
regedit.exe
APPMODE
=
gui
IMPORTS
=
msvcrt advapi32 kernel32
DELAYIMPORTS
=
comdlg32 comctl32 user32 gdi32
EXTRAINCL
=
-I
$(TOPSRCDIR)
/include/msvcrt
EXTRADEFS
=
-DNO_LIBWINE_PORT
...
...
programs/regedit/main.c
View file @
358cc8b0
...
...
@@ -53,120 +53,6 @@ TCHAR szChildClass[MAX_LOADSTRING];
/*******************************************************************************
*
* FUNCTION: DynamicBind( void )
*
* PURPOSE: Binds all functions dependent on user32.dll
*/
static
BOOL
DynamicBind
(
void
)
{
HMODULE
dll
;
#define d(x) \
p##x = (typeof (x) ) GetProcAddress( dll, #x ); \
if( ! p##x ) \
{ \
fprintf(stderr,"failed to bind function at line %d\n",__LINE__); \
return FALSE; \
} \
dll
=
LoadLibrary
(
"user32"
);
if
(
!
dll
)
return
FALSE
;
d
(
BeginDeferWindowPos
)
d
(
BeginPaint
)
d
(
CallWindowProcA
)
d
(
CheckMenuItem
)
d
(
CloseClipboard
)
d
(
CreateWindowExA
)
d
(
DefWindowProcA
)
d
(
DeferWindowPos
)
d
(
DestroyMenu
)
d
(
DestroyWindow
)
d
(
DialogBoxParamA
)
d
(
DispatchMessageA
)
d
(
EmptyClipboard
)
d
(
EndDeferWindowPos
)
d
(
EndDialog
)
d
(
EndPaint
)
d
(
FillRect
)
d
(
GetCapture
)
d
(
GetClientRect
)
d
(
GetCursorPos
)
d
(
GetDC
)
d
(
GetDlgItem
)
d
(
GetMenu
)
d
(
GetMessageA
)
d
(
GetSubMenu
)
d
(
GetSystemMetrics
)
d
(
GetWindowTextA
)
d
(
GetWindowTextLengthA
)
d
(
InvertRect
)
d
(
IsWindowVisible
)
d
(
LoadAcceleratorsA
)
d
(
LoadBitmapA
)
d
(
LoadCursorA
)
d
(
LoadIconA
)
d
(
LoadImageA
)
d
(
LoadMenuA
)
d
(
LoadStringA
)
d
(
MessageBeep
)
d
(
MessageBoxA
)
d
(
MoveWindow
)
d
(
OpenClipboard
)
d
(
PostQuitMessage
)
d
(
RegisterClassExA
)
d
(
RegisterClipboardFormatA
)
d
(
ReleaseCapture
)
d
(
ReleaseDC
)
d
(
ScreenToClient
)
d
(
SendMessageA
)
d
(
SetCapture
)
d
(
SetCursor
)
d
(
SetDlgItemTextA
)
d
(
SetFocus
)
d
(
SetWindowLongA
)
d
(
SetWindowTextA
)
d
(
ShowWindow
)
d
(
TranslateAcceleratorA
)
d
(
TranslateMessage
)
d
(
UpdateWindow
)
d
(
WinHelpA
)
d
(
wsprintfA
)
dll
=
LoadLibrary
(
"gdi32"
);
if
(
!
dll
)
return
FALSE
;
d
(
DeleteDC
)
d
(
DeleteObject
)
d
(
GetStockObject
)
dll
=
LoadLibrary
(
"comctl32"
);
if
(
!
dll
)
return
FALSE
;
d
(
CreateStatusWindowA
)
d
(
ImageList_Add
)
d
(
ImageList_Create
)
d
(
ImageList_GetImageCount
)
d
(
InitCommonControls
)
dll
=
LoadLibrary
(
"comdlg32"
);
if
(
!
dll
)
return
FALSE
;
d
(
CommDlgExtendedError
)
d
(
GetOpenFileNameA
)
d
(
GetSaveFileNameA
)
d
(
PrintDlgA
)
return
TRUE
;
}
/*******************************************************************************
*
*
* FUNCTION: InitInstance(HANDLE, int)
*
...
...
@@ -281,10 +167,6 @@ int APIENTRY WinMain(HINSTANCE hInstance,
return
0
;
}
if
(
!
DynamicBind
())
{
return
0
;
}
/* Initialize global strings */
LoadString
(
hInstance
,
IDS_APP_TITLE
,
szTitle
,
MAX_LOADSTRING
);
LoadString
(
hInstance
,
IDC_REGEDIT_FRAME
,
szFrameClass
,
MAX_LOADSTRING
);
...
...
programs/regedit/main.h
View file @
358cc8b0
...
...
@@ -21,11 +21,6 @@
#ifndef __MAIN_H__
#define __MAIN_H__
#ifdef __cplusplus
extern
"C"
{
#endif
#include "resource.h"
...
...
@@ -76,177 +71,6 @@ extern TCHAR szTitle[];
extern
TCHAR
szFrameClass
[];
extern
TCHAR
szChildClass
[];
/*******************************************************************************
* Dynamically load all things that depend on user32.dll
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "commdlg.h"
#ifdef REGEDIT_DECLARE_FUNCTIONS
#define d(x) typeof(x) *p##x = NULL;
#else
#define d(x) extern typeof(x) *p##x;
#endif
d
(
BeginDeferWindowPos
)
d
(
BeginPaint
)
d
(
CallWindowProcA
)
d
(
CheckMenuItem
)
d
(
CloseClipboard
)
d
(
CommDlgExtendedError
)
d
(
CreateStatusWindowA
)
d
(
CreateWindowExA
)
d
(
DefWindowProcA
)
d
(
DeferWindowPos
)
d
(
DeleteDC
)
d
(
DeleteObject
)
d
(
DestroyMenu
)
d
(
DestroyWindow
)
d
(
DialogBoxParamA
)
d
(
DispatchMessageA
)
d
(
EmptyClipboard
)
d
(
EndDeferWindowPos
)
d
(
EndPaint
)
d
(
EndDialog
)
d
(
FillRect
)
d
(
GetCapture
)
d
(
GetClientRect
)
d
(
GetCursorPos
)
d
(
GetDC
)
d
(
GetDlgItem
)
d
(
GetMenu
)
d
(
GetMessageA
)
d
(
GetOpenFileNameA
)
d
(
GetSaveFileNameA
)
d
(
GetStockObject
)
d
(
GetSubMenu
)
d
(
GetSystemMetrics
)
d
(
GetWindowTextA
)
d
(
GetWindowTextLengthA
)
d
(
ImageList_Add
)
d
(
ImageList_Create
)
d
(
ImageList_GetImageCount
)
d
(
InitCommonControls
)
d
(
InvertRect
)
d
(
IsWindowVisible
)
d
(
LoadAcceleratorsA
)
d
(
LoadBitmapA
)
d
(
LoadCursorA
)
d
(
LoadIconA
)
d
(
LoadImageA
)
d
(
LoadMenuA
)
d
(
LoadStringA
)
d
(
MessageBeep
)
d
(
MessageBoxA
)
d
(
MoveWindow
)
d
(
OpenClipboard
)
d
(
PostQuitMessage
)
d
(
PrintDlgA
)
d
(
RegisterClassExA
)
d
(
RegisterClipboardFormatA
)
d
(
ReleaseCapture
)
d
(
ReleaseDC
)
d
(
ScreenToClient
)
d
(
SendMessageA
)
d
(
SetCapture
)
d
(
SetCursor
)
d
(
SetDlgItemTextA
)
d
(
SetFocus
)
d
(
SetWindowLongA
)
d
(
SetWindowTextA
)
d
(
ShowWindow
)
d
(
TranslateAcceleratorA
)
d
(
TranslateMessage
)
d
(
UpdateWindow
)
d
(
WinHelpA
)
d
(
wsprintfA
)
#undef d
#define BeginDeferWindowPos pBeginDeferWindowPos
#define BeginPaint pBeginPaint
#define CallWindowProcA pCallWindowProcA
#define CheckMenuItem pCheckMenuItem
#define CloseClipboard pCloseClipboard
#define CommDlgExtendedError pCommDlgExtendedError
#define CreateStatusWindowA pCreateStatusWindowA
#define CreateWindowExA pCreateWindowExA
#define DefWindowProcA pDefWindowProcA
#define DeferWindowPos pDeferWindowPos
#define DeleteDC pDeleteDC
#define DeleteObject pDeleteObject
#define DestroyMenu pDestroyMenu
#define DestroyWindow pDestroyWindow
#define DialogBoxParamA pDialogBoxParamA
#define DispatchMessageA pDispatchMessageA
#define EmptyClipboard pEmptyClipboard
#define EndDeferWindowPos pEndDeferWindowPos
#define EndDialog pEndDialog
#define EndPaint pEndPaint
#define FillRect pFillRect
#define GetCapture pGetCapture
#define GetClientRect pGetClientRect
#define GetCursorPos pGetCursorPos
#define GetDC pGetDC
#define GetDlgItem pGetDlgItem
#define GetMenu pGetMenu
#define GetMessageA pGetMessageA
#define GetOpenFileNameA pGetOpenFileNameA
#define GetSaveFileNameA pGetSaveFileNameA
#define GetStockObject pGetStockObject
#define GetSubMenu pGetSubMenu
#define GetSystemMetrics pGetSystemMetrics
#define GetWindowTextA pGetWindowTextA
#define GetWindowTextLengthA pGetWindowTextLengthA
#define ImageList_Add pImageList_Add
#define ImageList_Create pImageList_Create
#define ImageList_GetImageCount pImageList_GetImageCount
#define InitCommonControls pInitCommonControls
#define InvertRect pInvertRect
#define IsWindowVisible pIsWindowVisible
#define LoadAcceleratorsA pLoadAcceleratorsA
#define LoadBitmapA pLoadBitmapA
#define LoadCursorA pLoadCursorA
#define LoadIconA pLoadIconA
#define LoadImageA pLoadImageA
#define LoadMenuA pLoadMenuA
#define LoadStringA pLoadStringA
#define MessageBeep pMessageBeep
#define MessageBoxA pMessageBoxA
#define MoveWindow pMoveWindow
#define OpenClipboard pOpenClipboard
#define PostQuitMessage pPostQuitMessage
#define PrintDlgA pPrintDlgA
#define RegisterClassExA pRegisterClassExA
#define RegisterClipboardFormatA pRegisterClipboardFormatA
#define ReleaseCapture pReleaseCapture
#define ReleaseDC pReleaseDC
#define ScreenToClient pScreenToClient
#define SendMessageA pSendMessageA
#define SetCapture pSetCapture
#define SetCursor pSetCursor
#define SetDlgItemTextA pSetDlgItemTextA
#define SetFocus pSetFocus
#define SetWindowLongA pSetWindowLongA
#define SetWindowTextA pSetWindowTextA
#define ShowWindow pShowWindow
#define TranslateAcceleratorA pTranslateAcceleratorA
#define TranslateMessage pTranslateMessage
#define UpdateWindow pUpdateWindow
#define WinHelpA pWinHelpA
#define wsprintfA pwsprintfA
#ifdef __cplusplus
};
#endif
/* about.c */
extern
void
ShowAboutBox
(
HWND
hWnd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment