Articles of ioctl

Windows中的智能卡通信build立

当我在接收到ATR后向读卡器插入智能卡时,我可以在驱动程序日志中看到许多未由我的应用程序发送(如未运行)的IOCTL。 我的问题是,如果有任何文件,描述在Windows的Smard卡通信build立?

DeviceIoControl调用失败,错误代码为183

我试图写缓冲区数据到SCSI设备,但是当我触发deviceIoControl调用时,我得到了窗口错误代码183.错误代码表明文件已经退出,但我不能够了解有关IOCTL调用的错误。 CreateFile函数通过,因为我能够得到适当的设备句柄,如下所示。 int devHandle = DeviceIoControlHelper.CreateFile(deviceName,DeviceIoControlHelper.GENERIC_READ | DeviceIoControlHelper.GENERIC_WRITE,DeviceIoControlHelper.FILE_SHARE_READ | DeviceIoControlHelper.FILE_SHARE_WRITE,IntPtr.Zero,DeviceIoControlHelper.OPEN_EXISTING,0,IntPtr.Zero); 但是,当我尝试写入缓冲区时出现错误: dwReturned = 0; int b = DeviceIoControlHelper.DeviceIoControl( devHandle, DeviceIoControlHelper.IOCTL_SCSI_PASS_THROUGH, inpBuffer, (uint)Marshal.SizeOf(info), inpBuffer, //out pDriveLayout, (uint)Marshal.SizeOf(info), //(uint)Marshal.SizeOf(typeof(DRIVE_LAYOUT_INFORMATION_EX)), out dwReturned, IntPtr.Zero); Log.Write(Log.TraceLevel_5,"ExecuteDeviceIoControl return pass_through scsistatus = " + info.spt.ScsiStatus); if (b == 0) { int win_err = this.GetWindowsErrorCode(); Log.Write(Log.TraceLevel_5, "ExecuteDeviceIoControl failed, error = " + win_err); […]

字符设备捕获多个(int)ioctl参数

我必须编写一个linux char设备,它可以为每个unlock_ioctl处理ioctl(无BKL)函数。 目前,我可以从用户空间ioctl命令收到一个参数 __get_user(myint, (int __user *) arg); 我怎样才能接收多个int参数(例如这个调用)? ioctl(fp, SZ_NEW_DEV_FORMAT, 0, 1, 30);

如何在Windows上logging程序的DeviceIoControl调用

我需要捕获应用程序的DeviceIoControl()系统调用。 在linux上,strace可以用来分析所有的ioctl调用。 在Windows上有没有类似的function? MSDN网站推荐一个名为“Process Monitor”的程序来分析可执行文件的实时活动。 但是,“进程监视器”不显示有关DeviceIoControl调用的任何内容。

sendto的最大缓冲区长度?

如何获取可以传递给sendto(..)调用的最大字节数作为UDP端口打开的套接字?

如何从Linux获取窗口大小

大家。 我对编程还不熟悉。 我真的需要一些关于我面临的问题的帮助。 所以,这里的情况是我试图显示一个警告,当terminal大小低于80×24。 为了logging,我的Os是Window,但是我使用虚拟机来运行Linux,因为所有文件都在Linux中。 当我运行该文件使用terminal,警告显示正确。 但问题是,当我尝试从Windows使用PuTTY运行文件。 警告没有出现。 我确定它是因为我使用的函数只能读取Linux环境,而不能读取Windows。 任何人都可以帮助我或指出我如何使它能够获得窗口的维度的方向。 这些文件应该都保留在Linux中。 我正在使用C. 这里只是显示有关显示警告和获取维度的代码的一部分。 //This is to display warning int display_warning() { CDKSCREEN *cdkscreen = 0; WINDOW *cursesWin = 0; char *mesg[5]; char *buttons[] = {"[ OK ]"}; CDKDIALOG *confirm; cursesWin = initscr(); cdkscreen = initCDKScreen (cursesWin); initCDKColor(); mesg[0] = "</2>"The size of Window must be […]

“错误:创build虚拟ioctl时在初始化程序中指定的未知字段”compat_ioctl“

static const struct inode_operations msdos_dir_inode_operations = { .create = msdos_create, .lookup = msdos_lookup, .unlink = msdos_unlink, .mkdir = msdos_mkdir, .rmdir = msdos_rmdir, .rename = msdos_rename, .setattr = fat_setattr, .getattr = fat_getattr, .compat_ioctl = my_ioctl, —->error }; 我也尝试与unlocked_ioctl但同样的错误发生 [root @ localhost fat]#make make -C /lib/modules/3.11.10-100.fc18.x86_64/build M = / home / aditya / linux-3.12.6 / fs / […]

Linux相当于I_PUSH

这个问题与ptyterminal数据包模式TIOCPKT有关 什么是启用packet mode的linux方式? 在ioctl函数中传递时找不到I_PUSH 。

Linux:ioctl / FIONREAD返回0字节在/ dev / random?

在打开文件描述符fd和/ dev / random的其他健全性检查之后,我试图读取设备中可读取的字节数,如果我的程序需要,可以抽取这个数量。 我的基本代码是这样的: if (fd = open("/dev/random", O_RDONLY) < 0) { perror("open"); return 1; } … if(ioctl(fd, FIONREAD, &n) < 0) { //file descriptor, call, unsigned int perror("ioctl"); return 1; } printf("%d bytes available for reading.\n", n); return 0; 不pipe情况如何(作为root用户或普通用户),它总是返回0字节可供读取。 我之前已经提出过 ,这是一种方法来检索我可以从设备中取出什么,你知道我的程序中有什么可能的问题或错误导致它总是返回零吗? 你知道有什么其他方法可以做我想做的吗?

FBIOPUT_VSCREENINFO和modelines

我正在尝试改变FBIOPUT_VSCREENINFO的屏幕configuration,但我不知道如何计算: __u32 pixclock; /* pixel clock in ps (pico seconds) */ __u32 left_margin; /* time from sync to picture */ __u32 right_margin; /* time from picture to sync */ __u32 upper_margin; /* time from sync to picture */ __u32 lower_margin; __u32 hsync_len; /* length of horizontal sync */ __u32 vsync_len; (请参阅: http : //lxr.free-electrons.com/source/include/linux/fb.h#L245 ),以获取给定模式行的fb_var_screeninfo结构。 […]