Win32API 是否有 32 位版本和 64 位版本的区别?
Does Win32API differ 32bit version and 64bit version?
好像所有的Win32 API都是32位的版本,不管我的Windows安装的是32位还是64位。如果我调用 CreateWindow
,返回的 HANDLE 将是指向 _HANDLE
的指针,它是 struct {int unused;}
.
的结构
所以 32 位 Windows 和 64 位 Windows 都使用 Windows API 以 32 位方式管理资源,对吗?
如果是这样,那么一个进程的句柄上限files/GUI,在32/64位windows之间是一样的吗?换句话说,64位的Windows进程除了拥有更多的内存,就不能拥有比32位进程更多的系统资源吗?
Seems all win32 api are all 32bit version, not matter my windows installed is 32bit or 64bit.
这是不正确的,您提供的示例 (HANDLE
) 也说明了这一点:它是一个 指针 ,因此它在 64- Windows 的位版本。它指向某个任意结构1 (struct { int unused; };
) 的事实无关紧要。结构内容未使用2.
除此之外,您可以看到,HANDLE
类型引用的内核对象的理论最大值在 64 位 Windows 上比在 32 位上高Windows。由于许多原因,实际限制通常低于这些限制。太多了,无法一一列举,但这里汇集了您可能会感兴趣的相关文章:
- On the unanswerability of the maximum number of user interface objects a program can create
- Does Windows have a limit of 2000 threads per process?
- Pushing the Limits of Windows: Physical Memory
- Pushing the Limits of Windows: Virtual Memory
- Pushing the Limits of Windows: Paged and Nonpaged Pool
- Pushing the Limits of Windows: Processes and Threads
- Pushing the Limits of Windows: Handles
- Pushing the Limits of Windows: USER and GDI Objects – Part 1
- Pushing the Limits of Windows: USER and GDI Objects – Part 2
1 只有在设置了 STRICT 预处理器宏时才使用此结构。如果不是,则 HANDLE
只是 void*
.
的类型定义
2 该结构用于防止某些类别的程序员错误,例如将 HANDLE
分配给 int
。在系统内部,句柄 value 才有意义。
好像所有的Win32 API都是32位的版本,不管我的Windows安装的是32位还是64位。如果我调用 CreateWindow
,返回的 HANDLE 将是指向 _HANDLE
的指针,它是 struct {int unused;}
.
所以 32 位 Windows 和 64 位 Windows 都使用 Windows API 以 32 位方式管理资源,对吗?
如果是这样,那么一个进程的句柄上限files/GUI,在32/64位windows之间是一样的吗?换句话说,64位的Windows进程除了拥有更多的内存,就不能拥有比32位进程更多的系统资源吗?
Seems all win32 api are all 32bit version, not matter my windows installed is 32bit or 64bit.
这是不正确的,您提供的示例 (HANDLE
) 也说明了这一点:它是一个 指针 ,因此它在 64- Windows 的位版本。它指向某个任意结构1 (struct { int unused; };
) 的事实无关紧要。结构内容未使用2.
除此之外,您可以看到,HANDLE
类型引用的内核对象的理论最大值在 64 位 Windows 上比在 32 位上高Windows。由于许多原因,实际限制通常低于这些限制。太多了,无法一一列举,但这里汇集了您可能会感兴趣的相关文章:
- On the unanswerability of the maximum number of user interface objects a program can create
- Does Windows have a limit of 2000 threads per process?
- Pushing the Limits of Windows: Physical Memory
- Pushing the Limits of Windows: Virtual Memory
- Pushing the Limits of Windows: Paged and Nonpaged Pool
- Pushing the Limits of Windows: Processes and Threads
- Pushing the Limits of Windows: Handles
- Pushing the Limits of Windows: USER and GDI Objects – Part 1
- Pushing the Limits of Windows: USER and GDI Objects – Part 2
1 只有在设置了 STRICT 预处理器宏时才使用此结构。如果不是,则
HANDLE
只是 void*
.的类型定义 2 该结构用于防止某些类别的程序员错误,例如将
HANDLE
分配给 int
。在系统内部,句柄 value 才有意义。