网站首页  词典首页

请输入您要查询的函数:

 

术语 definedosdevice
释义 DefineDosDevice
语法:
C++
BOOL WINAPI DefineDosDevice(
__in DWORD dwFlags,
__in LPCTSTR lpDeviceName,
__in_opt LPCTSTR lpTargetPath
);
DefineDosDevice功能
定义,重新定义或删除MS - DOS设备名。
参数
dwFlags [in]
该DefineDosDevice函数的控制方面。此参数可以是一个或多个下列值。
ValueMeaning
DDD_EXACT_MATCH_ON_REMOVE
0x00000004If此值指定的DDD_REMOVE_DEFINITION一直以来,该函数将使用完全匹配,以确定哪些映射删除。使用此值,以确保您不删除一些您没有界定。
DDD_NO_BROADCAST_SYSTEM
0x00000008Do没有广播WM_SETTINGCHANGE消息。默认情况下,此消息是广播通知壳和变更申请。
DDD_RAW_TARGET_PATH
0x00000001Uses的lpTargetPath字符串的。否则,它将转换从MS - DOS路径的路径。
DDD_REMOVE_DEFINITION
0x00000002Removes为指定的设备指定的定义。若要确定的定义中删除,该函数的映射走的设备列表,为lpTargetPath针对与此设备相关的每个映射前缀匹配寻找。第一个映射匹配是一个删除,然后函数返回。
如果lpTargetPath为NULL或对一个NULL字符串指针,该函数将删除第一个映射与设备相关的和流行,最近的一次推动。如果有剩下流行什么,设备的名称将被删除。
如果该值未指定,所指出的字符串参数的lpTargetPath将成为该设备的新映射。
lpDeviceName [in]
阿指针到MS - DOS设备名称字符串指定该设备的功能是定义,重新定义,或删除。设备名称字符串必须不作为最后一个字符结肠,除非一个驱动器号被定义,界定,或删除。例如,将驱动器C字符串的“C:”。在任何情况下是一个尾部反斜杠(“\\”)允许的。
lpTargetPath [中,可选]
一个路径字符串,将执行这一设备的指针。该字符串是一个MS - DOS路径字符串,除非DDD_RAW_TARGET_PATH标志被指定,在这种情况下,这个字符串是一个路径字符串。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
MS - DOS设备名称存储在对象名称空间路口。该代码转换一个MS - DOS到相应的路径路径使用这些路口的地图MS - DOS设备和驱动器号。该DefineDosDevice功能使应用程序来修改用于实现MS - DOS设备名称空间的交界处。
要检索特定的MS当前映射- DOS设备名称或以获取所有MS清单系统已知的DOS设备,使用QueryDosDevice函数。
To define a drive letter assignment that is persistent across boots and not a network share, use the SetVolumeMountPoint function.如果要装入量已经有一个驱动器号分配给它,使用DeleteVolumeMountPoint函数删除转让。
驱动器号和设备的名称,在系统启动时定义的保护,重新定义和删除,除非用户是管理员。
与Windows XP开始,这个功能创造了一个朋友是不是在自己的本地MS LocalSystem上下文中运行DOS设备命名空间的设备名。如果调用方是在LocalSystem上下文中运行,该函数创建的全球MS器件名称- DOS设备命名空间。有关更多信息,请参见定义一个MS DOS设备名和文件名,路径和命名空间。
实例
有关示例,请参见编辑驱动器号分配。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesDefineDosDeviceW(Unicode)和DefineDosDeviceA(ANSI)的
参见
DeleteVolumeMountPoint
QueryDosDevice
SetVolumeMountPoint
卷管理功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==DefineDosDevice Function
Defines, redefines, or deletes MS-DOS device names.
Syntax
C++
BOOL WINAPI DefineDosDevice(
__in DWORD dwFlags,
__in LPCTSTR lpDeviceName,
__in_opt LPCTSTR lpTargetPath
);
Parameters
dwFlags [in]
The controllable aspects of the DefineDosDevice function. This parameter can be one or more of the following values.
ValueMeaning
DDD_EXACT_MATCH_ON_REMOVE
0x00000004If this value is specified along with DDD_REMOVE_DEFINITION, the function will use an exact match to determine which mapping to remove. Use this value to ensure that you do not delete something that you did not define.
DDD_NO_BROADCAST_SYSTEM
0x00000008Do not broadcast the WM_SETTINGCHANGE message. By default, this message is broadcast to notify the shell and applications of the change.
DDD_RAW_TARGET_PATH
0x00000001Uses the lpTargetPath string as is. Otherwise, it is converted from an MS-DOS path to a path.
DDD_REMOVE_DEFINITION
0x00000002Removes the specified definition for the specified device. To determine which definition to remove, the function walks the list of mappings for the device, looking for a match of lpTargetPath against a prefix of each mapping associated with this device. The first mapping that matches is the one removed, and then the function returns.
If lpTargetPath is NULL or a pointer to a NULL string, the function will remove the first mapping associated with the device and pop the most recent one pushed. If there is nothing left to pop, the device name will be removed.
If this value is not specified, the string pointed to by the lpTargetPath parameter will become the new mapping for this device.

lpDeviceName [in]
A pointer to an MS-DOS device name string specifying the device the function is defining, redefining, or deleting. The device name string must not have a colon as the last character, unless a drive letter is being defined, redefined, or deleted. For example, drive C would be the string "C:". In no case is a trailing backslash ("\\") allowed.
lpTargetPath [in, optional]
A pointer to a path string that will implement this device. The string is an MS-DOS path string unless the DDD_RAW_TARGET_PATH flag is specified, in which case this string is a path string.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
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 DefineDosDevice function enables an application to modify the junctions used to implement the MS-DOS device name space.
To retrieve the current mapping for a particular MS-DOS device name or to obtain a list of all MS-DOS devices known to the system, use the QueryDosDevice function.
To define a drive letter assignment that is persistent across boots and not a network share, use the SetVolumeMountPoint function. If the volume to be mounted already has a drive letter assigned to it, use the DeleteVolumeMountPoint function to remove the assignment.
Drive letters and device names defined at system boot time are protected from redefinition and deletion unless the user is an administrator.
Starting with Windows XP, this function creates a device name for a caller that is not running in the LocalSystem context in its own Local MS-DOS device namespace. If the caller is running in the LocalSystem context, the function creates the device name in the Global MS-DOS device namespace. For more information, see Defining an MS DOS Device Name and File Names, Paths, and Namespaces .
Examples
For an example, see Editing Drive Letter Assignments .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesDefineDosDeviceW (Unicode) and DefineDosDeviceA (ANSI)
See Also
DeleteVolumeMountPoint
QueryDosDevice
SetVolumeMountPoint
Volume Management Functions
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa363904(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:19:58