少有人走的路

勇哥的工业自动化技术网站

本站视觉相关教程整理贴子,持续更新

2020年勇哥的机器视觉实验项目清单(大纲)

勇哥的免费视频教程清单

勇哥在B站发布的视频清单

开发windows64位系统的wdm驱动,一定要签名才能运行吗

windows驱动编程学习(二)基础知识回顾之指针

勇哥注:

指针练习好了,能解决90%的驱动开发时遇到的各种问题。



#include<stdio.h>
typedef void(*p_fun)(int i, int j);
struct st {
    int i;
    int j;
    int b;
    p_fun p_fun1;
};

void fun(int i, int j) {
    printf("fun%d %d\n", i, j);
}

int main()
{
    struct st st_ = { 0 };
    st_.i = 1;
    st_.j = 2;
    st_.p_fun1 = fun;
    st_.p_fun1(1, 2);     //fun1 2
    printf("%p %p\n", st_.p_fun1, &st_.p_fun1);    //00007FF668281334   000000496FF2F5A8

    struct st* pst_;
    pst_ = &st_;
    printf("%d %d\n", st_.i, st_.j);      //1  2

    int* p_int = (int*)pst_;
    printf("+0 %d %p\n", *p_int, p_int);  //   1   0000001B7CB2F4F8
    //*p_int=1;
    p_int += 1;
    printf("+1 %d %p\n", *p_int, p_int);  //+1  2   0000001B7CB2F4FC
    //*p_int=2;
    
    p_int += 1;
    *p_int = 3;
    printf("+1 %d %p\n", *p_int, p_int);  //+1   3  0000001B7CB2F500
 
    p_int += 1;
    printf("+1 %d %p\n", *p_int, p_int);   //+1   0   0000001B7CB2F504

    p_int += 1;
    printf("+1 %p %p %p\n", *p_int, p_int, *(long long int*)p_int);   //+1 0000000068281334 000000496FF2F5A8 00007FF668281334

   
    p_fun p =(p_fun)(*(long long int*)p_int);
    printf("%p\n",p);           //00007FF65AF91334
   
    p(1, 2);                  //fun1 2

    (*(p_fun*)p_int)(2, 3);   //fun2 3

    printf("%lld\n", sizeof(struct st));    //24

    return 0;
  
}

一张pci接口的io卡,如果我想在windows编写驱动去使用它,应该知道哪些信息

windows驱动编程学习(一)搭建win10+vs2022开发环境

勇哥注:

学习驱动开发的目的,是为运控和视觉程序构建一个实时环境。

这方面虽然有windows实时拓展的商业软件,但是价格贵得感人,特别是想实现一些简单实时需求的时候更不划算。

<< 1 >>
«    2025年12月    »
1234567
891011121314
15161718192021
22232425262728
293031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接

Powered By Z-BlogPHP 1.7.3

Copyright www.skcircle.com Rights Reserved.

鄂ICP备18008319号


站长QQ:496103864 微信:abc496103864