reactos操作系统实现(161)
来源:互联网 发布:什么是字符型数据 编辑:程序博客网 时间:2024/05/02 22:49
NtUserCreateWindowEx函数主要用来创建一个窗口显示。在Win32k.sys里的代码如下:
#001 HWND APIENTRY
#002 NtUserCreateWindowEx(DWORD dwExStyle,
#003 PUNICODE_STRINGUnsafeClassName,
#004 PUNICODE_STRINGUnsafeWindowName,
#005 DWORD dwStyle,
#006 LONG x,
#007 LONG y,
#008 LONG nWidth,
#009 LONG nHeight,
#010 HWND hWndParent,
#011 HMENU hMenu,
#012 HINSTANCE hInstance,
#013 LPVOID lpParam,
#014 DWORD dwShowMode,
#015 BOOL bUnicodeWindow,
#016 DWORD dwUnknown)
#017 {
#018 NTSTATUS Status;
#019 UNICODE_STRING WindowName;
#020 UNICODE_STRING ClassName;
#021 HWND NewWindow;
#022 DECLARE_RETURN(HWND);
#023
#024 DPRINT("Enter NtUserCreateWindowEx():(%d,%d-%d,%d)/n", x, y, nWidth, nHeight);
用户界面临界区进入。
#025 UserEnterExclusive();
#026
获取窗口类的名称。
#027 /* Get the class name (string or atom) */
#028 Status = MmCopyFromCaller(&ClassName,UnsafeClassName, sizeof(UNICODE_STRING));
#029 if (! NT_SUCCESS(Status))
#030 {
#031 SetLastNtError(Status);
#032 RETURN( NULL);
#033 }
#034 if (ClassName.Length != 0)
#035 {
#036 Status =IntSafeCopyUnicodeStringTerminateNULL(&ClassName, UnsafeClassName);
#037 if (! NT_SUCCESS(Status))
#038 {
#039 SetLastNtError(Status);
#040 RETURN( NULL);
#041 }
#042 }
#043 else if (! IS_ATOM(ClassName.Buffer))
#044 {
#045 SetLastWin32Error(ERROR_INVALID_PARAMETER);
#046 RETURN(NULL);
#047 }
#048
拷贝窗口的名称。
#049 /* safely copy the window name */
#050 if (NULL != UnsafeWindowName)
#051 {
#052 Status =IntSafeCopyUnicodeString(&WindowName, UnsafeWindowName);
#053 if (! NT_SUCCESS(Status))
#054 {
#055 if (! IS_ATOM(ClassName.Buffer))
#056 {
#057 ExFreePoolWithTag(ClassName.Buffer, TAG_STRING);
#058 }
#059 SetLastNtError(Status);
#060 RETURN( NULL);
#061 }
#062 }
#063 else
#064 {
#065 RtlInitUnicodeString(&WindowName,NULL);
#066 }
#067
调用函数co_IntCreateWindowEx来创建窗口。
#068 NewWindow =co_IntCreateWindowEx(dwExStyle, &ClassName, &WindowName, dwStyle, x, y,nWidth, nHeight,
#069 hWndParent, hMenu, hInstance, lpParam, dwShowMode, bUnicodeWindow);
#070
清空窗口名称和窗口类名称的缓冲区。
#071 if (WindowName.Buffer)
#072 {
#073 ExFreePoolWithTag(WindowName.Buffer,TAG_STRING);
#074 }
#075 if (! IS_ATOM(ClassName.Buffer))
#076 {
#077 ExFreePoolWithTag(ClassName.Buffer,TAG_STRING);
#078 }
#079
返回创建的新窗口。
#080 RETURN( NewWindow);
#081
#082 CLEANUP:
#083 DPRINT("Leave NtUserCreateWindowEx,ret=%i/n",_ret_);
#084 UserLeave();
#085 END_CLEANUP;
#086 }
#087
- reactos操作系统实现(161)
- reactos操作系统实现(1)
- reactos操作系统实现(2)
- reactos操作系统实现(3)
- reactos操作系统实现(4)
- reactos操作系统实现(5)
- reactos操作系统实现(6)
- reactos操作系统实现(7)
- reactos操作系统实现(8)
- reactos操作系统实现(9)
- reactos操作系统实现(10)
- reactos操作系统实现(11)
- reactos操作系统实现(12)
- reactos操作系统实现(13)
- reactos操作系统实现(14)
- reactos操作系统实现(15)
- reactos操作系统实现(16)
- reactos操作系统实现(17)
- Java私塾中级视频——Eclipse快捷键总结
- Linux内联汇编
- oralce 生成10万条测试数据的sql语句
- 决定!
- 图算法_普通广度优先搜索(BFS)解八数码问题_C语言
- reactos操作系统实现(161)
- 我需要
- VS 2010之多显示器支持 / Multi-Monitor Support (VS 2010 and .NET 4 Series)
- window.open一个新窗口后,用document.writeln写入时的编码设定
- 图示虚拟机virtualbox在Ubuntu下的安装使用(1)
- 文章标题
- 表单验证【待续】
- Jabber 协议 概述
- SQL语句中的HAVING关键字