Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
573969cd
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
1 年多 前同步成功
通知
10
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
573969cd
编写于
8月 02, 2005
作者:
A
Andy Polyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Abstain from GUI calls in rand_win.c in NT service context.
上级
34be0bb1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
29 deletion
+21
-29
crypto/rand/rand_win.c
crypto/rand/rand_win.c
+21
-29
未找到文件。
crypto/rand/rand_win.c
浏览文件 @
573969cd
...
...
@@ -167,7 +167,7 @@ typedef DWORD (WINAPI *GETQUEUESTATUS)(UINT);
typedef
HANDLE
(
WINAPI
*
CREATETOOLHELP32SNAPSHOT
)(
DWORD
,
DWORD
);
typedef
BOOL
(
WINAPI
*
CLOSETOOLHELP32SNAPSHOT
)(
HANDLE
);
typedef
BOOL
(
WINAPI
*
HEAP32FIRST
)(
LPHEAPENTRY32
,
DWORD
,
DWORD
);
typedef
BOOL
(
WINAPI
*
HEAP32FIRST
)(
LPHEAPENTRY32
,
DWORD
,
ULONG_PTR
);
typedef
BOOL
(
WINAPI
*
HEAP32NEXT
)(
LPHEAPENTRY32
);
typedef
BOOL
(
WINAPI
*
HEAP32LIST
)(
HANDLE
,
LPHEAPLIST32
);
typedef
BOOL
(
WINAPI
*
PROCESS32
)(
HANDLE
,
LPPROCESSENTRY32
);
...
...
@@ -195,21 +195,8 @@ int RAND_poll(void)
HCRYPTPROV
hProvider
=
0
;
BYTE
buf
[
64
];
DWORD
w
;
HWND
h
;
int
good
=
0
;
HMODULE
advapi
,
kernel
,
user
,
netapi
;
CRYPTACQUIRECONTEXTW
acquire
=
0
;
CRYPTGENRANDOM
gen
=
0
;
CRYPTRELEASECONTEXT
release
=
0
;
#if 1
/* There was previously a problem with NETSTATGET. Currently, this
* section is still experimental, but if all goes well, this conditional
* will be removed
*/
NETSTATGET
netstatget
=
0
;
NETFREE
netfree
=
0
;
#endif
/* 1 */
/* Determine the OS version we are on so we can turn off things
* that do not work properly.
*/
...
...
@@ -246,17 +233,18 @@ int RAND_poll(void)
* implement own shim routine, which would accept ANSI argument
* and expand it to Unicode.
*/
{
/* load functions dynamically - not available on all systems */
advapi
=
LoadLibrary
(
TEXT
(
"ADVAPI32.DLL"
));
kernel
=
LoadLibrary
(
TEXT
(
"KERNEL32.DLL"
));
user
=
LoadLibrary
(
TEXT
(
"USER32.DLL"
));
netapi
=
LoadLibrary
(
TEXT
(
"NETAPI32.DLL"
));
#if 1
/* There was previously a problem with NETSTATGET. Currently, this
* section is still experimental, but if all goes well, this conditional
* will be removed
*/
HMODULE
advapi
=
LoadLibrary
(
TEXT
(
"ADVAPI32.DLL"
));
HMODULE
kernel
=
LoadLibrary
(
TEXT
(
"KERNEL32.DLL"
));
HMODULE
user
=
NULL
;
HMODULE
netapi
=
LoadLibrary
(
TEXT
(
"NETAPI32.DLL"
));
CRYPTACQUIRECONTEXTW
acquire
=
NULL
;
CRYPTGENRANDOM
gen
=
NULL
;
CRYPTRELEASECONTEXT
release
=
NULL
;
NETSTATGET
netstatget
=
NULL
;
NETFREE
netfree
=
NULL
;
if
(
netapi
)
{
netstatget
=
(
NETSTATGET
)
GetProcAddress
(
netapi
,
"NetStatisticsGet"
);
...
...
@@ -286,7 +274,6 @@ int RAND_poll(void)
if
(
netapi
)
FreeLibrary
(
netapi
);
#endif
/* 1 */
/* It appears like this can cause an exception deep within ADVAPI32.DLL
* at random times on Windows 2000. Reported by Jeffrey Altman.
...
...
@@ -394,7 +381,9 @@ int RAND_poll(void)
if
(
advapi
)
FreeLibrary
(
advapi
);
if
(
user
)
if
((
osverinfo
.
dwPlatformId
!=
VER_PLATFORM_WIN32_NT
||
!
OPENSSL_isservice
())
&&
(
user
=
LoadLibrary
(
TEXT
(
"USER32.DLL"
))))
{
GETCURSORINFO
cursor
;
GETFOREGROUNDWINDOW
win
;
...
...
@@ -407,7 +396,7 @@ int RAND_poll(void)
if
(
win
)
{
/* window handle */
h
=
win
();
HWND
h
=
win
();
RAND_add
(
&
h
,
sizeof
(
h
),
0
);
}
if
(
cursor
)
...
...
@@ -570,6 +559,7 @@ int RAND_poll(void)
FreeLibrary
(
kernel
);
}
}
#endif
/* !OPENSSL_SYS_WINCE */
/* timer data */
...
...
@@ -633,8 +623,7 @@ int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
void
RAND_screen
(
void
)
/* function available for backward compatibility */
{
RAND_poll
();
if
(
GetVersion
()
>=
0x80000000
||
!
OPENSSL_isservice
())
readscreen
();
readscreen
();
}
...
...
@@ -710,6 +699,9 @@ static void readscreen(void)
int
y
;
/* y-coordinate of screen lines to grab */
int
n
=
16
;
/* number of screen lines to grab at a time */
if
(
GetVersion
()
>=
0x80000000
||
!
OPENSSL_isservice
())
return
;
/* Create a screen DC and a memory DC compatible to screen DC */
hScrDC
=
CreateDC
(
TEXT
(
"DISPLAY"
),
NULL
,
NULL
,
NULL
);
hMemDC
=
CreateCompatibleDC
(
hScrDC
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录