网站首页  词典首页

请输入您要查询的函数:

 

术语 querydosdevice
释义 QueryDosDevice
语法:
C++
DWORD WINAPI QueryDosDevice(
__in_opt LPCTSTR lpDeviceName,
__out LPTSTR lpTargetPath,
__in DWORD ucchMax
);
QueryDosDevice函数
获取信息的MS - DOS设备名。该函数可以获取特定的MS当前映射- DOS设备名。该功能还可以获取所有现有的MS列表- DOS设备名。
MS - DOS设备名称存储在对象名称空间路口。该代码转换一个MS - DOS到相应的路径路径使用这些路口的地图MS - DOS设备和驱动器号。该QueryDosDevice函数使应用程序查询用于执行MS - DOS设备空间,以及每个具体交界路口值的名称。
参数
lpDeviceName [中,可选]
一个MS - DOS设备名称字符串指定查询的目标。该设备的名称不能有一个尾部反斜杠,例如,使用的“C:”,而不是的“C:\\”。
此参数可以为NULL。在这种情况下,QueryDosDevice函数将存储到缓冲区的所有现有的MS列表- DOS设备名指向lpTargetPath。
lpTargetPath [out]
一个缓冲区将接收查询结果的指针。该函数用一个或多个空终止字符串,此缓冲区。最后一个NULL结尾的字符串后跟一个额外的空。
如果lpDeviceName是非NULL,则函数检索有关特定的MS - DOS的由lpDeviceName指定设备的信息。第一个空结尾到缓冲区中存储的字符串是该设备的当前映射。其他空终止字符串代表取消删除该设备预先映射。
如果lpDeviceName为NULL,则函数检索所有现有的MS列表- DOS设备名。每个空终止到缓冲区中存储的字符串,是一个现有的MS名称- DOS设备,例如,\\设备\\ HarddiskVolume1或\\设备\\ Floppy0。
ucchMax [in]
在TCHARs最多可以存储到缓冲区指向lpTargetPath。
返回值
如果函数成功,返回值是把存储在缓冲区TCHARs人数指向lpTargetPath。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
如果缓冲区太小,函数失败,最后错误代码是ERROR_INSUFFICIENT_BUFFER。
Windows 2000中:如果缓冲区太小,返回值表示有多少个字符存储。
备注
该DefineDosDevice功能使应用程序来创建和修改用于实现MS - DOS设备空间的交界处。
Windows Server 2003和Windows XP中:QueryDosDevice首先搜索指定的设备名本地MS - DOS设备命名空间。如果设备名没有找到,该函数将然后搜索全球MS - DOS设备命名空间。
当所有现有的MS - DOS设备名是质疑,器件返回的名单取决于它是否在LocalSystem上下文中运行。如果是这样,只有设备名称包括在全球的MS - DOS设备名称空间将被退还。如果不是这样,在全球和本地MS的设备名称串联- DOS设备空间将被返回。如果设备名称命名空间都存在,QueryDosDevice将返回在本地MS入门DOS设备命名空间。
欲了解更多有关全球和本地的MS - DOS设备名称空间和方便的MS - DOS设备名称的更改,请参见定义一个MS DOS设备名。
实例
有关示例,请参见获取来自文件处理或显示文件名称成交量路径。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesQueryDosDeviceW(Unicode)和QueryDosDeviceA(ANSI)的
参见
DefineDosDevice
卷管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==QueryDosDevice Function
Retrieves information about MS-DOS device names. The function can obtain the current mapping for a particular MS-DOS device name. The function can also obtain a list of all existing MS-DOS device names.
MS-DOS device names are stored as junctions in the object name space. The code that converts an MS-DOS path into a corresponding path uses these junctions to map MS-DOS devices and drive letters. The QueryDosDevice function enables an application to query the names of the junctions used to implement the MS-DOS device namespace as well as the value of each specific junction.
Syntax
C++
DWORD WINAPI QueryDosDevice(
__in_opt LPCTSTR lpDeviceName,
__out LPTSTR lpTargetPath,
__in DWORD ucchMax
);
Parameters
lpDeviceName [in, optional]
An MS-DOS device name string specifying the target of the query. The device name cannot have a trailing backslash; for example, use "C:", not "C:\\".
This parameter can be NULL. In that case, the QueryDosDevice function will store a list of all existing MS-DOS device names into the buffer pointed to by lpTargetPath.
lpTargetPath [out]
A pointer to a buffer that will receive the result of the query. The function fills this buffer with one or more null-terminated strings. The final null-terminated string is followed by an additional NULL.
If lpDeviceName is non-NULL, the function retrieves information about the particular MS-DOS device specified by lpDeviceName. The first null-terminated string stored into the buffer is the current mapping for the device. The other null-terminated strings represent undeleted prior mappings for the device.
If lpDeviceName is NULL, the function retrieves a list of all existing MS-DOS device names. Each null-terminated string stored into the buffer is the name of an existing MS-DOS device, for example, \\Device\\HarddiskVolume1 or \\Device\\Floppy0.
ucchMax [in]
The maximum number of TCHARs that can be stored into the buffer pointed to by lpTargetPath.
Return Value
If the function succeeds, the return value is the number of TCHARs stored into the buffer pointed to by lpTargetPath.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
If the buffer is too small, the function fails and the last error code is ERROR_INSUFFICIENT_BUFFER.
Windows 2000: If the buffer is too small, the return value indicates how many characters were stored.
Remarks
The DefineDosDevice function enables an application to create and modify the junctions used to implement the MS-DOS device namespace.
Windows Server 2003 and Windows XP: QueryDosDevice first searches the Local MS-DOS Device namespace for the specified device name. If the device name is not found, the function will then search the Global MS-DOS Device namespace.
When all existing MS-DOS device names are queried, the list of device names that are returned is dependent on whether it is running in the LocalSystem context. If so, only the device names included in the Global MS-DOS Device namespace will be returned. If not, a concatenation of the device names in the Global and Local MS-DOS Device namespaces will be returned. If a device name exists in both namespaces, QueryDosDevice will return the entry in the Local MS-DOS Device namespace.
For more information on the Global and Local MS-DOS Device namespaces and changes to the accessibility of MS-DOS device names, see Defining an MS DOS Device Name .
Examples
For an example, see Obtaining a File Name From a File Handle or Displaying Volume Paths .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesQueryDosDeviceW (Unicode) and QueryDosDeviceA (ANSI)
See Also
DefineDosDevice
Volume Management Functions
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365461(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:16:10