Sync up to trunk head.

svn path=/branches/header-work/; revision=47301
This commit is contained in:
Amine Khaldi
2010-05-22 13:41:48 +00:00
636 changed files with 26145 additions and 32687 deletions
-5
View File
@@ -472,11 +472,6 @@ rgenstat: $(RGENSTAT_TARGET)
$(ECHO_RGENSTAT)
$(Q)$(RGENSTAT_TARGET) apistatus.lst apistatus.xml
.PHONY: cb
cb: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
$(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) cb
.PHONY: msbuild
msbuild: $(ROS_BUILDENGINE)
$(ECHO_RBUILD)
+3
View File
@@ -74,6 +74,9 @@
<directory name="inflib">
<xi:include href="lib/inflib/inflib.rbuild" />
</directory>
<directory name="newinflib">
<xi:include href="lib/newinflib/inflib.rbuild" />
</directory>
<directory name="cmlib">
<xi:include href="lib/cmlib/cmlib.rbuild" />
</directory>
+78
View File
@@ -0,0 +1,78 @@
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
BEGIN
IDS_HELP, "ファイルのアクセス制御リスト(ACL) を表\示または変更します。\n\n\
CACLS ファイル名 [/T] [/E] [/C] [/G ユーザー名:アクセス権]\n\
[/R ユーザー名 [...]] [/P ユーザー名:アクセス権 [...]]\n\
[/D ユーザー名 [...]]\n\
ファイル名 ACL を表\示します。\n\
/T 現在のディレクトリとすべてのサブディレクトリにある\n\
指定されたファイルの ACL を変更します。\n\
/E ACL を置き換えずに、ACL を編集します。\n\
/C アクセス拒否エラーを無視して、ACL の変更を続行します。\n\
/G ユーザー名:アクセス権\n\
指定されたユーザーにアクセス権を与えます。\n\
アクセス権: R 読み取り\n\
W 書き込み\n\
C 変更 (書き込み)\n\
F フル コントロール\n\
/R ユーザー名 指定されたユーザーのアクセス権を失効させます。\n\
(/E オプションと共に使用)。\n\
/P ユーザー名:アクセス権\n\
指定されたユーザーのアクセス権を置き換えます。\n\
アクセス権: N なし\n\
W 書き込み\n\
R 読み取り\n\
C 変更 (書き込み)\n\
F フル コントロール\n\
/D ユーザー名 指定されたユーザーのアクセスを拒否します。\n\
複数のファイルを指定するには、ワイルドカードを使用できます。\n\
複数のユーザーを指定できます。\n\n\
省略形:\n\
CI - コンテナ継承。\n\
ACE はディレクトリに継承されます。\n\
OI - オブジェクト継承。\n\
ACE はファイルに継承されます。\n\
IO - 継承のみ。\n\
ACE は現在のファイル/ディレクトリに適用されません。\n"
IDS_ABBR_CI, "(CI)"
IDS_ABBR_OI, "(OI)"
IDS_ABBR_IO, "(IO)"
IDS_ABBR_FULL, "F"
IDS_ABBR_READ, "R"
IDS_ABBR_WRITE, "W"
IDS_ABBR_CHANGE, "C"
IDS_ABBR_NONE, "N"
IDS_ALLOW, ""
IDS_DENY, "(DENY)"
IDS_SPECIAL_ACCESS, "(special access:)"
IDS_GENERIC_READ, "GENERIC_READ"
IDS_GENERIC_WRITE, "GENERIC_WRITE"
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
IDS_GENERIC_ALL, "GENERIC_ALL"
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
IDS_FILE_READ_DATA, "FILE_READ_DATA"
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
IDS_FILE_READ_EA, "FILE_READ_EA"
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
IDS_FILE_EXECUTE, "FILE_EXECUTE"
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
IDS_SYNCHRONIZE, "SYNCHRONIZE"
IDS_WRITE_OWNER, "WRITE_OWNER"
IDS_WRITE_DAC, "WRITE_DAC"
IDS_READ_CONTROL, "READ_CONTROL"
IDS_DELETE, "DELETE"
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
END
+1
View File
@@ -10,6 +10,7 @@
#include "lang/fr-FR.rc"
#include "lang/id-ID.rc"
#include "lang/it-IT.rc"
#include "lang/ja-JP.rc"
#include "lang/ko-KR.rc"
#include "lang/no-NO.rc"
#include "lang/nl-NL.rc"
+1 -1
View File
@@ -204,7 +204,7 @@ Display_SetString(HWND hwnd, LPARAM lParam)
pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
_snwprintf(pData->szString, MAX_STRING, (WCHAR*)lParam);
// FIXME: redraw the window
InvalidateRect(hwnd, NULL, TRUE);
return 0;
}
+1 -8
View File
@@ -21,13 +21,6 @@
#include <winsock2.h> /* winsock2.h first */
#include <precomp.h>
//FIXME: remove eventually
#ifndef _UNICODE
#define _UNICODE
#endif
#include <tchar.h>
extern char g_username[];
extern char g_hostname[];
extern char g_servername[];
@@ -89,7 +82,7 @@ uni_to_str(char * sizex, TCHAR * size1)
int len;
int i;
len = _tcslen(size1);
len = lstrlen(size1);
for (i = 0; i < len; i++)
{
sizex[i] = (char)size1[i];
+6 -3
View File
@@ -143,6 +143,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
HBITMAP tempBm;
int i;
TCHAR tooltips[16][30];
HDC hDC;
TCHAR *c;
TCHAR sfnFilename[1000];
@@ -152,7 +153,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
TCHAR ofnFiletitle[256];
TCHAR ofnFilter[1000];
TCHAR miniaturetitle[100];
int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
static int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
};
@@ -371,8 +372,10 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient,
NULL, hThisInstance, NULL);
hDrawingDC = CreateCompatibleDC(GetDC(hImageArea));
hSelDC = CreateCompatibleDC(GetDC(hImageArea));
hDC = GetDC(hImageArea);
hDrawingDC = CreateCompatibleDC(hDC);
hSelDC = CreateCompatibleDC(hDC);
ReleaseDC(hImageArea, hDC);
SelectObject(hDrawingDC, CreatePen(PS_SOLID, 0, fgColor));
SelectObject(hDrawingDC, CreateSolidBrush(bgColor));
+72
View File
@@ -25,6 +25,34 @@ placeSelWin()
//SendMessage(hSelection, WM_PAINT, 0, 0);
}
void
regularize(short x0, short y0, short *x1, short *y1)
{
if (abs(*x1 - x0) >= abs(*y1 - y0))
*y1 = y0 + (*y1 > y0 ? abs(*x1 - x0) : -abs(*x1 - x0));
else
*x1 = x0 + (*x1 > x0 ? abs(*y1 - y0) : -abs(*y1 - y0));
}
void
roundTo8Directions(short x0, short y0, short *x1, short *y1)
{
if (abs(*x1 - x0) >= abs(*y1 - y0))
{
if (abs(*y1 - y0) * 5 < abs(*x1 - x0) * 2)
*y1 = y0;
else
*y1 = y0 + (*y1 > y0 ? abs(*x1 - x0) : -abs(*x1 - x0));
}
else
{
if (abs(*x1 - x0) * 5 < abs(*y1 - y0) * 2)
*x1 = x0;
else
*x1 = x0 + (*x1 > x0 ? abs(*y1 - y0) : -abs(*y1 - y0));
}
}
POINT pointStack[256];
short pointSP;
POINT *ptStack = NULL;
@@ -147,6 +175,8 @@ whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
break;
case 11:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
roundTo8Directions(startX, startY, &x, &y);
Line(hdc, startX, startY, x, y, fg, lineWidth);
break;
case 12:
@@ -169,21 +199,30 @@ whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
break;
case 13:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Rect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
case 14:
resetToU1();
pointStack[pointSP].x = x;
pointStack[pointSP].y = y;
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y,
(short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y);
if (pointSP + 1 >= 2)
Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE);
break;
case 15:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Ellp(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
case 16:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
}
@@ -276,6 +315,8 @@ endPaintingL(HDC hdc, short x, short y, int fg, int bg)
break;
case 11:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
roundTo8Directions(startX, startY, &x, &y);
Line(hdc, startX, startY, x, y, fg, lineWidth);
break;
case 12:
@@ -285,12 +326,17 @@ endPaintingL(HDC hdc, short x, short y, int fg, int bg)
break;
case 13:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Rect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
case 14:
resetToU1();
pointStack[pointSP].x = x;
pointStack[pointSP].y = y;
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y,
(short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y);
pointSP++;
if (pointSP >= 2)
{
@@ -310,10 +356,14 @@ endPaintingL(HDC hdc, short x, short y, int fg, int bg)
break;
case 15:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Ellp(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
case 16:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break;
}
@@ -398,6 +448,8 @@ whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
break;
case 11:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
roundTo8Directions(startX, startY, &x, &y);
Line(hdc, startX, startY, x, y, bg, lineWidth);
break;
case 12:
@@ -420,21 +472,30 @@ whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
break;
case 13:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Rect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
case 14:
resetToU1();
pointStack[pointSP].x = x;
pointStack[pointSP].y = y;
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y,
(short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y);
if (pointSP + 1 >= 2)
Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE);
break;
case 15:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Ellp(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
case 16:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
RRect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
}
@@ -457,6 +518,8 @@ endPaintingR(HDC hdc, short x, short y, int fg, int bg)
break;
case 11:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
roundTo8Directions(startX, startY, &x, &y);
Line(hdc, startX, startY, x, y, bg, lineWidth);
break;
case 12:
@@ -466,12 +529,17 @@ endPaintingR(HDC hdc, short x, short y, int fg, int bg)
break;
case 13:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Rect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
case 14:
resetToU1();
pointStack[pointSP].x = x;
pointStack[pointSP].y = y;
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y,
(short *)&pointStack[pointSP].x, (short *)&pointStack[pointSP].y);
pointSP++;
if (pointSP >= 2)
{
@@ -491,10 +559,14 @@ endPaintingR(HDC hdc, short x, short y, int fg, int bg)
break;
case 15:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
Ellp(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
case 16:
resetToU1();
if (GetAsyncKeyState(VK_SHIFT) < 0)
regularize(startX, startY, &x, &y);
RRect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break;
}
+193
View File
@@ -0,0 +1,193 @@
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDR_MAINMENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Preferenze", ID_SETTINGS
MENUITEM SEPARATOR
MENUITEM "E&sci", ID_EXIT
END
POPUP "&Programmi"
BEGIN
MENUITEM "&Installa", ID_INSTALL
MENUITEM "&Disinstalla",ID_UNINSTALL
MENUITEM "&Modifica", ID_MODIFY
MENUITEM SEPARATOR
MENUITEM "&Remuovi da Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Aggiorna", ID_REFRESH
END
POPUP "?"
BEGIN
MENUITEM "Guida", ID_HELP, GRAYED
MENUITEM "Informazioni", ID_ABOUT
END
END
IDR_LINKMENU MENU
BEGIN
POPUP "popup"
BEGIN
MENUITEM "&Apri il collegamento in un browser", ID_OPEN_LINK
MENUITEM "&Copia il collegamento negli appunti", ID_COPY_LINK
END
END
IDR_APPLICATIONMENU MENU
BEGIN
POPUP "popup"
BEGIN
MENUITEM "&Installa", ID_INSTALL
MENUITEM "&Disinstalla", ID_UNINSTALL
MENUITEM "&Modifica", ID_MODIFY
MENUITEM SEPARATOR
MENUITEM "&Rimuovi da Registry", ID_REGREMOVE
MENUITEM SEPARATOR
MENUITEM "&Aggiorna", ID_REFRESH
END
END
IDD_SETTINGS_DIALOG DIALOGEX DISCARDABLE 0, 0, 250, 144
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Impostazioni"
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Generale", -1, 4, 2, 240, 61
AUTOCHECKBOX "&Salva la posizione della finestra", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12
AUTOCHECKBOX "&Aggiorna la lista dei programmi accessibili", IDC_UPDATE_AVLIST, 15, 29, 219, 12
AUTOCHECKBOX "&Registra la installazione o disinstallazione dei programmi", IDC_LOG_ENABLED, 15, 46, 219, 12
GROUPBOX "Downloading", -1, 4, 65, 240, 51
LTEXT "Cartella:", -1, 16, 75, 100, 9
EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP
PUSHBUTTON "&Scegli", IDC_CHOOSE, 187, 85, 50, 14
AUTOCHECKBOX "&Rimuovere la procedura di installazione dopo l'uso", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12
PUSHBUTTON "Predefiniti", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14
PUSHBUTTON "OK", IDOK, 116, 124, 60, 14
PUSHBUTTON "Annulla", IDCANCEL, 181, 124, 60, 14
END
IDD_INSTALL_DIALOG DIALOGEX DISCARDABLE 0, 0, 216, 97
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Installazione"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "...", IDC_INSTALL_TEXT, 4, 5, 209, 35
AUTORADIOBUTTON "&Installa da un disco (CD o DVD)", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP
AUTORADIOBUTTON "&Scarica e installa", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP
PUSHBUTTON "OK", IDOK, 86, 78, 60, 14
PUSHBUTTON "Annulla", IDCANCEL, 150, 78, 60, 14
END
IDD_DOWNLOAD_DIALOG DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
CAPTION "Download in corso"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12
LTEXT "", IDC_DOWNLOAD_STATUS, 10, 30, 200, 10, SS_CENTER
PUSHBUTTON "Annulla", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
END
IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66
STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
CAPTION "Informazioni"
FONT 8, "MS Shell Dlg"
BEGIN
LTEXT "Gestione applicazioni di ReactOS \nCopyright (C) 2009\nby Dmitry Chapyshev ([email protected])", IDC_STATIC, 48, 7, 130, 39
PUSHBUTTON "Chiudi", IDOK, 133, 46, 50, 14
ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_TOOLTIP_INSTALL "Installa"
IDS_TOOLTIP_UNINSTALL "Disinstalla"
IDS_TOOLTIP_MODIFY "Modifica"
IDS_TOOLTIP_SETTINGS "Impostazioni"
IDS_TOOLTIP_REFRESH "Aggiorna"
IDS_TOOLTIP_EXIT "Esci"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_APP_NAME "Nome"
IDS_APP_INST_VERSION "Versione"
IDS_APP_DESCRIPTION "Descrizione"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_INFO_VERSION "\nVersione: "
IDS_INFO_DESCRIPTION "\nDescrizione: "
IDS_INFO_PUBLISHER "\nPubblicato da: "
IDS_INFO_HELPLINK "\nHelp Link: "
IDS_INFO_HELPPHONE "\nHelp Telefono: "
IDS_INFO_README "\nLeggimi: "
IDS_INFO_REGOWNER "\nProprietario registrato: "
IDS_INFO_PRODUCTID "\nID prodotto: "
IDS_INFO_CONTACT "\nContatto: "
IDS_INFO_UPDATEINFO "\nInformazioni di aggiornamento: "
IDS_INFO_INFOABOUT "\nInformazioni: "
IDS_INFO_COMMENTS "\nCommenti: "
IDS_INFO_INSTLOCATION "\nInstallato in: "
IDS_INFO_INSTALLSRC "\nProvenienza Installazione: "
IDS_INFO_UNINSTALLSTR "\nStringa di disinstallazione: "
IDS_INFO_MODIFYPATH "\nModifica percorso: "
IDS_INFO_INSTALLDATE "\nData installazione: "
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_AINFO_VERSION "\nVersione: "
IDS_AINFO_DESCRIPTION "\nDescrizione: "
IDS_AINFO_SIZE "\nDimensione: "
IDS_AINFO_URLSITE "\nHome Page: "
IDS_AINFO_LICENCE "\nLicenza: "
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_CAT_AUDIO "Audio"
IDS_CAT_DEVEL "Sviluppo"
IDS_CAT_DRIVERS "Drivers"
IDS_CAT_EDU "Edutainment"
IDS_CAT_ENGINEER "Engineering"
IDS_CAT_FINANCE "Finanza"
IDS_CAT_GAMES "Giochi e divertimento"
IDS_CAT_GRAPHICS "Graphica"
IDS_CAT_INTERNET "Internet & rete"
IDS_CAT_LIBS "Librerie"
IDS_CAT_OFFICE "Ufficio"
IDS_CAT_OTHER "Altro"
IDS_CAT_SCIENCE "Scienza"
IDS_CAT_TOOLS "Strumenti"
IDS_CAT_VIDEO "Video"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_APPTITLE "ReactOS Applications Manager"
IDS_SEARCH_TEXT "Cerca..."
IDS_INSTALL "Installa"
IDS_UNINSTALL "Disinstall"
IDS_MODIFY "Modifica"
IDS_APPS_COUNT "Numero applicazioni: %d"
IDS_WELCOME_TITLE "Benvenuto!\n\n"
IDS_WELCOME_TEXT "Scegliere una categoria a sinistra, poi scegliere una applicazione da installare o disinstallare.\nReactOS Web Site: "
IDS_WELCOME_URL "http://www.reactos.org"
IDS_INSTALLED "Installato"
IDS_AVAILABLEFORINST "Disponibile"
IDS_UPDATES "Aggiornamenti"
IDS_APPLICATIONS "Applicazioni"
IDS_CHOOSE_FOLDER_TEXT "Scegliere una cartella dove scaricare le applicazioni:"
IDS_CHOOSE_FOLDER_ERROR "La cartella indicata non esiste."
IDS_USER_NOT_ADMIN "Dovete essere Amministratore per avviare ""ReactOS Applications Manager""!"
IDS_APP_REG_REMOVE "Sicuro di voler cancellare dal registry i dati sui programmi installati?"
IDS_INFORMATION "Informazioni"
IDS_UNABLE_TO_REMOVE "Impossibile cancellare i dati dal registry!"
END
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = DOSBox
Version = 0.73
Version = 0.74
Licence = GPL
Description = DOSBox is a DOS emulator.
Size = 1.4MB
Category = 15
URLSite = http://www.dosbox.com/
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.73-win32-installer.exe
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.74-win32-installer.exe
CDPath = none
[Section.0407]
+6 -6
View File
@@ -8,35 +8,35 @@ Description = The most popular and one of the best free Web Browsers out there.
Size = 5.8M
Category = 5
URLSite = http://www.mozilla.com/en-US/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/en-US/Firefox%20Setup%202.0.0.20.exe
CDPath = none
[Section.0407]
Description = Der populärste und einer der besten freien Webbrowser.
Size = 5.5M
URLSite = http://www.mozilla-europe.org/de/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/de/Firefox%20Setup%202.0.0.20.exe
[Section.040a]
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
Size = 5.6M
URLSite = http://www.mozilla-europe.org/es/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/es-ES/Firefox%20Setup%202.0.0.20.exe
[Section.0414]
Description = Mest populære og best også gratis nettleserene der ute.
Size = 5.6M
URLSite = http://www.mozilla-europe.org/no/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/nb-NO/Firefox%20Setup%202.0.0.20.exe
[Section.0415]
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
Size = 6.3M
URLSite = http://www.mozilla-europe.org/pl/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/pl/Firefox%20Setup%202.0.0.20.exe
[Section.0419]
Description = Один из самых популярных и лучших бесплатных браузеров.
Size = 6.4M
URLSite = http://www.mozilla-europe.org/ru/
URLDownload = http://mozilla.mirrors.easynews.com/mozilla/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe
URLDownload = http://194.71.11.70/pub/www/clients/mozilla.org/firefox/releases/2.0.0.20/win32/ru/Firefox%20Setup%202.0.0.20.exe
+6 -6
View File
@@ -8,35 +8,35 @@ Description = The most popular and one of the best free Web Browsers out there.
Size = 7.2M
Category = 5
URLSite = http://www.mozilla.com/en-US/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/en-US/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/en-US/Firefox%20Setup%203.0.19.exe
CDPath = none
[Section.0407]
Description = Der populärste und einer der besten freien Webbrowser.
Size = 7.0M
URLSite = http://www.mozilla-europe.org/de/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/de/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/de/Firefox%20Setup%203.0.19.exe
[Section.040a]
Description = El más popular y uno de los mejores navegadores web gratuitos que hay.
Size = 7.0M
URLSite = http://www.mozilla-europe.org/es/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/es-ES/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/es-ES/Firefox%20Setup%203.0.19.exe
[Section.0414]
Description = Mest populære og best også gratis nettleserene der ute.
Size = 7.0M
URLSite = http://www.mozilla-europe.org/no/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/nb-NO/Firefox%20Setup%203.0.19.exe
[Section.0415]
Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych.
Size = 7.8M
URLSite = http://www.mozilla-europe.org/pl/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/pl/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/pl/Firefox%20Setup%203.0.19.exe
[Section.0419]
Description = Один из самых популярных и лучших бесплатных браузеров.
Size = 7.4M
URLSite = http://www.mozilla-europe.org/ru/
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real/win32/ru/Firefox%20Setup%203.0.19.exe
URLDownload = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/ru/Firefox%20Setup%203.0.19.exe
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = IrfanView
Version = 4.25
Version = 4.27
Licence = Freeware (for personal use)
Description = Viewer for all kinds of graphics/audio files/video files.
Size = 1.3MB
Category = 3
URLSite = http://www.irfanview.com/
URLDownload = http://irfanview.tuwien.ac.at/iview425_setup.exe
URLDownload = http://irfanview.tuwien.ac.at/iview427_setup.exe
CDPath = none
[Section.0407]
@@ -2,13 +2,13 @@
[Section]
Name = IrfanView Plugins
Version = 4.25
Version = 4.27
Licence = Freeware (for personal use)
Description = Additional Plugins for supporting more file types.
Size = 7.7MB
Size = 7.8MB
Category = 3
URLSite = http://www.irfanview.com/
URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_425_setup.exe
URLDownload = http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_427_setup.exe
CDPath = none
[Section.0407]
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = Miranda IM
Version = 0.8.19
Version = 0.8.22
Licence = GPL
Description = Open source multiprotocol instant messaging application - May not work completely.
Size = 1.6MB
Category = 5
URLSite = http://www.miranda-im.org/
URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.8.19-unicode.exe
URLDownload = http://miranda.googlecode.com/files/miranda-im-v0.8.22-unicode.exe
CDPath = none
[Section.0407]
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = OpenTTD
Version = 1.0.0
Version = 1.0.1
Licence = GPL v2
Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.
Size = 3.5MB
Category = 4
URLSite = http://www.openttd.org/
URLDownload = http://binaries.openttd.org/releases/1.0.0/openttd-1.0.0-windows-win32.exe
URLDownload = http://binaries.openttd.org/releases/1.0.1/openttd-1.0.1-windows-win32.exe
CDPath = none
[Section.0407]
+3 -3
View File
@@ -2,13 +2,13 @@
[Section]
Name = Opera
Version = 10.51
Version = 10.53
Licence = Freeware
Description = The popular Opera Browser with many advanced features and including a Mail and BitTorrent client.
Size = 11.0M
Size = 12.4M
Category = 5
URLSite = http://www.opera.com/
URLDownload = http://get4.opera.com/pub/opera/win/1051/int/Opera_1051_int_Setup.exe
URLDownload = http://get4.opera.com/pub/opera/win/1053/int/Opera_1053_int_Setup.exe
CDPath = none
[Section.0407]
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = ReactOS Build Environment
Version = 1.5
Version = 1.5.1
Licence = GPL
Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.
Size = 13.5MB
Category = 7
URLSite = http://reactos.org/wiki/Build_Environment/
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.exe
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.1.exe
CDPath = none
[Section.0407]
+2 -2
View File
@@ -2,13 +2,13 @@
[Section]
Name = SciTE
Version = 2.10
Version = 2.11
Licence = Freeware
Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs.
Size = 0.6M
Category = 7
URLSite = http://www.scintilla.org/
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc210.exe
URLDownload = http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc211.exe
CDPath = none
[Section.0407]
+3 -3
View File
@@ -2,13 +2,13 @@
[Section]
Name = ScummVM
Version = 1.1.0
Version = 1.1.1
Licence = GPL
Description = Sam and Max, Day of the Tentacle, etc on ReactOS.
Size = 3.4MB
Size = 3.3MB
Category = 4
URLSite = http://scummvm.org/
URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.1.0/scummvm-1.1.0-win32.exe
URLDownload = http://dfn.dl.sourceforge.net/project/scummvm/scummvm/1.1.1/scummvm-1.1.1-win32.exe
CDPath = none
[Section.0407]
+3 -3
View File
@@ -2,13 +2,13 @@
[Section]
Name = µTorrent
Version = 2.0
Version = 2.0.2
Licence = Freeware for non-commercial uses
Description = Small and fast BitTorrent Client.
Size = 312K
Size = 315K
Category = 5
URLSite = http://www.utorrent.com/
URLDownload = http://download.utorrent.com/2.0/utorrent.exe
URLDownload = http://download.utorrent.com/2.0.2/utorrent.exe
CDPath = none
+1
View File
@@ -2,6 +2,7 @@
#include "lang/de-DE.rc"
#include "lang/en-US.rc"
#include "lang/es-ES.rc"
#include "lang/it-IT.rc"
#include "lang/ja-JP.rc"
#include "lang/no-NO.rc"
#include "lang/pl-PL.rc"
+571 -56
View File
@@ -25,13 +25,531 @@ static const TCHAR s_szFindFlagsR[] = _T("FindFlagsReactOS");
static HWND s_hwndAbortDialog;
static BOOL s_bAbort;
static DWORD s_dwFlags;
static TCHAR s_szName[MAX_PATH];
static DWORD s_cbName;
static const TCHAR s_empty[] = {0};
static const TCHAR s_backslash[] = {'\\', 0};
extern VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName);
BOOL DoEvents(VOID)
{
MSG msg;
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
s_bAbort = TRUE;
if (!IsDialogMessage(s_hwndAbortDialog, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return s_bAbort;
}
static LPTSTR lstrstri(LPCTSTR psz1, LPCTSTR psz2)
{
INT i, cch1, cch2;
cch1 = lstrlen(psz1);
cch2 = lstrlen(psz2);
for(i = 0; i <= cch1 - cch2; i++)
{
if (CompareString(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE,
psz1 + i, cch2, psz2, cch2) == 2)
return (LPTSTR) (psz1 + i);
}
return NULL;
}
static BOOL CompareName(LPCTSTR pszName1, LPCTSTR pszName2)
{
if (s_dwFlags & RSF_WHOLESTRING)
{
if (s_dwFlags & RSF_MATCHCASE)
return lstrcmp(pszName1, pszName2) == 0;
else
return lstrcmpi(pszName1, pszName2) == 0;
}
else
{
if (s_dwFlags & RSF_MATCHCASE)
return _tcsstr(pszName1, pszName2) != NULL;
else
return lstrstri(pszName1, pszName2) != NULL;
}
}
static BOOL
CompareData(
DWORD dwType,
LPCTSTR psz1,
LPCTSTR psz2)
{
INT i, cch1 = lstrlen(psz1), cch2 = lstrlen(psz2);
if (dwType == REG_SZ || dwType == REG_EXPAND_SZ)
{
if (s_dwFlags & RSF_WHOLESTRING)
{
if (s_dwFlags & RSF_MATCHCASE)
return 2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
psz1, cch1, psz2, cch2);
else
return 2 == CompareString(LOCALE_SYSTEM_DEFAULT,
NORM_IGNORECASE, psz1, cch1, psz2, cch2);
}
for(i = 0; i <= cch1 - cch2; i++)
{
if (s_dwFlags & RSF_MATCHCASE)
{
if (2 == CompareString(LOCALE_SYSTEM_DEFAULT, 0,
psz1 + i, cch2, psz2, cch2))
return TRUE;
}
else
{
if (2 == CompareString(LOCALE_SYSTEM_DEFAULT,
NORM_IGNORECASE, psz1 + i, cch2, psz2, cch2))
return TRUE;
}
}
}
return FALSE;
}
int compare(const void *x, const void *y)
{
const LPCTSTR *a = (const LPCTSTR *)x;
const LPCTSTR *b = (const LPCTSTR *)y;
return lstrcmpi(*a, *b);
}
BOOL RegFindRecurse(
HKEY hKey,
LPCTSTR pszSubKey,
LPCTSTR pszValueName,
LPTSTR *ppszFoundSubKey,
LPTSTR *ppszFoundValueName)
{
HKEY hSubKey;
LONG lResult;
TCHAR szSubKey[MAX_PATH];
DWORD i, c, cb, type;
BOOL fPast = FALSE;
LPTSTR *ppszNames = NULL;
LPBYTE pb = NULL;
if (DoEvents())
return FALSE;
lstrcpy(szSubKey, pszSubKey);
hSubKey = NULL;
lResult = RegOpenKeyEx(hKey, szSubKey, 0, KEY_ALL_ACCESS, &hSubKey);
if (lResult != ERROR_SUCCESS)
return FALSE;
if (pszValueName == NULL)
pszValueName = s_empty;
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL,
&c, NULL, NULL, NULL, NULL);
if (lResult != ERROR_SUCCESS)
goto err;
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
if (ppszNames == NULL)
goto err;
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
s_cbName = MAX_PATH * sizeof(TCHAR);
lResult = RegEnumValue(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
NULL, &cb);
if (lResult == ERROR_NO_MORE_ITEMS)
{
c = i;
break;
}
if (lResult != ERROR_SUCCESS)
goto err;
if (s_cbName >= MAX_PATH * sizeof(TCHAR))
continue;
ppszNames[i] = _tcsdup(s_szName);
}
qsort(ppszNames, c, sizeof(LPTSTR), compare);
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
if (!fPast && lstrcmpi(ppszNames[i], pszValueName) == 0)
{
fPast = TRUE;
continue;
}
if (!fPast)
continue;
if ((s_dwFlags & RSF_LOOKATVALUES) &&
CompareName(ppszNames[i], s_szFindWhat))
{
*ppszFoundSubKey = _tcsdup(szSubKey);
if (ppszNames[i][0] == 0)
*ppszFoundValueName = NULL;
else
*ppszFoundValueName = _tcsdup(ppszNames[i]);
goto success;
}
lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
NULL, &cb);
if (lResult != ERROR_SUCCESS)
goto err;
pb = malloc(cb);
if (pb == NULL)
goto err;
lResult = RegQueryValueEx(hSubKey, ppszNames[i], NULL, &type,
pb, &cb);
if (lResult != ERROR_SUCCESS)
goto err;
if ((s_dwFlags & RSF_LOOKATDATA) &&
CompareData(type, (LPTSTR) pb, s_szFindWhat))
{
*ppszFoundSubKey = _tcsdup(szSubKey);
if (ppszNames[i][0] == 0)
*ppszFoundValueName = NULL;
else
*ppszFoundValueName = _tcsdup(ppszNames[i]);
goto success;
}
free(pb);
pb = NULL;
}
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
ppszNames = NULL;
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);
if (lResult != ERROR_SUCCESS)
goto err;
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
if (ppszNames == NULL)
goto err;
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
s_cbName = MAX_PATH * sizeof(TCHAR);
lResult = RegEnumKeyEx(hSubKey, i, s_szName, &s_cbName, NULL, NULL,
NULL, NULL);
if (lResult == ERROR_NO_MORE_ITEMS)
{
c = i;
break;
}
if (lResult != ERROR_SUCCESS)
goto err;
if (s_cbName >= MAX_PATH * sizeof(TCHAR))
continue;
ppszNames[i] = _tcsdup(s_szName);
}
qsort(ppszNames, c, sizeof(LPTSTR), compare);
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
if ((s_dwFlags & RSF_LOOKATKEYS) &&
CompareName(ppszNames[i], s_szFindWhat))
{
*ppszFoundSubKey = malloc(
(lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
sizeof(TCHAR));
if (*ppszFoundSubKey == NULL)
goto err;
if (szSubKey[0])
{
lstrcpy(*ppszFoundSubKey, szSubKey);
lstrcatW(*ppszFoundSubKey, s_backslash);
}
else
**ppszFoundSubKey = 0;
lstrcatW(*ppszFoundSubKey, ppszNames[i]);
*ppszFoundValueName = NULL;
goto success;
}
if (RegFindRecurse(hSubKey, ppszNames[i], NULL, ppszFoundSubKey,
ppszFoundValueName))
{
LPTSTR psz = *ppszFoundSubKey;
*ppszFoundSubKey = malloc(
(lstrlen(szSubKey) + lstrlen(psz) + 2) * sizeof(TCHAR));
if (*ppszFoundSubKey == NULL)
goto err;
if (szSubKey[0])
{
lstrcpy(*ppszFoundSubKey, szSubKey);
lstrcatW(*ppszFoundSubKey, s_backslash);
}
else
**ppszFoundSubKey = 0;
lstrcatW(*ppszFoundSubKey, psz);
free(psz);
goto success;
}
}
err:
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
free(pb);
RegCloseKey(hSubKey);
return FALSE;
success:
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
RegCloseKey(hSubKey);
return TRUE;
}
BOOL RegFindWalk(
HKEY * phKey,
LPCTSTR pszSubKey,
LPCTSTR pszValueName,
LPTSTR *ppszFoundSubKey,
LPTSTR *ppszFoundValueName)
{
LONG lResult;
DWORD i, c;
HKEY hBaseKey, hSubKey;
TCHAR szKeyName[MAX_PATH];
TCHAR szSubKey[MAX_PATH];
LPTSTR pch;
BOOL fPast;
LPTSTR *ppszNames = NULL;
hBaseKey = *phKey;
if (RegFindRecurse(hBaseKey, pszSubKey, pszValueName, ppszFoundSubKey,
ppszFoundValueName))
return TRUE;
if (lstrlen(pszSubKey) >= MAX_PATH)
return FALSE;
lstrcpy(szSubKey, pszSubKey);
while(szSubKey[0] != 0)
{
if (DoEvents())
return FALSE;
pch = _tcsrchr(szSubKey, _T('\\'));
if (pch == NULL)
{
lstrcpy(szKeyName, szSubKey);
szSubKey[0] = 0;
hSubKey = hBaseKey;
}
else
{
lstrcpyn(szKeyName, pch + 1, MAX_PATH);
*pch = 0;
lResult = RegOpenKeyEx(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
&hSubKey);
if (lResult != ERROR_SUCCESS)
return FALSE;
}
lResult = RegQueryInfoKey(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);
if (lResult != ERROR_SUCCESS)
goto err;
ppszNames = (LPTSTR *) malloc(c * sizeof(LPTSTR));
if (ppszNames == NULL)
goto err;
ZeroMemory(ppszNames, c * sizeof(LPTSTR));
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
s_cbName = MAX_PATH * sizeof(TCHAR);
lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cbName,
NULL, NULL, NULL, NULL);
if (lResult == ERROR_NO_MORE_ITEMS)
{
c = i;
break;
}
if (lResult != ERROR_SUCCESS)
break;
ppszNames[i] = _tcsdup(s_szName);
}
qsort(ppszNames, c, sizeof(LPTSTR), compare);
fPast = FALSE;
for(i = 0; i < c; i++)
{
if (DoEvents())
goto err;
if (!fPast && lstrcmpi(ppszNames[i], szKeyName) == 0)
{
fPast = TRUE;
continue;
}
if (!fPast)
continue;
if ((s_dwFlags & RSF_LOOKATKEYS) &&
CompareName(ppszNames[i], s_szFindWhat))
{
*ppszFoundSubKey = malloc(
(lstrlen(szSubKey) + lstrlen(ppszNames[i]) + 2) *
sizeof(TCHAR));
if (*ppszFoundSubKey == NULL)
goto err;
if (szSubKey[0])
{
lstrcpy(*ppszFoundSubKey, szSubKey);
lstrcatW(*ppszFoundSubKey, s_backslash);
}
else
**ppszFoundSubKey = 0;
lstrcatW(*ppszFoundSubKey, ppszNames[i]);
*ppszFoundValueName = NULL;
goto success;
}
if (RegFindRecurse(hSubKey, ppszNames[i], NULL,
ppszFoundSubKey, ppszFoundValueName))
{
LPTSTR psz = *ppszFoundSubKey;
*ppszFoundSubKey = malloc(
(lstrlen(szSubKey) + lstrlen(psz) + 2) *
sizeof(TCHAR));
if (*ppszFoundSubKey == NULL)
goto err;
if (szSubKey[0])
{
lstrcpy(*ppszFoundSubKey, szSubKey);
lstrcatW(*ppszFoundSubKey, s_backslash);
}
else
**ppszFoundSubKey = 0;
lstrcatW(*ppszFoundSubKey, psz);
free(psz);
goto success;
}
}
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
ppszNames = NULL;
if (hBaseKey != hSubKey)
RegCloseKey(hSubKey);
}
if (*phKey == HKEY_CLASSES_ROOT)
{
*phKey = HKEY_CURRENT_USER;
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
ppszFoundValueName))
return TRUE;
}
if (*phKey == HKEY_CURRENT_USER)
{
*phKey = HKEY_LOCAL_MACHINE;
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
ppszFoundValueName))
goto success;
}
if (*phKey == HKEY_LOCAL_MACHINE)
{
*phKey = HKEY_USERS;
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
ppszFoundValueName))
goto success;
}
if (*phKey == HKEY_USERS)
{
*phKey = HKEY_CURRENT_CONFIG;
if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
ppszFoundValueName))
goto success;
}
err:
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
if (hBaseKey != hSubKey)
RegCloseKey(hSubKey);
return FALSE;
success:
if (ppszNames != NULL)
{
for(i = 0; i < c; i++)
free(ppszNames[i]);
free(ppszNames);
}
if (hBaseKey != hSubKey)
RegCloseKey(hSubKey);
return TRUE;
}
static DWORD GetFindFlags(void)
{
HKEY hKey;
DWORD dwFlags = RSF_LOOKATKEYS;
DWORD dwType, dwValue, cbData;
DWORD dwFlags = RSF_LOOKATKEYS | RSF_LOOKATVALUES | RSF_LOOKATDATA;
if (RegOpenKey(HKEY_CURRENT_USER, g_szGeneralRegKey, &hKey) == ERROR_SUCCESS)
{
@@ -102,45 +620,54 @@ static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam,
return 0;
}
static BOOL RegSearchProc(LPVOID lpParam)
{
MSG msg;
UNREFERENCED_PARAMETER(lpParam);
if (s_hwndAbortDialog && PeekMessage(&msg, s_hwndAbortDialog, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return s_bAbort;
}
BOOL FindNext(HWND hWnd)
{
HKEY hKeyRoot;
LPCTSTR pszFindWhat;
LPCTSTR pszKeyPath;
DWORD dwFlags;
LONG lResult;
TCHAR szSubKey[512];
TCHAR szError[512];
TCHAR szTitle[64];
BOOL fSuccess;
TCHAR szFullKey[512];
LPCTSTR pszValueName;
LPTSTR pszFoundSubKey, pszFoundValueName;
pszFindWhat = s_szFindWhat;
dwFlags = GetFindFlags() & ~(RSF_LOOKATVALUES | RSF_LOOKATDATA);
if (_tcslen(s_szFindWhat) == 0)
{
FindDialog(hWnd);
return TRUE;
}
s_dwFlags = GetFindFlags();
pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
lstrcpyn(szSubKey, pszKeyPath, sizeof(szSubKey) / sizeof(szSubKey[0]));
if (pszKeyPath == NULL)
{
hKeyRoot = HKEY_CLASSES_ROOT;
pszKeyPath = s_empty;
}
/* Create abort find dialog */
s_hwndAbortDialog = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FINDING), hWnd, AbortFindDialogProc);
s_hwndAbortDialog = CreateDialog(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_FINDING), hWnd, AbortFindDialogProc);
if (s_hwndAbortDialog)
{
ShowWindow(s_hwndAbortDialog, SW_SHOW);
UpdateWindow(s_hwndAbortDialog);
}
s_bAbort = FALSE;
lResult = RegSearch(hKeyRoot, szSubKey, sizeof(szSubKey) / sizeof(szSubKey[0]),
pszFindWhat, 0, dwFlags, RegSearchProc, NULL);
pszValueName = GetValueName(g_pChildWnd->hListWnd, -1);
EnableWindow(hFrameWnd, FALSE);
EnableWindow(g_pChildWnd->hTreeWnd, FALSE);
EnableWindow(g_pChildWnd->hListWnd, FALSE);
EnableWindow(g_pChildWnd->hAddressBarWnd, FALSE);
fSuccess = RegFindWalk(&hKeyRoot, pszKeyPath, pszValueName,
&pszFoundSubKey, &pszFoundValueName);
EnableWindow(hFrameWnd, TRUE);
EnableWindow(g_pChildWnd->hTreeWnd, TRUE);
EnableWindow(g_pChildWnd->hListWnd, TRUE);
EnableWindow(g_pChildWnd->hAddressBarWnd, TRUE);
if (s_hwndAbortDialog)
{
@@ -148,26 +675,16 @@ BOOL FindNext(HWND hWnd)
s_hwndAbortDialog = NULL;
}
/* Did the user click "Cancel"? If so, exit without displaying an error message */
if (lResult == ERROR_OPERATION_ABORTED)
return FALSE;
if (lResult != ERROR_SUCCESS)
if (fSuccess)
{
LoadString(NULL, IDS_APP_TITLE, szTitle, sizeof(szTitle) / sizeof(szTitle[0]));
if ((lResult != ERROR_NO_MORE_ITEMS) || !LoadString(NULL, IDS_FINISHEDFIND, szError, sizeof(szError) / sizeof(szError[0])))
{
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, lResult, 0,
szError, sizeof(szError) / sizeof(szError[0]), NULL);
}
MessageBox(hWnd, szError, szTitle, MB_OK);
return FALSE;
RegKeyGetName(szFullKey, COUNT_OF(szFullKey), hKeyRoot, pszFoundSubKey);
SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
SetValueName(g_pChildWnd->hListWnd, pszFoundValueName);
free(pszFoundSubKey);
free(pszFoundValueName);
SetFocus(g_pChildWnd->hListWnd);
}
RegKeyGetName(szFullKey, sizeof(szFullKey) / sizeof(szFullKey[0]), hKeyRoot, szSubKey);
SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
return TRUE;
return fSuccess;
}
static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -183,26 +700,17 @@ static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
case WM_INITDIALOG:
dwFlags = GetFindFlags();
/* Looking at values is not yet implemented */
hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
if (hControl)
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATKEYS) ? TRUE : FALSE, 0);
/* Looking at values is not yet implemented */
hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
if (hControl)
{
lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
}
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATVALUES) ? TRUE : FALSE, 0);
/* Looking at data is not yet implemented */
hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
if (hControl)
{
lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
SetWindowLongPtr(hControl, GWL_STYLE, lStyle | WS_DISABLED);
}
SendMessage(hControl, BM_SETCHECK, (dwFlags & RSF_LOOKATDATA) ? TRUE : FALSE, 0);
/* Match whole string */
hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
@@ -299,7 +807,14 @@ void FindDialog(HWND hWnd)
if (DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND),
hWnd, FindDialogProc, 0) != 0)
{
FindNext(hWnd);
if (FindNext(hWnd) == FALSE)
{
TCHAR msg[128], caption[128];
LoadString(hInst, IDS_FINISHEDFIND, msg, sizeof(msg)/sizeof(TCHAR));
LoadString(hInst, IDS_APP_TITLE, caption, sizeof(caption)/sizeof(TCHAR));
MessageBox(0, msg, caption, MB_ICONINFORMATION);
}
}
}
+8 -19
View File
@@ -228,8 +228,6 @@ static BOOL CheckCommDlgError(HWND hWnd)
return TRUE;
}
#define MAX_CUSTOM_FILTER_SIZE 50
TCHAR CustomFilterBuffer[MAX_CUSTOM_FILTER_SIZE];
TCHAR FileNameBuffer[_MAX_PATH];
TCHAR FileTitleBuffer[_MAX_PATH];
@@ -275,25 +273,11 @@ static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME* pofn)
BuildFilterStrings(Filter, FilterPairs, sizeof(FilterPairs) / sizeof(FILTERPAIR));
pofn->lpstrFilter = Filter;
pofn->lpstrCustomFilter = CustomFilterBuffer;
pofn->nMaxCustFilter = MAX_CUSTOM_FILTER_SIZE;
pofn->nFilterIndex = 0;
pofn->lpstrFile = FileNameBuffer;
pofn->nMaxFile = _MAX_PATH;
pofn->lpstrFileTitle = FileTitleBuffer;
pofn->nMaxFileTitle = _MAX_PATH;
/* pofn->lpstrInitialDir = _T("");*/
/* pofn->lpstrTitle = _T("Import Registry File");*/
/* pofn->Flags = OFN_ENABLETEMPLATE + OFN_EXPLORER + OFN_ENABLESIZING;*/
pofn->Flags = OFN_HIDEREADONLY;
/* pofn->nFileOffset = ;*/
/* pofn->nFileExtension = ;*/
/* pofn->lpstrDefExt = _T("");*/
/* pofn->lCustData = ;*/
/* pofn->lpfnHook = ImportRegistryFile_OFNHookProc;*/
/* pofn->lpTemplateName = _T("ID_DLG_IMPORT_REGFILE");*/
/* pofn->lpTemplateName = MAKEINTRESOURCE(IDD_DIALOG1);*/
/* pofn->FlagsEx = ;*/
return TRUE;
}
@@ -356,11 +340,11 @@ static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, W
hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
if (hwndExportAll)
SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey[0] ? BST_UNCHECKED : BST_CHECKED, 0);
SendMessage(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
if (hwndExportBranch)
SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey[0] ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessage(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
if (hwndExportBranchText)
@@ -406,7 +390,12 @@ BOOL ExportRegistryFile(HWND hWnd)
InitOpenFileName(hWnd, &ofn);
LoadString(hInst, IDS_EXPORT_REG_FILE, Caption, sizeof(Caption)/sizeof(TCHAR));
ofn.lpstrTitle = Caption;
ofn.lCustData = (LPARAM) ExportKeyPath;
/* Only set the path if a key (not the root node) is selected */
if (hKeyRoot != 0)
{
ofn.lCustData = (LPARAM) ExportKeyPath;
}
ofn.Flags = OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLEHOOK;
ofn.lpfnHook = ExportRegistryFile_OFNHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(IDD_EXPORTRANGE);
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Îòêàç",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Îòêàç",IDCANCEL,93,29,45,14
LTEXT "Ïðåòúðñâàíå íà ðåãèñòúðà...",IDC_STATIC,33,12,105,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Suchen"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Abbrechen",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Abbrechen",IDCANCEL,93,29,45,14
LTEXT "Durchsuche die Registry...",IDC_STATIC,33,12,85,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Áêýñùóç",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Áêýñùóç",IDCANCEL,93,29,45,14
LTEXT "Ãßíåôáé áíáæÞôçóç óôç registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -435,7 +435,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -441,7 +441,7 @@ CAPTION "Buscar"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
LTEXT "Buscando en el registro...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -430,7 +430,7 @@ CAPTION "Chercher"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "Annuler",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "Annuler",IDCANCEL,93,29,45,14
LTEXT "Recherche dans le registre...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -439,7 +439,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Cari"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Batal",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Batal",IDCANCEL,93,29,45,14
LTEXT "Mencari registri...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -443,7 +443,7 @@ CAPTION "Trova"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Annulla",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Annulla",IDCANCEL,93,29,45,14
LTEXT "Ricerca in corso nel registro...",IDC_STATIC,33,12,83,8
END
+3 -3
View File
@@ -423,9 +423,9 @@ BEGIN
CONTROL "データ(&D)",IDC_LOOKAT_DATA,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,14,60,42,8
CONTROL "完全に一致するものだけを検索(&W)",IDC_MATCHSTRING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,83,32,94,13
BS_AUTOCHECKBOX | WS_TABSTOP,83,32,109,13
CONTROL "大文字と小文字を区別する(&C)",IDC_MATCHCASE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,83,48,90,12
WS_TABSTOP,83,48,108,12
END
IDD_FINDING DIALOGEX 0, 0, 145, 50
@@ -435,7 +435,7 @@ CAPTION "
FONT 9, "MS UI Gothic", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "キャンセル(&C)",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "キャンセル(&C)",IDCANCEL,93,29,45,14
LTEXT "レジストリの検索中...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -423,7 +423,7 @@ CAPTION "ã
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "취소(&C)",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "취소(&C)",IDCANCEL,93,29,45,14
LTEXT "레지스트리를 검색중...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "S
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Avbryt",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Avbryt",IDCANCEL,93,29,45,14
LTEXT "Søker i registret...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -443,7 +443,7 @@ CAPTION "Znajd
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Anuluj",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Anuluj",IDCANCEL,93,29,45,14
LTEXT "Przeszukiwanie rejestru...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -439,7 +439,7 @@ CAPTION "Localizar"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancelar",IDCANCEL,93,29,45,14
LTEXT "Pesquisando o registro...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -439,7 +439,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT, IDC_STATIC, 7, 7, 20, 20
PUSHBUTTON "&Îòìåíà", IDCANCEL, 93, 29, 45, 14
DEFPUSHBUTTON "&Îòìåíà", IDCANCEL, 93, 29, 45, 14
LTEXT "Ïîèñê â ðååñòðå...", IDC_STATIC, 33, 12, 83, 8
END
+1 -1
View File
@@ -423,7 +423,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Zruši",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Zruši",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -435,7 +435,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "Find"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Cancel",IDCANCEL,93,29,45,14
LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "&Ñêàñóâàòè",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "&Ñêàñóâàòè",IDCANCEL,93,29,45,14
LTEXT "Ïîøóê ó ðåºñòð³...",IDC_STATIC,33,12,83,8
END
+1 -1
View File
@@ -438,7 +438,7 @@ CAPTION "
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
ICON IDI_REGEDIT,IDC_STATIC,7,7,20,20
PUSHBUTTON "取消(&C)",IDCANCEL,93,29,45,14
DEFPUSHBUTTON "取消(&C)",IDCANCEL,93,29,45,14
LTEXT "正在搜索注册表...",IDC_STATIC,33,12,83,8
END
+34 -1
View File
@@ -27,6 +27,7 @@
int Image_String = 0;
int Image_Bin = 0;
INT iListViewSelect = -1;
typedef struct tagLINE_INFO
{
@@ -76,6 +77,29 @@ LPCTSTR GetValueName(HWND hwndLV, int iStartAt)
return lineinfo->name;
}
VOID SetValueName(HWND hwndLV, LPCTSTR pszValueName)
{
INT i, c;
LV_FINDINFO fi;
c = ListView_GetItemCount(hwndLV);
for(i = 0; i < c; i++)
{
ListView_SetItemState(hwndLV, i, 0, LVIS_FOCUSED | LVIS_SELECTED);
}
if (pszValueName == NULL)
i = 0;
else
{
fi.flags = LVFI_STRING;
fi.psz = pszValueName;
i = ListView_FindItem(hwndLV, -1, &fi);
}
ListView_SetItemState(hwndLV, i, LVIS_FOCUSED | LVIS_SELECTED,
LVIS_FOCUSED | LVIS_SELECTED);
iListViewSelect = i;
}
BOOL IsDefaultValue(HWND hwndLV, int i)
{
PLINE_INFO lineinfo;
@@ -497,6 +521,7 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
DWORD val_count;
HKEY hNewKey;
LONG errCode;
INT i, c;
BOOL AddedDefault = FALSE;
if (!hwndLV) return FALSE;
@@ -552,7 +577,15 @@ BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCTSTR keyPath)
{
AddEntryToList(hwndLV, _T(""), REG_SZ, NULL, 0, 0, FALSE);
}
(void)ListView_SortItems(hwndLV, CompareFunc, (WPARAM)hwndLV);
ListView_SortItems(hwndLV, CompareFunc, (WPARAM)hwndLV);
c = ListView_GetItemCount(hwndLV);
for(i = 0; i < c; i++)
{
ListView_SetItemState(hwndLV, i, 0, LVIS_FOCUSED | LVIS_SELECTED);
}
ListView_SetItemState(hwndLV, iListViewSelect,
LVIS_FOCUSED | LVIS_SELECTED,
LVIS_FOCUSED | LVIS_SELECTED);
RegCloseKey(hNewKey);
SendMessage(hwndLV, WM_SETREDRAW, TRUE, 0);
-141
View File
@@ -1497,147 +1497,6 @@ done:
return lResult;
}
/******************************************************************************
* Searching
*/
static LONG RegNextKey(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength)
{
LONG lResult;
LPTSTR s;
LPCTSTR pszOriginalKey;
TCHAR szKeyName[256];
HKEY hSubKey, hBaseKey;
DWORD dwIndex = 0;
DWORD cbName;
FILETIME ft;
BOOL bFoundKey = FALSE;
/* Try accessing a subkey */
if (RegOpenKeyEx(hKey, lpSubKey, 0, KEY_ALL_ACCESS, &hSubKey) == ERROR_SUCCESS)
{
cbName = (DWORD) iSubKeyLength - _tcslen(lpSubKey) - 1;
lResult = RegEnumKeyEx(hSubKey, 0, lpSubKey + _tcslen(lpSubKey) + 1,
&cbName, NULL, NULL, NULL, &ft);
RegCloseKey(hSubKey);
if (lResult == ERROR_SUCCESS)
{
lpSubKey[_tcslen(lpSubKey)] = '\\';
bFoundKey = TRUE;
}
}
if (!bFoundKey)
{
/* Go up and find the next sibling key */
do
{
s = _tcsrchr(lpSubKey, TEXT('\\'));
if (s)
{
*s = '\0';
pszOriginalKey = s + 1;
hBaseKey = NULL;
RegOpenKeyEx(hKey, lpSubKey, 0, KEY_ALL_ACCESS, &hBaseKey);
}
else
{
pszOriginalKey = lpSubKey;
hBaseKey = hKey;
}
if (hBaseKey)
{
dwIndex = 0;
do
{
lResult = RegEnumKey(hBaseKey, dwIndex++, szKeyName, sizeof(szKeyName) / sizeof(szKeyName[0]));
}
while((lResult == ERROR_SUCCESS) && _tcscmp(szKeyName, pszOriginalKey));
if (lResult == ERROR_SUCCESS)
{
lResult = RegEnumKey(hBaseKey, dwIndex++, szKeyName, sizeof(szKeyName) / sizeof(szKeyName[0]));
if (lResult == ERROR_SUCCESS)
{
bFoundKey = TRUE;
_sntprintf(lpSubKey + _tcslen(lpSubKey), iSubKeyLength - _tcslen(lpSubKey), _T("\\%s"), szKeyName);
}
}
RegCloseKey(hBaseKey);
}
}
while(!bFoundKey);
}
return bFoundKey ? ERROR_SUCCESS : ERROR_NO_MORE_ITEMS;
}
static BOOL RegSearchCompare(LPCTSTR s1, LPCTSTR s2, DWORD dwSearchFlags)
{
BOOL bResult;
if (dwSearchFlags & RSF_WHOLESTRING)
{
if (dwSearchFlags & RSF_MATCHCASE)
bResult = !_tcscmp(s1, s2);
else
bResult = !_tcsicmp(s1, s2);
}
else
{
if (dwSearchFlags & RSF_MATCHCASE)
bResult = (_tcsstr(s1, s2) != NULL);
else
{
/* My kingdom for _tcsistr() */
bResult = FALSE;
while(*s1)
{
if (!_tcsnicmp(s1, s2, _tcslen(s2)))
{
bResult = TRUE;
break;
}
s1++;
}
}
}
return bResult;
}
LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
LPCTSTR pszSearchString, DWORD dwValueIndex,
DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam)
{
LONG lResult;
LPCTSTR s;
UNREFERENCED_PARAMETER(dwValueIndex);
if (dwSearchFlags & (RSF_LOOKATVALUES | RSF_LOOKATDATA))
return ERROR_CALL_NOT_IMPLEMENTED; /* NYI */
do
{
if (pfnCallback)
{
if (pfnCallback(lpParam))
return ERROR_OPERATION_ABORTED;
}
lResult = RegNextKey(hKey, lpSubKey, iSubKeyLength);
if (lResult != ERROR_SUCCESS)
return lResult;
s = _tcsrchr(lpSubKey, TEXT('\\'));
s = s ? s + 1 : lpSubKey;
}
while(!(dwSearchFlags & RSF_LOOKATKEYS) || !RegSearchCompare(s, pszSearchString, dwSearchFlags));
return ERROR_SUCCESS;
}
/******************************************************************************
* Key naming and parsing
*/
-4
View File
@@ -92,10 +92,6 @@ LONG RegQueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTST
#define RSF_LOOKATDATA 0x00000008
#define RSF_MATCHCASE 0x00010000
LONG RegSearch(HKEY hKey, LPTSTR lpSubKey, size_t iSubKeyLength,
LPCTSTR pszSearchString, DWORD dwValueIndex,
DWORD dwSearchFlags, BOOL (*pfnCallback)(LPVOID), LPVOID lpParam);
BOOL RegKeyGetName(LPTSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCTSTR lpSubKey);
/* EOF */
+2 -1
View File
@@ -2,7 +2,8 @@
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="wordpad" type="win32gui" installbase="system32" installname="wordpad.exe" allowwarnings="true">
<include base="wordpad">.</include>
<define name="__ROS_LONG64__" />
<include base="ReactOS">include/reactos/wine</include>
<define name="__ROS_LONG64__" />
<library>comdlg32</library>
<library>shell32</library>
<library>user32</library>
-33
View File
@@ -1,33 +0,0 @@
Acknowledgements:
Tinus provided the initial port of these dhclient file.
Ok I need these things:
1) Adapter concept thingy
Needs a name and index
Current IP address etc
interface_info
Must be able to get one from an adapter index or name
Must query the ip address and such
Must be able to set the address
2) System state doodad
List of adapters
List of parameter changes
List of persistent stuff
Must be able to initialize from the registry
(persistent stuff, some adapter info)
Save changes to persistent set
3) Parameter change set
TODO
4) Persistent queries
TODO
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="dhcp" type="win32cui" installbase="system32" installname="dhcp.exe">
<include base="dhcp">.</include>
<include base="dhcp">include</include>
<library>ntdll</library>
<library>ws2_32</library>
<library>iphlpapi</library>
<library>advapi32</library>
<library>oldnames</library>
<file>adapter.c</file>
<file>alloc.c</file>
<file>api.c</file>
<file>compat.c</file>
<file>dhclient.c</file>
<file>dispatch.c</file>
<file>hash.c</file>
<file>options.c</file>
<file>pipe.c</file>
<file>privsep.c</file>
<file>socket.c</file>
<file>tables.c</file>
<file>timer.c</file>
<file>util.c</file>
<file>dhcp.rc</file>
<directory name="include">
<pch>rosdhcp.h</pch>
</directory>
</module>
-6
View File
@@ -1,6 +0,0 @@
/* $Id: regsvr32.rc 12852 2005-01-06 13:58:04Z mf $ */
#define REACTOS_STR_FILE_DESCRIPTION "DHCP Client Service"
#define REACTOS_STR_INTERNAL_NAME "dhcp\0"
#define REACTOS_STR_ORIGINAL_FILENAME "dhcp.exe\0"
#include <reactos/version.rc>
-72
View File
@@ -1,72 +0,0 @@
/* $Id:$
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Service
* FILE: subsys/system/dhcp
* PURPOSE: DHCP client service entry point
* PROGRAMMER: Art Yerkes ([email protected])
* UPDATE HISTORY:
* Created 03/08/2005
*/
#include <windows.h>
#include "dhcpd.h"
#include "version.h"
typedef struct _DHCP_API_REQUEST {
int type;
UINT flags;
LPDHCPAPI_CLASSID class_id;
DHCP_API_PARAMS_ARRAY vendor_params;
DHCP_API_PARAMS_ARRAY general_params;
LPWSTR request_id, adapter_name;
} DHCP_API_REQUEST;
typedef struct _DHCP_MANAGED_ADAPTER {
LPWSTR adapter_name, hostname, dns_server;
UINT adapter_index;
struct sockaddr_in address, netmask;
struct interface_info *dhcp_info;
} DHCP_MANAGED_ADAPTER;
#define DHCP_REQUESTPARAM WM_USER + 0
#define DHCP_PARAMCHANGE WM_USER + 1
#define DHCP_CANCELREQUEST WM_USER + 2
#define DHCP_NOPARAMCHANGE WM_USER + 3
#define DHCP_MANAGEADAPTER WM_USER + 4
#define DHCP_UNMANAGEADAPTER WM_USER + 5
UINT DhcpEventTimer;
HANDLE DhcpServiceThread;
DWORD DhcpServiceThreadId;
LIST_ENTRY ManagedAdapters;
LRESULT WINAPI ServiceThread( PVOID Data ) {
MSG msg;
while( GetMessage( &msg, 0, 0, 0 ) ) {
switch( msg.message ) {
case DHCP_MANAGEADAPTER:
break;
case DHCP_UNMANAGEADAPTER:
break;
case DHCP_REQUESTPARAM:
break;
case DHCP_CANCELREQUEST:
break;
case DHCP_PARAMCHANGE:
break;
case DHCP_NOPARAMCHANGE:
break;
}
}
}
int main( int argc, char **argv ) {
}
-57
View File
@@ -1,57 +0,0 @@
/* cdefs.h
Standard C definitions... */
/*
* Copyright (c) 1996 The Internet Software Consortium.
* All Rights Reserved.
* Copyright (c) 1995 RadioMail Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of RadioMail Corporation, the Internet Software
* Consortium nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY RADIOMAIL CORPORATION, THE INTERNET
* SOFTWARE CONSORTIUM AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL RADIOMAIL CORPORATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software was written for RadioMail Corporation by Ted Lemon
* under a contract with Vixie Enterprises. Further modifications have
* been made for the Internet Software Consortium under a contract
* with Vixie Laboratories.
*/
#if (defined (__GNUC__) || defined (__STDC__)) && !defined (BROKEN_ANSI)
#define PROTO(x) x
#define KandR(x)
#define ANSI_DECL(x) x
#if defined (__GNUC__)
#define INLINE inline
#else
#define INLINE
#endif /* __GNUC__ */
#else
#define PROTO(x) ()
#define KandR(x) x
#define ANSI_DECL(x)
#define INLINE
#endif /* __GNUC__ || __STDC__ */
-136
View File
@@ -1,136 +0,0 @@
/* dhctoken.h
Tokens for config file lexer and parser. */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
* The Internet Software Consortium. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This software has been written for the Internet Software Consortium
* by Ted Lemon <[email protected]> in cooperation with Vixie
* Enterprises. To learn more about the Internet Software Consortium,
* see ``http://www.vix.com/isc''. To learn more about Vixie
* Enterprises, see ``http://www.vix.com''.
*/
#define SEMI ';'
#define DOT '.'
#define COLON ':'
#define COMMA ','
#define SLASH '/'
#define LBRACE '{'
#define RBRACE '}'
#define FIRST_TOKEN HOST
#define HOST 256
#define HARDWARE 257
#define FILENAME 258
#define FIXED_ADDR 259
#define OPTION 260
#define ETHERNET 261
#define STRING 262
#define NUMBER 263
#define NUMBER_OR_NAME 264
#define NAME 265
#define TIMESTAMP 266
#define STARTS 267
#define ENDS 268
#define UID 269
#define CLASS 270
#define LEASE 271
#define RANGE 272
#define PACKET 273
#define CIADDR 274
#define YIADDR 275
#define SIADDR 276
#define GIADDR 277
#define SUBNET 278
#define NETMASK 279
#define DEFAULT_LEASE_TIME 280
#define MAX_LEASE_TIME 281
#define VENDOR_CLASS 282
#define USER_CLASS 283
#define SHARED_NETWORK 284
#define SERVER_NAME 285
#define DYNAMIC_BOOTP 286
#define SERVER_IDENTIFIER 287
#define DYNAMIC_BOOTP_LEASE_CUTOFF 288
#define DYNAMIC_BOOTP_LEASE_LENGTH 289
#define BOOT_UNKNOWN_CLIENTS 290
#define NEXT_SERVER 291
#define TOKEN_RING 292
#define GROUP 293
#define ONE_LEASE_PER_CLIENT 294
#define GET_LEASE_HOSTNAMES 295
#define USE_HOST_DECL_NAMES 296
#define SEND 297
#define CLIENT_IDENTIFIER 298
#define REQUEST 299
#define REQUIRE 300
#define TIMEOUT 301
#define RETRY 302
#define SELECT_TIMEOUT 303
#define SCRIPT 304
#define INTERFACE 305
#define RENEW 306
#define REBIND 307
#define EXPIRE 308
#define UNKNOWN_CLIENTS 309
#define ALLOW 310
#define BOOTP 311
#define DENY 312
#define BOOTING 313
#define DEFAULT 314
#define MEDIA 315
#define MEDIUM 316
#define ALIAS 317
#define REBOOT 318
#define ABANDONED 319
#define BACKOFF_CUTOFF 320
#define INITIAL_INTERVAL 321
#define NAMESERVER 322
#define DOMAIN 323
#define SEARCH 324
#define SUPERSEDE 325
#define APPEND 326
#define PREPEND 327
#define HOSTNAME 328
#define CLIENT_HOSTNAME 329
#define REJECT 330
#define FDDI 331
#define USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 332
#define AUTHORITATIVE 333
#define TOKEN_NOT 334
#define ALWAYS_REPLY_RFC1048 335
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
(x) != STRING && \
(x) != NUMBER && \
(x) != EOF)
-52
View File
@@ -1,52 +0,0 @@
/* inet.h
Portable definitions for internet addresses */
/*
* Copyright (c) 1996 The Internet Software Consortium. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This software has been written for the Internet Software Consortium
* by Ted Lemon <[email protected]> in cooperation with Vixie
* Enterprises. To learn more about the Internet Software Consortium,
* see ``http://www.vix.com/isc''. To learn more about Vixie
* Enterprises, see ``http://www.vix.com''.
*/
/* An internet address of up to 128 bits. */
typedef struct _iaddr {
int len;
unsigned char iabuf [16];
} iaddr;
typedef struct _iaddrlist {
struct _iaddrlist *next;
iaddr addr;
} iaddrlist;
-294
View File
@@ -1,294 +0,0 @@
/* osdep.h
Operating system dependencies... */
/*
* Copyright (c) 1996, 1997, 1998, 1999 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software was written for the Internet Software Consortium by Ted Lemon
* under a contract with Vixie Laboratories.
*/
#include "site.h"
/* Porting::
If you add a new network API, you must add a check for it below: */
#if !defined (USE_SOCKETS) && \
!defined (USE_SOCKET_SEND) && \
!defined (USE_SOCKET_RECEIVE) && \
!defined (USE_RAW_SOCKETS) && \
!defined (USE_RAW_SEND) && \
!defined (USE_SOCKET_RECEIVE) && \
!defined (USE_BPF) && \
!defined (USE_BPF_SEND) && \
!defined (USE_BPF_RECEIVE) && \
!defined (USE_LPF) && \
!defined (USE_LPF_SEND) && \
!defined (USE_LPF_RECEIVE) && \
!defined (USE_NIT) && \
!defined (USE_NIT_SEND) && \
!defined (USE_NIT_RECEIVE) && \
!defined (USR_DLPI_SEND) && \
!defined (USE_DLPI_RECEIVE)
# define USE_DEFAULT_NETWORK
#endif
/* Porting::
If you add a new system configuration file, include it here: */
#if defined (sun)
# if defined (__svr4__) || defined (__SVR4)
# include "cf/sunos5-5.h"
# else
# include "cf/sunos4.h"
# endif
#endif
#ifdef aix
# include "cf/aix.h"
#endif
#ifdef bsdi
# include "cf/bsdos.h"
#endif
#ifdef __NetBSD__
# include "cf/netbsd.h"
#endif
#ifdef __FreeBSD__
# include "cf/freebsd.h"
#endif
#if defined (__osf__) && defined (__alpha)
# include "cf/alphaosf.h"
#endif
#ifdef ultrix
# include "cf/ultrix.h"
#endif
#ifdef linux
# include "cf/linux.h"
#endif
#ifdef SCO
# include "cf/sco.h"
#endif
#if defined (hpux) || defined (__hpux)
# include "cf/hpux.h"
#endif
#ifdef __QNX__
# include "cf/qnx.h"
#endif
#ifdef __CYGWIN32__
# include "cf/cygwin32.h"
#endif
#ifdef __APPLE__
# include "cf/rhapsody.h"
#else
# if defined (NeXT)
# include "cf/nextstep.h"
# endif
#endif
#if defined(IRIX) || defined(__sgi)
# include "cf/irix.h"
#endif
#if !defined (TIME_MAX)
# define TIME_MAX 2147483647
#endif
/* Porting::
If you add a new network API, and have it set up so that it can be
used for sending or receiving, but doesn't have to be used for both,
then set up an ifdef like the ones below: */
#ifdef USE_SOCKETS
# define USE_SOCKET_SEND
# define USE_SOCKET_RECEIVE
#endif
#ifdef USE_RAW_SOCKETS
# define USE_RAW_SEND
# define USE_SOCKET_RECEIVE
#endif
#ifdef USE_BPF
# define USE_BPF_SEND
# define USE_BPF_RECEIVE
#endif
#ifdef USE_LPF
# define USE_LPF_SEND
# define USE_LPF_RECEIVE
#endif
#ifdef USE_NIT
# define USE_NIT_SEND
# define USE_NIT_RECEIVE
#endif
#ifdef USE_DLPI
# define USE_DLPI_SEND
# define USE_DLPI_RECEIVE
#endif
#ifdef USE_UPF
# define USE_UPF_SEND
# define USE_UPF_RECEIVE
#endif
/* Porting::
If you add support for sending packets directly out an interface,
and your support does not do ARP or routing, you must use a fallback
mechanism to deal with packets that need to be sent to routers.
Currently, all low-level packet interfaces use BSD sockets as a
fallback. */
#if defined (USE_BPF_SEND) || defined (USE_NIT_SEND) || \
defined (USE_DLPI_SEND) || defined (USE_UPF_SEND) || defined (USE_LPF_SEND)
# define USE_SOCKET_FALLBACK
# define USE_FALLBACK
#endif
/* Porting::
If you add support for sending packets directly out an interface
and need to be able to assemble packets, add the USE_XXX_SEND
definition for your interface to the list tested below. */
#if defined (USE_RAW_SEND) || defined (USE_BPF_SEND) || \
defined (USE_NIT_SEND) || defined (USE_UPF_SEND) || \
defined (USE_DLPI_SEND) || defined (USE_LPF_SEND)
# define PACKET_ASSEMBLY
#endif
/* Porting::
If you add support for receiving packets directly from an interface
and need to be able to decode raw packets, add the USE_XXX_RECEIVE
definition for your interface to the list tested below. */
#if defined (USE_RAW_RECEIVE) || defined (USE_BPF_SEND) || \
defined (USE_NIT_RECEIVE) || defined (USE_UPF_RECEIVE) || \
defined (USE_DLPI_RECEIVE) || \
defined (USE_LPF_SEND) || \
(defined (USE_SOCKET_SEND) && defined (SO_BINDTODEVICE))
# define PACKET_DECODING
#endif
/* If we don't have a DLPI packet filter, we have to filter in userland.
Probably not worth doing, actually. */
#if defined (USE_DLPI_RECEIVE) && !defined (USE_DLPI_PFMOD)
# define USERLAND_FILTER
#endif
/* jmp_buf is assumed to be a struct unless otherwise defined in the
system header. */
#ifndef jbp_decl
# define jbp_decl(x) jmp_buf *x
#endif
#ifndef jref
# define jref(x) (&(x))
#endif
#ifndef jdref
# define jdref(x) (*(x))
#endif
#ifndef jrefproto
# define jrefproto jmp_buf *
#endif
#ifndef BPF_FORMAT
# define BPF_FORMAT "/dev/bpf%d"
#endif
#if defined (IFF_POINTOPOINT) && !defined (HAVE_IFF_POINTOPOINT)
# define HAVE_IFF_POINTOPOINT
#endif
#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
# define HAVE_AF_LINK
#endif
#if defined (ARPHRD_TUNNEL) && !defined (HAVE_ARPHRD_TUNNEL)
# define HAVE_ARPHRD_TUNNEL
#endif
#if defined (ARPHRD_LOOPBACK) && !defined (HAVE_ARPHRD_LOOPBACK)
# define HAVE_ARPHRD_LOOPBACK
#endif
#if defined (ARPHRD_ROSE) && !defined (HAVE_ARPHRD_ROSE)
# define HAVE_ARPHRD_ROSE
#endif
#if defined (ARPHRD_IEEE802) && !defined (HAVE_ARPHRD_IEEE802)
# define HAVE_ARPHRD_IEEE802
#endif
#if defined (ARPHRD_FDDI) && !defined (HAVE_ARPHRD_FDDI)
# define HAVE_ARPHRD_FDDI
#endif
#if defined (ARPHRD_AX25) && !defined (HAVE_ARPHRD_AX25)
# define HAVE_ARPHRD_AX25
#endif
#if defined (ARPHRD_NETROM) && !defined (HAVE_ARPHRD_NETROM)
# define HAVE_ARPHRD_NETROM
#endif
#if defined (ARPHRD_METRICOM) && !defined (HAVE_ARPHRD_METRICOM)
# define HAVE_ARPHRD_METRICOM
#endif
#if defined (SO_BINDTODEVICE) && !defined (HAVE_SO_BINDTODEVICE)
# define HAVE_SO_BINDTODEVICE
#endif
#if defined (SIOCGIFHWADDR) && !defined (HAVE_SIOCGIFHWADDR)
# define HAVE_SIOCGIFHWADDR
#endif
#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
# define HAVE_AF_LINK
#endif
-4
View File
@@ -1,4 +0,0 @@
#pragma once
struct iaddr;
struct interface_info;
-47
View File
@@ -1,47 +0,0 @@
/* $OpenBSD: privsep.h,v 1.2 2004/05/04 18:51:18 henning Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE, ABUSE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
//#include <poll.h>
//#include <pwd.h>
struct buf {
u_char *buf;
size_t size;
size_t wpos;
size_t rpos;
};
enum imsg_code {
IMSG_NONE,
IMSG_SCRIPT_INIT,
IMSG_SCRIPT_WRITE_PARAMS,
IMSG_SCRIPT_GO,
IMSG_SCRIPT_GO_RET
};
struct imsg_hdr {
enum imsg_code code;
size_t len;
};
struct buf *buf_open(size_t);
int buf_add(struct buf *, void *, size_t);
int buf_close(int, struct buf *);
ssize_t buf_read(int sock, void *, size_t);
-100
View File
@@ -1,100 +0,0 @@
/* Site-specific definitions.
For supported systems, you shouldn't need to make any changes here.
However, you may want to, in order to deal with site-specific
differences. */
/* Add any site-specific definitions and inclusions here... */
/* #include <site-foo-bar.h> */
/* #define SITE_FOOBAR */
/* Define this if you don't want dhcpd to run as a daemon and do want
to see all its output printed to stdout instead of being logged via
syslog(). This also makes dhcpd use the dhcpd.conf in its working
directory and write the dhcpd.leases file there. */
/* #define DEBUG */
/* Define this to see what the parser is parsing. You probably don't
want to see this. */
/* #define DEBUG_TOKENS */
/* Define this to see dumps of incoming and outgoing packets. This
slows things down quite a bit... */
/* #define DEBUG_PACKET */
/* Define this if you want to see dumps of tree evaluations. The most
common reason for doing this is to watch what happens with DNS name
lookups. */
/* #define DEBUG_EVAL */
/* Define this if you want the dhcpd.pid file to go somewhere other than
the default (which varies from system to system, but is usually either
/etc or /var/run. */
/* #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" */
/* Define this if you want the dhcpd.leases file (the dynamic lease database)
to go somewhere other than the default location, which is normally
/etc/dhcpd.leases. */
/* #define _PATH_DHCPD_DB "/etc/dhcpd.leases" */
/* Define this if you want the dhcpd.conf file to go somewhere other than
the default location. By default, it goes in /etc/dhcpd.conf. */
/* #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" */
/* Network API definitions. You do not need to choose one of these - if
you don't choose, one will be chosen for you in your system's config
header. DON'T MESS WITH THIS UNLESS YOU KNOW WHAT YOU'RE DOING!!! */
/* Define this to use the standard BSD socket API.
On many systems, the BSD socket API does not provide the ability to
send packets to the 255.255.255.255 broadcast address, which can
prevent some clients (e.g., Win95) from seeing replies. This is
not a problem on Solaris.
In addition, the BSD socket API will not work when more than one
network interface is configured on the server.
However, the BSD socket API is about as efficient as you can get, so if
the aforementioned problems do not matter to you, or if no other
API is supported for your system, you may want to go with it. */
/* #define USE_SOCKETS */
/* Define this to use the Sun Streams NIT API.
The Sun Streams NIT API is only supported on SunOS 4.x releases. */
/* #define USE_NIT */
/* Define this to use the Berkeley Packet Filter API.
The BPF API is available on all 4.4-BSD derivatives, including
NetBSD, FreeBSD and BSDI's BSD/OS. It's also available on
DEC Alpha OSF/1 in a compatibility mode supported by the Alpha OSF/1
packetfilter interface. */
/* #define USE_BPF */
/* Define this to use the raw socket API.
The raw socket API is provided on many BSD derivatives, and provides
a way to send out raw IP packets. It is only supported for sending
packets - packets must be received with the regular socket API.
This code is experimental - I've never gotten it to actually transmit
a packet to the 255.255.255.255 broadcast address - so use it at your
own risk. */
/* #define USE_RAW_SOCKETS */
/* Define this to change the logging facility used by dhcpd. */
/* #define DHCPD_LOG_FACILITY LOG_DAEMON */
-10
View File
@@ -1,10 +0,0 @@
#pragma once
typedef signed char int8_t;
typedef unsigned char u_int8_t;
typedef short int16_t;
typedef unsigned short u_int16_t;
typedef int int32_t;
typedef unsigned int u_int32_t;
typedef char *caddr_t;
-52
View File
@@ -1,52 +0,0 @@
/* systat.h
Definitions for systat protocol... */
/*
* Copyright (c) 1997 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This software has been written for the Internet Software Consortium
* by Ted Lemon <[email protected]> in cooperation with Vixie
* Enterprises. To learn more about the Internet Software Consortium,
* see ``http://www.vix.com/isc''. To learn more about Vixie
* Enterprises, see ``http://www.vix.com''.
*/
#define SYSCONF_SOCKET "/var/run/sysconf"
struct sysconf_header {
u_int32_t type; /* Type of status message... */
u_int32_t length; /* Length of message. */
};
/* Message types... */
#define NETWORK_LOCATION_CHANGED 1
-3
View File
@@ -1,3 +0,0 @@
/* Current version of ISC DHCP Distribution. */
#define DHCP_VERSION "2.0pl5"
-919
View File
@@ -1,919 +0,0 @@
/* memory.c
Memory-resident database... */
/*
* Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of The Internet Software Consortium nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This software has been written for the Internet Software Consortium
* by Ted Lemon <[email protected]> in cooperation with Vixie
* Enterprises. To learn more about the Internet Software Consortium,
* see ``http://www.vix.com/isc''. To learn more about Vixie
* Enterprises, see ``http://www.vix.com''.
*/
#ifndef lint
static char copyright[] =
"$Id: memory.c,v 1.35.2.4 1999/05/27 17:47:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "rosdhcp.h"
#include "dhcpd.h"
struct subnet *subnets;
struct shared_network *shared_networks;
static struct hash_table *host_hw_addr_hash;
static struct hash_table *host_uid_hash;
static struct hash_table *lease_uid_hash;
static struct hash_table *lease_ip_addr_hash;
static struct hash_table *lease_hw_addr_hash;
struct lease *dangling_leases;
static struct hash_table *vendor_class_hash;
static struct hash_table *user_class_hash;
void enter_host (hd)
struct host_decl *hd;
{
struct host_decl *hp = (struct host_decl *)0;
struct host_decl *np = (struct host_decl *)0;
hd -> n_ipaddr = (struct host_decl *)0;
if (hd -> interface.hlen) {
if (!host_hw_addr_hash)
host_hw_addr_hash = new_hash ();
else
hp = (struct host_decl *)
hash_lookup (host_hw_addr_hash,
hd -> interface.haddr,
hd -> interface.hlen);
/* If there isn't already a host decl matching this
address, add it to the hash table. */
if (!hp)
add_hash (host_hw_addr_hash,
hd -> interface.haddr, hd -> interface.hlen,
(unsigned char *)hd);
}
/* If there was already a host declaration for this hardware
address, add this one to the end of the list. */
if (hp) {
for (np = hp; np -> n_ipaddr; np = np -> n_ipaddr)
;
np -> n_ipaddr = hd;
}
if (hd -> group -> options [DHO_DHCP_CLIENT_IDENTIFIER]) {
if (!tree_evaluate (hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER]))
return;
/* If there's no uid hash, make one; otherwise, see if
there's already an entry in the hash for this host. */
if (!host_uid_hash) {
host_uid_hash = new_hash ();
hp = (struct host_decl *)0;
} else
hp = (struct host_decl *) hash_lookup
(host_uid_hash,
hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER] -> value,
hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER] -> len);
/* If there's already a host declaration for this
client identifier, add this one to the end of the
list. Otherwise, add it to the hash table. */
if (hp) {
/* Don't link it in twice... */
if (!np) {
for (np = hp; np -> n_ipaddr;
np = np -> n_ipaddr)
;
np -> n_ipaddr = hd;
}
} else {
add_hash (host_uid_hash,
hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER] -> value,
hd -> group -> options
[DHO_DHCP_CLIENT_IDENTIFIER] -> len,
(unsigned char *)hd);
}
}
}
struct host_decl *find_hosts_by_haddr (htype, haddr, hlen)
int htype;
unsigned char *haddr;
int hlen;
{
struct host_decl *foo;
foo = (struct host_decl *)hash_lookup (host_hw_addr_hash,
haddr, hlen);
return foo;
}
struct host_decl *find_hosts_by_uid (data, len)
unsigned char *data;
int len;
{
struct host_decl *foo;
foo = (struct host_decl *)hash_lookup (host_uid_hash, data, len);
return foo;
}
/* More than one host_decl can be returned by find_hosts_by_haddr or
find_hosts_by_uid, and each host_decl can have multiple addresses.
Loop through the list of hosts, and then for each host, through the
list of addresses, looking for an address that's in the same shared
network as the one specified. Store the matching address through
the addr pointer, update the host pointer to point at the host_decl
that matched, and return the subnet that matched. */
subnet *find_host_for_network (struct host_decl **host, iaddr *addr,
shared_network *share)
{
int i;
subnet *subnet;
iaddr ip_address;
struct host_decl *hp;
for (hp = *host; hp; hp = hp -> n_ipaddr) {
if (!hp -> fixed_addr || !tree_evaluate (hp -> fixed_addr))
continue;
for (i = 0; i < hp -> fixed_addr -> len; i += 4) {
ip_address.len = 4;
memcpy (ip_address.iabuf,
hp -> fixed_addr -> value + i, 4);
subnet = find_grouped_subnet (share, ip_address);
if (subnet) {
*addr = ip_address;
*host = hp;
return subnet;
}
}
}
return (struct _subnet *)0;
}
void new_address_range (iaddr low, iaddr high, subnet *subnet, int dynamic)
{
lease *address_range, *lp, *plp;
iaddr net;
int min, max, i;
char lowbuf [16], highbuf [16], netbuf [16];
shared_network *share = subnet -> shared_network;
struct hostent *h;
struct in_addr ia;
/* All subnets should have attached shared network structures. */
if (!share) {
strcpy (netbuf, piaddr (subnet -> net));
error ("No shared network for network %s (%s)",
netbuf, piaddr (subnet -> netmask));
}
/* Initialize the hash table if it hasn't been done yet. */
if (!lease_uid_hash)
lease_uid_hash = new_hash ();
if (!lease_ip_addr_hash)
lease_ip_addr_hash = new_hash ();
if (!lease_hw_addr_hash)
lease_hw_addr_hash = new_hash ();
/* Make sure that high and low addresses are in same subnet. */
net = subnet_number (low, subnet -> netmask);
if (!addr_eq (net, subnet_number (high, subnet -> netmask))) {
strcpy (lowbuf, piaddr (low));
strcpy (highbuf, piaddr (high));
strcpy (netbuf, piaddr (subnet -> netmask));
error ("Address range %s to %s, netmask %s spans %s!",
lowbuf, highbuf, netbuf, "multiple subnets");
}
/* Make sure that the addresses are on the correct subnet. */
if (!addr_eq (net, subnet -> net)) {
strcpy (lowbuf, piaddr (low));
strcpy (highbuf, piaddr (high));
strcpy (netbuf, piaddr (subnet -> netmask));
error ("Address range %s to %s not on net %s/%s!",
lowbuf, highbuf, piaddr (subnet -> net), netbuf);
}
/* Get the high and low host addresses... */
max = host_addr (high, subnet -> netmask);
min = host_addr (low, subnet -> netmask);
/* Allow range to be specified high-to-low as well as low-to-high. */
if (min > max) {
max = min;
min = host_addr (high, subnet -> netmask);
}
/* Get a lease structure for each address in the range. */
address_range = new_leases (max - min + 1, "new_address_range");
if (!address_range) {
strcpy (lowbuf, piaddr (low));
strcpy (highbuf, piaddr (high));
error ("No memory for address range %s-%s.", lowbuf, highbuf);
}
memset (address_range, 0, (sizeof *address_range) * (max - min + 1));
/* Fill in the last lease if it hasn't been already... */
if (!share -> last_lease) {
share -> last_lease = &address_range [0];
}
/* Fill out the lease structures with some minimal information. */
for (i = 0; i < max - min + 1; i++) {
address_range [i].ip_addr =
ip_addr (subnet -> net, subnet -> netmask, i + min);
address_range [i].starts =
address_range [i].timestamp = MIN_TIME;
address_range [i].ends = MIN_TIME;
address_range [i].subnet = subnet;
address_range [i].shared_network = share;
address_range [i].flags = dynamic ? DYNAMIC_BOOTP_OK : 0;
memcpy (&ia, address_range [i].ip_addr.iabuf, 4);
if (subnet -> group -> get_lease_hostnames) {
h = gethostbyaddr ((char *)&ia, sizeof ia, AF_INET);
if (!h)
warn ("No hostname for %s", inet_ntoa (ia));
else {
address_range [i].hostname =
malloc (strlen (h -> h_name) + 1);
if (!address_range [i].hostname)
error ("no memory for hostname %s.",
h -> h_name);
strcpy (address_range [i].hostname,
h -> h_name);
}
}
/* Link this entry into the list. */
address_range [i].next = share -> leases;
address_range [i].prev = (struct lease *)0;
share -> leases = &address_range [i];
if (address_range [i].next)
address_range [i].next -> prev = share -> leases;
add_hash (lease_ip_addr_hash,
address_range [i].ip_addr.iabuf,
address_range [i].ip_addr.len,
(unsigned char *)&address_range [i]);
}
/* Find out if any dangling leases are in range... */
plp = (struct lease *)0;
for (lp = dangling_leases; lp; lp = lp -> next) {
iaddr lnet;
int lhost;
lnet = subnet_number (lp -> ip_addr, subnet -> netmask);
lhost = host_addr (lp -> ip_addr, subnet -> netmask);
/* If it's in range, fill in the real lease structure with
the dangling lease's values, and remove the lease from
the list of dangling leases. */
if (addr_eq (lnet, subnet -> net) &&
lhost >= i && lhost <= max) {
if (plp) {
plp -> next = lp -> next;
} else {
dangling_leases = lp -> next;
}
lp -> next = (struct lease *)0;
address_range [lhost - i].hostname = lp -> hostname;
address_range [lhost - i].client_hostname =
lp -> client_hostname;
supersede_lease (&address_range [lhost - i], lp, 0);
free_lease (lp, "new_address_range");
} else
plp = lp;
}
}
subnet *find_subnet (iaddr addr)
{
subnet *rv;
for (rv = subnets; rv; rv = rv -> next_subnet) {
if (addr_eq (subnet_number (addr, rv -> netmask), rv -> net))
return rv;
}
return (subnet *)0;
}
subnet *find_grouped_subnet (shared_network *share, iaddr addr)
{
subnet *rv;
for (rv = share -> subnets; rv; rv = rv -> next_sibling) {
if (addr_eq (subnet_number (addr, rv -> netmask), rv -> net))
return rv;
}
return (subnet *)0;
}
int subnet_inner_than (struct _subnet *subnet, struct _subnet *scan, int warnp)
{
if (addr_eq (subnet_number (subnet -> net, scan -> netmask),
scan -> net) ||
addr_eq (subnet_number (scan -> net, subnet -> netmask),
subnet -> net)) {
char n1buf [16];
int i, j;
for (i = 0; i < 32; i++)
if (subnet -> netmask.iabuf [3 - (i >> 3)]
& (1 << (i & 7)))
break;
for (j = 0; j < 32; j++)
if (scan -> netmask.iabuf [3 - (j >> 3)] &
(1 << (j & 7)))
break;
strcpy (n1buf, piaddr (subnet -> net));
if (warnp)
warn ("%ssubnet %s/%d conflicts with subnet %s/%d",
"Warning: ", n1buf, 32 - i,
piaddr (scan -> net), 32 - j);
if (i < j)
return 1;
}
return 0;
}
/* Enter a new subnet into the subnet list. */
void enter_subnet (struct _subnet *subnet)
{
struct _subnet *scan, *prev = (struct _subnet *)0;
/* Check for duplicates... */
for (scan = subnets; scan; scan = scan -> next_subnet) {
/* When we find a conflict, make sure that the
subnet with the narrowest subnet mask comes
first. */
if (subnet_inner_than (subnet, scan, 1)) {
if (prev) {
prev -> next_subnet = subnet;
} else
subnets = subnet;
subnet -> next_subnet = scan;
return;
}
prev = scan;
}
/* XXX use the BSD radix tree code instead of a linked list. */
subnet -> next_subnet = subnets;
subnets = subnet;
}
/* Enter a new shared network into the shared network list. */
void enter_shared_network (shared_network *share)
{
/* XXX Sort the nets into a balanced tree to make searching quicker. */
share -> next = shared_networks;
shared_networks = share;
}
/* Enter a lease into the system. This is called by the parser each
time it reads in a new lease. If the subnet for that lease has
already been read in (usually the case), just update that lease;
otherwise, allocate temporary storage for the lease and keep it around
until we're done reading in the config file. */
void enter_lease (struct _lease *lease)
{
struct _lease *comp = find_lease_by_ip_addr (lease -> ip_addr);
/* If we don't have a place for this lease yet, save it for
later. */
if (!comp) {
comp = new_lease ("enter_lease");
if (!comp) {
error ("No memory for lease %s\n",
piaddr (lease -> ip_addr));
}
*comp = *lease;
comp -> next = dangling_leases;
comp -> prev = (struct lease *)0;
dangling_leases = comp;
} else {
/* Record the hostname information in the lease. */
comp -> hostname = lease -> hostname;
comp -> client_hostname = lease -> client_hostname;
supersede_lease (comp, lease, 0);
}
}
/* Replace the data in an existing lease with the data in a new lease;
adjust hash tables to suit, and insertion sort the lease into the
list of leases by expiry time so that we can always find the oldest
lease. */
int supersede_lease (struct _lease *comp, struct _lease *lease, int commit)
{
int enter_uid = 0;
int enter_hwaddr = 0;
struct _lease *lp;
/* Static leases are not currently kept in the database... */
if (lease -> flags & STATIC_LEASE)
return 1;
/* If the existing lease hasn't expired and has a different
unique identifier or, if it doesn't have a unique
identifier, a different hardware address, then the two
leases are in conflict. If the existing lease has a uid
and the new one doesn't, but they both have the same
hardware address, and dynamic bootp is allowed on this
lease, then we allow that, in case a dynamic BOOTP lease is
requested *after* a DHCP lease has been assigned. */
if (!(lease -> flags & ABANDONED_LEASE) &&
comp -> ends > cur_time &&
(((comp -> uid && lease -> uid) &&
(comp -> uid_len != lease -> uid_len ||
memcmp (comp -> uid, lease -> uid, comp -> uid_len))) ||
(!comp -> uid &&
((comp -> hardware_addr.htype !=
lease -> hardware_addr.htype) ||
(comp -> hardware_addr.hlen !=
lease -> hardware_addr.hlen) ||
memcmp (comp -> hardware_addr.haddr,
lease -> hardware_addr.haddr,
comp -> hardware_addr.hlen))))) {
warn ("Lease conflict at %s",
piaddr (comp -> ip_addr));
return 0;
} else {
/* If there's a Unique ID, dissociate it from the hash
table and free it if necessary. */
if (comp -> uid) {
uid_hash_delete (comp);
enter_uid = 1;
if (comp -> uid != &comp -> uid_buf [0]) {
free (comp -> uid);
comp -> uid_max = 0;
comp -> uid_len = 0;
}
comp -> uid = (unsigned char *)0;
} else
enter_uid = 1;
if (comp -> hardware_addr.htype &&
((comp -> hardware_addr.hlen !=
lease -> hardware_addr.hlen) ||
(comp -> hardware_addr.htype !=
lease -> hardware_addr.htype) ||
memcmp (comp -> hardware_addr.haddr,
lease -> hardware_addr.haddr,
comp -> hardware_addr.hlen))) {
hw_hash_delete (comp);
enter_hwaddr = 1;
} else if (!comp -> hardware_addr.htype)
enter_hwaddr = 1;
/* Copy the data files, but not the linkages. */
comp -> starts = lease -> starts;
if (lease -> uid) {
if (lease -> uid_len < sizeof (lease -> uid_buf)) {
memcpy (comp -> uid_buf,
lease -> uid, lease -> uid_len);
comp -> uid = &comp -> uid_buf [0];
comp -> uid_max = sizeof comp -> uid_buf;
} else if (lease -> uid != &lease -> uid_buf [0]) {
comp -> uid = lease -> uid;
comp -> uid_max = lease -> uid_max;
lease -> uid = (unsigned char *)0;
lease -> uid_max = 0;
} else {
error ("corrupt lease uid."); /* XXX */
}
} else {
comp -> uid = (unsigned char *)0;
comp -> uid_max = 0;
}
comp -> uid_len = lease -> uid_len;
comp -> host = lease -> host;
comp -> hardware_addr = lease -> hardware_addr;
comp -> flags = ((lease -> flags & ~PERSISTENT_FLAGS) |
(comp -> flags & ~EPHEMERAL_FLAGS));
/* Record the lease in the uid hash if necessary. */
if (enter_uid && lease -> uid) {
uid_hash_add (comp);
}
/* Record it in the hardware address hash if necessary. */
if (enter_hwaddr && lease -> hardware_addr.htype) {
hw_hash_add (comp);
}
/* Remove the lease from its current place in the
timeout sequence. */
if (comp -> prev) {
comp -> prev -> next = comp -> next;
} else {
comp -> shared_network -> leases = comp -> next;
}
if (comp -> next) {
comp -> next -> prev = comp -> prev;
}
if (comp -> shared_network -> last_lease == comp) {
comp -> shared_network -> last_lease = comp -> prev;
}
/* Find the last insertion point... */
if (comp == comp -> shared_network -> insertion_point ||
!comp -> shared_network -> insertion_point) {
lp = comp -> shared_network -> leases;
} else {
lp = comp -> shared_network -> insertion_point;
}
if (!lp) {
/* Nothing on the list yet? Just make comp the
head of the list. */
comp -> shared_network -> leases = comp;
comp -> shared_network -> last_lease = comp;
} else if (lp -> ends > lease -> ends) {
/* Skip down the list until we run out of list
or find a place for comp. */
while (lp -> next && lp -> ends > lease -> ends) {
lp = lp -> next;
}
if (lp -> ends > lease -> ends) {
/* If we ran out of list, put comp
at the end. */
lp -> next = comp;
comp -> prev = lp;
comp -> next = (struct lease *)0;
comp -> shared_network -> last_lease = comp;
} else {
/* If we didn't, put it between lp and
the previous item on the list. */
if ((comp -> prev = lp -> prev))
comp -> prev -> next = comp;
comp -> next = lp;
lp -> prev = comp;
}
} else {
/* Skip up the list until we run out of list
or find a place for comp. */
while (lp -> prev && lp -> ends < lease -> ends) {
lp = lp -> prev;
}
if (lp -> ends < lease -> ends) {
/* If we ran out of list, put comp
at the beginning. */
lp -> prev = comp;
comp -> next = lp;
comp -> prev = (struct lease *)0;
comp -> shared_network -> leases = comp;
} else {
/* If we didn't, put it between lp and
the next item on the list. */
if ((comp -> next = lp -> next))
comp -> next -> prev = comp;
comp -> prev = lp;
lp -> next = comp;
}
}
comp -> shared_network -> insertion_point = comp;
comp -> ends = lease -> ends;
}
/* Return zero if we didn't commit the lease to permanent storage;
nonzero if we did. */
return commit && write_lease (comp) && commit_leases ();
}
/* Release the specified lease and re-hash it as appropriate. */
void release_lease (struct _lease *lease)
{
struct _lease lt;
lt = *lease;
if (lt.ends > cur_time) {
lt.ends = cur_time;
supersede_lease (lease, &lt, 1);
}
}
/* Abandon the specified lease (set its timeout to infinity and its
particulars to zero, and re-hash it as appropriate. */
void abandon_lease (struct _lease *lease, char *message)
{
struct _lease lt;
lease -> flags |= ABANDONED_LEASE;
lt = *lease;
lt.ends = cur_time;
warn ("Abandoning IP address %s: %s",
piaddr (lease -> ip_addr), message);
lt.hardware_addr.htype = 0;
lt.hardware_addr.hlen = 0;
lt.uid = (unsigned char *)0;
lt.uid_len = 0;
supersede_lease (lease, &lt, 1);
}
/* Locate the lease associated with a given IP address... */
lease *find_lease_by_ip_addr (iaddr addr)
{
lease *lease = (struct _lease *)hash_lookup (lease_ip_addr_hash,
addr.iabuf,
addr.len);
return lease;
}
lease *find_lease_by_uid (unsigned char *uid, int len)
{
lease *lease = (struct lease *)hash_lookup (lease_uid_hash,
uid, len);
return lease;
}
lease *find_lease_by_hw_addr (unsigned char *hwaddr, int hwlen)
{
struct _lease *lease =
(struct _lease *)hash_lookup (lease_hw_addr_hash,
hwaddr, hwlen);
return lease;
}
/* Add the specified lease to the uid hash. */
void uid_hash_add (lease *lease)
{
struct _lease *head = find_lease_by_uid (lease -> uid, lease -> uid_len);
struct _lease *scan;
#ifdef DEBUG
if (lease -> n_uid)
abort ();
#endif
/* If it's not in the hash, just add it. */
if (!head)
add_hash (lease_uid_hash, lease -> uid,
lease -> uid_len, (unsigned char *)lease);
else {
/* Otherwise, attach it to the end of the list. */
for (scan = head; scan -> n_uid; scan = scan -> n_uid)
#ifdef DEBUG
if (scan == lease)
abort ()
#endif
;
scan -> n_uid = lease;
}
}
/* Delete the specified lease from the uid hash. */
void uid_hash_delete (lease *lease)
{
struct _lease *head =
find_lease_by_uid (lease -> uid, lease -> uid_len);
struct _lease *scan;
/* If it's not in the hash, we have no work to do. */
if (!head) {
lease -> n_uid = (struct lease *)0;
return;
}
/* If the lease we're freeing is at the head of the list,
remove the hash table entry and add a new one with the
next lease on the list (if there is one). */
if (head == lease) {
delete_hash_entry (lease_uid_hash,
lease -> uid, lease -> uid_len);
if (lease -> n_uid)
add_hash (lease_uid_hash,
lease -> n_uid -> uid,
lease -> n_uid -> uid_len,
(unsigned char *)(lease -> n_uid));
} else {
/* Otherwise, look for the lease in the list of leases
attached to the hash table entry, and remove it if
we find it. */
for (scan = head; scan -> n_uid; scan = scan -> n_uid) {
if (scan -> n_uid == lease) {
scan -> n_uid = scan -> n_uid -> n_uid;
break;
}
}
}
lease -> n_uid = (struct lease *)0;
}
/* Add the specified lease to the hardware address hash. */
void hw_hash_add (lease *lease)
{
struct _lease *head =
find_lease_by_hw_addr (lease -> hardware_addr.haddr,
lease -> hardware_addr.hlen);
struct _lease *scan;
/* If it's not in the hash, just add it. */
if (!head)
add_hash (lease_hw_addr_hash,
lease -> hardware_addr.haddr,
lease -> hardware_addr.hlen,
(unsigned char *)lease);
else {
/* Otherwise, attach it to the end of the list. */
for (scan = head; scan -> n_hw; scan = scan -> n_hw)
;
scan -> n_hw = lease;
}
}
/* Delete the specified lease from the hardware address hash. */
void hw_hash_delete (lease *lease)
{
struct _lease *head =
find_lease_by_hw_addr (lease -> hardware_addr.haddr,
lease -> hardware_addr.hlen);
struct _lease *scan;
/* If it's not in the hash, we have no work to do. */
if (!head) {
lease -> n_hw = (struct lease *)0;
return;
}
/* If the lease we're freeing is at the head of the list,
remove the hash table entry and add a new one with the
next lease on the list (if there is one). */
if (head == lease) {
delete_hash_entry (lease_hw_addr_hash,
lease -> hardware_addr.haddr,
lease -> hardware_addr.hlen);
if (lease -> n_hw)
add_hash (lease_hw_addr_hash,
lease -> n_hw -> hardware_addr.haddr,
lease -> n_hw -> hardware_addr.hlen,
(unsigned char *)(lease -> n_hw));
} else {
/* Otherwise, look for the lease in the list of leases
attached to the hash table entry, and remove it if
we find it. */
for (scan = head; scan -> n_hw; scan = scan -> n_hw) {
if (scan -> n_hw == lease) {
scan -> n_hw = scan -> n_hw -> n_hw;
break;
}
}
}
lease -> n_hw = (struct lease *)0;
}
struct class *add_class (type, name)
int type;
char *name;
{
struct class *class = new_class ("add_class");
char *tname = (char *)malloc (strlen (name) + 1);
if (!vendor_class_hash)
vendor_class_hash = new_hash ();
if (!user_class_hash)
user_class_hash = new_hash ();
if (!tname || !class || !vendor_class_hash || !user_class_hash)
{
if (tname != NULL)
free(tname);
return (struct class *)0;
}
memset (class, 0, sizeof *class);
strcpy (tname, name);
class -> name = tname;
if (type)
add_hash (user_class_hash,
(unsigned char *)tname, strlen (tname),
(unsigned char *)class);
else
add_hash (vendor_class_hash,
(unsigned char *)tname, strlen (tname),
(unsigned char *)class);
return class;
}
struct class *find_class (type, name, len)
int type;
unsigned char *name;
int len;
{
struct class *class =
(struct class *)hash_lookup (type
? user_class_hash
: vendor_class_hash, name, len);
return class;
}
struct group *clone_group (group, caller)
struct group *group;
char *caller;
{
struct group *g = new_group (caller);
if (!g)
error ("%s: can't allocate new group", caller);
*g = *group;
return g;
}
/* Write all interesting leases to permanent storage. */
void write_leases ()
{
lease *l;
shared_network *s;
for (s = shared_networks; s; s = (shared_network *)s -> next) {
for (l = s -> leases; l; l = l -> next) {
if (l -> hardware_addr.hlen ||
l -> uid_len ||
(l -> flags & ABANDONED_LEASE))
if (!write_lease (l))
error ("Can't rewrite lease database");
}
}
if (!commit_leases ())
error ("Can't commit leases to new database: %m");
}
void dump_subnets ()
{
struct _lease *l;
shared_network *s;
subnet *n;
note ("Subnets:");
for (n = subnets; n; n = n -> next_subnet) {
debug (" Subnet %s", piaddr (n -> net));
debug (" netmask %s",
piaddr (n -> netmask));
}
note ("Shared networks:");
for (s = shared_networks; s; s = (shared_network *)s -> next) {
note (" %s", s -> name);
for (l = s -> leases; l; l = l -> next) {
print_lease (l);
}
if (s -> last_lease) {
debug (" Last Lease:");
print_lease (s -> last_lease);
}
}
}
-225
View File
@@ -1,225 +0,0 @@
/* $OpenBSD: privsep.c,v 1.7 2004/05/10 18:34:42 deraadt Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE, ABUSE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "rosdhcp.h"
#include "dhcpd.h"
#include "privsep.h"
struct buf *
buf_open(size_t len)
{
struct buf *buf;
if ((buf = calloc(1, sizeof(struct buf))) == NULL)
return (NULL);
if ((buf->buf = malloc(len)) == NULL) {
free(buf);
return (NULL);
}
buf->size = len;
return (buf);
}
int
buf_add(struct buf *buf, void *data, size_t len)
{
if (buf->wpos + len > buf->size)
return (-1);
memcpy(buf->buf + buf->wpos, data, len);
buf->wpos += len;
return (0);
}
int
buf_close(int sock, struct buf *buf)
{
ssize_t n;
n = write(sock, buf->buf + buf->rpos, buf->size - buf->rpos);
if (n != -1)
buf->rpos += n;
if (n == 0) { /* connection closed */
return (-1);
}
if (buf->rpos < buf->size)
error("short write: wanted %lu got %ld bytes",
(unsigned long)buf->size, (long)buf->rpos);
free(buf->buf);
free(buf);
return (n);
}
ssize_t
buf_read(int sock, void *buf, size_t nbytes)
{
ssize_t n, r = 0;
char *p = buf;
n = read(sock, p, nbytes);
if (n == 0)
error("connection closed");
if (n != -1) {
r += n;
p += n;
nbytes -= n;
}
if (n == -1)
error("buf_read: %d", WSAGetLastError());
if (r < nbytes)
error("short read: wanted %lu got %ld bytes",
(unsigned long)nbytes, (long)r);
return (r);
}
void
dispatch_imsg(int fd)
{
struct imsg_hdr hdr;
char *medium, *reason, *filename,
*servername, *prefix;
size_t medium_len, reason_len, filename_len,
servername_len, prefix_len, totlen;
struct client_lease lease;
int ret, i, optlen;
struct buf *buf;
buf_read(fd, &hdr, sizeof(hdr));
switch (hdr.code) {
case IMSG_SCRIPT_INIT:
if (hdr.len < sizeof(hdr) + sizeof(size_t))
error("corrupted message received");
buf_read(fd, &medium_len, sizeof(medium_len));
if (hdr.len < medium_len + sizeof(size_t) + sizeof(hdr)
+ sizeof(size_t) || medium_len == SIZE_T_MAX)
error("corrupted message received");
if (medium_len > 0) {
if ((medium = calloc(1, medium_len + 1)) != NULL)
buf_read(fd, medium, medium_len);
} else
medium = NULL;
buf_read(fd, &reason_len, sizeof(reason_len));
if (hdr.len < medium_len + reason_len + sizeof(hdr) ||
reason_len == SIZE_T_MAX)
error("corrupted message received");
if (reason_len > 0) {
if ((reason = calloc(1, reason_len + 1)) != NULL)
buf_read(fd, reason, reason_len);
} else
reason = NULL;
// priv_script_init(reason, medium);
free(reason);
free(medium);
break;
case IMSG_SCRIPT_WRITE_PARAMS:
//bzero(&lease, sizeof lease);
memset(&lease, 0, sizeof(lease));
totlen = sizeof(hdr) + sizeof(lease) + sizeof(size_t);
if (hdr.len < totlen)
error("corrupted message received");
buf_read(fd, &lease, sizeof(lease));
buf_read(fd, &filename_len, sizeof(filename_len));
totlen += filename_len + sizeof(size_t);
if (hdr.len < totlen || filename_len == SIZE_T_MAX)
error("corrupted message received");
if (filename_len > 0) {
if ((filename = calloc(1, filename_len + 1)) != NULL)
buf_read(fd, filename, filename_len);
} else
filename = NULL;
buf_read(fd, &servername_len, sizeof(servername_len));
totlen += servername_len + sizeof(size_t);
if (hdr.len < totlen || servername_len == SIZE_T_MAX)
error("corrupted message received");
if (servername_len > 0) {
if ((servername =
calloc(1, servername_len + 1)) != NULL)
buf_read(fd, servername, servername_len);
} else
servername = NULL;
buf_read(fd, &prefix_len, sizeof(prefix_len));
totlen += prefix_len;
if (hdr.len < totlen || prefix_len == SIZE_T_MAX)
error("corrupted message received");
if (prefix_len > 0) {
if ((prefix = calloc(1, prefix_len + 1)) != NULL)
buf_read(fd, prefix, prefix_len);
} else
prefix = NULL;
for (i = 0; i < 256; i++) {
totlen += sizeof(optlen);
if (hdr.len < totlen)
error("corrupted message received");
buf_read(fd, &optlen, sizeof(optlen));
lease.options[i].data = NULL;
lease.options[i].len = optlen;
if (optlen > 0) {
totlen += optlen;
if (hdr.len < totlen || optlen == SIZE_T_MAX)
error("corrupted message received");
lease.options[i].data =
calloc(1, optlen + 1);
if (lease.options[i].data != NULL)
buf_read(fd, lease.options[i].data, optlen);
}
}
lease.server_name = servername;
lease.filename = filename;
// priv_script_write_params(prefix, &lease);
free(servername);
free(filename);
free(prefix);
for (i = 0; i < 256; i++)
if (lease.options[i].len > 0)
free(lease.options[i].data);
break;
case IMSG_SCRIPT_GO:
if (hdr.len != sizeof(hdr))
error("corrupted message received");
// ret = priv_script_go();
hdr.code = IMSG_SCRIPT_GO_RET;
hdr.len = sizeof(struct imsg_hdr) + sizeof(int);
buf = buf_open(hdr.len);
if (buf != NULL) {
buf_add(buf, &hdr, sizeof(hdr));
buf_add(buf, &ret, sizeof(ret));
buf_close(fd, buf);
}
break;
default:
error("received unknown message, code %d", hdr.code);
}
}
-2
View File
@@ -1,2 +0,0 @@
#include "rosdhcp.h"
-3
View File
@@ -4,9 +4,6 @@
<directory name="audiosrv">
<xi:include href="audiosrv/audiosrv.rbuild" />
</directory>
<directory name="dhcp">
<xi:include href="dhcp/dhcp.rbuild" />
</directory>
<directory name="eventlog">
<xi:include href="eventlog/eventlog.rbuild" />
</directory>
-3
View File
@@ -60,9 +60,6 @@ RunNewSetup (HINSTANCE hInstance)
HMODULE hDll;
PINSTALL_REACTOS InstallReactOS;
/* some dlls (loaded by syssetup) need a valid user profile */
InitializeProfiles();
hDll = LoadLibrary (TEXT("syssetup"));
if (hDll == NULL)
{
+4
View File
@@ -132,6 +132,7 @@ InfpOpenInfFileW(
IN PCWSTR FileName,
IN PCWSTR InfClass,
IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine)
{
HINF hInf = NULL;
@@ -143,6 +144,7 @@ InfpOpenInfFileW(
Status = InfOpenFile(
&hInf,
&FileNameU,
LocaleId,
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
@@ -252,6 +254,7 @@ INF_OpenBufferedFileA(
IN ULONG FileSize,
IN PCSTR InfClass,
IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine)
{
#ifdef __REACTOS__
@@ -263,6 +266,7 @@ INF_OpenBufferedFileA(
&hInf,
FileBuffer,
FileSize,
LocaleId,
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
+2
View File
@@ -110,6 +110,7 @@ InfpOpenInfFileW(
IN PCWSTR FileName,
IN PCWSTR InfClass,
IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine);
#endif /* __REACTOS__ */
@@ -132,6 +133,7 @@ INF_OpenBufferedFileA(
IN ULONG FileSize,
IN PCSTR InfClass,
IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine);
VOID INF_SetHeap(
+10 -1
View File
@@ -79,6 +79,8 @@ static PGENERIC_LIST KeyboardList = NULL;
static PGENERIC_LIST LayoutList = NULL;
static PGENERIC_LIST LanguageList = NULL;
static LANGID LanguageId = 0;
/* FUNCTIONS ****************************************************************/
static VOID
@@ -422,6 +424,7 @@ CheckUnattendedSetup(VOID)
UnattendInf = SetupOpenInfFileW(UnattendInfPath,
NULL,
INF_STYLE_WIN4,
LanguageId,
&ErrorLine);
if (UnattendInf == INVALID_HANDLE_VALUE)
@@ -678,6 +681,8 @@ LanguagePage(PINPUT_RECORD Ir)
{
SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
if (wcscmp(SelectedLanguageId, DefaultLanguage))
{
UpdateKBLayout();
@@ -765,6 +770,7 @@ SetupStartPage(PINPUT_RECORD Ir)
SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL,
INF_STYLE_WIN4,
LanguageId,
&ErrorLine);
if (SetupInf == INVALID_HANDLE_VALUE)
@@ -3045,6 +3051,7 @@ PrepareCopyPage(PINPUT_RECORD Ir)
InfFileSize,
(const CHAR*) NULL,
INF_STYLE_WIN4,
LanguageId,
&ErrorLine);
if (InfHandle == INVALID_HANDLE_VALUE)
@@ -3259,6 +3266,8 @@ RegistryPage(PINPUT_RECORD Ir)
DPRINT("Action: %S File: %S Section %S\n", Action, File, Section);
if (Action == NULL) break; // Hackfix
if (!_wcsicmp (Action, L"AddReg"))
{
Delete = FALSE;
@@ -3274,7 +3283,7 @@ RegistryPage(PINPUT_RECORD Ir)
CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File);
if (!ImportRegistryFile(File, Section, Delete))
if (!ImportRegistryFile(File, Section, LanguageId, Delete))
{
DPRINT("Importing %S failed\n", File);
+2 -2
View File
@@ -399,13 +399,13 @@ static MUI_ENTRY itITDevicePageEntries[] =
{
6,
19,
"Pu• scegliere la configurazione con i tasti SU e GIë",
"Pu• scegliere un elemento della configurazione con i tasti SU e GIë",
TEXT_STYLE_NORMAL
},
{
6,
20,
"Premere INVIO per modificare la configurazione alternativa.",
"e modificarlo premendo INVIO per selezionare un valore alternativo.",
TEXT_STYLE_NORMAL
},
{
+2
View File
@@ -617,6 +617,7 @@ registry_callback (HINF hInf, PCWSTR Section, BOOLEAN Delete)
BOOLEAN
ImportRegistryFile(PWSTR Filename,
PWSTR Section,
LCID LocaleId,
BOOLEAN Delete)
{
WCHAR FileNameBuffer[MAX_PATH];
@@ -632,6 +633,7 @@ ImportRegistryFile(PWSTR Filename,
FileNameBuffer,
NULL,
INF_STYLE_WIN4,
LocaleId,
&ErrorLine);
if (hInf == INVALID_HANDLE_VALUE)
{
+1
View File
@@ -29,6 +29,7 @@
BOOLEAN
ImportRegistryFile(PWSTR Filename,
PWSTR Section,
LCID LocaleId,
BOOLEAN Delete);
BOOLEAN
+2 -2
View File
@@ -4,10 +4,10 @@
<bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" />
<include base="usetup">.</include>
<include base="zlib">.</include>
<include base="inflib">.</include>
<include base="newinflib">.</include>
<include base="ReactOS">include/reactos/drivers</include>
<library>zlib</library>
<library>inflib</library>
<library>newinflib</library>
<library>ext2lib</library>
<library>vfatlib</library>
<library>ntdll</library>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 36 KiB

+6 -3
View File
@@ -1282,14 +1282,17 @@ HWND ClockWindow::Create(HWND hwndParent)
ClientRect clnt(hwndParent);
WindowCanvas canvas(hwndParent);
FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT));
FontSelection font(canvas, GetStockFont(ANSI_VAR_FONT));
RECT rect = {0, 0, 0, 0};
TCHAR buffer[8];
TCHAR buffer[16];
// Arbitrary high time so that the created clock window is big enough
SYSTEMTIME st = { 1601, 1, 0, 1, 23, 59, 59, 999 };
if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, NULL, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
if (!GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, buffer, sizeof(buffer)/sizeof(TCHAR)))
_tcscpy(buffer, TEXT("00:00"));
// Calculate the rectangle needed to draw the time (without actually drawing it)
DrawText(canvas, buffer, -1, &rect, DT_SINGLELINE|DT_NOPREFIX|DT_CALCRECT);
int clockwindowWidth = rect.right-rect.left + 4;
+3 -3
View File
@@ -212,7 +212,6 @@ StartAutoApplications(
WARN("FindFirstFile(%s) failed with error %lu\n", debugstr_w(szPath), GetLastError());
return;
}
szPath[len] = L'\0';
do
{
@@ -220,9 +219,10 @@ StartAutoApplications(
{
memset(&ExecInfo, 0x0, sizeof(SHELLEXECUTEINFOW));
ExecInfo.cbSize = sizeof(ExecInfo);
wcscpy(&szPath[len+1], findData.cFileName);
ExecInfo.lpVerb = L"open";
ExecInfo.lpFile = findData.cFileName;
ExecInfo.lpDirectory = szPath;
ExecInfo.lpFile = szPath;
ExecInfo.lpDirectory = NULL;
TRACE("Executing %s in directory %s\n",
debugstr_w(findData.cFileName), debugstr_w(szPath));
ShellExecuteExW(&ExecInfo);
+169
View File
@@ -0,0 +1,169 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Winlogon
* FILE: base/system/winlogon/environment.c
* PURPOSE: User environment routines
* PROGRAMMERS: Thomas Weidenmueller (w3seek@users.sourceforge.net)
* Hervé Poussineau (hpoussin@reactos.org)
* Eric Kohl
*/
/* INCLUDES *****************************************************************/
#include "winlogon.h"
#include <shlobj.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(winlogon);
/* GLOBALS ******************************************************************/
typedef HRESULT (WINAPI *PFSHGETFOLDERPATHW)(HWND, int, HANDLE, DWORD, LPWSTR);
/* FUNCTIONS ****************************************************************/
static VOID
BuildVolatileEnvironment(IN PWLSESSION Session,
IN HKEY hKey)
{
HINSTANCE hShell32 = NULL;
PFSHGETFOLDERPATHW pfSHGetFolderPathW = NULL;
WCHAR szPath[MAX_PATH + 1];
WCHAR szExpandedPath[MAX_PATH + 1];
LPCWSTR wstr;
SIZE_T size;
WCHAR szEnvKey[MAX_PATH];
WCHAR szEnvValue[1024];
SIZE_T length;
LPWSTR eqptr, endptr;
/* Parse the environment variables and add them to the volatile environment key */
if (Session->Profile->dwType == WLX_PROFILE_TYPE_V2_0 &&
Session->Profile->pszEnvironment != NULL)
{
wstr = Session->Profile->pszEnvironment;
while (*wstr != UNICODE_NULL)
{
size = wcslen(wstr) + 1;
eqptr = wcschr(wstr, L'=');
if (eqptr != NULL)
{
endptr = eqptr;
endptr--;
while (iswspace(*endptr))
endptr--;
length = (SIZE_T)(endptr - wstr + 1);
wcsncpy(szEnvKey, wstr, length);
szEnvKey[length] = 0;
eqptr++;
while (iswspace(*eqptr))
eqptr++;
wcscpy(szEnvValue, eqptr);
RegSetValueExW(hKey,
szEnvKey,
0,
REG_SZ,
(LPBYTE)szEnvValue,
(wcslen(szEnvValue) + 1) * sizeof(WCHAR));
}
wstr += size;
}
}
/* Load shell32.dll and call SHGetFolderPathW to get the users appdata folder path */
hShell32 = LoadLibraryW(L"shell32.dll");
if (hShell32 != NULL)
{
pfSHGetFolderPathW = (PFSHGETFOLDERPATHW)GetProcAddress(hShell32,
"SHGetFolderPathW");
if (pfSHGetFolderPathW != NULL)
{
if (pfSHGetFolderPathW(NULL,
CSIDL_APPDATA | CSIDL_FLAG_DONT_VERIFY,
Session->UserToken,
0,
szPath) == S_OK)
{
/* FIXME: Expand %USERPROFILE% here. SHGetFolderPathW should do it for us. See Bug #5372.*/
TRACE("APPDATA path: %S\n", szPath);
ExpandEnvironmentStringsForUserW(Session->UserToken,
szPath,
szExpandedPath,
MAX_PATH);
/* Add the appdata folder path to the users volatile environment key */
TRACE("APPDATA expanded path: %S\n", szExpandedPath);
RegSetValueExW(hKey,
L"APPDATA",
0,
REG_SZ,
(LPBYTE)szExpandedPath,
(wcslen(szExpandedPath) + 1) * sizeof(WCHAR));
}
}
FreeLibrary(hShell32);
}
}
BOOL
CreateUserEnvironment(IN PWLSESSION Session)
{
HKEY hKey;
DWORD dwDisp;
LONG lError;
HKEY hKeyCurrentUser;
TRACE("WL: CreateUserEnvironment called\n");
/* Impersonate the new user */
ImpersonateLoggedOnUser(Session->UserToken);
/* Open the new users HKCU key */
lError = RegOpenCurrentUser(KEY_CREATE_SUB_KEY,
&hKeyCurrentUser);
if (lError == ERROR_SUCCESS)
{
/* Create the 'Volatile Environment' key */
lError = RegCreateKeyExW(hKeyCurrentUser,
L"Volatile Environment",
0,
NULL,
REG_OPTION_VOLATILE,
KEY_WRITE,
NULL,
&hKey,
&dwDisp);
if (lError == ERROR_SUCCESS)
{
BuildVolatileEnvironment(Session,
hKey);
RegCloseKey(hKey);
}
else
{
WARN("WL: RegCreateKeyExW() failed (Error: %ld)\n", lError);
}
RegCloseKey(hKeyCurrentUser);
}
/* Revert the impersonation */
RevertToSelf();
TRACE("WL: CreateUserEnvironment done\n");
return TRUE;
}
+7 -50
View File
@@ -170,9 +170,6 @@ HandleLogon(
{
PROFILEINFOW ProfileInfo;
LPVOID lpEnvironment = NULL;
LPWSTR lpFullEnv = NULL;
LPCWSTR wstr;
SIZE_T EnvBlockSize = 0, ProfileSize = 0;
BOOLEAN Old;
BOOL ret = FALSE;
@@ -210,55 +207,17 @@ HandleLogon(
}
/* Create environment block for the user */
if (!CreateEnvironmentBlock(
&lpEnvironment,
Session->UserToken,
TRUE))
if (!CreateUserEnvironment(Session))
{
WARN("WL: CreateEnvironmentBlock() failed\n");
WARN("WL: SetUserEnvironment() failed\n");
goto cleanup;
}
if (Session->Profile->dwType == WLX_PROFILE_TYPE_V2_0 && Session->Profile->pszEnvironment)
/* Create environment block for the user */
if (!CreateEnvironmentBlock(&lpEnvironment, Session->UserToken, TRUE))
{
/* Count required size for full environment */
wstr = (LPCWSTR)lpEnvironment;
while (*wstr != UNICODE_NULL)
{
SIZE_T size = wcslen(wstr) + 1;
wstr += size;
EnvBlockSize += size;
}
wstr = Session->Profile->pszEnvironment;
while (*wstr != UNICODE_NULL)
{
SIZE_T size = wcslen(wstr) + 1;
wstr += size;
ProfileSize += size;
}
/* Allocate enough memory */
lpFullEnv = HeapAlloc(GetProcessHeap, 0, (EnvBlockSize + ProfileSize + 1) * sizeof(WCHAR));
if (!lpFullEnv)
{
TRACE("HeapAlloc() failed\n");
goto cleanup;
}
/* Fill user environment block */
CopyMemory(
lpFullEnv,
lpEnvironment,
EnvBlockSize * sizeof(WCHAR));
CopyMemory(
&lpFullEnv[EnvBlockSize],
Session->Profile->pszEnvironment,
ProfileSize * sizeof(WCHAR));
lpFullEnv[EnvBlockSize + ProfileSize] = UNICODE_NULL;
}
else
{
lpFullEnv = (LPWSTR)lpEnvironment;
WARN("WL: CreateEnvironmentBlock() failed\n");
goto cleanup;
}
DisplayStatusMessage(Session, Session->WinlogonDesktop, IDS_APPLYINGYOURPERSONALSETTINGS);
@@ -280,7 +239,7 @@ HandleLogon(
Session->Gina.Context,
L"Default",
NULL, /* FIXME */
lpFullEnv))
lpEnvironment))
{
//WCHAR StatusMsg[256];
WARN("WL: WlxActivateUserShell() failed\n");
@@ -307,8 +266,6 @@ cleanup:
{
UnloadUserProfile(WLSession->UserToken, ProfileInfo.hProfile);
}
if (lpFullEnv != lpEnvironment)
HeapFree(GetProcessHeap(), 0, lpFullEnv);
if (lpEnvironment)
DestroyEnvironmentBlock(lpEnvironment);
RemoveStatusMessage(Session);
+1 -1
View File
@@ -69,7 +69,7 @@ PlayLogonSoundThread(
if (!hService)
{
CloseServiceHandle(hSCManager);
TRACE("WL: failed to open sysaudio Status %x", GetLastError());
TRACE("WL: failed to open sysaudio Status %x\n", GetLastError());
ExitThread(0);
}
+4
View File
@@ -180,6 +180,10 @@ BOOL WINAPI
UpdatePerUserSystemParameters(DWORD dwUnknown,
DWORD dwReserved);
/* environment.c */
BOOL
CreateUserEnvironment(IN PWLSESSION Session);
/* sas.c */
BOOL
SetDefaultLanguage(
+1
View File
@@ -8,6 +8,7 @@
<library>advapi32</library>
<library>userenv</library>
<library>secur32</library>
<file>environment.c</file>
<file>sas.c</file>
<file>screensaver.c</file>
<file>setup.c</file>
+1 -1
View File
@@ -41,7 +41,7 @@ HKCR,"rtffile\shell\open\command","",0x00020000,"%SystemRoot%\system32\wordpad.e
HKCR,".386","",0x00000000,"vxdfile"
HKCR,".vxd","",0x00000000,"vxdfile"
HKCR,"vxdfile","",0x00000000,"Virtual Device Driver"
HKCR,"vxdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-156"
HKCR,"vxdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-157"
; Animated Cursors
HKCR,".ani","",0x00000000,"anifile"
+1 -1
View File
@@ -41,7 +41,7 @@ HKCR,"rtffile\shell\open\command","",0x00020000,"%SystemRoot%\system32\wordpad.e
HKCR,".386","",0x00000000,"vxdfile"
HKCR,".vxd","",0x00000000,"vxdfile"
HKCR,"vxdfile","",0x00000000,"Virtual Device Driver"
HKCR,"vxdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-156"
HKCR,"vxdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-157"
; Animated Cursors
HKCR,".ani","",0x00000000,"anifile"
+2 -1
View File
@@ -1530,7 +1530,8 @@ HKCU,"Control Panel\Accessibility\Keyboard Preference","On",2,"0"
; Internet Explorer
HKCU,Software\Wine\MSHTML,"GeckoUrl",,"http://source.winehq.org/winegecko.php"
HKCU,Software\Wine\MSHTML,"GeckoCabDir",0x00020000,"%SystemRoot%\"
;HKCU,Software\Wine\MSHTML,"GeckoCabDir",0x00020000,"%SystemRoot%\"
HKCU,Software\Wine\MSHTML,"GeckoCabDir",,"C:\ReactOS\"
; Sound Schemes
HKCU,"AppEvents",,0x00000012
Binary file not shown.
+4
View File
@@ -1126,4 +1126,8 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\Device\shellex\P
; Keyboard layout switcher
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
; SvcHost services
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,"DHCP"
; EOF
+4
View File
@@ -1262,4 +1262,8 @@ HKLM,"SOFTWARE\Microsoft\Ole","EnableRemoteConnect",0x00000000,"N"
; Keyboard layout switcher
;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","kbswitch",0x00000000,"kbswitch.exe"
; SvcHost services
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost", "netsvcs",0x00010000,"DHCP"
; EOF
+9 -4
View File
@@ -973,6 +973,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Description",0x00000000,"P
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Group",0x00000000,"Audio"
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ImagePath",0x00020000,"%SystemRoot%\system32\audiosrv.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\RosAudioSrv","Type",0x00010001,0x00000010
@@ -1036,12 +1037,13 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Disk","Type",0x00010001,0x00000001
; DHCP client service
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","DisplayName",0x00000000,"DHCP Client"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Description",0x00000000,"Attempts to obtain network settings automatically from an available DHCP server"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ErrorControl",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Group",0x00000000,"Network"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ImagePath",0x00020000,"%SystemRoot%\system32\dhcp.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Group",0x00000000,"TDI"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ImagePath",0x00020000,"%SystemRoot%\system32\svchost.exe -k netsvcs"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Start",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Type",0x00010001,0x00000010
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP","Type",0x00010001,0x00000020
HKLM,"SYSTEM\CurrentControlSet\Services\DHCP\Parameters","ServiceDll",0x00020000,"%SystemRoot%\system32\dhcpcsvc.dll"
; Event logging service
HKLM,"SYSTEM\CurrentControlSet\Services\EventLog",,0x00000010
@@ -1219,6 +1221,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","DisplayName",0x00000000,"Simpl
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Group",0x00000000,"Network"
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ImagePath",0x00020000,"%SystemRoot%\system32\tcpsvcs.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\tcpsvcs","Type",0x00010001,0x00000020
@@ -1228,6 +1231,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","DisplayName",0x00000000,"React
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Group",0x00000000,"Network"
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ImagePath",0x00020000,"%SystemRoot%\system32\telnetd.exe"
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\telnetd","Type",0x00010001,0x00000020
@@ -1308,6 +1312,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Description",0x00000000,"Con
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Group",0x00000000,"Windows Installer"
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ImagePath",0x00020000,"system32\msiexec.exe /V"
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","ObjectName",0x00000000,"LocalSystem"
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Start",0x00010001,0x00000003
HKLM,"SYSTEM\CurrentControlSet\Services\MSIserver","Type",0x00010001,0x00000020
+1 -1
View File
@@ -90,7 +90,6 @@ base\applications\wordpad\wordpad.exe 1
base\applications\write\write.exe 1
base\services\audiosrv\audiosrv.exe 1
base\services\dhcp\dhcp.exe 1
base\services\eventlog\eventlog.exe 1
base\services\rpcss\rpcss.exe 1
base\services\spoolsv\spoolsv.exe 1
@@ -634,6 +633,7 @@ media\nls\c_28603.nls 1
media\nls\c_28604.nls 1
media\nls\c_28605.nls 1
media\nls\c_28606.nls 1
media\drivers\etc\hosts 5
media\drivers\etc\services 5
media\inf\audio.inf 6
media\inf\acpi.inf 6
+17 -1
View File
@@ -452,7 +452,23 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
SectorCount = Geometry.Sectors;
}
else
return EINVAL;
{
DPRINTM(DPRINT_HWDETECT, "Using legacy sector size detection\n");
/* Fall back to legacy detection */
if (DrivePartition == 0xff)
{
/* This is a CD-ROM device */
SectorSize = 2048;
}
else
{
/* This is either a floppy disk device (DrivePartition == 0) or
* a hard disk device (DrivePartition != 0 && DrivePartition != 0xFF) but
* it doesn't matter which one because they both have 512 bytes per sector */
SectorSize = 512;
}
}
if (DrivePartition != 0xff && DrivePartition != 0)
{
-1
View File
@@ -45,7 +45,6 @@ PcMachInit(const char *CmdLine)
MachVtbl.PrepareForReactOS = PcPrepareForReactOS;
MachVtbl.GetMemoryMap = PcMemGetMemoryMap;
MachVtbl.DiskGetBootPath = DiskGetBootPath;
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
MachVtbl.DiskReadLogicalSectors = PcDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = PcDiskGetDriveGeometry;
MachVtbl.DiskGetCacheableBlockCount = PcDiskGetCacheableBlockCount;
@@ -48,7 +48,6 @@ XboxMachInit(const char *CmdLine)
MachVtbl.PrepareForReactOS = XboxPrepareForReactOS;
MachVtbl.GetMemoryMap = XboxMemGetMemoryMap;
MachVtbl.DiskGetBootPath = DiskGetBootPath;
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry;
MachVtbl.DiskGetCacheableBlockCount = XboxDiskGetCacheableBlockCount;
@@ -44,12 +44,6 @@ VOID LoadAndBootBootSector(PCSTR OperatingSystemName)
return;
}
if (!MachDiskNormalizeSystemPath(FileName, sizeof(FileName)))
{
UiMessageBox("Invalid path to boot sector file");
return;
}
FilePointer = FsOpenFile(FileName);
if (!FilePointer)
{
+14 -1
View File
@@ -138,7 +138,20 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
if (!DissectArcPath(Path, FileName, &DriveNumber, &DrivePartition))
return EINVAL;
SectorSize = (DrivePartition == 0xff ? 2048 : 512);
if (DrivePartition == 0xff)
{
/* This is a CD-ROM device */
SectorSize = 2048;
}
else
{
/* This is either a floppy disk device (DrivePartition == 0) or
* a hard disk device (DrivePartition != 0 && DrivePartition != 0xFF) but
* it doesn't matter which one because they both have 512 bytes per sector */
SectorSize = 512;
}
if (DrivePartition != 0xff && DrivePartition != 0)
{
if (!XboxDiskGetPartitionEntry(DriveNumber, DrivePartition, &PartitionTableEntry))
-1
View File
@@ -440,7 +440,6 @@ void PpcDefaultMachVtbl()
MachVtbl.GetMemoryMap = PpcGetMemoryMap;
MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
MachVtbl.DiskGetBootPath = PpcDiskGetBootPath;
MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors;
MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry;

Some files were not shown because too many files have changed in this diff Show More