Author: jmorlan
Date: Wed Mar 18 01:27:33 2009
New Revision: 40082
URL:
http://svn.reactos.org/svn/reactos?rev=40082&view=rev
Log:
- Implement MKLINK command.
- Remove unused library shell32 from cmd.rbuild.
Added:
trunk/reactos/base/shell/cmd/mklink.c (with props)
Modified:
trunk/reactos/base/shell/cmd/cmd.h
trunk/reactos/base/shell/cmd/cmd.rbuild
trunk/reactos/base/shell/cmd/cmdtable.c
trunk/reactos/base/shell/cmd/config.h
trunk/reactos/base/shell/cmd/lang/de-DE.rc
trunk/reactos/base/shell/cmd/lang/el-GR.rc
trunk/reactos/base/shell/cmd/lang/en-US.rc
trunk/reactos/base/shell/cmd/lang/es-ES.rc
trunk/reactos/base/shell/cmd/lang/fr-FR.rc
trunk/reactos/base/shell/cmd/lang/hu-HU.rc
trunk/reactos/base/shell/cmd/lang/id-ID.rc
trunk/reactos/base/shell/cmd/lang/it-IT.rc
trunk/reactos/base/shell/cmd/lang/ja-JP.rc
trunk/reactos/base/shell/cmd/lang/no-NO.rc
trunk/reactos/base/shell/cmd/lang/pl-PL.rc
trunk/reactos/base/shell/cmd/lang/ru-RU.rc
trunk/reactos/base/shell/cmd/lang/uk-UA.rc
trunk/reactos/base/shell/cmd/resource.h
Modified: trunk/reactos/base/shell/cmd/cmd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=4…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.h [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -318,6 +318,10 @@
/* Prototypes for MEMORY.C */
INT CommandMemory (LPTSTR);
+
+
+/* Prototypes for MKLINK.C */
+INT cmd_mklink(LPTSTR);
/* Prototypes for MISC.C */
Modified: trunk/reactos/base/shell/cmd/cmd.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.rbuild?…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmd.rbuild [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -9,7 +9,6 @@
<library>wine</library>
<library>kernel32</library>
<library>advapi32</library>
- <library>shell32</library>
<library>user32</library>
<file>cmd.rc</file>
<file>main.c</file>
@@ -49,6 +48,7 @@
<file>locale.c</file>
<file>memory.c</file>
<file>misc.c</file>
+ <file>mklink.c</file>
<file>move.c</file>
<file>msgbox.c</file>
<file>parser.c</file>
Modified: trunk/reactos/base/shell/cmd/cmdtable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdtable.c?…
==============================================================================
--- trunk/reactos/base/shell/cmd/cmdtable.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/cmdtable.c [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -137,6 +137,10 @@
#ifdef INCLUDE_CMD_MKDIR
{_T("md"), CMD_SPECIAL, cmd_mkdir},
{_T("mkdir"), CMD_SPECIAL, cmd_mkdir},
+#endif
+
+#ifdef INCLUDE_CMD_MKLINK
+ {_T("mklink"), 0, cmd_mklink},
#endif
#ifdef INCLUDE_CMD_MOVE
Modified: trunk/reactos/base/shell/cmd/config.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/config.h?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/config.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/config.h [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -66,6 +66,7 @@
#define INCLUDE_CMD_LABEL
#define INCLUDE_CMD_MEMORY
#define INCLUDE_CMD_MKDIR
+#define INCLUDE_CMD_MKLINK
#define INCLUDE_CMD_MOVE
#ifdef NT4_INTERNAL_COMMANDS
#define INCLUDE_CMD_MSGBOX
Modified: trunk/reactos/base/shell/cmd/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/de-DE.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/de-DE.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -294,6 +294,13 @@
STRING_MKDIR_HELP, "Erzeugt ein Verzeichnis.\n\n\
MKDIR [Laufwerk:]Pfad\nMD [Laufwerk:]Pfad"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Zeigt die Größe des Systemspeicher an.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% Speicher geladen.\n\n\
@@ -576,6 +583,7 @@
LABEL Erstellt, ändert oder löscht die Bezeichnung eines Volumes.\n\
MD Erstellt ein Verzeichnis.\n\
MKDIR Erstellt ein Verzeichnis.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Verschiebt eine oder mehrere Dateien von einem Verzeichnis in\n\
ein anderes.\n\
PATH Legt den Suchpfad für ausführbare Dateien fest oder zeigt diesen an.\n\
@@ -680,6 +688,9 @@
STRING_SCREEN_COL, "ungültige Spalten-Angabe"
STRING_SCREEN_ROW, "ungültige Zeilen-Angabe"
STRING_TIMER_TIME "Timer %d ist %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Ungültiger Operand."
STRING_EXPECTED_CLOSE_PAREN, "Erwartet ')'."
STRING_EXPECTED_NUMBER_OR_VARIABLE,"Erwartet Nummer oder Variablennamen."
Modified: trunk/reactos/base/shell/cmd/lang/el-GR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/el-GR.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/el-GR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/el-GR.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -301,6 +301,13 @@
STRING_MKDIR_HELP, "Creates a directory.\n\n\
MKDIR [drive:]path\nMD [drive:]path"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Displays the amount of system memory.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n\
@@ -583,6 +590,7 @@
LABEL Äçìéïõñãåß, áëëÜæåé Þ äéáãñÜöåé ôçí åôéêÝôá ôüìïõ åíüò äßóêïõ.\n\
MD Äçìéïõñãåß Ýíáí êáôÜëïãï.\n\
MKDIR Äçìéïõñãåß Ýíáí êáôÜëïãï.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Ìåôáêéíåß Ýíá Þ ðåñéóóüôåñá áñ÷åßá áðü Ýíáí êáôÜëïãï óå Ýíáí Üëëï.\n\
PATH Åìöáíßæåé Þ ïñßæåé ìéá äéáäñïìÞ áíáæÞôçóçò ãéá åêôåëÝóéìá áñ÷åßá.\n\
PAUSE ÁíáóôÝëëåé ôçí åêôÝëåóç åíüò ðñïãñÜììáôïò äÝóìçò êáé åìöáíßæåé Ýíá ìÞíõìá.\n\
@@ -697,6 +705,9 @@
STRING_SCREEN_COL, "invalid value for col"
STRING_SCREEN_ROW, "invalid value for row"
STRING_TIMER_TIME "Timer %d is %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Invalid operand."
STRING_EXPECTED_CLOSE_PAREN, "Áíáìåíüôáí ')'."
Modified: trunk/reactos/base/shell/cmd/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/en-US.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/en-US.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -302,6 +302,13 @@
STRING_MKDIR_HELP, "Creates a directory.\n\n\
MKDIR [drive:]path\nMD [drive:]path"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Displays the amount of system memory.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n\
@@ -584,6 +591,7 @@
LABEL Creates, changes, or deletes the volume label of a disk.\n\
MD Creates a directory.\n\
MKDIR Creates a directory.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Moves one or more files from one directory to another\n\
directory.\n\
PATH Displays or sets a search path for executable files.\n\
@@ -701,6 +709,9 @@
STRING_SCREEN_COL, "invalid value for col"
STRING_SCREEN_ROW, "invalid value for row"
STRING_TIMER_TIME "Timer %d is %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Invalid operand."
STRING_EXPECTED_CLOSE_PAREN, "Expected ')'."
Modified: trunk/reactos/base/shell/cmd/lang/es-ES.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/es-ES.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/es-ES.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/es-ES.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -300,6 +300,13 @@
STRING_MKDIR_HELP, "Crea un directorio.\n\n\
MKDIR [unidad:]ruta\nMD [unidad:]ruta"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Muestra la cantidad de memoria del sistema.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% carga de memoria.\n\n\
@@ -543,6 +550,7 @@
LABEL Crea, cambia, o borra la etiqueta de volumen de un disco.\n\
MD Crea un directorio.\n\
MKDIR Crea un directorio.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Mueve uno o más archivos de un directorio a otro.\n\
PATH Muestra o configura las rutas de búsqueda para archivos ejecutables.\n\
PAUSE Suspende el procesamiento de un archivo por lotes y muestra un mensaje.\n\
@@ -649,6 +657,9 @@
STRING_SCREEN_COL, "Valor inválido de columna"
STRING_SCREEN_ROW, "Valor inválido de fila"
STRING_TIMER_TIME "El temporizador %d es %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Operador erróneo.\n"
STRING_EXPECTED_CLOSE_PAREN, "Se esperaba ')'.\n"
Modified: trunk/reactos/base/shell/cmd/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/fr-FR.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/fr-FR.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -313,6 +313,13 @@
STRING_MKDIR_HELP, "Crée un répertoire.\n\n\
MKDIR [lecteur:]chemin\nMD [lecteur:]chemin"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Affiche la quantité de mémoire système.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% de charge mémoire.\n\n\
@@ -597,6 +604,7 @@
LABEL Créé, change, ou supprime le nom de volume d'un disque.\n\
MD Créé un répertoire.\n\
MKDIR Créé un répertoire.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Déplace un ou plusieurs fichiers d'un répertoire vers un autre\n\
répertoire.\n\
PATH Affiche ou défini un chemin de recherche pour les fichiers exécutables.\n\
@@ -715,6 +723,9 @@
STRING_SCREEN_COL, "valeur invalide pour col"
STRING_SCREEN_ROW, "valeur invalide pour lig"
STRING_TIMER_TIME "Le timer n°%d est %s : "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Opérande invalide."
STRING_EXPECTED_CLOSE_PAREN, "Attendu ')'."
Modified: trunk/reactos/base/shell/cmd/lang/hu-HU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/hu-HU.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/hu-HU.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -289,6 +289,13 @@
STRING_MKDIR_HELP, "Létrehoz egy új mappát.\n\n\
MKDIR [meghajtó:]path\nMD [meghajtó:]path"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Megjeleníti a memória statisztikát.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n A memória %12s%%-a foglalt.\n\n\
@@ -526,6 +533,7 @@
LABEL Beállítja egy kötet címkéjét.\n\
MD Létrehoz egy új mappát.\n\
MKDIR Létrehoz egy új mappát.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Áthelyez egy vagy több állományt az egyik mappából a másikba.\n\
PATH Megjeleníti vagy beállítja a keresési útvonalakat.\n\
PAUSE Felfüggeszti a futást, és vár a felhasználóra.\n\
@@ -629,4 +637,7 @@
STRING_SCREEN_COL, "Érvénytelen érték oszlopnak"
STRING_SCREEN_ROW, "Érvénytelen érték sornak"
STRING_TIMER_TIME "Idõzítõ %d értéke %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
END
Modified: trunk/reactos/base/shell/cmd/lang/id-ID.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/id-ID.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/id-ID.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/id-ID.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -302,6 +302,13 @@
STRING_MKDIR_HELP, "Membuat direktori.\n\n\
MKDIR [drive:]path\nMD [drive:]path"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Menampilkan jumlah memori sistem.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% beban memori.\n\n\
@@ -542,6 +549,7 @@
LABEL Membuat, mengubah, atau menghapus label volume disk.\n\
MD Membuat sebuah direktori.\n\
MKDIR Membuat sebuah direktori.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Memindahkan satu atau lebih file dari satu direktori ke yang lainnya\n\
directory.\n\
PATH Menampilkan atau menyetel path pencarian untuk file executable.\n\
@@ -651,6 +659,9 @@
STRING_SCREEN_COL, "Nilai untuk kolom tidak benar"
STRING_SCREEN_ROW, "Nilai untuk baris tidak benar"
STRING_TIMER_TIME "Timer %d adalah %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Operand tidak benar."
STRING_EXPECTED_CLOSE_PAREN, "Diharapkan ')'."
Modified: trunk/reactos/base/shell/cmd/lang/it-IT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/it-IT.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/it-IT.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/it-IT.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -301,6 +301,13 @@
STRING_MKDIR_HELP, "Crea una cartella.\n\n\
MKDIR [disco:]percorso\nMD [disco:]percorso"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Visualizza la quantità della memoria di sistema.\n\n\
MEMORY"
@@ -590,6 +597,7 @@
LABEL Crea, modifica, o cancella l'etichetta di un disco.\n\
MD Crea una cartella.\n\
MKDIR Crea una cartella.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Muove uno o più file da una cartella a un'altra\n\
PATH Visualizza o imposta i percorsi di ricerca per gli eseguibili.\n\
PAUSE Ferma l'esecuzione di un batch e visualizza un messaggio.\n\
@@ -705,6 +713,9 @@
STRING_SCREEN_COL, "valore non valido per colonna"
STRING_SCREEN_ROW, "valore non valido per riga"
STRING_TIMER_TIME "Timer %d è %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Operando non valido."
STRING_EXPECTED_CLOSE_PAREN, "Attesa una ')'."
Modified: trunk/reactos/base/shell/cmd/lang/ja-JP.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ja-JP.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/ja-JP.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ja-JP.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -310,6 +310,13 @@
MKDIR [hCu:]pX\n\
MD [hCu:]pX"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "VXe ÌÊð\\¦µÜ·B\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% ̪gp³êĢܷB\n\n\
@@ -551,6 +558,7 @@
LABEL fBXNÌ{
[ xð\\¦Ü½ÍÏXµÜ·B\n\
MD fBNgð쬵ܷB\n\
MKDIR fBNgð쬵ܷB\n\
+MKLINK Creates a filesystem link object.\n\
MOVE t@CðÚ®¨æÑt@CÆfBNg¼ðÏXµÜ·B\n\
PATH ÀsÂ\\t@CÌõpXð\\¦Ü½ÍÝèµÜ·B\n\
PAUSE ob` vOÌðêâ~µAbZ[Wð\\¦µÜ·B\n\
@@ -658,6 +666,9 @@
STRING_SCREEN_COL, "sÌlª³øÅ·B"
STRING_SCREEN_ROW, "ñÌlª³øÅ·B"
STRING_TIMER_TIME "^C}[ %d Í %s Å·B: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "³øÈIyhÅ·B"
STRING_EXPECTED_CLOSE_PAREN, "Expected ')'"
Modified: trunk/reactos/base/shell/cmd/lang/no-NO.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/no-NO.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/no-NO.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/no-NO.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -294,6 +294,13 @@
STRING_MKDIR_HELP, "Oppretter en mappe.\n\n\
MKDIR [stasjon:]mappe\nMD [stasjon:]mappe"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Vis mengde av system minne.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% benyttet minne.\n\n\
@@ -534,6 +541,7 @@
LABEL Oppretter, endrer, eller sletter volumnavnet på en disk.\n\
MD Oppretter en mappe.\n\
MKDIR Oppretter en mappe.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Flytter en eller flere filer fra en mappe til en annen.\n\
PATH Vis eller sett en søkesti for kjørbare filer.\n\
PAUSE Avbryter behandling av en satsvis fil, og viser en melding.\n\
@@ -643,6 +651,9 @@
STRING_SCREEN_COL, "ugyldig verdi for kolonne"
STRING_SCREEN_ROW, "ugyldig verdi for rad"
STRING_TIMER_TIME "Stoppeklokke %d er %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Ugyldig operand."
STRING_EXPECTED_CLOSE_PAREN, "Forventet ')'."
Modified: trunk/reactos/base/shell/cmd/lang/pl-PL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/pl-PL.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/pl-PL.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -300,6 +300,13 @@
STRING_MKDIR_HELP, "Tworzy katalog.\n\n\
MKDIR [napêd:]cie¿ka\nMD [napêd:]cie¿ka"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Wywietla iloæ pamiêci systemowej.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% pamiêci zajêtej.\n\n\
@@ -541,6 +548,7 @@
LABEL Tworzy, zmienia lub kasuje etykietê woluminu w danym napêdzie.\n\
MD Tworzy katalog.\n\
MKDIR Tworzy katalog.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Przenosi jeden lub wiêcej plików z jednego katalogu do drugiego.\n\
PATH Wywietla lub ustawia cie¿ki dostêpu dla programów.\n\
PAUSE Zawiesza przetwarzanie programu wsadowego i wywietla komunikat.\n\
@@ -649,6 +657,9 @@
STRING_SCREEN_COL, "nieprawid³owy numer kolumny"
STRING_SCREEN_ROW, "nieprawid³owy numer rzêdu"
STRING_TIMER_TIME "Stoper %d czas - %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Nieprawid³owy argument operatora."
STRING_EXPECTED_CLOSE_PAREN, "Oczekiwano ')'."
Modified: trunk/reactos/base/shell/cmd/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/ru-RU.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/ru-RU.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -307,6 +307,13 @@
STRING_MKDIR_HELP, "Ñîçäàíèå êàòàëîãà.\n\n\
MKDIR [äèñê:]ïóòü\nMD [äèñê:]ïóòü"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Âûâîä îáúåìà ñèñòåìíîé ïàìÿòè.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n\
@@ -548,6 +555,7 @@
LABEL Ñîçäàíèå, èçìåíåíèå è óäàëåíèå ìåòîê òîìà.\n\
MD Ñîçäàíèå êàòàëîãà.\n\
MKDIR Ñîçäàíèå êàòàëîãà.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Ïåðåìåùåíèå ôàéëîâ è ïåðåèìåíîâàíèå ôàéëîâ è êàòàëîãîâ\n\
PATH Âûâîä èëè çàäàíèå ïóòè ïîèñêà èñïîëíÿåìûõ ôàéëîâ.\n\
PAUSE Ïðèîñòàíîâêà âûïîëíåíèÿ ïàêåòíîãî ôàéëà.\n\
@@ -656,6 +664,9 @@
STRING_SCREEN_COL, "íåïðàâèëüíîå çíà÷åíèå äëÿ êîë"
STRING_SCREEN_ROW, "íåïðàâèëüíîå çíà÷åíèå äëÿ ñòð"
STRING_TIMER_TIME "Timer %d is %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Íåâåðíûé îïåðàíä."
STRING_EXPECTED_CLOSE_PAREN, "Îæèäàåòñÿ ')'."
Modified: trunk/reactos/base/shell/cmd/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/lang/uk-UA.…
==============================================================================
--- trunk/reactos/base/shell/cmd/lang/uk-UA.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/lang/uk-UA.rc [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -306,6 +306,13 @@
STRING_MKDIR_HELP, "Creates a directory.\n\n\
MKDIR [drive:]path\nMD [drive:]path"
+STRING_MKLINK_HELP, "Creates a filesystem link object.\n\n\
+MKLINK [/D | /H | /J] linkname target\n\n\
+ /D Indicates that the symbolic link target is a directory.\n\
+ /H Create a hard link.\n\
+ /J Create a directory junction.\n\n\
+If neither /H or /J is specified, a symbolic link is created."
+
STRING_MEMMORY_HELP1, "Displays the amount of system memory.\n\nMEMORY"
STRING_MEMMORY_HELP2, "\n %12s%% memory load.\n\n\
@@ -587,6 +594,7 @@
LABEL Ñòâîðåííÿ, çì³íà, àáî âèäàëåííÿ ì³òîê òîìó äèñêà.\n\
MD Ñòâîðåííÿ ïàïêè.\n\
MKDIR Ñòâîðåííÿ ïàïêè.\n\
+MKLINK Creates a filesystem link object.\n\
MOVE Ïåðåì³ùåííÿ îäíîãî àáî á³ëüøå ôàéë³â ç îäí³º¿ ïàïêè äî ³íøî¿\n\
ïàïêè.\n\
PATH ³äîáðàæåííÿ àáî âñòàíîâëåííÿ øëÿõó ïîøóêó âèêîíóâàíèõ ôàéë³â.\n\
@@ -705,6 +713,9 @@
STRING_SCREEN_COL, "íåïðàâèëüíå çíà÷åííÿ col"
STRING_SCREEN_ROW, "íåïðàâèëüíå çíà÷åííÿ row"
STRING_TIMER_TIME "Òàéìåð %d - %s: "
+STRING_MKLINK_CREATED_SYMBOLIC, "Symbolic link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_HARD, "Hard link created for %s <<===>>
%s\n"
+STRING_MKLINK_CREATED_JUNCTION, "Junction created for %s <<===>>
%s\n"
STRING_INVALID_OPERAND, "Íåâ³ðíèé îïåðàíä."
STRING_EXPECTED_CLOSE_PAREN, "Î÷³êóºòüñÿ ')'."
Added: trunk/reactos/base/shell/cmd/mklink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/mklink.c?re…
==============================================================================
--- trunk/reactos/base/shell/cmd/mklink.c (added)
+++ trunk/reactos/base/shell/cmd/mklink.c [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -1,0 +1,219 @@
+/*
+ * MKLINK.C - mklink internal command.
+ */
+
+#include <precomp.h>
+
+#ifdef INCLUDE_CMD_MKLINK
+
+/* There is no API for creating junctions, so we must do it the hard way */
+static BOOL CreateJunction(LPCTSTR LinkName, LPCTSTR TargetName)
+{
+ /* Structure for reparse point daya when ReparseTag is one of
+ * the tags defined by Microsoft. Copied from MinGW winnt.h */
+ typedef struct _REPARSE_DATA_BUFFER {
+ DWORD ReparseTag;
+ WORD ReparseDataLength;
+ WORD Reserved;
+ _ANONYMOUS_UNION union {
+ struct {
+ WORD SubstituteNameOffset;
+ WORD SubstituteNameLength;
+ WORD PrintNameOffset;
+ WORD PrintNameLength;
+ ULONG Flags;
+ WCHAR PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+ struct {
+ WORD SubstituteNameOffset;
+ WORD SubstituteNameLength;
+ WORD PrintNameOffset;
+ WORD PrintNameLength;
+ WCHAR PathBuffer[1];
+ } MountPointReparseBuffer;
+ struct {
+ BYTE DataBuffer[1];
+ } GenericReparseBuffer;
+ } DUMMYUNIONNAME;
+ } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
+
+ HMODULE hNTDLL = GetModuleHandle(_T("NTDLL"));
+ BOOLEAN (WINAPI *RtlDosPathNameToNtPathName_U)(PCWSTR, PUNICODE_STRING, PCWSTR *, CURDIR
*)
+ = (BOOLEAN (WINAPI *)())GetProcAddress(hNTDLL,
"RtlDosPathNameToNtPathName_U");
+ VOID (WINAPI *RtlFreeUnicodeString)(PUNICODE_STRING)
+ = (VOID (WINAPI *)())GetProcAddress(hNTDLL, "RtlFreeUnicodeString");
+
+ TCHAR TargetFullPath[MAX_PATH];
+#ifdef UNICODE
+#define TargetFullPathW TargetFullPath
+#else
+ WCHAR TargetFullPathW[MAX_PATH];
+#endif
+ UNICODE_STRING TargetNTPath;
+ HANDLE hJunction;
+
+ /* The data for this kind of reparse point has two strings:
+ * The first ("SubstituteName") is the full target path in NT format,
+ * the second ("PrintName") is the full target path in Win32 format.
+ * Both of these must be wide-character strings. */
+ if (!RtlDosPathNameToNtPathName_U ||
+ !RtlFreeUnicodeString ||
+ !GetFullPathName(TargetName, MAX_PATH, TargetFullPath, NULL) ||
+#ifndef UNICODE
+ !MultiByteToWideChar(CP_ACP, 0, TargetFullPath, -1, TargetFullPathW, -1) ||
+#endif
+ !RtlDosPathNameToNtPathName_U(TargetFullPathW, &TargetNTPath, NULL, NULL))
+ {
+ return FALSE;
+ }
+
+ /* We have both the names we need, so time to create the junction.
+ * Start with an empty directory */
+ if (!CreateDirectory(LinkName, NULL))
+ {
+ RtlFreeUnicodeString(&TargetNTPath);
+ return FALSE;
+ }
+
+ /* Open the directory we just created */
+ hJunction = CreateFile(LinkName, GENERIC_WRITE, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (hJunction != INVALID_HANDLE_VALUE)
+ {
+ /* Allocate a buffer large enough to hold both strings, including trailing NULs */
+ DWORD TargetLen = wcslen(TargetFullPathW) * sizeof(WCHAR);
+ DWORD DataSize = FIELD_OFFSET(REPARSE_DATA_BUFFER, MountPointReparseBuffer.PathBuffer)
+ + TargetNTPath.Length + sizeof(WCHAR)
+ + TargetLen + sizeof(WCHAR);
+ PREPARSE_DATA_BUFFER Data = _alloca(DataSize);
+
+ /* Fill it out and use it to turn the directory into a reparse point */
+ Data->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
+ Data->ReparseDataLength = DataSize - FIELD_OFFSET(REPARSE_DATA_BUFFER,
MountPointReparseBuffer);
+ Data->Reserved = 0;
+ Data->MountPointReparseBuffer.SubstituteNameOffset = 0;
+ Data->MountPointReparseBuffer.SubstituteNameLength = TargetNTPath.Length;
+ wcscpy(Data->MountPointReparseBuffer.PathBuffer,
+ TargetNTPath.Buffer);
+ Data->MountPointReparseBuffer.PrintNameOffset = TargetNTPath.Length +
sizeof(WCHAR);
+ Data->MountPointReparseBuffer.PrintNameLength = TargetLen;
+ wcscpy((WCHAR *)((BYTE *)Data->MountPointReparseBuffer.PathBuffer
+ + Data->MountPointReparseBuffer.PrintNameOffset),
+ TargetFullPathW);
+ if (DeviceIoControl(hJunction, FSCTL_SET_REPARSE_POINT,
+ Data, DataSize, NULL, 0, &DataSize, NULL))
+ {
+ /* Success */
+ CloseHandle(hJunction);
+ RtlFreeUnicodeString(&TargetNTPath);
+ return TRUE;
+ }
+ CloseHandle(hJunction);
+ }
+ RemoveDirectory(LinkName);
+ RtlFreeUnicodeString(&TargetNTPath);
+ return FALSE;
+}
+
+INT
+cmd_mklink(LPTSTR param)
+{
+ HMODULE hKernel32 = GetModuleHandle(_T("KERNEL32"));
+ DWORD Flags = 0;
+ enum { SYMBOLIC, HARD, JUNCTION } LinkType = SYMBOLIC;
+ INT NumFiles = 0;
+ LPTSTR Name[2];
+ INT argc, i;
+ LPTSTR *arg;
+
+ if (!_tcsncmp(param, _T("/?"), 2))
+ {
+ ConOutResPuts(STRING_MKLINK_HELP);
+ return 0;
+ }
+
+ arg = split(param, &argc, FALSE);
+ for (i = 0; i < argc; i++)
+ {
+ if (arg[i][0] == _T('/'))
+ {
+ if (!_tcsicmp(arg[i], _T("/D")))
+ Flags |= 1; /* SYMBOLIC_LINK_FLAG_DIRECTORY */
+ else if (!_tcsicmp(arg[i], _T("/H")))
+ LinkType = HARD;
+ else if (!_tcsicmp(arg[i], _T("/J")))
+ LinkType = JUNCTION;
+ else
+ {
+ error_invalid_switch(arg[i][1]);
+ freep(arg);
+ return 1;
+ }
+ }
+ else
+ {
+ if (NumFiles == 2)
+ {
+ error_too_many_parameters(arg[i]);
+ freep(arg);
+ return 1;
+ }
+ Name[NumFiles++] = arg[i];
+ }
+ }
+ freep(arg);
+
+ if (NumFiles != 2)
+ {
+ error_req_param_missing();
+ return 1;
+ }
+
+ nErrorLevel = 0;
+
+ if (LinkType == SYMBOLIC)
+ {
+ /* CreateSymbolicLink doesn't exist in old versions of Windows,
+ * so load dynamically */
+ BOOL (WINAPI *CreateSymbolicLink)(LPCTSTR, LPCTSTR, DWORD)
+#ifdef UNICODE
+ = (BOOL (WINAPI *)())GetProcAddress(hKernel32, "CreateSymbolicLinkW");
+#else
+ = (BOOL (WINAPI *)())GetProcAddress(hKernel32, "CreateSymbolicLinkA");
+#endif
+ if (CreateSymbolicLink && CreateSymbolicLink(Name[0], Name[1], Flags))
+ {
+ ConOutResPrintf(STRING_MKLINK_CREATED_SYMBOLIC, Name[0], Name[1]);
+ return 0;
+ }
+ }
+ else if (LinkType == HARD)
+ {
+ /* CreateHardLink doesn't exist in old versions of Windows,
+ * so load dynamically */
+ BOOL (WINAPI *CreateHardLink)(LPCTSTR, LPCTSTR, LPSECURITY_ATTRIBUTES)
+#ifdef UNICODE
+ = (BOOL (WINAPI *)())GetProcAddress(hKernel32, "CreateHardLinkW");
+#else
+ = (BOOL (WINAPI *)())GetProcAddress(hKernel32, "CreateHardLinkA");
+#endif
+ if (CreateHardLink && CreateHardLink(Name[0], Name[1], NULL))
+ {
+ ConOutResPrintf(STRING_MKLINK_CREATED_HARD, Name[0], Name[1]);
+ return 0;
+ }
+ }
+ else
+ {
+ if (CreateJunction(Name[0], Name[1]))
+ {
+ ConOutResPrintf(STRING_MKLINK_CREATED_JUNCTION, Name[0], Name[1]);
+ return 0;
+ }
+ }
+
+ ErrorMessage(GetLastError(), _T("MKLINK"));
+ return 1;
+}
+
+#endif /* INCLUDE_CMD_MKLINK */
Propchange: trunk/reactos/base/shell/cmd/mklink.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/shell/cmd/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/resource.h?…
==============================================================================
--- trunk/reactos/base/shell/cmd/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/resource.h [iso-8859-1] Wed Mar 18 01:27:33 2009
@@ -89,6 +89,7 @@
#define STRING_CMD_HELP7 614
#define STRING_CMD_HELP8 615
#define STRING_ASSOC_HELP 616
+#define STRING_MKLINK_HELP 617
#define STRING_CMD_SHELLINFO 624
@@ -242,6 +243,9 @@
#define STRING_REPLACE_HELP10 736
#define STRING_REPLACE_HELP11 737
+#define STRING_MKLINK_CREATED_SYMBOLIC 738
+#define STRING_MKLINK_CREATED_HARD 739
+#define STRING_MKLINK_CREATED_JUNCTION 740
/* These strings are language independent (cmd.rc) */
#define STRING_FREEDOS_DEV 800