这学期我们学操作系统,所以得写个PCB。

于是我借鉴了一下windows的PCB,写了这个

Imports System.Runtime.InteropServices
''' <summary>
''' 这就是传说中的PCB
''' </summary>
Structure KPROCESS
Dim Header As DispatcherHeader
Dim ProfileListHead As LinkedList(Of ProcessProfileSimulator)
Dim DirectoryTableBase As UInteger
Dim LdtDescriptor As KernelGlobalDescriptorTableEntry
Dim Int21Descriptor As KernelInterruptDescriptorTableEntry
Dim IopmOffset As Short
Dim Iopl As Byte
Dim ActiveProcessors As UInteger
Dim KernelTime As UInteger
Dim UserTime As UInteger
Dim ReadyListHead As LinkedList(Of ProcessSimulator)
Dim SwapListEntry As SingleLinkedList(Of ProcessSimulator)
Dim VdmTrapcHandler As IntPtr
Dim ThreadListHead As LinkedList(Of ThreadSimulator)
Dim ProcessLock As UInteger
Dim Affinity As UInteger
Dim ProcessFlags As ProcessFlag
Dim BasePriority As SByte
Dim QuantumReset As SByte
Dim State As Byte
Dim ThreadSeed As Byte
Dim PowerState As Byte
Dim IdealNode As Byte
Dim Visited As Byte
Dim ExecuteOptions As Byte
Dim StackCount As UInteger
Dim ProcessListEntry As LinkedList(Of ProcessSimulator)
Dim CycleTime As ULong
End Structure Enum ProcessFlag
None
AutoAlignment
DisableBoost
DisableQuantum =
End Enum Structure DispatcherHeader
Dim UnionType As Byte
Dim UnionData As UnionA
<StructLayout(LayoutKind.Explicit)>
Structure UnionA
<FieldOffset(0)> Dim Abandoned As Byte
<FieldOffset()> Dim Absolute As Byte
<FieldOffset()> Dim NpxIrql As Byte
<FieldOffset()> Dim Signalling As Byte
<FieldOffset()> Dim Size As Byte
<FieldOffset()> Dim Hand As Byte
<FieldOffset()> Dim Inserted As Byte
<FieldOffset()> Dim DebugActive As Byte
<FieldOffset()> Dim DpcActive As Byte
End Structure
Dim Lock As Integer
Dim SignalState As Integer
Dim WaitListHead As LinkedList(Of ProcessSimulator)
End Structure Structure KernelGlobalDescriptorTableEntry
Dim LimitLow As Short
Dim BaseLow As Short
Dim HighWord As UInteger
End Structure Structure KernelInterruptDescriptorTableEntry
Dim Offset As Short
Dim Selector As Short
Dim Access As Short
Dim ExtendedOffset As Short
End Structure Enum KernelExecuteOptions As Byte
None
ExecuteDisable
ExecuteEnable
DisableThunkEmulation =
Permanent =
ExecuteDispatchEnable =
ImageDispatchEnable =
End Enum

那个SingleLinkedList是我自定义的

Public Class SingleLinkedList(Of T)
Public Property [Next] As SingleLinkedList(Of T)
Public Property Value As T
End Class

[水]用vb写了个PCB的更多相关文章

  1. abap调vb写的dll实现电子天平的读数(带控件版)

    废话不多说,直接上. 鉴于abap调研的dll文件需要在wins注册,自己尝试过delphi和C#感觉不是很好,最后毅然选择了VB来写 因为需要用到MScomm控件,所以对于将要写的dll需要带for ...

  2. 运行vb写的程序,有些电脑上会弹出一个与office相关的窗口

    到网上搜索了一下,找了几个解决方案,不过我的电脑上没出现过,所以先收藏一下,或许以后能用上. 来自:http://bbs.csdn.net/topics/380204412 今天将注册表的项一个个删除 ...

  3. VC调用VB写的COM

    VB. 步骤: 1.创建类库:类库的创建必须分为接口和实现类:给外面提供的是COM接口: 创建了接口和类之后还要创建"Guid",这个在"工具->创建GUID&qu ...

  4. vb写文件时报'Invalid procedure call or argument'

    原来的一段代码是这样的: Set fso3 = CreateObject("Scripting.FileSystemObject")                  'msgbo ...

  5. VB 共享软件防破解设计技术初探(二)

    VB 共享软件防破解设计技术初探(二) ×××××××××××××××××××××××××××××××××××××××××××××× 其他文章快速链接: VB 共享软件防破解设计技术初探(一)http ...

  6. 用VB实现SmartQQ机器人

    这里为了便于介绍程序设计的流程,更多以代码形式给出,具体可用火狐浏览器的firebug插件来抓包分析,或者用谷歌浏览器的开发者工具进行抓包.抓包地址是:http://w.qq.com 第一步,是二维码 ...

  7. 演练:使用Xamarin.Forms开发产品介绍性质的应用(VB版)

    概述 Xamarin这个使用mono和.net core的跨平台开发框架这几年在不断发展.被微软收购后的Xamarin为个人开发者提供了免费版的Xamarin for Visual Studio,吸引 ...

  8. 在uwp中复活常用的vb库函数

    这个博文是纯原创的,转载一定要说明作者是 Nukepayload2!! 在.Net Core 中,很多地方被精简了,有个重灾区就是vb语言库.从当初的囊括vb6库函数并且附带后期绑定到现在的几个函数加 ...

  9. [Aaronyang] 写给自己的WPF4.5 失传的第一本古老秘籍[多扩展显示器编程]

    世界上只有想不通的人,没有走不通的路 --Aaronyang的博客(www.ayjs.net)-www.8mi.me =============时隔两年后再看WPF,有些秘籍不太适合公开,公开了就不值 ...

随机推荐

  1. 绘制n边形:用两个以上的控件来控制矩形的颜色、大小、位置及空实心(程序代写)

    绘制n边形:用两个以上的控件来控制矩形的颜色.大小.位置及空实心.(n由键盘输入) package lzy.di9zhang; import java.awt.BorderLayout;import ...

  2. WebApi中直接返回json字符串的方法

    [HttpPost] public HttpResponseMessage Upload() { string json = "{\"result\":\"tr ...

  3. centos中 mysql 5.7安装

    以免授权模式启动 编辑 /etc/my.cnf,添加以下内容: linux环境中:vi /etc/my.cnf 在[MySQL(和PHP搭配之最佳组合)d]配置段添加如下两行: user=mysql ...

  4. BlazeMeter发布chrome扩展插件,支持JMeter脚本创建

    BlazeMeter发布chrome扩展插件,支持JMeter脚本创建http://www.automationqa.com/forum.php?mod=viewthread&tid=3898 ...

  5. jQuery超炫酷按钮插件及源码

    现在大部分网页的按钮都是经过美化的,那些原始的浏览器按钮太过于枯燥乏味,让用户失去和网站交互的兴趣.早期我们都是通过背景图片来美化网页按钮,而现在我们可以利用扩展性更好的CSS3来制作漂亮的网页按钮, ...

  6. ora-01031:insufficient privileges解决方法 - 转

    今天晚上要远程修改一个分公司的数据库参数,于是下午先远程过去做些准备工作.数据库是oracle 11g rac,操作系统是windows 2008 server,我还是第一次见过windows下的or ...

  7. 在linux下挂载、卸载U盘

    首先你得保证你的U盘的格式是fat格式. 先进入/mnt/目录新建一个usb目录 cd /mnt/ mkidr usb 先fdisk -l,然后插上U盘,fdisk -l 查看是否有新的硬盘添加上来了 ...

  8. POJ 1363 Rails

    Rails Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21728   Accepted: 8703 Descriptio ...

  9. python 字符串比较

    cmp方法比较两个对象,并根据结果返回一个整数.cmp(x,y)如果X< Y,返回值是负数 如果X>Y 返回的值为正数. sStr1 = 'strch'sStr2 = 'strchr'pr ...

  10. 安卓开发笔记——关于图片的三级缓存策略(内存LruCache+磁盘DiskLruCache+网络Volley)

    在开发安卓应用中避免不了要使用到网络图片,获取网络图片很简单,但是需要付出一定的代价——流量.对于少数的图片而言问题不大,但如果手机应用中包含大量的图片,这势必会耗费用户的一定流量,如果我们不加以处理 ...