mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 23:42:56 +00:00
- Start rosapps rearrange and cleanup process.
svn path=/trunk/; revision=34303
This commit is contained in:
parent
0a0a13a41c
commit
2012315e5a
1206 changed files with 81 additions and 81 deletions
126
rosapps/applications/sysutils/lsdd/lsdd.c
Normal file
126
rosapps/applications/sysutils/lsdd/lsdd.c
Normal file
|
@ -0,0 +1,126 @@
|
|||
/* $Id$
|
||||
*
|
||||
* FILE : lsdd.c
|
||||
* AUTHOR: Emanuele ALIBERTI
|
||||
* DATE : 2000-08-04
|
||||
* DESC : List DOS devices, i.e. symbolic links created
|
||||
* in the \?? object manager's name space.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
||||
|
||||
#include <reactos/buildno.h>
|
||||
|
||||
#include "../win32err.h"
|
||||
|
||||
#define LINKS_SIZE 32768
|
||||
#define DEVICE_SIZE 8192
|
||||
|
||||
static const LPWSTR error_prefix = L"lsdd: ";
|
||||
|
||||
static char SymbolicLinks [LINKS_SIZE];
|
||||
static char DosDeviceName [DEVICE_SIZE];
|
||||
|
||||
static char DeviceNames [DEVICE_SIZE];
|
||||
static char DeviceName [DEVICE_SIZE];
|
||||
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
GetNextString (
|
||||
char * BufferIn,
|
||||
char * BufferOut,
|
||||
char ** Next
|
||||
)
|
||||
{
|
||||
char * next = *Next;
|
||||
char * w;
|
||||
|
||||
if ('\0' == *next) return FALSE;
|
||||
for ( w = BufferOut;
|
||||
('\0' != *next);
|
||||
next ++
|
||||
)
|
||||
{
|
||||
*(w ++) = *next;
|
||||
}
|
||||
*w = '\0';
|
||||
*Next = ++ next;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char * argv [] )
|
||||
{
|
||||
printf (
|
||||
"ReactOS/Win32 %s - List DOS Devices Utility\n"
|
||||
"Written by E.Aliberti (%s)\n\n",
|
||||
KERNEL_RELEASE_STR,
|
||||
__DATE__
|
||||
);
|
||||
|
||||
if (0 != QueryDosDevice (
|
||||
NULL, /* dump full directory */
|
||||
SymbolicLinks,
|
||||
sizeof SymbolicLinks
|
||||
)
|
||||
)
|
||||
{
|
||||
char * NextDosDevice = SymbolicLinks;
|
||||
char * NextDevice;
|
||||
|
||||
while (TRUE == GetNextString (
|
||||
SymbolicLinks,
|
||||
DosDeviceName,
|
||||
& NextDosDevice
|
||||
)
|
||||
)
|
||||
{
|
||||
printf ("%s\n", DosDeviceName);
|
||||
if (0 != QueryDosDevice (
|
||||
DosDeviceName,
|
||||
DeviceNames,
|
||||
sizeof DeviceNames
|
||||
)
|
||||
)
|
||||
{
|
||||
NextDevice = DeviceNames;
|
||||
while (TRUE == GetNextString (
|
||||
DeviceNames,
|
||||
DeviceName,
|
||||
& NextDevice
|
||||
)
|
||||
)
|
||||
{
|
||||
printf (" -> \"%s\"\n", DeviceName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintWin32Error (
|
||||
error_prefix,
|
||||
GetLastError ()
|
||||
);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintWin32Error (
|
||||
error_prefix,
|
||||
GetLastError ()
|
||||
);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* EOF */
|
11
rosapps/applications/sysutils/lsdd/lsdd.rbuild
Normal file
11
rosapps/applications/sysutils/lsdd/lsdd.rbuild
Normal file
|
@ -0,0 +1,11 @@
|
|||
<module name="lsdd" type="win32cui" installbase="system32" installname="lsdd.exe">
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>lib</library>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
|
||||
<file>lsdd.c</file>
|
||||
<file>lsdd.rc</file>
|
||||
</module>
|
6
rosapps/applications/sysutils/lsdd/lsdd.rc
Normal file
6
rosapps/applications/sysutils/lsdd/lsdd.rc
Normal file
|
@ -0,0 +1,6 @@
|
|||
/* $Id$ */
|
||||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Tool to list the device names visible to the W32 subsystem (also known as DOS Devices).\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "lsdd\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "lsdd.exe\0"
|
||||
#include <reactos/version.rc>
|
Loading…
Add table
Add a link
Reference in a new issue