Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
37766c22
Commit
37766c22
authored
2 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
We don't need to dynamically load [GS]etConsoleMode()
parent
3b7d4567
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#8161
passed
2 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/conio/Common.gmake
+1
-0
1 addition, 0 deletions
src/conio/Common.gmake
src/conio/win32cio.c
+4
-55
4 additions, 55 deletions
src/conio/win32cio.c
with
5 additions
and
55 deletions
src/conio/Common.gmake
+
1
−
0
View file @
37766c22
...
...
@@ -59,6 +59,7 @@ ifndef win
CIOLIB-MT_CFLAGS += -DDISABLE_X11=1 -DNO_X
endif
else
CIOLIB-MT_LIBS += -lkernel32
NO_X := 1
CIOLIB-MT_CFLAGS += -DDISABLE_X11=1 -DNO_X
ifndef WITHOUT_GDI
...
...
This diff is collapsed.
Click to expand it.
src/conio/win32cio.c
+
4
−
55
View file @
37766c22
...
...
@@ -522,12 +522,6 @@ static CONSOLE_SCREEN_BUFFER_INFOEX orig_sbiex = {
};
static
void
*
win32_suspendbuf
=
NULL
;
#ifndef CONSOLE_FULLSCREEN_MODE
/* SetConsoleDisplayMode parameter value */
#define CONSOLE_FULLSCREEN_MODE 1 // Text is displayed in full-screen mode.
#define CONSOLE_WINDOWED_MODE 2 // Text is displayed in a console window.
#endif
static
DWORD
orig_display_mode
=
0
;
/*-----------------------------------------------------------------------------
...
...
@@ -554,61 +548,16 @@ Remarks:
-----------------------------------------------------------------------------*/
BOOL
NT_SetConsoleDisplayMode
(
HANDLE
hOutputHandle
,
DWORD
dwNewMode
)
{
typedef
BOOL
(
WINAPI
*
SCDMProc_t
)
(
HANDLE
,
DWORD
,
LPDWORD
);
SCDMProc_t
SetConsoleDisplayMode
;
HMODULE
hKernel32
;
BOOL
ret
;
const
char
KERNEL32_NAME
[]
=
"kernel32.dll"
;
hKernel32
=
LoadLibraryA
(
KERNEL32_NAME
);
if
(
hKernel32
==
NULL
)
return
FALSE
;
SetConsoleDisplayMode
=
(
SCDMProc_t
)
GetProcAddress
(
hKernel32
,
"SetConsoleDisplayMode"
);
if
(
SetConsoleDisplayMode
==
NULL
)
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
ret
=
FALSE
;
}
else
{
DWORD
dummy
=
0
;
ret
=
SetConsoleDisplayMode
(
hOutputHandle
,
dwNewMode
,
&
dummy
);
dprintf
(
"SetConsoleDisplayMode(%d) returned %d"
,
dwNewMode
,
ret
);
}
FreeLibrary
(
hKernel32
);
BOOL
ret
=
SetConsoleDisplayMode
(
hOutputHandle
,
dwNewMode
,
NULL
);
dprintf
(
"SetConsoleDisplayMode(%d) returned %d"
,
dwNewMode
,
ret
);
return
ret
;
}
BOOL
NT_GetConsoleDisplayMode
(
DWORD
*
mode
)
{
typedef
BOOL
(
WINAPI
*
GCDMProc_t
)
(
LPDWORD
);
GCDMProc_t
GetConsoleDisplayMode
;
HMODULE
hKernel32
;
BOOL
ret
;
const
char
KERNEL32_NAME
[]
=
"kernel32.dll"
;
hKernel32
=
LoadLibraryA
(
KERNEL32_NAME
);
if
(
hKernel32
==
NULL
)
return
FALSE
;
GetConsoleDisplayMode
=
(
GCDMProc_t
)
GetProcAddress
(
hKernel32
,
"GetConsoleDisplayMode"
);
if
(
GetConsoleDisplayMode
==
NULL
)
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
ret
=
FALSE
;
}
else
{
ret
=
GetConsoleDisplayMode
(
mode
);
dprintf
(
"GetConsoleDisplayMode() returned %d (%d)"
,
ret
,
*
mode
);
}
FreeLibrary
(
hKernel32
);
BOOL
ret
=
GetConsoleDisplayMode
(
mode
);
dprintf
(
"GetConsoleDisplayMode() returned %d (%d)"
,
ret
,
*
mode
);
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment