ReactOS  0.4.14-dev-1007-g90d795b
lsdd.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <reactos/buildno.h>
#include "../win32err.h"
Include dependency graph for lsdd.c:

Go to the source code of this file.

Macros

#define LINKS_SIZE   32768
 
#define DEVICE_SIZE   8192
 

Functions

BOOL WINAPI GetNextString (char *BufferIn, char *BufferOut, char **Next)
 
int main (int argc, char *argv [])
 

Variables

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]
 

Macro Definition Documentation

◆ DEVICE_SIZE

#define DEVICE_SIZE   8192

Definition at line 21 of file lsdd.c.

◆ LINKS_SIZE

#define LINKS_SIZE   32768

Definition at line 20 of file lsdd.c.

Function Documentation

◆ GetNextString()

BOOL WINAPI GetNextString ( char BufferIn,
char BufferOut,
char **  Next 
)

Definition at line 34 of file lsdd.c.

39 {
40  char * next = *Next;
41  char * w;
42 
43  if ('\0' == *next) return FALSE;
44  for ( w = BufferOut;
45  ('\0' != *next);
46  next ++
47  )
48  {
49  *(w ++) = *next;
50  }
51  *w = '\0';
52  *Next = ++ next;
53  return TRUE;
54 }
#define TRUE
Definition: types.h:120
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 58 of file lsdd.c.

59 {
60  printf (
61  "ReactOS/Win32 %s - List DOS Devices Utility\n"
62  "Written by E.Aliberti (%s)\n\n",
63  KERNEL_VERSION_STR,
64  __DATE__
65  );
66 
67  if (0 != QueryDosDevice (
68  NULL, /* dump full directory */
70  sizeof SymbolicLinks
71  )
72  )
73  {
74  char * NextDosDevice = SymbolicLinks;
75  char * NextDevice;
76 
77  while (TRUE == GetNextString (
80  & NextDosDevice
81  )
82  )
83  {
84  printf ("%s\n", DosDeviceName);
85  if (0 != QueryDosDevice (
88  sizeof DeviceNames
89  )
90  )
91  {
92  NextDevice = DeviceNames;
93  while (TRUE == GetNextString (
95  DeviceName,
96  & NextDevice
97  )
98  )
99  {
100  printf (" -> \"%s\"\n", DeviceName);
101  }
102  }
103  else
104  {
106  error_prefix,
107  GetLastError ()
108  );
109  }
110  printf ("\n");
111  }
112  }
113  else
114  {
116  error_prefix,
117  GetLastError ()
118  );
119  return EXIT_FAILURE;
120  }
121  return EXIT_SUCCESS;
122 }
#define QueryDosDevice
Definition: winbase.h:3726
#define TRUE
Definition: types.h:120
BOOL WINAPI GetNextString(char *BufferIn, char *BufferOut, char **Next)
Definition: lsdd.c:34
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static char SymbolicLinks[LINKS_SIZE]
Definition: lsdd.c:25
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
static char DeviceName[DEVICE_SIZE]
Definition: lsdd.c:29
VOID PrintWin32Error(IN LPWSTR Message, IN DWORD ErrorCode)
Definition: main.c:146
static char DeviceNames[DEVICE_SIZE]
Definition: lsdd.c:28
static const LPWSTR error_prefix
Definition: lsdd.c:23
smooth NULL
Definition: ftsmooth.c:416
#define EXIT_FAILURE
Definition: jerror.c:33
static char DosDeviceName[DEVICE_SIZE]
Definition: lsdd.c:26
#define printf
Definition: config.h:203

Variable Documentation

◆ DeviceName

char DeviceName[DEVICE_SIZE]
static

Definition at line 29 of file lsdd.c.

Referenced by main().

◆ DeviceNames

char DeviceNames[DEVICE_SIZE]
static

Definition at line 28 of file lsdd.c.

Referenced by main().

◆ DosDeviceName

char DosDeviceName[DEVICE_SIZE]
static

Definition at line 26 of file lsdd.c.

Referenced by CreateSoundDevice(), DestroySoundDevice(), DriverEntry(), main(), and ScsiPortInitialize().

◆ error_prefix

const LPWSTR error_prefix = L"lsdd: "
static

Definition at line 23 of file lsdd.c.

Referenced by main().

◆ SymbolicLinks

char SymbolicLinks[LINKS_SIZE]
static

Definition at line 25 of file lsdd.c.

Referenced by main().