这学期我们学操作系统,所以得写个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. WPF下载远程文件,并显示进度条和百分比

    WPF下载远程文件,并显示进度条和百分比 1.xaml <ProgressBar HorizontalAlignment="Left" Height="10&quo ...

  2. ECSHOP始终显示全部分类方法

    商品分类树需要始终显示所有类别,默认的Ecshop的显示方式为在当前产品页面只显示当前的产品所在的同级及下级分类,这就导致当点开某个产品或者子分 类的时候全局的分类树就不见了. 其实修改的方法很简单. ...

  3. ecshop利用.htaccess实现301重定向的方法

    实现方法如下(空间必须支持对目录中的.htaccess文件解析) 打开 .htaccess 找到 RewriteEngine on 它的下方添加 RewriteCond %{HTTP_HOST} ^需 ...

  4. 安装mmseg出错 config.status: error: cannot find input file: src/Makefile.in

    aclocallibtoolize --forceautomake --add-missingautoconfautoheadermake clean

  5. 【Cocos2d-Js基础教学(2)类的使用和面向对象】

    类的使用和面向对象 大家都知道在cocos2d-x 底层是C++编写的,那么就有类的概念和继承机制. 但是在JS中,是没有类这个概念的,没有提供类,没有C++的类继承机制. 那么JS是通过什么方式实现 ...

  6. android学习者优秀网址推荐

    非常漂亮的android UI库集合,别人整理的,如果感觉不错,赶快收藏吧!! https://github.com/wasabeef/awesome-android-ui https://githu ...

  7. nc

    http://www.oschina.net/translate/nc-command-examples http://nixdoc.net/man-pages/openbsd/man1/nc.1.h ...

  8. js日期时间比较函数

    转自:http://www.cnblogs.com/zxjyuan/archive/2010/09/07/1820708.html js日期比较(yyyy-mm-dd) function duibi( ...

  9. [转]安卓开发startservice 和bindservice详解

    原文 作者:aikongmeng 来源:安卓中文网 博主暗表:搜到此文,终于为我解惑,bindService并不会真正启动service,不会调用onStartCommand!还需要再bind之前st ...

  10. xcode6.0 模拟器打不开

      只要设置下这个就行了 本来以为虚拟机的问题  都把虚拟机从新安装了 杯具啊