diff --git a/Makefile b/Makefile index 1e7cbd2fcbf..07148d023ad 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/ReactOS-arm.rbuild b/ReactOS-arm.rbuild index 6d7abe77d6e..29bddc97feb 100644 --- a/ReactOS-arm.rbuild +++ b/ReactOS-arm.rbuild @@ -74,6 +74,9 @@ + + + diff --git a/base/applications/cacls/lang/ja-JP.rc b/base/applications/cacls/lang/ja-JP.rc new file mode 100644 index 00000000000..3816fe4d94f --- /dev/null +++ b/base/applications/cacls/lang/ja-JP.rc @@ -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 diff --git a/base/applications/cacls/rsrc.rc b/base/applications/cacls/rsrc.rc index d892f4a1904..cf19989a441 100644 --- a/base/applications/cacls/rsrc.rc +++ b/base/applications/cacls/rsrc.rc @@ -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" diff --git a/base/applications/fontview/display.c b/base/applications/fontview/display.c index 7de217d7cbe..1362e4a822a 100644 --- a/base/applications/fontview/display.c +++ b/base/applications/fontview/display.c @@ -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; } diff --git a/base/applications/mstsc/win32.c b/base/applications/mstsc/win32.c index 56390e09621..c7c4e63361b 100644 --- a/base/applications/mstsc/win32.c +++ b/base/applications/mstsc/win32.c @@ -21,13 +21,6 @@ #include /* winsock2.h first */ #include -//FIXME: remove eventually -#ifndef _UNICODE -#define _UNICODE -#endif -#include - - 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]; diff --git a/base/applications/paint/main.c b/base/applications/paint/main.c index 98565f4b36c..904220567d1 100644 --- a/base/applications/paint/main.c +++ b/base/applications/paint/main.c @@ -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)); diff --git a/base/applications/paint/mouse.c b/base/applications/paint/mouse.c index 4f5c13031fd..9165291594e 100644 --- a/base/applications/paint/mouse.c +++ b/base/applications/paint/mouse.c @@ -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; } diff --git a/base/applications/rapps/lang/it-IT.rc b/base/applications/rapps/lang/it-IT.rc new file mode 100644 index 00000000000..44fcfab4a8a --- /dev/null +++ b/base/applications/rapps/lang/it-IT.rc @@ -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 (dmitry@reactos.org)", 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 diff --git a/base/applications/rapps/rapps/dosbox.txt b/base/applications/rapps/rapps/dosbox.txt index 783779deeed..7a25f08dcb9 100644 --- a/base/applications/rapps/rapps/dosbox.txt +++ b/base/applications/rapps/rapps/dosbox.txt @@ -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] diff --git a/base/applications/rapps/rapps/firefox2.txt b/base/applications/rapps/rapps/firefox2.txt index 0c6379485c7..3cf7dc27921 100644 --- a/base/applications/rapps/rapps/firefox2.txt +++ b/base/applications/rapps/rapps/firefox2.txt @@ -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 diff --git a/base/applications/rapps/rapps/firefox3.txt b/base/applications/rapps/rapps/firefox3.txt index e9313b7677a..284c872da4d 100644 --- a/base/applications/rapps/rapps/firefox3.txt +++ b/base/applications/rapps/rapps/firefox3.txt @@ -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 diff --git a/base/applications/rapps/rapps/irfanview.txt b/base/applications/rapps/rapps/irfanview.txt index 9f1d5743f68..c392d1eea3e 100644 --- a/base/applications/rapps/rapps/irfanview.txt +++ b/base/applications/rapps/rapps/irfanview.txt @@ -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] diff --git a/base/applications/rapps/rapps/irfanviewplugins.txt b/base/applications/rapps/rapps/irfanviewplugins.txt index 9d36ab8faa8..fc7ab238b6e 100644 --- a/base/applications/rapps/rapps/irfanviewplugins.txt +++ b/base/applications/rapps/rapps/irfanviewplugins.txt @@ -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] diff --git a/base/applications/rapps/rapps/mirandaim.txt b/base/applications/rapps/rapps/mirandaim.txt index db0b17f1ab6..aadc724e326 100644 --- a/base/applications/rapps/rapps/mirandaim.txt +++ b/base/applications/rapps/rapps/mirandaim.txt @@ -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] diff --git a/base/applications/rapps/rapps/openttd.txt b/base/applications/rapps/rapps/openttd.txt index 2e70160c846..b1f35d6c9f5 100644 --- a/base/applications/rapps/rapps/openttd.txt +++ b/base/applications/rapps/rapps/openttd.txt @@ -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] diff --git a/base/applications/rapps/rapps/opera.txt b/base/applications/rapps/rapps/opera.txt index 44e49cc61ac..045e7e0f322 100644 --- a/base/applications/rapps/rapps/opera.txt +++ b/base/applications/rapps/rapps/opera.txt @@ -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] diff --git a/base/applications/rapps/rapps/rosbe.txt b/base/applications/rapps/rapps/rosbe.txt index 7d7918b5c78..384df84563a 100644 --- a/base/applications/rapps/rapps/rosbe.txt +++ b/base/applications/rapps/rapps/rosbe.txt @@ -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] diff --git a/base/applications/rapps/rapps/scite.txt b/base/applications/rapps/rapps/scite.txt index 1f8208b2153..c32df9cd195 100644 --- a/base/applications/rapps/rapps/scite.txt +++ b/base/applications/rapps/rapps/scite.txt @@ -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] diff --git a/base/applications/rapps/rapps/scummvm.txt b/base/applications/rapps/rapps/scummvm.txt index ebe7b348a50..d64e53c3653 100644 --- a/base/applications/rapps/rapps/scummvm.txt +++ b/base/applications/rapps/rapps/scummvm.txt @@ -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] diff --git a/base/applications/rapps/rapps/utorrent.txt b/base/applications/rapps/rapps/utorrent.txt index 988263777c5..f987811b5a8 100644 --- a/base/applications/rapps/rapps/utorrent.txt +++ b/base/applications/rapps/rapps/utorrent.txt @@ -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 diff --git a/base/applications/rapps/rsrc.rc b/base/applications/rapps/rsrc.rc index b060279c12b..c09097f28cd 100644 --- a/base/applications/rapps/rsrc.rc +++ b/base/applications/rapps/rsrc.rc @@ -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" diff --git a/base/applications/regedit/find.c b/base/applications/regedit/find.c index d718007adb5..e20d01684f8 100644 --- a/base/applications/regedit/find.c +++ b/base/applications/regedit/find.c @@ -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); + } } } diff --git a/base/applications/regedit/framewnd.c b/base/applications/regedit/framewnd.c index 6a90cc3edd2..a6b4144bcef 100644 --- a/base/applications/regedit/framewnd.c +++ b/base/applications/regedit/framewnd.c @@ -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); diff --git a/base/applications/regedit/lang/bg-BG.rc b/base/applications/regedit/lang/bg-BG.rc index 16c3f5ec0c4..c7bd4215245 100644 --- a/base/applications/regedit/lang/bg-BG.rc +++ b/base/applications/regedit/lang/bg-BG.rc @@ -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 diff --git a/base/applications/regedit/lang/cs-CZ.rc b/base/applications/regedit/lang/cs-CZ.rc index 8376b262eaa..8f36dadaf0d 100644 --- a/base/applications/regedit/lang/cs-CZ.rc +++ b/base/applications/regedit/lang/cs-CZ.rc @@ -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 diff --git a/base/applications/regedit/lang/de-DE.rc b/base/applications/regedit/lang/de-DE.rc index 2b0a22cd2af..3b2b646f738 100644 --- a/base/applications/regedit/lang/de-DE.rc +++ b/base/applications/regedit/lang/de-DE.rc @@ -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 diff --git a/base/applications/regedit/lang/el-GR.rc b/base/applications/regedit/lang/el-GR.rc index bb8f6bb3aa5..34e4202d15d 100644 --- a/base/applications/regedit/lang/el-GR.rc +++ b/base/applications/regedit/lang/el-GR.rc @@ -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 diff --git a/base/applications/regedit/lang/en-US.rc b/base/applications/regedit/lang/en-US.rc index 5bc1ca6c4a6..b7e948f8a9a 100644 --- a/base/applications/regedit/lang/en-US.rc +++ b/base/applications/regedit/lang/en-US.rc @@ -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 diff --git a/base/applications/regedit/lang/es-ES.rc b/base/applications/regedit/lang/es-ES.rc index 48db017a168..b7e703048da 100644 --- a/base/applications/regedit/lang/es-ES.rc +++ b/base/applications/regedit/lang/es-ES.rc @@ -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 diff --git a/base/applications/regedit/lang/fr-FR.rc b/base/applications/regedit/lang/fr-FR.rc index 3ee1d3bad64..ed997425aff 100644 --- a/base/applications/regedit/lang/fr-FR.rc +++ b/base/applications/regedit/lang/fr-FR.rc @@ -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 diff --git a/base/applications/regedit/lang/hu-HU.rc b/base/applications/regedit/lang/hu-HU.rc index a59356e2f4d..3c7277b79ab 100644 --- a/base/applications/regedit/lang/hu-HU.rc +++ b/base/applications/regedit/lang/hu-HU.rc @@ -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 diff --git a/base/applications/regedit/lang/id-ID.rc b/base/applications/regedit/lang/id-ID.rc index 4f602ff4d77..c6b9bb1cb49 100644 --- a/base/applications/regedit/lang/id-ID.rc +++ b/base/applications/regedit/lang/id-ID.rc @@ -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 diff --git a/base/applications/regedit/lang/it-IT.rc b/base/applications/regedit/lang/it-IT.rc index c5f274986a9..47960b8da5b 100644 --- a/base/applications/regedit/lang/it-IT.rc +++ b/base/applications/regedit/lang/it-IT.rc @@ -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 diff --git a/base/applications/regedit/lang/ja-JP.rc b/base/applications/regedit/lang/ja-JP.rc index 25c8a04ae39..3108fb8aa34 100644 --- a/base/applications/regedit/lang/ja-JP.rc +++ b/base/applications/regedit/lang/ja-JP.rc @@ -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 diff --git a/base/applications/regedit/lang/ko-KR.rc b/base/applications/regedit/lang/ko-KR.rc index b4bd99c2fe6..5aef6a1b358 100644 --- a/base/applications/regedit/lang/ko-KR.rc +++ b/base/applications/regedit/lang/ko-KR.rc @@ -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 diff --git a/base/applications/regedit/lang/nl-NL.rc b/base/applications/regedit/lang/nl-NL.rc index 0596b96fd36..158a4ec4d24 100644 --- a/base/applications/regedit/lang/nl-NL.rc +++ b/base/applications/regedit/lang/nl-NL.rc @@ -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 diff --git a/base/applications/regedit/lang/no-NO.rc b/base/applications/regedit/lang/no-NO.rc index 4d5073eb232..ac3e7faa330 100644 --- a/base/applications/regedit/lang/no-NO.rc +++ b/base/applications/regedit/lang/no-NO.rc @@ -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 "Sker i registret...",IDC_STATIC,33,12,83,8 END diff --git a/base/applications/regedit/lang/pl-PL.rc b/base/applications/regedit/lang/pl-PL.rc index bfa9294fecc..ebf6da04151 100644 --- a/base/applications/regedit/lang/pl-PL.rc +++ b/base/applications/regedit/lang/pl-PL.rc @@ -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 diff --git a/base/applications/regedit/lang/pt-BR.rc b/base/applications/regedit/lang/pt-BR.rc index 4d26aae272e..9c1f7245ec4 100644 --- a/base/applications/regedit/lang/pt-BR.rc +++ b/base/applications/regedit/lang/pt-BR.rc @@ -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 diff --git a/base/applications/regedit/lang/pt-PT.rc b/base/applications/regedit/lang/pt-PT.rc index 5f2806df457..081ba3b0800 100644 --- a/base/applications/regedit/lang/pt-PT.rc +++ b/base/applications/regedit/lang/pt-PT.rc @@ -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 diff --git a/base/applications/regedit/lang/ru-RU.rc b/base/applications/regedit/lang/ru-RU.rc index e14ec89cee4..3d38ed24f01 100644 --- a/base/applications/regedit/lang/ru-RU.rc +++ b/base/applications/regedit/lang/ru-RU.rc @@ -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 diff --git a/base/applications/regedit/lang/sk-SK.rc b/base/applications/regedit/lang/sk-SK.rc index b1a8cf6686d..1ef4df97081 100644 --- a/base/applications/regedit/lang/sk-SK.rc +++ b/base/applications/regedit/lang/sk-SK.rc @@ -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喨",IDCANCEL,93,29,45,14 + DEFPUSHBUTTON "&Zru喨",IDCANCEL,93,29,45,14 LTEXT "Searching the registry...",IDC_STATIC,33,12,83,8 END diff --git a/base/applications/regedit/lang/sl-SI.rc b/base/applications/regedit/lang/sl-SI.rc index 356d08426d6..5c529ffe6fb 100644 --- a/base/applications/regedit/lang/sl-SI.rc +++ b/base/applications/regedit/lang/sl-SI.rc @@ -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 diff --git a/base/applications/regedit/lang/sv-SE.rc b/base/applications/regedit/lang/sv-SE.rc index 09c06639d31..efce60a4190 100644 --- a/base/applications/regedit/lang/sv-SE.rc +++ b/base/applications/regedit/lang/sv-SE.rc @@ -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 diff --git a/base/applications/regedit/lang/th-TH.rc b/base/applications/regedit/lang/th-TH.rc index 72220f9a150..d69da60f90e 100644 --- a/base/applications/regedit/lang/th-TH.rc +++ b/base/applications/regedit/lang/th-TH.rc @@ -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 diff --git a/base/applications/regedit/lang/uk-UA.rc b/base/applications/regedit/lang/uk-UA.rc index ff7d13965e4..e7d53f0f883 100644 --- a/base/applications/regedit/lang/uk-UA.rc +++ b/base/applications/regedit/lang/uk-UA.rc @@ -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 diff --git a/base/applications/regedit/lang/zh-CN.rc b/base/applications/regedit/lang/zh-CN.rc index 875aff13ed8..87a1e6fd5e4 100644 --- a/base/applications/regedit/lang/zh-CN.rc +++ b/base/applications/regedit/lang/zh-CN.rc @@ -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 diff --git a/base/applications/regedit/listview.c b/base/applications/regedit/listview.c index 64a6e123ef4..6e95a863ff9 100644 --- a/base/applications/regedit/listview.c +++ b/base/applications/regedit/listview.c @@ -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); diff --git a/base/applications/regedit/regproc.c b/base/applications/regedit/regproc.c index c67e05df7a6..2ba45c29faf 100644 --- a/base/applications/regedit/regproc.c +++ b/base/applications/regedit/regproc.c @@ -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 */ diff --git a/base/applications/regedit/regproc.h b/base/applications/regedit/regproc.h index 15bb2484728..aae3a4a969b 100644 --- a/base/applications/regedit/regproc.h +++ b/base/applications/regedit/regproc.h @@ -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 */ diff --git a/base/applications/wordpad/wordpad.rbuild b/base/applications/wordpad/wordpad.rbuild index 6a419cdc4ad..9c21eac69b9 100644 --- a/base/applications/wordpad/wordpad.rbuild +++ b/base/applications/wordpad/wordpad.rbuild @@ -2,7 +2,8 @@ . - + include/reactos/wine + comdlg32 shell32 user32 diff --git a/base/services/dhcp/design.txt b/base/services/dhcp/design.txt deleted file mode 100644 index 17c9a29194b..00000000000 --- a/base/services/dhcp/design.txt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/base/services/dhcp/dhcp.rbuild b/base/services/dhcp/dhcp.rbuild deleted file mode 100644 index ffa05b78465..00000000000 --- a/base/services/dhcp/dhcp.rbuild +++ /dev/null @@ -1,30 +0,0 @@ - - - - . - include - - ntdll - ws2_32 - iphlpapi - advapi32 - oldnames - adapter.c - alloc.c - api.c - compat.c - dhclient.c - dispatch.c - hash.c - options.c - pipe.c - privsep.c - socket.c - tables.c - timer.c - util.c - dhcp.rc - - rosdhcp.h - - diff --git a/base/services/dhcp/dhcp.rc b/base/services/dhcp/dhcp.rc deleted file mode 100644 index 35e404f893e..00000000000 --- a/base/services/dhcp/dhcp.rc +++ /dev/null @@ -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 diff --git a/base/services/dhcp/dhcpmain.c b/base/services/dhcp/dhcpmain.c deleted file mode 100644 index c1a1b30328e..00000000000 --- a/base/services/dhcp/dhcpmain.c +++ /dev/null @@ -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 (arty@users.sf.net) - * UPDATE HISTORY: - * Created 03/08/2005 - */ - -#include -#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 ) { -} diff --git a/base/services/dhcp/include/cdefs.h b/base/services/dhcp/include/cdefs.h deleted file mode 100644 index 2bc67a5251a..00000000000 --- a/base/services/dhcp/include/cdefs.h +++ /dev/null @@ -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__ */ diff --git a/base/services/dhcp/include/dhctoken.h b/base/services/dhcp/include/dhctoken.h deleted file mode 100644 index 2aeb5303af1..00000000000 --- a/base/services/dhcp/include/dhctoken.h +++ /dev/null @@ -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 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) diff --git a/base/services/dhcp/include/inet.h b/base/services/dhcp/include/inet.h deleted file mode 100644 index a45f92265de..00000000000 --- a/base/services/dhcp/include/inet.h +++ /dev/null @@ -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 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; diff --git a/base/services/dhcp/include/osdep.h b/base/services/dhcp/include/osdep.h deleted file mode 100644 index 71a985980e1..00000000000 --- a/base/services/dhcp/include/osdep.h +++ /dev/null @@ -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 diff --git a/base/services/dhcp/include/predec.h b/base/services/dhcp/include/predec.h deleted file mode 100644 index 59fb94b003c..00000000000 --- a/base/services/dhcp/include/predec.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -struct iaddr; -struct interface_info; diff --git a/base/services/dhcp/include/privsep.h b/base/services/dhcp/include/privsep.h deleted file mode 100644 index e1fc52d5b69..00000000000 --- a/base/services/dhcp/include/privsep.h +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: privsep.h,v 1.2 2004/05/04 18:51:18 henning Exp $ */ - -/* - * Copyright (c) 2004 Henning Brauer - * - * 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 - -//#include -//#include - -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); diff --git a/base/services/dhcp/include/site.h b/base/services/dhcp/include/site.h deleted file mode 100644 index 30fdb703005..00000000000 --- a/base/services/dhcp/include/site.h +++ /dev/null @@ -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 */ -/* #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 */ diff --git a/base/services/dhcp/include/stdint.h b/base/services/dhcp/include/stdint.h deleted file mode 100644 index a45def0e663..00000000000 --- a/base/services/dhcp/include/stdint.h +++ /dev/null @@ -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; diff --git a/base/services/dhcp/include/sysconf.h b/base/services/dhcp/include/sysconf.h deleted file mode 100644 index 5feb4c75c70..00000000000 --- a/base/services/dhcp/include/sysconf.h +++ /dev/null @@ -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 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 - diff --git a/base/services/dhcp/include/version.h b/base/services/dhcp/include/version.h deleted file mode 100644 index 303fbfa332b..00000000000 --- a/base/services/dhcp/include/version.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Current version of ISC DHCP Distribution. */ - -#define DHCP_VERSION "2.0pl5" diff --git a/base/services/dhcp/memory.c b/base/services/dhcp/memory.c deleted file mode 100644 index 2752422d2c7..00000000000 --- a/base/services/dhcp/memory.c +++ /dev/null @@ -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 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, <, 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, <, 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); - } - } -} diff --git a/base/services/dhcp/privsep.c b/base/services/dhcp/privsep.c deleted file mode 100644 index 7a13bfed21b..00000000000 --- a/base/services/dhcp/privsep.c +++ /dev/null @@ -1,225 +0,0 @@ -/* $OpenBSD: privsep.c,v 1.7 2004/05/10 18:34:42 deraadt Exp $ */ - -/* - * Copyright (c) 2004 Henning Brauer - * - * 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); - } -} diff --git a/base/services/dhcp/timer.c b/base/services/dhcp/timer.c deleted file mode 100644 index ccd817188ec..00000000000 --- a/base/services/dhcp/timer.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "rosdhcp.h" - diff --git a/base/services/services.rbuild b/base/services/services.rbuild index 993f7d01ad9..5125d9b2f79 100644 --- a/base/services/services.rbuild +++ b/base/services/services.rbuild @@ -4,9 +4,6 @@ - - - diff --git a/base/setup/setup/setup.c b/base/setup/setup/setup.c index 8f9db9b6278..4db7fc46a92 100644 --- a/base/setup/setup/setup.c +++ b/base/setup/setup/setup.c @@ -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) { diff --git a/base/setup/usetup/inffile.c b/base/setup/usetup/inffile.c index 51fe2e7489d..0bbde01d9da 100644 --- a/base/setup/usetup/inffile.c +++ b/base/setup/usetup/inffile.c @@ -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)) diff --git a/base/setup/usetup/inffile.h b/base/setup/usetup/inffile.h index 52b002db3a9..864d2017020 100644 --- a/base/setup/usetup/inffile.h +++ b/base/setup/usetup/inffile.h @@ -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( diff --git a/base/setup/usetup/interface/usetup.c b/base/setup/usetup/interface/usetup.c index 87df41628f9..7a97b492c27 100644 --- a/base/setup/usetup/interface/usetup.c +++ b/base/setup/usetup/interface/usetup.c @@ -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); diff --git a/base/setup/usetup/lang/it-IT.h b/base/setup/usetup/lang/it-IT.h index 21d3d8990bf..bb220000c84 100644 --- a/base/setup/usetup/lang/it-IT.h +++ b/base/setup/usetup/lang/it-IT.h @@ -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 }, { diff --git a/base/setup/usetup/registry.c b/base/setup/usetup/registry.c index d313b4d28bd..a8081292e67 100644 --- a/base/setup/usetup/registry.c +++ b/base/setup/usetup/registry.c @@ -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) { diff --git a/base/setup/usetup/registry.h b/base/setup/usetup/registry.h index d76470402d7..63d2b67ef8b 100644 --- a/base/setup/usetup/registry.h +++ b/base/setup/usetup/registry.h @@ -29,6 +29,7 @@ BOOLEAN ImportRegistryFile(PWSTR Filename, PWSTR Section, + LCID LocaleId, BOOLEAN Delete); BOOLEAN diff --git a/base/setup/usetup/usetup.rbuild b/base/setup/usetup/usetup.rbuild index fa96c8cd59e..51f3c0386a0 100644 --- a/base/setup/usetup/usetup.rbuild +++ b/base/setup/usetup/usetup.rbuild @@ -4,10 +4,10 @@ . . - . + . include/reactos/drivers zlib - inflib + newinflib ext2lib vfatlib ntdll diff --git a/base/shell/explorer/res/startmenu.ico b/base/shell/explorer/res/startmenu.ico index 492e388a939..b0c5059f3d8 100644 Binary files a/base/shell/explorer/res/startmenu.ico and b/base/shell/explorer/res/startmenu.ico differ diff --git a/base/shell/explorer/taskbar/traynotify.cpp b/base/shell/explorer/taskbar/traynotify.cpp index 5bb76af043e..ea0e85a4204 100644 --- a/base/shell/explorer/taskbar/traynotify.cpp +++ b/base/shell/explorer/taskbar/traynotify.cpp @@ -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; diff --git a/base/system/userinit/userinit.c b/base/system/userinit/userinit.c index 9eb96029318..81027d4b964 100644 --- a/base/system/userinit/userinit.c +++ b/base/system/userinit/userinit.c @@ -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); diff --git a/base/system/winlogon/environment.c b/base/system/winlogon/environment.c new file mode 100644 index 00000000000..7a22e494d27 --- /dev/null +++ b/base/system/winlogon/environment.c @@ -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 + +#include + +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; +} diff --git a/base/system/winlogon/sas.c b/base/system/winlogon/sas.c index f560187d702..d4dbad881f6 100644 --- a/base/system/winlogon/sas.c +++ b/base/system/winlogon/sas.c @@ -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); diff --git a/base/system/winlogon/winlogon.c b/base/system/winlogon/winlogon.c index 79535666a82..f711cf38085 100644 --- a/base/system/winlogon/winlogon.c +++ b/base/system/winlogon/winlogon.c @@ -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); } diff --git a/base/system/winlogon/winlogon.h b/base/system/winlogon/winlogon.h index 2df4e3aec03..45e73254428 100644 --- a/base/system/winlogon/winlogon.h +++ b/base/system/winlogon/winlogon.h @@ -180,6 +180,10 @@ BOOL WINAPI UpdatePerUserSystemParameters(DWORD dwUnknown, DWORD dwReserved); +/* environment.c */ +BOOL +CreateUserEnvironment(IN PWLSESSION Session); + /* sas.c */ BOOL SetDefaultLanguage( diff --git a/base/system/winlogon/winlogon.rbuild b/base/system/winlogon/winlogon.rbuild index 6a75ed19015..cc5b2a33ddc 100644 --- a/base/system/winlogon/winlogon.rbuild +++ b/base/system/winlogon/winlogon.rbuild @@ -8,6 +8,7 @@ advapi32 userenv secur32 + environment.c sas.c screensaver.c setup.c diff --git a/boot/bootdata/hivecls_arm.inf b/boot/bootdata/hivecls_arm.inf index a39f33f76f5..4651412d315 100644 --- a/boot/bootdata/hivecls_arm.inf +++ b/boot/bootdata/hivecls_arm.inf @@ -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" diff --git a/boot/bootdata/hivecls_i386.inf b/boot/bootdata/hivecls_i386.inf index 350fe18e010..147f80d81de 100644 --- a/boot/bootdata/hivecls_i386.inf +++ b/boot/bootdata/hivecls_i386.inf @@ -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" diff --git a/boot/bootdata/hivedef_arm.inf b/boot/bootdata/hivedef_arm.inf index 8d8c48935d1..086ee67f4fa 100644 --- a/boot/bootdata/hivedef_arm.inf +++ b/boot/bootdata/hivedef_arm.inf @@ -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 diff --git a/boot/bootdata/hivedef_i386.inf b/boot/bootdata/hivedef_i386.inf index 9650563ee47..905f5ef3daf 100644 Binary files a/boot/bootdata/hivedef_i386.inf and b/boot/bootdata/hivedef_i386.inf differ diff --git a/boot/bootdata/hivesft_arm.inf b/boot/bootdata/hivesft_arm.inf index a3a273ff646..6a63e499ae1 100644 --- a/boot/bootdata/hivesft_arm.inf +++ b/boot/bootdata/hivesft_arm.inf @@ -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 diff --git a/boot/bootdata/hivesft_i386.inf b/boot/bootdata/hivesft_i386.inf index 006796e8779..5acea1c1687 100644 --- a/boot/bootdata/hivesft_i386.inf +++ b/boot/bootdata/hivesft_i386.inf @@ -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 diff --git a/boot/bootdata/hivesys_i386.inf b/boot/bootdata/hivesys_i386.inf index b19128dc360..3ca06176457 100644 --- a/boot/bootdata/hivesys_i386.inf +++ b/boot/bootdata/hivesys_i386.inf @@ -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 diff --git a/boot/bootdata/packages/reactos.dff b/boot/bootdata/packages/reactos.dff index a4d4de2a79b..c76e469d7f2 100644 --- a/boot/bootdata/packages/reactos.dff +++ b/boot/bootdata/packages/reactos.dff @@ -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 diff --git a/boot/freeldr/freeldr/arch/i386/hardware.c b/boot/freeldr/freeldr/arch/i386/hardware.c index 1dff167c987..97577aa020c 100644 --- a/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/boot/freeldr/freeldr/arch/i386/hardware.c @@ -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) { diff --git a/boot/freeldr/freeldr/arch/i386/machpc.c b/boot/freeldr/freeldr/arch/i386/machpc.c index 74f3e22ee4c..1b985f28c4d 100644 --- a/boot/freeldr/freeldr/arch/i386/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/machpc.c @@ -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; diff --git a/boot/freeldr/freeldr/arch/i386/machxbox.c b/boot/freeldr/freeldr/arch/i386/machxbox.c index 442c7be2f1d..704a7ae91cc 100644 --- a/boot/freeldr/freeldr/arch/i386/machxbox.c +++ b/boot/freeldr/freeldr/arch/i386/machxbox.c @@ -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; diff --git a/boot/freeldr/freeldr/arch/i386/miscboot.c b/boot/freeldr/freeldr/arch/i386/miscboot.c index e0aa98cfd50..1f30141ce7f 100644 --- a/boot/freeldr/freeldr/arch/i386/miscboot.c +++ b/boot/freeldr/freeldr/arch/i386/miscboot.c @@ -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) { diff --git a/boot/freeldr/freeldr/arch/i386/xboxhw.c b/boot/freeldr/freeldr/arch/i386/xboxhw.c index 5c7680b17ae..ff325b3dd49 100644 --- a/boot/freeldr/freeldr/arch/i386/xboxhw.c +++ b/boot/freeldr/freeldr/arch/i386/xboxhw.c @@ -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)) diff --git a/boot/freeldr/freeldr/arch/powerpc/mach.c b/boot/freeldr/freeldr/arch/powerpc/mach.c index 57cacd27675..9abd56bca53 100644 --- a/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -440,7 +440,6 @@ void PpcDefaultMachVtbl() MachVtbl.GetMemoryMap = PpcGetMemoryMap; - MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath; MachVtbl.DiskGetBootPath = PpcDiskGetBootPath; MachVtbl.DiskReadLogicalSectors = PpcDiskReadLogicalSectors; MachVtbl.DiskGetDriveGeometry = PpcDiskGetDriveGeometry; diff --git a/boot/freeldr/freeldr/disk/disk.c b/boot/freeldr/freeldr/disk/disk.c index 16ee1be7ad9..b7ce3295497 100644 --- a/boot/freeldr/freeldr/disk/disk.c +++ b/boot/freeldr/freeldr/disk/disk.c @@ -107,62 +107,80 @@ DiskGetBootPath(char *BootPath, unsigned Size) { static char Path[] = "multi(0)disk(0)"; char Device[4]; - - _itoa(BootDrive, Device, 10); - if (Size <= sizeof(Path) + 6 + strlen(Device)) + char Partition[4]; + PARTITION_TABLE_ENTRY PartitionEntry; + MASTER_BOOT_RECORD MasterBootRecord; + + if (BootDrive < 0x80) { - return FALSE; + /* This is a floppy */ + + if (Size <= sizeof(Path) + 7 + strlen(Device)) + { + return FALSE; + } + + strcpy(BootPath, Path); + + strcat(BootPath, "fdisk"); + + _itoa(BootDrive, Device, 10); + strcat(BootPath, "("); + strcat(BootPath, Device); + strcat(BootPath, ")"); } - strcpy(BootPath, Path); - strcat(BootPath, BootDrive < 0x80 ? "fdisk" : "cdrom"); - strcat(strcat(strcat(BootPath, "("), Device), ")"); - - if (strcmp(BootPath, "multi(0)disk(0)cdrom(128)") == 0) - strcpy(BootPath, "multi(0)disk(0)rdisk(0)partition(1)"); + /* FIXME */ + else if (DiskReadBootRecord(BootDrive, 0, &MasterBootRecord)) + { + /* This is a hard disk */ + + if (!DiskGetActivePartitionEntry(BootDrive, &PartitionEntry, &BootPartition)) + { + DbgPrint("Invalid active partition information\n"); + return FALSE; + } + + if (Size <= sizeof(Path) + 18 + strlen(Device) + strlen(Partition)) + { + return FALSE; + } + + strcpy(BootPath, Path); + + strcat(BootPath, "rdisk"); + + _itoa(BootDrive - 0x80, Device, 10); + strcat(BootPath, "("); + strcat(BootPath, Device); + strcat(BootPath, ")"); + + _itoa(BootPartition, Partition, 10); + strcat(BootPath, "partition("); + strcat(BootPath, Partition); + strcat(BootPath, ")"); + } + else + { + /* This is a CD-ROM drive */ + + if (Size <= sizeof(Path) + 7 + strlen(Device)) + { + return FALSE; + } + + strcpy(BootPath, Path); + + strcat(BootPath, "cdrom"); + + _itoa(BootDrive - 0x80, Device, 10); + strcat(BootPath, "("); + strcat(BootPath, Device); + strcat(BootPath, ")"); + } + return TRUE; } -BOOLEAN -DiskNormalizeSystemPath(char *SystemPath, unsigned Size) -{ - CHAR BootPath[256]; - ULONG PartitionNumber; - ULONG DriveNumber; - PARTITION_TABLE_ENTRY PartEntry; - char *p; - - if (!DissectArcPath(SystemPath, BootPath, &DriveNumber, &PartitionNumber)) - { - return FALSE; - } - - if (0 != PartitionNumber) - { - return TRUE; - } - - if (! DiskGetActivePartitionEntry(DriveNumber, - &PartEntry, - &PartitionNumber) || - PartitionNumber < 1 || 9 < PartitionNumber) - { - return FALSE; - } - - p = SystemPath; - while ('\0' != *p && 0 != _strnicmp(p, "partition(", 10)) { - p++; - } - p = strchr(p, ')'); - if (NULL == p || '0' != *(p - 1)) { - return FALSE; - } - *(p - 1) = '0' + PartitionNumber; - - return TRUE; -} - - // This function is in arch/i386/i386disk.c //VOID DiskStopFloppyMotor(VOID) diff --git a/boot/freeldr/freeldr/disk/partition.c b/boot/freeldr/freeldr/disk/partition.c index 8966e67187a..b93b2e17b2a 100644 --- a/boot/freeldr/freeldr/disk/partition.c +++ b/boot/freeldr/freeldr/disk/partition.c @@ -197,7 +197,6 @@ BOOLEAN DiskGetFirstExtendedPartitionEntry(PMASTER_BOOT_RECORD MasterBootRecord, BOOLEAN DiskReadBootRecord(ULONG DriveNumber, ULONGLONG LogicalSectorNumber, PMASTER_BOOT_RECORD BootRecord) { - char ErrMsg[64]; ULONG Index; // Read master boot record @@ -231,9 +230,6 @@ BOOLEAN DiskReadBootRecord(ULONG DriveNumber, ULONGLONG LogicalSectorNumber, PMA // Check the partition table magic value if (BootRecord->MasterBootRecordMagic != 0xaa55) { - sprintf(ErrMsg, "Invalid partition table magic 0x%x found on drive 0x%lx", - BootRecord->MasterBootRecordMagic, DriveNumber); - DiskError(ErrMsg, 0); return FALSE; } diff --git a/boot/freeldr/freeldr/fs/iso.c b/boot/freeldr/freeldr/fs/iso.c index dd1231558d7..f0a9832935e 100644 --- a/boot/freeldr/freeldr/fs/iso.c +++ b/boot/freeldr/freeldr/fs/iso.c @@ -161,6 +161,7 @@ static LONG IsoLookupFile(PCSTR FileName, ULONG DeviceId, PISO_FILE_INFO IsoFile DPRINTM(DPRINT_FILESYSTEM, "IsoLookupFile() FileName = %s\n", FileName); RtlZeroMemory(IsoFileInfoPointer, sizeof(ISO_FILE_INFO)); + RtlZeroMemory(&IsoFileInfo, sizeof(ISO_FILE_INFO)); // // Read The Primary Volume Descriptor diff --git a/boot/freeldr/freeldr/include/disk.h b/boot/freeldr/freeldr/include/disk.h index daaaa495e55..191ee1215d6 100644 --- a/boot/freeldr/freeldr/include/disk.h +++ b/boot/freeldr/freeldr/include/disk.h @@ -127,7 +127,6 @@ extern ULONG BootDrive; extern ULONG BootPartition; BOOLEAN DiskGetBootPath(char *BootPath, unsigned Size); -BOOLEAN DiskNormalizeSystemPath(char *SystemPath, unsigned Size); /////////////////////////////////////////////////////////////////////////////////////// diff --git a/boot/freeldr/freeldr/include/machine.h b/boot/freeldr/freeldr/include/machine.h index 0c0076f4760..65952056faa 100644 --- a/boot/freeldr/freeldr/include/machine.h +++ b/boot/freeldr/freeldr/include/machine.h @@ -62,7 +62,6 @@ typedef struct tagMACHVTBL ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize); BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size); - BOOLEAN (*DiskNormalizeSystemPath)(char *SystemPath, unsigned Size); BOOLEAN (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer); BOOLEAN (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry); ULONG (*DiskGetCacheableBlockCount)(ULONG DriveNumber); diff --git a/boot/freeldr/freeldr/linuxboot.c b/boot/freeldr/freeldr/linuxboot.c index 10c2017eb0c..5aea40c2427 100644 --- a/boot/freeldr/freeldr/linuxboot.c +++ b/boot/freeldr/freeldr/linuxboot.c @@ -97,13 +97,6 @@ VOID LoadAndBootLinux(PCSTR OperatingSystemName, PCSTR Description) goto LinuxBootFailed; } - // Open the boot volume - if (!MachDiskNormalizeSystemPath(LinuxBootPath, sizeof(LinuxBootPath))) - { - UiMessageBox("Invalid boot path"); - goto LinuxBootFailed; - } - // Open the kernel LinuxKernel = FsOpenFile(LinuxKernelName); if (!LinuxKernel) diff --git a/boot/freeldr/freeldr/machine.c b/boot/freeldr/freeldr/machine.c index 9021a7c57a7..c898bf49430 100644 --- a/boot/freeldr/freeldr/machine.c +++ b/boot/freeldr/freeldr/machine.c @@ -37,7 +37,6 @@ #undef MachBeep #undef MachPrepareForReactOS #undef MachDiskGetBootPath -#undef MachDiskNormalizeSystemPath #undef MachDiskReadLogicalSectors #undef MachDiskGetDriveGeometry #undef MachDiskGetCacheableBlockCount @@ -152,12 +151,6 @@ MachDiskGetBootPath(char *BootPath, unsigned Size) return MachVtbl.DiskGetBootPath(BootPath, Size); } -BOOLEAN -MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size) -{ - return MachVtbl.DiskNormalizeSystemPath(SystemPath, Size); -} - BOOLEAN MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer) { diff --git a/boot/freeldr/freeldr/reactos/arcname.c b/boot/freeldr/freeldr/reactos/arcname.c index 3ca69fadb51..4b7f97addb6 100644 --- a/boot/freeldr/freeldr/reactos/arcname.c +++ b/boot/freeldr/freeldr/reactos/arcname.c @@ -60,7 +60,7 @@ BOOLEAN DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* B if (p == NULL) return FALSE; p++; - *BootPartition = 0xff; + *BootPartition = 0; } else if (_strnicmp(p, "cdrom(", 6) == 0) { @@ -69,7 +69,7 @@ BOOLEAN DissectArcPath(CHAR *ArcPath, CHAR *BootPath, ULONG* BootDrive, ULONG* B * multi(0)disk(0)cdrom(x)\path */ p = p + 6; - *BootDrive = atoi(p); + *BootDrive = atoi(p) + 0x80; p = strchr(p, ')'); if (p == NULL) return FALSE; diff --git a/boot/freeldr/freeldr/reactos/reactos.c b/boot/freeldr/freeldr/reactos/reactos.c index 12c8c6647e4..81b654b84b9 100644 --- a/boot/freeldr/freeldr/reactos/reactos.c +++ b/boot/freeldr/freeldr/reactos/reactos.c @@ -718,12 +718,6 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) } else { - if (! MachDiskNormalizeSystemPath(SystemPath, - sizeof(SystemPath))) - { - UiMessageBox("Invalid system path"); - return; - } /* copy system path into kernel command line */ strcpy(reactos_kernel_cmdline, SystemPath); } diff --git a/boot/freeldr/freeldr/setupldr.rbuild b/boot/freeldr/freeldr/setupldr.rbuild index 8143b5919c4..bf41b103c48 100644 --- a/boot/freeldr/freeldr/setupldr.rbuild +++ b/boot/freeldr/freeldr/setupldr.rbuild @@ -5,15 +5,15 @@ freeldr_startup freeldr_base64k freeldr_base + + mini_hal + freeldr_arch setupldr_main rossym cmlib rtl libcntpr - - mini_hal - -nostartfiles -nostdlib diff --git a/dll/cpl/appwiz/lang/cs-CZ.rc b/dll/cpl/appwiz/lang/cs-CZ.rc index 5f59fbf8e70..8bfb70e574d 100644 --- a/dll/cpl/appwiz/lang/cs-CZ.rc +++ b/dll/cpl/appwiz/lang/cs-CZ.rc @@ -1,6 +1,6 @@ /* FILE: dll/cpl/appwiz/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) - * UPDATED: 2008-07-27 + * UPDATED: 2010-03-14 */ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT @@ -48,7 +48,7 @@ END STRINGTABLE BEGIN - IDS_CPLSYSTEMNAME "Pidat/Odebrat programy" + IDS_CPLSYSTEMNAME "Pidat a odebrat programy" IDS_CPLSYSTEMDESCRIPTION "Nastavuje programy a vytv碾 z疽tupce." IDS_CREATE_SHORTCUT "Vytvoit z疽tupce" IDS_ERROR_NOT_FOUND "Soubor %s nebyl nalezen." diff --git a/dll/cpl/console/colors.c b/dll/cpl/console/colors.c index f7dde527868..d312fadda0b 100644 --- a/dll/cpl/console/colors.c +++ b/dll/cpl/console/colors.c @@ -231,6 +231,7 @@ ColorsProc( InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); pConInfo->ActiveStaticControl = index; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } } diff --git a/dll/cpl/console/layout.c b/dll/cpl/console/layout.c index 592ba610168..cca60ca92eb 100644 --- a/dll/cpl/console/layout.c +++ b/dll/cpl/console/layout.c @@ -294,6 +294,52 @@ LayoutProc( { switch(LOWORD(wParam)) { + case IDC_EDIT_SCREEN_BUFFER_WIDTH: + case IDC_EDIT_SCREEN_BUFFER_HEIGHT: + case IDC_EDIT_WINDOW_SIZE_WIDTH: + case IDC_UPDOWN_WINDOW_SIZE_HEIGHT: + case IDC_EDIT_WINDOW_POS_LEFT: + case IDC_EDIT_WINDOW_POS_TOP: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD wheight, wwidth; + DWORD sheight, swidth; + DWORD left, top; + + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, NULL, FALSE); + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE); + + swidth = max(swidth, 1); + sheight = max(sheight, 1); + + /* automatically adjust window size when screen buffer decreases */ + if (wwidth > swidth) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE); + wwidth = swidth; + } + + if (wheight > sheight) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE); + wheight = sheight; + } + + + pConInfo->ScreenBuffer = MAKELONG(swidth, sheight); + pConInfo->WindowSize = MAKELONG(wwidth, wheight); + pConInfo->WindowPosition = MAKELONG(left, top); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + case IDC_CHECK_SYSTEM_POS_WINDOW: { LONG res = SendMessage((HWND)lParam, BM_GETCHECK, 0, 0); diff --git a/dll/cpl/input/settings.c b/dll/cpl/input/settings.c index 58642f54a86..393359dd7a2 100644 --- a/dll/cpl/input/settings.c +++ b/dll/cpl/input/settings.c @@ -5,6 +5,7 @@ * PURPOSE: input.dll * PROGRAMMER: Dmitry Chapyshev (dmitry@reactos.org) * Colin Finck + * Gregor Schneider * UPDATE HISTORY: * 06-09-2007 Created */ @@ -376,6 +377,59 @@ UpdateLayoutsList(VOID) (VOID) ListView_SetImageList(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST), hImgList, LVSIL_SMALL); } +typedef struct _REG_KB_ENTRY_ +{ + TCHAR szLayoutID[3]; + DWORD dwType; + TCHAR szData[CCH_LAYOUT_ID + 1]; + DWORD dwDataSize; +} REG_KB_ENTRY; + +/* Layouts were deleted so we have to order the existing ones */ +static VOID +UpdateRegValueNames(HKEY hKey) +{ + DWORD dwIndex = 0, dwGot = 0, dwLayoutSize; + DWORD dwSets = 5; + REG_KB_ENTRY* data = HeapAlloc(GetProcessHeap(), 0, dwSets * sizeof(REG_KB_ENTRY)); + + /* Get all existing entries and delete them */ + dwLayoutSize = sizeof(data[0].szLayoutID); + while (RegEnumValue(hKey, + dwIndex, + data[dwGot].szLayoutID, + &dwLayoutSize, + NULL, + &data[dwGot].dwType, + (PBYTE)data[dwGot].szData, + &data[dwGot].dwDataSize) != ERROR_NO_MORE_ITEMS) + { + if (_tcslen(data[dwGot].szLayoutID) <= 2 && _tcslen(data[dwGot].szData) == CCH_LAYOUT_ID) + { + RegDeleteValue(hKey, data[dwGot].szLayoutID); + dwGot++; + if (dwGot == dwSets) + { + dwSets += 5; + data = HeapReAlloc(GetProcessHeap(), 0, data, dwSets * sizeof(REG_KB_ENTRY)); + } + } + dwIndex++; + dwLayoutSize = sizeof(data[0].szLayoutID); + } + + /* Set all entries with an updated value name */ + for (dwIndex = 0; dwIndex < dwGot; dwIndex++) + { + TCHAR szNewLayoutID[3]; + + _stprintf(szNewLayoutID, TEXT("%u"), dwIndex + 1); + RegSetValueEx(hKey, szNewLayoutID, 0, data[dwIndex].dwType, + (PBYTE)data[dwIndex].szData, data[dwIndex].dwDataSize); + } + HeapFree(GetProcessHeap(), 0, data); +} + static VOID DeleteLayout(VOID) { @@ -430,6 +484,7 @@ DeleteLayout(VOID) if (RegDeleteValue(hKey, szLayoutNum) == ERROR_SUCCESS) { UpdateLayoutsList(); + UpdateRegValueNames(hKey); } } RegCloseKey(hKey); diff --git a/dll/cpl/intl/lang/bg-BG.rc b/dll/cpl/intl/lang/bg-BG.rc index 1e6af627b8f..75d62f3391a 100644 --- a/dll/cpl/intl/lang/bg-BG.rc +++ b/dll/cpl/intl/lang/bg-BG.rc @@ -188,6 +188,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "ヘ璢瑰籵 褥頸 瑰鳰" IDS_SPAIN "Spanish (Spain)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/cs-CZ.rc b/dll/cpl/intl/lang/cs-CZ.rc index 4e0047868ca..c72579df513 100644 --- a/dll/cpl/intl/lang/cs-CZ.rc +++ b/dll/cpl/intl/lang/cs-CZ.rc @@ -193,6 +193,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Pizpsobit mstn nastaven" IDS_SPAIN "角anl嗾ina (角anlsko)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/de-DE.rc b/dll/cpl/intl/lang/de-DE.rc index 909652966c4..07c47b20238 100644 --- a/dll/cpl/intl/lang/de-DE.rc +++ b/dll/cpl/intl/lang/de-DE.rc @@ -187,6 +187,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Regionale Einstellungen bearbeiten" IDS_SPAIN "Spanisch (Spanien)" + IDS_METRIC "Metrisch" + IDS_IMPERIAL "US-Ma゚e" END STRINGTABLE diff --git a/dll/cpl/intl/lang/en-US.rc b/dll/cpl/intl/lang/en-US.rc index d04ab75effe..f9abb75af08 100644 --- a/dll/cpl/intl/lang/en-US.rc +++ b/dll/cpl/intl/lang/en-US.rc @@ -188,6 +188,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Customize Regional Options" IDS_SPAIN "Spanish (Spain)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/es-ES.rc b/dll/cpl/intl/lang/es-ES.rc index e96c6c40fa4..e0987242f86 100644 --- a/dll/cpl/intl/lang/es-ES.rc +++ b/dll/cpl/intl/lang/es-ES.rc @@ -194,6 +194,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Personaliza opciones regionales" IDS_SPAIN "Espaol (Espaa)" + IDS_METRIC "M騁rico" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/fr-FR.rc b/dll/cpl/intl/lang/fr-FR.rc index ffbb2a6e7e7..363e980fd9e 100644 --- a/dll/cpl/intl/lang/fr-FR.rc +++ b/dll/cpl/intl/lang/fr-FR.rc @@ -191,6 +191,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Personnaliser les options r馮ionales" IDS_SPAIN "Espagnol (Espagne)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/it-IT.rc b/dll/cpl/intl/lang/it-IT.rc index d4156f1aa49..ee1513a685c 100644 --- a/dll/cpl/intl/lang/it-IT.rc +++ b/dll/cpl/intl/lang/it-IT.rc @@ -189,7 +189,9 @@ END STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Opzioni internazionali e della lingua" - IDS_SPAIN "Spanish (Spain)" + IDS_SPAIN "Spagnolo (Spagna)" + IDS_METRIC "Metrico" + IDS_IMPERIAL "Imperiale" END STRINGTABLE diff --git a/dll/cpl/intl/lang/no-NO.rc b/dll/cpl/intl/lang/no-NO.rc index c2d0509f817..376f1bccdac 100644 --- a/dll/cpl/intl/lang/no-NO.rc +++ b/dll/cpl/intl/lang/no-NO.rc @@ -188,6 +188,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Innstillinger for region og spr虧" IDS_SPAIN "Spanisk (Spain)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/pl-PL.rc b/dll/cpl/intl/lang/pl-PL.rc index b3ec2685c5c..a80e5dba5da 100644 --- a/dll/cpl/intl/lang/pl-PL.rc +++ b/dll/cpl/intl/lang/pl-PL.rc @@ -195,6 +195,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Dostosuj Ustawienia regionalne" IDS_SPAIN "Hiszpaski (Hiszpania)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/ro-RO.rc b/dll/cpl/intl/lang/ro-RO.rc index fc13dc93114..366453baef2 100644 --- a/dll/cpl/intl/lang/ro-RO.rc +++ b/dll/cpl/intl/lang/ro-RO.rc @@ -1,4 +1,4 @@ -LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL +サソLANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL #pragma code_page(65001) @@ -190,6 +190,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Particularizare opネ嬖uni" IDS_SPAIN "Spaniolト (Spainia)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/ru-RU.rc b/dll/cpl/intl/lang/ru-RU.rc index e9d36439fe0..6c3b3d637c8 100644 --- a/dll/cpl/intl/lang/ru-RU.rc +++ b/dll/cpl/intl/lang/ru-RU.rc @@ -186,6 +186,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "ヘ瑰鳰 裙韶琿 瑩瑟褪" IDS_SPAIN "ネ瑙韜 (ネ瑙)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/sk-SK.rc b/dll/cpl/intl/lang/sk-SK.rc index 8ddc3c29384..665d484a837 100644 --- a/dll/cpl/intl/lang/sk-SK.rc +++ b/dll/cpl/intl/lang/sk-SK.rc @@ -194,6 +194,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "Prispsobi miestne nastavenia" IDS_SPAIN "Spanish (Spain)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/uk-UA.rc b/dll/cpl/intl/lang/uk-UA.rc index 0b0b71fea73..4224beb675d 100644 --- a/dll/cpl/intl/lang/uk-UA.rc +++ b/dll/cpl/intl/lang/uk-UA.rc @@ -197,6 +197,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "ヘ瑰鳰 裙ウ琿頷 瑩瑟褪ウ" IDS_SPAIN "イ瑙 (イ瑙ウ)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/lang/zh-CN.rc b/dll/cpl/intl/lang/zh-CN.rc index 02cd64aed7b..1cb41817ce0 100644 --- a/dll/cpl/intl/lang/zh-CN.rc +++ b/dll/cpl/intl/lang/zh-CN.rc @@ -194,6 +194,8 @@ STRINGTABLE BEGIN IDS_CUSTOMIZE_TITLE "ラヤカィメ衂モム。マ" IDS_SPAIN "ホー獏タモ (ホー獏タ)" + IDS_METRIC "Metric" + IDS_IMPERIAL "Imperial" END STRINGTABLE diff --git a/dll/cpl/intl/numbers.c b/dll/cpl/intl/numbers.c index 1ca113d076a..75f609bda1d 100644 --- a/dll/cpl/intl/numbers.c +++ b/dll/cpl/intl/numbers.c @@ -58,8 +58,6 @@ static LPTSTR lpLeadNumFmtSamples[MAX_LEAD_ZEROES_SAMPLES] = {_T(",7"), _T("0,7")}; static LPTSTR lpListSepSamples[MAX_LIST_SEP_SAMPLES] = {_T(";")}; -static LPTSTR lpUnitsSysSamples[MAX_UNITS_SYS_SAMPLES] = - {_T("Metric"), _T("Imperial")}; /* Init num decimal separator control box */ @@ -495,6 +493,7 @@ InitUnitsSysCB(HWND hwndDlg, LCID lcid) { TCHAR szUnitsSys[MAX_SAMPLES_STR_SIZE]; + TCHAR szUnitName[128]; INT nCBIndex; /* Get current system of units */ @@ -512,10 +511,12 @@ InitUnitsSysCB(HWND hwndDlg, /* Create list of standard system of units */ for (nCBIndex = 0; nCBIndex < MAX_UNITS_SYS_SAMPLES; nCBIndex++) { + LoadString(hApplet, IDS_METRIC + nCBIndex, szUnitName, 128); + SendMessage(GetDlgItem(hwndDlg, IDC_NUMBERSMEASSYS), CB_ADDSTRING, 0, - (LPARAM)lpUnitsSysSamples[nCBIndex]); + (LPARAM)szUnitName); } /* Set current item to value from registry */ diff --git a/dll/cpl/intl/resource.h b/dll/cpl/intl/resource.h index 8491517acce..117077573fa 100644 --- a/dll/cpl/intl/resource.h +++ b/dll/cpl/intl/resource.h @@ -74,5 +74,7 @@ #define IDS_CPLDESCRIPTION 1001 #define IDS_CUSTOMIZE_TITLE 1002 #define IDS_SPAIN 1003 +#define IDS_METRIC 1004 +#define IDS_IMPERIAL 1005 /* EOF */ diff --git a/dll/cpl/sysdm/lang/cs-CZ.rc b/dll/cpl/sysdm/lang/cs-CZ.rc index 72c8f4c9f29..5be033c26d3 100644 --- a/dll/cpl/sysdm/lang/cs-CZ.rc +++ b/dll/cpl/sysdm/lang/cs-CZ.rc @@ -1,6 +1,6 @@ /* FILE: dll/cpl/sysdm/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) - * UPDATED: 2009-01-25 + * UPDATED: 2010-03-04 */ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT @@ -48,17 +48,6 @@ BEGIN PUSHBUTTON "Hard&warov profily...", IDC_HARDWARE_PROFILE, 154, 190, 90, 15 END -IDD_SYSSETTINGS DIALOGEX 0, 0, 221, 106 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION -CAPTION "System Settings" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Version Info",IDC_STATIC,6,3,210,73 - CONTROL "Report as Workstation",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 - LTEXT "ReactOS is built as a server OS and reports as such. Check this box to change this for applications only.",IDC_STATIC,15,15,183,41 - PUSHBUTTON "OK",IDOK,166,83,50,14 -END - IDD_PROPPAGEADVANCED DIALOGEX 0, 0, 256, 218 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION @@ -78,10 +67,22 @@ BEGIN LTEXT "Mo柤osti spu嗾n a zotaven kaj po竟ta鑛, jak se spustit a co dlat, jestli枡 jej chyba donut zastavit.", IDC_STATIC, 16, 144, 228, 19 PUSHBUTTON "Nastaven", IDC_STAREC, 194, 162, 50, 15 + PUSHBUTTON "Nastaven syst駑u", IDC_SYSSETTINGS, 2, 192, 80, 15 PUSHBUTTON "Promnn prosted", IDC_ENVVAR, 84, 192, 80, 15 PUSHBUTTON "Hl癩en chyb", IDC_ERRORREPORT, 170, 192, 80, 15 END +IDD_SYSSETTINGS DIALOGEX 0, 0, 221, 106 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +CAPTION "Nastaven syst駑u" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Informace o verzi",IDC_STATIC,6,3,210,73 + CONTROL "Hl疽it se jako pracovn stanice",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 + LTEXT "ReactOS je vytvoen jako serverov OS a jako takov se i hl疽. Po za嗅rtnut tohoto pol鑢a se pro aplikace toto chov疣 zmn.",IDC_STATIC,15,15,183,41 + PUSHBUTTON "OK",IDOK,166,83,50,14 +END + IDD_HARDWAREPROFILES DIALOGEX 6, 18, 254, 234 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU diff --git a/dll/cpl/sysdm/lang/it-IT.rc b/dll/cpl/sysdm/lang/it-IT.rc index 8fc2abc5367..253a4bd1084 100644 --- a/dll/cpl/sysdm/lang/it-IT.rc +++ b/dll/cpl/sysdm/lang/it-IT.rc @@ -43,16 +43,6 @@ BEGIN PUSHBUTTON "&Profili Hardware...", IDC_HARDWARE_PROFILE, 154, 190, 90, 14 END -IDD_SYSSETTINGS DIALOGEX 0, 0, 221, 106 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION -CAPTION "System Settings" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Version Info",IDC_STATIC,6,3,210,73 - CONTROL "Report as Workstation",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 - LTEXT "ReactOS is built as a server OS and reports as such. Check this box to change this for applications only.",IDC_STATIC,15,15,183,41 - PUSHBUTTON "OK",IDOK,166,83,50,14 -END IDD_PROPPAGEADVANCED DIALOGEX 0, 0, 256, 218 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION @@ -72,10 +62,22 @@ BEGIN LTEXT "Le opzioni di Avvio e recupero informano il computer su come partire e cosa fare nel caso che un errore fermi il computer.", IDC_STATIC, 16, 144, 210, 19 PUSHBUTTON "Impostazioni", IDC_STAREC, 194, 162, 50, 14 + PUSHBUTTON "Impostazioni di sistema", IDC_SYSSETTINGS, 2, 192, 80, 15 PUSHBUTTON "Variabili di ambiente", IDC_ENVVAR, 84, 192, 80, 14 PUSHBUTTON "Registrazione errori", IDC_ERRORREPORT, 170, 192, 80, 14 END +IDD_SYSSETTINGS DIALOGEX 0, 0, 221, 106 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION +CAPTION "System Settings" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Informazioni sulla versione",IDC_STATIC,6,3,210,73 + CONTROL "Notifica come Workstation",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 + LTEXT "ReactOS compilato come server ed notificato come tale. Non per questa applicazione.",IDC_STATIC,15,15,183,41 + PUSHBUTTON "OK",IDOK,166,83,50,14 +END + IDD_HARDWAREPROFILES DIALOGEX 6, 18, 254, 234 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU @@ -159,7 +161,7 @@ BEGIN EDITTEXT IDC_STRRECRECEDIT, 179, 68, 30, 12, ES_NUMBER CONTROL "", IDC_STRRECRECUPDWN, "msctls_updown32", UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | WS_CHILD | WS_VISIBLE, 0, 0, 8, 13 LTEXT "secondi", IDC_STATIC, 215, 70, 25, 8 - LTEXT "Per modificare le opzioni di avvio manualmenta , clicca Modifica.", IDC_STATIC, 14, 89, 187, 8 + LTEXT "Per modificare le opzioni di avvio manualmente, clicca Modifica.", IDC_STATIC, 14, 89, 187, 8 PUSHBUTTON "&Modifica", IDC_STRRECEDIT, 188, 87, 50, 14 GROUPBOX "Blocco del sistema", IDC_STATIC, 7, 111, 238, 140 @@ -282,4 +284,5 @@ BEGIN IDS_USERPROFILE_TYPE "Tipo" IDS_USERPROFILE_STATUS "Stato" IDS_USERPROFILE_MODIFIED "Modificato" + IDS_DEVS "\nReactOS Team\n\nCoordinatore\n\nAleksey Bragin\n\nGruppo di sviluppo\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHerv Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blmel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nG van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nUlteriori ringraziamenti\n\na tutti i Contributers\nWine Team\n\n" END diff --git a/dll/cpl/sysdm/lang/uk-UA.rc b/dll/cpl/sysdm/lang/uk-UA.rc index 408f6511dc6..651a167d1ea 100644 --- a/dll/cpl/sysdm/lang/uk-UA.rc +++ b/dll/cpl/sysdm/lang/uk-UA.rc @@ -58,7 +58,6 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "イ璋ウ 粢ウ",IDC_STATIC,6,3,210,73 CONTROL "マ鈿璞頸 碚 瑙ウ",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 - CONTROL "マ鈿璞頸 碚 瑙ウ",IDC_REPORTASWORKSTATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,57,88,10 LTEXT "ReactOS 碯蔘コ 褞粢 ホム. ホ碣瑣 瑜褻, 銕ウ頸 顏 裨 蒡萵.",IDC_STATIC,15,15,183,41 PUSHBUTTON "OK",IDOK,166,83,50,14 END diff --git a/dll/cpl/usrmgr/groups.c b/dll/cpl/usrmgr/groups.c index 255d6bf4f79..4eebfa40f26 100644 --- a/dll/cpl/usrmgr/groups.c +++ b/dll/cpl/usrmgr/groups.c @@ -234,10 +234,10 @@ GroupNew(HWND hwndDlg) } if (group.lgrpi1_name) - HeapFree(GetProcessHeap, 0, group.lgrpi1_name); + HeapFree(GetProcessHeap(), 0, group.lgrpi1_name); if (group.lgrpi1_comment) - HeapFree(GetProcessHeap, 0, group.lgrpi1_comment); + HeapFree(GetProcessHeap(), 0, group.lgrpi1_comment); } diff --git a/dll/cpl/usrmgr/users.c b/dll/cpl/usrmgr/users.c index 8335e1d9aa9..04ff45eaca3 100644 --- a/dll/cpl/usrmgr/users.c +++ b/dll/cpl/usrmgr/users.c @@ -294,16 +294,16 @@ UserNew(HWND hwndDlg) } if (user.usri3_name) - HeapFree(GetProcessHeap, 0, user.usri3_name); + HeapFree(GetProcessHeap(), 0, user.usri3_name); if (user.usri3_full_name) - HeapFree(GetProcessHeap, 0, user.usri3_full_name); + HeapFree(GetProcessHeap(), 0, user.usri3_full_name); if (user.usri3_comment) - HeapFree(GetProcessHeap, 0, user.usri3_comment); + HeapFree(GetProcessHeap(), 0, user.usri3_comment); if (user.usri3_password) - HeapFree(GetProcessHeap, 0, user.usri3_password); + HeapFree(GetProcessHeap(), 0, user.usri3_password); } diff --git a/dll/cpl/usrmgr/usrmgr.rbuild b/dll/cpl/usrmgr/usrmgr.rbuild index 6b88a4b8103..472bec32e51 100644 --- a/dll/cpl/usrmgr/usrmgr.rbuild +++ b/dll/cpl/usrmgr/usrmgr.rbuild @@ -3,6 +3,7 @@ . + include/reactos/wine advapi32 user32 gdi32 diff --git a/dll/ntdll/ldr/utils.c b/dll/ntdll/ldr/utils.c index 9dcb99960ef..14512194832 100644 --- a/dll/ntdll/ldr/utils.c +++ b/dll/ntdll/ldr/utils.c @@ -1518,7 +1518,7 @@ LdrpGetOrLoadModule(PWCHAR SearchPath, if (!NT_SUCCESS(Status)) { ULONG ErrorResponse; - ULONG_PTR ErrorParameter = (ULONG_PTR)&DllName; + ULONG_PTR ErrorParameter = (ULONG_PTR)&AnsiDllName; DPRINT1("failed to load %wZ\n", &DllName); diff --git a/dll/win32/advapi32/misc/hwprofiles.c b/dll/win32/advapi32/misc/hwprofiles.c index f3ac824710d..6bfc08b0df0 100644 --- a/dll/win32/advapi32/misc/hwprofiles.c +++ b/dll/win32/advapi32/misc/hwprofiles.c @@ -1,15 +1,14 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries - * FILE: lib/advapi32/misc/hwprofiles.c + * FILE: dll/win32/advapi32/misc/hwprofiles.c * PURPOSE: advapi32.dll Hardware Functions * PROGRAMMER: Steven Edwards - * UPDATE HISTORY: - * 20042502 + * Eric Kohl */ #include +#include #include WINE_DEFAULT_DEBUG_CHANNEL(advapi); @@ -91,6 +90,7 @@ GetCurrentHwProfileW(LPHW_PROFILE_INFOW lpHwProfileInfo) HKEY hProfileKey; DWORD dwLength; DWORD dwConfigId; + UUID uuid; TRACE("GetCurrentHwProfileW() called\n"); @@ -158,9 +158,17 @@ GetCurrentHwProfileW(LPHW_PROFILE_INFOW lpHwProfileInfo) (LPBYTE)&lpHwProfileInfo->szHwProfileGuid, &dwLength)) { - /* FIXME: Create a new GUID */ - wcscpy(lpHwProfileInfo->szHwProfileGuid, - L"{00000000-0000-0000-0000-000000000000}"); + /* Create a new GUID */ + UuidCreate(&uuid); + swprintf( + lpHwProfileInfo->szHwProfileGuid, + L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + uuid.Data1, + uuid.Data2, + uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7]); dwLength = (wcslen(lpHwProfileInfo->szHwProfileGuid) + 1) * sizeof(WCHAR); RegSetValueExW(hProfileKey, diff --git a/dll/win32/advapi32/reg/reg.c b/dll/win32/advapi32/reg/reg.c index e131cf2e43b..26036dc1963 100644 --- a/dll/win32/advapi32/reg/reg.c +++ b/dll/win32/advapi32/reg/reg.c @@ -4841,15 +4841,7 @@ RegSetValueExW(HKEY hKey, return RtlNtStatusToDosError(Status); } - if (lpValueName != NULL) - { - RtlInitUnicodeString(&ValueName, - lpValueName); - } - else - { - RtlInitUnicodeString(&ValueName, L""); - } + RtlInitUnicodeString(&ValueName, lpValueName); pValueName = &ValueName; if (is_string(dwType) && (cbData != 0)) diff --git a/dll/win32/advapi32/service/eventlog.c b/dll/win32/advapi32/service/eventlog.c index 8cb4b22664e..b8a35a639b3 100644 --- a/dll/win32/advapi32/service/eventlog.c +++ b/dll/win32/advapi32/service/eventlog.c @@ -945,6 +945,8 @@ ReportEventA(IN HANDLE hEventLog, ANSI_STRING *Strings; ANSI_STRING ComputerName; WORD i; + CHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD dwSize; TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n", hEventLog, wType, wCategory, dwEventID, lpUserSid, @@ -962,8 +964,9 @@ ReportEventA(IN HANDLE hEventLog, for (i = 0; i < wNumStrings; i++) RtlInitAnsiString(&Strings[i], lpStrings[i]); - /*FIXME: ComputerName */ - RtlInitAnsiString(&ComputerName, ""); + dwSize = MAX_COMPUTERNAME_LENGTH + 1; + GetComputerNameA(szComputerName, &dwSize); + RtlInitAnsiString(&ComputerName, szComputerName); RpcTryExcept { @@ -1029,6 +1032,8 @@ ReportEventW(IN HANDLE hEventLog, UNICODE_STRING *Strings; UNICODE_STRING ComputerName; WORD i; + WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD dwSize; TRACE("%p, %u, %u, %lu, %p, %u, %lu, %p, %p\n", hEventLog, wType, wCategory, dwEventID, lpUserSid, @@ -1046,8 +1051,9 @@ ReportEventW(IN HANDLE hEventLog, for (i = 0; i < wNumStrings; i++) RtlInitUnicodeString(&Strings[i], lpStrings[i]); - /*FIXME: ComputerName */ - RtlInitUnicodeString(&ComputerName, L""); + dwSize = MAX_COMPUTERNAME_LENGTH + 1; + GetComputerNameW(szComputerName, &dwSize); + RtlInitUnicodeString(&ComputerName, szComputerName); RpcTryExcept { diff --git a/dll/win32/comctl32/comctl32.rbuild b/dll/win32/comctl32/comctl32.rbuild index 460df46a789..3cc1ce2c0ad 100644 --- a/dll/win32/comctl32/comctl32.rbuild +++ b/dll/win32/comctl32/comctl32.rbuild @@ -8,6 +8,8 @@ include/reactos/wine + + 0x600 animate.c comboex.c comctl32undoc.c diff --git a/dll/win32/comdlg32/filedlg.c b/dll/win32/comdlg32/filedlg.c index 58b57ccbbac..64cb3935ab2 100644 --- a/dll/win32/comdlg32/filedlg.c +++ b/dll/win32/comdlg32/filedlg.c @@ -176,7 +176,7 @@ static SIZE MemDialogSize = { 0, 0}; /* keep size of the (resizable) dialog */ /* Internal functions used by the dialog */ static LRESULT FILEDLG95_ResizeControls(HWND hwnd, WPARAM wParam, LPARAM lParam); static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam); -static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam); +static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam); static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd); static BOOL FILEDLG95_OnOpen(HWND hwnd); static LRESULT FILEDLG95_InitControls(HWND hwnd); @@ -240,7 +240,7 @@ static BOOL GetFileName95(FileOpenDlgInfos *fodInfos) { LRESULT lRes; - LPCVOID template; + LPVOID template; HRSRC hRes; HANDLE hDlgTmpl = 0; HRESULT hr; @@ -991,7 +991,7 @@ static LRESULT FILEDLG95_OnWMGetMMI( HWND hwnd, LPMINMAXINFO mmiptr) * vertically or horizontally to get out of the way. Only the "grip" * is moved in both directions to stay in the corner. */ -static LRESULT FILEDLG95_OnWMSize(HWND hwnd, WPARAM wParam, LPARAM lParam) +static LRESULT FILEDLG95_OnWMSize(HWND hwnd, WPARAM wParam) { RECT rc, rcview; int chgx, chgy; @@ -1223,11 +1223,11 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l return 0; } case WM_SIZE: - return FILEDLG95_OnWMSize(hwnd, wParam, lParam); + return FILEDLG95_OnWMSize(hwnd, wParam); case WM_GETMINMAXINFO: return FILEDLG95_OnWMGetMMI( hwnd, (LPMINMAXINFO)lParam); case WM_COMMAND: - return FILEDLG95_OnWMCommand(hwnd, wParam, lParam); + return FILEDLG95_OnWMCommand(hwnd, wParam); case WM_DRAWITEM: { switch(((LPDRAWITEMSTRUCT)lParam)->CtlID) @@ -1733,7 +1733,7 @@ void FILEDLG95_Clean(HWND hwnd) * * WM_COMMAND message handler */ -static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam) +static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam) { WORD wNotifyCode = HIWORD(wParam); /* notification code */ WORD wID = LOWORD(wParam); /* item, control, or accelerator identifier */ @@ -3799,7 +3799,7 @@ BOOL FD32_GetTemplate(PFD31_DATA lfs) /*********************************************************************** * FD32_WMMeasureItem [internal] */ -static LONG FD32_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) +static LONG FD32_WMMeasureItem(LPARAM lParam) { LPMEASUREITEMSTRUCT lpmeasure; @@ -3832,7 +3832,7 @@ static INT_PTR CALLBACK FD32_FileOpenDlgProc(HWND hWnd, UINT wMsg, return FD31_WMInitDialog(hWnd, wParam, lParam); case WM_MEASUREITEM: - return FD32_WMMeasureItem(hWnd, wParam, lParam); + return FD32_WMMeasureItem(lParam); case WM_DRAWITEM: return FD31_WMDrawItem(hWnd, wParam, lParam, !lfs->open, (DRAWITEMSTRUCT *)lParam); diff --git a/dll/win32/comdlg32/fontdlg.c b/dll/win32/comdlg32/fontdlg.c index 1ad881c72d2..80f1ad9345b 100644 --- a/dll/win32/comdlg32/fontdlg.c +++ b/dll/win32/comdlg32/fontdlg.c @@ -766,7 +766,7 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) /*********************************************************************** * CFn_WMMeasureItem [internal] */ -static LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam) +static LRESULT CFn_WMMeasureItem(HWND hDlg, LPARAM lParam) { HDC hdc; HFONT hfontprev; @@ -794,7 +794,7 @@ static LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam) /*********************************************************************** * CFn_WMDrawItem [internal] */ -static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam) +static LRESULT CFn_WMDrawItem(LPARAM lParam) { HBRUSH hBrush; WCHAR buffer[40]; @@ -1190,9 +1190,9 @@ static INT_PTR CALLBACK FormatCharDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, switch (uMsg) { case WM_MEASUREITEM: - return CFn_WMMeasureItem(hDlg, wParam, lParam); + return CFn_WMMeasureItem(hDlg,lParam); case WM_DRAWITEM: - return CFn_WMDrawItem(hDlg, wParam, lParam); + return CFn_WMDrawItem(lParam); case WM_COMMAND: return CFn_WMCommand(hDlg, wParam, lParam, lpcfw); case WM_DESTROY: @@ -1239,9 +1239,9 @@ static INT_PTR CALLBACK FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, switch (uMsg) { case WM_MEASUREITEM: - return CFn_WMMeasureItem(hDlg, wParam, lParam); + return CFn_WMMeasureItem(hDlg, lParam); case WM_DRAWITEM: - return CFn_WMDrawItem(hDlg, wParam, lParam); + return CFn_WMDrawItem(lParam); case WM_COMMAND: return CFn_WMCommand(hDlg, wParam, lParam, lpcf); case WM_DESTROY: diff --git a/dll/win32/comdlg32/printdlg.c b/dll/win32/comdlg32/printdlg.c index f653251ed16..74a06ffa3d5 100644 --- a/dll/win32/comdlg32/printdlg.c +++ b/dll/win32/comdlg32/printdlg.c @@ -1504,7 +1504,7 @@ static LRESULT PRINTDLG_WMInitDialogW(HWND hDlg, * PRINTDLG_WMCommand [internal] */ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, - LPARAM lParam, PRINT_PTRA* PrintStructures) + PRINT_PTRA* PrintStructures) { LPPRINTDLGA lppd = PrintStructures->lpPrintDlg; UINT PrinterComboID = (lppd->Flags & PD_PRINTSETUP) ? cmb1 : cmb4; @@ -1658,7 +1658,7 @@ static LRESULT PRINTDLG_WMCommandA(HWND hDlg, WPARAM wParam, } static LRESULT PRINTDLG_WMCommandW(HWND hDlg, WPARAM wParam, - LPARAM lParam, PRINT_PTRW* PrintStructures) + PRINT_PTRW* PrintStructures) { LPPRINTDLGW lppd = PrintStructures->lpPrintDlg; UINT PrinterComboID = (lppd->Flags & PD_PRINTSETUP) ? cmb1 : cmb4; @@ -1846,7 +1846,7 @@ static INT_PTR CALLBACK PrintDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, switch (uMsg) { case WM_COMMAND: - return PRINTDLG_WMCommandA(hDlg, wParam, lParam, PrintStructures); + return PRINTDLG_WMCommandA(hDlg, wParam, PrintStructures); case WM_DESTROY: DestroyIcon(PrintStructures->hCollateIcon); @@ -1892,7 +1892,7 @@ static INT_PTR CALLBACK PrintDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam, switch (uMsg) { case WM_COMMAND: - return PRINTDLG_WMCommandW(hDlg, wParam, lParam, PrintStructures); + return PRINTDLG_WMCommandW(hDlg, wParam, PrintStructures); case WM_DESTROY: DestroyIcon(PrintStructures->hCollateIcon); diff --git a/dll/win32/crypt32/decode.c b/dll/win32/crypt32/decode.c index fb3d36e8124..655a5b2c5d6 100644 --- a/dll/win32/crypt32/decode.c +++ b/dll/win32/crypt32/decode.c @@ -523,9 +523,11 @@ static BOOL CRYPT_AsnDecodeSequence(struct AsnDecodeSequenceItem items[], for (i = 0; i < cItem; i++) { - bytesNeeded += items[i].size; + if (items[i].size > items[i].minSize) + bytesNeeded += items[i].size - items[i].minSize; structSize = max( structSize, items[i].offset + items[i].minSize ); } + bytesNeeded += structSize; if (pcbDecoded) *pcbDecoded = 1 + lenBytes + cbDecoded; if (!pvStructInfo) diff --git a/base/services/dhcp/adapter.c b/dll/win32/dhcpcsvc/dhcp/adapter.c similarity index 100% rename from base/services/dhcp/adapter.c rename to dll/win32/dhcpcsvc/dhcp/adapter.c diff --git a/base/services/dhcp/alloc.c b/dll/win32/dhcpcsvc/dhcp/alloc.c similarity index 100% rename from base/services/dhcp/alloc.c rename to dll/win32/dhcpcsvc/dhcp/alloc.c diff --git a/base/services/dhcp/api.c b/dll/win32/dhcpcsvc/dhcp/api.c similarity index 98% rename from base/services/dhcp/api.c rename to dll/win32/dhcpcsvc/dhcp/api.c index 268466980b6..efa07a80a54 100644 --- a/base/services/dhcp/api.c +++ b/dll/win32/dhcpcsvc/dhcp/api.c @@ -28,6 +28,10 @@ VOID ApiUnlock() { LeaveCriticalSection( &ApiCriticalSection ); } +VOID ApiFree() { + DeleteCriticalSection( &ApiCriticalSection ); +} + /* This represents the service portion of the DHCP client API */ DWORD DSLeaseIpAddress( PipeSendFunc Send, COMM_DHCP_REQ *Req ) { diff --git a/base/services/dhcp/compat.c b/dll/win32/dhcpcsvc/dhcp/compat.c similarity index 100% rename from base/services/dhcp/compat.c rename to dll/win32/dhcpcsvc/dhcp/compat.c diff --git a/base/services/dhcp/dhclient.c b/dll/win32/dhcpcsvc/dhcp/dhclient.c similarity index 90% rename from base/services/dhcp/dhclient.c rename to dll/win32/dhcpcsvc/dhcp/dhclient.c index db263bc4ab5..a27c7b667ad 100644 --- a/base/services/dhcp/dhclient.c +++ b/dll/win32/dhcpcsvc/dhcp/dhclient.c @@ -54,10 +54,7 @@ */ #include "rosdhcp.h" -#include #include "dhcpd.h" -#include "privsep.h" -#include "debug.h" #define PERIOD 0x2e #define hyphenchar(c) ((c) == 0x2d) @@ -110,16 +107,9 @@ int check_arp( struct interface_info *ip, struct client_lease *lp ) time_t scripttime; - -static VOID CALLBACK ServiceMain(DWORD argc, LPWSTR *argv); static WCHAR ServiceName[] = L"DHCP"; -static SERVICE_TABLE_ENTRYW ServiceTable[] = -{ - {ServiceName, ServiceMain}, - {NULL, NULL} -}; -SERVICE_STATUS_HANDLE ServiceStatusHandle; +SERVICE_STATUS_HANDLE ServiceStatusHandle = 0; SERVICE_STATUS ServiceStatus; @@ -192,7 +182,7 @@ ServiceControlHandler(DWORD dwControl, } -static VOID CALLBACK +VOID NTAPI ServiceMain(DWORD argc, LPWSTR *argv) { ServiceStatusHandle = RegisterServiceCtrlHandlerExW(ServiceName, @@ -200,53 +190,49 @@ ServiceMain(DWORD argc, LPWSTR *argv) NULL); if (!ServiceStatusHandle) { + DbgPrint("DHCPCSVC: Unable to register service control handler (%x)\n", GetLastError); return; } UpdateServiceStatus(SERVICE_START_PENDING); + ApiInit(); + AdapterInit(); + + tzset(); + + memset(&sockaddr_broadcast, 0, sizeof(sockaddr_broadcast)); + sockaddr_broadcast.sin_family = AF_INET; + sockaddr_broadcast.sin_port = htons(REMOTE_PORT); + sockaddr_broadcast.sin_addr.s_addr = INADDR_BROADCAST; + inaddr_any.s_addr = INADDR_ANY; + bootp_packet_handler = do_packet; + + if (PipeInit() == INVALID_HANDLE_VALUE) + { + DbgPrint("DHCPCSVC: PipeInit() failed!\n"); + AdapterStop(); + ApiFree(); + UpdateServiceStatus(SERVICE_STOPPED); + } + + DH_DbgPrint(MID_TRACE,("DHCP Service Started\n")); + UpdateServiceStatus(SERVICE_RUNNING); + DH_DbgPrint(MID_TRACE,("Going into dispatch()\n")); + + DbgPrint("DHCPCSVC: DHCP service is starting up\n"); + dispatch(); -} + DbgPrint("DHCPCSVC: DHCP service is shutting down\n"); -int -main(int argc, char *argv[]) -{ - ApiInit(); - AdapterInit(); - PipeInit(); + //AdapterStop(); + //ApiFree(); + /* FIXME: Close pipe and kill pipe thread */ - tzset(); - - memset(&sockaddr_broadcast, 0, sizeof(sockaddr_broadcast)); - sockaddr_broadcast.sin_family = AF_INET; - sockaddr_broadcast.sin_port = htons(REMOTE_PORT); - sockaddr_broadcast.sin_addr.s_addr = INADDR_BROADCAST; - inaddr_any.s_addr = INADDR_ANY; - - DH_DbgPrint(MID_TRACE,("DHCP Service Started\n")); - - bootp_packet_handler = do_packet; - - DH_DbgPrint(MID_TRACE,("Going into dispatch()\n")); - - StartServiceCtrlDispatcherW(ServiceTable); - - /* not reached */ - return (0); -} - -void -usage(void) -{ -// extern char *__progname; - -// fprintf(stderr, "usage: %s [-dqu] ", __progname); - fprintf(stderr, "usage: dhclient [-dqu] "); - fprintf(stderr, "[-c conffile] [-l leasefile] interface\n"); - exit(1); + UpdateServiceStatus(SERVICE_STOPPED); } /* @@ -1117,83 +1103,12 @@ void state_panic(void *ipp) { struct interface_info *ip = ipp; - struct client_lease *loop = ip->client->active; - struct client_lease *lp; - time_t cur_time; + time_t cur_time; + + time(&cur_time); note("No DHCPOFFERS received."); - time(&cur_time); - - /* We may not have an active lease, but we may have some - predefined leases that we can try. */ - if (!ip->client->active && ip->client->leases) - goto activate_next; - - /* Run through the list of leases and see if one can be used. */ - while (ip->client->active) { - if (ip->client->active->expiry > cur_time) { - note("Trying recorded lease %s", - piaddr(ip->client->active->address)); - /* Run the client script with the existing - parameters. */ - script_init("TIMEOUT", - ip->client->active->medium); - script_write_params("new_", ip->client->active); - if (ip->client->alias) - script_write_params("alias_", - ip->client->alias); - - /* If the old lease is still good and doesn't - yet need renewal, go into BOUND state and - timeout at the renewal time. */ - if (cur_time < - ip->client->active->renewal) { - ip->client->state = S_BOUND; - note("bound: renewal in %ld seconds.", - (long int)(ip->client->active->renewal - - cur_time)); - add_timeout( - ip->client->active->renewal, - state_bound, ip); - } else { - ip->client->state = S_BOUND; - note("bound: immediate renewal."); - state_bound(ip); - } - return; - } - - /* If there are no other leases, give up. */ - if (!ip->client->leases) { - ip->client->leases = ip->client->active; - ip->client->active = NULL; - break; - } - -activate_next: - /* Otherwise, put the active lease at the end of the - lease list, and try another lease.. */ - for (lp = ip->client->leases; lp->next; lp = lp->next) - ; - lp->next = ip->client->active; - if (lp->next) - lp->next->next = NULL; - ip->client->active = ip->client->leases; - ip->client->leases = ip->client->leases->next; - - /* If we already tried this lease, we've exhausted the - set of leases, so we might as well give up for - now. */ - if (ip->client->active == loop) - break; - else if (!loop) - loop = ip->client->active; - } - - /* No leases were available, or what was available didn't work, so - tell the shell script that we failed to allocate an address, - and try again later. */ note("No working leases in persistent database - sleeping.\n"); ip->client->state = S_INIT; add_timeout(cur_time + ip->client->config->retry_interval, state_init, @@ -1239,8 +1154,6 @@ send_request(void *ipp) if (ip->client->state == S_REBOOTING && !ip->client->medium && ip->client->active->medium ) { - script_init("MEDIUM", ip->client->active->medium); - /* If the medium we chose won't fly, go to INIT state. */ /* XXX Nothing for now */ @@ -1708,41 +1621,6 @@ write_client_lease(struct interface_info *ip, struct client_lease *lease, fflush(leaseFile); } -void -script_init(char *reason, struct string_list *medium) -{ - size_t len, mediumlen = 0; - struct imsg_hdr hdr; - struct buf *buf; - int errs; - - if (medium != NULL && medium->string != NULL) - mediumlen = strlen(medium->string); - - hdr.code = IMSG_SCRIPT_INIT; - hdr.len = sizeof(struct imsg_hdr) + - sizeof(size_t) + mediumlen + - sizeof(size_t) + strlen(reason); - - if ((buf = buf_open(hdr.len)) == NULL) - return; - - errs = 0; - errs += buf_add(buf, &hdr, sizeof(hdr)); - errs += buf_add(buf, &mediumlen, sizeof(mediumlen)); - if (mediumlen > 0) - errs += buf_add(buf, medium->string, mediumlen); - len = strlen(reason); - errs += buf_add(buf, &len, sizeof(len)); - errs += buf_add(buf, reason, len); - - if (errs) - error("buf_add: %d", WSAGetLastError()); - - if (buf_close(privfd, buf) == -1) - error("buf_close: %d", WSAGetLastError()); -} - void priv_script_init(struct interface_info *ip, char *reason, char *medium) { @@ -1889,58 +1767,6 @@ supersede: #endif } -void -script_write_params(char *prefix, struct client_lease *lease) -{ - size_t fn_len = 0, sn_len = 0, pr_len = 0; - struct imsg_hdr hdr; - struct buf *buf; - int errs, i; - - if (lease->filename != NULL) - fn_len = strlen(lease->filename); - if (lease->server_name != NULL) - sn_len = strlen(lease->server_name); - if (prefix != NULL) - pr_len = strlen(prefix); - - hdr.code = IMSG_SCRIPT_WRITE_PARAMS; - hdr.len = sizeof(hdr) + sizeof(struct client_lease) + - sizeof(size_t) + fn_len + sizeof(size_t) + sn_len + - sizeof(size_t) + pr_len; - - for (i = 0; i < 256; i++) - hdr.len += sizeof(int) + lease->options[i].len; - - scripttime = time(NULL); - - if ((buf = buf_open(hdr.len)) == NULL) - return; - - errs = 0; - errs += buf_add(buf, &hdr, sizeof(hdr)); - errs += buf_add(buf, lease, sizeof(struct client_lease)); - errs += buf_add(buf, &fn_len, sizeof(fn_len)); - errs += buf_add(buf, lease->filename, fn_len); - errs += buf_add(buf, &sn_len, sizeof(sn_len)); - errs += buf_add(buf, lease->server_name, sn_len); - errs += buf_add(buf, &pr_len, sizeof(pr_len)); - errs += buf_add(buf, prefix, pr_len); - - for (i = 0; i < 256; i++) { - errs += buf_add(buf, &lease->options[i].len, - sizeof(lease->options[i].len)); - errs += buf_add(buf, lease->options[i].data, - lease->options[i].len); - } - - if (errs) - error("buf_add: %d", WSAGetLastError()); - - if (buf_close(privfd, buf) == -1) - error("buf_close: %d", WSAGetLastError()); -} - int dhcp_option_ev_name(char *buf, size_t buflen, struct dhcp_option *option) { diff --git a/base/services/dhcp/dispatch.c b/dll/win32/dhcpcsvc/dhcp/dispatch.c similarity index 98% rename from base/services/dhcp/dispatch.c rename to dll/win32/dhcpcsvc/dhcp/dispatch.c index c26ead72701..b429f9517e7 100644 --- a/base/services/dhcp/dispatch.c +++ b/dll/win32/dhcpcsvc/dhcp/dispatch.c @@ -69,10 +69,8 @@ dispatch(void) time_t howlong, cur_time; struct timeval timeval; - if (!AdapterDiscover()) { - AdapterStop(); + if (!AdapterDiscover()) return; - } ApiLock(); @@ -151,7 +149,7 @@ dispatch(void) } } while (1); - ApiUnlock(); /* Not reached currently */ + ApiUnlock(); } void @@ -182,7 +180,7 @@ got_one(struct protocol *l) warning("Interface %s no longer appears valid.", ip->name); ip->dead = 1; - close(l->fd); + closesocket(l->fd); remove_protocol(l); adapter = AdapterFindInfo(ip); if (adapter) { diff --git a/base/services/dhcp/hash.c b/dll/win32/dhcpcsvc/dhcp/hash.c similarity index 100% rename from base/services/dhcp/hash.c rename to dll/win32/dhcpcsvc/dhcp/hash.c diff --git a/base/services/dhcp/options.c b/dll/win32/dhcpcsvc/dhcp/options.c similarity index 100% rename from base/services/dhcp/options.c rename to dll/win32/dhcpcsvc/dhcp/options.c diff --git a/base/services/dhcp/pipe.c b/dll/win32/dhcpcsvc/dhcp/pipe.c similarity index 100% rename from base/services/dhcp/pipe.c rename to dll/win32/dhcpcsvc/dhcp/pipe.c diff --git a/base/services/dhcp/socket.c b/dll/win32/dhcpcsvc/dhcp/socket.c similarity index 100% rename from base/services/dhcp/socket.c rename to dll/win32/dhcpcsvc/dhcp/socket.c diff --git a/base/services/dhcp/tables.c b/dll/win32/dhcpcsvc/dhcp/tables.c similarity index 100% rename from base/services/dhcp/tables.c rename to dll/win32/dhcpcsvc/dhcp/tables.c diff --git a/base/services/dhcp/tree.c b/dll/win32/dhcpcsvc/dhcp/tree.c similarity index 100% rename from base/services/dhcp/tree.c rename to dll/win32/dhcpcsvc/dhcp/tree.c diff --git a/base/services/dhcp/util.c b/dll/win32/dhcpcsvc/dhcp/util.c similarity index 100% rename from base/services/dhcp/util.c rename to dll/win32/dhcpcsvc/dhcp/util.c diff --git a/dll/win32/dhcpcsvc/dhcpcsvc.c b/dll/win32/dhcpcsvc/dhcpcsvc.c index 0c59fb7df90..07910684993 100644 --- a/dll/win32/dhcpcsvc/dhcpcsvc.c +++ b/dll/win32/dhcpcsvc/dhcpcsvc.c @@ -6,22 +6,63 @@ * COPYRIGHT: Copyright 2005 Art Yerkes */ -#include -#include -#include -#include +#include #define NDEBUG #include -#define DHCP_TIMEOUT 1000 +static HANDLE PipeHandle = INVALID_HANDLE_VALUE; DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version) { - *Version = 2; - return 0; + DWORD PipeMode; + + /* Wait for the pipe to be available */ + if (WaitNamedPipeW(DHCP_PIPE_NAME, NMPWAIT_USE_DEFAULT_WAIT)) + { + /* It's available, let's try to open it */ + PipeHandle = CreateFileW(DHCP_PIPE_NAME, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, + OPEN_EXISTING, + 0, + NULL); + + /* Check if we succeeded in opening the pipe */ + if (PipeHandle == INVALID_HANDLE_VALUE) + { + /* We didn't */ + return GetLastError(); + } + else + { + /* Change the pipe into message mode */ + PipeMode = PIPE_READMODE_MESSAGE; + if (!SetNamedPipeHandleState(PipeHandle, &PipeMode, NULL, NULL)) + { + /* Mode change failed */ + CloseHandle(PipeHandle); + PipeHandle = INVALID_HANDLE_VALUE; + return GetLastError(); + } + else + { + /* We're good to go */ + *Version = 2; + return NO_ERROR; + } + } + } + else + { + /* No good, we failed */ + return GetLastError(); + } } VOID APIENTRY DhcpCApiCleanup() { + CloseHandle(PipeHandle); + PipeHandle = INVALID_HANDLE_VALUE; } DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex, @@ -33,12 +74,20 @@ DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex, DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqQueryHWInfo; Req.AdapterIndex = AdapterIndex; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); + if (!Result) + { + /* Pipe transaction failed */ + return 0; + } if( !Reply.Reply ) return 0; else { @@ -55,12 +104,20 @@ DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ) { DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqLeaseIpAddress; Req.AdapterIndex = AdapterIndex; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); + if (!Result) + { + /* Pipe transaction failed */ + return 0; + } return Reply.Reply; } @@ -71,12 +128,20 @@ DWORD APIENTRY DhcpReleaseIpAddressLease( DWORD AdapterIndex ) { DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqReleaseIpAddress; Req.AdapterIndex = AdapterIndex; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); + if (!Result) + { + /* Pipe transaction failed */ + return 0; + } return Reply.Reply; } @@ -87,12 +152,20 @@ DWORD APIENTRY DhcpRenewIpAddressLease( DWORD AdapterIndex ) { DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqRenewIpAddress; Req.AdapterIndex = AdapterIndex; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); + if (!Result) + { + /* Pipe transaction failed */ + return 0; + } return Reply.Reply; } @@ -105,14 +178,22 @@ DWORD APIENTRY DhcpStaticRefreshParams( DWORD AdapterIndex, DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqStaticRefreshParams; Req.AdapterIndex = AdapterIndex; Req.Body.StaticRefreshParams.IPAddress = Address; Req.Body.StaticRefreshParams.Netmask = Netmask; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); + if (!Result) + { + /* Pipe transaction failed */ + return 0; + } return Reply.Reply; } @@ -153,7 +234,7 @@ DhcpNotifyConfigChange(LPWSTR ServerName, DWORD SubnetMask, int DhcpAction) { - DPRINT1("DhcpNotifyConfigChange not implemented yet\n"); + DbgPrint("DHCPCSVC: DhcpNotifyConfigChange not implemented yet\n"); return 0; } @@ -192,12 +273,15 @@ DWORD APIENTRY DhcpRosGetAdapterInfo( DWORD AdapterIndex, DWORD BytesRead; BOOL Result; + ASSERT(PipeHandle != INVALID_HANDLE_VALUE); + Req.Type = DhcpReqGetAdapterInfo; Req.AdapterIndex = AdapterIndex; - Result = CallNamedPipeW - ( DHCP_PIPE_NAME, &Req, sizeof(Req), &Reply, sizeof(Reply), - &BytesRead, DHCP_TIMEOUT ); + Result = TransactNamedPipe(PipeHandle, + &Req, sizeof(Req), + &Reply, sizeof(Reply), + &BytesRead, NULL); if ( 0 != Result && 0 != Reply.Reply ) { *DhcpEnabled = Reply.GetAdapterInfo.DhcpEnabled; diff --git a/dll/win32/dhcpcsvc/dhcpcsvc.rbuild b/dll/win32/dhcpcsvc/dhcpcsvc.rbuild index c2cc0a1e112..773c295b21c 100644 --- a/dll/win32/dhcpcsvc/dhcpcsvc.rbuild +++ b/dll/win32/dhcpcsvc/dhcpcsvc.rbuild @@ -2,8 +2,28 @@ include ntdll + msvcrt ws2_32 iphlpapi + advapi32 + oldnames + + adapter.c + alloc.c + api.c + compat.c + dhclient.c + dispatch.c + hash.c + options.c + pipe.c + socket.c + tables.c + util.c + + + rosdhcp.h + dhcpcsvc.c dhcpcsvc.rc diff --git a/dll/win32/dhcpcsvc/dhcpcsvc.spec b/dll/win32/dhcpcsvc/dhcpcsvc.spec index d97b6e7f2ac..b9f95712bb4 100644 --- a/dll/win32/dhcpcsvc/dhcpcsvc.spec +++ b/dll/win32/dhcpcsvc/dhcpcsvc.spec @@ -43,5 +43,4 @@ @ stub McastRenewAddress @ stub McastRequestAddress @ stdcall DhcpRosGetAdapterInfo(long ptr ptr ptr ptr) -# The Windows DHCP client service is implemented in the DLL too -#@ stub ServiceMain +@ stdcall ServiceMain(long ptr) diff --git a/base/services/dhcp/include/debug.h b/dll/win32/dhcpcsvc/include/debug.h similarity index 100% rename from base/services/dhcp/include/debug.h rename to dll/win32/dhcpcsvc/include/debug.h diff --git a/base/services/dhcp/include/dhcp.h b/dll/win32/dhcpcsvc/include/dhcp.h similarity index 100% rename from base/services/dhcp/include/dhcp.h rename to dll/win32/dhcpcsvc/include/dhcp.h diff --git a/base/services/dhcp/include/dhcpd.h b/dll/win32/dhcpcsvc/include/dhcpd.h similarity index 100% rename from base/services/dhcp/include/dhcpd.h rename to dll/win32/dhcpcsvc/include/dhcpd.h diff --git a/base/services/dhcp/include/hash.h b/dll/win32/dhcpcsvc/include/hash.h similarity index 100% rename from base/services/dhcp/include/hash.h rename to dll/win32/dhcpcsvc/include/hash.h diff --git a/base/services/dhcp/include/rosdhcp.h b/dll/win32/dhcpcsvc/include/rosdhcp.h similarity index 92% rename from base/services/dhcp/include/rosdhcp.h rename to dll/win32/dhcpcsvc/include/rosdhcp.h index 6b1dab6f0cc..48c67167f3e 100644 --- a/base/services/dhcp/include/rosdhcp.h +++ b/dll/win32/dhcpcsvc/include/rosdhcp.h @@ -8,11 +8,9 @@ #include #include #include -#include -#include -#include "stdint.h" -#include "predec.h" #include +#include +#include #include "debug.h" #define IFNAMSIZ MAX_INTERFACE_NAME_LEN #undef interface /* wine/objbase.h -- Grrr */ @@ -27,6 +25,10 @@ #define DHCP_DEFAULT_LEASE_TIME 43200 /* 12 hours */ #define _PATH_DHCLIENT_PID "\\systemroot\\system32\\drivers\\etc\\dhclient.pid" typedef void *VOIDPTR; +typedef unsigned char u_int8_t; +typedef unsigned short u_int16_t; +typedef unsigned int u_int32_t; +typedef char *caddr_t; #ifndef _SSIZE_T_DEFINED #define _SSIZE_T_DEFINED @@ -51,6 +53,9 @@ typedef u_int32_t uintTIME; typedef void (*handler_t) PROTO ((struct packet *)); +struct iaddr; +struct interface_info; + typedef struct _DHCP_ADAPTER { LIST_ENTRY ListEntry; MIB_IFROW IfMib; @@ -74,13 +79,14 @@ typedef DWORD (*PipeSendFunc)( COMM_DHCP_REPLY *Reply ); void AdapterInit(VOID); BOOLEAN AdapterDiscover(VOID); void AdapterStop(VOID); -HANDLE PipeInit(VOID); extern PDHCP_ADAPTER AdapterGetFirst(); extern PDHCP_ADAPTER AdapterGetNext(PDHCP_ADAPTER); extern PDHCP_ADAPTER AdapterFindIndex( unsigned int AdapterIndex ); extern PDHCP_ADAPTER AdapterFindInfo( struct interface_info *info ); extern PDHCP_ADAPTER AdapterFindByHardwareAddress( u_int8_t haddr[16], u_int8_t hlen ); +extern HANDLE PipeInit(); extern VOID ApiInit(); +extern VOID ApiFree(); extern VOID ApiLock(); extern VOID ApiUnlock(); extern DWORD DSQueryHWInfo( PipeSendFunc Send, COMM_DHCP_REQ *Req ); diff --git a/base/services/dhcp/include/tree.h b/dll/win32/dhcpcsvc/include/tree.h similarity index 100% rename from base/services/dhcp/include/tree.h rename to dll/win32/dhcpcsvc/include/tree.h diff --git a/dll/win32/gdi32/include/gdi32p.h b/dll/win32/gdi32/include/gdi32p.h index f45a0ddd171..5cc09870a94 100644 --- a/dll/win32/gdi32/include/gdi32p.h +++ b/dll/win32/gdi32/include/gdi32p.h @@ -292,4 +292,91 @@ int FASTCALL DocumentEventEx(PVOID,HANDLE,HDC,int,ULONG,PVOID,ULONG,PVOID); BOOL FASTCALL EndPagePrinterEx(PVOID,HANDLE); BOOL FASTCALL LoadTheSpoolerDrv(VOID); + +FORCEINLINE +PVOID +GdiAllocBatchCommand( + HDC hdc, + USHORT Cmd) +{ + PTEB pTeb; + ULONG ulSize; + PGDIBATCHHDR pHdr; + + /* Get a pointer to the TEB */ + pTeb = NtCurrentTeb(); + + /* Check if we have a valid environment */ + if (!pTeb || !pTeb->Win32ThreadInfo) return NULL; + + /* Do we use a DC? */ + if (hdc) + { + /* If the batch DC is NULL, we set this one as the new one */ + if (!pTeb->GdiTebBatch.HDC) pTeb->GdiTebBatch.HDC = hdc; + + /* If not, check if the batch DC equal to our DC */ + else if (pTeb->GdiTebBatch.HDC != hdc) return NULL; + } + + /* Get the size of the entry */ + switch(Cmd) + { + case GdiBCPatBlt: + ulSize = 0; + break; + case GdiBCPolyPatBlt: + ulSize = 0; + break; + case GdiBCTextOut: + ulSize = 0; + break; + case GdiBCExtTextOut: + ulSize = 0; + break; + case GdiBCSetBrushOrg: + ulSize = 0; + break; + case GdiBCExtSelClipRgn: + ulSize = 0; + break; + case GdiBCSelObj: + ulSize = sizeof(GDIBSOBJECT); + break; + case GdiBCDelRgn: + ulSize = sizeof(GDIBSOBJECT); + break; + case GdiBCDelObj: + ulSize = sizeof(GDIBSOBJECT); + break; + default: + return NULL; + } + + /* Unsupported operation */ + if (ulSize == 0) return NULL; + + /* Check if the buffer is full */ + if ((pTeb->GdiBatchCount >= GDI_BatchLimit) || + ((pTeb->GdiTebBatch.Offset + ulSize) > GDIBATCHBUFSIZE)) + { + /* Call win32k, the kernel will call NtGdiFlushUserBatch to flush + the current batch */ + NtGdiFlush(); + } + + /* Get the head of the entry */ + pHdr = (PVOID)((PUCHAR)pTeb->GdiTebBatch.Buffer + pTeb->GdiTebBatch.Offset); + + /* Update Offset and batch count */ + pTeb->GdiTebBatch.Offset += ulSize; + pTeb->GdiBatchCount++; + + /* Fill in the core fields */ + pHdr->Cmd = Cmd; + pHdr->Size = ulSize; + + return pHdr; +} + /* EOF */ diff --git a/dll/win32/gdi32/objects/dc.c b/dll/win32/gdi32/objects/dc.c index 34c31148bb3..ddc33e501f1 100644 --- a/dll/win32/gdi32/objects/dc.c +++ b/dll/win32/gdi32/objects/dc.c @@ -1540,7 +1540,6 @@ SelectObject(HDC hDC, PDC_ATTR pDc_Attr; HGDIOBJ hOldObj = NULL; UINT uType; - PTEB pTeb; if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) { @@ -1582,27 +1581,23 @@ SelectObject(HDC hDC, case GDI_OBJECT_TYPE_FONT: hOldObj = pDc_Attr->hlfntNew; if (hOldObj == hGdiObj) return hOldObj; + pDc_Attr->ulDirty_ &= ~SLOW_WIDTHS; pDc_Attr->ulDirty_ |= DIRTY_CHARSET; pDc_Attr->hlfntNew = hGdiObj; - pTeb = NtCurrentTeb(); - if (((pTeb->GdiTebBatch.HDC == 0) || - (pTeb->GdiTebBatch.HDC == hDC)) && - ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSOBJECT)) <= GDIBATCHBUFSIZE) && - (!(pDc_Attr->ulDirty_ & DC_DIBSECTION))) - { - PGDIBSOBJECT pgO = (PGDIBSOBJECT)(&pTeb->GdiTebBatch.Buffer[0] + - pTeb->GdiTebBatch.Offset); - pgO->gbHdr.Cmd = GdiBCSelObj; - pgO->gbHdr.Size = sizeof(GDIBSOBJECT); - pgO->hgdiobj = hGdiObj; - pTeb->GdiTebBatch.Offset += sizeof(GDIBSOBJECT); - pTeb->GdiTebBatch.HDC = hDC; - pTeb->GdiBatchCount++; - if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush(); - return hOldObj; + if (!(pDc_Attr->ulDirty_ & DC_DIBSECTION)) + { + PGDIBSOBJECT pgO; + + pgO = GdiAllocBatchCommand(hDC, GdiBCSelObj); + if (pgO) + { + pgO->hgdiobj = hGdiObj; + return hOldObj; + } } + // default for select object font return NtGdiSelectFont(hDC, hGdiObj); diff --git a/dll/win32/gdi32/objects/region.c b/dll/win32/gdi32/objects/region.c index 3e2b7fe5b65..eb6395363e4 100644 --- a/dll/win32/gdi32/objects/region.c +++ b/dll/win32/gdi32/objects/region.c @@ -104,29 +104,22 @@ BOOL FASTCALL DeleteRegion( HRGN hRgn ) { +#if 0 PRGN_ATTR Rgn_Attr; if ((GdiGetHandleUserData((HGDIOBJ) hRgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) && ( Rgn_Attr != NULL )) { - PTEB pTeb = NtCurrentTeb(); - if (pTeb->Win32ThreadInfo != NULL) - { - if ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSOBJECT)) <= GDIBATCHBUFSIZE) - { - PGDIBSOBJECT pgO = (PGDIBSOBJECT)(&pTeb->GdiTebBatch.Buffer[0] + - pTeb->GdiTebBatch.Offset); - pgO->gbHdr.Cmd = GdiBCDelRgn; - pgO->gbHdr.Size = sizeof(GDIBSOBJECT); - pgO->hgdiobj = (HGDIOBJ)hRgn; - - pTeb->GdiTebBatch.Offset += sizeof(GDIBSOBJECT); - pTeb->GdiBatchCount++; - if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush(); - return TRUE; - } - } + PGDIBSOBJECT pgO; + + pgO = GdiAllocBatchCommand(NULL, GdiBCDelRgn); + if (pgO) + { + pgO->hgdiobj = (HGDIOBJ)hRgn; + return TRUE; + } } +#endif return NtGdiDeleteObjectApp((HGDIOBJ) hRgn); } @@ -208,6 +201,9 @@ CombineRgn(HRGN hDest, INT Complexity; BOOL Ret; +// HACK +return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); + Ret = GdiGetHandleUserData((HGDIOBJ) hDest, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr_Dest); Ret = GdiGetHandleUserData((HGDIOBJ) hSrc1, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr_Src1); @@ -445,6 +441,11 @@ CreateRectRgn(int x1, int y1, int x2, int y2) HRGN hrgn; int tmp; +/// <- +//// Remove when Brush/Pen/Rgn Attr is ready! + return NtGdiCreateRectRgn(x1,y1,x2,y2); +//// + /* Normalize points */ tmp = x1; if ( x1 > x2 ) @@ -595,7 +596,7 @@ ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode) { if (pLDC->iType != LDC_EMFLDC || EMFDRV_ExtSelectClipRgn( hdc, )) return NtGdiExtSelectClipRgn(hdc, ); - } +} else SetLastError(ERROR_INVALID_HANDLE); return ERROR; @@ -743,7 +744,7 @@ GetRgnBox(HRGN hrgn, { PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + //if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) return NtGdiGetRgnBox(hrgn, prcOut); if (Rgn_Attr->Flags == NULLREGION) @@ -854,7 +855,8 @@ OffsetRgn( HRGN hrgn, PRGN_ATTR pRgn_Attr; int nLeftRect, nTopRect, nRightRect, nBottomRect; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) +// HACKFIX +// if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset); if ( pRgn_Attr->Flags == NULLREGION) @@ -907,7 +909,8 @@ PtInRegion(IN HRGN hrgn, { PRGN_ATTR pRgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + // HACKFIX + //if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) return NtGdiPtInRegion(hrgn,x,y); if ( pRgn_Attr->Flags == NULLREGION) @@ -930,7 +933,8 @@ RectInRegion(HRGN hrgn, PRGN_ATTR pRgn_Attr; RECTL rc; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) + // HACKFIX + //if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &pRgn_Attr)) return NtGdiRectInRegion(hrgn, (LPRECT) prcl); if ( pRgn_Attr->Flags == NULLREGION) @@ -993,7 +997,7 @@ SetRectRgn(HRGN hrgn, { PRGN_ATTR Rgn_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) + //if (!GdiGetHandleUserData((HGDIOBJ) hrgn, GDI_OBJECT_TYPE_REGION, (PVOID) &Rgn_Attr)) return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect); if ((nLeftRect == nRightRect) || (nTopRect == nBottomRect)) diff --git a/dll/win32/gdiplus/brush.c b/dll/win32/gdiplus/brush.c index 2d28004c95d..67be6b49836 100644 --- a/dll/win32/gdiplus/brush.c +++ b/dll/win32/gdiplus/brush.c @@ -1194,6 +1194,16 @@ GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient return NotImplemented; } +GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient *brush, INT *count) +{ + TRACE("(%p, %p)\n", brush, count); + + if (!brush || !count) + return InvalidParameter; + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient *brush, GpWrapMode *wrapmode) { @@ -1559,7 +1569,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient *grad, } GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient - *grad, ARGB *argb, INT *count) + *grad, GDIPCONST ARGB *argb, INT *count) { static int calls; diff --git a/dll/win32/gdiplus/font.c b/dll/win32/gdiplus/font.c index fda5428a7dd..3a29771c710 100644 --- a/dll/win32/gdiplus/font.c +++ b/dll/win32/gdiplus/font.c @@ -489,6 +489,7 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, switch (font->unit) { case UnitPixel: + case UnitWorld: *height = font_height; break; case UnitPoint: @@ -520,7 +521,7 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, static INT CALLBACK is_font_installed_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm, DWORD type, LPARAM lParam) { - if (!ntm) + if (!ntm || type == RASTER_FONTTYPE) { return 1; } @@ -642,12 +643,14 @@ GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily* FontFamily, GpFontFamily** GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR *name, LANGID language) { + static int lang_fixme; + if (family == NULL) return InvalidParameter; TRACE("%p, %p, %d\n", family, name, language); - if (language != LANG_NEUTRAL) + if (language != LANG_NEUTRAL && !lang_fixme++) FIXME("No support for handling of multiple languages!\n"); lstrcpynW (name, family->FamilyName, LF_FACESIZE); @@ -826,15 +829,21 @@ GpStatus WINGDIPAPI GdipGetGenericFontFamilySerif(GpFontFamily **nativeFamily) */ GpStatus WINGDIPAPI GdipGetGenericFontFamilySansSerif(GpFontFamily **nativeFamily) { - /* FIXME: On Windows this is called Microsoft Sans Serif, this shouldn't - * affect anything */ - static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; + GpStatus stat; + static const WCHAR MicrosoftSansSerif[] = {'M','i','c','r','o','s','o','f','t',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; + static const WCHAR Tahoma[] = {'T','a','h','o','m','a','\0'}; TRACE("(%p)\n", nativeFamily); if (nativeFamily == NULL) return InvalidParameter; - return GdipCreateFontFamilyFromName(MSSansSerif, NULL, nativeFamily); + stat = GdipCreateFontFamilyFromName(MicrosoftSansSerif, NULL, nativeFamily); + + if (stat == FontFamilyNotFound) + /* FIXME: Microsoft Sans Serif is not installed on Wine. */ + stat = GdipCreateFontFamilyFromName(Tahoma, NULL, nativeFamily); + + return stat; } /***************************************************************************** @@ -957,6 +966,9 @@ static INT CALLBACK add_font_proc(const LOGFONTW *lfw, const TEXTMETRICW *ntm, GpFontCollection* fonts = (GpFontCollection*)lParam; int i; + if (type == RASTER_FONTTYPE) + return 1; + /* skip duplicates */ for (i=0; icount; i++) if (strcmpiW(lfw->lfFaceName, fonts->FontFamilies[i]->FamilyName) == 0) diff --git a/dll/win32/gdiplus/gdiplus.spec b/dll/win32/gdiplus/gdiplus.spec index e6cea5ad443..14e7fbff4a8 100644 --- a/dll/win32/gdiplus/gdiplus.spec +++ b/dll/win32/gdiplus/gdiplus.spec @@ -338,7 +338,7 @@ @ stub GdipGetPathGradientPresetBlendCount @ stdcall GdipGetPathGradientRect(ptr ptr) @ stdcall GdipGetPathGradientRectI(ptr ptr) -@ stub GdipGetPathGradientSurroundColorCount +@ stdcall GdipGetPathGradientSurroundColorCount(ptr ptr) @ stdcall GdipGetPathGradientSurroundColorsWithCount(ptr ptr ptr) @ stub GdipGetPathGradientTransform @ stdcall GdipGetPathGradientWrapMode(ptr ptr) diff --git a/dll/win32/gdiplus/gdiplus_private.h b/dll/win32/gdiplus/gdiplus_private.h index ca1cba6175c..5ff71255b9d 100644 --- a/dll/win32/gdiplus/gdiplus_private.h +++ b/dll/win32/gdiplus/gdiplus_private.h @@ -78,6 +78,29 @@ static inline REAL deg2rad(REAL degrees) return M_PI * degrees / 180.0; } +static inline ARGB color_over(ARGB bg, ARGB fg) +{ + BYTE b, g, r, a; + BYTE bg_alpha, fg_alpha; + + fg_alpha = (fg>>24)&0xff; + + if (fg_alpha == 0xff) return fg; + + if (fg_alpha == 0) return bg; + + bg_alpha = (((bg>>24)&0xff) * (0xff-fg_alpha)) / 0xff; + + if (bg_alpha == 0) return fg; + + a = bg_alpha + fg_alpha; + b = ((bg&0xff)*bg_alpha + (fg&0xff)*fg_alpha)*0xff/a; + g = (((bg>>8)&0xff)*bg_alpha + ((fg>>8)&0xff)*fg_alpha)*0xff/a; + r = (((bg>>16)&0xff)*bg_alpha + ((fg>>16)&0xff)*fg_alpha)*0xff/a; + + return (a<<24)|(r<<16)|(g<<8)|b; +} + extern const char *debugstr_rectf(CONST RectF* rc); extern const char *debugstr_pointf(CONST PointF* pt); @@ -112,6 +135,7 @@ struct GpGraphics{ HDC hdc; HWND hwnd; BOOL owndc; + GpImage *image; SmoothingMode smoothing; CompositingQuality compqual; InterpolationMode interpolation; diff --git a/dll/win32/gdiplus/graphics.c b/dll/win32/gdiplus/graphics.c index 1fd870e3d42..7a6fad301c9 100644 --- a/dll/win32/gdiplus/graphics.c +++ b/dll/win32/gdiplus/graphics.c @@ -173,6 +173,74 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti, } } +/* Draw non-premultiplied ARGB data to the given graphics object */ +static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y, + const BYTE *src, INT src_width, INT src_height, INT src_stride) +{ + if (graphics->image && graphics->image->type == ImageTypeBitmap) + { + GpBitmap *dst_bitmap = (GpBitmap*)graphics->image; + INT x, y; + + for (x=0; xhdc, dst_x, dst_y, src_width, src_height, + hdc, 0, 0, src_width, src_height, bf); + + SelectObject(hdc, old_hbm); + DeleteDC(hdc); + DeleteObject(hbitmap); + + return Ok; + } +} + static ARGB blend_colors(ARGB start, ARGB end, REAL position) { ARGB result=0; @@ -1273,10 +1341,10 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, (*metafile)->bounds.X = ((REAL) placeable->BoundingBox.Left) / ((REAL) placeable->Inch); (*metafile)->bounds.Y = ((REAL) placeable->BoundingBox.Top) / ((REAL) placeable->Inch); (*metafile)->bounds.Width = ((REAL) (placeable->BoundingBox.Right - - placeable->BoundingBox.Left)) / ((REAL) placeable->Inch); + - placeable->BoundingBox.Left)); (*metafile)->bounds.Height = ((REAL) (placeable->BoundingBox.Bottom - - placeable->BoundingBox.Top)) / ((REAL) placeable->Inch); - (*metafile)->unit = UnitInch; + - placeable->BoundingBox.Top)); + (*metafile)->unit = UnitPixel; if(delete) DeleteMetaFile(hwmf); @@ -1866,15 +1934,15 @@ GpStatus WINGDIPAPI GdipDrawImagePointsI(GpGraphics *graphics, GpImage *image, return NotImplemented; } -/* FIXME: partially implemented (only works for rectangular parallelograms) */ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image, GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes, DrawImageAbort callback, VOID * callbackData) { - GpPointF ptf[3]; - POINT pti[3]; + GpPointF ptf[4]; + POINT pti[4]; REAL dx, dy; + GpStatus stat; TRACE("(%p, %p, %p, %d, %f, %f, %f, %f, %d, %p, %p, %p)\n", graphics, image, points, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, @@ -1887,10 +1955,13 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image debugstr_pointf(&points[2])); memcpy(ptf, points, 3 * sizeof(GpPointF)); - transform_and_round_points(graphics, pti, ptf, 3); + ptf[3].X = ptf[2].X + ptf[1].X - ptf[0].X; + ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; + transform_and_round_points(graphics, pti, ptf, 4); if (image->picture) { + /* FIXME: partially implemented (only works for rectangular parallelograms) */ if(srcUnit == UnitInch) dx = dy = (REAL) INCH_HIMETRIC; else if(srcUnit == UnitPixel){ @@ -1914,10 +1985,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image } else if (image->type == ImageTypeBitmap && ((GpBitmap*)image)->hbitmap) { - HDC hdc; GpBitmap* bitmap = (GpBitmap*)image; - int temp_hdc=0, temp_bitmap=0; - HBITMAP hbitmap, old_hbm=NULL; + int use_software=0; if (srcUnit == UnitInch) dx = dy = 96.0; /* FIXME: use the image resolution */ @@ -1926,83 +1995,233 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image else return NotImplemented; - if (!(bitmap->format == PixelFormat16bppRGB555 || - bitmap->format == PixelFormat24bppRGB || - bitmap->format == PixelFormat32bppRGB || - bitmap->format == PixelFormat32bppPARGB)) + if (imageAttributes || + (graphics->image && graphics->image->type == ImageTypeBitmap) || + ptf[1].Y != ptf[0].Y || ptf[2].X != ptf[0].X) + use_software = 1; + + if (use_software) { - BITMAPINFOHEADER bih; - BYTE *temp_bits; - PixelFormat dst_format; + RECT src_area, dst_area; + int i, x, y, stride; + GpMatrix *dst_to_src; + REAL m11, m12, m21, m22, mdx, mdy; + LPBYTE data; - /* we can't draw a bitmap of this format directly */ - hdc = CreateCompatibleDC(0); - temp_hdc = 1; - temp_bitmap = 1; + src_area.left = srcx*dx; + src_area.top = srcy*dy; + src_area.right = (srcx+srcwidth)*dx; + src_area.bottom = (srcy+srcheight)*dy; - bih.biSize = sizeof(BITMAPINFOHEADER); - bih.biWidth = bitmap->width; - bih.biHeight = -bitmap->height; - bih.biPlanes = 1; - bih.biBitCount = 32; - bih.biCompression = BI_RGB; - bih.biSizeImage = 0; - bih.biXPelsPerMeter = 0; - bih.biYPelsPerMeter = 0; - bih.biClrUsed = 0; - bih.biClrImportant = 0; + dst_area.left = dst_area.right = pti[0].x; + dst_area.top = dst_area.bottom = pti[0].y; + for (i=1; i<4; i++) + { + if (dst_area.left > pti[i].x) dst_area.left = pti[i].x; + if (dst_area.right < pti[i].x) dst_area.right = pti[i].x; + if (dst_area.top > pti[i].y) dst_area.top = pti[i].y; + if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y; + } - hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, - (void**)&temp_bits, NULL, 0); + m11 = (ptf[1].X - ptf[0].X) / srcwidth; + m21 = (ptf[2].X - ptf[0].X) / srcheight; + mdx = ptf[0].X - m11 * srcx - m21 * srcy; + m12 = (ptf[1].Y - ptf[0].Y) / srcwidth; + m22 = (ptf[2].Y - ptf[0].Y) / srcheight; + mdy = ptf[0].Y - m12 * srcx - m22 * srcy; + + stat = GdipCreateMatrix2(m11, m12, m21, m22, mdx, mdy, &dst_to_src); + if (stat != Ok) return stat; + + stat = GdipInvertMatrix(dst_to_src); + if (stat != Ok) + { + GdipDeleteMatrix(dst_to_src); + return stat; + } + + data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); + if (!data) + { + GdipDeleteMatrix(dst_to_src); + return OutOfMemory; + } + + stride = sizeof(ARGB) * (dst_area.right - dst_area.left); + + for (x=dst_area.left; x= src_area.right || + src_y < src_area.top || src_y >= src_area.bottom) + /* FIXME: Use wrapmode */ + *src_color = 0; + else + GdipBitmapGetPixel(bitmap, src_x, src_y, src_color); + } + } + + GdipDeleteMatrix(dst_to_src); + + if (imageAttributes) + { + if (imageAttributes->colorkeys[ColorAdjustTypeBitmap].enabled || + imageAttributes->colorkeys[ColorAdjustTypeDefault].enabled) + { + static int fixme; + if (!fixme++) + FIXME("Color keying not implemented\n"); + } + + if (imageAttributes->colorremaptables[ColorAdjustTypeBitmap].enabled || + imageAttributes->colorremaptables[ColorAdjustTypeDefault].enabled) + { + const struct color_remap_table *table; + + if (imageAttributes->colorremaptables[ColorAdjustTypeBitmap].enabled) + table = &imageAttributes->colorremaptables[ColorAdjustTypeBitmap]; + else + table = &imageAttributes->colorremaptables[ColorAdjustTypeDefault]; + + for (x=dst_area.left; xmapsize; i++) + { + if (*src_color == table->colormap[i].oldColor.Argb) + { + *src_color = table->colormap[i].newColor.Argb; + break; + } + } + } + } + + if (imageAttributes->colormatrices[ColorAdjustTypeBitmap].enabled || + imageAttributes->colormatrices[ColorAdjustTypeDefault].enabled) + { + static int fixme; + if (!fixme++) + FIXME("Color transforms not implemented\n"); + } + + if (imageAttributes->gamma_enabled[ColorAdjustTypeBitmap] || + imageAttributes->gamma_enabled[ColorAdjustTypeDefault]) + { + static int fixme; + if (!fixme++) + FIXME("Gamma adjustment not implemented\n"); + } + } + + stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top, + data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, stride); + + GdipFree(data); + + return stat; + } + else + { + HDC hdc; + int temp_hdc=0, temp_bitmap=0; + HBITMAP hbitmap, old_hbm=NULL; + + if (!(bitmap->format == PixelFormat16bppRGB555 || + bitmap->format == PixelFormat24bppRGB || + bitmap->format == PixelFormat32bppRGB || + bitmap->format == PixelFormat32bppPARGB)) + { + BITMAPINFOHEADER bih; + BYTE *temp_bits; + PixelFormat dst_format; + + /* we can't draw a bitmap of this format directly */ + hdc = CreateCompatibleDC(0); + temp_hdc = 1; + temp_bitmap = 1; + + bih.biSize = sizeof(BITMAPINFOHEADER); + bih.biWidth = bitmap->width; + bih.biHeight = -bitmap->height; + bih.biPlanes = 1; + bih.biBitCount = 32; + bih.biCompression = BI_RGB; + bih.biSizeImage = 0; + bih.biXPelsPerMeter = 0; + bih.biYPelsPerMeter = 0; + bih.biClrUsed = 0; + bih.biClrImportant = 0; + + hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bih, DIB_RGB_COLORS, + (void**)&temp_bits, NULL, 0); + + if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) + dst_format = PixelFormat32bppPARGB; + else + dst_format = PixelFormat32bppRGB; + + convert_pixels(bitmap->width, bitmap->height, + bitmap->width*4, temp_bits, dst_format, + bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette_entries); + } + else + { + hbitmap = bitmap->hbitmap; + hdc = bitmap->hdc; + temp_hdc = (hdc == 0); + } + + if (temp_hdc) + { + if (!hdc) hdc = CreateCompatibleDC(0); + old_hbm = SelectObject(hdc, hbitmap); + } if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) - dst_format = PixelFormat32bppPARGB; + { + BLENDFUNCTION bf; + + bf.BlendOp = AC_SRC_OVER; + bf.BlendFlags = 0; + bf.SourceConstantAlpha = 255; + bf.AlphaFormat = AC_SRC_ALPHA; + + GdiAlphaBlend(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y, + hdc, srcx*dx, srcy*dy, srcwidth*dx, srcheight*dy, bf); + } else - dst_format = PixelFormat32bppRGB; + { + StretchBlt(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y, + hdc, srcx*dx, srcy*dy, srcwidth*dx, srcheight*dy, SRCCOPY); + } - convert_pixels(bitmap->width, bitmap->height, - bitmap->width*4, temp_bits, dst_format, - bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette_entries); + if (temp_hdc) + { + SelectObject(hdc, old_hbm); + DeleteDC(hdc); + } + + if (temp_bitmap) + DeleteObject(hbitmap); } - else - { - hbitmap = bitmap->hbitmap; - hdc = bitmap->hdc; - temp_hdc = (hdc == 0); - } - - if (temp_hdc) - { - if (!hdc) hdc = CreateCompatibleDC(0); - old_hbm = SelectObject(hdc, hbitmap); - } - - if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) - { - BLENDFUNCTION bf; - - bf.BlendOp = AC_SRC_OVER; - bf.BlendFlags = 0; - bf.SourceConstantAlpha = 255; - bf.AlphaFormat = AC_SRC_ALPHA; - - GdiAlphaBlend(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y, - hdc, srcx*dx, srcy*dy, srcwidth*dx, srcheight*dy, bf); - } - else - { - StretchBlt(graphics->hdc, pti[0].x, pti[0].y, pti[1].x-pti[0].x, pti[2].y-pti[0].y, - hdc, srcx*dx, srcy*dy, srcwidth*dx, srcheight*dy, SRCCOPY); - } - - if (temp_hdc) - { - SelectObject(hdc, old_hbm); - DeleteDC(hdc); - } - - if (temp_bitmap) - DeleteObject(hbitmap); } else { @@ -2403,208 +2622,6 @@ GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics *graphics, GpPen *pen, return ret; } -GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string, - INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, - GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush) -{ - HRGN rgn = NULL; - HFONT gdifont; - LOGFONTW lfw; - TEXTMETRICW textmet; - GpPointF pt[3], rectcpy[4]; - POINT corners[4]; - WCHAR* stringdup; - REAL angle, ang_cos, ang_sin, rel_width, rel_height; - INT sum = 0, height = 0, offsety = 0, fit, fitcpy, save_state, i, j, lret, nwidth, - nheight, lineend; - SIZE size; - POINT drawbase; - UINT drawflags; - RECT drawcoord; - - TRACE("(%p, %s, %i, %p, %s, %p, %p)\n", graphics, debugstr_wn(string, length), - length, font, debugstr_rectf(rect), format, brush); - - if(!graphics || !string || !font || !brush || !rect) - return InvalidParameter; - - if((brush->bt != BrushTypeSolidColor)){ - FIXME("not implemented for given parameters\n"); - return NotImplemented; - } - - if(format){ - TRACE("may be ignoring some format flags: attr %x\n", format->attr); - - /* Should be no need to explicitly test for StringAlignmentNear as - * that is default behavior if no alignment is passed. */ - if(format->vertalign != StringAlignmentNear){ - RectF bounds; - GdipMeasureString(graphics, string, length, font, rect, format, &bounds, 0, 0); - - if(format->vertalign == StringAlignmentCenter) - offsety = (rect->Height - bounds.Height) / 2; - else if(format->vertalign == StringAlignmentFar) - offsety = (rect->Height - bounds.Height); - } - } - - if(length == -1) length = lstrlenW(string); - - stringdup = GdipAlloc(length * sizeof(WCHAR)); - if(!stringdup) return OutOfMemory; - - save_state = SaveDC(graphics->hdc); - SetBkMode(graphics->hdc, TRANSPARENT); - SetTextColor(graphics->hdc, brush->lb.lbColor); - - pt[0].X = 0.0; - pt[0].Y = 0.0; - pt[1].X = 1.0; - pt[1].Y = 0.0; - pt[2].X = 0.0; - pt[2].Y = 1.0; - GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); - angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); - ang_cos = cos(angle); - ang_sin = sin(angle); - rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ - (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); - rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ - (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X)); - - rectcpy[3].X = rectcpy[0].X = rect->X; - rectcpy[1].Y = rectcpy[0].Y = rect->Y + offsety; - rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width; - rectcpy[3].Y = rectcpy[2].Y = rect->Y + offsety + rect->Height; - transform_and_round_points(graphics, corners, rectcpy, 4); - - if (roundr(rect->Width) == 0) - nwidth = INT_MAX; - else - nwidth = roundr(rel_width * rect->Width); - - if (roundr(rect->Height) == 0) - nheight = INT_MAX; - else - nheight = roundr(rel_height * rect->Height); - - if (roundr(rect->Width) != 0 && roundr(rect->Height) != 0) - { - /* FIXME: If only the width or only the height is 0, we should probably still clip */ - rgn = CreatePolygonRgn(corners, 4, ALTERNATE); - SelectClipRgn(graphics->hdc, rgn); - } - - /* Use gdi to find the font, then perform transformations on it (height, - * width, angle). */ - SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); - GetTextMetricsW(graphics->hdc, &textmet); - lfw = font->lfw; - - lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height); - lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width); - - lfw.lfEscapement = lfw.lfOrientation = roundr((angle / M_PI) * 1800.0); - - gdifont = CreateFontIndirectW(&lfw); - DeleteObject(SelectObject(graphics->hdc, CreateFontIndirectW(&lfw))); - - for(i = 0, j = 0; i < length; i++){ - if(!isprintW(string[i]) && (string[i] != '\n')) - continue; - - stringdup[j] = string[i]; - j++; - } - - length = j; - - if (!format || format->align == StringAlignmentNear) - { - drawbase.x = corners[0].x; - drawbase.y = corners[0].y; - drawflags = DT_NOCLIP | DT_EXPANDTABS; - } - else if (format->align == StringAlignmentCenter) - { - drawbase.x = (corners[0].x + corners[1].x)/2; - drawbase.y = (corners[0].y + corners[1].y)/2; - drawflags = DT_NOCLIP | DT_EXPANDTABS | DT_CENTER; - } - else /* (format->align == StringAlignmentFar) */ - { - drawbase.x = corners[1].x; - drawbase.y = corners[1].y; - drawflags = DT_NOCLIP | DT_EXPANDTABS | DT_RIGHT; - } - - while(sum < length){ - drawcoord.left = drawcoord.right = drawbase.x + roundr(ang_sin * (REAL) height); - drawcoord.top = drawcoord.bottom = drawbase.y + roundr(ang_cos * (REAL) height); - - GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum, - nwidth, &fit, NULL, &size); - fitcpy = fit; - - if(fit == 0){ - DrawTextW(graphics->hdc, stringdup + sum, 1, &drawcoord, drawflags); - break; - } - - for(lret = 0; lret < fit; lret++) - if(*(stringdup + sum + lret) == '\n') - break; - - /* Line break code (may look strange, but it imitates windows). */ - if(lret < fit) - lineend = fit = lret; /* this is not an off-by-one error */ - else if(fit < (length - sum)){ - if(*(stringdup + sum + fit) == ' ') - while(*(stringdup + sum + fit) == ' ') - fit++; - else - while(*(stringdup + sum + fit - 1) != ' '){ - fit--; - - if(*(stringdup + sum + fit) == '\t') - break; - - if(fit == 0){ - fit = fitcpy; - break; - } - } - lineend = fit; - while(*(stringdup + sum + lineend - 1) == ' ' || - *(stringdup + sum + lineend - 1) == '\t') - lineend--; - } - else - lineend = fit; - DrawTextW(graphics->hdc, stringdup + sum, min(length - sum, lineend), - &drawcoord, drawflags); - - sum += fit + (lret < fitcpy ? 1 : 0); - height += size.cy; - - if(height > nheight) - break; - - /* Stop if this was a linewrap (but not if it was a linebreak). */ - if((lret == fitcpy) && format && (format->attr & StringFormatFlagsNoWrap)) - break; - } - - GdipFree(stringdup); - DeleteObject(rgn); - DeleteObject(gdifont); - - RestoreDC(graphics->hdc, save_state); - - return Ok; -} - GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill) { @@ -3074,8 +3091,6 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush, GpStatus WINGDIPAPI GdipFlush(GpGraphics *graphics, GpFlushIntention intention) { - static int calls; - TRACE("(%p,%u)\n", graphics, intention); if(!graphics) @@ -3084,10 +3099,12 @@ GpStatus WINGDIPAPI GdipFlush(GpGraphics *graphics, GpFlushIntention intention) if(graphics->busy) return ObjectBusy; - if(!(calls++)) - FIXME("not implemented\n"); + /* We have no internal operation queue, so there's no need to clear it. */ - return NotImplemented; + if (graphics->hdc) + GdiFlush(); + + return Ok; } /***************************************************************************** @@ -3465,61 +3482,37 @@ GpStatus WINGDIPAPI GdipIsVisibleRectI(GpGraphics *graphics, INT x, INT y, INT w return GdipIsVisibleRect(graphics, (REAL)x, (REAL)y, (REAL)width, (REAL)height, result); } -GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, - GDIPCONST WCHAR* string, INT length, GDIPCONST GpFont* font, - GDIPCONST RectF* layoutRect, GDIPCONST GpStringFormat *stringFormat, - INT regionCount, GpRegion** regions) -{ - FIXME("stub: %p %s %d %p %p %p %d %p\n", graphics, debugstr_w(string), - length, font, layoutRect, stringFormat, regionCount, regions); +typedef GpStatus (*gdip_format_string_callback)(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, + INT lineno, const RectF *bounds, void *user_data); - if (!(graphics && string && font && layoutRect && stringFormat && regions)) - return InvalidParameter; - - return NotImplemented; -} - -/* Find the smallest rectangle that bounds the text when it is printed in rect - * according to the format options listed in format. If rect has 0 width and - * height, then just find the smallest rectangle that bounds the text when it's - * printed at location (rect->X, rect-Y). */ -GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, +static GpStatus gdip_format_string(GpGraphics *graphics, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, - GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, RectF *bounds, - INT *codepointsfitted, INT *linesfilled) + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, + gdip_format_string_callback callback, void *user_data) { - HFONT oldfont; WCHAR* stringdup; - INT sum = 0, height = 0, fit, fitcpy, max_width = 0, i, j, lret, nwidth, - nheight, lineend; + INT sum = 0, height = 0, fit, fitcpy, i, j, lret, nwidth, + nheight, lineend, lineno = 0; + RectF bounds; + StringAlignment halign; + GpStatus stat = Ok; SIZE size; - TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics, - debugstr_wn(string, length), length, font, debugstr_rectf(rect), format, - bounds, codepointsfitted, linesfilled); - - if(!graphics || !string || !font || !rect) - return InvalidParameter; - - if(linesfilled) *linesfilled = 0; - if(codepointsfitted) *codepointsfitted = 0; - - if(format) - TRACE("may be ignoring some format flags: attr %x\n", format->attr); - if(length == -1) length = lstrlenW(string); stringdup = GdipAlloc((length + 1) * sizeof(WCHAR)); if(!stringdup) return OutOfMemory; - oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); nwidth = roundr(rect->Width); nheight = roundr(rect->Height); - if((nwidth == 0) && (nheight == 0)) - nwidth = nheight = INT_MAX; + if (nwidth == 0) nwidth = INT_MAX; + if (nheight == 0) nheight = INT_MAX; for(i = 0, j = 0; i < length; i++){ + /* FIXME: This makes the indexes passed to callback inaccurate. */ if(!isprintW(string[i]) && (string[i] != '\n')) continue; @@ -3527,9 +3520,11 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, j++; } - stringdup[j] = 0; length = j; + if (format) halign = format->align; + else halign = StringAlignmentNear; + while(sum < length){ GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum, nwidth, &fit, NULL, &size); @@ -3572,12 +3567,38 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, GetTextExtentExPointW(graphics->hdc, stringdup + sum, lineend, nwidth, &j, NULL, &size); - sum += fit + (lret < fitcpy ? 1 : 0); - if(codepointsfitted) *codepointsfitted = sum; + bounds.Width = size.cx; + if(height + size.cy > nheight) + bounds.Height = nheight - (height + size.cy); + else + bounds.Height = size.cy; + + bounds.Y = rect->Y + height; + + switch (halign) + { + case StringAlignmentNear: + default: + bounds.X = rect->X; + break; + case StringAlignmentCenter: + bounds.X = rect->X + (rect->Width/2) - (bounds.Width/2); + break; + case StringAlignmentFar: + bounds.X = rect->X + rect->Width - bounds.Width; + break; + } + + stat = callback(graphics, stringdup, sum, lineend, + font, rect, format, lineno, &bounds, user_data); + + if (stat != Ok) + break; + + sum += fit + (lret < fitcpy ? 1 : 0); height += size.cy; - if(linesfilled) *linesfilled += size.cy; - max_width = max(max_width, size.cx); + lineno++; if(height > nheight) break; @@ -3587,17 +3608,311 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, break; } + GdipFree(stringdup); + + return stat; +} + +struct measure_ranges_args { + GpRegion **regions; +}; + +GpStatus measure_ranges_callback(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, + INT lineno, const RectF *bounds, void *user_data) +{ + int i; + GpStatus stat = Ok; + struct measure_ranges_args *args = user_data; + + for (i=0; irange_count; i++) + { + INT range_start = max(index, format->character_ranges[i].First); + INT range_end = min(index+length, format->character_ranges[i].First+format->character_ranges[i].Length); + if (range_start < range_end) + { + GpRectF range_rect; + SIZE range_size; + + range_rect.Y = bounds->Y; + range_rect.Height = bounds->Height; + + GetTextExtentExPointW(graphics->hdc, string + index, range_start - index, + INT_MAX, NULL, NULL, &range_size); + range_rect.X = bounds->X + range_size.cx; + + GetTextExtentExPointW(graphics->hdc, string + index, range_end - index, + INT_MAX, NULL, NULL, &range_size); + range_rect.Width = (bounds->X + range_size.cx) - range_rect.X; + + stat = GdipCombineRegionRect(args->regions[i], &range_rect, CombineModeUnion); + if (stat != Ok) + break; + } + } + + return stat; +} + +GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, + GDIPCONST WCHAR* string, INT length, GDIPCONST GpFont* font, + GDIPCONST RectF* layoutRect, GDIPCONST GpStringFormat *stringFormat, + INT regionCount, GpRegion** regions) +{ + GpStatus stat; + int i; + HFONT oldfont; + struct measure_ranges_args args; + + TRACE("(%p %s %d %p %s %p %d %p)\n", graphics, debugstr_w(string), + length, font, debugstr_rectf(layoutRect), stringFormat, regionCount, regions); + + if (!(graphics && string && font && layoutRect && stringFormat && regions)) + return InvalidParameter; + + if (regionCount < stringFormat->range_count) + return InvalidParameter; + + if (stringFormat->attr) + TRACE("may be ignoring some format flags: attr %x\n", stringFormat->attr); + + oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); + + for (i=0; irange_count; i++) + { + stat = GdipSetEmpty(regions[i]); + if (stat != Ok) + return stat; + } + + args.regions = regions; + + stat = gdip_format_string(graphics, string, length, font, layoutRect, stringFormat, + measure_ranges_callback, &args); + + DeleteObject(SelectObject(graphics->hdc, oldfont)); + + return stat; +} + +struct measure_string_args { + RectF *bounds; + INT *codepointsfitted; + INT *linesfilled; +}; + +static GpStatus measure_string_callback(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, + INT lineno, const RectF *bounds, void *user_data) +{ + struct measure_string_args *args = user_data; + + if (bounds->Width > args->bounds->Width) + args->bounds->Width = bounds->Width; + + if (bounds->Height + bounds->Y > args->bounds->Height + args->bounds->Y) + args->bounds->Height = bounds->Height + bounds->Y - args->bounds->Y; + + if (args->codepointsfitted) + *args->codepointsfitted = index + length; + + if (args->linesfilled) + (*args->linesfilled)++; + + return Ok; +} + +/* Find the smallest rectangle that bounds the text when it is printed in rect + * according to the format options listed in format. If rect has 0 width and + * height, then just find the smallest rectangle that bounds the text when it's + * printed at location (rect->X, rect-Y). */ +GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, RectF *bounds, + INT *codepointsfitted, INT *linesfilled) +{ + HFONT oldfont; + struct measure_string_args args; + + TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics, + debugstr_wn(string, length), length, font, debugstr_rectf(rect), format, + bounds, codepointsfitted, linesfilled); + + if(!graphics || !string || !font || !rect || !bounds) + return InvalidParameter; + + if(linesfilled) *linesfilled = 0; + if(codepointsfitted) *codepointsfitted = 0; + + if(format) + TRACE("may be ignoring some format flags: attr %x\n", format->attr); + + oldfont = SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); + bounds->X = rect->X; bounds->Y = rect->Y; - bounds->Width = (REAL)max_width; - bounds->Height = (REAL) min(height, nheight); + bounds->Width = 0.0; + bounds->Height = 0.0; + + args.bounds = bounds; + args.codepointsfitted = codepointsfitted; + args.linesfilled = linesfilled; + + gdip_format_string(graphics, string, length, font, rect, format, + measure_string_callback, &args); - GdipFree(stringdup); DeleteObject(SelectObject(graphics->hdc, oldfont)); return Ok; } +struct draw_string_args { + POINT drawbase; + UINT drawflags; + REAL ang_cos, ang_sin; +}; + +static GpStatus draw_string_callback(GpGraphics *graphics, + GDIPCONST WCHAR *string, INT index, INT length, GDIPCONST GpFont *font, + GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, + INT lineno, const RectF *bounds, void *user_data) +{ + struct draw_string_args *args = user_data; + RECT drawcoord; + + drawcoord.left = drawcoord.right = args->drawbase.x + roundr(args->ang_sin * bounds->Y); + drawcoord.top = drawcoord.bottom = args->drawbase.y + roundr(args->ang_cos * bounds->Y); + + DrawTextW(graphics->hdc, string + index, length, &drawcoord, args->drawflags); + + return Ok; +} + +GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string, + INT length, GDIPCONST GpFont *font, GDIPCONST RectF *rect, + GDIPCONST GpStringFormat *format, GDIPCONST GpBrush *brush) +{ + HRGN rgn = NULL; + HFONT gdifont; + LOGFONTW lfw; + TEXTMETRICW textmet; + GpPointF pt[3], rectcpy[4]; + POINT corners[4]; + REAL angle, rel_width, rel_height; + INT offsety = 0, save_state; + struct draw_string_args args; + RectF scaled_rect; + + TRACE("(%p, %s, %i, %p, %s, %p, %p)\n", graphics, debugstr_wn(string, length), + length, font, debugstr_rectf(rect), format, brush); + + if(!graphics || !string || !font || !brush || !rect) + return InvalidParameter; + + if((brush->bt != BrushTypeSolidColor)){ + FIXME("not implemented for given parameters\n"); + return NotImplemented; + } + + if(format){ + TRACE("may be ignoring some format flags: attr %x\n", format->attr); + + /* Should be no need to explicitly test for StringAlignmentNear as + * that is default behavior if no alignment is passed. */ + if(format->vertalign != StringAlignmentNear){ + RectF bounds; + GdipMeasureString(graphics, string, length, font, rect, format, &bounds, 0, 0); + + if(format->vertalign == StringAlignmentCenter) + offsety = (rect->Height - bounds.Height) / 2; + else if(format->vertalign == StringAlignmentFar) + offsety = (rect->Height - bounds.Height); + } + } + + save_state = SaveDC(graphics->hdc); + SetBkMode(graphics->hdc, TRANSPARENT); + SetTextColor(graphics->hdc, brush->lb.lbColor); + + pt[0].X = 0.0; + pt[0].Y = 0.0; + pt[1].X = 1.0; + pt[1].Y = 0.0; + pt[2].X = 0.0; + pt[2].Y = 1.0; + GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, pt, 3); + angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); + args.ang_cos = cos(angle); + args.ang_sin = sin(angle); + rel_width = sqrt((pt[1].Y-pt[0].Y)*(pt[1].Y-pt[0].Y)+ + (pt[1].X-pt[0].X)*(pt[1].X-pt[0].X)); + rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ + (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X)); + + rectcpy[3].X = rectcpy[0].X = rect->X; + rectcpy[1].Y = rectcpy[0].Y = rect->Y + offsety; + rectcpy[2].X = rectcpy[1].X = rect->X + rect->Width; + rectcpy[3].Y = rectcpy[2].Y = rect->Y + offsety + rect->Height; + transform_and_round_points(graphics, corners, rectcpy, 4); + + scaled_rect.X = 0.0; + scaled_rect.Y = 0.0; + scaled_rect.Width = rel_width * rect->Width; + scaled_rect.Height = rel_height * rect->Height; + + if (roundr(scaled_rect.Width) != 0 && roundr(scaled_rect.Height) != 0) + { + /* FIXME: If only the width or only the height is 0, we should probably still clip */ + rgn = CreatePolygonRgn(corners, 4, ALTERNATE); + SelectClipRgn(graphics->hdc, rgn); + } + + /* Use gdi to find the font, then perform transformations on it (height, + * width, angle). */ + SelectObject(graphics->hdc, CreateFontIndirectW(&font->lfw)); + GetTextMetricsW(graphics->hdc, &textmet); + lfw = font->lfw; + + lfw.lfHeight = roundr(((REAL)lfw.lfHeight) * rel_height); + lfw.lfWidth = roundr(textmet.tmAveCharWidth * rel_width); + + lfw.lfEscapement = lfw.lfOrientation = roundr((angle / M_PI) * 1800.0); + + gdifont = CreateFontIndirectW(&lfw); + DeleteObject(SelectObject(graphics->hdc, CreateFontIndirectW(&lfw))); + + if (!format || format->align == StringAlignmentNear) + { + args.drawbase.x = corners[0].x; + args.drawbase.y = corners[0].y; + args.drawflags = DT_NOCLIP | DT_EXPANDTABS; + } + else if (format->align == StringAlignmentCenter) + { + args.drawbase.x = (corners[0].x + corners[1].x)/2; + args.drawbase.y = (corners[0].y + corners[1].y)/2; + args.drawflags = DT_NOCLIP | DT_EXPANDTABS | DT_CENTER; + } + else /* (format->align == StringAlignmentFar) */ + { + args.drawbase.x = corners[1].x; + args.drawbase.y = corners[1].y; + args.drawflags = DT_NOCLIP | DT_EXPANDTABS | DT_RIGHT; + } + + gdip_format_string(graphics, string, length, font, &scaled_rect, format, + draw_string_callback, &args); + + DeleteObject(rgn); + DeleteObject(gdifont); + + RestoreDC(graphics->hdc, save_state); + + return Ok; +} + GpStatus WINGDIPAPI GdipResetClip(GpGraphics *graphics) { TRACE("(%p)\n", graphics); @@ -4300,7 +4615,12 @@ GpStatus WINGDIPAPI GdipTransformPointsI(GpGraphics *graphics, GpCoordinateSpace HPALETTE WINGDIPAPI GdipCreateHalftonePalette(void) { - FIXME("\n"); + static int calls; + + TRACE("\n"); + + if (!calls++) + FIXME("stub\n"); return NULL; } diff --git a/dll/win32/gdiplus/image.c b/dll/win32/gdiplus/image.c index 58f3c6570be..0a73dcf6ca4 100644 --- a/dll/win32/gdiplus/image.c +++ b/dll/win32/gdiplus/image.c @@ -122,7 +122,7 @@ static inline void getpixel_16bppGrayScale(BYTE *r, BYTE *g, BYTE *b, BYTE *a, static inline void getpixel_16bppRGB555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x) { - WORD pixel = *((WORD*)(row)+x); + WORD pixel = *((const WORD*)(row)+x); *r = (pixel>>7&0xf8)|(pixel>>12&0x7); *g = (pixel>>2&0xf8)|(pixel>>6&0x7); *b = (pixel<<3&0xf8)|(pixel>>2&0x7); @@ -132,7 +132,7 @@ static inline void getpixel_16bppRGB555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, static inline void getpixel_16bppRGB565(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x) { - WORD pixel = *((WORD*)(row)+x); + WORD pixel = *((const WORD*)(row)+x); *r = (pixel>>8&0xf8)|(pixel>>13&0x7); *g = (pixel>>3&0xfc)|(pixel>>9&0x3); *b = (pixel<<3&0xf8)|(pixel>>2&0x7); @@ -142,7 +142,7 @@ static inline void getpixel_16bppRGB565(BYTE *r, BYTE *g, BYTE *b, BYTE *a, static inline void getpixel_16bppARGB1555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, const BYTE *row, UINT x) { - WORD pixel = *((WORD*)(row)+x); + WORD pixel = *((const WORD*)(row)+x); *r = (pixel>>7&0xf8)|(pixel>>12&0x7); *g = (pixel>>2&0xf8)|(pixel>>6&0x7); *b = (pixel<<3&0xf8)|(pixel>>2&0x7); @@ -1831,6 +1831,37 @@ GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16, return NotImplemented; } +/* Internal utility function: Replace the image data of dst with that of src, + * and free src. */ +static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) +{ + GdipFree(dst->bitmapbits); + DeleteDC(dst->hdc); + DeleteObject(dst->hbitmap); + + if (clobber_palette) + { + GdipFree(dst->image.palette_entries); + dst->image.palette_flags = src->image.palette_flags; + dst->image.palette_count = src->image.palette_count; + dst->image.palette_entries = src->image.palette_entries; + } + else + GdipFree(src->image.palette_entries); + + dst->image.xres = src->image.xres; + dst->image.yres = src->image.yres; + dst->width = src->width; + dst->height = src->height; + dst->format = src->format; + dst->hbitmap = src->hbitmap; + dst->hdc = src->hdc; + dst->bits = src->bits; + dst->stride = src->stride; + + GdipFree(src); +} + GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { TRACE("%p\n", image); @@ -1946,6 +1977,7 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, GpGraphics **graphics) { HDC hdc; + GpStatus stat; TRACE("%p %p\n", image, graphics); @@ -1965,7 +1997,12 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, ((GpBitmap*)image)->hdc = hdc; } - return GdipCreateFromHDC(hdc, graphics); + stat = GdipCreateFromHDC(hdc, graphics); + + if (stat == Ok) + (*graphics)->image = image; + + return stat; } GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height) @@ -2459,6 +2496,11 @@ static GpStatus decode_image_gif(IStream* stream, REFCLSID clsid, GpImage **imag return decode_image_wic(stream, &CLSID_WICGifDecoder, image); } +static GpStatus decode_image_tiff(IStream* stream, REFCLSID clsid, GpImage **image) +{ + return decode_image_wic(stream, &CLSID_WICTiffDecoder, image); +} + static GpStatus decode_image_olepicture_metafile(IStream* stream, REFCLSID clsid, GpImage **image) { IPicture *pic; @@ -2505,6 +2547,7 @@ typedef enum { BMP, JPEG, GIF, + TIFF, EMF, WMF, PNG, @@ -2517,10 +2560,11 @@ static const struct image_codec codecs[NUM_CODECS]; static GpStatus get_decoder_info(IStream* stream, const struct image_codec **result) { BYTE signature[8]; + const BYTE *pattern, *mask; LARGE_INTEGER seek; HRESULT hr; UINT bytesread; - int i, j; + int i, j, sig; /* seek to the start of the stream */ seek.QuadPart = 0; @@ -2528,7 +2572,7 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if (FAILED(hr)) return hresult_to_status(hr); /* read the first 8 bytes */ - /* FIXME: This assumes all codecs have one signature <= 8 bytes in length */ + /* FIXME: This assumes all codecs have signatures <= 8 bytes in length */ hr = IStream_Read(stream, signature, 8, &bytesread); if (FAILED(hr)) return hresult_to_status(hr); if (hr == S_FALSE || bytesread == 0) return GenericError; @@ -2537,13 +2581,18 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res if ((codecs[i].info.Flags & ImageCodecFlagsDecoder) && bytesread >= codecs[i].info.SigSize) { - for (j=0; jtype != ImageTypeBitmap) + { + FIXME("Not implemented for type %i\n", image->type); + return NotImplemented; + } + + bitmap = (GpBitmap*)image; + bpp = PIXELFORMATBPP(bitmap->format); + + if (bpp < 8) + { + FIXME("Not implemented for %i bit images\n", bpp); + return NotImplemented; + } + + if (rotate_90) + { + width = bitmap->height; + height = bitmap->width; + } + else + { + width = bitmap->width; + height = bitmap->height; + } + + bytesperpixel = bpp/8; + + stat = GdipCreateBitmapFromScan0(width, height, 0, bitmap->format, NULL, &new_bitmap); + + if (stat != Ok) + return stat; + + stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, bitmap->format, &src_lock); + + if (stat == Ok) + { + stat = GdipBitmapLockBits(new_bitmap, NULL, ImageLockModeWrite, bitmap->format, &dst_lock); + + if (stat == Ok) + { + LPBYTE src_row, src_pixel; + LPBYTE dst_row, dst_pixel; + + src_origin = src_lock.Scan0; + if (flip_x) src_origin += bytesperpixel * (bitmap->width - 1); + if (flip_y) src_origin += src_lock.Stride * (bitmap->height - 1); + + if (rotate_90) + { + if (flip_y) src_x_offset = -src_lock.Stride; + else src_x_offset = src_lock.Stride; + if (flip_x) src_y_offset = -bytesperpixel; + else src_y_offset = bytesperpixel; + } + else + { + if (flip_x) src_x_offset = -bytesperpixel; + else src_x_offset = bytesperpixel; + if (flip_y) src_y_offset = -src_lock.Stride; + else src_y_offset = src_lock.Stride; + } + + src_row = src_origin; + dst_row = dst_lock.Scan0; + for (y=0; ycharsets, &mlang_info, - (HCHARSET)InterlockedIncrement(&This->next_charset_handle)); + UlongToHandle(InterlockedIncrement(&This->next_charset_handle))); } LeaveCriticalSection(&This->cs); diff --git a/dll/win32/inetcomm/mimeole.c b/dll/win32/inetcomm/mimeole.c index 992949a44ef..f297c2973b4 100644 --- a/dll/win32/inetcomm/mimeole.c +++ b/dll/win32/inetcomm/mimeole.c @@ -1419,7 +1419,7 @@ static HRESULT create_sub_stream(IStream *stream, ULARGE_INTEGER start, ULARGE_I typedef struct body_t { struct list entry; - HBODY hbody; + DWORD index; IMimeBody *mime_body; struct body_t *parent; @@ -1434,7 +1434,7 @@ typedef struct MimeMessage IStream *stream; struct list body_tree; - HBODY next_hbody; + DWORD next_index; } MimeMessage; static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv) @@ -1512,13 +1512,13 @@ static HRESULT WINAPI MimeMessage_IsDirty( return E_NOTIMPL; } -static body_t *new_body_entry(IMimeBody *mime_body, HBODY hbody, body_t *parent) +static body_t *new_body_entry(IMimeBody *mime_body, DWORD index, body_t *parent) { body_t *body = HeapAlloc(GetProcessHeap(), 0, sizeof(*body)); if(body) { body->mime_body = mime_body; - body->hbody = hbody; + body->index = index; list_init(&body->children); body->parent = parent; } @@ -1630,8 +1630,7 @@ static body_t *create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *off offset->cbBodyStart = cur.u.LowPart + offset->cbHeaderStart; if(parent) MimeBody_set_offsets(impl_from_IMimeBody(mime_body), offset); IMimeBody_SetData(mime_body, IET_BINARY, NULL, NULL, &IID_IStream, pStm); - body = new_body_entry(mime_body, msg->next_hbody, parent); - msg->next_hbody = (HBODY)((DWORD)msg->next_hbody + 1); + body = new_body_entry(mime_body, msg->next_index++, parent); if(IMimeBody_IsContentType(mime_body, "multipart", NULL) == S_OK) { @@ -1812,7 +1811,7 @@ static HRESULT find_body(struct list *list, HBODY hbody, body_t **body) LIST_FOR_EACH_ENTRY(cur, list, body_t, entry) { - if(cur->hbody == hbody) + if(cur->index == HandleToUlong(hbody)) { *body = cur; return S_OK; @@ -1948,7 +1947,7 @@ static HRESULT WINAPI MimeMessage_GetBody( hr = get_body(This, location, hPivot, &body); - if(hr == S_OK) *phBody = body->hbody; + if(hr == S_OK) *phBody = UlongToHandle(body->index); return hr; } @@ -2003,38 +2002,35 @@ static HRESULT WINAPI MimeMessage_CountBodies( return S_OK; } -static HRESULT find_next(IMimeMessage *msg, LPFINDBODY find_body, HBODY *out) +static HRESULT find_next(IMimeMessage *msg, body_t *body, LPFINDBODY find, HBODY *out) { - HRESULT hr; - IMimeBody *mime_body; + MimeMessage *This = (MimeMessage *)msg; + struct list *ptr; HBODY next; - if(find_body->dwReserved == 0) - find_body->dwReserved = (DWORD)HBODY_ROOT; - else + for (;;) { - hr = IMimeMessage_GetBody(msg, IBL_FIRST, (HBODY)find_body->dwReserved, &next); - if(hr == S_OK) - find_body->dwReserved = (DWORD)next; + if (!body) ptr = list_head( &This->body_tree ); else { - hr = IMimeMessage_GetBody(msg, IBL_NEXT, (HBODY)find_body->dwReserved, &next); - if(hr == S_OK) - find_body->dwReserved = (DWORD)next; - else - return MIME_E_NOT_FOUND; + ptr = list_head( &body->children ); + while (!ptr) + { + if (!body->parent) return MIME_E_NOT_FOUND; + if (!(ptr = list_next( &body->parent->children, &body->entry ))) body = body->parent; + } + } + + body = LIST_ENTRY( ptr, body_t, entry ); + next = UlongToHandle( body->index ); + find->dwReserved = body->index; + if (IMimeBody_IsContentType(body->mime_body, find->pszPriType, find->pszSubType) == S_OK) + { + *out = next; + return S_OK; } } - - hr = IMimeMessage_BindToObject(msg, (HBODY)find_body->dwReserved, &IID_IMimeBody, (void**)&mime_body); - if(IMimeBody_IsContentType(mime_body, find_body->pszPriType, find_body->pszSubType) == S_OK) - { - IMimeBody_Release(mime_body); - *out = (HBODY)find_body->dwReserved; - return S_OK; - } - IMimeBody_Release(mime_body); - return find_next(msg, find_body, out); + return MIME_E_NOT_FOUND; } static HRESULT WINAPI MimeMessage_FindFirst( @@ -2045,7 +2041,7 @@ static HRESULT WINAPI MimeMessage_FindFirst( TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody); pFindBody->dwReserved = 0; - return find_next(iface, pFindBody, phBody); + return find_next( iface, NULL, pFindBody, phBody ); } static HRESULT WINAPI MimeMessage_FindNext( @@ -2053,9 +2049,15 @@ static HRESULT WINAPI MimeMessage_FindNext( LPFINDBODY pFindBody, LPHBODY phBody) { + MimeMessage *This = (MimeMessage *)iface; + body_t *body; + HRESULT hr; + TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody); - return find_next(iface, pFindBody, phBody); + hr = find_body( &This->body_tree, UlongToHandle( pFindBody->dwReserved ), &body ); + if (hr != S_OK) return MIME_E_NOT_FOUND; + return find_next( iface, body, pFindBody, phBody ); } static HRESULT WINAPI MimeMessage_ResolveURL( @@ -2562,7 +2564,7 @@ HRESULT MimeMessage_create(IUnknown *outer, void **obj) This->refs = 1; This->stream = NULL; list_init(&This->body_tree); - This->next_hbody = (HBODY)1; + This->next_index = 1; *obj = &This->lpVtbl; return S_OK; diff --git a/dll/win32/inseng/inseng_main.c b/dll/win32/inseng/inseng_main.c index 8ceb252b511..f1f148b4398 100644 --- a/dll/win32/inseng/inseng_main.c +++ b/dll/win32/inseng/inseng_main.c @@ -61,7 +61,6 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) HRESULT WINAPI DllCanUnloadNow(void) { - FIXME("\n"); return S_FALSE; } diff --git a/dll/win32/iphlpapi/dhcp_reactos.c b/dll/win32/iphlpapi/dhcp_reactos.c index 1dd4b87eee9..3364e3c9c7e 100644 --- a/dll/win32/iphlpapi/dhcp_reactos.c +++ b/dll/win32/iphlpapi/dhcp_reactos.c @@ -8,6 +8,8 @@ #include "iphlpapi_private.h" #include "dhcp.h" +#include "dhcpcsdk.h" +#include "dhcpcapi.h" #include #define NDEBUG @@ -25,6 +27,23 @@ DWORD getDhcpInfoForAdapter(DWORD AdapterIndex, time_t *LeaseObtained, time_t *LeaseExpires) { - return DhcpRosGetAdapterInfo(AdapterIndex, DhcpEnabled, DhcpServer, - LeaseObtained, LeaseExpires); + DWORD Status, Version = 0; + + Status = DhcpCApiInitialize(&Version); + if (Status != ERROR_SUCCESS) + { + /* We assume that the DHCP service isn't running yet */ + *DhcpEnabled = FALSE; + *DhcpServer = htonl(INADDR_NONE); + *LeaseObtained = 0; + *LeaseExpires = 0; + return ERROR_SUCCESS; + } + + Status = DhcpRosGetAdapterInfo(AdapterIndex, DhcpEnabled, DhcpServer, + LeaseObtained, LeaseExpires); + + DhcpCApiCleanup(); + + return Status; } diff --git a/dll/win32/iphlpapi/iphlpapi.rbuild b/dll/win32/iphlpapi/iphlpapi.rbuild index 207a9f565b2..ed1fe25218e 100644 --- a/dll/win32/iphlpapi/iphlpapi.rbuild +++ b/dll/win32/iphlpapi/iphlpapi.rbuild @@ -2,7 +2,7 @@ . include/reactos/wine - include + include . wine ntdll diff --git a/dll/win32/iphlpapi/iphlpapi_main.c b/dll/win32/iphlpapi/iphlpapi_main.c index 0bc146b6616..3fd68560c17 100644 --- a/dll/win32/iphlpapi/iphlpapi_main.c +++ b/dll/win32/iphlpapi/iphlpapi_main.c @@ -49,7 +49,7 @@ #include "route.h" #include "wine/debug.h" #include "dhcpcsdk.h" -#include "dhcp/rosdhcp_public.h" +#include "dhcpcapi.h" WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); @@ -63,6 +63,7 @@ typedef struct _NAME_SERVER_LIST_CONTEXT { BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + DWORD Version; switch (fdwReason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hinstDLL ); @@ -1944,30 +1945,23 @@ DWORD WINAPI GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIP */ DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo) { - COMM_DHCP_REPLY Reply; - COMM_DHCP_REQ Request; - DWORD BytesRead; - - Request.AdapterIndex = AdapterInfo->Index; - Request.Type = DhcpReqReleaseIpAddress; - - TRACE("AdapterInfo %p\n", AdapterInfo); - - if (CallNamedPipe(DHCP_PIPE_NAME, - &Request, - sizeof(Request), - &Reply, - sizeof(Reply), - &BytesRead, - NMPWAIT_USE_DEFAULT_WAIT)) - { - if (Reply.Reply) - return NO_ERROR; + DWORD Status, Version = 0; + if (!AdapterInfo || !AdapterInfo->Name) return ERROR_INVALID_PARAMETER; - } - return ERROR_PROC_NOT_FOUND; + /* Maybe we should do this in DllMain */ + if (DhcpCApiInitialize(&Version) != ERROR_SUCCESS) + return ERROR_PROC_NOT_FOUND; + + if (DhcpReleaseIpAddressLease(AdapterInfo->Index)) + Status = ERROR_SUCCESS; + else + Status = ERROR_PROC_NOT_FOUND; + + DhcpCApiCleanup(); + + return Status; } @@ -1985,30 +1979,23 @@ DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo) */ DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo) { - COMM_DHCP_REPLY Reply; - COMM_DHCP_REQ Request; - DWORD BytesRead; - - Request.AdapterIndex = AdapterInfo->Index; - Request.Type = DhcpReqRenewIpAddress; - - TRACE("AdapterInfo %p\n", AdapterInfo); - - if (CallNamedPipe(DHCP_PIPE_NAME, - &Request, - sizeof(Request), - &Reply, - sizeof(Reply), - &BytesRead, - NMPWAIT_USE_DEFAULT_WAIT)) - { - if (Reply.Reply) - return NO_ERROR; + DWORD Status, Version = 0; + if (!AdapterInfo || !AdapterInfo->Name) return ERROR_INVALID_PARAMETER; - } - return ERROR_PROC_NOT_FOUND; + /* Maybe we should do this in DllMain */ + if (DhcpCApiInitialize(&Version) != ERROR_SUCCESS) + return ERROR_PROC_NOT_FOUND; + + if (DhcpRenewIpAddressLease(AdapterInfo->Index)) + Status = ERROR_SUCCESS; + else + Status = ERROR_PROC_NOT_FOUND; + + DhcpCApiCleanup(); + + return Status; } @@ -2301,17 +2288,196 @@ PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID) } /* - * @unimplemented + * @implemented */ DWORD WINAPI GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen) { + InterfaceIndexTable *indexTable; + IFInfo ifInfo; + int i; + ULONG ret, requiredSize = 0; + PIP_ADAPTER_ADDRESSES currentAddress; + PUCHAR currentLocation; + HANDLE tcpFile; + if (!pOutBufLen) return ERROR_INVALID_PARAMETER; - if (!pAdapterAddresses || *pOutBufLen == 0) - return ERROR_BUFFER_OVERFLOW; if (Reserved) return ERROR_INVALID_PARAMETER; - FIXME(":stub\n"); - return ERROR_NO_DATA; + indexTable = getNonLoopbackInterfaceIndexTable(); //I think we want non-loopback here + if (!indexTable) + return ERROR_NOT_ENOUGH_MEMORY; + + ret = openTcpFile(&tcpFile); + if (!NT_SUCCESS(ret)) + return ERROR_NO_DATA; + + for (i = indexTable->numIndexes; i >= 0; i--) + { + if (NT_SUCCESS(getIPAddrEntryForIf(tcpFile, + NULL, + indexTable->indexes[i], + &ifInfo))) + { + /* The whole struct */ + requiredSize += sizeof(IP_ADAPTER_ADDRESSES); + + /* Friendly name */ + if (!(Flags & GAA_FLAG_SKIP_FRIENDLY_NAME)) + requiredSize += strlen((char *)ifInfo.if_info.ent.if_descr) + 1; //FIXME + + /* Adapter name */ + requiredSize += strlen((char *)ifInfo.if_info.ent.if_descr) + 1; + + /* Unicast address */ + if (!(Flags & GAA_FLAG_SKIP_UNICAST)) + requiredSize += sizeof(IP_ADAPTER_UNICAST_ADDRESS); + + /* FIXME: Implement multicast, anycast, and dns server stuff */ + + /* FIXME: Implement dns suffix and description */ + requiredSize += 2 * sizeof(WCHAR); + + /* We're only going to implement what's required for XP SP0 */ + } + } + + if (*pOutBufLen < requiredSize) + { + *pOutBufLen = requiredSize; + closeTcpFile(tcpFile); + free(indexTable); + return ERROR_BUFFER_OVERFLOW; + } + + RtlZeroMemory(pAdapterAddresses, requiredSize); + + /* Let's set up the pointers */ + currentAddress = pAdapterAddresses; + for (i = indexTable->numIndexes; i >= 0; i--) + { + if (NT_SUCCESS(getIPAddrEntryForIf(tcpFile, + NULL, + indexTable->indexes[i], + &ifInfo))) + { + currentLocation = (PUCHAR)currentAddress + (ULONG_PTR)sizeof(IP_ADAPTER_ADDRESSES); + + /* FIXME: Friendly name */ + if (!(Flags & GAA_FLAG_SKIP_FRIENDLY_NAME)) + { + currentAddress->FriendlyName = (PVOID)currentLocation; + currentLocation += sizeof(WCHAR); + } + + /* Adapter name */ + currentAddress->AdapterName = (PVOID)currentLocation; + currentLocation += strlen((char *)ifInfo.if_info.ent.if_descr) + 1; + + /* Unicast address */ + if (!(Flags & GAA_FLAG_SKIP_UNICAST)) + { + currentAddress->FirstUnicastAddress = (PVOID)currentLocation; + currentLocation += sizeof(IP_ADAPTER_UNICAST_ADDRESS); + currentAddress->FirstUnicastAddress->Address.lpSockaddr = (PVOID)currentLocation; + currentLocation += sizeof(struct sockaddr); + } + + /* FIXME: Implement multicast, anycast, and dns server stuff */ + + /* FIXME: Implement dns suffix and description */ + currentAddress->DnsSuffix = (PVOID)currentLocation; + currentLocation += sizeof(WCHAR); + + currentAddress->Description = (PVOID)currentLocation; + currentLocation += sizeof(WCHAR); + + currentAddress->Next = (PVOID)currentLocation; + + /* We're only going to implement what's required for XP SP0 */ + + currentAddress = currentAddress->Next; + } + } + + /* Terminate the last address correctly */ + if (currentAddress) + currentAddress->Next = NULL; + + /* Now again, for real this time */ + + currentAddress = pAdapterAddresses; + for (i = indexTable->numIndexes; i >= 0; i--) + { + if (NT_SUCCESS(getIPAddrEntryForIf(tcpFile, + NULL, + indexTable->indexes[i], + &ifInfo))) + { + /* Make sure we're not looping more than we hoped for */ + ASSERT(currentAddress); + + /* Alignment information */ + currentAddress->Length = sizeof(IP_ADAPTER_ADDRESSES); + currentAddress->IfIndex = indexTable->indexes[i]; + + /* Adapter name */ + strcpy(currentAddress->AdapterName, (char *)ifInfo.if_info.ent.if_descr); + + if (!(Flags & GAA_FLAG_SKIP_UNICAST)) + { + currentAddress->FirstUnicastAddress->Length = sizeof(IP_ADAPTER_UNICAST_ADDRESS); + currentAddress->FirstUnicastAddress->Flags = 0; //FIXME + currentAddress->FirstUnicastAddress->Next = NULL; //FIXME: Support more than one address per adapter + currentAddress->FirstUnicastAddress->Address.lpSockaddr->sa_family = AF_INET; + memcpy(currentAddress->FirstUnicastAddress->Address.lpSockaddr->sa_data, + &ifInfo.ip_addr.iae_addr, + sizeof(ifInfo.ip_addr.iae_addr)); + currentAddress->FirstUnicastAddress->Address.iSockaddrLength = sizeof(ifInfo.ip_addr.iae_addr) + sizeof(USHORT); + currentAddress->FirstUnicastAddress->PrefixOrigin = IpPrefixOriginOther; //FIXME + currentAddress->FirstUnicastAddress->SuffixOrigin = IpPrefixOriginOther; //FIXME + currentAddress->FirstUnicastAddress->DadState = IpDadStatePreferred; //FIXME + currentAddress->FirstUnicastAddress->ValidLifetime = 0xFFFFFFFF; //FIXME + currentAddress->FirstUnicastAddress->PreferredLifetime = 0xFFFFFFFF; //FIXME + currentAddress->FirstUnicastAddress->LeaseLifetime = 0xFFFFFFFF; //FIXME + } + + /* FIXME: Implement multicast, anycast, and dns server stuff */ + currentAddress->FirstAnycastAddress = NULL; + currentAddress->FirstMulticastAddress = NULL; + currentAddress->FirstDnsServerAddress = NULL; + + /* FIXME: Implement dns suffix, description, and friendly name */ + currentAddress->DnsSuffix[0] = UNICODE_NULL; + currentAddress->Description[0] = UNICODE_NULL; + currentAddress->FriendlyName[0] = UNICODE_NULL; + + /* Physical Address */ + memcpy(currentAddress->PhysicalAddress, ifInfo.if_info.ent.if_physaddr, ifInfo.if_info.ent.if_physaddrlen); + currentAddress->PhysicalAddressLength = ifInfo.if_info.ent.if_physaddrlen; + + /* Flags */ + currentAddress->Flags = 0; //FIXME + + /* MTU */ + currentAddress->Mtu = ifInfo.if_info.ent.if_mtu; + + /* Interface type */ + currentAddress->IfType = ifInfo.if_info.ent.if_type; + + /* Operational status */ + currentAddress->OperStatus = ifInfo.if_info.ent.if_operstatus; + + /* We're only going to implement what's required for XP SP0 */ + + /* Move to the next address */ + currentAddress = currentAddress->Next; + } + } + + closeTcpFile(tcpFile); + free(indexTable); + + return NO_ERROR; } /* diff --git a/dll/win32/iphlpapi/iphlpapi_private.h b/dll/win32/iphlpapi/iphlpapi_private.h index 766f7f4e6ee..fa6c1c151cd 100644 --- a/dll/win32/iphlpapi/iphlpapi_private.h +++ b/dll/win32/iphlpapi/iphlpapi_private.h @@ -60,6 +60,15 @@ #define TCP_REQUEST_QUERY_INFORMATION_INIT { { { 0 } } } #define TCP_REQUEST_SET_INFORMATION_INIT { { 0 } } +/* FIXME: ROS headers suck */ +#ifndef GAA_FLAG_SKIP_UNICAST +#define GAA_FLAG_SKIP_UNICAST 0x0001 +#endif + +#ifndef GAA_FLAG_SKIP_FRIENDLY_NAME +#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x0020 +#endif + // As in the mib from RFC 1213 typedef struct _IPRouteEntry { @@ -138,6 +147,10 @@ typedef VOID (*EnumNameServersFunc)( PWCHAR Interface, PWCHAR NameServer, PVOID Data ); void EnumNameServers( HANDLE RegHandle, PWCHAR Interface, PVOID Data, EnumNameServersFunc cb ); +NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, + char *name, + DWORD index, + IFInfo *ifInfo); #include /* This is here until we switch to version 2.5 of the mingw headers */ diff --git a/dll/win32/jscript/jscript.h b/dll/win32/jscript/jscript.h index 00688273de8..c1c8e60f35b 100644 --- a/dll/win32/jscript/jscript.h +++ b/dll/win32/jscript/jscript.h @@ -324,6 +324,7 @@ HRESULT regexp_match_next(script_ctx_t*,DispatchEx*,DWORD,const WCHAR*,DWORD,con DWORD*,DWORD*,match_result_t*); HRESULT regexp_match(script_ctx_t*,DispatchEx*,const WCHAR*,DWORD,BOOL,match_result_t**,DWORD*); HRESULT parse_regexp_flags(const WCHAR*,DWORD,DWORD*); +HRESULT regexp_string_match(script_ctx_t*,DispatchEx*,BSTR,VARIANT*,jsexcept_t*); static inline VARIANT *get_arg(DISPPARAMS *dp, DWORD i) { diff --git a/dll/win32/jscript/regexp.c b/dll/win32/jscript/regexp.c index 04575458105..7861d229826 100644 --- a/dll/win32/jscript/regexp.c +++ b/dll/win32/jscript/regexp.c @@ -2384,7 +2384,7 @@ SimpleMatch(REGlobalData *gData, REMatchState *x, REOp op, RECharSet *charSet; const char *opname = reop_names[op]; - TRACE("\n%06d: %*s%s\n", pc - gData->regexp->program, + TRACE("\n%06d: %*s%s\n", (int)(pc - gData->regexp->program), (int)gData->stateStackTop * 2, "", opname); switch (op) { @@ -2623,7 +2623,7 @@ ExecuteREBytecode(REGlobalData *gData, REMatchState *x) for (;;) { const char *opname = reop_names[op]; - TRACE("\n%06d: %*s%s\n", pc - gData->regexp->program, + TRACE("\n%06d: %*s%s\n", (int)(pc - gData->regexp->program), (int)gData->stateStackTop * 2, "", opname); if (REOP_IS_SIMPLE(op)) { @@ -3637,25 +3637,25 @@ static HRESULT run_exec(script_ctx_t *ctx, vdisp_t *jsthis, VARIANT *arg, jsexce hres = to_string(ctx, arg, ei, &string); if(FAILED(hres)) return hres; + length = SysStringLen(string); }else { - string = SysAllocStringLen(NULL, 0); - if(!string) - return E_OUTOFMEMORY; + string = NULL; + length = 0; } - if(regexp->last_index < 0) { - SysFreeString(string); - set_last_index(regexp, 0); - *ret = VARIANT_FALSE; - if(input) { - *input = NULL; + if(regexp->jsregexp->flags & JSREG_GLOB) { + if(regexp->last_index < 0) { + SysFreeString(string); + set_last_index(regexp, 0); + *ret = VARIANT_FALSE; + if(input) { + *input = NULL; + } + return S_OK; } - return S_OK; - } - length = SysStringLen(string); - if(regexp->jsregexp->flags & JSREG_GLOB) last_index = regexp->last_index; + } cp = string + last_index; hres = regexp_match_next(ctx, ®exp->dispex, REM_RESET_INDEX, string, length, &cp, parens, @@ -3878,6 +3878,87 @@ HRESULT create_regexp_var(script_ctx_t *ctx, VARIANT *src_arg, VARIANT *flags_ar return create_regexp(ctx, src, -1, flags, ret); } +HRESULT regexp_string_match(script_ctx_t *ctx, DispatchEx *re, BSTR str, + VARIANT *retv, jsexcept_t *ei) +{ + RegExpInstance *regexp = (RegExpInstance*)re; + match_result_t *match_result; + DWORD match_cnt, i, length; + DispatchEx *array; + VARIANT var; + HRESULT hres; + + length = SysStringLen(str); + + if(!(regexp->jsregexp->flags & JSREG_GLOB)) { + match_result_t match, *parens = NULL; + DWORD parens_cnt, parens_size = 0; + const WCHAR *cp = str; + + hres = regexp_match_next(ctx, ®exp->dispex, 0, str, length, &cp, &parens, &parens_size, &parens_cnt, &match); + if(FAILED(hres)) + return hres; + + if(retv) { + if(hres == S_OK) { + IDispatch *ret; + + hres = create_match_array(ctx, str, &match, parens, parens_cnt, ei, &ret); + if(SUCCEEDED(hres)) { + V_VT(retv) = VT_DISPATCH; + V_DISPATCH(retv) = ret; + } + }else { + V_VT(retv) = VT_NULL; + } + } + + heap_free(parens); + return S_OK; + } + + hres = regexp_match(ctx, ®exp->dispex, str, length, FALSE, &match_result, &match_cnt); + if(FAILED(hres)) + return hres; + + if(!match_cnt) { + TRACE("no match\n"); + + if(retv) + V_VT(retv) = VT_NULL; + return S_OK; + } + + hres = create_array(ctx, match_cnt, &array); + if(FAILED(hres)) + return hres; + + V_VT(&var) = VT_BSTR; + + for(i=0; i < match_cnt; i++) { + V_BSTR(&var) = SysAllocStringLen(match_result[i].str, match_result[i].len); + if(!V_BSTR(&var)) { + hres = E_OUTOFMEMORY; + break; + } + + hres = jsdisp_propput_idx(array, i, &var, ei, NULL/*FIXME*/); + SysFreeString(V_BSTR(&var)); + if(FAILED(hres)) + break; + } + + heap_free(match_result); + + if(SUCCEEDED(hres) && retv) { + V_VT(retv) = VT_DISPATCH; + V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(array); + }else { + jsdisp_release(array); + } + return hres; +} + static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { diff --git a/dll/win32/jscript/string.c b/dll/win32/jscript/string.c index df43fee27ed..510dcc272c6 100644 --- a/dll/win32/jscript/string.c +++ b/dll/win32/jscript/string.c @@ -622,11 +622,9 @@ static HRESULT String_match(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { const WCHAR *str; - match_result_t *match_result; DispatchEx *regexp; - DispatchEx *array; - VARIANT var, *arg_var; - DWORD length, match_cnt, i; + VARIANT *arg_var; + DWORD length; BSTR val_str = NULL; HRESULT hres = S_OK; @@ -645,7 +643,7 @@ static HRESULT String_match(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP case VT_DISPATCH: regexp = iface_to_jsdisp((IUnknown*)V_DISPATCH(arg_var)); if(regexp) { - if(regexp->builtin_info->class == JSCLASS_REGEXP) + if(is_class(regexp, JSCLASS_REGEXP)) break; jsdisp_release(regexp); } @@ -664,54 +662,17 @@ static HRESULT String_match(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP } hres = get_string_val(ctx, jsthis, ei, &str, &length, &val_str); - if(SUCCEEDED(hres)) - hres = regexp_match(ctx, regexp, str, length, FALSE, &match_result, &match_cnt); - jsdisp_release(regexp); - if(FAILED(hres)) { - SysFreeString(val_str); - return hres; - } - - if(!match_cnt) { - TRACE("no match\n"); - - if(retv) - V_VT(retv) = VT_NULL; - - SysFreeString(val_str); - return S_OK; - } - - hres = create_array(ctx, match_cnt, &array); - if(FAILED(hres)) { - SysFreeString(val_str); - return hres; - } - - V_VT(&var) = VT_BSTR; - - for(i=0; i < match_cnt; i++) { - V_BSTR(&var) = SysAllocStringLen(match_result[i].str, match_result[i].len); - if(!V_BSTR(&var)) { + if(SUCCEEDED(hres)) { + if(!val_str) + val_str = SysAllocStringLen(str, length); + if(val_str) + hres = regexp_string_match(ctx, regexp, val_str, retv, ei); + else hres = E_OUTOFMEMORY; - break; - } - - hres = jsdisp_propput_idx(array, i, &var, ei, NULL/*FIXME*/); - SysFreeString(V_BSTR(&var)); - if(FAILED(hres)) - break; } - heap_free(match_result); + jsdisp_release(regexp); SysFreeString(val_str); - - if(SUCCEEDED(hres) && retv) { - V_VT(retv) = VT_DISPATCH; - V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(array); - }else { - jsdisp_release(array); - } return hres; } diff --git a/dll/win32/kernel32/include/kernel32.h b/dll/win32/kernel32/include/kernel32.h index 60056f111f7..19731210435 100755 --- a/dll/win32/kernel32/include/kernel32.h +++ b/dll/win32/kernel32/include/kernel32.h @@ -190,3 +190,7 @@ IntGetCodePageEntry(UINT CodePage); LPWSTR GetDllLoadPath(LPCWSTR lpModule); + +VOID +WINAPI +InitCommandLines(VOID); diff --git a/dll/win32/kernel32/kernel32.pspec b/dll/win32/kernel32/kernel32.pspec index b952a287b5d..cba32d9f29d 100644 --- a/dll/win32/kernel32/kernel32.pspec +++ b/dll/win32/kernel32/kernel32.pspec @@ -966,11 +966,9 @@ @ stdcall WaitNamedPipeW (wstr long) @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall WinExec(str long) -#ifdef _M_AMD64 @ stdcall Wow64EnableWow64FsRedirection(long) @ stdcall Wow64DisableWow64FsRedirection(long) @ stdcall Wow64RevertWow64FsRedirection(long) -#endif @ stdcall WriteConsoleA(long ptr long ptr ptr) @ stdcall WriteConsoleInputA(long ptr long ptr) @ stdcall WriteConsoleInputVDMA(long long long long) diff --git a/dll/win32/kernel32/lang/bg-BG.mc b/dll/win32/kernel32/lang/bg-BG.mc index 4a0fa997233..ff0e58602a8 100644 --- a/dll/win32/kernel32/lang/bg-BG.mc +++ b/dll/win32/kernel32/lang/bg-BG.mc @@ -2468,17499 +2468,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FAILED_DRIVER_ENTRY Language=Bulgarian -ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. -. - -MessageId=648 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_ENUMERATION_ERROR -Language=Bulgarian -ERROR_DEVICE_ENUMERATION_ERROR - The \"%hs\" encountered an error while applying power or reading the device configuration. This may be caused by a failure of your hardware or by a poor connection. -. - -MessageId=649 -Severity=Success -Facility=System -SymbolicName=ERROR_MOUNT_POINT_NOT_RESOLVED -Language=Bulgarian -ERROR_MOUNT_POINT_NOT_RESOLVED - The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached. -. - -MessageId=650 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DEVICE_OBJECT_PARAMETER -Language=Bulgarian -ERROR_INVALID_DEVICE_OBJECT_PARAMETER - The device object parameter is either not a valid device object or is not attached to the volume specified by the file name. -. - -MessageId=651 -Severity=Success -Facility=System -SymbolicName=ERROR_MCA_OCCURED -Language=Bulgarian -ERROR_MCA_OCCURED - A Machine Check Error has occurred. Please check the system eventlog for additional information. -. - -MessageId=652 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVER_DATABASE_ERROR -Language=Bulgarian -ERROR_DRIVER_DATABASE_ERROR - There was error [%2] processing the driver database. -. - -MessageId=653 -Severity=Success -Facility=System -SymbolicName=ERROR_SYSTEM_HIVE_TOO_LARGE -Language=Bulgarian -ERROR_SYSTEM_HIVE_TOO_LARGE - System hive size has exceeded its limit. -. - -MessageId=654 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVER_FAILED_PRIOR_UNLOAD -Language=Bulgarian -ERROR_DRIVER_FAILED_PRIOR_UNLOAD - The driver could not be loaded because a previous version of the driver is still in memory. -. - -MessageId=655 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLSNAP_PREPARE_HIBERNATE -Language=Bulgarian -ERROR_VOLSNAP_PREPARE_HIBERNATE - Please wait while the Volume Shadow Copy Service prepares volume %hs for hibernation. -. - -MessageId=656 -Severity=Success -Facility=System -SymbolicName=ERROR_HIBERNATION_FAILURE -Language=Bulgarian -ERROR_HIBERNATION_FAILURE - The system has failed to hibernate (The error code is %hs). Hibernation will be disabled until the system is restarted. -. - -MessageId=657 -Severity=Success -Facility=System -SymbolicName=ERROR_HUNG_DISPLAY_DRIVER_THREAD -Language=Bulgarian -ERROR_HUNG_DISPLAY_DRIVER_THREAD - The %hs display driver has stopped working normally. Save your work and reboot the system to restore full display functionality. The next time you reboot the machine a dialog will be displayed giving you a chance to report this failure to Microsoft. -. - -MessageId=665 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_SYSTEM_LIMITATION -Language=Bulgarian -ERROR_FILE_SYSTEM_LIMITATION - The requested operation could not be completed due to a file system limitation. -. - -MessageId=668 -Severity=Success -Facility=System -SymbolicName=ERROR_ASSERTION_FAILURE -Language=Bulgarian -ERROR_ASSERTION_FAILURE - An assertion failure has occurred. -. - -MessageId=669 -Severity=Success -Facility=System -SymbolicName=ERROR_VERIFIER_STOP -Language=Bulgarian -ERROR_VERIFIER_STOP - Application verifier has found an error in the current process. -. - -MessageId=670 -Severity=Success -Facility=System -SymbolicName=ERROR_WOW_ASSERTION -Language=Bulgarian -ERROR_WOW_ASSERTION - WOW Assertion Error. -. - -MessageId=671 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_BAD_MPS_TABLE -Language=Bulgarian -ERROR_PNP_BAD_MPS_TABLE - A device is missing in the system BIOS MPS table. This device will not be used. Please contact your system vendor for system BIOS update. -. - -MessageId=672 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_TRANSLATION_FAILED -Language=Bulgarian -ERROR_PNP_TRANSLATION_FAILED - A translator failed to translate resources. -. - -MessageId=673 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_IRQ_TRANSLATION_FAILED -Language=Bulgarian -ERROR_PNP_IRQ_TRANSLATION_FAILED - A IRQ translator failed to translate resources. -. - -MessageId=674 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_INVALID_ID -Language=Bulgarian -ERROR_PNP_INVALID_ID - Driver %2 returned invalid ID for a child device (%3). -. - -MessageId=675 -Severity=Success -Facility=System -SymbolicName=ERROR_WAKE_SYSTEM_DEBUGGER -Language=Bulgarian -ERROR_WAKE_SYSTEM_DEBUGGER - The system debugger was awakened by an interrupt. -. - -MessageId=676 -Severity=Success -Facility=System -SymbolicName=ERROR_HANDLES_CLOSED -Language=Bulgarian -ERROR_HANDLES_CLOSED - Handles to objects have been automatically closed as a result of the requested operation. -. - -MessageId=677 -Severity=Success -Facility=System -SymbolicName=ERROR_EXTRANEOUS_INFORMATION -Language=Bulgarian -ERROR_EXTRANEOUS_INFORMATION - he specified access control list (ACL) contained more information than was expected. -. - -MessageId=678 -Severity=Success -Facility=System -SymbolicName=ERROR_RXACT_COMMIT_NECESSARY -Language=Bulgarian -ERROR_RXACT_COMMIT_NECESSARY - This warning level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted. The commit has NOT been completed, but has not been rolled back either (so it may still be committed if desired). -. - -MessageId=679 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_CHECK -Language=Bulgarian -ERROR_MEDIA_CHECK - The media may have changed. -. - -MessageId=680 -Severity=Success -Facility=System -SymbolicName=ERROR_GUID_SUBSTITUTION_MADE -Language=Bulgarian -ERROR_GUID_SUBSTITUTION_MADE - During the translation of a global identifier (GUID) to a Windows security ID (SID), no administratively-defined GUID prefix was found. A substitute prefix was used, which will not compromise system security. However, this may provide a more restrictive access than intended. -. - -MessageId=681 -Severity=Success -Facility=System -SymbolicName=ERROR_STOPPED_ON_SYMLINK -Language=Bulgarian -ERROR_STOPPED_ON_SYMLINK - The create operation stopped after reaching a symbolic link. -. - -MessageId=682 -Severity=Success -Facility=System -SymbolicName=ERROR_LONGJUMP -Language=Bulgarian -ERROR_LONGJUMP - A long jump has been executed. -. - -MessageId=683 -Severity=Success -Facility=System -SymbolicName=ERROR_PLUGPLAY_QUERY_VETOED -Language=Bulgarian -ERROR_PLUGPLAY_QUERY_VETOED - The Plug and Play query operation was not successful. -. - -MessageId=684 -Severity=Success -Facility=System -SymbolicName=ERROR_UNWIND_CONSOLIDATE -Language=Bulgarian -ERROR_UNWIND_CONSOLIDATE - A frame consolidation has been executed. -. - -MessageId=685 -Severity=Success -Facility=System -SymbolicName=ERROR_REGISTRY_HIVE_RECOVERED -Language=Bulgarian -ERROR_REGISTRY_HIVE_RECOVERED - Registry hive (file): %hs was corrupted and it has been recovered. Some data might have been lost. -. - -MessageId=686 -Severity=Success -Facility=System -SymbolicName=ERROR_DLL_MIGHT_BE_INSECURE -Language=Bulgarian -ERROR_DLL_MIGHT_BE_INSECURE - The application is attempting to run executable code from the module %hs. This may be insecure. An alternative, %hs, is available. Should the application use the secure module %hs? -. - -MessageId=687 -Severity=Success -Facility=System -SymbolicName=ERROR_DLL_MIGHT_BE_INCOMPATIBLE -Language=Bulgarian -ERROR_DLL_MIGHT_BE_INCOMPATIBLE - The application is loading executable code from the module %hs. This is secure, but may be incompatible with previous releases of the operating system. An alternative, %hs, is available. Should the application use the secure module %hs? -. - -MessageId=688 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_EXCEPTION_NOT_HANDLED -Language=Bulgarian -ERROR_DBG_EXCEPTION_NOT_HANDLED - Debugger did not handle the exception. -. - -MessageId=689 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_REPLY_LATER -Language=Bulgarian -ERROR_DBG_REPLY_LATER - Debugger will reply later. -. - -MessageId=690 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE -Language=Bulgarian -ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE - Debugger can not provide handle. -. - -MessageId=691 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_TERMINATE_THREAD -Language=Bulgarian -ERROR_DBG_TERMINATE_THREAD - Debugger terminated thread. -. - -MessageId=692 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_TERMINATE_PROCESS -Language=Bulgarian -ERROR_DBG_TERMINATE_PROCESS - Debugger terminated process. -. - -MessageId=693 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_CONTROL_C -Language=Bulgarian -ERROR_DBG_CONTROL_C - Debugger got control C. -. - -MessageId=694 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_PRINTEXCEPTION_C -Language=Bulgarian -ERROR_DBG_PRINTEXCEPTION_C - Debugger printed exception on control C. -. - -MessageId=695 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_RIPEXCEPTION -Language=Bulgarian -ERROR_DBG_RIPEXCEPTION - Debugger received RIP exception. -. - -MessageId=696 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_CONTROL_BREAK -Language=Bulgarian -ERROR_DBG_CONTROL_BREAK - Debugger received control break. -. - -MessageId=697 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_COMMAND_EXCEPTION -Language=Bulgarian -ERROR_DBG_COMMAND_EXCEPTION - Debugger command communication exception. -. - -MessageId=698 -Severity=Success -Facility=System -SymbolicName=ERROR_OBJECT_NAME_EXISTS -Language=Bulgarian -ERROR_OBJECT_NAME_EXISTS - An attempt was made to create an object and the object name already existed. -. - -MessageId=699 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_WAS_SUSPENDED -Language=Bulgarian -ERROR_THREAD_WAS_SUSPENDED - A thread termination occurred while the thread was suspended. The thread was resumed, and termination proceeded. -. - -MessageId=700 -Severity=Success -Facility=System -SymbolicName=ERROR_IMAGE_NOT_AT_BASE -Language=Bulgarian -ERROR_IMAGE_NOT_AT_BASE - An image file could not be mapped at the address specified in the image file. Local fixups must be performed on this image. -. - -MessageId=701 -Severity=Success -Facility=System -SymbolicName=ERROR_RXACT_STATE_CREATED -Language=Bulgarian -ERROR_RXACT_STATE_CREATED - This informational level status indicates that a specified registry sub-tree transaction state did not yet exist and had to be created. -. - -MessageId=702 -Severity=Success -Facility=System -SymbolicName=ERROR_SEGMENT_NOTIFICATION -Language=Bulgarian -ERROR_SEGMENT_NOTIFICATION - A virtual DOS machine (VDM) is loading, unloading, or moving an MS-DOS or Win16 program segment image. An exception is raised so a debugger can load, unload or track symbols and breakpoints within these 16-bit segments. -. - -MessageId=703 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_CURRENT_DIRECTORY -Language=Bulgarian -ERROR_BAD_CURRENT_DIRECTORY - The process cannot switch to the startup current directory %hs. Select OK to set current directory to %hs, or select CANCEL to exit. -. - -MessageId=704 -Severity=Success -Facility=System -SymbolicName=ERROR_FT_READ_RECOVERY_FROM_BACKUP -Language=Bulgarian -ERROR_FT_READ_RECOVERY_FROM_BACKUP - To satisfy a read request, the NT fault-tolerant file system successfully read the requested data from a redundant copy. This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was unable to reassign the failing area of the device. -. - -MessageId=705 -Severity=Success -Facility=System -SymbolicName=ERROR_FT_WRITE_RECOVERY -Language=Bulgarian -ERROR_FT_WRITE_RECOVERY - To satisfy a write request, the NT fault-tolerant file system successfully wrote a redundant copy of the information. This was done because the file system encountered a failure on a member of the fault-tolerant volume, but was not able to reassign the failing area of the device. -. - -MessageId=706 -Severity=Success -Facility=System -SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH -Language=Bulgarian -ERROR_IMAGE_MACHINE_TYPE_MISMATCH - The image file %hs is valid, but is for a machine type other than the current machine. Select OK to continue, or CANCEL to fail the DLL load. -. - -MessageId=707 -Severity=Success -Facility=System -SymbolicName=ERROR_RECEIVE_PARTIAL -Language=Bulgarian -ERROR_RECEIVE_PARTIAL - The network transport returned partial data to its client. The remaining data will be sent later. -. - -MessageId=708 -Severity=Success -Facility=System -SymbolicName=ERROR_RECEIVE_EXPEDITED -Language=Bulgarian -ERROR_RECEIVE_EXPEDITED - The network transport returned data to its client that was marked as expedited by the remote system. -. - -MessageId=709 -Severity=Success -Facility=System -SymbolicName=ERROR_RECEIVE_PARTIAL_EXPEDITED -Language=Bulgarian -ERROR_RECEIVE_PARTIAL_EXPEDITED - The network transport returned partial data to its client and this data was marked as expedited by the remote system. The remaining data will be sent later. -. - -MessageId=710 -Severity=Success -Facility=System -SymbolicName=ERROR_EVENT_DONE -Language=Bulgarian -ERROR_EVENT_DONE - The TDI indication has completed successfully. -. - -MessageId=711 -Severity=Success -Facility=System -SymbolicName=ERROR_EVENT_PENDING -Language=Bulgarian -ERROR_EVENT_PENDING - The TDI indication has entered the pending state. -. - -MessageId=712 -Severity=Success -Facility=System -SymbolicName=ERROR_CHECKING_FILE_SYSTEM -Language=Bulgarian -ERROR_CHECKING_FILE_SYSTEM - Checking file system on %wZ. -. - -MessageId=714 -Severity=Success -Facility=System -SymbolicName=ERROR_PREDEFINED_HANDLE -Language=Bulgarian -ERROR_PREDEFINED_HANDLE - The specified registry key is referenced by a predefined handle. -. - -MessageId=715 -Severity=Success -Facility=System -SymbolicName=ERROR_WAS_UNLOCKED -Language=Bulgarian -ERROR_WAS_UNLOCKED - The page protection of a locked page was changed to 'No Access' and the page was unlocked from memory and from the process. -. - -MessageId=717 -Severity=Success -Facility=System -SymbolicName=ERROR_WAS_LOCKED -Language=Bulgarian -ERROR_WAS_LOCKED - One of the pages to lock was already locked. -. - -MessageId=720 -Severity=Success -Facility=System -SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE -Language=Bulgarian -ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE - The image file %hs is valid, but is for a machine type other than the current machine. -. - -MessageId=721 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_YIELD_PERFORMED -Language=Bulgarian -ERROR_NO_YIELD_PERFORMED - A yield execution was performed and no thread was available to run. -. - -MessageId=722 -Severity=Success -Facility=System -SymbolicName=ERROR_TIMER_RESUME_IGNORED -Language=Bulgarian -ERROR_TIMER_RESUME_IGNORED - The resumable flag to a timer API was ignored. -. - -MessageId=723 -Severity=Success -Facility=System -SymbolicName=ERROR_ARBITRATION_UNHANDLED -Language=Bulgarian -ERROR_ARBITRATION_UNHANDLED - The arbiter has deferred arbitration of these resources to its parent. -. - -MessageId=724 -Severity=Success -Facility=System -SymbolicName=ERROR_CARDBUS_NOT_SUPPORTED -Language=Bulgarian -ERROR_CARDBUS_NOT_SUPPORTED - The device \"%hs\" has detected a CardBus card in its slot, but the firmware on this system is not configured to allow the CardBus controller to be run in CardBus mode. The operating system will currently accept only 16-bit (R2) pc-cards on this controller. -. - -MessageId=725 -Severity=Success -Facility=System -SymbolicName=ERROR_MP_PROCESSOR_MISMATCH -Language=Bulgarian -ERROR_MP_PROCESSOR_MISMATCH - The CPUs in this multiprocessor system are not all the same revision level. To use all processors the operating system restricts itself to the features of the least capable processor in the system. Should problems occur with this system, contact the CPU manufacturer to see if this mix of processors is supported. -. - -MessageId=726 -Severity=Success -Facility=System -SymbolicName=ERROR_HIBERNATED -Language=Bulgarian -ERROR_HIBERNATED - The system was put into hibernation. -. - -MessageId=727 -Severity=Success -Facility=System -SymbolicName=ERROR_RESUME_HIBERNATION -Language=Bulgarian -ERROR_RESUME_HIBERNATION - The system was resumed from hibernation. -. - -MessageId=728 -Severity=Success -Facility=System -SymbolicName=ERROR_FIRMWARE_UPDATED -Language=Bulgarian -ERROR_FIRMWARE_UPDATED - Windows has detected that the system firmware (BIOS) was updated [previous firmware date = %2, current firmware date %3]. -. - -MessageId=729 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVERS_LEAKING_LOCKED_PAGES -Language=Bulgarian -ERROR_DRIVERS_LEAKING_LOCKED_PAGES - A device driver is leaking locked I/O pages causing system degradation. The system has automatically enabled tracking code in order to try and catch the culprit. -. - -MessageId=730 -Severity=Success -Facility=System -SymbolicName=ERROR_WAKE_SYSTEM -Language=Bulgarian -ERROR_WAKE_SYSTEM - The system has awoken -. - -MessageId=741 -Severity=Success -Facility=System -SymbolicName=ERROR_REPARSE -Language=Bulgarian -ERROR_REPARSE - A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link. -. - -MessageId=742 -Severity=Success -Facility=System -SymbolicName=ERROR_OPLOCK_BREAK_IN_PROGRESS -Language=Bulgarian -ERROR_OPLOCK_BREAK_IN_PROGRESS - An open/create operation completed while an oplock break is underway. -. - -MessageId=743 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLUME_MOUNTED -Language=Bulgarian -ERROR_VOLUME_MOUNTED - A new volume has been mounted by a file system. -. - -MessageId=744 -Severity=Success -Facility=System -SymbolicName=ERROR_RXACT_COMMITTED -Language=Bulgarian -ERROR_RXACT_COMMITTED - This success level status indicates that the transaction state already exists for the registry sub-tree, but that a transaction commit was previously aborted. The commit has now been completed. -. - -MessageId=745 -Severity=Success -Facility=System -SymbolicName=ERROR_NOTIFY_CLEANUP -Language=Bulgarian -ERROR_NOTIFY_CLEANUP - This indicates that a notify change request has been completed due to closing the handle which made the notify change request. -. - -MessageId=746 -Severity=Success -Facility=System -SymbolicName=ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED -Language=Bulgarian -ERROR_PRIMARY_TRANSPORT_CONNECT_FAILED - An attempt was made to connect to the remote server %hs on the primary transport, but the connection failed. The computer WAS able to connect on a secondary transport. -. - -MessageId=747 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGE_FAULT_TRANSITION -Language=Bulgarian -ERROR_PAGE_FAULT_TRANSITION - Page fault was a transition fault. -. - -MessageId=748 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGE_FAULT_DEMAND_ZERO -Language=Bulgarian -ERROR_PAGE_FAULT_DEMAND_ZERO - Page fault was a demand zero fault. -. - -MessageId=749 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGE_FAULT_COPY_ON_WRITE -Language=Bulgarian -ERROR_PAGE_FAULT_COPY_ON_WRITE - Page fault was a demand zero fault. -. - -MessageId=750 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGE_FAULT_GUARD_PAGE -Language=Bulgarian -ERROR_PAGE_FAULT_GUARD_PAGE - Page fault was a demand zero fault. -. - -MessageId=751 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGE_FAULT_PAGING_FILE -Language=Bulgarian -ERROR_PAGE_FAULT_PAGING_FILE - Page fault was satisfied by reading from a secondary storage device. -. - -MessageId=752 -Severity=Success -Facility=System -SymbolicName=ERROR_CACHE_PAGE_LOCKED -Language=Bulgarian -ERROR_CACHE_PAGE_LOCKED - Cached page was locked during operation. -. - -MessageId=753 -Severity=Success -Facility=System -SymbolicName=ERROR_CRASH_DUMP -Language=Bulgarian -ERROR_CRASH_DUMP - Crash dump exists in paging file. -. - -MessageId=754 -Severity=Success -Facility=System -SymbolicName=ERROR_BUFFER_ALL_ZEROS -Language=Bulgarian -ERROR_BUFFER_ALL_ZEROS - Specified buffer contains all zeros. -. - -MessageId=755 -Severity=Success -Facility=System -SymbolicName=ERROR_REPARSE_OBJECT -Language=Bulgarian -ERROR_REPARSE_OBJECT - A reparse should be performed by the Object Manager since the name of the file resulted in a symbolic link. -. - -MessageId=756 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_REQUIREMENTS_CHANGED -Language=Bulgarian -ERROR_RESOURCE_REQUIREMENTS_CHANGED - The device has succeeded a query-stop and its resource requirements have changed. -. - -MessageId=757 -Severity=Success -Facility=System -SymbolicName=ERROR_TRANSLATION_COMPLETE -Language=Bulgarian -ERROR_TRANSLATION_COMPLETE - The translator has translated these resources into the global space and no further translations should be performed. -. - -MessageId=758 -Severity=Success -Facility=System -SymbolicName=ERROR_NOTHING_TO_TERMINATE -Language=Bulgarian -ERROR_NOTHING_TO_TERMINATE - A process being terminated has no threads to terminate. -. - -MessageId=759 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_NOT_IN_JOB -Language=Bulgarian -ERROR_PROCESS_NOT_IN_JOB - The specified process is not part of a job. -. - -MessageId=760 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_IN_JOB -Language=Bulgarian -ERROR_PROCESS_IN_JOB - The specified process is part of a job. -. - -MessageId=761 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLSNAP_HIBERNATE_READY -Language=Bulgarian -ERROR_VOLSNAP_HIBERNATE_READY - The system is now ready for hibernation. -. - -MessageId=762 -Severity=Success -Facility=System -SymbolicName=ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY -Language=Bulgarian -ERROR_FSFILTER_OP_COMPLETED_SUCCESSFULLY - A file system or file system filter driver has successfully completed an FsFilter operation. -. - -MessageId=763 -Severity=Success -Facility=System -SymbolicName=ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED -Language=Bulgarian -ERROR_INTERRUPT_VECTOR_ALREADY_CONNECTED - The specified interrupt vector was already connected. -. - -MessageId=764 -Severity=Success -Facility=System -SymbolicName=ERROR_INTERRUPT_STILL_CONNECTED -Language=Bulgarian -ERROR_INTERRUPT_STILL_CONNECTED - The specified interrupt vector is still connected. -. - -MessageId=765 -Severity=Success -Facility=System -SymbolicName=ERROR_WAIT_FOR_OPLOCK -Language=Bulgarian -ERROR_WAIT_FOR_OPLOCK - An operation is blocked waiting for an oplock. -. - -MessageId=766 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_EXCEPTION_HANDLED -Language=Bulgarian -ERROR_DBG_EXCEPTION_HANDLED - Debugger handled exception. -. - -MessageId=767 -Severity=Success -Facility=System -SymbolicName=ERROR_DBG_CONTINUE -Language=Bulgarian -ERROR_DBG_CONTINUE - Debugger continued -. - -MessageId=768 -Severity=Success -Facility=System -SymbolicName=ERROR_CALLBACK_POP_STACK -Language=Bulgarian -ERROR_CALLBACK_POP_STACK - An exception occurred in a user mode callback and the kernel callback frame should be removed. -. - -MessageId=769 -Severity=Success -Facility=System -SymbolicName=ERROR_COMPRESSION_DISABLED -Language=Bulgarian -ERROR_COMPRESSION_DISABLED - Compression is disabled for this volume. -. - -MessageId=770 -Severity=Success -Facility=System -SymbolicName=ERROR_CANTFETCHBACKWARDS -Language=Bulgarian -ERROR_CANTFETCHBACKWARDS - The data provider cannot fetch backwards through a result set. -. - -MessageId=771 -Severity=Success -Facility=System -SymbolicName=ERROR_CANTSCROLLBACKWARDS -Language=Bulgarian -ERROR_CANTSCROLLBACKWARDS - The data provider cannot scroll backwards through a result set. -. - -MessageId=772 -Severity=Success -Facility=System -SymbolicName=ERROR_ROWSNOTRELEASED -Language=Bulgarian -ERROR_ROWSNOTRELEASED - The data provider requires that previously fetched data is released before asking for more data. -. - -MessageId=773 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_ACCESSOR_FLAGS -Language=Bulgarian -ERROR_BAD_ACCESSOR_FLAGS - The data provider was not able to interpret the flags set for a column binding in an accessor. -. - -MessageId=774 -Severity=Success -Facility=System -SymbolicName=ERROR_ERRORS_ENCOUNTERED -Language=Bulgarian -ERROR_ERRORS_ENCOUNTERED - One or more errors occurred while processing the request. -. - -MessageId=775 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_CAPABLE -Language=Bulgarian -ERROR_NOT_CAPABLE - The implementation is not capable of performing the request. -. - -MessageId=776 -Severity=Success -Facility=System -SymbolicName=ERROR_REQUEST_OUT_OF_SEQUENCE -Language=Bulgarian -ERROR_REQUEST_OUT_OF_SEQUENCE - The client of a component requested an operation which is not valid given the state of the component instance. -. - -MessageId=777 -Severity=Success -Facility=System -SymbolicName=ERROR_VERSION_PARSE_ERROR -Language=Bulgarian -ERROR_VERSION_PARSE_ERROR - A version number could not be parsed. -. - -MessageId=778 -Severity=Success -Facility=System -SymbolicName=ERROR_BADSTARTPOSITION -Language=Bulgarian -ERROR_BADSTARTPOSITION - The iterator's start position is invalid. -. - -MessageId=994 -Severity=Success -Facility=System -SymbolicName=ERROR_EA_ACCESS_DENIED -Language=Bulgarian -ERROR_EA_ACCESS_DENIED - Access to the extended attribute was denied. -. - -MessageId=995 -Severity=Success -Facility=System -SymbolicName=ERROR_OPERATION_ABORTED -Language=Bulgarian -ERROR_OPERATION_ABORTED - The I/O operation has been aborted because of either a thread exit or an application request. -. - -MessageId=996 -Severity=Success -Facility=System -SymbolicName=ERROR_IO_INCOMPLETE -Language=Bulgarian -ERROR_IO_INCOMPLETE - Overlapped I/O event is not in a signaled state. -. - -MessageId=997 -Severity=Success -Facility=System -SymbolicName=ERROR_IO_PENDING -Language=Bulgarian -ERROR_IO_PENDING - Overlapped I/O operation is in progress. -. - -MessageId=998 -Severity=Success -Facility=System -SymbolicName=ERROR_NOACCESS -Language=Bulgarian -ERROR_NOACCESS - Invalid access to memory location. -. - -MessageId=999 -Severity=Success -Facility=System -SymbolicName=ERROR_SWAPERROR -Language=Bulgarian -ERROR_SWAPERROR - Error performing inpage operation. -. - -MessageId=1001 -Severity=Success -Facility=System -SymbolicName=ERROR_STACK_OVERFLOW -Language=Bulgarian -ERROR_STACK_OVERFLOW - Recursion too deep; the stack overflowed. -. - -MessageId=1002 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MESSAGE -Language=Bulgarian -ERROR_INVALID_MESSAGE - The window cannot act on the sent message. -. - -MessageId=1003 -Severity=Success -Facility=System -SymbolicName=ERROR_CAN_NOT_COMPLETE -Language=Bulgarian -ERROR_CAN_NOT_COMPLETE - Cannot complete this function. -. - -MessageId=1004 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FLAGS -Language=Bulgarian -ERROR_INVALID_FLAGS - Invalid flags. -. - -MessageId=1005 -Severity=Success -Facility=System -SymbolicName=ERROR_UNRECOGNIZED_VOLUME -Language=Bulgarian -ERROR_UNRECOGNIZED_VOLUME - The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupted. -. - -MessageId=1006 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_INVALID -Language=Bulgarian -ERROR_FILE_INVALID - The volume for a file has been externally altered so that the opened file is no longer valid. -. - -MessageId=1007 -Severity=Success -Facility=System -SymbolicName=ERROR_FULLSCREEN_MODE -Language=Bulgarian -ERROR_FULLSCREEN_MODE - The requested operation cannot be performed in full-screen mode. -. - -MessageId=1008 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_TOKEN -Language=Bulgarian -ERROR_NO_TOKEN - An attempt was made to reference a token that does not exist. -. - -MessageId=1009 -Severity=Success -Facility=System -SymbolicName=ERROR_BADDB -Language=Bulgarian -ERROR_BADDB - The configuration registry database is corrupt. -. - -MessageId=1010 -Severity=Success -Facility=System -SymbolicName=ERROR_BADKEY -Language=Bulgarian -ERROR_BADKEY - The configuration registry key is invalid. -. - -MessageId=1011 -Severity=Success -Facility=System -SymbolicName=ERROR_CANTOPEN -Language=Bulgarian -ERROR_CANTOPEN - The configuration registry key could not be opened. -. - -MessageId=1012 -Severity=Success -Facility=System -SymbolicName=ERROR_CANTREAD -Language=Bulgarian -ERROR_CANTREAD - The configuration registry key could not be read. -. - -MessageId=1013 -Severity=Success -Facility=System -SymbolicName=ERROR_CANTWRITE -Language=Bulgarian -ERROR_CANTWRITE - The configuration registry key could not be written. -. - -MessageId=1014 -Severity=Success -Facility=System -SymbolicName=ERROR_REGISTRY_RECOVERED -Language=Bulgarian -ERROR_REGISTRY_RECOVERED - One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful. -. - -MessageId=1015 -Severity=Success -Facility=System -SymbolicName=ERROR_REGISTRY_CORRUPT -Language=Bulgarian -ERROR_REGISTRY_CORRUPT - The registry is corrupted. The structure of one of the files containing registry data is corrupted, or the system's memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted. -. - -MessageId=1016 -Severity=Success -Facility=System -SymbolicName=ERROR_REGISTRY_IO_FAILED -Language=Bulgarian -ERROR_REGISTRY_IO_FAILED - An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry. -. - -MessageId=1017 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_REGISTRY_FILE -Language=Bulgarian -ERROR_NOT_REGISTRY_FILE - The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format. -. - -MessageId=1018 -Severity=Success -Facility=System -SymbolicName=ERROR_KEY_DELETED -Language=Bulgarian -ERROR_KEY_DELETED - Illegal operation attempted on a registry key that has been marked for deletion. -. - -MessageId=1019 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_LOG_SPACE -Language=Bulgarian -ERROR_NO_LOG_SPACE - System could not allocate the required space in a registry log. -. - -MessageId=1020 -Severity=Success -Facility=System -SymbolicName=ERROR_KEY_HAS_CHILDREN -Language=Bulgarian -ERROR_KEY_HAS_CHILDREN - Cannot create a symbolic link in a registry key that already has subkeys or values. -. - -MessageId=1021 -Severity=Success -Facility=System -SymbolicName=ERROR_CHILD_MUST_BE_VOLATILE -Language=Bulgarian -ERROR_CHILD_MUST_BE_VOLATILE - Cannot create a stable subkey under a volatile parent key. -. - -MessageId=1022 -Severity=Success -Facility=System -SymbolicName=ERROR_NOTIFY_ENUM_DIR -Language=Bulgarian -ERROR_NOTIFY_ENUM_DIR - A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes. -. - -MessageId=1051 -Severity=Success -Facility=System -SymbolicName=ERROR_DEPENDENT_SERVICES_RUNNING -Language=Bulgarian -ERROR_DEPENDENT_SERVICES_RUNNING - A stop control has been sent to a service that other running services are dependent on. -. - -MessageId=1052 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SERVICE_CONTROL -Language=Bulgarian -ERROR_INVALID_SERVICE_CONTROL - The requested control is not valid for this service. -. - -MessageId=1053 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_REQUEST_TIMEOUT -Language=Bulgarian -ERROR_SERVICE_REQUEST_TIMEOUT - The service did not respond to the start or control request in a timely fashion. -. - -MessageId=1054 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_NO_THREAD -Language=Bulgarian -ERROR_SERVICE_NO_THREAD - A thread could not be created for the service. -. - -MessageId=1055 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_DATABASE_LOCKED -Language=Bulgarian -ERROR_SERVICE_DATABASE_LOCKED - The service database is locked. -. - -MessageId=1056 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_ALREADY_RUNNING -Language=Bulgarian -ERROR_SERVICE_ALREADY_RUNNING - An instance of the service is already running. -. - -MessageId=1057 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SERVICE_ACCOUNT -Language=Bulgarian -ERROR_INVALID_SERVICE_ACCOUNT - The account name is invalid or does not exist, or the password is invalid for the account name specified. -. - -MessageId=1058 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_DISABLED -Language=Bulgarian -ERROR_SERVICE_DISABLED - The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. -. - -MessageId=1059 -Severity=Success -Facility=System -SymbolicName=ERROR_CIRCULAR_DEPENDENCY -Language=Bulgarian -ERROR_CIRCULAR_DEPENDENCY - Circular service dependency was specified. -. - -MessageId=1060 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_DOES_NOT_EXIST -Language=Bulgarian -ERROR_SERVICE_DOES_NOT_EXIST - The specified service does not exist as an installed service. -. - -MessageId=1061 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_CANNOT_ACCEPT_CTRL -Language=Bulgarian -ERROR_SERVICE_CANNOT_ACCEPT_CTRL - The service cannot accept control messages at this time. -. - -MessageId=1062 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_NOT_ACTIVE -Language=Bulgarian -ERROR_SERVICE_NOT_ACTIVE - The service has not been started. -. - -MessageId=1063 -Severity=Success -Facility=System -SymbolicName=ERROR_FAILED_SERVICE_CONTROLLER_CONNECT -Language=Bulgarian -ERROR_FAILED_SERVICE_CONTROLLER_CONNECT - The service process could not connect to the service controller. -. - -MessageId=1064 -Severity=Success -Facility=System -SymbolicName=ERROR_EXCEPTION_IN_SERVICE -Language=Bulgarian -ERROR_EXCEPTION_IN_SERVICE - An exception occurred in the service when handling the control request. -. - -MessageId=1065 -Severity=Success -Facility=System -SymbolicName=ERROR_DATABASE_DOES_NOT_EXIST -Language=Bulgarian -ERROR_DATABASE_DOES_NOT_EXIST - The database specified does not exist. -. - -MessageId=1066 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_SPECIFIC_ERROR -Language=Bulgarian -ERROR_SERVICE_SPECIFIC_ERROR - The service has returned a service-specific error code. -. - -MessageId=1067 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_ABORTED -Language=Bulgarian -ERROR_PROCESS_ABORTED - The process terminated unexpectedly. -. - -MessageId=1068 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_DEPENDENCY_FAIL -Language=Bulgarian -ERROR_SERVICE_DEPENDENCY_FAIL - The dependency service or group failed to start. -. - -MessageId=1069 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_LOGON_FAILED -Language=Bulgarian -ERROR_SERVICE_LOGON_FAILED - The service did not start due to a logon failure. -. - -MessageId=1070 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_START_HANG -Language=Bulgarian -ERROR_SERVICE_START_HANG - After starting, the service hung in a start-pending state. -. - -MessageId=1071 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SERVICE_LOCK -Language=Bulgarian -ERROR_INVALID_SERVICE_LOCK - The specified service database lock is invalid. -. - -MessageId=1072 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_MARKED_FOR_DELETE -Language=Bulgarian -ERROR_SERVICE_MARKED_FOR_DELETE - The specified service has been marked for deletion. -. - -MessageId=1073 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_EXISTS -Language=Bulgarian -ERROR_SERVICE_EXISTS - The specified service already exists. -. - -MessageId=1074 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_RUNNING_LKG -Language=Bulgarian -ERROR_ALREADY_RUNNING_LKG - The system is currently running with the last-known-good configuration. -. - -MessageId=1075 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_DEPENDENCY_DELETED -Language=Bulgarian -ERROR_SERVICE_DEPENDENCY_DELETED - The dependency service does not exist or has been marked for deletion. -. - -MessageId=1076 -Severity=Success -Facility=System -SymbolicName=ERROR_BOOT_ALREADY_ACCEPTED -Language=Bulgarian -ERROR_BOOT_ALREADY_ACCEPTED - The current boot has already been accepted for use as the last-known-good control set. -. - -MessageId=1077 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_NEVER_STARTED -Language=Bulgarian -ERROR_SERVICE_NEVER_STARTED - No attempts to start the service have been made since the last boot. -. - -MessageId=1078 -Severity=Success -Facility=System -SymbolicName=ERROR_DUPLICATE_SERVICE_NAME -Language=Bulgarian -ERROR_DUPLICATE_SERVICE_NAME - The name is already in use as either a service name or a service display name. -. - -MessageId=1079 -Severity=Success -Facility=System -SymbolicName=ERROR_DIFFERENT_SERVICE_ACCOUNT -Language=Bulgarian -ERROR_DIFFERENT_SERVICE_ACCOUNT - The account specified for this service is different from the account specified for other services running in the same process. -. - -MessageId=1080 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_DETECT_DRIVER_FAILURE -Language=Bulgarian -ERROR_CANNOT_DETECT_DRIVER_FAILURE - Failure actions can only be set for Win32 services, not for drivers. -. - -MessageId=1081 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_DETECT_PROCESS_ABORT -Language=Bulgarian -ERROR_CANNOT_DETECT_PROCESS_ABORT - This service runs in the same process as the service control manager. Therefore, the service control manager cannot take action if this service's process terminates unexpectedly. -. - -MessageId=1082 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_RECOVERY_PROGRAM -Language=Bulgarian -ERROR_NO_RECOVERY_PROGRAM - No recovery program has been configured for this service. -. - -MessageId=1083 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_NOT_IN_EXE -Language=Bulgarian -ERROR_SERVICE_NOT_IN_EXE - The executable program that this service is configured to run in does not implement the service. -. - -MessageId=1084 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SAFEBOOT_SERVICE -Language=Bulgarian -ERROR_NOT_SAFEBOOT_SERVICE - This service cannot be started in Safe Mode. -. - -MessageId=1100 -Severity=Success -Facility=System -SymbolicName=ERROR_END_OF_MEDIA -Language=Bulgarian -ERROR_END_OF_MEDIA - The physical end of the tape has been reached. -. - -MessageId=1101 -Severity=Success -Facility=System -SymbolicName=ERROR_FILEMARK_DETECTED -Language=Bulgarian -ERROR_FILEMARK_DETECTED - A tape access reached a filemark. -. - -MessageId=1102 -Severity=Success -Facility=System -SymbolicName=ERROR_BEGINNING_OF_MEDIA -Language=Bulgarian -ERROR_BEGINNING_OF_MEDIA - The beginning of the tape or a partition was encountered. -. - -MessageId=1103 -Severity=Success -Facility=System -SymbolicName=ERROR_SETMARK_DETECTED -Language=Bulgarian -ERROR_SETMARK_DETECTED - A tape access reached the end of a set of files. -. - -MessageId=1104 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_DATA_DETECTED -Language=Bulgarian -ERROR_NO_DATA_DETECTED - No more data is on the tape. -. - -MessageId=1105 -Severity=Success -Facility=System -SymbolicName=ERROR_PARTITION_FAILURE -Language=Bulgarian -ERROR_PARTITION_FAILURE - Tape could not be partitioned. -. - -MessageId=1106 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_BLOCK_LENGTH -Language=Bulgarian -ERROR_INVALID_BLOCK_LENGTH - When accessing a new tape of a multivolume partition, the current block size is incorrect. -. - -MessageId=1107 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_NOT_PARTITIONED -Language=Bulgarian -ERROR_DEVICE_NOT_PARTITIONED - Tape partition information could not be found when loading a tape. -. - -MessageId=1108 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_LOCK_MEDIA -Language=Bulgarian -ERROR_UNABLE_TO_LOCK_MEDIA - Unable to lock the media eject mechanism. -. - -MessageId=1109 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_UNLOAD_MEDIA -Language=Bulgarian -ERROR_UNABLE_TO_UNLOAD_MEDIA - Unable to unload the media. -. - -MessageId=1110 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_CHANGED -Language=Bulgarian -ERROR_MEDIA_CHANGED - The media in the drive may have changed. -. - -MessageId=1111 -Severity=Success -Facility=System -SymbolicName=ERROR_BUS_RESET -Language=Bulgarian -ERROR_BUS_RESET - The I/O bus was reset. -. - -MessageId=1112 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MEDIA_IN_DRIVE -Language=Bulgarian -ERROR_NO_MEDIA_IN_DRIVE - No media in drive. -. - -MessageId=1113 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_UNICODE_TRANSLATION -Language=Bulgarian -ERROR_NO_UNICODE_TRANSLATION - No mapping for the Unicode character exists in the target multi-byte code page. -. - -MessageId=1114 -Severity=Success -Facility=System -SymbolicName=ERROR_DLL_INIT_FAILED -Language=Bulgarian -ERROR_DLL_INIT_FAILED - A dynamic link library (DLL) initialization routine failed. -. - -MessageId=1115 -Severity=Success -Facility=System -SymbolicName=ERROR_SHUTDOWN_IN_PROGRESS -Language=Bulgarian -ERROR_SHUTDOWN_IN_PROGRESS - A system shutdown is in progress. -. - -MessageId=1116 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SHUTDOWN_IN_PROGRESS -Language=Bulgarian -ERROR_NO_SHUTDOWN_IN_PROGRESS - Unable to abort the system shutdown because no shutdown was in progress. -. - -MessageId=1117 -Severity=Success -Facility=System -SymbolicName=ERROR_IO_DEVICE -Language=Bulgarian -ERROR_IO_DEVICE - The request could not be performed because of an I/O device error. -. - -MessageId=1118 -Severity=Success -Facility=System -SymbolicName=ERROR_SERIAL_NO_DEVICE -Language=Bulgarian -ERROR_SERIAL_NO_DEVICE - No serial device was successfully initialized. The serial driver will unload. -. - -MessageId=1119 -Severity=Success -Facility=System -SymbolicName=ERROR_IRQ_BUSY -Language=Bulgarian -ERROR_IRQ_BUSY - Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened. -. - -MessageId=1120 -Severity=Success -Facility=System -SymbolicName=ERROR_MORE_WRITES -Language=Bulgarian -ERROR_MORE_WRITES - A serial I/O operation was completed by another write to the serial port. (The IOCTL_SERIAL_XOFF_COUNTER reached zero.) -. - -MessageId=1121 -Severity=Success -Facility=System -SymbolicName=ERROR_COUNTER_TIMEOUT -Language=Bulgarian -ERROR_COUNTER_TIMEOUT - A serial I/O operation completed because the timeout period expired. (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.) -. - -MessageId=1122 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOPPY_ID_MARK_NOT_FOUND -Language=Bulgarian -ERROR_FLOPPY_ID_MARK_NOT_FOUND - No ID address mark was found on the floppy disk. -. - -MessageId=1123 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOPPY_WRONG_CYLINDER -Language=Bulgarian -ERROR_FLOPPY_WRONG_CYLINDER - Mismatch between the floppy disk sector ID field and the floppy disk controller track address. -. - -MessageId=1124 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOPPY_UNKNOWN_ERROR -Language=Bulgarian -ERROR_FLOPPY_UNKNOWN_ERROR - The floppy disk controller reported an error that is not recognized by the floppy disk driver. -. - -MessageId=1125 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOPPY_BAD_REGISTERS -Language=Bulgarian -ERROR_FLOPPY_BAD_REGISTERS - The floppy disk controller returned inconsistent results in its registers. -. - -MessageId=1126 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_RECALIBRATE_FAILED -Language=Bulgarian -ERROR_DISK_RECALIBRATE_FAILED - While accessing the hard disk, a recalibrate operation failed, even after retries. -. - -MessageId=1127 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_OPERATION_FAILED -Language=Bulgarian -ERROR_DISK_OPERATION_FAILED - While accessing the hard disk, a disk operation failed even after retries. -. - -MessageId=1128 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_RESET_FAILED -Language=Bulgarian -ERROR_DISK_RESET_FAILED - While accessing the hard disk, a disk controller reset was needed, but even that failed. -. - -MessageId=1129 -Severity=Success -Facility=System -SymbolicName=ERROR_EOM_OVERFLOW -Language=Bulgarian -ERROR_EOM_OVERFLOW - Physical end of tape encountered. -. - -MessageId=1130 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_ENOUGH_SERVER_MEMORY -Language=Bulgarian -ERROR_NOT_ENOUGH_SERVER_MEMORY - Not enough server storage is available to process this command. -. - -MessageId=1131 -Severity=Success -Facility=System -SymbolicName=ERROR_POSSIBLE_DEADLOCK -Language=Bulgarian -ERROR_POSSIBLE_DEADLOCK - A potential deadlock condition has been detected. -. - -MessageId=1132 -Severity=Success -Facility=System -SymbolicName=ERROR_MAPPED_ALIGNMENT -Language=Bulgarian -ERROR_MAPPED_ALIGNMENT - The base address or the file offset specified does not have the proper alignment. -. - -MessageId=1140 -Severity=Success -Facility=System -SymbolicName=ERROR_SET_POWER_STATE_VETOED -Language=Bulgarian -ERROR_SET_POWER_STATE_VETOED - An attempt to change the system power state was vetoed by another application or driver. -. - -MessageId=1141 -Severity=Success -Facility=System -SymbolicName=ERROR_SET_POWER_STATE_FAILED -Language=Bulgarian -ERROR_SET_POWER_STATE_FAILED - The system BIOS failed an attempt to change the system power state. -. - -MessageId=1142 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_LINKS -Language=Bulgarian -ERROR_TOO_MANY_LINKS - An attempt was made to create more links on a file than the file system supports. -. - -MessageId=1150 -Severity=Success -Facility=System -SymbolicName=ERROR_OLD_WIN_VERSION -Language=Bulgarian -ERROR_OLD_WIN_VERSION - The specified program requires a newer version of Windows. -. - -MessageId=1151 -Severity=Success -Facility=System -SymbolicName=ERROR_APP_WRONG_OS -Language=Bulgarian -ERROR_APP_WRONG_OS - The specified program is not a Windows or MS-DOS program. -. - -MessageId=1152 -Severity=Success -Facility=System -SymbolicName=ERROR_SINGLE_INSTANCE_APP -Language=Bulgarian -ERROR_SINGLE_INSTANCE_APP - Cannot start more than one instance of the specified program. -. - -MessageId=1153 -Severity=Success -Facility=System -SymbolicName=ERROR_RMODE_APP -Language=Bulgarian -ERROR_RMODE_APP - The specified program was written for an earlier version of Windows. -. - -MessageId=1154 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DLL -Language=Bulgarian -ERROR_INVALID_DLL - One of the library files needed to run this application is damaged. -. - -MessageId=1155 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_ASSOCIATION -Language=Bulgarian -ERROR_NO_ASSOCIATION - No application is associated with the specified file for this operation. -. - -MessageId=1156 -Severity=Success -Facility=System -SymbolicName=ERROR_DDE_FAIL -Language=Bulgarian -ERROR_DDE_FAIL - An error occurred in sending the command to the application. -. - -MessageId=1157 -Severity=Success -Facility=System -SymbolicName=ERROR_DLL_NOT_FOUND -Language=Bulgarian -ERROR_DLL_NOT_FOUND - One of the library files needed to run this application cannot be found. -. - -MessageId=1158 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_USER_HANDLES -Language=Bulgarian -ERROR_NO_MORE_USER_HANDLES - The current process has used all of its system allowance of handles for Window Manager objects. -. - -MessageId=1159 -Severity=Success -Facility=System -SymbolicName=ERROR_MESSAGE_SYNC_ONLY -Language=Bulgarian -ERROR_MESSAGE_SYNC_ONLY - The message can be used only with synchronous operations. -. - -MessageId=1160 -Severity=Success -Facility=System -SymbolicName=ERROR_SOURCE_ELEMENT_EMPTY -Language=Bulgarian -ERROR_SOURCE_ELEMENT_EMPTY - The indicated source element has no media. -. - -MessageId=1161 -Severity=Success -Facility=System -SymbolicName=ERROR_DESTINATION_ELEMENT_FULL -Language=Bulgarian -ERROR_DESTINATION_ELEMENT_FULL - The indicated destination element already contains media. -. - -MessageId=1162 -Severity=Success -Facility=System -SymbolicName=ERROR_ILLEGAL_ELEMENT_ADDRESS -Language=Bulgarian -ERROR_ILLEGAL_ELEMENT_ADDRESS - The indicated element does not exist. -. - -MessageId=1163 -Severity=Success -Facility=System -SymbolicName=ERROR_MAGAZINE_NOT_PRESENT -Language=Bulgarian -ERROR_MAGAZINE_NOT_PRESENT - The indicated element is part of a magazine that is not present. -. - -MessageId=1164 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_REINITIALIZATION_NEEDED -Language=Bulgarian -ERROR_DEVICE_REINITIALIZATION_NEEDED - The indicated device requires reinitialization due to hardware errors. -. - -MessageId=1165 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_REQUIRES_CLEANING -Language=Bulgarian -ERROR_DEVICE_REQUIRES_CLEANING - The device has indicated that cleaning is required before further operations are attempted. -. - -MessageId=1166 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_DOOR_OPEN -Language=Bulgarian -ERROR_DEVICE_DOOR_OPEN - The device has indicated that its door is open. -. - -MessageId=1167 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_NOT_CONNECTED -Language=Bulgarian -ERROR_DEVICE_NOT_CONNECTED - The device is not connected. -. - -MessageId=1168 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_FOUND -Language=Bulgarian -ERROR_NOT_FOUND - Element not found. -. - -MessageId=1169 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MATCH -Language=Bulgarian -ERROR_NO_MATCH - There was no match for the specified key in the index. -. - -MessageId=1170 -Severity=Success -Facility=System -SymbolicName=ERROR_SET_NOT_FOUND -Language=Bulgarian -ERROR_SET_NOT_FOUND - The property set specified does not exist on the object. -. - -MessageId=1171 -Severity=Success -Facility=System -SymbolicName=ERROR_POINT_NOT_FOUND -Language=Bulgarian -ERROR_POINT_NOT_FOUND - The point passed to GetMouseMovePointsEx is not in the buffer. -. - -MessageId=1172 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_TRACKING_SERVICE -Language=Bulgarian -ERROR_NO_TRACKING_SERVICE - The tracking (workstation) service is not running. -. - -MessageId=1173 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_VOLUME_ID -Language=Bulgarian -ERROR_NO_VOLUME_ID - The Volume ID could not be found. -. - -MessageId=1175 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_REMOVE_REPLACED -Language=Bulgarian -ERROR_UNABLE_TO_REMOVE_REPLACED - Unable to remove the file to be replaced. -. - -MessageId=1176 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_MOVE_REPLACEMENT -Language=Bulgarian -ERROR_UNABLE_TO_MOVE_REPLACEMENT - Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name. -. - -MessageId=1177 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 -Language=Bulgarian -ERROR_UNABLE_TO_MOVE_REPLACEMENT_2 - Unable to move the replacement file to the file to be replaced. The file to be replaced has been renamed using the backup name. -. - -MessageId=1178 -Severity=Success -Facility=System -SymbolicName=ERROR_JOURNAL_DELETE_IN_PROGRESS -Language=Bulgarian -ERROR_JOURNAL_DELETE_IN_PROGRESS - The volume change journal is being deleted. -. - -MessageId=1179 -Severity=Success -Facility=System -SymbolicName=ERROR_JOURNAL_NOT_ACTIVE -Language=Bulgarian -ERROR_JOURNAL_NOT_ACTIVE - The volume change journal is not active. -. - -MessageId=1180 -Severity=Success -Facility=System -SymbolicName=ERROR_POTENTIAL_FILE_FOUND -Language=Bulgarian -ERROR_POTENTIAL_FILE_FOUND - A file was found, but it may not be the correct file. -. - -MessageId=1181 -Severity=Success -Facility=System -SymbolicName=ERROR_JOURNAL_ENTRY_DELETED -Language=Bulgarian -ERROR_JOURNAL_ENTRY_DELETED - The journal entry has been deleted from the journal. -. - -MessageId=1200 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DEVICE -Language=Bulgarian -ERROR_BAD_DEVICE - The specified device name is invalid. -. - -MessageId=1201 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_UNAVAIL -Language=Bulgarian -ERROR_CONNECTION_UNAVAIL - The device is not currently connected but it is a remembered connection. -. - -MessageId=1202 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_ALREADY_REMEMBERED -Language=Bulgarian -ERROR_DEVICE_ALREADY_REMEMBERED - The local device name has a remembered connection to another network resource. -. - -MessageId=1203 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_NET_OR_BAD_PATH -Language=Bulgarian -ERROR_NO_NET_OR_BAD_PATH - The network path was either typed incorrectly, does not exist, or the network provider is not currently available. Please try retyping the path or contact your network administrator. -. - -MessageId=1204 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_PROVIDER -Language=Bulgarian -ERROR_BAD_PROVIDER - The specified network provider name is invalid. -. - -MessageId=1205 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_OPEN_PROFILE -Language=Bulgarian -ERROR_CANNOT_OPEN_PROFILE - Unable to open the network connection profile. -. - -MessageId=1206 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_PROFILE -Language=Bulgarian -ERROR_BAD_PROFILE - The network connection profile is corrupted. -. - -MessageId=1207 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_CONTAINER -Language=Bulgarian -ERROR_NOT_CONTAINER - Cannot enumerate a noncontainer. -. - -MessageId=1208 -Severity=Success -Facility=System -SymbolicName=ERROR_EXTENDED_ERROR -Language=Bulgarian -ERROR_EXTENDED_ERROR - An extended error has occurred. -. - -MessageId=1209 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_GROUPNAME -Language=Bulgarian -ERROR_INVALID_GROUPNAME - The format of the specified group name is invalid. -. - -MessageId=1210 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_COMPUTERNAME -Language=Bulgarian -ERROR_INVALID_COMPUTERNAME - The format of the specified computer name is invalid. -. - -MessageId=1211 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EVENTNAME -Language=Bulgarian -ERROR_INVALID_EVENTNAME - The format of the specified event name is invalid. -. - -MessageId=1212 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DOMAINNAME -Language=Bulgarian -ERROR_INVALID_DOMAINNAME - The format of the specified domain name is invalid. -. - -MessageId=1213 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SERVICENAME -Language=Bulgarian -ERROR_INVALID_SERVICENAME - The format of the specified service name is invalid. -. - -MessageId=1214 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_NETNAME -Language=Bulgarian -ERROR_INVALID_NETNAME - The format of the specified network name is invalid. -. - -MessageId=1215 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SHARENAME -Language=Bulgarian -ERROR_INVALID_SHARENAME - The format of the specified share name is invalid. -. - -MessageId=1216 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PASSWORDNAME -Language=Bulgarian -ERROR_INVALID_PASSWORDNAME - The format of the specified password is invalid. -. - -MessageId=1217 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MESSAGENAME -Language=Bulgarian -ERROR_INVALID_MESSAGENAME - The format of the specified message name is invalid. -. - -MessageId=1218 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MESSAGEDEST -Language=Bulgarian -ERROR_INVALID_MESSAGEDEST - The format of the specified message destination is invalid. -. - -MessageId=1219 -Severity=Success -Facility=System -SymbolicName=ERROR_SESSION_CREDENTIAL_CONFLICT -Language=Bulgarian -ERROR_SESSION_CREDENTIAL_CONFLICT - Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. -. - -MessageId=1220 -Severity=Success -Facility=System -SymbolicName=ERROR_REMOTE_SESSION_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_REMOTE_SESSION_LIMIT_EXCEEDED - An attempt was made to establish a session to a network server, but there are already too many sessions established to that server. -. - -MessageId=1221 -Severity=Success -Facility=System -SymbolicName=ERROR_DUP_DOMAINNAME -Language=Bulgarian -ERROR_DUP_DOMAINNAME - The workgroup or domain name is already in use by another computer on the network. -. - -MessageId=1222 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_NETWORK -Language=Bulgarian -ERROR_NO_NETWORK - The network is not present or not started. -. - -MessageId=1223 -Severity=Success -Facility=System -SymbolicName=ERROR_CANCELLED -Language=Bulgarian -ERROR_CANCELLED - The operation was canceled by the user. -. - -MessageId=1224 -Severity=Success -Facility=System -SymbolicName=ERROR_USER_MAPPED_FILE -Language=Bulgarian -ERROR_USER_MAPPED_FILE - The requested operation cannot be performed on a file with a user-mapped section open. -. - -MessageId=1225 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_REFUSED -Language=Bulgarian -ERROR_CONNECTION_REFUSED - The remote system refused the network connection. -. - -MessageId=1226 -Severity=Success -Facility=System -SymbolicName=ERROR_GRACEFUL_DISCONNECT -Language=Bulgarian -ERROR_GRACEFUL_DISCONNECT - The network connection was gracefully closed. -. - -MessageId=1227 -Severity=Success -Facility=System -SymbolicName=ERROR_ADDRESS_ALREADY_ASSOCIATED -Language=Bulgarian -ERROR_ADDRESS_ALREADY_ASSOCIATED - The network transport endpoint already has an address associated with it. -. - -MessageId=1228 -Severity=Success -Facility=System -SymbolicName=ERROR_ADDRESS_NOT_ASSOCIATED -Language=Bulgarian -ERROR_ADDRESS_NOT_ASSOCIATED - An address has not yet been associated with the network endpoint. -. - -MessageId=1229 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_INVALID -Language=Bulgarian -ERROR_CONNECTION_INVALID - An operation was attempted on a nonexistent network connection. -. - -MessageId=1230 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_ACTIVE -Language=Bulgarian -ERROR_CONNECTION_ACTIVE - An invalid operation was attempted on an active network connection. -. - -MessageId=1231 -Severity=Success -Facility=System -SymbolicName=ERROR_NETWORK_UNREACHABLE -Language=Bulgarian -ERROR_NETWORK_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. -. - -MessageId=1232 -Severity=Success -Facility=System -SymbolicName=ERROR_HOST_UNREACHABLE -Language=Bulgarian -ERROR_HOST_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. -. - -MessageId=1233 -Severity=Success -Facility=System -SymbolicName=ERROR_PROTOCOL_UNREACHABLE -Language=Bulgarian -ERROR_PROTOCOL_UNREACHABLE - The network location cannot be reached. For information about network troubleshooting, see Windows Help. -. - -MessageId=1234 -Severity=Success -Facility=System -SymbolicName=ERROR_PORT_UNREACHABLE -Language=Bulgarian -ERROR_PORT_UNREACHABLE - No service is operating at the destination network endpoint on the remote system. -. - -MessageId=1235 -Severity=Success -Facility=System -SymbolicName=ERROR_REQUEST_ABORTED -Language=Bulgarian -ERROR_REQUEST_ABORTED - The request was aborted. -. - -MessageId=1236 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_ABORTED -Language=Bulgarian -ERROR_CONNECTION_ABORTED - The network connection was aborted by the local system. -. - -MessageId=1237 -Severity=Success -Facility=System -SymbolicName=ERROR_RETRY -Language=Bulgarian -ERROR_RETRY - The operation could not be completed. A retry should be performed. -. - -MessageId=1238 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTION_COUNT_LIMIT -Language=Bulgarian -ERROR_CONNECTION_COUNT_LIMIT - A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached. -. - -MessageId=1239 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGIN_TIME_RESTRICTION -Language=Bulgarian -ERROR_LOGIN_TIME_RESTRICTION - Attempting to log in during an unauthorized time of day for this account. -. - -MessageId=1240 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGIN_WKSTA_RESTRICTION -Language=Bulgarian -ERROR_LOGIN_WKSTA_RESTRICTION - The account is not authorized to log in from this station. -. - -MessageId=1241 -Severity=Success -Facility=System -SymbolicName=ERROR_INCORRECT_ADDRESS -Language=Bulgarian -ERROR_INCORRECT_ADDRESS - The network address could not be used for the operation requested. -. - -MessageId=1242 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_REGISTERED -Language=Bulgarian -ERROR_ALREADY_REGISTERED - The service is already registered. -. - -MessageId=1243 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVICE_NOT_FOUND -Language=Bulgarian -ERROR_SERVICE_NOT_FOUND - The specified service does not exist. -. - -MessageId=1244 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_AUTHENTICATED -Language=Bulgarian -ERROR_NOT_AUTHENTICATED - The operation being requested was not performed because the user has not been authenticated. -. - -MessageId=1245 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_LOGGED_ON -Language=Bulgarian -ERROR_NOT_LOGGED_ON - The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist. -. - -MessageId=1246 -Severity=Success -Facility=System -SymbolicName=ERROR_CONTINUE -Language=Bulgarian -ERROR_CONTINUE - Continue with work in progress. -. - -MessageId=1247 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_INITIALIZED -Language=Bulgarian -ERROR_ALREADY_INITIALIZED - An attempt was made to perform an initialization operation when initialization has already been completed. -. - -MessageId=1248 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_DEVICES -Language=Bulgarian -ERROR_NO_MORE_DEVICES - No more local devices. -. - -MessageId=1249 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_SITE -Language=Bulgarian -ERROR_NO_SUCH_SITE - The specified site does not exist. -. - -MessageId=1250 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_CONTROLLER_EXISTS -Language=Bulgarian -ERROR_DOMAIN_CONTROLLER_EXISTS - A domain controller with the specified name already exists. -. - -MessageId=1251 -Severity=Success -Facility=System -SymbolicName=ERROR_ONLY_IF_CONNECTED -Language=Bulgarian -ERROR_ONLY_IF_CONNECTED - This operation is supported only when you are connected to the server. -. - -MessageId=1252 -Severity=Success -Facility=System -SymbolicName=ERROR_OVERRIDE_NOCHANGES -Language=Bulgarian -ERROR_OVERRIDE_NOCHANGES - The group policy framework should call the extension even if there are no changes. -. - -MessageId=1253 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_USER_PROFILE -Language=Bulgarian -ERROR_BAD_USER_PROFILE - The specified user does not have a valid profile. -. - -MessageId=1254 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SUPPORTED_ON_SBS -Language=Bulgarian -ERROR_NOT_SUPPORTED_ON_SBS - This operation is not supported on a computer running Windows Server 2003 for Small Business Server. -. - -MessageId=1255 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVER_SHUTDOWN_IN_PROGRESS -Language=Bulgarian -ERROR_SERVER_SHUTDOWN_IN_PROGRESS - The server machine is shutting down. -. - -MessageId=1256 -Severity=Success -Facility=System -SymbolicName=ERROR_HOST_DOWN -Language=Bulgarian -ERROR_HOST_DOWN - The remote system is not available. For information about network troubleshooting, see Windows Help. -. - -MessageId=1257 -Severity=Success -Facility=System -SymbolicName=ERROR_NON_ACCOUNT_SID -Language=Bulgarian -ERROR_NON_ACCOUNT_SID - The security identifier provided is not from an account domain. -. - -MessageId=1258 -Severity=Success -Facility=System -SymbolicName=ERROR_NON_DOMAIN_SID -Language=Bulgarian -ERROR_NON_DOMAIN_SID - The security identifier provided does not have a domain component. -. - -MessageId=1259 -Severity=Success -Facility=System -SymbolicName=ERROR_APPHELP_BLOCK -Language=Bulgarian -ERROR_APPHELP_BLOCK - AppHelp dialog canceled thus preventing the application from starting. -. - -MessageId=1260 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCESS_DISABLED_BY_POLICY -Language=Bulgarian -ERROR_ACCESS_DISABLED_BY_POLICY - Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system administrator. -. - -MessageId=1261 -Severity=Success -Facility=System -SymbolicName=ERROR_REG_NAT_CONSUMPTION -Language=Bulgarian -ERROR_REG_NAT_CONSUMPTION - A program attempt to use an invalid register value. Normally caused by an uninitialized register. This error is Itanium specific. -. - -MessageId=1262 -Severity=Success -Facility=System -SymbolicName=ERROR_CSCSHARE_OFFLINE -Language=Bulgarian -ERROR_CSCSHARE_OFFLINE - The share is currently offline or does not exist. -. - -MessageId=1263 -Severity=Success -Facility=System -SymbolicName=ERROR_PKINIT_FAILURE -Language=Bulgarian -ERROR_PKINIT_FAILURE - The kerberos protocol encountered an error while validating the KDC certificate during smartcard logon. -. - -MessageId=1264 -Severity=Success -Facility=System -SymbolicName=ERROR_SMARTCARD_SUBSYSTEM_FAILURE -Language=Bulgarian -ERROR_SMARTCARD_SUBSYSTEM_FAILURE - The kerberos protocol encountered an error while attempting to utilize the smartcard subsystem. -. - -MessageId=1265 -Severity=Success -Facility=System -SymbolicName=ERROR_DOWNGRADE_DETECTED -Language=Bulgarian -ERROR_DOWNGRADE_DETECTED - The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you. -. - -MessageId=1266 -Severity=Success -Facility=System -SymbolicName=SEC_E_SMARTCARD_CERT_REVOKED -Language=Bulgarian -SEC_E_SMARTCARD_CERT_REVOKED - The smartcard certificate used for authentication has been revoked. Please contact your system administrator. There may be additional information in the event log. -. - -MessageId=1267 -Severity=Success -Facility=System -SymbolicName=SEC_E_ISSUING_CA_UNTRUSTED -Language=Bulgarian -SEC_E_ISSUING_CA_UNTRUSTED - An untrusted certificate authority was detected while processing the smartcard certificate used for authentication. Please contact your system administrator. -. - -MessageId=1268 -Severity=Success -Facility=System -SymbolicName=SEC_E_REVOCATION_OFFLINE_C -Language=Bulgarian -SEC_E_REVOCATION_OFFLINE_C - The revocation status of the smartcard certificate used for authentication could not be determined. Please contact your system administrator. -. - -MessageId=1269 -Severity=Success -Facility=System -SymbolicName=SEC_E_PKINIT_CLIENT_FAILUR -Language=Bulgarian -SEC_E_PKINIT_CLIENT_FAILUR - The smartcard certificate used for authentication was not trusted. Please contact your system administrator. -. - -MessageId=1270 -Severity=Success -Facility=System -SymbolicName=SEC_E_SMARTCARD_CERT_EXPIRED -Language=Bulgarian -SEC_E_SMARTCARD_CERT_EXPIRED - The smartcard certificate used for authentication has expired. Please contact your system administrator. -. - -MessageId=1271 -Severity=Success -Facility=System -SymbolicName=ERROR_MACHINE_LOCKED -Language=Bulgarian -ERROR_MACHINE_LOCKED - The machine is locked and cannot be shut down without the force option. -. - -MessageId=1273 -Severity=Success -Facility=System -SymbolicName=ERROR_CALLBACK_SUPPLIED_INVALID_DATA -Language=Bulgarian -ERROR_CALLBACK_SUPPLIED_INVALID_DATA - An application-defined callback gave invalid data when called. -. - -MessageId=1274 -Severity=Success -Facility=System -SymbolicName=ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED -Language=Bulgarian -ERROR_SYNC_FOREGROUND_REFRESH_REQUIRED - The group policy framework should call the extension in the synchronous foreground policy refresh. -. - -MessageId=1275 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVER_BLOCKED -Language=Bulgarian -ERROR_DRIVER_BLOCKED - This driver has been blocked from loading. -. - -MessageId=1276 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_IMPORT_OF_NON_DLL -Language=Bulgarian -ERROR_INVALID_IMPORT_OF_NON_DLL - A dynamic link library (DLL) referenced a module that was neither a DLL nor the process's executable image. -. - -MessageId=1277 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCESS_DISABLED_WEBBLADE -Language=Bulgarian -ERROR_ACCESS_DISABLED_WEBBLADE - Windows cannot open this program since it has been disabled. -. - -MessageId=1278 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER -Language=Bulgarian -ERROR_ACCESS_DISABLED_WEBBLADE_TAMPER - Windows cannot open this program because the license enforcement system has been tampered with or become corrupted. -. - -MessageId=1279 -Severity=Success -Facility=System -SymbolicName=ERROR_RECOVERY_FAILURE -Language=Bulgarian -ERROR_RECOVERY_FAILURE - A transaction recovery failed. -. - -MessageId=1280 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_FIBER -Language=Bulgarian -ERROR_ALREADY_FIBER - The current thread has already been converted to a fiber. -. - -MessageId=1281 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_THREAD -Language=Bulgarian -ERROR_ALREADY_THREAD - The current thread has already been converted from a fiber. -. - -MessageId=1282 -Severity=Success -Facility=System -SymbolicName=ERROR_STACK_BUFFER_OVERRUN -Language=Bulgarian -ERROR_STACK_BUFFER_OVERRUN - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application. -. - -MessageId=1283 -Severity=Success -Facility=System -SymbolicName=ERROR_PARAMETER_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_PARAMETER_QUOTA_EXCEEDED - Data present in one of the parameters is more than the function can operate on. -. - -MessageId=1284 -Severity=Success -Facility=System -SymbolicName=ERROR_DEBUGGER_INACTIVE -Language=Bulgarian -ERROR_DEBUGGER_INACTIVE - An attempt to do an operation on a debug object failed because the object is in the process of being deleted. -. - -MessageId=1285 -Severity=Success -Facility=System -SymbolicName=ERROR_DELAY_LOAD_FAILED -Language=Bulgarian -ERROR_DELAY_LOAD_FAILED - An attempt to delay-load a .dll or get a function address in a delay-loaded .dll failed. -. - -MessageId=1286 -Severity=Success -Facility=System -SymbolicName=ERROR_VDM_DISALLOWED -Language=Bulgarian -ERROR_VDM_DISALLOWED - %1 is a 16-bit application. You do not have permissions to execute 16-bit applications. Check your permissions with your system administrator. -. - -MessageId=1287 -Severity=Success -Facility=System -SymbolicName=ERROR_UNIDENTIFIED_ERROR -Language=Bulgarian -ERROR_UNIDENTIFIED_ERROR - Insufficient information exists to identify the cause of failure. -. - -MessageId=1288 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_BANDWIDTH_PARAMETERS -Language=Bulgarian -ERROR_INVALID_BANDWIDTH_PARAMETERS - An invalid budget or period parameter was specified. -. - -MessageId=1289 -Severity=Success -Facility=System -SymbolicName=ERROR_AFFINITY_NOT_COMPATIBLE -Language=Bulgarian -ERROR_AFFINITY_NOT_COMPATIBLE - An attempt was made to join a thread to a reserve whose affinity did not intersect the reserve affinity or an attempt was made to associate a process with a reserve whose affinity did not intersect the reserve affinity. -. - -MessageId=1290 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_ALREADY_IN_RESERVE -Language=Bulgarian -ERROR_THREAD_ALREADY_IN_RESERVE - An attempt was made to join a thread to a reserve which was already joined to another reserve. -. - -MessageId=1291 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_NOT_IN_RESERVE -Language=Bulgarian -ERROR_THREAD_NOT_IN_RESERVE - An attempt was made to disjoin a thread from a reserve, but the thread was not joined to the reserve. -. - -MessageId=1292 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_PROCESS_IN_RESERVE -Language=Bulgarian -ERROR_THREAD_PROCESS_IN_RESERVE - An attempt was made to disjoin a thread from a reserve whose process is associated with a reserve. -. - -MessageId=1293 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_ALREADY_IN_RESERVE -Language=Bulgarian -ERROR_PROCESS_ALREADY_IN_RESERVE - An attempt was made to associate a process with a reserve that was already associated with a reserve. -. - -MessageId=1294 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_NOT_IN_RESERVE -Language=Bulgarian -ERROR_PROCESS_NOT_IN_RESERVE - An attempt was made to disassociate a process from a reserve, but the process did not have an associated reserve. -. - -MessageId=1295 -Severity=Success -Facility=System -SymbolicName=ERROR_PROCESS_THREADS_IN_RESERVE -Language=Bulgarian -ERROR_PROCESS_THREADS_IN_RESERVE - An attempt was made to associate a process with a reserve, but the process contained thread joined to a reserve. -. - -MessageId=1296 -Severity=Success -Facility=System -SymbolicName=ERROR_AFFINITY_NOT_SET_IN_RESERVE -Language=Bulgarian -ERROR_AFFINITY_NOT_SET_IN_RESERVE - An attempt was made to set the affinity of a thread or a process, but the thread or process was joined or associated with a reserve. -. - -MessageId=1297 -Severity=Success -Facility=System -SymbolicName=ERROR_IMPLEMENTATION_LIMIT -Language=Bulgarian -ERROR_IMPLEMENTATION_LIMIT - An operation attempted to exceed an implementation-defined limit. -. - -MessageId=1298 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CACHE_ONLY -Language=Bulgarian -ERROR_DS_CACHE_ONLY - The requested object is for internal DS operations only. -. - -MessageId=1300 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_ALL_ASSIGNED -Language=Bulgarian -ERROR_NOT_ALL_ASSIGNED - Not all privileges referenced are assigned to the caller. -. - -MessageId=1301 -Severity=Success -Facility=System -SymbolicName=ERROR_SOME_NOT_MAPPED -Language=Bulgarian -ERROR_SOME_NOT_MAPPED - Some mapping between account names and security IDs was not done. -. - -MessageId=1302 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_QUOTAS_FOR_ACCOUNT -Language=Bulgarian -ERROR_NO_QUOTAS_FOR_ACCOUNT - No system quota limits are specifically set for this account. -. - -MessageId=1303 -Severity=Success -Facility=System -SymbolicName=ERROR_LOCAL_USER_SESSION_KEY -Language=Bulgarian -ERROR_LOCAL_USER_SESSION_KEY - No encryption key is available. A well-known encryption key was returned. -. - -MessageId=1304 -Severity=Success -Facility=System -SymbolicName=ERROR_NULL_LM_PASSWORD -Language=Bulgarian -ERROR_NULL_LM_PASSWORD - The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string. -. - -MessageId=1305 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_REVISION -Language=Bulgarian -ERROR_UNKNOWN_REVISION - The revision level is unknown. -. - -MessageId=1306 -Severity=Success -Facility=System -SymbolicName=ERROR_REVISION_MISMATCH -Language=Bulgarian -ERROR_REVISION_MISMATCH - Indicates two revision levels are incompatible. -. - -MessageId=1307 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_OWNER -Language=Bulgarian -ERROR_INVALID_OWNER - This security ID may not be assigned as the owner of this object. -. - -MessageId=1308 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRIMARY_GROUP -Language=Bulgarian -ERROR_INVALID_PRIMARY_GROUP - This security ID may not be assigned as the primary group of an object. -. - -MessageId=1309 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_IMPERSONATION_TOKEN -Language=Bulgarian -ERROR_NO_IMPERSONATION_TOKEN - An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client. -. - -MessageId=1310 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_DISABLE_MANDATORY -Language=Bulgarian -ERROR_CANT_DISABLE_MANDATORY - The group may not be disabled. -. - -MessageId=1311 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_LOGON_SERVERS -Language=Bulgarian -ERROR_NO_LOGON_SERVERS - There are currently no logon servers available to service the logon request. -. - -MessageId=1312 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_LOGON_SESSION -Language=Bulgarian -ERROR_NO_SUCH_LOGON_SESSION - A specified logon session does not exist. It may already have been terminated. -. - -MessageId=1313 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_PRIVILEGE -Language=Bulgarian -ERROR_NO_SUCH_PRIVILEGE - A specified privilege does not exist. -. - -MessageId=1314 -Severity=Success -Facility=System -SymbolicName=ERROR_PRIVILEGE_NOT_HELD -Language=Bulgarian -ERROR_PRIVILEGE_NOT_HELD - A required privilege is not held by the client. -. - -MessageId=1315 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ACCOUNT_NAME -Language=Bulgarian -ERROR_INVALID_ACCOUNT_NAME - The name provided is not a properly formed account name. -. - -MessageId=1316 -Severity=Success -Facility=System -SymbolicName=ERROR_USER_EXISTS -Language=Bulgarian -ERROR_USER_EXISTS - The specified user already exists. -. - -MessageId=1317 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_USER -Language=Bulgarian -ERROR_NO_SUCH_USER - The specified user does not exist. -. - -MessageId=1318 -Severity=Success -Facility=System -SymbolicName=ERROR_GROUP_EXISTS -Language=Bulgarian -ERROR_GROUP_EXISTS - The specified group already exists. -. - -MessageId=1319 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_GROUP -Language=Bulgarian -ERROR_NO_SUCH_GROUP - The specified group does not exist. -. - -MessageId=1320 -Severity=Success -Facility=System -SymbolicName=ERROR_MEMBER_IN_GROUP -Language=Bulgarian -ERROR_MEMBER_IN_GROUP - Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member. -. - -MessageId=1321 -Severity=Success -Facility=System -SymbolicName=ERROR_MEMBER_NOT_IN_GROUP -Language=Bulgarian -ERROR_MEMBER_NOT_IN_GROUP - The specified user account is not a member of the specified group account. -. - -MessageId=1322 -Severity=Success -Facility=System -SymbolicName=ERROR_LAST_ADMIN -Language=Bulgarian -ERROR_LAST_ADMIN - The last remaining administration account cannot be disabled or deleted. -. - -MessageId=1323 -Severity=Success -Facility=System -SymbolicName=ERROR_WRONG_PASSWORD -Language=Bulgarian -ERROR_WRONG_PASSWORD - Unable to update the password. The value provided as the current password is incorrect. -. - -MessageId=1324 -Severity=Success -Facility=System -SymbolicName=ERROR_ILL_FORMED_PASSWORD -Language=Bulgarian -ERROR_ILL_FORMED_PASSWORD - Unable to update the password. The value provided for the new password contains values that are not allowed in passwords. -. - -MessageId=1325 -Severity=Success -Facility=System -SymbolicName=ERROR_PASSWORD_RESTRICTION -Language=Bulgarian -ERROR_PASSWORD_RESTRICTION - Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirement of the domain. -. - -MessageId=1326 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_FAILURE -Language=Bulgarian -ERROR_LOGON_FAILURE - Logon failure: unknown user name or bad password. -. - -MessageId=1327 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCOUNT_RESTRICTION -Language=Bulgarian -ERROR_ACCOUNT_RESTRICTION - Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced. -. - -MessageId=1328 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LOGON_HOURS -Language=Bulgarian -ERROR_INVALID_LOGON_HOURS - Logon failure: account logon time restriction violation. -. - -MessageId=1329 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_WORKSTATION -Language=Bulgarian -ERROR_INVALID_WORKSTATION - Logon failure: user not allowed to log on to this computer. -. - -MessageId=1330 -Severity=Success -Facility=System -SymbolicName=ERROR_PASSWORD_EXPIRED -Language=Bulgarian -ERROR_PASSWORD_EXPIRED - Logon failure: the specified account password has expired. -. - -MessageId=1331 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCOUNT_DISABLED -Language=Bulgarian -ERROR_ACCOUNT_DISABLED - Logon failure: account currently disabled. -. - -MessageId=1332 -Severity=Success -Facility=System -SymbolicName=ERROR_NONE_MAPPED -Language=Bulgarian -ERROR_NONE_MAPPED - No mapping between account names and security IDs was done. -. - -MessageId=1333 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_LUIDS_REQUESTED -Language=Bulgarian -ERROR_TOO_MANY_LUIDS_REQUESTED - Too many local user identifiers (LUIDs) were requested at one time. -. - -MessageId=1334 -Severity=Success -Facility=System -SymbolicName=ERROR_LUIDS_EXHAUSTED -Language=Bulgarian -ERROR_LUIDS_EXHAUSTED - No more local user identifiers (LUIDs) are available. -. - -MessageId=1335 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SUB_AUTHORITY -Language=Bulgarian -ERROR_INVALID_SUB_AUTHORITY - The subauthority part of a security ID is invalid for this particular use. -. - -MessageId=1336 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ACL -Language=Bulgarian -ERROR_INVALID_ACL - The access control list (ACL) structure is invalid. -. - -MessageId=1337 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SID -Language=Bulgarian -ERROR_INVALID_SID - The security ID structure is invalid. -. - -MessageId=1338 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SECURITY_DESCR -Language=Bulgarian -ERROR_INVALID_SECURITY_DESCR - The security descriptor structure is invalid. -. - -MessageId=1340 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_INHERITANCE_ACL -Language=Bulgarian -ERROR_BAD_INHERITANCE_ACL - The inherited access control list (ACL) or access control entry (ACE) could not be built. -. - -MessageId=1341 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVER_DISABLED -Language=Bulgarian -ERROR_SERVER_DISABLED - The server is currently disabled. -. - -MessageId=1342 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVER_NOT_DISABLED -Language=Bulgarian -ERROR_SERVER_NOT_DISABLED - The server is currently enabled. -. - -MessageId=1343 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ID_AUTHORITY -Language=Bulgarian -ERROR_INVALID_ID_AUTHORITY - The value provided was an invalid value for an identifier authority. -. - -MessageId=1344 -Severity=Success -Facility=System -SymbolicName=ERROR_ALLOTTED_SPACE_EXCEEDED -Language=Bulgarian -ERROR_ALLOTTED_SPACE_EXCEEDED - No more memory is available for security information updates. -. - -MessageId=1345 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_GROUP_ATTRIBUTES -Language=Bulgarian -ERROR_INVALID_GROUP_ATTRIBUTES - The specified attributes are invalid, or incompatible with the attributes for the group as a whole. -. - -MessageId=1346 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_IMPERSONATION_LEVEL -Language=Bulgarian -ERROR_BAD_IMPERSONATION_LEVEL - Either a required impersonation level was not provided, or the provided impersonation level is invalid. -. - -MessageId=1347 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_OPEN_ANONYMOUS -Language=Bulgarian -ERROR_CANT_OPEN_ANONYMOUS - Cannot open an anonymous level security token. -. - -MessageId=1348 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_VALIDATION_CLASS -Language=Bulgarian -ERROR_BAD_VALIDATION_CLASS - The validation information class requested was invalid. -. - -MessageId=1349 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_TOKEN_TYPE -Language=Bulgarian -ERROR_BAD_TOKEN_TYPE - The type of the token is inappropriate for its attempted use. -. - -MessageId=1350 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SECURITY_ON_OBJECT -Language=Bulgarian -ERROR_NO_SECURITY_ON_OBJECT - Unable to perform a security operation on an object that has no associated security. -. - -MessageId=1351 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_ACCESS_DOMAIN_INFO -Language=Bulgarian -ERROR_CANT_ACCESS_DOMAIN_INFO - Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. -. - -MessageId=1352 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SERVER_STATE -Language=Bulgarian -ERROR_INVALID_SERVER_STATE - The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation. -. - -MessageId=1353 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DOMAIN_STATE -Language=Bulgarian -ERROR_INVALID_DOMAIN_STATE - The domain was in the wrong state to perform the security operation. -. - -MessageId=1354 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DOMAIN_ROLE -Language=Bulgarian -ERROR_INVALID_DOMAIN_ROLE - This operation is only allowed for the Primary Domain Controller of the domain. -. - -MessageId=1355 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_DOMAIN -Language=Bulgarian -ERROR_NO_SUCH_DOMAIN - The specified domain either does not exist or could not be contacted. -. - -MessageId=1356 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_EXISTS -Language=Bulgarian -ERROR_DOMAIN_EXISTS - The specified domain already exists. -. - -MessageId=1357 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_DOMAIN_LIMIT_EXCEEDED - An attempt was made to exceed the limit on the number of domains per server. -. - -MessageId=1358 -Severity=Success -Facility=System -SymbolicName=ERROR_INTERNAL_DB_CORRUPTION -Language=Bulgarian -ERROR_INTERNAL_DB_CORRUPTION - Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk. -. - -MessageId=1359 -Severity=Success -Facility=System -SymbolicName=ERROR_INTERNAL_ERROR -Language=Bulgarian -ERROR_INTERNAL_ERROR - An internal error occurred. -. - -MessageId=1360 -Severity=Success -Facility=System -SymbolicName=ERROR_GENERIC_NOT_MAPPED -Language=Bulgarian -ERROR_GENERIC_NOT_MAPPED - Generic access types were contained in an access mask which should already be mapped to nongeneric types. -. - -MessageId=1361 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DESCRIPTOR_FORMAT -Language=Bulgarian -ERROR_BAD_DESCRIPTOR_FORMAT - A security descriptor is not in the right format (absolute or self-relative). -. - -MessageId=1362 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_LOGON_PROCESS -Language=Bulgarian -ERROR_NOT_LOGON_PROCESS - The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process. -. - -MessageId=1363 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_SESSION_EXISTS -Language=Bulgarian -ERROR_LOGON_SESSION_EXISTS - Cannot start a new logon session with an ID that is already in use. -. - -MessageId=1364 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_PACKAGE -Language=Bulgarian -ERROR_NO_SUCH_PACKAGE - A specified authentication package is unknown. -. - -MessageId=1365 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_LOGON_SESSION_STATE -Language=Bulgarian -ERROR_BAD_LOGON_SESSION_STATE - The logon session is not in a state that is consistent with the requested operation. -. - -MessageId=1366 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_SESSION_COLLISION -Language=Bulgarian -ERROR_LOGON_SESSION_COLLISION - The logon session ID is already in use. -. - -MessageId=1367 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LOGON_TYPE -Language=Bulgarian -ERROR_INVALID_LOGON_TYPE - A logon request contained an invalid logon type value. -. - -MessageId=1368 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_IMPERSONATE -Language=Bulgarian -ERROR_CANNOT_IMPERSONATE - Unable to impersonate using a named pipe until data has been read from that pipe. -. - -MessageId=1369 -Severity=Success -Facility=System -SymbolicName=ERROR_RXACT_INVALID_STATE -Language=Bulgarian -ERROR_RXACT_INVALID_STATE - The transaction state of a registry subtree is incompatible with the requested operation. -. - -MessageId=1370 -Severity=Success -Facility=System -SymbolicName=ERROR_RXACT_COMMIT_FAILURE -Language=Bulgarian -ERROR_RXACT_COMMIT_FAILURE - An internal security database corruption has been encountered. -. - -MessageId=1371 -Severity=Success -Facility=System -SymbolicName=ERROR_SPECIAL_ACCOUNT -Language=Bulgarian -ERROR_SPECIAL_ACCOUNT - Cannot perform this operation on built-in accounts. -. - -MessageId=1372 -Severity=Success -Facility=System -SymbolicName=ERROR_SPECIAL_GROUP -Language=Bulgarian -ERROR_SPECIAL_GROUP - Cannot perform this operation on this built-in special group. -. - -MessageId=1373 -Severity=Success -Facility=System -SymbolicName=ERROR_SPECIAL_USER -Language=Bulgarian -ERROR_SPECIAL_USER - Cannot perform this operation on this built-in special user. -. - -MessageId=1374 -Severity=Success -Facility=System -SymbolicName=ERROR_MEMBERS_PRIMARY_GROUP -Language=Bulgarian -ERROR_MEMBERS_PRIMARY_GROUP - The user cannot be removed from a group because the group is currently the user's primary group. -. - -MessageId=1375 -Severity=Success -Facility=System -SymbolicName=ERROR_TOKEN_ALREADY_IN_USE -Language=Bulgarian -ERROR_TOKEN_ALREADY_IN_USE - The token is already in use as a primary token. -. - -MessageId=1376 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_ALIAS -Language=Bulgarian -ERROR_NO_SUCH_ALIAS - The specified local group does not exist. -. - -MessageId=1377 -Severity=Success -Facility=System -SymbolicName=ERROR_MEMBER_NOT_IN_ALIAS -Language=Bulgarian -ERROR_MEMBER_NOT_IN_ALIAS - The specified account name is not a member of the local group. -. - -MessageId=1378 -Severity=Success -Facility=System -SymbolicName=ERROR_MEMBER_IN_ALIAS -Language=Bulgarian -ERROR_MEMBER_IN_ALIAS - The specified account name is already a member of the local group. -. - -MessageId=1379 -Severity=Success -Facility=System -SymbolicName=ERROR_ALIAS_EXISTS -Language=Bulgarian -ERROR_ALIAS_EXISTS - The specified local group already exists. -. - -MessageId=1380 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_NOT_GRANTED -Language=Bulgarian -ERROR_LOGON_NOT_GRANTED - Logon failure: the user has not been granted the requested logon type at this computer. -. - -MessageId=1381 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_SECRETS -Language=Bulgarian -ERROR_TOO_MANY_SECRETS - The maximum number of secrets that may be stored in a single system has been exceeded. -. - -MessageId=1382 -Severity=Success -Facility=System -SymbolicName=ERROR_SECRET_TOO_LONG -Language=Bulgarian -ERROR_SECRET_TOO_LONG - The length of a secret exceeds the maximum length allowed. -. - -MessageId=1383 -Severity=Success -Facility=System -SymbolicName=ERROR_INTERNAL_DB_ERROR -Language=Bulgarian -ERROR_INTERNAL_DB_ERROR - The local security authority database contains an internal inconsistency. -. - -MessageId=1384 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_CONTEXT_IDS -Language=Bulgarian -ERROR_TOO_MANY_CONTEXT_IDS - During a logon attempt, the user's security context accumulated too many security IDs. -. - -MessageId=1385 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_TYPE_NOT_GRANTED -Language=Bulgarian -ERROR_LOGON_TYPE_NOT_GRANTED - Logon failure: the user has not been granted the requested logon type at this computer. -. - -MessageId=1386 -Severity=Success -Facility=System -SymbolicName=ERROR_NT_CROSS_ENCRYPTION_REQUIRED -Language=Bulgarian -ERROR_NT_CROSS_ENCRYPTION_REQUIRED - A cross-encrypted password is necessary to change a user password. -. - -MessageId=1387 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUCH_MEMBER -Language=Bulgarian -ERROR_NO_SUCH_MEMBER - A new member could not be added to or removed from the local group because the member does not exist. -. - -MessageId=1388 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MEMBER -Language=Bulgarian -ERROR_INVALID_MEMBER - A new member could not be added to a local group because the member has the wrong account type. -. - -MessageId=1389 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_SIDS -Language=Bulgarian -ERROR_TOO_MANY_SIDS - Too many security IDs have been specified. -. - -MessageId=1390 -Severity=Success -Facility=System -SymbolicName=ERROR_LM_CROSS_ENCRYPTION_REQUIRED -Language=Bulgarian -ERROR_LM_CROSS_ENCRYPTION_REQUIRED - A cross-encrypted password is necessary to change this user password. -. - -MessageId=1391 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_INHERITANCE -Language=Bulgarian -ERROR_NO_INHERITANCE - Indicates an ACL contains no inheritable components. -. - -MessageId=1392 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_CORRUPT -Language=Bulgarian -ERROR_FILE_CORRUPT - The file or directory is corrupted and unreadable. -. - -MessageId=1393 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_CORRUPT -Language=Bulgarian -ERROR_DISK_CORRUPT - The disk structure is corrupted and unreadable. -. - -MessageId=1394 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_USER_SESSION_KEY -Language=Bulgarian -ERROR_NO_USER_SESSION_KEY - There is no user session key for the specified logon session. -. - -MessageId=1395 -Severity=Success -Facility=System -SymbolicName=ERROR_LICENSE_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_LICENSE_QUOTA_EXCEEDED - The service being accessed is licensed for a particular number of connections. No more connections can be made to the service at this time because there are already as many connections as the service can accept. -. - -MessageId=1396 -Severity=Success -Facility=System -SymbolicName=ERROR_WRONG_TARGET_NAME -Language=Bulgarian -ERROR_WRONG_TARGET_NAME - Logon Failure: The target account name is incorrect. -. - -MessageId=1397 -Severity=Success -Facility=System -SymbolicName=ERROR_MUTUAL_AUTH_FAILED -Language=Bulgarian -ERROR_MUTUAL_AUTH_FAILED - Mutual Authentication failed. The server's password is out of date at the domain controller. -. - -MessageId=1398 -Severity=Success -Facility=System -SymbolicName=ERROR_TIME_SKEW -Language=Bulgarian -ERROR_TIME_SKEW - There is a time and/or date difference between the client and server. -. - -MessageId=1399 -Severity=Success -Facility=System -SymbolicName=ERROR_CURRENT_DOMAIN_NOT_ALLOWED -Language=Bulgarian -ERROR_CURRENT_DOMAIN_NOT_ALLOWED - This operation cannot be performed on the current domain. -. - -MessageId=1400 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_WINDOW_HANDLE -Language=Bulgarian -ERROR_INVALID_WINDOW_HANDLE - Invalid window handle. -. - -MessageId=1401 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MENU_HANDLE -Language=Bulgarian -ERROR_INVALID_MENU_HANDLE - Invalid menu handle. -. - -MessageId=1402 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_CURSOR_HANDLE -Language=Bulgarian -ERROR_INVALID_CURSOR_HANDLE - Invalid cursor handle. -. - -MessageId=1403 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ACCEL_HANDLE -Language=Bulgarian -ERROR_INVALID_ACCEL_HANDLE - Invalid accelerator table handle. -. - -MessageId=1404 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_HOOK_HANDLE -Language=Bulgarian -ERROR_INVALID_HOOK_HANDLE - Invalid hook handle. -. - -MessageId=1405 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DWP_HANDLE -Language=Bulgarian -ERROR_INVALID_DWP_HANDLE - Invalid handle to a multiple-window position structure. -. - -MessageId=1406 -Severity=Success -Facility=System -SymbolicName=ERROR_TLW_WITH_WSCHILD -Language=Bulgarian -ERROR_TLW_WITH_WSCHILD - Cannot create a top-level child window. -. - -MessageId=1407 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_FIND_WND_CLASS -Language=Bulgarian -ERROR_CANNOT_FIND_WND_CLASS - Cannot find window class. -. - -MessageId=1408 -Severity=Success -Facility=System -SymbolicName=ERROR_WINDOW_OF_OTHER_THREAD -Language=Bulgarian -ERROR_WINDOW_OF_OTHER_THREAD - Invalid window; it belongs to other thread. -. - -MessageId=1409 -Severity=Success -Facility=System -SymbolicName=ERROR_HOTKEY_ALREADY_REGISTERED -Language=Bulgarian -ERROR_HOTKEY_ALREADY_REGISTERED - Hot key is already registered. -. - -MessageId=1410 -Severity=Success -Facility=System -SymbolicName=ERROR_CLASS_ALREADY_EXISTS -Language=Bulgarian -ERROR_CLASS_ALREADY_EXISTS - Class already exists. -. - -MessageId=1411 -Severity=Success -Facility=System -SymbolicName=ERROR_CLASS_DOES_NOT_EXIST -Language=Bulgarian -ERROR_CLASS_DOES_NOT_EXIST - Class does not exist. -. - -MessageId=1412 -Severity=Success -Facility=System -SymbolicName=ERROR_CLASS_HAS_WINDOWS -Language=Bulgarian -ERROR_CLASS_HAS_WINDOWS - Class still has open windows. -. - -MessageId=1413 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_INDEX -Language=Bulgarian -ERROR_INVALID_INDEX - Invalid index. -. - -MessageId=1414 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ICON_HANDLE -Language=Bulgarian -ERROR_INVALID_ICON_HANDLE - Invalid icon handle. -. - -MessageId=1415 -Severity=Success -Facility=System -SymbolicName=ERROR_PRIVATE_DIALOG_INDEX -Language=Bulgarian -ERROR_PRIVATE_DIALOG_INDEX - Using private DIALOG window words. -. - -MessageId=1416 -Severity=Success -Facility=System -SymbolicName=ERROR_LISTBOX_ID_NOT_FOUND -Language=Bulgarian -ERROR_LISTBOX_ID_NOT_FOUND - The list box identifier was not found. -. - -MessageId=1417 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_WILDCARD_CHARACTERS -Language=Bulgarian -ERROR_NO_WILDCARD_CHARACTERS - No wildcards were found. -. - -MessageId=1418 -Severity=Success -Facility=System -SymbolicName=ERROR_CLIPBOARD_NOT_OPEN -Language=Bulgarian -ERROR_CLIPBOARD_NOT_OPEN - Thread does not have a clipboard open. -. - -MessageId=1419 -Severity=Success -Facility=System -SymbolicName=ERROR_HOTKEY_NOT_REGISTERED -Language=Bulgarian -ERROR_HOTKEY_NOT_REGISTERED - Hot key is not registered. -. - -MessageId=1420 -Severity=Success -Facility=System -SymbolicName=ERROR_WINDOW_NOT_DIALOG -Language=Bulgarian -ERROR_WINDOW_NOT_DIALOG - The window is not a valid dialog window. -. - -MessageId=1421 -Severity=Success -Facility=System -SymbolicName=ERROR_CONTROL_ID_NOT_FOUND -Language=Bulgarian -ERROR_CONTROL_ID_NOT_FOUND - Control ID not found. -. - -MessageId=1422 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_COMBOBOX_MESSAGE -Language=Bulgarian -ERROR_INVALID_COMBOBOX_MESSAGE - Invalid message for a combo box because it does not have an edit control. -. - -MessageId=1423 -Severity=Success -Facility=System -SymbolicName=ERROR_WINDOW_NOT_COMBOBOX -Language=Bulgarian -ERROR_WINDOW_NOT_COMBOBOX - The window is not a combo box. -. - -MessageId=1424 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EDIT_HEIGHT -Language=Bulgarian -ERROR_INVALID_EDIT_HEIGHT - Height must be less than 256. -. - -MessageId=1425 -Severity=Success -Facility=System -SymbolicName=ERROR_DC_NOT_FOUND -Language=Bulgarian -ERROR_DC_NOT_FOUND - Invalid device context (DC) handle. -. - -MessageId=1426 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_HOOK_FILTER -Language=Bulgarian -ERROR_INVALID_HOOK_FILTER - Invalid hook procedure type. -. - -MessageId=1427 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FILTER_PROC -Language=Bulgarian -ERROR_INVALID_FILTER_PROC - Invalid hook procedure. -. - -MessageId=1428 -Severity=Success -Facility=System -SymbolicName=ERROR_HOOK_NEEDS_HMOD -Language=Bulgarian -ERROR_HOOK_NEEDS_HMOD - Cannot set nonlocal hook without a module handle. -. - -MessageId=1429 -Severity=Success -Facility=System -SymbolicName=ERROR_GLOBAL_ONLY_HOOK -Language=Bulgarian -ERROR_GLOBAL_ONLY_HOOK - This hook procedure can only be set globally. -. - -MessageId=1430 -Severity=Success -Facility=System -SymbolicName=ERROR_JOURNAL_HOOK_SET -Language=Bulgarian -ERROR_JOURNAL_HOOK_SET - The journal hook procedure is already installed. -. - -MessageId=1431 -Severity=Success -Facility=System -SymbolicName=ERROR_HOOK_NOT_INSTALLED -Language=Bulgarian -ERROR_HOOK_NOT_INSTALLED - The hook procedure is not installed. -. - -MessageId=1432 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LB_MESSAGE -Language=Bulgarian -ERROR_INVALID_LB_MESSAGE - Invalid message for single-selection list box. -. - -MessageId=1433 -Severity=Success -Facility=System -SymbolicName=ERROR_SETCOUNT_ON_BAD_LB -Language=Bulgarian -ERROR_SETCOUNT_ON_BAD_LB - LB_SETCOUNT sent to non-lazy list box. -. - -MessageId=1434 -Severity=Success -Facility=System -SymbolicName=ERROR_LB_WITHOUT_TABSTOPS -Language=Bulgarian -ERROR_LB_WITHOUT_TABSTOPS - This list box does not support tab stops. -. - -MessageId=1435 -Severity=Success -Facility=System -SymbolicName=ERROR_DESTROY_OBJECT_OF_OTHER_THREAD -Language=Bulgarian -ERROR_DESTROY_OBJECT_OF_OTHER_THREAD - Cannot destroy object created by another thread. -. - -MessageId=1436 -Severity=Success -Facility=System -SymbolicName=ERROR_CHILD_WINDOW_MENU -Language=Bulgarian -ERROR_CHILD_WINDOW_MENU - Child windows cannot have menus. -. - -MessageId=1437 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SYSTEM_MENU -Language=Bulgarian -ERROR_NO_SYSTEM_MENU - The window does not have a system menu. -. - -MessageId=1438 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MSGBOX_STYLE -Language=Bulgarian -ERROR_INVALID_MSGBOX_STYLE - Invalid message box style. -. - -MessageId=1439 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SPI_VALUE -Language=Bulgarian -ERROR_INVALID_SPI_VALUE - Invalid system-wide (SPI_*) parameter. -. - -MessageId=1440 -Severity=Success -Facility=System -SymbolicName=ERROR_SCREEN_ALREADY_LOCKED -Language=Bulgarian -ERROR_SCREEN_ALREADY_LOCKED - Screen already locked. -. - -MessageId=1441 -Severity=Success -Facility=System -SymbolicName=ERROR_HWNDS_HAVE_DIFF_PARENT -Language=Bulgarian -ERROR_HWNDS_HAVE_DIFF_PARENT - All handles to windows in a multiple-window position structure must have the same parent. -. - -MessageId=1442 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_CHILD_WINDOW -Language=Bulgarian -ERROR_NOT_CHILD_WINDOW - The window is not a child window. -. - -MessageId=1443 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_GW_COMMAND -Language=Bulgarian -ERROR_INVALID_GW_COMMAND - Invalid GW_* command. -. - -MessageId=1444 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_THREAD_ID -Language=Bulgarian -ERROR_INVALID_THREAD_ID - Invalid thread identifier. -. - -MessageId=1445 -Severity=Success -Facility=System -SymbolicName=ERROR_NON_MDICHILD_WINDOW -Language=Bulgarian -ERROR_NON_MDICHILD_WINDOW - Cannot process a message from a window that is not a multiple document interface (MDI) window. -. - -MessageId=1446 -Severity=Success -Facility=System -SymbolicName=ERROR_POPUP_ALREADY_ACTIVE -Language=Bulgarian -ERROR_POPUP_ALREADY_ACTIVE - Popup menu already active. -. - -MessageId=1447 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SCROLLBARS -Language=Bulgarian -ERROR_NO_SCROLLBARS - The window does not have scroll bars. -. - -MessageId=1448 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SCROLLBAR_RANGE -Language=Bulgarian -ERROR_INVALID_SCROLLBAR_RANGE - Scroll bar range cannot be greater than MAXLONG. -. - -MessageId=1449 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SHOWWIN_COMMAND -Language=Bulgarian -ERROR_INVALID_SHOWWIN_COMMAND - Cannot show or remove the window in the way specified. -. - -MessageId=1450 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SYSTEM_RESOURCES -Language=Bulgarian -ERROR_NO_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. -. - -MessageId=1451 -Severity=Success -Facility=System -SymbolicName=ERROR_NONPAGED_SYSTEM_RESOURCES -Language=Bulgarian -ERROR_NONPAGED_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. -. - -MessageId=1452 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGED_SYSTEM_RESOURCES -Language=Bulgarian -ERROR_PAGED_SYSTEM_RESOURCES - Insufficient system resources exist to complete the requested service. -. - -MessageId=1453 -Severity=Success -Facility=System -SymbolicName=ERROR_WORKING_SET_QUOTA -Language=Bulgarian -ERROR_WORKING_SET_QUOTA - Insufficient quota to complete the requested service. -. - -MessageId=1454 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGEFILE_QUOTA -Language=Bulgarian -ERROR_PAGEFILE_QUOTA - Insufficient quota to complete the requested service. -. - -MessageId=1455 -Severity=Success -Facility=System -SymbolicName=ERROR_COMMITMENT_LIMIT -Language=Bulgarian -ERROR_COMMITMENT_LIMIT - The paging file is too small for this operation to complete. -. - -MessageId=1456 -Severity=Success -Facility=System -SymbolicName=ERROR_MENU_ITEM_NOT_FOUND -Language=Bulgarian -ERROR_MENU_ITEM_NOT_FOUND - A menu item was not found. -. - -MessageId=1457 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_KEYBOARD_HANDLE -Language=Bulgarian -ERROR_INVALID_KEYBOARD_HANDLE - Invalid keyboard layout handle. -. - -MessageId=1458 -Severity=Success -Facility=System -SymbolicName=ERROR_HOOK_TYPE_NOT_ALLOWED -Language=Bulgarian -ERROR_HOOK_TYPE_NOT_ALLOWED - Hook type not allowed. -. - -MessageId=1459 -Severity=Success -Facility=System -SymbolicName=ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION -Language=Bulgarian -ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION - This operation requires an interactive window station. -. - -MessageId=1460 -Severity=Success -Facility=System -SymbolicName=ERROR_TIMEOUT -Language=Bulgarian -ERROR_TIMEOUT - This operation returned because the timeout period expired. -. - -MessageId=1461 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MONITOR_HANDLE -Language=Bulgarian -ERROR_INVALID_MONITOR_HANDLE - Invalid monitor handle. -. - -MessageId=1500 -Severity=Success -Facility=System -SymbolicName=ERROR_EVENTLOG_FILE_CORRUPT -Language=Bulgarian -ERROR_EVENTLOG_FILE_CORRUPT - The event log file is corrupted. -. - -MessageId=1501 -Severity=Success -Facility=System -SymbolicName=ERROR_EVENTLOG_CANT_START -Language=Bulgarian -ERROR_EVENTLOG_CANT_START - No event log file could be opened, so the event logging service did not start. -. - -MessageId=1502 -Severity=Success -Facility=System -SymbolicName=ERROR_LOG_FILE_FULL -Language=Bulgarian -ERROR_LOG_FILE_FULL - The event log file is full. -. - -MessageId=1503 -Severity=Success -Facility=System -SymbolicName=ERROR_EVENTLOG_FILE_CHANGED -Language=Bulgarian -ERROR_EVENTLOG_FILE_CHANGED - The event log file has changed between read operations. -. - -MessageId=1601 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_SERVICE_FAILURE -Language=Bulgarian -ERROR_INSTALL_SERVICE_FAILURE - The Windows Installer service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance. -. - -MessageId=1602 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_USEREXIT -Language=Bulgarian -ERROR_INSTALL_USEREXIT - User cancelled installation. -. - -MessageId=1603 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_FAILURE -Language=Bulgarian -ERROR_INSTALL_FAILURE - Fatal error during installation. -. - -MessageId=1604 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_SUSPEND -Language=Bulgarian -ERROR_INSTALL_SUSPEND - Installation suspended, incomplete. -. - -MessageId=1605 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PRODUCT -Language=Bulgarian -ERROR_UNKNOWN_PRODUCT - This action is only valid for products that are currently installed. -. - -MessageId=1606 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_FEATURE -Language=Bulgarian -ERROR_UNKNOWN_FEATURE - Feature ID not registered. -. - -MessageId=1607 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_COMPONENT -Language=Bulgarian -ERROR_UNKNOWN_COMPONENT - Component ID not registered. -. - -MessageId=1608 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PROPERTY -Language=Bulgarian -ERROR_UNKNOWN_PROPERTY - Unknown property. -. - -MessageId=1609 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_HANDLE_STATE -Language=Bulgarian -ERROR_INVALID_HANDLE_STATE - Handle is in an invalid state. -. - -MessageId=1610 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_CONFIGURATION -Language=Bulgarian -ERROR_BAD_CONFIGURATION - The configuration data for this product is corrupt. Contact your support personnel. -. - -MessageId=1611 -Severity=Success -Facility=System -SymbolicName=ERROR_INDEX_ABSENT -Language=Bulgarian -ERROR_INDEX_ABSENT - Component qualifier not present. -. - -MessageId=1612 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_SOURCE_ABSENT -Language=Bulgarian -ERROR_INSTALL_SOURCE_ABSENT - The installation source for this product is not available. Verify that the source exists and that you can access it. -. - -MessageId=1613 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_PACKAGE_VERSION -Language=Bulgarian -ERROR_INSTALL_PACKAGE_VERSION - This installation package cannot be installed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service. -. - -MessageId=1614 -Severity=Success -Facility=System -SymbolicName=ERROR_PRODUCT_UNINSTALLED -Language=Bulgarian -ERROR_PRODUCT_UNINSTALLED - Product is uninstalled. -. - -MessageId=1615 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_QUERY_SYNTAX -Language=Bulgarian -ERROR_BAD_QUERY_SYNTAX - SQL query syntax invalid or unsupported. -. - -MessageId=1616 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FIELD -Language=Bulgarian -ERROR_INVALID_FIELD - Record field does not exist. -. - -MessageId=1617 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_REMOVED -Language=Bulgarian -ERROR_DEVICE_REMOVED - The device has been removed. -. - -MessageId=1618 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_ALREADY_RUNNING -Language=Bulgarian -ERROR_INSTALL_ALREADY_RUNNING - Another installation is already in progress. Complete that installation before proceeding with this install. -. - -MessageId=1619 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_PACKAGE_OPEN_FAILED -Language=Bulgarian -ERROR_INSTALL_PACKAGE_OPEN_FAILED - This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package. -. - -MessageId=1620 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_PACKAGE_INVALID -Language=Bulgarian -ERROR_INSTALL_PACKAGE_INVALID - This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package. -. - -MessageId=1621 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_UI_FAILURE -Language=Bulgarian -ERROR_INSTALL_UI_FAILURE - There was an error starting the Windows Installer service user interface. Contact your support personnel. -. - -MessageId=1622 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_LOG_FAILURE -Language=Bulgarian -ERROR_INSTALL_LOG_FAILURE - Error opening installation log file. Verify that the specified log file location exists and that you can write to it. -. - -MessageId=1623 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_LANGUAGE_UNSUPPORTED -Language=Bulgarian -ERROR_INSTALL_LANGUAGE_UNSUPPORTED - The language of this installation package is not supported by your system. -. - -MessageId=1624 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_TRANSFORM_FAILURE -Language=Bulgarian -ERROR_INSTALL_TRANSFORM_FAILURE - Error applying transforms. Verify that the specified transform paths are valid. -. - -MessageId=1625 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_PACKAGE_REJECTED -Language=Bulgarian -ERROR_INSTALL_PACKAGE_REJECTED - This installation is forbidden by system policy. Contact your system administrator. -. - -MessageId=1626 -Severity=Success -Facility=System -SymbolicName=ERROR_FUNCTION_NOT_CALLED -Language=Bulgarian -ERROR_FUNCTION_NOT_CALLED - Function could not be executed. -. - -MessageId=1627 -Severity=Success -Facility=System -SymbolicName=ERROR_FUNCTION_FAILED -Language=Bulgarian -ERROR_FUNCTION_FAILED - Function failed during execution. -. - -MessageId=1628 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_TABLE -Language=Bulgarian -ERROR_INVALID_TABLE - Invalid or unknown table specified. -. - -MessageId=1629 -Severity=Success -Facility=System -SymbolicName=ERROR_DATATYPE_MISMATCH -Language=Bulgarian -ERROR_DATATYPE_MISMATCH - Data supplied is of wrong type. -. - -MessageId=1630 -Severity=Success -Facility=System -SymbolicName=ERROR_UNSUPPORTED_TYPE -Language=Bulgarian -ERROR_UNSUPPORTED_TYPE - Data of this type is not supported. -. - -MessageId=1631 -Severity=Success -Facility=System -SymbolicName=ERROR_CREATE_FAILED -Language=Bulgarian -ERROR_CREATE_FAILED - The Windows Installer service failed to start. Contact your support personnel. -. - -MessageId=1632 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_TEMP_UNWRITABLE -Language=Bulgarian -ERROR_INSTALL_TEMP_UNWRITABLE - The Temp folder is on a drive that is full or inaccessible. Free up space on the drive or verify that you have write permission on the Temp folder. -. - -MessageId=1633 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_PLATFORM_UNSUPPORTED -Language=Bulgarian -ERROR_INSTALL_PLATFORM_UNSUPPORTED - This installation package is not supported by this processor type. Contact your product vendor. -. - -MessageId=1634 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_NOTUSED -Language=Bulgarian -ERROR_INSTALL_NOTUSED - Component not used on this computer. -. - -MessageId=1635 -Severity=Success -Facility=System -SymbolicName=ERROR_PATCH_PACKAGE_OPEN_FAILED -Language=Bulgarian -ERROR_PATCH_PACKAGE_OPEN_FAILED - This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package. -. - -MessageId=1636 -Severity=Success -Facility=System -SymbolicName=ERROR_PATCH_PACKAGE_INVALID -Language=Bulgarian -ERROR_PATCH_PACKAGE_INVALID - This patch package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer patch package. -. - -MessageId=1637 -Severity=Success -Facility=System -SymbolicName=ERROR_PATCH_PACKAGE_UNSUPPORTED -Language=Bulgarian -ERROR_PATCH_PACKAGE_UNSUPPORTED - This patch package cannot be processed by the Windows Installer service. You must install a Windows service pack that contains a newer version of the Windows Installer service. -. - -MessageId=1638 -Severity=Success -Facility=System -SymbolicName=ERROR_PRODUCT_VERSION -Language=Bulgarian -ERROR_PRODUCT_VERSION - Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. -. - -MessageId=1639 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_COMMAND_LINE -Language=Bulgarian -ERROR_INVALID_COMMAND_LINE - Invalid command line argument. Consult the Windows Installer SDK for detailed command line help. -. - -MessageId=1640 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_REMOTE_DISALLOWED -Language=Bulgarian -ERROR_INSTALL_REMOTE_DISALLOWED - Only administrators have permission to add, remove, or configure server software during a Terminal Services remote session. If you want to install or configure software on the server, contact your network administrator. -. - -MessageId=1641 -Severity=Success -Facility=System -SymbolicName=ERROR_SUCCESS_REBOOT_INITIATED -Language=Bulgarian -ERROR_SUCCESS_REBOOT_INITIATED - The requested operation completed successfully. The system will be restarted so the changes can take effect. -. - -MessageId=1642 -Severity=Success -Facility=System -SymbolicName=ERROR_PATCH_TARGET_NOT_FOUND -Language=Bulgarian -ERROR_PATCH_TARGET_NOT_FOUND - The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch. -. - -MessageId=1643 -Severity=Success -Facility=System -SymbolicName=ERROR_PATCH_PACKAGE_REJECTED -Language=Bulgarian -ERROR_PATCH_PACKAGE_REJECTED - The patch package is not permitted by software restriction policy. -. - -MessageId=1644 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_TRANSFORM_REJECTED -Language=Bulgarian -ERROR_INSTALL_TRANSFORM_REJECTED - One or more customizations are not permitted by software restriction policy. -. - -MessageId=1645 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTALL_REMOTE_PROHIBITED -Language=Bulgarian -ERROR_INSTALL_REMOTE_PROHIBITED - The Windows Installer does not permit installation from a Remote Desktop Connection. -. - -MessageId=1700 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_STRING_BINDING -Language=Bulgarian -RPC_S_INVALID_STRING_BINDING - The string binding is invalid. -. - -MessageId=1701 -Severity=Success -Facility=System -SymbolicName=RPC_S_WRONG_KIND_OF_BINDING -Language=Bulgarian -RPC_S_WRONG_KIND_OF_BINDING - The binding handle is not the correct type. -. - -MessageId=1702 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_BINDING -Language=Bulgarian -RPC_S_INVALID_BINDING - The binding handle is invalid. -. - -MessageId=1703 -Severity=Success -Facility=System -SymbolicName=RPC_S_PROTSEQ_NOT_SUPPORTED -Language=Bulgarian -RPC_S_PROTSEQ_NOT_SUPPORTED - The RPC protocol sequence is not supported. -. - -MessageId=1704 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_RPC_PROTSEQ -Language=Bulgarian -RPC_S_INVALID_RPC_PROTSEQ - The RPC protocol sequence is invalid. -. - -MessageId=1705 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_STRING_UUID -Language=Bulgarian -RPC_S_INVALID_STRING_UUID - The string universal unique identifier (UUID) is invalid. -. - -MessageId=1706 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_ENDPOINT_FORMAT -Language=Bulgarian -RPC_S_INVALID_ENDPOINT_FORMAT - The endpoint format is invalid. -. - -MessageId=1707 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_NET_ADDR -Language=Bulgarian -RPC_S_INVALID_NET_ADDR - The network address is invalid. -. - -MessageId=1708 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_ENDPOINT_FOUND -Language=Bulgarian -RPC_S_NO_ENDPOINT_FOUND - No endpoint was found. -. - -MessageId=1709 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_TIMEOUT -Language=Bulgarian -RPC_S_INVALID_TIMEOUT - The timeout value is invalid. -. - -MessageId=1710 -Severity=Success -Facility=System -SymbolicName=RPC_S_OBJECT_NOT_FOUND -Language=Bulgarian -RPC_S_OBJECT_NOT_FOUND - The object universal unique identifier (UUID) was not found. -. - -MessageId=1711 -Severity=Success -Facility=System -SymbolicName=RPC_S_ALREADY_REGISTERED -Language=Bulgarian -RPC_S_ALREADY_REGISTERED - The object universal unique identifier (UUID) has already been registered. -. - -MessageId=1712 -Severity=Success -Facility=System -SymbolicName=RPC_S_TYPE_ALREADY_REGISTERED -Language=Bulgarian -RPC_S_TYPE_ALREADY_REGISTERED - The type universal unique identifier (UUID) has already been registered. -. - -MessageId=1713 -Severity=Success -Facility=System -SymbolicName=RPC_S_ALREADY_LISTENING -Language=Bulgarian -RPC_S_ALREADY_LISTENING - The RPC server is already listening. -. - -MessageId=1714 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_PROTSEQS_REGISTERED -Language=Bulgarian -RPC_S_NO_PROTSEQS_REGISTERED - No protocol sequences have been registered. -. - -MessageId=1715 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOT_LISTENING -Language=Bulgarian -RPC_S_NOT_LISTENING - The RPC server is not listening. -. - -MessageId=1716 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_MGR_TYPE -Language=Bulgarian -RPC_S_UNKNOWN_MGR_TYPE - The manager type is unknown. -. - -MessageId=1717 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_IF -Language=Bulgarian -RPC_S_UNKNOWN_IF - The interface is unknown. -. - -MessageId=1718 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_BINDINGS -Language=Bulgarian -RPC_S_NO_BINDINGS - There are no bindings. -. - -MessageId=1719 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_PROTSEQS -Language=Bulgarian -RPC_S_NO_PROTSEQS - There are no protocol sequences. -. - -MessageId=1720 -Severity=Success -Facility=System -SymbolicName=RPC_S_CANT_CREATE_ENDPOINT -Language=Bulgarian -RPC_S_CANT_CREATE_ENDPOINT - The endpoint cannot be created. -. - -MessageId=1721 -Severity=Success -Facility=System -SymbolicName=RPC_S_OUT_OF_RESOURCES -Language=Bulgarian -RPC_S_OUT_OF_RESOURCES - Not enough resources are available to complete this operation. -. - -MessageId=1722 -Severity=Success -Facility=System -SymbolicName=RPC_S_SERVER_UNAVAILABLE -Language=Bulgarian -RPC_S_SERVER_UNAVAILABLE - The RPC server is unavailable. -. - -MessageId=1723 -Severity=Success -Facility=System -SymbolicName=RPC_S_SERVER_TOO_BUSY -Language=Bulgarian -RPC_S_SERVER_TOO_BUSY - The RPC server is too busy to complete this operation. -. - -MessageId=1724 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_NETWORK_OPTIONS -Language=Bulgarian -RPC_S_INVALID_NETWORK_OPTIONS - The network options are invalid. -. - -MessageId=1725 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_CALL_ACTIVE -Language=Bulgarian -RPC_S_NO_CALL_ACTIVE - There are no remote procedure calls active on this thread. -. - -MessageId=1726 -Severity=Success -Facility=System -SymbolicName=RPC_S_CALL_FAILED -Language=Bulgarian -RPC_S_CALL_FAILED - The remote procedure call failed. -. - -MessageId=1727 -Severity=Success -Facility=System -SymbolicName=RPC_S_CALL_FAILED_DNE -Language=Bulgarian -RPC_S_CALL_FAILED_DNE - The remote procedure call failed and did not execute. -. - -MessageId=1728 -Severity=Success -Facility=System -SymbolicName=RPC_S_PROTOCOL_ERROR -Language=Bulgarian -RPC_S_PROTOCOL_ERROR - A remote procedure call (RPC) protocol error occurred. -. - -MessageId=1730 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNSUPPORTED_TRANS_SYN -Language=Bulgarian -RPC_S_UNSUPPORTED_TRANS_SYN - The transfer syntax is not supported by the RPC server. -. - -MessageId=1732 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNSUPPORTED_TYPE -Language=Bulgarian -RPC_S_UNSUPPORTED_TYPE - The universal unique identifier (UUID) type is not supported. -. - -MessageId=1733 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_TAG -Language=Bulgarian -RPC_S_INVALID_TAG - The tag is invalid. -. - -MessageId=1734 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_BOUND -Language=Bulgarian -RPC_S_INVALID_BOUND - The array bounds are invalid. -. - -MessageId=1735 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_ENTRY_NAME -Language=Bulgarian -RPC_S_NO_ENTRY_NAME - The binding does not contain an entry name. -. - -MessageId=1736 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_NAME_SYNTAX -Language=Bulgarian -RPC_S_INVALID_NAME_SYNTAX - The name syntax is invalid. -. - -MessageId=1737 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNSUPPORTED_NAME_SYNTAX -Language=Bulgarian -RPC_S_UNSUPPORTED_NAME_SYNTAX - The name syntax is not supported. -. - -MessageId=1739 -Severity=Success -Facility=System -SymbolicName=RPC_S_UUID_NO_ADDRESS -Language=Bulgarian -RPC_S_UUID_NO_ADDRESS - No network address is available to use to construct a universal unique identifier (UUID). -. - -MessageId=1740 -Severity=Success -Facility=System -SymbolicName=RPC_S_DUPLICATE_ENDPOINT -Language=Bulgarian -RPC_S_DUPLICATE_ENDPOINT - The endpoint is a duplicate. -. - -MessageId=1741 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_AUTHN_TYPE -Language=Bulgarian -RPC_S_UNKNOWN_AUTHN_TYPE - The authentication type is unknown. -. - -MessageId=1742 -Severity=Success -Facility=System -SymbolicName=RPC_S_MAX_CALLS_TOO_SMALL -Language=Bulgarian -RPC_S_MAX_CALLS_TOO_SMALL - The maximum number of calls is too small. -. - -MessageId=1743 -Severity=Success -Facility=System -SymbolicName=RPC_S_STRING_TOO_LONG -Language=Bulgarian -RPC_S_STRING_TOO_LONG - The string is too long. -. - -MessageId=1744 -Severity=Success -Facility=System -SymbolicName=RPC_S_PROTSEQ_NOT_FOUND -Language=Bulgarian -RPC_S_PROTSEQ_NOT_FOUND - The RPC protocol sequence was not found. -. - -MessageId=1745 -Severity=Success -Facility=System -SymbolicName=RPC_S_PROCNUM_OUT_OF_RANGE -Language=Bulgarian -RPC_S_PROCNUM_OUT_OF_RANGE - The procedure number is out of range. -. - -MessageId=1746 -Severity=Success -Facility=System -SymbolicName=RPC_S_BINDING_HAS_NO_AUTH -Language=Bulgarian -RPC_S_BINDING_HAS_NO_AUTH - The binding does not contain any authentication information. -. - -MessageId=1747 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_AUTHN_SERVICE -Language=Bulgarian -RPC_S_UNKNOWN_AUTHN_SERVICE - The authentication service is unknown. -. - -MessageId=1748 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_AUTHN_LEVEL -Language=Bulgarian -RPC_S_UNKNOWN_AUTHN_LEVEL - The authentication level is unknown. -. - -MessageId=1749 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_AUTH_IDENTITY -Language=Bulgarian -RPC_S_INVALID_AUTH_IDENTITY - The security context is invalid. -. - -MessageId=1750 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNKNOWN_AUTHZ_SERVICE -Language=Bulgarian -RPC_S_UNKNOWN_AUTHZ_SERVICE - The authorization service is unknown. -. - -MessageId=1751 -Severity=Success -Facility=System -SymbolicName=EPT_S_INVALID_ENTRY -Language=Bulgarian -EPT_S_INVALID_ENTRY - The entry is invalid. -. - -MessageId=1752 -Severity=Success -Facility=System -SymbolicName=EPT_S_CANT_PERFORM_OP -Language=Bulgarian -EPT_S_CANT_PERFORM_OP - The server endpoint cannot perform the operation. -. - -MessageId=1753 -Severity=Success -Facility=System -SymbolicName=EPT_S_NOT_REGISTERED -Language=Bulgarian -EPT_S_NOT_REGISTERED - There are no more endpoints available from the endpoint mapper. -. - -MessageId=1754 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOTHING_TO_EXPORT -Language=Bulgarian -RPC_S_NOTHING_TO_EXPORT - No interfaces have been exported. -. - -MessageId=1755 -Severity=Success -Facility=System -SymbolicName=RPC_S_INCOMPLETE_NAME -Language=Bulgarian -RPC_S_INCOMPLETE_NAME - The entry name is incomplete. -. - -MessageId=1756 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_VERS_OPTION -Language=Bulgarian -RPC_S_INVALID_VERS_OPTION - The version option is invalid. -. - -MessageId=1757 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_MORE_MEMBERS -Language=Bulgarian -RPC_S_NO_MORE_MEMBERS - There are no more members. -. - -MessageId=1758 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOT_ALL_OBJS_UNEXPORTED -Language=Bulgarian -RPC_S_NOT_ALL_OBJS_UNEXPORTED - There is nothing to unexport. -. - -MessageId=1759 -Severity=Success -Facility=System -SymbolicName=RPC_S_INTERFACE_NOT_FOUND -Language=Bulgarian -RPC_S_INTERFACE_NOT_FOUND - The interface was not found. -. - -MessageId=1760 -Severity=Success -Facility=System -SymbolicName=RPC_S_ENTRY_ALREADY_EXISTS -Language=Bulgarian -RPC_S_ENTRY_ALREADY_EXISTS - The entry already exists. -. - -MessageId=1761 -Severity=Success -Facility=System -SymbolicName=RPC_S_ENTRY_NOT_FOUND -Language=Bulgarian -RPC_S_ENTRY_NOT_FOUND - The entry is not found. -. - -MessageId=1762 -Severity=Success -Facility=System -SymbolicName=RPC_S_NAME_SERVICE_UNAVAILABLE -Language=Bulgarian -RPC_S_NAME_SERVICE_UNAVAILABLE - The name service is unavailable. -. - -MessageId=1763 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_NAF_ID -Language=Bulgarian -RPC_S_INVALID_NAF_ID - The network address family is invalid. -. - -MessageId=1764 -Severity=Success -Facility=System -SymbolicName=RPC_S_CANNOT_SUPPORT -Language=Bulgarian -RPC_S_CANNOT_SUPPORT - The requested operation is not supported. -. - -MessageId=1765 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_CONTEXT_AVAILABLE -Language=Bulgarian -RPC_S_NO_CONTEXT_AVAILABLE - No security context is available to allow impersonation. -. - -MessageId=1766 -Severity=Success -Facility=System -SymbolicName=RPC_S_INTERNAL_ERROR -Language=Bulgarian -RPC_S_INTERNAL_ERROR - An internal error occurred in a remote procedure call (RPC). -. - -MessageId=1767 -Severity=Success -Facility=System -SymbolicName=RPC_S_ZERO_DIVIDE -Language=Bulgarian -RPC_S_ZERO_DIVIDE - The RPC server attempted an integer division by zero. -. - -MessageId=1768 -Severity=Success -Facility=System -SymbolicName=RPC_S_ADDRESS_ERROR -Language=Bulgarian -RPC_S_ADDRESS_ERROR - An addressing error occurred in the RPC server. -. - -MessageId=1769 -Severity=Success -Facility=System -SymbolicName=RPC_S_FP_DIV_ZERO -Language=Bulgarian -RPC_S_FP_DIV_ZERO - A floating-point operation at the RPC server caused a division by zero. -. - -MessageId=1770 -Severity=Success -Facility=System -SymbolicName=RPC_S_FP_UNDERFLOW -Language=Bulgarian -RPC_S_FP_UNDERFLOW - A floating-point underflow occurred at the RPC server. -. - -MessageId=1771 -Severity=Success -Facility=System -SymbolicName=RPC_S_FP_OVERFLOW -Language=Bulgarian -RPC_S_FP_OVERFLOW - A floating-point overflow occurred at the RPC server. -. - -MessageId=1772 -Severity=Success -Facility=System -SymbolicName=RPC_X_NO_MORE_ENTRIES -Language=Bulgarian -RPC_X_NO_MORE_ENTRIES - The list of RPC servers available for the binding of auto handles has been exhausted. -. - -MessageId=1773 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_CHAR_TRANS_OPEN_FAIL -Language=Bulgarian -RPC_X_SS_CHAR_TRANS_OPEN_FAIL - Unable to open the character translation table file. -. - -MessageId=1774 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_CHAR_TRANS_SHORT_FILE -Language=Bulgarian -RPC_X_SS_CHAR_TRANS_SHORT_FILE - The file containing the character translation table has fewer than 512 bytes. -. - -MessageId=1775 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_IN_NULL_CONTEXT -Language=Bulgarian -RPC_X_SS_IN_NULL_CONTEXT - A null context handle was passed from the client to the host during a remote procedure call. -. - -MessageId=1777 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_CONTEXT_DAMAGED -Language=Bulgarian -RPC_X_SS_CONTEXT_DAMAGED - The context handle changed during a remote procedure call. -. - -MessageId=1778 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_HANDLES_MISMATCH -Language=Bulgarian -RPC_X_SS_HANDLES_MISMATCH - The binding handles passed to a remote procedure call do not match. -. - -MessageId=1779 -Severity=Success -Facility=System -SymbolicName=RPC_X_SS_CANNOT_GET_CALL_HANDLE -Language=Bulgarian -RPC_X_SS_CANNOT_GET_CALL_HANDLE - The stub is unable to get the remote procedure call handle. -. - -MessageId=1780 -Severity=Success -Facility=System -SymbolicName=RPC_X_NULL_REF_POINTER -Language=Bulgarian -RPC_X_NULL_REF_POINTER - A null reference pointer was passed to the stub. -. - -MessageId=1781 -Severity=Success -Facility=System -SymbolicName=RPC_X_ENUM_VALUE_OUT_OF_RANGE -Language=Bulgarian -RPC_X_ENUM_VALUE_OUT_OF_RANGE - The enumeration value is out of range. -. - -MessageId=1782 -Severity=Success -Facility=System -SymbolicName=RPC_X_BYTE_COUNT_TOO_SMALL -Language=Bulgarian -RPC_X_BYTE_COUNT_TOO_SMALL - The byte count is too small. -. - -MessageId=1783 -Severity=Success -Facility=System -SymbolicName=RPC_X_BAD_STUB_DATA -Language=Bulgarian -RPC_X_BAD_STUB_DATA - The stub received bad data. -. - -MessageId=1784 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_USER_BUFFER -Language=Bulgarian -ERROR_INVALID_USER_BUFFER - The supplied user buffer is not valid for the requested operation. -. - -MessageId=1785 -Severity=Success -Facility=System -SymbolicName=ERROR_UNRECOGNIZED_MEDIA -Language=Bulgarian -ERROR_UNRECOGNIZED_MEDIA - The disk media is not recognized. It may not be formatted. -. - -MessageId=1786 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_TRUST_LSA_SECRET -Language=Bulgarian -ERROR_NO_TRUST_LSA_SECRET - The workstation does not have a trust secret. -. - -MessageId=1787 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_TRUST_SAM_ACCOUNT -Language=Bulgarian -ERROR_NO_TRUST_SAM_ACCOUNT - The security database on the server does not have a computer account for this workstation trust relationship. -. - -MessageId=1788 -Severity=Success -Facility=System -SymbolicName=ERROR_TRUSTED_DOMAIN_FAILURE -Language=Bulgarian -ERROR_TRUSTED_DOMAIN_FAILURE - The trust relationship between the primary domain and the trusted domain failed. -. - -MessageId=1789 -Severity=Success -Facility=System -SymbolicName=ERROR_TRUSTED_RELATIONSHIP_FAILURE -Language=Bulgarian -ERROR_TRUSTED_RELATIONSHIP_FAILURE - The trust relationship between this workstation and the primary domain failed. -. - -MessageId=1790 -Severity=Success -Facility=System -SymbolicName=ERROR_TRUST_FAILURE -Language=Bulgarian -ERROR_TRUST_FAILURE - The network logon failed. -. - -MessageId=1791 -Severity=Success -Facility=System -SymbolicName=RPC_S_CALL_IN_PROGRESS -Language=Bulgarian -RPC_S_CALL_IN_PROGRESS - A remote procedure call is already in progress for this thread. -. - -MessageId=1792 -Severity=Success -Facility=System -SymbolicName=ERROR_NETLOGON_NOT_STARTED -Language=Bulgarian -ERROR_NETLOGON_NOT_STARTED - An attempt was made to logon, but the network logon service was not started. -. - -MessageId=1793 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCOUNT_EXPIRED -Language=Bulgarian -ERROR_ACCOUNT_EXPIRED - The user's account has expired. -. - -MessageId=1794 -Severity=Success -Facility=System -SymbolicName=ERROR_REDIRECTOR_HAS_OPEN_HANDLES -Language=Bulgarian -ERROR_REDIRECTOR_HAS_OPEN_HANDLES - The redirector is in use and cannot be unloaded. -. - -MessageId=1795 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_DRIVER_ALREADY_INSTALLED -Language=Bulgarian -ERROR_PRINTER_DRIVER_ALREADY_INSTALLED - The specified printer driver is already installed. -. - -MessageId=1796 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PORT -Language=Bulgarian -ERROR_UNKNOWN_PORT - The specified port is unknown. -. - -MessageId=1797 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PRINTER_DRIVER -Language=Bulgarian -ERROR_UNKNOWN_PRINTER_DRIVER - The printer driver is unknown. -. - -MessageId=1798 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PRINTPROCESSOR -Language=Bulgarian -ERROR_UNKNOWN_PRINTPROCESSOR - The print processor is unknown. -. - -MessageId=1799 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SEPARATOR_FILE -Language=Bulgarian -ERROR_INVALID_SEPARATOR_FILE - The specified separator file is invalid. -. - -MessageId=1800 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRIORITY -Language=Bulgarian -ERROR_INVALID_PRIORITY - The specified priority is invalid. -. - -MessageId=1801 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRINTER_NAME -Language=Bulgarian -ERROR_INVALID_PRINTER_NAME - The printer name is invalid. -. - -MessageId=1802 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_ALREADY_EXISTS -Language=Bulgarian -ERROR_PRINTER_ALREADY_EXISTS - The printer already exists. -. - -MessageId=1803 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRINTER_COMMAND -Language=Bulgarian -ERROR_INVALID_PRINTER_COMMAND - The printer command is invalid. -. - -MessageId=1804 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DATATYPE -Language=Bulgarian -ERROR_INVALID_DATATYPE - The specified datatype is invalid. -. - -MessageId=1805 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ENVIRONMENT -Language=Bulgarian -ERROR_INVALID_ENVIRONMENT - The environment specified is invalid. -. - -MessageId=1806 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_MORE_BINDINGS -Language=Bulgarian -RPC_S_NO_MORE_BINDINGS - There are no more bindings. -. - -MessageId=1807 -Severity=Success -Facility=System -SymbolicName=ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT -Language=Bulgarian -ERROR_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT - The account used is an interdomain trust account. Use your global user account or local user account to access this server. -. - -MessageId=1808 -Severity=Success -Facility=System -SymbolicName=ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT -Language=Bulgarian -ERROR_NOLOGON_WORKSTATION_TRUST_ACCOUNT - The account used is a computer account. Use your global user account or local user account to access this server. -. - -MessageId=1809 -Severity=Success -Facility=System -SymbolicName=ERROR_NOLOGON_SERVER_TRUST_ACCOUNT -Language=Bulgarian -ERROR_NOLOGON_SERVER_TRUST_ACCOUNT - The account used is a server trust account. Use your global user account or local user account to access this server. -. - -MessageId=1810 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_TRUST_INCONSISTENT -Language=Bulgarian -ERROR_DOMAIN_TRUST_INCONSISTENT - The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain. -. - -MessageId=1811 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVER_HAS_OPEN_HANDLES -Language=Bulgarian -ERROR_SERVER_HAS_OPEN_HANDLES - The server is in use and cannot be unloaded. -. - -MessageId=1812 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_DATA_NOT_FOUND -Language=Bulgarian -ERROR_RESOURCE_DATA_NOT_FOUND - The specified image file did not contain a resource section. -. - -MessageId=1813 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_TYPE_NOT_FOUND -Language=Bulgarian -ERROR_RESOURCE_TYPE_NOT_FOUND - The specified resource type cannot be found in the image file. -. - -MessageId=1814 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_NAME_NOT_FOUND -Language=Bulgarian -ERROR_RESOURCE_NAME_NOT_FOUND - The specified resource name cannot be found in the image file. -. - -MessageId=1815 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_LANG_NOT_FOUND -Language=Bulgarian -ERROR_RESOURCE_LANG_NOT_FOUND - The specified resource language ID cannot be found in the image file. -. - -MessageId=1816 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_ENOUGH_QUOTA -Language=Bulgarian -ERROR_NOT_ENOUGH_QUOTA - Not enough quota is available to process this command. -. - -MessageId=1817 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_INTERFACES -Language=Bulgarian -RPC_S_NO_INTERFACES - No interfaces have been registered. -. - -MessageId=1818 -Severity=Success -Facility=System -SymbolicName=RPC_S_CALL_CANCELLED -Language=Bulgarian -RPC_S_CALL_CANCELLED - The remote procedure call was cancelled. -. - -MessageId=1819 -Severity=Success -Facility=System -SymbolicName=RPC_S_BINDING_INCOMPLETE -Language=Bulgarian -RPC_S_BINDING_INCOMPLETE - The binding handle does not contain all required information. -. - -MessageId=1820 -Severity=Success -Facility=System -SymbolicName=RPC_S_COMM_FAILURE -Language=Bulgarian -RPC_S_COMM_FAILURE - A communications failure occurred during a remote procedure call. -. - -MessageId=1821 -Severity=Success -Facility=System -SymbolicName=RPC_S_UNSUPPORTED_AUTHN_LEVEL -Language=Bulgarian -RPC_S_UNSUPPORTED_AUTHN_LEVEL - The requested authentication level is not supported. -. - -MessageId=1822 -Severity=Success -Facility=System -SymbolicName=RPC_S_NO_PRINC_NAME -Language=Bulgarian -RPC_S_NO_PRINC_NAME - No principal name registered. -. - -MessageId=1823 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOT_RPC_ERROR -Language=Bulgarian -RPC_S_NOT_RPC_ERROR - The error specified is not a valid Windows RPC error code. -. - -MessageId=1824 -Severity=Success -Facility=System -SymbolicName=RPC_S_UUID_LOCAL_ONLY -Language=Bulgarian -RPC_S_UUID_LOCAL_ONLY - A UUID that is valid only on this computer has been allocated. -. - -MessageId=1825 -Severity=Success -Facility=System -SymbolicName=RPC_S_SEC_PKG_ERROR -Language=Bulgarian -RPC_S_SEC_PKG_ERROR - A security package specific error occurred. -. - -MessageId=1826 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOT_CANCELLED -Language=Bulgarian -RPC_S_NOT_CANCELLED - Thread is not canceled. -. - -MessageId=1827 -Severity=Success -Facility=System -SymbolicName=RPC_X_INVALID_ES_ACTION -Language=Bulgarian -RPC_X_INVALID_ES_ACTION - Invalid operation on the encoding/decoding handle. -. - -MessageId=1828 -Severity=Success -Facility=System -SymbolicName=RPC_X_WRONG_ES_VERSION -Language=Bulgarian -RPC_X_WRONG_ES_VERSION - Incompatible version of the serializing package. -. - -MessageId=1829 -Severity=Success -Facility=System -SymbolicName=RPC_X_WRONG_STUB_VERSION -Language=Bulgarian -RPC_X_WRONG_STUB_VERSION - Incompatible version of the RPC stub. -. - -MessageId=1830 -Severity=Success -Facility=System -SymbolicName=RPC_X_INVALID_PIPE_OBJECT -Language=Bulgarian -RPC_X_INVALID_PIPE_OBJECT - The RPC pipe object is invalid or corrupted. -. - -MessageId=1831 -Severity=Success -Facility=System -SymbolicName=RPC_X_WRONG_PIPE_ORDER -Language=Bulgarian -RPC_X_WRONG_PIPE_ORDER - An invalid operation was attempted on an RPC pipe object. -. - -MessageId=1832 -Severity=Success -Facility=System -SymbolicName=RPC_X_WRONG_PIPE_VERSION -Language=Bulgarian -RPC_X_WRONG_PIPE_VERSION - Unsupported RPC pipe version. -. - -MessageId=1898 -Severity=Success -Facility=System -SymbolicName=RPC_S_GROUP_MEMBER_NOT_FOUND -Language=Bulgarian -RPC_S_GROUP_MEMBER_NOT_FOUND - The group member was not found. -. - -MessageId=1899 -Severity=Success -Facility=System -SymbolicName=EPT_S_CANT_CREATE -Language=Bulgarian -EPT_S_CANT_CREATE - The endpoint mapper database entry could not be created. -. - -MessageId=1900 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_OBJECT -Language=Bulgarian -RPC_S_INVALID_OBJECT - The object universal unique identifier (UUID) is the nil UUID. -. - -MessageId=1901 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_TIME -Language=Bulgarian -ERROR_INVALID_TIME - The specified time is invalid. -. - -MessageId=1902 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FORM_NAME -Language=Bulgarian -ERROR_INVALID_FORM_NAME - The specified form name is invalid. -. - -MessageId=1903 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FORM_SIZE -Language=Bulgarian -ERROR_INVALID_FORM_SIZE - The specified form size is invalid. -. - -MessageId=1904 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_WAITING -Language=Bulgarian -ERROR_ALREADY_WAITING - The specified printer handle is already being waited on -. - -MessageId=1905 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_DELETED -Language=Bulgarian -ERROR_PRINTER_DELETED - The specified printer has been deleted. -. - -MessageId=1906 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRINTER_STATE -Language=Bulgarian -ERROR_INVALID_PRINTER_STATE - The state of the printer is invalid. -. - -MessageId=1907 -Severity=Success -Facility=System -SymbolicName=ERROR_PASSWORD_MUST_CHANGE -Language=Bulgarian -ERROR_PASSWORD_MUST_CHANGE - The user's password must be changed before logging on the first time. -. - -MessageId=1908 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_CONTROLLER_NOT_FOUND -Language=Bulgarian -ERROR_DOMAIN_CONTROLLER_NOT_FOUND - Could not find the domain controller for this domain. -. - -MessageId=1909 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCOUNT_LOCKED_OUT -Language=Bulgarian -ERROR_ACCOUNT_LOCKED_OUT - The referenced account is currently locked out and may not be used to log on. -. - -MessageId=1910 -Severity=Success -Facility=System -SymbolicName=OR_INVALID_OXID -Language=Bulgarian -OR_INVALID_OXID - The object exporter specified was not found. -. - -MessageId=1911 -Severity=Success -Facility=System -SymbolicName=OR_INVALID_OID -Language=Bulgarian -OR_INVALID_OID - The object specified was not found. -. - -MessageId=1912 -Severity=Success -Facility=System -SymbolicName=OR_INVALID_SET -Language=Bulgarian -OR_INVALID_SET - The object resolver set specified was not found. -. - -MessageId=1913 -Severity=Success -Facility=System -SymbolicName=RPC_S_SEND_INCOMPLETE -Language=Bulgarian -RPC_S_SEND_INCOMPLETE - Some data remains to be sent in the request buffer. -. - -MessageId=1914 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_ASYNC_HANDLE -Language=Bulgarian -RPC_S_INVALID_ASYNC_HANDLE - Invalid asynchronous remote procedure call handle. -. - -MessageId=1915 -Severity=Success -Facility=System -SymbolicName=RPC_S_INVALID_ASYNC_CALL -Language=Bulgarian -RPC_S_INVALID_ASYNC_CALL - Invalid asynchronous RPC call handle for this operation. -. - -MessageId=1916 -Severity=Success -Facility=System -SymbolicName=RPC_X_PIPE_CLOSED -Language=Bulgarian -RPC_X_PIPE_CLOSED - The RPC pipe object has already been closed. -. - -MessageId=1917 -Severity=Success -Facility=System -SymbolicName=RPC_X_PIPE_DISCIPLINE_ERROR -Language=Bulgarian -RPC_X_PIPE_DISCIPLINE_ERROR - The RPC call completed before all pipes were processed. -. - -MessageId=1918 -Severity=Success -Facility=System -SymbolicName=RPC_X_PIPE_EMPTY -Language=Bulgarian -RPC_X_PIPE_EMPTY - No more data is available from the RPC pipe. -. - -MessageId=1919 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SITENAME -Language=Bulgarian -ERROR_NO_SITENAME - No site name is available for this machine. -. - -MessageId=1920 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_ACCESS_FILE -Language=Bulgarian -ERROR_CANT_ACCESS_FILE - The file cannot be accessed by the system. -. - -MessageId=1921 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_RESOLVE_FILENAME -Language=Bulgarian -ERROR_CANT_RESOLVE_FILENAME - The name of the file cannot be resolved by the system. -. - -MessageId=1922 -Severity=Success -Facility=System -SymbolicName=RPC_S_ENTRY_TYPE_MISMATCH -Language=Bulgarian -RPC_S_ENTRY_TYPE_MISMATCH - The entry is not of the expected type. -. - -MessageId=1923 -Severity=Success -Facility=System -SymbolicName=RPC_S_NOT_ALL_OBJS_EXPORTED -Language=Bulgarian -RPC_S_NOT_ALL_OBJS_EXPORTED - Not all object UUIDs could be exported to the specified entry. -. - -MessageId=1924 -Severity=Success -Facility=System -SymbolicName=RPC_S_INTERFACE_NOT_EXPORTED -Language=Bulgarian -RPC_S_INTERFACE_NOT_EXPORTED - Interface could not be exported to the specified entry. -. - -MessageId=1925 -Severity=Success -Facility=System -SymbolicName=RPC_S_PROFILE_NOT_ADDED -Language=Bulgarian -RPC_S_PROFILE_NOT_ADDED - The specified profile entry could not be added. -. - -MessageId=1926 -Severity=Success -Facility=System -SymbolicName=RPC_S_PRF_ELT_NOT_ADDED -Language=Bulgarian -RPC_S_PRF_ELT_NOT_ADDED - The specified profile element could not be added. -. - -MessageId=1927 -Severity=Success -Facility=System -SymbolicName=RPC_S_PRF_ELT_NOT_REMOVED -Language=Bulgarian -RPC_S_PRF_ELT_NOT_REMOVED - The specified profile element could not be removed. -. - -MessageId=1928 -Severity=Success -Facility=System -SymbolicName=RPC_S_GRP_ELT_NOT_ADDED -Language=Bulgarian -RPC_S_GRP_ELT_NOT_ADDED - The group element could not be added. -. - -MessageId=1929 -Severity=Success -Facility=System -SymbolicName=RPC_S_GRP_ELT_NOT_REMOVED -Language=Bulgarian -RPC_S_GRP_ELT_NOT_REMOVED - The group element could not be removed. -. - -MessageId=1930 -Severity=Success -Facility=System -SymbolicName=ERROR_KM_DRIVER_BLOCKED -Language=Bulgarian -ERROR_KM_DRIVER_BLOCKED - The printer driver is not compatible with a policy enabled on your computer that blocks NT 4.0 drivers. -. - -MessageId=1931 -Severity=Success -Facility=System -SymbolicName=ERROR_CONTEXT_EXPIRED -Language=Bulgarian -ERROR_CONTEXT_EXPIRED - The context has expired and can no longer be used. -. - -MessageId=1932 -Severity=Success -Facility=System -SymbolicName=ERROR_PER_USER_TRUST_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_PER_USER_TRUST_QUOTA_EXCEEDED - The current user's delegated trust creation quota has been exceeded. -. - -MessageId=1933 -Severity=Success -Facility=System -SymbolicName=ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_ALL_USER_TRUST_QUOTA_EXCEEDED - The total delegated trust creation quota has been exceeded. -. - -MessageId=1934 -Severity=Success -Facility=System -SymbolicName=ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_USER_DELETE_TRUST_QUOTA_EXCEEDED - The current user's delegated trust deletion quota has been exceeded. -. - -MessageId=2000 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PIXEL_FORMAT -Language=Bulgarian -ERROR_INVALID_PIXEL_FORMAT - The pixel format is invalid. -. - -MessageId=2001 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DRIVER -Language=Bulgarian -ERROR_BAD_DRIVER - The specified driver is invalid. -. - -MessageId=2002 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_WINDOW_STYLE -Language=Bulgarian -ERROR_INVALID_WINDOW_STYLE - The window style or class attribute is invalid for this operation. -. - -MessageId=2003 -Severity=Success -Facility=System -SymbolicName=ERROR_METAFILE_NOT_SUPPORTED -Language=Bulgarian -ERROR_METAFILE_NOT_SUPPORTED - The requested metafile operation is not supported. -. - -MessageId=2004 -Severity=Success -Facility=System -SymbolicName=ERROR_TRANSFORM_NOT_SUPPORTED -Language=Bulgarian -ERROR_TRANSFORM_NOT_SUPPORTED - The requested transformation operation is not supported. -. - -MessageId=2005 -Severity=Success -Facility=System -SymbolicName=ERROR_CLIPPING_NOT_SUPPORTED -Language=Bulgarian -ERROR_CLIPPING_NOT_SUPPORTED - The requested clipping operation is not supported. -. - -MessageId=2010 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_CMM -Language=Bulgarian -ERROR_INVALID_CMM - The specified color management module is invalid. -. - -MessageId=2011 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PROFILE -Language=Bulgarian -ERROR_INVALID_PROFILE - The specified color profile is invalid. -. - -MessageId=2012 -Severity=Success -Facility=System -SymbolicName=ERROR_TAG_NOT_FOUND -Language=Bulgarian -ERROR_TAG_NOT_FOUND - The specified tag was not found. -. - -MessageId=2013 -Severity=Success -Facility=System -SymbolicName=ERROR_TAG_NOT_PRESENT -Language=Bulgarian -ERROR_TAG_NOT_PRESENT - A required tag is not present. -. - -MessageId=2014 -Severity=Success -Facility=System -SymbolicName=ERROR_DUPLICATE_TAG -Language=Bulgarian -ERROR_DUPLICATE_TAG - The specified tag is already present. -. - -MessageId=2015 -Severity=Success -Facility=System -SymbolicName=ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE -Language=Bulgarian -ERROR_PROFILE_NOT_ASSOCIATED_WITH_DEVICE - The specified color profile is not associated with any device. -. - -MessageId=2016 -Severity=Success -Facility=System -SymbolicName=ERROR_PROFILE_NOT_FOUND -Language=Bulgarian -ERROR_PROFILE_NOT_FOUND - The specified color profile was not found. -. - -MessageId=2017 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_COLORSPACE -Language=Bulgarian -ERROR_INVALID_COLORSPACE - The specified color space is invalid. -. - -MessageId=2018 -Severity=Success -Facility=System -SymbolicName=ERROR_ICM_NOT_ENABLED -Language=Bulgarian -ERROR_ICM_NOT_ENABLED - Image Color Management is not enabled. -. - -MessageId=2019 -Severity=Success -Facility=System -SymbolicName=ERROR_DELETING_ICM_XFORM -Language=Bulgarian -ERROR_DELETING_ICM_XFORM - There was an error while deleting the color transform. -. - -MessageId=2020 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_TRANSFORM -Language=Bulgarian -ERROR_INVALID_TRANSFORM - The specified color transform is invalid. -. - -MessageId=2021 -Severity=Success -Facility=System -SymbolicName=ERROR_COLORSPACE_MISMATCH -Language=Bulgarian -ERROR_COLORSPACE_MISMATCH - The specified transform does not match the bitmap's color space. -. - -MessageId=2022 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_COLORINDEX -Language=Bulgarian -ERROR_INVALID_COLORINDEX - The specified named color index is not present in the profile. -. - -MessageId=2108 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTED_OTHER_PASSWORD -Language=Bulgarian -ERROR_CONNECTED_OTHER_PASSWORD - The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified. -. - -MessageId=2109 -Severity=Success -Facility=System -SymbolicName=ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT -Language=Bulgarian -ERROR_CONNECTED_OTHER_PASSWORD_DEFAULT - The network connection was made successfully using default credentials. -. - -MessageId=2202 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_USERNAME -Language=Bulgarian -ERROR_BAD_USERNAME - The specified username is invalid. -. - -MessageId=2250 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_CONNECTED -Language=Bulgarian -ERROR_NOT_CONNECTED - This network connection does not exist. -. - -MessageId=2401 -Severity=Success -Facility=System -SymbolicName=ERROR_OPEN_FILES -Language=Bulgarian -ERROR_OPEN_FILES - This network connection has files open or requests pending. -. - -MessageId=2402 -Severity=Success -Facility=System -SymbolicName=ERROR_ACTIVE_CONNECTIONS -Language=Bulgarian -ERROR_ACTIVE_CONNECTIONS - Active connections still exist. -. - -MessageId=2404 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_IN_USE -Language=Bulgarian -ERROR_DEVICE_IN_USE - The device is in use by an active process and cannot be disconnected. -. - -MessageId=3000 -Severity=Success -Facility=System -SymbolicName=ERROR_UNKNOWN_PRINT_MONITOR -Language=Bulgarian -ERROR_UNKNOWN_PRINT_MONITOR - The specified print monitor is unknown. -. - -MessageId=3001 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_DRIVER_IN_USE -Language=Bulgarian -ERROR_PRINTER_DRIVER_IN_USE - The specified printer driver is currently in use. -. - -MessageId=3002 -Severity=Success -Facility=System -SymbolicName=ERROR_SPOOL_FILE_NOT_FOUND -Language=Bulgarian -ERROR_SPOOL_FILE_NOT_FOUND - The spool file was not found. -. - -MessageId=3003 -Severity=Success -Facility=System -SymbolicName=ERROR_SPL_NO_STARTDOC -Language=Bulgarian -ERROR_SPL_NO_STARTDOC - A StartDocPrinter call was not issued. -. - -MessageId=3004 -Severity=Success -Facility=System -SymbolicName=ERROR_SPL_NO_ADDJOB -Language=Bulgarian -ERROR_SPL_NO_ADDJOB - An AddJob call was not issued. -. - -MessageId=3005 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED -Language=Bulgarian -ERROR_PRINT_PROCESSOR_ALREADY_INSTALLED - The specified print processor has already been installed. -. - -MessageId=3006 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINT_MONITOR_ALREADY_INSTALLED -Language=Bulgarian -ERROR_PRINT_MONITOR_ALREADY_INSTALLED - The specified print monitor has already been installed. -. - -MessageId=3007 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PRINT_MONITOR -Language=Bulgarian -ERROR_INVALID_PRINT_MONITOR - The specified print monitor does not have the required functions. -. - -MessageId=3008 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINT_MONITOR_IN_USE -Language=Bulgarian -ERROR_PRINT_MONITOR_IN_USE - The specified print monitor is currently in use. -. - -MessageId=3009 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_HAS_JOBS_QUEUED -Language=Bulgarian -ERROR_PRINTER_HAS_JOBS_QUEUED - The requested operation is not allowed when there are jobs queued to the printer. -. - -MessageId=3010 -Severity=Success -Facility=System -SymbolicName=ERROR_SUCCESS_REBOOT_REQUIRED -Language=Bulgarian -ERROR_SUCCESS_REBOOT_REQUIRED - The requested operation is successful. Changes will not be effective until the system is rebooted. -. - -MessageId=3011 -Severity=Success -Facility=System -SymbolicName=ERROR_SUCCESS_RESTART_REQUIRED -Language=Bulgarian -ERROR_SUCCESS_RESTART_REQUIRED - The requested operation is successful. Changes will not be effective until the service is restarted. -. - -MessageId=3012 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_NOT_FOUND -Language=Bulgarian -ERROR_PRINTER_NOT_FOUND - No printers were found. -. - -MessageId=3013 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_DRIVER_WARNED -Language=Bulgarian -ERROR_PRINTER_DRIVER_WARNED - The printer driver is known to be unreliable. -. - -MessageId=3014 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTER_DRIVER_BLOCKED -Language=Bulgarian -ERROR_PRINTER_DRIVER_BLOCKED - The printer driver is known to harm the system. -. - -MessageId=3100 -Severity=Success -Facility=System -SymbolicName=ERROR_XML_UNDEFINED_ENTITY -Language=Bulgarian -ERROR_XML_UNDEFINED_ENTITY - The XML contains an entity reference to an undefined entity. -. - -MessageId=3101 -Severity=Success -Facility=System -SymbolicName=ERROR_XML_MALFORMED_ENTITY -Language=Bulgarian -ERROR_XML_MALFORMED_ENTITY - The XML contains a malformed entity reference. -. - -MessageId=3102 -Severity=Success -Facility=System -SymbolicName=ERROR_XML_CHAR_NOT_IN_RANGE -Language=Bulgarian -ERROR_XML_CHAR_NOT_IN_RANGE - The XML contains a character which is not permitted in XML. -. - -MessageId=3200 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_EXTERNAL_PROXY -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_EXTERNAL_PROXY - The manifest contained a duplicate definition for external proxy stub %1 at (%1:%2,%3) -. - -MessageId=3201 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_ASSEMBLY_REFERENCE -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_ASSEMBLY_REFERENCE - The manifest already contains a reference to %4 - a second reference was found at (%1:%2,%3) -. - -MessageId=3202 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_INVALID_ASSEMBLY_REFERENCE -Language=Bulgarian -ERROR_PCM_COMPILER_INVALID_ASSEMBLY_REFERENCE - The assembly reference at (%1:%2,%3) is invalid. -. - -MessageId=3203 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_INVALID_ASSEMBLY_DEFINITION -Language=Bulgarian -ERROR_PCM_COMPILER_INVALID_ASSEMBLY_DEFINITION - The assembly definition at (%1:%2,%3) is invalid. -. - -MessageId=3204 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_WINDOW_CLASS -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_WINDOW_CLASS - The manifest already contained the window class %4, found a second declaration at (%1:%2,%3) -. - -MessageId=3205 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_PROGID -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_PROGID - The manifest already declared the progId %4, found a second declaration at (%1:%2,%3) -. - -MessageId=3206 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_NOINHERIT -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_NOINHERIT - Only one noInherit tag may be present in a manifest, found a second tag at (%1:%2,%3) -. - -MessageId=3207 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_NOINHERITABLE -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_NOINHERITABLE - Only one noInheritable tag may be present in a manifest, found a second tag at (%1:%2,%3) -. - -MessageId=3208 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_COM_CLASS -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_COM_CLASS - The manifest contained a duplicate declaration of COM class %4 at (%1:%2,%3) -. - -MessageId=3209 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_FILE_NAME -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_FILE_NAME - The manifest already declared the file %4, a second definition was found at (%1:%2,%3) -. - -MessageId=3210 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_CLR_SURROGATE -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_CLR_SURROGATE - CLR surrogate %1 was already defined, second definition at (%1:%2,%3) is invalid. -. - -MessageId=3211 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_TYPE_LIBRARY -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_TYPE_LIBRARY - Type library %1 was already defined, second definition at (%1:%2,%3) is invalid. -. - -MessageId=3212 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_PROXY_STUB -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_PROXY_STUB - Proxy stub definition %1 was already defined, second definition at (%1:%2,%3) is invalid. -. - -MessageId=3213 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_CATEGORY_NAME -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_CATEGORY_NAME - Category friendly name %4 was already used, second definition was found at (%1:%2,%3) is invalid. -. - -MessageId=3214 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_DUPLICATE_TOP_LEVEL_IDENTITY_FOUND -Language=Bulgarian -ERROR_PCM_COMPILER_DUPLICATE_TOP_LEVEL_IDENTITY_FOUND - Only one top-level assemblyIdentity tag may be present in a manifest. A second tag with identity %4 was found at (%1:%2,%3) -. - -MessageId=3215 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_UNKNOWN_ROOT_ELEMENT -Language=Bulgarian -ERROR_PCM_COMPILER_UNKNOWN_ROOT_ELEMENT - The root element for a manifest found at (%1:%2,%3) was not expected or was of the wrong version. -. - -MessageId=3216 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_INVALID_ELEMENT -Language=Bulgarian -ERROR_PCM_COMPILER_INVALID_ELEMENT - The element found at (%1:%2,%3) was not expected according to the manifest schema. -. - -MessageId=3217 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_MISSING_REQUIRED_ATTRIBUTE -Language=Bulgarian -ERROR_PCM_COMPILER_MISSING_REQUIRED_ATTRIBUTE - The element found at (%1:%2,%3) was missing the required attribute '%4'. See the manifest schema for more information -. - -MessageId=3218 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_INVALID_ATTRIBUTE_VALUE -Language=Bulgarian -ERROR_PCM_COMPILER_INVALID_ATTRIBUTE_VALUE - The attribute value %4 at (%1:%2,%3) was invalid according to the schema. -. - -MessageId=3219 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_COMPILER_UNEXPECTED_PCDATA -Language=Bulgarian -ERROR_PCM_COMPILER_UNEXPECTED_PCDATA - PCDATA or CDATA found at (%1:%2,%3) in the source document was not expected in the parent element %4. -. - -MessageId=3220 -Severity=Success -Facility=System -SymbolicName=ERROR_PCM_DUPLICATE_STRING_TABLE_ENT -Language=Bulgarian -ERROR_PCM_DUPLICATE_STRING_TABLE_ENT - The string table entry with culture %4, name %5, and value '%6' at (%1:%2,%3) duplicated a previous entry. -. - -MessageId=4000 -Severity=Success -Facility=System -SymbolicName=ERROR_WINS_INTERNAL -Language=Bulgarian -ERROR_WINS_INTERNAL - WINS encountered an error while processing the command. -. - -MessageId=4001 -Severity=Success -Facility=System -SymbolicName=ERROR_CAN_NOT_DEL_LOCAL_WINS -Language=Bulgarian -ERROR_CAN_NOT_DEL_LOCAL_WINS - The local WINS cannot be deleted. -. - -MessageId=4002 -Severity=Success -Facility=System -SymbolicName=ERROR_STATIC_INIT -Language=Bulgarian -ERROR_STATIC_INIT - The importation from the file failed. -. - -MessageId=4003 -Severity=Success -Facility=System -SymbolicName=ERROR_INC_BACKUP -Language=Bulgarian -ERROR_INC_BACKUP - The backup failed. Was a full backup done before? -. - -MessageId=4004 -Severity=Success -Facility=System -SymbolicName=ERROR_FULL_BACKUP -Language=Bulgarian -ERROR_FULL_BACKUP - The backup failed. Check the directory to which you are backing the database. -. - -MessageId=4005 -Severity=Success -Facility=System -SymbolicName=ERROR_REC_NON_EXISTENT -Language=Bulgarian -ERROR_REC_NON_EXISTENT - The name does not exist in the WINS database. -. - -MessageId=4006 -Severity=Success -Facility=System -SymbolicName=ERROR_RPL_NOT_ALLOWED -Language=Bulgarian -ERROR_RPL_NOT_ALLOWED - Replication with a nonconfigured partner is not allowed. -. - -MessageId=4100 -Severity=Success -Facility=System -SymbolicName=ERROR_DHCP_ADDRESS_CONFLICT -Language=Bulgarian -ERROR_DHCP_ADDRESS_CONFLICT - The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address. -. - -MessageId=4200 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_GUID_NOT_FOUND -Language=Bulgarian -ERROR_WMI_GUID_NOT_FOUND - The GUID passed was not recognized as valid by a WMI data provider. -. - -MessageId=4201 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_INSTANCE_NOT_FOUND -Language=Bulgarian -ERROR_WMI_INSTANCE_NOT_FOUND - The instance name passed was not recognized as valid by a WMI data provider. -. - -MessageId=4202 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_ITEMID_NOT_FOUND -Language=Bulgarian -ERROR_WMI_ITEMID_NOT_FOUND - The data item ID passed was not recognized as valid by a WMI data provider. -. - -MessageId=4203 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_TRY_AGAIN -Language=Bulgarian -ERROR_WMI_TRY_AGAIN - The WMI request could not be completed and should be retried. -. - -MessageId=4204 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_DP_NOT_FOUND -Language=Bulgarian -ERROR_WMI_DP_NOT_FOUND - The WMI data provider could not be located. -. - -MessageId=4205 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_UNRESOLVED_INSTANCE_REF -Language=Bulgarian -ERROR_WMI_UNRESOLVED_INSTANCE_REF - The WMI data provider references an instance set that has not been registered. -. - -MessageId=4206 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_ALREADY_ENABLED -Language=Bulgarian -ERROR_WMI_ALREADY_ENABLED - The WMI data block or event notification has already been enabled. -. - -MessageId=4207 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_GUID_DISCONNECTED -Language=Bulgarian -ERROR_WMI_GUID_DISCONNECTED - The WMI data block is no longer available. -. - -MessageId=4208 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_SERVER_UNAVAILABLE -Language=Bulgarian -ERROR_WMI_SERVER_UNAVAILABLE - The WMI data service is not available. -. - -MessageId=4209 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_DP_FAILED -Language=Bulgarian -ERROR_WMI_DP_FAILED - The WMI data provider failed to carry out the request. -. - -MessageId=4210 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_INVALID_MOF -Language=Bulgarian -ERROR_WMI_INVALID_MOF - The WMI MOF information is not valid. -. - -MessageId=4211 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_INVALID_REGINFO -Language=Bulgarian -ERROR_WMI_INVALID_REGINFO - The WMI registration information is not valid. -. - -MessageId=4212 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_ALREADY_DISABLED -Language=Bulgarian -ERROR_WMI_ALREADY_DISABLED - The WMI data block or event notification has already been disabled. -. - -MessageId=4213 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_READ_ONLY -Language=Bulgarian -ERROR_WMI_READ_ONLY - The WMI data item or data block is read only. -. - -MessageId=4214 -Severity=Success -Facility=System -SymbolicName=ERROR_WMI_SET_FAILURE -Language=Bulgarian -ERROR_WMI_SET_FAILURE - The WMI data item or data block could not be changed. -. - -MessageId=4300 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MEDIA -Language=Bulgarian -ERROR_INVALID_MEDIA - The media identifier does not represent a valid medium. -. - -MessageId=4301 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LIBRARY -Language=Bulgarian -ERROR_INVALID_LIBRARY - The library identifier does not represent a valid library. -. - -MessageId=4302 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MEDIA_POOL -Language=Bulgarian -ERROR_INVALID_MEDIA_POOL - The media pool identifier does not represent a valid media pool. -. - -MessageId=4303 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVE_MEDIA_MISMATCH -Language=Bulgarian -ERROR_DRIVE_MEDIA_MISMATCH - The drive and medium are not compatible or exist in different libraries. -. - -MessageId=4304 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_OFFLINE -Language=Bulgarian -ERROR_MEDIA_OFFLINE - The medium currently exists in an offline library and must be online to perform this operation. -. - -MessageId=4305 -Severity=Success -Facility=System -SymbolicName=ERROR_LIBRARY_OFFLINE -Language=Bulgarian -ERROR_LIBRARY_OFFLINE - The operation cannot be performed on an offline library. -. - -MessageId=4306 -Severity=Success -Facility=System -SymbolicName=ERROR_EMPTY -Language=Bulgarian -ERROR_EMPTY - The library, drive, or media pool is empty. -. - -MessageId=4307 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_EMPTY -Language=Bulgarian -ERROR_NOT_EMPTY - The library, drive, or media pool must be empty to perform this operation. -. - -MessageId=4308 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_UNAVAILABLE -Language=Bulgarian -ERROR_MEDIA_UNAVAILABLE - No media is currently available in this media pool or library. -. - -MessageId=4309 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_DISABLED -Language=Bulgarian -ERROR_RESOURCE_DISABLED - A resource required for this operation is disabled. -. - -MessageId=4310 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_CLEANER -Language=Bulgarian -ERROR_INVALID_CLEANER - The media identifier does not represent a valid cleaner. -. - -MessageId=4311 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_CLEAN -Language=Bulgarian -ERROR_UNABLE_TO_CLEAN - The drive cannot be cleaned or does not support cleaning. -. - -MessageId=4312 -Severity=Success -Facility=System -SymbolicName=ERROR_OBJECT_NOT_FOUND -Language=Bulgarian -ERROR_OBJECT_NOT_FOUND - The object identifier does not represent a valid object. -. - -MessageId=4313 -Severity=Success -Facility=System -SymbolicName=ERROR_DATABASE_FAILURE -Language=Bulgarian -ERROR_DATABASE_FAILURE - Unable to read from or write to the database. -. - -MessageId=4314 -Severity=Success -Facility=System -SymbolicName=ERROR_DATABASE_FULL -Language=Bulgarian -ERROR_DATABASE_FULL - The database is full. -. - -MessageId=4315 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_INCOMPATIBLE -Language=Bulgarian -ERROR_MEDIA_INCOMPATIBLE - The medium is not compatible with the device or media pool. -. - -MessageId=4316 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_NOT_PRESENT -Language=Bulgarian -ERROR_RESOURCE_NOT_PRESENT - The resource required for this operation does not exist. -. - -MessageId=4317 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_OPERATION -Language=Bulgarian -ERROR_INVALID_OPERATION - The operation identifier is not valid. -. - -MessageId=4318 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIA_NOT_AVAILABLE -Language=Bulgarian -ERROR_MEDIA_NOT_AVAILABLE - The media is not mounted or ready for use. -. - -MessageId=4319 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_NOT_AVAILABLE -Language=Bulgarian -ERROR_DEVICE_NOT_AVAILABLE - The device is not ready for use. -. - -MessageId=4320 -Severity=Success -Facility=System -SymbolicName=ERROR_REQUEST_REFUSED -Language=Bulgarian -ERROR_REQUEST_REFUSED - The operator or administrator has refused the request. -. - -MessageId=4321 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DRIVE_OBJECT -Language=Bulgarian -ERROR_INVALID_DRIVE_OBJECT - The drive identifier does not represent a valid drive. -. - -MessageId=4322 -Severity=Success -Facility=System -SymbolicName=ERROR_LIBRARY_FULL -Language=Bulgarian -ERROR_LIBRARY_FULL - Library is full. No slot is available for use. -. - -MessageId=4323 -Severity=Success -Facility=System -SymbolicName=ERROR_MEDIUM_NOT_ACCESSIBLE -Language=Bulgarian -ERROR_MEDIUM_NOT_ACCESSIBLE - The transport cannot access the medium. -. - -MessageId=4324 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_LOAD_MEDIUM -Language=Bulgarian -ERROR_UNABLE_TO_LOAD_MEDIUM - Unable to load the medium into the drive. -. - -MessageId=4325 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_INVENTORY_DRIVE -Language=Bulgarian -ERROR_UNABLE_TO_INVENTORY_DRIVE - Unable to retrieve status about the drive. -. - -MessageId=4326 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_INVENTORY_SLOT -Language=Bulgarian -ERROR_UNABLE_TO_INVENTORY_SLOT - Unable to retrieve status about the slot. -. - -MessageId=4327 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_INVENTORY_TRANSPORT -Language=Bulgarian -ERROR_UNABLE_TO_INVENTORY_TRANSPORT - Unable to retrieve status about the transport. -. - -MessageId=4328 -Severity=Success -Facility=System -SymbolicName=ERROR_TRANSPORT_FULL -Language=Bulgarian -ERROR_TRANSPORT_FULL - Cannot use the transport because it is already in use. -. - -MessageId=4329 -Severity=Success -Facility=System -SymbolicName=ERROR_CONTROLLING_IEPORT -Language=Bulgarian -ERROR_CONTROLLING_IEPORT - Unable to open or close the inject/eject port. -. - -MessageId=4330 -Severity=Success -Facility=System -SymbolicName=ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA -Language=Bulgarian -ERROR_UNABLE_TO_EJECT_MOUNTED_MEDIA - Unable to eject the media because it is in a drive. -. - -MessageId=4331 -Severity=Success -Facility=System -SymbolicName=ERROR_CLEANER_SLOT_SET -Language=Bulgarian -ERROR_CLEANER_SLOT_SET - A cleaner slot is already reserved. -. - -MessageId=4332 -Severity=Success -Facility=System -SymbolicName=ERROR_CLEANER_SLOT_NOT_SET -Language=Bulgarian -ERROR_CLEANER_SLOT_NOT_SET - A cleaner slot is not reserved. -. - -MessageId=4333 -Severity=Success -Facility=System -SymbolicName=ERROR_CLEANER_CARTRIDGE_SPENT -Language=Bulgarian -ERROR_CLEANER_CARTRIDGE_SPENT - The cleaner cartridge has performed the maximum number of drive cleanings. -. - -MessageId=4334 -Severity=Success -Facility=System -SymbolicName=ERROR_UNEXPECTED_OMID -Language=Bulgarian -ERROR_UNEXPECTED_OMID - Unexpected on-medium identifier. -. - -MessageId=4335 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_DELETE_LAST_ITEM -Language=Bulgarian -ERROR_CANT_DELETE_LAST_ITEM - The last remaining item in this group or resource cannot be deleted. -. - -MessageId=4336 -Severity=Success -Facility=System -SymbolicName=ERROR_MESSAGE_EXCEEDS_MAX_SIZE -Language=Bulgarian -ERROR_MESSAGE_EXCEEDS_MAX_SIZE - The message provided exceeds the maximum size allowed for this parameter. -. - -MessageId=4337 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLUME_CONTAINS_SYS_FILES -Language=Bulgarian -ERROR_VOLUME_CONTAINS_SYS_FILES - The volume contains system or paging files. -. - -MessageId=4338 -Severity=Success -Facility=System -SymbolicName=ERROR_INDIGENOUS_TYPE -Language=Bulgarian -ERROR_INDIGENOUS_TYPE - The media type cannot be removed from this library since at least one drive in the library reports it can support this media type. -. - -MessageId=4339 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SUPPORTING_DRIVES -Language=Bulgarian -ERROR_NO_SUPPORTING_DRIVES - This offline media cannot be mounted on this system since no enabled drives are present which can be used. -. - -MessageId=4340 -Severity=Success -Facility=System -SymbolicName=ERROR_CLEANER_CARTRIDGE_INSTALLED -Language=Bulgarian -ERROR_CLEANER_CARTRIDGE_INSTALLED - A cleaner cartridge is present in the tape library. -. - -MessageId=4350 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_OFFLINE -Language=Bulgarian -ERROR_FILE_OFFLINE - The remote storage service was not able to recall the file. -. - -MessageId=4351 -Severity=Success -Facility=System -SymbolicName=ERROR_REMOTE_STORAGE_NOT_ACTIVE -Language=Bulgarian -ERROR_REMOTE_STORAGE_NOT_ACTIVE - The remote storage service is not operational at this time. -. - -MessageId=4352 -Severity=Success -Facility=System -SymbolicName=ERROR_REMOTE_STORAGE_MEDIA_ERROR -Language=Bulgarian -ERROR_REMOTE_STORAGE_MEDIA_ERROR - The remote storage service encountered a media error. -. - -MessageId=4390 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_A_REPARSE_POINT -Language=Bulgarian -ERROR_NOT_A_REPARSE_POINT - The file or directory is not a reparse point. -. - -MessageId=4391 -Severity=Success -Facility=System -SymbolicName=ERROR_REPARSE_ATTRIBUTE_CONFLICT -Language=Bulgarian -ERROR_REPARSE_ATTRIBUTE_CONFLICT - The reparse point attribute cannot be set because it conflicts with an existing attribute. -. - -MessageId=4392 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_REPARSE_DATA -Language=Bulgarian -ERROR_INVALID_REPARSE_DATA - The data present in the reparse point buffer is invalid. -. - -MessageId=4393 -Severity=Success -Facility=System -SymbolicName=ERROR_REPARSE_TAG_INVALID -Language=Bulgarian -ERROR_REPARSE_TAG_INVALID - The tag present in the reparse point buffer is invalid. -. - -MessageId=4394 -Severity=Success -Facility=System -SymbolicName=ERROR_REPARSE_TAG_MISMATCH -Language=Bulgarian -ERROR_REPARSE_TAG_MISMATCH - There is a mismatch between the tag specified in the request and the tag present in the reparse point. -. - -MessageId=4500 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLUME_NOT_SIS_ENABLED -Language=Bulgarian -ERROR_VOLUME_NOT_SIS_ENABLED - Single Instance Storage is not available on this volume. -. - -MessageId=5001 -Severity=Success -Facility=System -SymbolicName=ERROR_DEPENDENT_RESOURCE_EXISTS -Language=Bulgarian -ERROR_DEPENDENT_RESOURCE_EXISTS - The cluster resource cannot be moved to another group because other resources are dependent on it. -. - -MessageId=5002 -Severity=Success -Facility=System -SymbolicName=ERROR_DEPENDENCY_NOT_FOUND -Language=Bulgarian -ERROR_DEPENDENCY_NOT_FOUND - The cluster resource dependency cannot be found. -. - -MessageId=5003 -Severity=Success -Facility=System -SymbolicName=ERROR_DEPENDENCY_ALREADY_EXISTS -Language=Bulgarian -ERROR_DEPENDENCY_ALREADY_EXISTS - The cluster resource cannot be made dependent on the specified resource because it is already dependent. -. - -MessageId=5004 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_NOT_ONLINE -Language=Bulgarian -ERROR_RESOURCE_NOT_ONLINE - The cluster resource is not online. -. - -MessageId=5005 -Severity=Success -Facility=System -SymbolicName=ERROR_HOST_NODE_NOT_AVAILABLE -Language=Bulgarian -ERROR_HOST_NODE_NOT_AVAILABLE - A cluster node is not available for this operation. -. - -MessageId=5006 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_NOT_AVAILABLE -Language=Bulgarian -ERROR_RESOURCE_NOT_AVAILABLE - The cluster resource is not available. -. - -MessageId=5007 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_NOT_FOUND -Language=Bulgarian -ERROR_RESOURCE_NOT_FOUND - The cluster resource could not be found. -. - -MessageId=5008 -Severity=Success -Facility=System -SymbolicName=ERROR_SHUTDOWN_CLUSTER -Language=Bulgarian -ERROR_SHUTDOWN_CLUSTER - The cluster is being shut down. -. - -MessageId=5009 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_EVICT_ACTIVE_NODE -Language=Bulgarian -ERROR_CANT_EVICT_ACTIVE_NODE - A cluster node cannot be evicted from the cluster unless the node is down. -. - -MessageId=5010 -Severity=Success -Facility=System -SymbolicName=ERROR_OBJECT_ALREADY_EXISTS -Language=Bulgarian -ERROR_OBJECT_ALREADY_EXISTS - The object already exists. -. - -MessageId=5011 -Severity=Success -Facility=System -SymbolicName=ERROR_OBJECT_IN_LIST -Language=Bulgarian -ERROR_OBJECT_IN_LIST - The object is already in the list. -. - -MessageId=5012 -Severity=Success -Facility=System -SymbolicName=ERROR_GROUP_NOT_AVAILABLE -Language=Bulgarian -ERROR_GROUP_NOT_AVAILABLE - The cluster group is not available for any new requests. -. - -MessageId=5013 -Severity=Success -Facility=System -SymbolicName=ERROR_GROUP_NOT_FOUND -Language=Bulgarian -ERROR_GROUP_NOT_FOUND - The cluster group could not be found. -. - -MessageId=5014 -Severity=Success -Facility=System -SymbolicName=ERROR_GROUP_NOT_ONLINE -Language=Bulgarian -ERROR_GROUP_NOT_ONLINE - The operation could not be completed because the cluster group is not online. -. - -MessageId=5015 -Severity=Success -Facility=System -SymbolicName=ERROR_HOST_NODE_NOT_RESOURCE_OWNER -Language=Bulgarian -ERROR_HOST_NODE_NOT_RESOURCE_OWNER - The cluster node is not the owner of the resource. -. - -MessageId=5016 -Severity=Success -Facility=System -SymbolicName=ERROR_HOST_NODE_NOT_GROUP_OWNER -Language=Bulgarian -ERROR_HOST_NODE_NOT_GROUP_OWNER - The cluster node is not the owner of the group. -. - -MessageId=5017 -Severity=Success -Facility=System -SymbolicName=ERROR_RESMON_CREATE_FAILED -Language=Bulgarian -ERROR_RESMON_CREATE_FAILED - The cluster resource could not be created in the specified resource monitor. -. - -MessageId=5018 -Severity=Success -Facility=System -SymbolicName=ERROR_RESMON_ONLINE_FAILED -Language=Bulgarian -ERROR_RESMON_ONLINE_FAILED - The cluster resource could not be brought online by the resource monitor. -. - -MessageId=5019 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_ONLINE -Language=Bulgarian -ERROR_RESOURCE_ONLINE - The operation could not be completed because the cluster resource is online. -. - -MessageId=5020 -Severity=Success -Facility=System -SymbolicName=ERROR_QUORUM_RESOURCE -Language=Bulgarian -ERROR_QUORUM_RESOURCE - The cluster resource could not be deleted or brought offline because it is the quorum resource. -. - -MessageId=5021 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_QUORUM_CAPABLE -Language=Bulgarian -ERROR_NOT_QUORUM_CAPABLE - The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource. -. - -MessageId=5022 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_SHUTTING_DOWN -Language=Bulgarian -ERROR_CLUSTER_SHUTTING_DOWN - The cluster software is shutting down. -. - -MessageId=5023 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_STATE -Language=Bulgarian -ERROR_INVALID_STATE - The group or resource is not in the correct state to perform the requested operation. -. - -MessageId=5024 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_PROPERTIES_STORED -Language=Bulgarian -ERROR_RESOURCE_PROPERTIES_STORED - The properties were stored but not all changes will take effect until the next time the resource is brought online. -. - -MessageId=5025 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_QUORUM_CLASS -Language=Bulgarian -ERROR_NOT_QUORUM_CLASS - The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class. -. - -MessageId=5026 -Severity=Success -Facility=System -SymbolicName=ERROR_CORE_RESOURCE -Language=Bulgarian -ERROR_CORE_RESOURCE - The cluster resource could not be deleted since it is a core resource. -. - -MessageId=5027 -Severity=Success -Facility=System -SymbolicName=ERROR_QUORUM_RESOURCE_ONLINE_FAILED -Language=Bulgarian -ERROR_QUORUM_RESOURCE_ONLINE_FAILED - The quorum resource failed to come online. -. - -MessageId=5028 -Severity=Success -Facility=System -SymbolicName=ERROR_QUORUMLOG_OPEN_FAILED -Language=Bulgarian -ERROR_QUORUMLOG_OPEN_FAILED - The quorum log could not be created or mounted successfully. -. - -MessageId=5029 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTERLOG_CORRUPT -Language=Bulgarian -ERROR_CLUSTERLOG_CORRUPT - The cluster log is corrupt. -. - -MessageId=5030 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE -Language=Bulgarian -ERROR_CLUSTERLOG_RECORD_EXCEEDS_MAXSIZE - The record could not be written to the cluster log since it exceeds the maximum size. -. - -MessageId=5031 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE -Language=Bulgarian -ERROR_CLUSTERLOG_EXCEEDS_MAXSIZE - The cluster log exceeds its maximum size. -. - -MessageId=5032 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTERLOG_CHKPOINT_NOT_FOUND - No checkpoint record was found in the cluster log. -. - -MessageId=5033 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE -Language=Bulgarian -ERROR_CLUSTERLOG_NOT_ENOUGH_SPACE - The minimum required disk space needed for logging is not available. -. - -MessageId=5034 -Severity=Success -Facility=System -SymbolicName=ERROR_QUORUM_OWNER_ALIVE -Language=Bulgarian -ERROR_QUORUM_OWNER_ALIVE - The cluster node failed to take control of the quorum resource because the resource is owned by another active node. -. - -MessageId=5035 -Severity=Success -Facility=System -SymbolicName=ERROR_NETWORK_NOT_AVAILABLE -Language=Bulgarian -ERROR_NETWORK_NOT_AVAILABLE - A cluster network is not available for this operation. -. - -MessageId=5036 -Severity=Success -Facility=System -SymbolicName=ERROR_NODE_NOT_AVAILABLE -Language=Bulgarian -ERROR_NODE_NOT_AVAILABLE - A cluster node is not available for this operation. -. - -MessageId=5037 -Severity=Success -Facility=System -SymbolicName=ERROR_ALL_NODES_NOT_AVAILABLE -Language=Bulgarian -ERROR_ALL_NODES_NOT_AVAILABLE - All cluster nodes must be running to perform this operation. -. - -MessageId=5038 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_FAILED -Language=Bulgarian -ERROR_RESOURCE_FAILED - A cluster resource failed. -. - -MessageId=5039 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INVALID_NODE -Language=Bulgarian -ERROR_CLUSTER_INVALID_NODE - The cluster node is not valid. -. - -MessageId=5040 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_EXISTS -Language=Bulgarian -ERROR_CLUSTER_NODE_EXISTS - The cluster node already exists. -. - -MessageId=5041 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_JOIN_IN_PROGRESS -Language=Bulgarian -ERROR_CLUSTER_JOIN_IN_PROGRESS - A node is in the process of joining the cluster. -. - -MessageId=5042 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_NODE_NOT_FOUND - The cluster node was not found. -. - -MessageId=5043 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_LOCAL_NODE_NOT_FOUND - The cluster local node information was not found. -. - -MessageId=5044 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_EXISTS -Language=Bulgarian -ERROR_CLUSTER_NETWORK_EXISTS - The cluster network already exists. -. - -MessageId=5045 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_NETWORK_NOT_FOUND - The cluster network was not found. -. - -MessageId=5046 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETINTERFACE_EXISTS -Language=Bulgarian -ERROR_CLUSTER_NETINTERFACE_EXISTS - The cluster network interface already exists. -. - -MessageId=5047 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETINTERFACE_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_NETINTERFACE_NOT_FOUND - The cluster network interface was not found. -. - -MessageId=5048 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INVALID_REQUEST -Language=Bulgarian -ERROR_CLUSTER_INVALID_REQUEST - The cluster request is not valid for this object. -. - -MessageId=5049 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INVALID_NETWORK_PROVIDER -Language=Bulgarian -ERROR_CLUSTER_INVALID_NETWORK_PROVIDER - The cluster network provider is not valid. -. - -MessageId=5050 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_DOWN -Language=Bulgarian -ERROR_CLUSTER_NODE_DOWN - The cluster node is down. -. - -MessageId=5051 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_UNREACHABLE -Language=Bulgarian -ERROR_CLUSTER_NODE_UNREACHABLE - The cluster node is not reachable. -. - -MessageId=5052 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_NOT_MEMBER -Language=Bulgarian -ERROR_CLUSTER_NODE_NOT_MEMBER - The cluster node is not a member of the cluster. -. - -MessageId=5053 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS -Language=Bulgarian -ERROR_CLUSTER_JOIN_NOT_IN_PROGRESS - A cluster join operation is not in progress. -. - -MessageId=5054 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INVALID_NETWORK -Language=Bulgarian -ERROR_CLUSTER_INVALID_NETWORK - The cluster network is not valid. -. - -MessageId=5056 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_UP -Language=Bulgarian -ERROR_CLUSTER_NODE_UP - The cluster node is up. -. - -MessageId=5057 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_IPADDR_IN_USE -Language=Bulgarian -ERROR_CLUSTER_IPADDR_IN_USE - The cluster IP address is already in use. -. - -MessageId=5058 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_NOT_PAUSED -Language=Bulgarian -ERROR_CLUSTER_NODE_NOT_PAUSED - The cluster node is not paused. -. - -MessageId=5059 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NO_SECURITY_CONTEXT -Language=Bulgarian -ERROR_CLUSTER_NO_SECURITY_CONTEXT - No cluster security context is available. -. - -MessageId=5060 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_NOT_INTERNAL -Language=Bulgarian -ERROR_CLUSTER_NETWORK_NOT_INTERNAL - The cluster network is not configured for internal cluster communication. -. - -MessageId=5061 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_ALREADY_UP -Language=Bulgarian -ERROR_CLUSTER_NODE_ALREADY_UP - The cluster node is already up. -. - -MessageId=5062 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_ALREADY_DOWN -Language=Bulgarian -ERROR_CLUSTER_NODE_ALREADY_DOWN - The cluster node is already down. -. - -MessageId=5063 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_ALREADY_ONLINE -Language=Bulgarian -ERROR_CLUSTER_NETWORK_ALREADY_ONLINE - The cluster network is already online. -. - -MessageId=5064 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE -Language=Bulgarian -ERROR_CLUSTER_NETWORK_ALREADY_OFFLINE - The cluster network is already offline. -. - -MessageId=5065 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_ALREADY_MEMBER -Language=Bulgarian -ERROR_CLUSTER_NODE_ALREADY_MEMBER - The cluster node is already a member of the cluster. -. - -MessageId=5066 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_LAST_INTERNAL_NETWORK -Language=Bulgarian -ERROR_CLUSTER_LAST_INTERNAL_NETWORK - The cluster network is the only one configured for internal cluster communication between two or more active cluster nodes. The internal communication capability cannot be removed from the network. -. - -MessageId=5067 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS -Language=Bulgarian -ERROR_CLUSTER_NETWORK_HAS_DEPENDENTS - One or more cluster resources depend on the network to provide service to clients. The client access capability cannot be removed from the network. -. - -MessageId=5068 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_OPERATION_ON_QUORUM -Language=Bulgarian -ERROR_INVALID_OPERATION_ON_QUORUM - This operation cannot be performed on the cluster resource as it the quorum resource. You may not bring the quorum resource offline or modify its possible owners list. -. - -MessageId=5069 -Severity=Success -Facility=System -SymbolicName=ERROR_DEPENDENCY_NOT_ALLOWED -Language=Bulgarian -ERROR_DEPENDENCY_NOT_ALLOWED - The cluster quorum resource is not allowed to have any dependencies. -. - -MessageId=5070 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_PAUSED -Language=Bulgarian -ERROR_CLUSTER_NODE_PAUSED - The cluster node is paused. -. - -MessageId=5071 -Severity=Success -Facility=System -SymbolicName=ERROR_NODE_CANT_HOST_RESOURCE -Language=Bulgarian -ERROR_NODE_CANT_HOST_RESOURCE - The cluster resource cannot be brought online. The owner node cannot run this resource. -. - -MessageId=5072 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_NOT_READY -Language=Bulgarian -ERROR_CLUSTER_NODE_NOT_READY - The cluster node is not ready to perform the requested operation. -. - -MessageId=5073 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_SHUTTING_DOWN -Language=Bulgarian -ERROR_CLUSTER_NODE_SHUTTING_DOWN - The cluster node is shutting down. -. - -MessageId=5074 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_JOIN_ABORTED -Language=Bulgarian -ERROR_CLUSTER_JOIN_ABORTED - The cluster join operation was aborted. -. - -MessageId=5075 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INCOMPATIBLE_VERSIONS -Language=Bulgarian -ERROR_CLUSTER_INCOMPATIBLE_VERSIONS - The cluster join operation failed due to incompatible software versions between the joining node and its sponsor. -. - -MessageId=5076 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED -Language=Bulgarian -ERROR_CLUSTER_MAXNUM_OF_RESOURCES_EXCEEDED - This resource cannot be created because the cluster has reached the limit on the number of resources it can monitor. -. - -MessageId=5077 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED -Language=Bulgarian -ERROR_CLUSTER_SYSTEM_CONFIG_CHANGED - The system configuration changed during the cluster join or form operation. The join or form operation was aborted. -. - -MessageId=5078 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_RESOURCE_TYPE_NOT_FOUND - The specified resource type was not found. -. - -MessageId=5079 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED -Language=Bulgarian -ERROR_CLUSTER_RESTYPE_NOT_SUPPORTED - The specified node does not support a resource of this type. This may be due to version inconsistencies or due to the absence of the resource DLL on this node. -. - -MessageId=5080 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_RESNAME_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_RESNAME_NOT_FOUND - The specified resource name is supported by this resource DLL. This may be due to a bad (or changed) name supplied to the resource DLL. -. - -MessageId=5081 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED -Language=Bulgarian -ERROR_CLUSTER_NO_RPC_PACKAGES_REGISTERED - No authentication package could be registered with the RPC server. -. - -MessageId=5082 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST -Language=Bulgarian -ERROR_CLUSTER_OWNER_NOT_IN_PREFLIST - You cannot bring the group online because the owner of the group is not in the preferred list for the group. To change the owner node for the group, move the group. -. - -MessageId=5083 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_DATABASE_SEQMISMATCH -Language=Bulgarian -ERROR_CLUSTER_DATABASE_SEQMISMATCH - The join operation failed because the cluster database sequence number has changed or is incompatible with the locker node. This may happen during a join operation if the cluster database was changing during the join. -. - -MessageId=5084 -Severity=Success -Facility=System -SymbolicName=ERROR_RESMON_INVALID_STATE -Language=Bulgarian -ERROR_RESMON_INVALID_STATE - The resource monitor will not allow the fail operation to be performed while the resource is in its current state. This may happen if the resource is in a pending state. -. - -MessageId=5085 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_GUM_NOT_LOCKER -Language=Bulgarian -ERROR_CLUSTER_GUM_NOT_LOCKER - A non locker code got a request to reserve the lock for making global updates. -. - -MessageId=5086 -Severity=Success -Facility=System -SymbolicName=ERROR_QUORUM_DISK_NOT_FOUND -Language=Bulgarian -ERROR_QUORUM_DISK_NOT_FOUND - The quorum disk could not be located by the cluster service. -. - -MessageId=5087 -Severity=Success -Facility=System -SymbolicName=ERROR_DATABASE_BACKUP_CORRUPT -Language=Bulgarian -ERROR_DATABASE_BACKUP_CORRUPT - The backup up cluster database is possibly corrupt. -. - -MessageId=5088 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT -Language=Bulgarian -ERROR_CLUSTER_NODE_ALREADY_HAS_DFS_ROOT - A DFS root already exists in this cluster node. -. - -MessageId=5089 -Severity=Success -Facility=System -SymbolicName=ERROR_RESOURCE_PROPERTY_UNCHANGEABLE -Language=Bulgarian -ERROR_RESOURCE_PROPERTY_UNCHANGEABLE - An attempt to modify a resource property failed because it conflicts with another existing property. -. - -MessageId=5890 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE -Language=Bulgarian -ERROR_CLUSTER_MEMBERSHIP_INVALID_STATE - An operation was attempted that is incompatible with the current membership state of the node. -. - -MessageId=5891 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_QUORUMLOG_NOT_FOUND -Language=Bulgarian -ERROR_CLUSTER_QUORUMLOG_NOT_FOUND - The quorum resource does not contain the quorum log. -. - -MessageId=5892 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_MEMBERSHIP_HALT -Language=Bulgarian -ERROR_CLUSTER_MEMBERSHIP_HALT - The membership engine requested shutdown of the cluster service on this node. -. - -MessageId=5893 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_INSTANCE_ID_MISMATCH -Language=Bulgarian -ERROR_CLUSTER_INSTANCE_ID_MISMATCH - The join operation failed because the cluster instance ID of the joining node does not match the cluster instance ID of the sponsor node. -. - -MessageId=5894 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP -Language=Bulgarian -ERROR_CLUSTER_NETWORK_NOT_FOUND_FOR_IP - A matching network for the specified IP address could not be found. Please also specify a subnet mask and a cluster network. -. - -MessageId=5895 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH -Language=Bulgarian -ERROR_CLUSTER_PROPERTY_DATA_TYPE_MISMATCH - The actual data type of the property did not match the expected data type of the property. -. - -MessageId=5896 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP -Language=Bulgarian -ERROR_CLUSTER_EVICT_WITHOUT_CLEANUP - The cluster node was evicted from the cluster successfully, but the node was not cleaned up. Extended status information explaining why the node was not cleaned up is available. -. - -MessageId=5897 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_PARAMETER_MISMATCH -Language=Bulgarian -ERROR_CLUSTER_PARAMETER_MISMATCH - Two or more parameter values specified for a resource's properties are in conflict. -. - -MessageId=5898 -Severity=Success -Facility=System -SymbolicName=ERROR_NODE_CANNOT_BE_CLUSTERED -Language=Bulgarian -ERROR_NODE_CANNOT_BE_CLUSTERED - This computer cannot be made a member of a cluster. -. - -MessageId=5899 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_WRONG_OS_VERSION -Language=Bulgarian -ERROR_CLUSTER_WRONG_OS_VERSION - This computer cannot be made a member of a cluster because it does not have the correct version of Windows installed. -. - -MessageId=5900 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME -Language=Bulgarian -ERROR_CLUSTER_CANT_CREATE_DUP_CLUSTER_NAME - A cluster cannot be created with the specified cluster name because that cluster name is already in use. Specify a different name for the cluster. -. - -MessageId=5901 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSCFG_ALREADY_COMMITTED -Language=Bulgarian -ERROR_CLUSCFG_ALREADY_COMMITTED - The cluster configuration action has already been committed. -. - -MessageId=5902 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSCFG_ROLLBACK_FAILED -Language=Bulgarian -ERROR_CLUSCFG_ROLLBACK_FAILED - The cluster configuration action could not be rolled back. -. - -MessageId=5903 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT -Language=Bulgarian -ERROR_CLUSCFG_SYSTEM_DISK_DRIVE_LETTER_CONFLICT - The drive letter assigned to a system disk on one node conflicted with the driver letter assigned to a disk on another node. -. - -MessageId=5904 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_OLD_VERSION -Language=Bulgarian -ERROR_CLUSTER_OLD_VERSION - One or more nodes in the cluster are running a version of Windows that does not support this operation. -. - -MessageId=5905 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME -Language=Bulgarian -ERROR_CLUSTER_MISMATCHED_COMPUTER_ACCT_NAME - The name of the corresponding computer account doesn't match the Network Name for this resource. -. - -MessageId=5906 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_NO_NET_ADAPTERS -Language=Bulgarian -ERROR_CLUSTER_NO_NET_ADAPTERS - No network adapters are available. -. - -MessageId=5907 -Severity=Success -Facility=System -SymbolicName=ERROR_CLUSTER_POISONED -Language=Bulgarian -ERROR_CLUSTER_POISONED - The cluster node has been poisoned. -. - -MessageId=6000 -Severity=Success -Facility=System -SymbolicName=ERROR_ENCRYPTION_FAILED -Language=Bulgarian -ERROR_ENCRYPTION_FAILED - The specified file could not be encrypted. -. - -MessageId=6001 -Severity=Success -Facility=System -SymbolicName=ERROR_DECRYPTION_FAILED -Language=Bulgarian -ERROR_DECRYPTION_FAILED - The specified file could not be decrypted. -. - -MessageId=6002 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_ENCRYPTED -Language=Bulgarian -ERROR_FILE_ENCRYPTED - The specified file is encrypted and the user does not have the ability to decrypt it. -. - -MessageId=6003 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_RECOVERY_POLICY -Language=Bulgarian -ERROR_NO_RECOVERY_POLICY - There is no valid encryption recovery policy configured for this system. -. - -MessageId=6004 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_EFS -Language=Bulgarian -ERROR_NO_EFS - The required encryption driver is not loaded for this system. -. - -MessageId=6005 -Severity=Success -Facility=System -SymbolicName=ERROR_WRONG_EFS -Language=Bulgarian -ERROR_WRONG_EFS - The file was encrypted with a different encryption driver than is currently loaded. -. - -MessageId=6006 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_USER_KEYS -Language=Bulgarian -ERROR_NO_USER_KEYS - There are no EFS keys defined for the user. -. - -MessageId=6007 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_NOT_ENCRYPTED -Language=Bulgarian -ERROR_FILE_NOT_ENCRYPTED - The specified file is not encrypted. -. - -MessageId=6008 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_EXPORT_FORMAT -Language=Bulgarian -ERROR_NOT_EXPORT_FORMAT - The specified file is not in the defined EFS export format. -. - -MessageId=6009 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_READ_ONLY -Language=Bulgarian -ERROR_FILE_READ_ONLY - The specified file is read only. -. - -MessageId=6010 -Severity=Success -Facility=System -SymbolicName=ERROR_DIR_EFS_DISALLOWED -Language=Bulgarian -ERROR_DIR_EFS_DISALLOWED - The directory has been disabled for encryption. -. - -MessageId=6011 -Severity=Success -Facility=System -SymbolicName=ERROR_EFS_SERVER_NOT_TRUSTED -Language=Bulgarian -ERROR_EFS_SERVER_NOT_TRUSTED - The server is not trusted for remote encryption operation. -. - -MessageId=6012 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_RECOVERY_POLICY -Language=Bulgarian -ERROR_BAD_RECOVERY_POLICY - Recovery policy configured for this system contains invalid recovery certificate. -. - -MessageId=6013 -Severity=Success -Facility=System -SymbolicName=ERROR_EFS_ALG_BLOB_TOO_BIG -Language=Bulgarian -ERROR_EFS_ALG_BLOB_TOO_BIG - The encryption algorithm used on the source file needs a bigger key buffer than the one on the destination file. -. - -MessageId=6014 -Severity=Success -Facility=System -SymbolicName=ERROR_VOLUME_NOT_SUPPORT_EFS -Language=Bulgarian -ERROR_VOLUME_NOT_SUPPORT_EFS - The disk partition does not support file encryption. -. - -MessageId=6015 -Severity=Success -Facility=System -SymbolicName=ERROR_EFS_DISABLED -Language=Bulgarian -ERROR_EFS_DISABLED - This machine is disabled for file encryption. -. - -MessageId=6016 -Severity=Success -Facility=System -SymbolicName=ERROR_EFS_VERSION_NOT_SUPPORT -Language=Bulgarian -ERROR_EFS_VERSION_NOT_SUPPORT - A newer system is required to decrypt this encrypted file. -. - -MessageId=6118 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_BROWSER_SERVERS_FOUND -Language=Bulgarian -ERROR_NO_BROWSER_SERVERS_FOUND - The list of servers for this workgroup is not currently available. -. - -MessageId=6200 -Severity=Success -Facility=System -SymbolicName=SCHED_E_SERVICE_NOT_LOCALSYSTEM -Language=Bulgarian -SCHED_E_SERVICE_NOT_LOCALSYSTEM - The Task Scheduler service must be configured to run in the System account to function properly. Individual tasks may be configured to run in other accounts. -. - -MessageId=7001 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATION_NAME_INVALID -Language=Bulgarian -ERROR_CTX_WINSTATION_NAME_INVALID - The specified session name is invalid. -. - -MessageId=7002 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_INVALID_PD -Language=Bulgarian -ERROR_CTX_INVALID_PD - The specified protocol driver is invalid. -. - -MessageId=7003 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_PD_NOT_FOUND -Language=Bulgarian -ERROR_CTX_PD_NOT_FOUND - The specified protocol driver was not found in the system path. -. - -MessageId=7004 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WD_NOT_FOUND -Language=Bulgarian -ERROR_CTX_WD_NOT_FOUND - The specified terminal connection driver was not found in the system path. -. - -MessageId=7005 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY -Language=Bulgarian -ERROR_CTX_CANNOT_MAKE_EVENTLOG_ENTRY - A registry key for event logging could not be created for this session. -. - -MessageId=7006 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SERVICE_NAME_COLLISION -Language=Bulgarian -ERROR_CTX_SERVICE_NAME_COLLISION - A service with the same name already exists on the system. -. - -MessageId=7007 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CLOSE_PENDING -Language=Bulgarian -ERROR_CTX_CLOSE_PENDING - A close operation is pending on the session. -. - -MessageId=7008 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_NO_OUTBUF -Language=Bulgarian -ERROR_CTX_NO_OUTBUF - There are no free output buffers available. -. - -MessageId=7009 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_INF_NOT_FOUND -Language=Bulgarian -ERROR_CTX_MODEM_INF_NOT_FOUND - The MODEM.INF file was not found. -. - -MessageId=7010 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_INVALID_MODEMNAME -Language=Bulgarian -ERROR_CTX_INVALID_MODEMNAME - The modem name was not found in MODEM.INF. -. - -MessageId=7011 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_ERROR -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_ERROR - The modem did not accept the command sent to it. Verify that the configured modem name matches the attached modem. -. - -MessageId=7012 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_TIMEOUT -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_TIMEOUT - The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on. -. - -MessageId=7013 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_NO_CARRIER -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_NO_CARRIER - Carrier detect has failed or carrier has been dropped due to disconnect. -. - -MessageId=7014 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_NO_DIALTONE - Dial tone not detected within the required time. Verify that the phone cable is properly attached and functional. -. - -MessageId=7015 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_BUSY -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_BUSY - Busy signal detected at remote site on callback. -. - -MessageId=7016 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_MODEM_RESPONSE_VOICE -Language=Bulgarian -ERROR_CTX_MODEM_RESPONSE_VOICE - Voice detected at remote site on callback. -. - -MessageId=7017 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_TD_ERROR -Language=Bulgarian -ERROR_CTX_TD_ERROR - Transport driver error -. - -MessageId=7022 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATION_NOT_FOUND -Language=Bulgarian -ERROR_CTX_WINSTATION_NOT_FOUND - The specified session cannot be found. -. - -MessageId=7023 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATION_ALREADY_EXISTS -Language=Bulgarian -ERROR_CTX_WINSTATION_ALREADY_EXISTS - The specified session name is already in use. -. - -MessageId=7024 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATION_BUSY -Language=Bulgarian -ERROR_CTX_WINSTATION_BUSY - The requested operation cannot be completed because the terminal connection is currently busy processing a connect, disconnect, reset, or delete operation. -. - -MessageId=7025 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_BAD_VIDEO_MODE -Language=Bulgarian -ERROR_CTX_BAD_VIDEO_MODE - An attempt has been made to connect to a session whose video mode is not supported by the current client. -. - -MessageId=7035 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_GRAPHICS_INVALID -Language=Bulgarian -ERROR_CTX_GRAPHICS_INVALID - The application attempted to enable DOS graphics mode. DOS graphics mode is not supported. -. - -MessageId=7037 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_LOGON_DISABLED -Language=Bulgarian -ERROR_CTX_LOGON_DISABLED - Your interactive logon privilege has been disabled. Please contact your administrator. -. - -MessageId=7038 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_NOT_CONSOLE -Language=Bulgarian -ERROR_CTX_NOT_CONSOLE - The requested operation can be performed only on the system console. This is most often the result of a driver or system DLL requiring direct console access. -. - -MessageId=7040 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CLIENT_QUERY_TIMEOUT -Language=Bulgarian -ERROR_CTX_CLIENT_QUERY_TIMEOUT - The client failed to respond to the server connect message. -. - -MessageId=7041 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CONSOLE_DISCONNECT -Language=Bulgarian -ERROR_CTX_CONSOLE_DISCONNECT - Disconnecting the console session is not supported. -. - -MessageId=7042 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CONSOLE_CONNECT -Language=Bulgarian -ERROR_CTX_CONSOLE_CONNECT - Reconnecting a disconnected session to the console is not supported. -. - -MessageId=7044 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SHADOW_DENIED -Language=Bulgarian -ERROR_CTX_SHADOW_DENIED - The request to control another session remotely was denied. -. - -MessageId=7045 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATION_ACCESS_DENIED -Language=Bulgarian -ERROR_CTX_WINSTATION_ACCESS_DENIED - The requested session access is denied. -. - -MessageId=7049 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_INVALID_WD -Language=Bulgarian -ERROR_CTX_INVALID_WD - The specified terminal connection driver is invalid. -. - -MessageId=7050 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SHADOW_INVALID -Language=Bulgarian -ERROR_CTX_SHADOW_INVALID - The requested session cannot be controlled remotely. This may be because the session is disconnected or does not currently have a user logged on. -. - -MessageId=7051 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SHADOW_DISABLED -Language=Bulgarian -ERROR_CTX_SHADOW_DISABLED - The requested session is not configured to allow remote control. -. - -MessageId=7052 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CLIENT_LICENSE_IN_USE -Language=Bulgarian -ERROR_CTX_CLIENT_LICENSE_IN_USE - Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number is currently being used by another user. Please call your system administrator to obtain a unique license number. -. - -MessageId=7053 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CLIENT_LICENSE_NOT_SET -Language=Bulgarian -ERROR_CTX_CLIENT_LICENSE_NOT_SET - Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number has not been entered for this copy of the Terminal Server client. Please contact your system administrator. -. - -MessageId=7054 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_LICENSE_NOT_AVAILABLE -Language=Bulgarian -ERROR_CTX_LICENSE_NOT_AVAILABLE - The system has reached its licensed logon limit. Please try again later. -. - -MessageId=7055 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_LICENSE_CLIENT_INVALID -Language=Bulgarian -ERROR_CTX_LICENSE_CLIENT_INVALID - The client you are using is not licensed to use this system. Your logon request is denied. -. - -MessageId=7056 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_LICENSE_EXPIRED -Language=Bulgarian -ERROR_CTX_LICENSE_EXPIRED - The system license has expired. Your logon request is denied. -. - -MessageId=7057 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SHADOW_NOT_RUNNING -Language=Bulgarian -ERROR_CTX_SHADOW_NOT_RUNNING - Remote control could not be terminated because the specified session is not currently being remotely controlled. -. - -MessageId=7058 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE -Language=Bulgarian -ERROR_CTX_SHADOW_ENDED_BY_MODE_CHANGE - The remote control of the console was terminated because the display mode was changed. Changing the display mode in a remote control session is not supported. -. - -MessageId=7059 -Severity=Success -Facility=System -SymbolicName=ERROR_ACTIVATION_COUNT_EXCEEDED -Language=Bulgarian -ERROR_ACTIVATION_COUNT_EXCEEDED - Activation has already been reset the maximum number of times for this installation. Your activation timer will not be cleared. -. - -MessageId=7060 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_WINSTATIONS_DISABLED -Language=Bulgarian -ERROR_CTX_WINSTATIONS_DISABLED - Remote logins are currently disabled. -. - -MessageId=7061 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED -Language=Bulgarian -ERROR_CTX_ENCRYPTION_LEVEL_REQUIRED - You do not have the proper encryption level to access this Session. -. - -MessageId=7062 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_SESSION_IN_USE -Language=Bulgarian -ERROR_CTX_SESSION_IN_USE - The user %s\\%s is currently logged on to this computer. Only the current user or an administrator can log on to this computer. -. - -MessageId=7063 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_NO_FORCE_LOGOFF -Language=Bulgarian -ERROR_CTX_NO_FORCE_LOGOFF - The user %s\\%s is already logged on to the console of this computer. You do not have permission to log in at this time. To resolve this issue, contact %s\\%s and have them log off. -. - -MessageId=7064 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_ACCOUNT_RESTRICTION -Language=Bulgarian -ERROR_CTX_ACCOUNT_RESTRICTION - Unable to log you on because of an account restriction. -. - -MessageId=7065 -Severity=Success -Facility=System -SymbolicName=ERROR_RDP_PROTOCOL_ERROR -Language=Bulgarian -ERROR_RDP_PROTOCOL_ERROR - The RDP protocol component %2 detected an error in the protocol stream and has disconnected the client. -. - -MessageId=7066 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CDM_CONNECT -Language=Bulgarian -ERROR_CTX_CDM_CONNECT - The Client Drive Mapping Service Has Connected on Terminal Connection. -. - -MessageId=7067 -Severity=Success -Facility=System -SymbolicName=ERROR_CTX_CDM_DISCONNECT -Language=Bulgarian -ERROR_CTX_CDM_DISCONNECT - The Client Drive Mapping Service Has Disconnected on Terminal Connection. -. - -MessageId=8001 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_INVALID_API_SEQUENCE -Language=Bulgarian -FRS_ERR_INVALID_API_SEQUENCE - The file replication service API was called incorrectly. -. - -MessageId=8002 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_STARTING_SERVICE -Language=Bulgarian -FRS_ERR_STARTING_SERVICE - The file replication service cannot be started. -. - -MessageId=8003 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_STOPPING_SERVICE -Language=Bulgarian -FRS_ERR_STOPPING_SERVICE - The file replication service cannot be stopped. -. - -MessageId=8004 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_INTERNAL_API -Language=Bulgarian -FRS_ERR_INTERNAL_API - The file replication service API terminated the request. The event log may have more information. -. - -MessageId=8005 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_INTERNAL -Language=Bulgarian -FRS_ERR_INTERNAL - The file replication service terminated the request. The event log may have more information. -. - -MessageId=8006 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_SERVICE_COMM -Language=Bulgarian -FRS_ERR_SERVICE_COMM - The file replication service cannot be contacted. The event log may have more information. -. - -MessageId=8007 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_INSUFFICIENT_PRIV -Language=Bulgarian -FRS_ERR_INSUFFICIENT_PRIV - The file replication service cannot satisfy the request because the user has insufficient privileges. The event log may have more information. -. - -MessageId=8008 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_AUTHENTICATION -Language=Bulgarian -FRS_ERR_AUTHENTICATION - The file replication service cannot satisfy the request because authenticated RPC is not available. The event log may have more information. -. - -MessageId=8009 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_PARENT_INSUFFICIENT_PRIV -Language=Bulgarian -FRS_ERR_PARENT_INSUFFICIENT_PRIV - The file replication service cannot satisfy the request because the user has insufficient privileges on the domain controller. The event log may have more information. -. - -MessageId=8010 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_PARENT_AUTHENTICATION -Language=Bulgarian -FRS_ERR_PARENT_AUTHENTICATION - The file replication service cannot satisfy the request because authenticated RPC is not available on the domain controller. The event log may have more information. -. - -MessageId=8011 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_CHILD_TO_PARENT_COMM -Language=Bulgarian -FRS_ERR_CHILD_TO_PARENT_COMM - The file replication service cannot communicate with the file replication service on the domain controller. The event log may have more information. -. - -MessageId=8012 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_PARENT_TO_CHILD_COMM -Language=Bulgarian -FRS_ERR_PARENT_TO_CHILD_COMM - The file replication service on the domain controller cannot communicate with the file replication service on this computer. The event log may have more information. -. - -MessageId=8013 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_SYSVOL_POPULATE -Language=Bulgarian -FRS_ERR_SYSVOL_POPULATE - The file replication service cannot populate the system volume because of an internal error. The event log may have more information. -. - -MessageId=8014 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_SYSVOL_POPULATE_TIMEOUT -Language=Bulgarian -FRS_ERR_SYSVOL_POPULATE_TIMEOUT - The file replication service cannot populate the system volume because of an internal timeout. The event log may have more information. -. - -MessageId=8015 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_SYSVOL_IS_BUSY -Language=Bulgarian -FRS_ERR_SYSVOL_IS_BUSY - The file replication service cannot process the request. The system volume is busy with a previous request. -. - -MessageId=8016 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_SYSVOL_DEMOTE -Language=Bulgarian -FRS_ERR_SYSVOL_DEMOTE - The file replication service cannot stop replicating the system volume because of an internal error. The event log may have more information. -. - -MessageId=8017 -Severity=Success -Facility=System -SymbolicName=FRS_ERR_INVALID_SERVICE_PARAMETER -Language=Bulgarian -FRS_ERR_INVALID_SERVICE_PARAMETER - The file replication service detected an invalid parameter. -. - -MessageId=8200 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_INSTALLED -Language=Bulgarian -ERROR_DS_NOT_INSTALLED - An error occurred while installing the directory service. For more information, see the event log. -. - -MessageId=8201 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY -Language=Bulgarian -ERROR_DS_MEMBERSHIP_EVALUATED_LOCALLY - The directory service evaluated group memberships locally. -. - -MessageId=8202 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_ATTRIBUTE_OR_VALUE -Language=Bulgarian -ERROR_DS_NO_ATTRIBUTE_OR_VALUE - The specified directory service attribute or value does not exist. -. - -MessageId=8203 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_ATTRIBUTE_SYNTAX -Language=Bulgarian -ERROR_DS_INVALID_ATTRIBUTE_SYNTAX - The attribute syntax specified to the directory service is invalid. -. - -MessageId=8204 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED -Language=Bulgarian -ERROR_DS_ATTRIBUTE_TYPE_UNDEFINED - The attribute type specified to the directory service is not defined. -. - -MessageId=8205 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS -Language=Bulgarian -ERROR_DS_ATTRIBUTE_OR_VALUE_EXISTS - The specified directory service attribute or value already exists. -. - -MessageId=8206 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BUSY -Language=Bulgarian -ERROR_DS_BUSY - The directory service is busy. -. - -MessageId=8207 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNAVAILABLE -Language=Bulgarian -ERROR_DS_UNAVAILABLE - The directory service is unavailable. -. - -MessageId=8208 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_RIDS_ALLOCATED -Language=Bulgarian -ERROR_DS_NO_RIDS_ALLOCATED - The directory service was unable to allocate a relative identifier. -. - -MessageId=8209 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_MORE_RIDS -Language=Bulgarian -ERROR_DS_NO_MORE_RIDS - The directory service has exhausted the pool of relative identifiers. -. - -MessageId=8210 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INCORRECT_ROLE_OWNER -Language=Bulgarian -ERROR_DS_INCORRECT_ROLE_OWNER - The requested operation could not be performed because the directory service is not the master for that type of operation. -. - -MessageId=8211 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_RIDMGR_INIT_ERROR -Language=Bulgarian -ERROR_DS_RIDMGR_INIT_ERROR - The directory service was unable to initialize the subsystem that allocates relative identifiers. -. - -MessageId=8212 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_CLASS_VIOLATION -Language=Bulgarian -ERROR_DS_OBJ_CLASS_VIOLATION - The requested operation did not satisfy one or more constraints associated with the class of the object. -. - -MessageId=8213 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ON_NON_LEAF -Language=Bulgarian -ERROR_DS_CANT_ON_NON_LEAF - The directory service can perform the requested operation only on a leaf object. -. - -MessageId=8214 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ON_RDN -Language=Bulgarian -ERROR_DS_CANT_ON_RDN - The directory service cannot perform the requested operation on the RDN attribute of an object. -. - -MessageId=8215 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOD_OBJ_CLASS -Language=Bulgarian -ERROR_DS_CANT_MOD_OBJ_CLASS - The directory service detected an attempt to modify the object class of an object. -. - -MessageId=8216 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CROSS_DOM_MOVE_ERROR -Language=Bulgarian -ERROR_DS_CROSS_DOM_MOVE_ERROR - The requested cross-domain move operation could not be performed. -. - -MessageId=8217 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GC_NOT_AVAILABLE -Language=Bulgarian -ERROR_DS_GC_NOT_AVAILABLE - Unable to contact the global catalog server. -. - -MessageId=8218 -Severity=Success -Facility=System -SymbolicName=ERROR_SHARED_POLICY -Language=Bulgarian -ERROR_SHARED_POLICY - The policy object is shared and can only be modified at the root. -. - -MessageId=8219 -Severity=Success -Facility=System -SymbolicName=ERROR_POLICY_OBJECT_NOT_FOUND -Language=Bulgarian -ERROR_POLICY_OBJECT_NOT_FOUND - The policy object does not exist. -. - -MessageId=8220 -Severity=Success -Facility=System -SymbolicName=ERROR_POLICY_ONLY_IN_DS -Language=Bulgarian -ERROR_POLICY_ONLY_IN_DS - The requested policy information is only in the directory service. -. - -MessageId=8221 -Severity=Success -Facility=System -SymbolicName=ERROR_PROMOTION_ACTIVE -Language=Bulgarian -ERROR_PROMOTION_ACTIVE - A domain controller promotion is currently active. -. - -MessageId=8222 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_PROMOTION_ACTIVE -Language=Bulgarian -ERROR_NO_PROMOTION_ACTIVE - A domain controller promotion is not currently active -. - -MessageId=8224 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OPERATIONS_ERROR -Language=Bulgarian -ERROR_DS_OPERATIONS_ERROR - An operations error occurred. -. - -MessageId=8225 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_PROTOCOL_ERROR -Language=Bulgarian -ERROR_DS_PROTOCOL_ERROR - A protocol error occurred. -. - -MessageId=8226 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_TIMELIMIT_EXCEEDED -Language=Bulgarian -ERROR_DS_TIMELIMIT_EXCEEDED - The time limit for this request was exceeded. -. - -MessageId=8227 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SIZELIMIT_EXCEEDED -Language=Bulgarian -ERROR_DS_SIZELIMIT_EXCEEDED - The size limit for this request was exceeded. -. - -MessageId=8228 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ADMIN_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_DS_ADMIN_LIMIT_EXCEEDED - The administrative limit for this request was exceeded. -. - -MessageId=8229 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COMPARE_FALSE -Language=Bulgarian -ERROR_DS_COMPARE_FALSE - The compare response was false. -. - -MessageId=8230 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COMPARE_TRUE -Language=Bulgarian -ERROR_DS_COMPARE_TRUE - The compare response was true. -. - -MessageId=8231 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AUTH_METHOD_NOT_SUPPORTED -Language=Bulgarian -ERROR_DS_AUTH_METHOD_NOT_SUPPORTED - The requested authentication method is not supported by the server. -. - -MessageId=8232 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_STRONG_AUTH_REQUIRED -Language=Bulgarian -ERROR_DS_STRONG_AUTH_REQUIRED - A more secure authentication method is required for this server. -. - -MessageId=8233 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INAPPROPRIATE_AUTH -Language=Bulgarian -ERROR_DS_INAPPROPRIATE_AUTH - Inappropriate authentication. -. - -MessageId=8234 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AUTH_UNKNOWN -Language=Bulgarian -ERROR_DS_AUTH_UNKNOWN - The authentication mechanism is unknown. -. - -MessageId=8235 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REFERRAL -Language=Bulgarian -ERROR_DS_REFERRAL - A referral was returned from the server. -. - -MessageId=8236 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNAVAILABLE_CRIT_EXTENSION -Language=Bulgarian -ERROR_DS_UNAVAILABLE_CRIT_EXTENSION - The server does not support the requested critical extension. -. - -MessageId=8237 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CONFIDENTIALITY_REQUIRED -Language=Bulgarian -ERROR_DS_CONFIDENTIALITY_REQUIRED - This request requires a secure connection. -. - -MessageId=8238 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INAPPROPRIATE_MATCHING -Language=Bulgarian -ERROR_DS_INAPPROPRIATE_MATCHING - Inappropriate matching. -. - -MessageId=8239 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CONSTRAINT_VIOLATION -Language=Bulgarian -ERROR_DS_CONSTRAINT_VIOLATION - A constraint violation occurred. -. - -MessageId=8240 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_SUCH_OBJECT -Language=Bulgarian -ERROR_DS_NO_SUCH_OBJECT - There is no such object on the server. -. - -MessageId=8241 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ALIAS_PROBLEM -Language=Bulgarian -ERROR_DS_ALIAS_PROBLEM - There is an alias problem. -. - -MessageId=8242 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_DN_SYNTAX -Language=Bulgarian -ERROR_DS_INVALID_DN_SYNTAX - An invalid dn syntax has been specified. -. - -MessageId=8243 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_IS_LEAF -Language=Bulgarian -ERROR_DS_IS_LEAF - The object is a leaf object. -. - -MessageId=8244 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ALIAS_DEREF_PROBLEM -Language=Bulgarian -ERROR_DS_ALIAS_DEREF_PROBLEM - There is an alias dereferencing problem. -. - -MessageId=8245 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNWILLING_TO_PERFORM -Language=Bulgarian -ERROR_DS_UNWILLING_TO_PERFORM - The server is unwilling to process the request. -. - -MessageId=8246 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOOP_DETECT -Language=Bulgarian -ERROR_DS_LOOP_DETECT - A loop has been detected. -. - -MessageId=8247 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAMING_VIOLATION -Language=Bulgarian -ERROR_DS_NAMING_VIOLATION - There is a naming violation. -. - -MessageId=8248 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJECT_RESULTS_TOO_LARGE -Language=Bulgarian -ERROR_DS_OBJECT_RESULTS_TOO_LARGE - The result set is too large. -. - -MessageId=8249 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AFFECTS_MULTIPLE_DSAS -Language=Bulgarian -ERROR_DS_AFFECTS_MULTIPLE_DSAS - The operation affects multiple DSAs -. - -MessageId=8250 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SERVER_DOWN -Language=Bulgarian -ERROR_DS_SERVER_DOWN - The server is not operational. -. - -MessageId=8251 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOCAL_ERROR -Language=Bulgarian -ERROR_DS_LOCAL_ERROR - A local error has occurred. -. - -MessageId=8252 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ENCODING_ERROR -Language=Bulgarian -ERROR_DS_ENCODING_ERROR - An encoding error has occurred. -. - -MessageId=8253 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DECODING_ERROR -Language=Bulgarian -ERROR_DS_DECODING_ERROR - A decoding error has occurred. -. - -MessageId=8254 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_FILTER_UNKNOWN -Language=Bulgarian -ERROR_DS_FILTER_UNKNOWN - The search filter cannot be recognized. -. - -MessageId=8255 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_PARAM_ERROR -Language=Bulgarian -ERROR_DS_PARAM_ERROR - One or more parameters are illegal. -. - -MessageId=8256 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_SUPPORTED -Language=Bulgarian -ERROR_DS_NOT_SUPPORTED - The specified method is not supported. -. - -MessageId=8257 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_RESULTS_RETURNED -Language=Bulgarian -ERROR_DS_NO_RESULTS_RETURNED - No results were returned. -. - -MessageId=8258 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CONTROL_NOT_FOUND -Language=Bulgarian -ERROR_DS_CONTROL_NOT_FOUND - The specified control is not supported by the server. -. - -MessageId=8259 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CLIENT_LOOP -Language=Bulgarian -ERROR_DS_CLIENT_LOOP - A referral loop was detected by the client. -. - -MessageId=8260 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REFERRAL_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_DS_REFERRAL_LIMIT_EXCEEDED - The preset referral limit was exceeded. -. - -MessageId=8261 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SORT_CONTROL_MISSING -Language=Bulgarian -ERROR_DS_SORT_CONTROL_MISSING - The search requires a SORT control. -. - -MessageId=8262 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OFFSET_RANGE_ERROR -Language=Bulgarian -ERROR_DS_OFFSET_RANGE_ERROR - The search results exceed the offset range specified. -. - -MessageId=8301 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ROOT_MUST_BE_NC -Language=Bulgarian -ERROR_DS_ROOT_MUST_BE_NC - The root object must be the head of a naming context. The root object cannot have an instantiated parent. -. - -MessageId=8302 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ADD_REPLICA_INHIBITED -Language=Bulgarian -ERROR_DS_ADD_REPLICA_INHIBITED - The add replica operation cannot be performed. The naming context must be writeable in order to create the replica. -. - -MessageId=8303 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_NOT_DEF_IN_SCHEMA -Language=Bulgarian -ERROR_DS_ATT_NOT_DEF_IN_SCHEMA - A reference to an attribute that is not defined in the schema occurred. -. - -MessageId=8304 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MAX_OBJ_SIZE_EXCEEDED -Language=Bulgarian -ERROR_DS_MAX_OBJ_SIZE_EXCEEDED - The maximum size of an object has been exceeded. -. - -MessageId=8305 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_STRING_NAME_EXISTS -Language=Bulgarian -ERROR_DS_OBJ_STRING_NAME_EXISTS - An attempt was made to add an object to the directory with a name that is already in use. -. - -MessageId=8306 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA -Language=Bulgarian -ERROR_DS_NO_RDN_DEFINED_IN_SCHEMA - An attempt was made to add an object of a class that does not have an RDN defined in the schema. -. - -MessageId=8307 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_RDN_DOESNT_MATCH_SCHEMA -Language=Bulgarian -ERROR_DS_RDN_DOESNT_MATCH_SCHEMA - An attempt was made to add an object using an RDN that is not the RDN defined in the schema. -. - -MessageId=8308 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_REQUESTED_ATTS_FOUND -Language=Bulgarian -ERROR_DS_NO_REQUESTED_ATTS_FOUND - None of the requested attributes were found on the objects. -. - -MessageId=8309 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_USER_BUFFER_TO_SMALL -Language=Bulgarian -ERROR_DS_USER_BUFFER_TO_SMALL - The user buffer is too small. -. - -MessageId=8310 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_IS_NOT_ON_OBJ -Language=Bulgarian -ERROR_DS_ATT_IS_NOT_ON_OBJ - The attribute specified in the operation is not present on the object. -. - -MessageId=8311 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ILLEGAL_MOD_OPERATION -Language=Bulgarian -ERROR_DS_ILLEGAL_MOD_OPERATION - Illegal modify operation. Some aspect of the modification is not permitted. -. - -MessageId=8312 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_TOO_LARGE -Language=Bulgarian -ERROR_DS_OBJ_TOO_LARGE - The specified object is too large. -. - -MessageId=8313 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BAD_INSTANCE_TYPE -Language=Bulgarian -ERROR_DS_BAD_INSTANCE_TYPE - The specified instance type is not valid. -. - -MessageId=8314 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MASTERDSA_REQUIRED -Language=Bulgarian -ERROR_DS_MASTERDSA_REQUIRED - The operation must be performed at a master DSA. -. - -MessageId=8315 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJECT_CLASS_REQUIRED -Language=Bulgarian -ERROR_DS_OBJECT_CLASS_REQUIRED - The object class attribute must be specified. -. - -MessageId=8316 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MISSING_REQUIRED_ATT -Language=Bulgarian -ERROR_DS_MISSING_REQUIRED_ATT - A required attribute is missing. -. - -MessageId=8317 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_NOT_DEF_FOR_CLASS -Language=Bulgarian -ERROR_DS_ATT_NOT_DEF_FOR_CLASS - An attempt was made to modify an object to include an attribute that is not legal for its class -. - -MessageId=8318 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_ALREADY_EXISTS -Language=Bulgarian -ERROR_DS_ATT_ALREADY_EXISTS - The specified attribute is already present on the object. -. - -MessageId=8320 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ADD_ATT_VALUES -Language=Bulgarian -ERROR_DS_CANT_ADD_ATT_VALUES - The specified attribute is not present, or has no values. -. - -MessageId=8321 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SINGLE_VALUE_CONSTRAINT -Language=Bulgarian -ERROR_DS_SINGLE_VALUE_CONSTRAINT - Multiple values were specified for an attribute that can have only one value. -. - -MessageId=8322 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_RANGE_CONSTRAINT -Language=Bulgarian -ERROR_DS_RANGE_CONSTRAINT - A value for the attribute was not in the acceptable range of values. -. - -MessageId=8323 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_VAL_ALREADY_EXISTS -Language=Bulgarian -ERROR_DS_ATT_VAL_ALREADY_EXISTS - The specified value already exists. -. - -MessageId=8324 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_REM_MISSING_ATT -Language=Bulgarian -ERROR_DS_CANT_REM_MISSING_ATT - The attribute cannot be removed because it is not present on the object. -. - -MessageId=8325 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_REM_MISSING_ATT_VAL -Language=Bulgarian -ERROR_DS_CANT_REM_MISSING_ATT_VAL - The attribute value cannot be removed because it is not present on the object. -. - -MessageId=8326 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ROOT_CANT_BE_SUBREF -Language=Bulgarian -ERROR_DS_ROOT_CANT_BE_SUBREF - The specified root object cannot be a subref. -. - -MessageId=8327 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_CHAINING -Language=Bulgarian -ERROR_DS_NO_CHAINING - Chaining is not permitted. -. - -MessageId=8328 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_CHAINED_EVAL -Language=Bulgarian -ERROR_DS_NO_CHAINED_EVAL - Chained evaluation is not permitted. -. - -MessageId=8329 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_PARENT_OBJECT -Language=Bulgarian -ERROR_DS_NO_PARENT_OBJECT - The operation could not be performed because the object's parent is either uninstantiated or deleted. -. - -MessageId=8330 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_PARENT_IS_AN_ALIAS -Language=Bulgarian -ERROR_DS_PARENT_IS_AN_ALIAS - Having a parent that is an alias is not permitted. Aliases are leaf objects. -. - -MessageId=8331 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MIX_MASTER_AND_REPS -Language=Bulgarian -ERROR_DS_CANT_MIX_MASTER_AND_REPS - The object and parent must be of the same type, either both masters or both replicas. -. - -MessageId=8332 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CHILDREN_EXIST -Language=Bulgarian -ERROR_DS_CHILDREN_EXIST - The operation cannot be performed because child objects exist. This operation can only be performed on a leaf object. -. - -MessageId=8333 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_NOT_FOUND -Language=Bulgarian -ERROR_DS_OBJ_NOT_FOUND - Directory object not found. -. - -MessageId=8334 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ALIASED_OBJ_MISSING -Language=Bulgarian -ERROR_DS_ALIASED_OBJ_MISSING - The aliased object is missing. -. - -MessageId=8335 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BAD_NAME_SYNTAX -Language=Bulgarian -ERROR_DS_BAD_NAME_SYNTAX - The object name has bad syntax. -. - -MessageId=8336 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ALIAS_POINTS_TO_ALIAS -Language=Bulgarian -ERROR_DS_ALIAS_POINTS_TO_ALIAS - It is not permitted for an alias to refer to another alias. -. - -MessageId=8337 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DEREF_ALIAS -Language=Bulgarian -ERROR_DS_CANT_DEREF_ALIAS - The alias cannot be dereferenced. -. - -MessageId=8338 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OUT_OF_SCOPE -Language=Bulgarian -ERROR_DS_OUT_OF_SCOPE - The operation is out of scope. -. - -MessageId=8339 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJECT_BEING_REMOVED -Language=Bulgarian -ERROR_DS_OBJECT_BEING_REMOVED - The operation cannot continue because the object is in the process of being removed. -. - -MessageId=8340 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DELETE_DSA_OBJ -Language=Bulgarian -ERROR_DS_CANT_DELETE_DSA_OBJ - The DSA object cannot be deleted. -. - -MessageId=8341 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GENERIC_ERROR -Language=Bulgarian -ERROR_DS_GENERIC_ERROR - A directory service error has occurred. -. - -MessageId=8342 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DSA_MUST_BE_INT_MASTER -Language=Bulgarian -ERROR_DS_DSA_MUST_BE_INT_MASTER - The operation can only be performed on an internal master DSA object. -. - -MessageId=8343 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CLASS_NOT_DSA -Language=Bulgarian -ERROR_DS_CLASS_NOT_DSA - The object must be of class DSA. -. - -MessageId=8344 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INSUFF_ACCESS_RIGHTS -Language=Bulgarian -ERROR_DS_INSUFF_ACCESS_RIGHTS - Insufficient access rights to perform the operation. -. - -MessageId=8345 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ILLEGAL_SUPERIOR -Language=Bulgarian -ERROR_DS_ILLEGAL_SUPERIOR - The object cannot be added because the parent is not on the list of possible superiors. -. - -MessageId=8346 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATTRIBUTE_OWNED_BY_SAM -Language=Bulgarian -ERROR_DS_ATTRIBUTE_OWNED_BY_SAM - Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM). -. - -MessageId=8347 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_TOO_MANY_PARTS -Language=Bulgarian -ERROR_DS_NAME_TOO_MANY_PARTS - The name has too many parts. -. - -MessageId=8348 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_TOO_LONG -Language=Bulgarian -ERROR_DS_NAME_TOO_LONG - The name is too long. -. - -MessageId=8349 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_VALUE_TOO_LONG -Language=Bulgarian -ERROR_DS_NAME_VALUE_TOO_LONG - The name value is too long. -. - -MessageId=8350 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_UNPARSEABLE -Language=Bulgarian -ERROR_DS_NAME_UNPARSEABLE - The directory service encountered an error parsing a name. -. - -MessageId=8351 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_TYPE_UNKNOWN -Language=Bulgarian -ERROR_DS_NAME_TYPE_UNKNOWN - The directory service cannot get the attribute type for a name. -. - -MessageId=8352 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_AN_OBJECT -Language=Bulgarian -ERROR_DS_NOT_AN_OBJECT - The name does not identify an object; the name identifies a phantom. -. - -MessageId=8353 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SEC_DESC_TOO_SHORT -Language=Bulgarian -ERROR_DS_SEC_DESC_TOO_SHORT - The security descriptor is too short. -. - -MessageId=8354 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SEC_DESC_INVALID -Language=Bulgarian -ERROR_DS_SEC_DESC_INVALID - The security descriptor is invalid. -. - -MessageId=8355 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_DELETED_NAME -Language=Bulgarian -ERROR_DS_NO_DELETED_NAME - Failed to create name for deleted object. -. - -MessageId=8356 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SUBREF_MUST_HAVE_PARENT -Language=Bulgarian -ERROR_DS_SUBREF_MUST_HAVE_PARENT - The parent of a new subref must exist. -. - -MessageId=8357 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NCNAME_MUST_BE_NC -Language=Bulgarian -ERROR_DS_NCNAME_MUST_BE_NC - The object must be a naming context. -. - -MessageId=8358 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ADD_SYSTEM_ONLY -Language=Bulgarian -ERROR_DS_CANT_ADD_SYSTEM_ONLY - It is not permitted to add an attribute which is owned by the system. -. - -MessageId=8359 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CLASS_MUST_BE_CONCRETE -Language=Bulgarian -ERROR_DS_CLASS_MUST_BE_CONCRETE - The class of the object must be structural; you cannot instantiate an abstract class. -. - -MessageId=8360 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_DMD -Language=Bulgarian -ERROR_DS_INVALID_DMD - The schema object could not be found. -. - -MessageId=8361 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_GUID_EXISTS -Language=Bulgarian -ERROR_DS_OBJ_GUID_EXISTS - A local object with this GUID (dead or alive) already exists. -. - -MessageId=8362 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_ON_BACKLINK -Language=Bulgarian -ERROR_DS_NOT_ON_BACKLINK - The operation cannot be performed on a back link. -. - -MessageId=8363 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_CROSSREF_FOR_NC -Language=Bulgarian -ERROR_DS_NO_CROSSREF_FOR_NC - The cross reference for the specified naming context could not be found. -. - -MessageId=8364 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SHUTTING_DOWN -Language=Bulgarian -ERROR_DS_SHUTTING_DOWN - The operation could not be performed because the directory service is shutting down. -. - -MessageId=8365 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNKNOWN_OPERATION -Language=Bulgarian -ERROR_DS_UNKNOWN_OPERATION - The directory service request is invalid. -. - -MessageId=8366 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_ROLE_OWNER -Language=Bulgarian -ERROR_DS_INVALID_ROLE_OWNER - The role owner attribute could not be read. -. - -MessageId=8367 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COULDNT_CONTACT_FSMO -Language=Bulgarian -ERROR_DS_COULDNT_CONTACT_FSMO - The requested FSMO operation failed. The current FSMO holder could not be reached. -. - -MessageId=8368 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CROSS_NC_DN_RENAME -Language=Bulgarian -ERROR_DS_CROSS_NC_DN_RENAME - Modification of a DN across a naming context is not permitted. -. - -MessageId=8369 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOD_SYSTEM_ONLY -Language=Bulgarian -ERROR_DS_CANT_MOD_SYSTEM_ONLY - The attribute cannot be modified because it is owned by the system. -. - -MessageId=8370 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REPLICATOR_ONLY -Language=Bulgarian -ERROR_DS_REPLICATOR_ONLY - Only the replicator can perform this function. -. - -MessageId=8371 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_CLASS_NOT_DEFINED -Language=Bulgarian -ERROR_DS_OBJ_CLASS_NOT_DEFINED - The specified class is not defined. -. - -MessageId=8372 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OBJ_CLASS_NOT_SUBCLASS -Language=Bulgarian -ERROR_DS_OBJ_CLASS_NOT_SUBCLASS - The specified class is not a subclass. -. - -MessageId=8373 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_REFERENCE_INVALID -Language=Bulgarian -ERROR_DS_NAME_REFERENCE_INVALID - The name reference is invalid. -. - -MessageId=8374 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CROSS_REF_EXISTS -Language=Bulgarian -ERROR_DS_CROSS_REF_EXISTS - A cross reference already exists. -. - -MessageId=8375 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DEL_MASTER_CROSSREF -Language=Bulgarian -ERROR_DS_CANT_DEL_MASTER_CROSSREF - It is not permitted to delete a master cross reference. -. - -MessageId=8376 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD -Language=Bulgarian -ERROR_DS_SUBTREE_NOTIFY_NOT_NC_HEAD - Subtree notifications are only supported on NC heads. -. - -MessageId=8377 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX -Language=Bulgarian -ERROR_DS_NOTIFY_FILTER_TOO_COMPLEX - Notification filter is too complex. -. - -MessageId=8378 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_RDN -Language=Bulgarian -ERROR_DS_DUP_RDN - Schema update failed: duplicate RDN. -. - -MessageId=8379 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_OID -Language=Bulgarian -ERROR_DS_DUP_OID - Schema update failed: duplicate OID -. - -MessageId=8380 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_MAPI_ID -Language=Bulgarian -ERROR_DS_DUP_MAPI_ID - Schema update failed: duplicate MAPI identifier. -. - -MessageId=8381 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_SCHEMA_ID_GUID -Language=Bulgarian -ERROR_DS_DUP_SCHEMA_ID_GUID - Schema update failed: duplicate schema-id GUID. -. - -MessageId=8382 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_LDAP_DISPLAY_NAME -Language=Bulgarian -ERROR_DS_DUP_LDAP_DISPLAY_NAME - Schema update failed: duplicate LDAP display name. -. - -MessageId=8383 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SEMANTIC_ATT_TEST -Language=Bulgarian -ERROR_DS_SEMANTIC_ATT_TEST - Schema update failed: range-lower less than range upper -. - -MessageId=8384 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SYNTAX_MISMATCH -Language=Bulgarian -ERROR_DS_SYNTAX_MISMATCH - Schema update failed: syntax mismatch -. - -MessageId=8385 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_MUST_HAVE -Language=Bulgarian -ERROR_DS_EXISTS_IN_MUST_HAVE - Schema deletion failed: attribute is used in must-contain -. - -MessageId=8386 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_MAY_HAVE -Language=Bulgarian -ERROR_DS_EXISTS_IN_MAY_HAVE - Schema deletion failed: attribute is used in may-contain -. - -MessageId=8387 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NONEXISTENT_MAY_HAVE -Language=Bulgarian -ERROR_DS_NONEXISTENT_MAY_HAVE - Schema update failed: attribute in may-contain does not exist -. - -MessageId=8388 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NONEXISTENT_MUST_HAVE -Language=Bulgarian -ERROR_DS_NONEXISTENT_MUST_HAVE - Schema update failed: attribute in must-contain does not exist -. - -MessageId=8389 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AUX_CLS_TEST_FAIL -Language=Bulgarian -ERROR_DS_AUX_CLS_TEST_FAIL - Schema update failed: class in aux-class list does not exist or is not an auxiliary class -. - -MessageId=8390 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NONEXISTENT_POSS_SUP -Language=Bulgarian -ERROR_DS_NONEXISTENT_POSS_SUP - Schema update failed: class in poss-superiors does not exist -. - -MessageId=8391 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SUB_CLS_TEST_FAIL -Language=Bulgarian -ERROR_DS_SUB_CLS_TEST_FAIL - Schema update failed: class in subclassof list does not exist or does not satisfy hierarchy rules -. - -MessageId=8392 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BAD_RDN_ATT_ID_SYNTAX -Language=Bulgarian -ERROR_DS_BAD_RDN_ATT_ID_SYNTAX - Schema update failed: Rdn-Att-Id has wrong syntax -. - -MessageId=8393 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_AUX_CLS -Language=Bulgarian -ERROR_DS_EXISTS_IN_AUX_CLS - Schema deletion failed: class is used as auxiliary class -. - -MessageId=8394 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_SUB_CLS -Language=Bulgarian -ERROR_DS_EXISTS_IN_SUB_CLS - Schema deletion failed: class is used as sub class -. - -MessageId=8395 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_POSS_SUP -Language=Bulgarian -ERROR_DS_EXISTS_IN_POSS_SUP - Schema deletion failed: class is used as poss superior -. - -MessageId=8396 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_RECALCSCHEMA_FAILED -Language=Bulgarian -ERROR_DS_RECALCSCHEMA_FAILED - Schema update failed in recalculating validation cache. -. - -MessageId=8397 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_TREE_DELETE_NOT_FINISHED -Language=Bulgarian -ERROR_DS_TREE_DELETE_NOT_FINISHED - The tree deletion is not finished. -. - -MessageId=8398 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DELETE -Language=Bulgarian -ERROR_DS_CANT_DELETE - The requested delete operation could not be performed. -. - -MessageId=8399 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_SCHEMA_REQ_ID -Language=Bulgarian -ERROR_DS_ATT_SCHEMA_REQ_ID - Cannot read the governs class identifier for the schema record. -. - -MessageId=8400 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BAD_ATT_SCHEMA_SYNTAX -Language=Bulgarian -ERROR_DS_BAD_ATT_SCHEMA_SYNTAX - The attribute schema has bad syntax. -. - -MessageId=8401 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_CACHE_ATT -Language=Bulgarian -ERROR_DS_CANT_CACHE_ATT - The attribute could not be cached. -. - -MessageId=8402 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_CACHE_CLASS -Language=Bulgarian -ERROR_DS_CANT_CACHE_CLASS - The class could not be cached. -. - -MessageId=8403 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_REMOVE_ATT_CACHE -Language=Bulgarian -ERROR_DS_CANT_REMOVE_ATT_CACHE - The attribute could not be removed from the cache. -. - -MessageId=8404 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_REMOVE_CLASS_CACHE -Language=Bulgarian -ERROR_DS_CANT_REMOVE_CLASS_CACHE - The class could not be removed from the cache. -. - -MessageId=8405 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_RETRIEVE_DN -Language=Bulgarian -ERROR_DS_CANT_RETRIEVE_DN - The distinguished name attribute could not be read. -. - -MessageId=8406 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MISSING_SUPREF -Language=Bulgarian -ERROR_DS_MISSING_SUPREF - No superior reference has been configured for the directory service. The directory service is therefore unable to issue referrals to objects outside this forest. -. - -MessageId=8407 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_RETRIEVE_INSTANCE -Language=Bulgarian -ERROR_DS_CANT_RETRIEVE_INSTANCE - The instance type attribute could not be retrieved. -. - -MessageId=8408 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CODE_INCONSISTENCY -Language=Bulgarian -ERROR_DS_CODE_INCONSISTENCY - An internal error has occurred. -. - -MessageId=8409 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DATABASE_ERROR -Language=Bulgarian -ERROR_DS_DATABASE_ERROR - A database error has occurred. -. - -MessageId=8410 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GOVERNSID_MISSING -Language=Bulgarian -ERROR_DS_GOVERNSID_MISSING - The attribute GOVERNSID is missing. -. - -MessageId=8411 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MISSING_EXPECTED_ATT -Language=Bulgarian -ERROR_DS_MISSING_EXPECTED_ATT - An expected attribute is missing. -. - -MessageId=8412 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NCNAME_MISSING_CR_REF -Language=Bulgarian -ERROR_DS_NCNAME_MISSING_CR_REF - The specified naming context is missing a cross reference. -. - -MessageId=8413 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SECURITY_CHECKING_ERROR -Language=Bulgarian -ERROR_DS_SECURITY_CHECKING_ERROR - A security checking error has occurred. -. - -MessageId=8414 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SCHEMA_NOT_LOADED -Language=Bulgarian -ERROR_DS_SCHEMA_NOT_LOADED - The schema is not loaded. -. - -MessageId=8415 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SCHEMA_ALLOC_FAILED -Language=Bulgarian -ERROR_DS_SCHEMA_ALLOC_FAILED - Schema allocation failed. Please check if the machine is running low on memory. -. - -MessageId=8416 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ATT_SCHEMA_REQ_SYNTAX -Language=Bulgarian -ERROR_DS_ATT_SCHEMA_REQ_SYNTAX - Failed to obtain the required syntax for the attribute schema. -. - -MessageId=8417 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GCVERIFY_ERROR -Language=Bulgarian -ERROR_DS_GCVERIFY_ERROR - The global catalog verification failed. The global catalog is not available or does not support the operation. Some part of the directory is currently not available. -. - -MessageId=8418 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SCHEMA_MISMATCH -Language=Bulgarian -ERROR_DS_DRA_SCHEMA_MISMATCH - The replication operation failed because of a schema mismatch between the servers involved. -. - -MessageId=8419 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_FIND_DSA_OBJ -Language=Bulgarian -ERROR_DS_CANT_FIND_DSA_OBJ - The DSA object could not be found. -. - -MessageId=8420 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_FIND_EXPECTED_NC -Language=Bulgarian -ERROR_DS_CANT_FIND_EXPECTED_NC - The naming context could not be found. -. - -MessageId=8421 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_FIND_NC_IN_CACHE -Language=Bulgarian -ERROR_DS_CANT_FIND_NC_IN_CACHE - The naming context could not be found in the cache. -. - -MessageId=8422 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_RETRIEVE_CHILD -Language=Bulgarian -ERROR_DS_CANT_RETRIEVE_CHILD - The child object could not be retrieved. -. - -MessageId=8423 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SECURITY_ILLEGAL_MODIFY -Language=Bulgarian -ERROR_DS_SECURITY_ILLEGAL_MODIFY - The modification was not permitted for security reasons. -. - -MessageId=8424 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_REPLACE_HIDDEN_REC -Language=Bulgarian -ERROR_DS_CANT_REPLACE_HIDDEN_REC - The operation cannot replace the hidden record. -. - -MessageId=8425 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BAD_HIERARCHY_FILE -Language=Bulgarian -ERROR_DS_BAD_HIERARCHY_FILE - The hierarchy file is invalid. -. - -MessageId=8426 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED -Language=Bulgarian -ERROR_DS_BUILD_HIERARCHY_TABLE_FAILED - The attempt to build the hierarchy table failed. -. - -MessageId=8427 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CONFIG_PARAM_MISSING -Language=Bulgarian -ERROR_DS_CONFIG_PARAM_MISSING - The directory configuration parameter is missing from the registry. -. - -MessageId=8428 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COUNTING_AB_INDICES_FAILED -Language=Bulgarian -ERROR_DS_COUNTING_AB_INDICES_FAILED - The attempt to count the address book indices failed. -. - -MessageId=8429 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED -Language=Bulgarian -ERROR_DS_HIERARCHY_TABLE_MALLOC_FAILED - The allocation of the hierarchy table failed. -. - -MessageId=8430 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INTERNAL_FAILURE -Language=Bulgarian -ERROR_DS_INTERNAL_FAILURE - The directory service encountered an internal failure. -. - -MessageId=8431 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNKNOWN_ERROR -Language=Bulgarian -ERROR_DS_UNKNOWN_ERROR - The directory service encountered an unknown failure. -. - -MessageId=8432 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ROOT_REQUIRES_CLASS_TOP -Language=Bulgarian -ERROR_DS_ROOT_REQUIRES_CLASS_TOP - A root object requires a class of 'top'. -. - -MessageId=8433 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REFUSING_FSMO_ROLES -Language=Bulgarian -ERROR_DS_REFUSING_FSMO_ROLES - This directory server is shutting down, and cannot take ownership of new floating single-master operation roles. -. - -MessageId=8434 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MISSING_FSMO_SETTINGS -Language=Bulgarian -ERROR_DS_MISSING_FSMO_SETTINGS - The directory service is missing mandatory configuration information, and is unable to determine the ownership of floating single-master operation roles. -. - -MessageId=8435 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNABLE_TO_SURRENDER_ROLES -Language=Bulgarian -ERROR_DS_UNABLE_TO_SURRENDER_ROLES - The directory service was unable to transfer ownership of one or more floating single-master operation roles to other servers. -. - -MessageId=8436 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_GENERIC -Language=Bulgarian -ERROR_DS_DRA_GENERIC - The replication operation failed. -. - -MessageId=8437 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_INVALID_PARAMETER -Language=Bulgarian -ERROR_DS_DRA_INVALID_PARAMETER - An invalid parameter was specified for this replication operation. -. - -MessageId=8438 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_BUSY -Language=Bulgarian -ERROR_DS_DRA_BUSY - The directory service is too busy to complete the replication operation at this time. -. - -MessageId=8439 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_BAD_DN -Language=Bulgarian -ERROR_DS_DRA_BAD_DN - The distinguished name specified for this replication operation is invalid. -. - -MessageId=8440 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_BAD_NC -Language=Bulgarian -ERROR_DS_DRA_BAD_NC - The naming context specified for this replication operation is invalid. -. - -MessageId=8441 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_DN_EXISTS -Language=Bulgarian -ERROR_DS_DRA_DN_EXISTS - The distinguished name specified for this replication operation already exists. -. - -MessageId=8442 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_INTERNAL_ERROR -Language=Bulgarian -ERROR_DS_DRA_INTERNAL_ERROR - The replication system encountered an internal error. -. - -MessageId=8443 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_INCONSISTENT_DIT -Language=Bulgarian -ERROR_DS_DRA_INCONSISTENT_DIT - The replication operation encountered a database inconsistency. -. - -MessageId=8444 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_CONNECTION_FAILED -Language=Bulgarian -ERROR_DS_DRA_CONNECTION_FAILED - The server specified for this replication operation could not be contacted. -. - -MessageId=8445 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_BAD_INSTANCE_TYPE -Language=Bulgarian -ERROR_DS_DRA_BAD_INSTANCE_TYPE - The replication operation encountered an object with an invalid instance type. -. - -MessageId=8446 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_OUT_OF_MEM -Language=Bulgarian -ERROR_DS_DRA_OUT_OF_MEM - The replication operation failed to allocate memory. -. - -MessageId=8447 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_MAIL_PROBLEM -Language=Bulgarian -ERROR_DS_DRA_MAIL_PROBLEM - The replication operation encountered an error with the mail system. -. - -MessageId=8448 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_REF_ALREADY_EXISTS -Language=Bulgarian -ERROR_DS_DRA_REF_ALREADY_EXISTS - The replication reference information for the target server already exists. -. - -MessageId=8449 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_REF_NOT_FOUND -Language=Bulgarian -ERROR_DS_DRA_REF_NOT_FOUND - The replication reference information for the target server does not exist. -. - -MessageId=8450 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_OBJ_IS_REP_SOURCE -Language=Bulgarian -ERROR_DS_DRA_OBJ_IS_REP_SOURCE - The naming context cannot be removed because it is replicated to another server. -. - -MessageId=8451 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_DB_ERROR -Language=Bulgarian -ERROR_DS_DRA_DB_ERROR - The replication operation encountered a database error. -. - -MessageId=8452 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_NO_REPLICA -Language=Bulgarian -ERROR_DS_DRA_NO_REPLICA - The naming context is in the process of being removed or is not replicated from the specified server. -. - -MessageId=8453 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_ACCESS_DENIED -Language=Bulgarian -ERROR_DS_DRA_ACCESS_DENIED - Replication access was denied. -. - -MessageId=8454 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_NOT_SUPPORTED -Language=Bulgarian -ERROR_DS_DRA_NOT_SUPPORTED - The requested operation is not supported by this version of the directory service. -. - -MessageId=8455 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_RPC_CANCELLED -Language=Bulgarian -ERROR_DS_DRA_RPC_CANCELLED - The replication remote procedure call was cancelled. -. - -MessageId=8456 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SOURCE_DISABLED -Language=Bulgarian -ERROR_DS_DRA_SOURCE_DISABLED - The source server is currently rejecting replication requests. -. - -MessageId=8457 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SINK_DISABLED -Language=Bulgarian -ERROR_DS_DRA_SINK_DISABLED - The destination server is currently rejecting replication requests. -. - -MessageId=8458 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_NAME_COLLISION -Language=Bulgarian -ERROR_DS_DRA_NAME_COLLISION - The replication operation failed due to a collision of object names. -. - -MessageId=8459 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SOURCE_REINSTALLED -Language=Bulgarian -ERROR_DS_DRA_SOURCE_REINSTALLED - The replication source has been reinstalled. -. - -MessageId=8460 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_MISSING_PARENT -Language=Bulgarian -ERROR_DS_DRA_MISSING_PARENT - The replication operation failed because a required parent object is missing. -. - -MessageId=8461 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_PREEMPTED -Language=Bulgarian -ERROR_DS_DRA_PREEMPTED - The replication operation was preempted. -. - -MessageId=8462 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_ABANDON_SYNC -Language=Bulgarian -ERROR_DS_DRA_ABANDON_SYNC - The replication synchronization attempt was abandoned because of a lack of updates. -. - -MessageId=8463 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SHUTDOWN -Language=Bulgarian -ERROR_DS_DRA_SHUTDOWN - The replication operation was terminated because the system is shutting down. -. - -MessageId=8464 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET -Language=Bulgarian -ERROR_DS_DRA_INCOMPATIBLE_PARTIAL_SET - Synchronization attempt failed because the destination DC is currently waiting to synchronize new partial attributes from source. This condition is normal if a recent schema change modified the partial attribute set. The destination partial attribute set is not a subset of the source partial attribute set. -. - -MessageId=8465 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA -Language=Bulgarian -ERROR_DS_DRA_SOURCE_IS_PARTIAL_REPLICA - The replication synchronization attempt failed because a master replica attempted to sync from a partial replica. -. - -MessageId=8466 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_EXTN_CONNECTION_FAILED -Language=Bulgarian -ERROR_DS_DRA_EXTN_CONNECTION_FAILED - The server specified for this replication operation was contacted, but that server was unable to contact an additional server needed to complete the operation. -. - -MessageId=8467 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INSTALL_SCHEMA_MISMATCH -Language=Bulgarian -ERROR_DS_INSTALL_SCHEMA_MISMATCH - The version of the Active Directory schema of the source forest is not compatible with the version of Active Directory on this computer. -. - -MessageId=8468 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_LINK_ID -Language=Bulgarian -ERROR_DS_DUP_LINK_ID - Schema update failed: An attribute with the same link identifier already exists. -. - -MessageId=8469 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_RESOLVING -Language=Bulgarian -ERROR_DS_NAME_ERROR_RESOLVING - Name translation: Generic processing error. -. - -MessageId=8470 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_NOT_FOUND -Language=Bulgarian -ERROR_DS_NAME_ERROR_NOT_FOUND - Name translation: Could not find the name or insufficient right to see name. -. - -MessageId=8471 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_NOT_UNIQUE -Language=Bulgarian -ERROR_DS_NAME_ERROR_NOT_UNIQUE - Name translation: Input name mapped to more than one output name. -. - -MessageId=8472 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_NO_MAPPING -Language=Bulgarian -ERROR_DS_NAME_ERROR_NO_MAPPING - Name translation: Input name found, but not the associated output format. -. - -MessageId=8473 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_DOMAIN_ONLY -Language=Bulgarian -ERROR_DS_NAME_ERROR_DOMAIN_ONLY - Name translation: Unable to resolve completely, only the domain was found. -. - -MessageId=8474 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING -Language=Bulgarian -ERROR_DS_NAME_ERROR_NO_SYNTACTICAL_MAPPING - Name translation: Unable to perform purely syntactical mapping at the client without going out to the wire. -. - -MessageId=8475 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CONSTRUCTED_ATT_MOD -Language=Bulgarian -ERROR_DS_CONSTRUCTED_ATT_MOD - Modification of a constructed attribute is not allowed. -. - -MessageId=8476 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_WRONG_OM_OBJ_CLASS -Language=Bulgarian -ERROR_DS_WRONG_OM_OBJ_CLASS - The OM-Object-Class specified is incorrect for an attribute with the specified syntax. -. - -MessageId=8477 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_REPL_PENDING -Language=Bulgarian -ERROR_DS_DRA_REPL_PENDING - The replication request has been posted; waiting for reply. -. - -MessageId=8478 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DS_REQUIRED -Language=Bulgarian -ERROR_DS_DS_REQUIRED - The requested operation requires a directory service, and none was available. -. - -MessageId=8479 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_LDAP_DISPLAY_NAME -Language=Bulgarian -ERROR_DS_INVALID_LDAP_DISPLAY_NAME - The LDAP display name of the class or attribute contains non-ASCII characters. -. - -MessageId=8480 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NON_BASE_SEARCH -Language=Bulgarian -ERROR_DS_NON_BASE_SEARCH - The requested search operation is only supported for base searches. -. - -MessageId=8481 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_RETRIEVE_ATTS -Language=Bulgarian -ERROR_DS_CANT_RETRIEVE_ATTS - The search failed to retrieve attributes from the database. -. - -MessageId=8482 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_BACKLINK_WITHOUT_LINK -Language=Bulgarian -ERROR_DS_BACKLINK_WITHOUT_LINK - The schema update operation tried to add a backward link attribute that has no corresponding forward link. -. - -MessageId=8483 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EPOCH_MISMATCH -Language=Bulgarian -ERROR_DS_EPOCH_MISMATCH - Source and destination of a cross domain move do not agree on the object's epoch number. Either source or destination does not have the latest version of the object. -. - -MessageId=8484 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_NAME_MISMATCH -Language=Bulgarian -ERROR_DS_SRC_NAME_MISMATCH - Source and destination of a cross domain move do not agree on the object's current name. Either source or destination does not have the latest version of the object. -. - -MessageId=8485 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_AND_DST_NC_IDENTICAL -Language=Bulgarian -ERROR_DS_SRC_AND_DST_NC_IDENTICAL - Source and destination of a cross domain move operation are identical. Caller should use local move operation instead of cross domain move operation. -. - -MessageId=8486 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DST_NC_MISMATCH -Language=Bulgarian -ERROR_DS_DST_NC_MISMATCH - Source and destination for a cross domain move are not in agreement on the naming contexts in the forest. Either source or destination does not have the latest version of the Partitions container. -. - -MessageId=8487 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC -Language=Bulgarian -ERROR_DS_NOT_AUTHORITIVE_FOR_DST_NC - Destination of a cross domain move is not authoritative for the destination naming context. -. - -MessageId=8488 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_GUID_MISMATCH -Language=Bulgarian -ERROR_DS_SRC_GUID_MISMATCH - Source and destination of a cross domain move do not agree on the identity of the source object. Either source or destination does not have the latest version of the source object. -. - -MessageId=8489 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOVE_DELETED_OBJECT -Language=Bulgarian -ERROR_DS_CANT_MOVE_DELETED_OBJECT - Object being moved across domains is already known to be deleted by the destination server. The source server does not have the latest version of the source object. -. - -MessageId=8490 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_PDC_OPERATION_IN_PROGRESS -Language=Bulgarian -ERROR_DS_PDC_OPERATION_IN_PROGRESS - Another operation, which requires exclusive access to the PDC PSMO, is already in progress. -. - -MessageId=8491 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD -Language=Bulgarian -ERROR_DS_CROSS_DOMAIN_CLEANUP_REQD - A cross domain move operation failed such that the two versions of the moved object exist - one each in the source and destination domains. The destination object needs to be removed to restore the system to a consistent state. -. - -MessageId=8492 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION -Language=Bulgarian -ERROR_DS_ILLEGAL_XDOM_MOVE_OPERATION - This object may not be moved across domain boundaries either because cross domain moves for this class are disallowed, or the object has some special characteristics, e.g.: trust account or restricted RID, which prevent its move. -. - -MessageId=8493 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS -Language=Bulgarian -ERROR_DS_CANT_WITH_ACCT_GROUP_MEMBERSHPS - Can't move objects with memberships across domain boundaries as once moved, this would violate the membership conditions of the account group. Remove the object from any account group memberships and retry. -. - -MessageId=8494 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NC_MUST_HAVE_NC_PARENT -Language=Bulgarian -ERROR_DS_NC_MUST_HAVE_NC_PARENT - A naming context head must be the immediate child of another naming context head, not of an interior node. -. - -MessageId=8495 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE -Language=Bulgarian -ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE - The directory cannot validate the proposed naming context name because it does not hold a replica of the naming context above the proposed naming context. Please ensure that the domain naming master role is held by a server that is configured as a global catalog server, and that the server is up to date with its replication partners. (Applies only to Windows 2000 Domain Naming masters) -. - -MessageId=8496 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DST_DOMAIN_NOT_NATIVE -Language=Bulgarian -ERROR_DS_DST_DOMAIN_NOT_NATIVE - Destination domain must be in native mode. -. - -MessageId=8497 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER -Language=Bulgarian -ERROR_DS_MISSING_INFRASTRUCTURE_CONTAINER - The operation cannot be performed because the server does not have an infrastructure container in the domain of interest. -. - -MessageId=8498 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOVE_ACCOUNT_GROUP -Language=Bulgarian -ERROR_DS_CANT_MOVE_ACCOUNT_GROUP - Cross-domain move of non-empty account groups is not allowed. -. - -MessageId=8499 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOVE_RESOURCE_GROUP -Language=Bulgarian -ERROR_DS_CANT_MOVE_RESOURCE_GROUP - Cross-domain move of non-empty resource groups is not allowed. -. - -MessageId=8500 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_SEARCH_FLAG -Language=Bulgarian -ERROR_DS_INVALID_SEARCH_FLAG - The search flags for the attribute are invalid. The ANR bit is valid only on attributes of Unicode or Teletex strings. -. - -MessageId=8501 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_TREE_DELETE_ABOVE_NC -Language=Bulgarian -ERROR_DS_NO_TREE_DELETE_ABOVE_NC - Tree deletions starting at an object which has an NC head as a descendant are not allowed. -. - -MessageId=8502 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE -Language=Bulgarian -ERROR_DS_COULDNT_LOCK_TREE_FOR_DELETE - The directory service failed to lock a tree in preparation for a tree deletion because the tree was in use. -. - -MessageId=8503 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE -Language=Bulgarian -ERROR_DS_COULDNT_IDENTIFY_OBJECTS_FOR_TREE_DELETE - The directory service failed to identify the list of objects to delete while attempting a tree deletion. -. - -MessageId=8504 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SAM_INIT_FAILURE -Language=Bulgarian -ERROR_DS_SAM_INIT_FAILURE - Security Accounts Manager initialization failed because of the following error: %1. -Error Status: 0x%2. Click OK to shut down the system and reboot into Directory Services Restore Mode. Check the event log for detailed information. -. - -MessageId=8505 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SENSITIVE_GROUP_VIOLATION -Language=Bulgarian -ERROR_DS_SENSITIVE_GROUP_VIOLATION - Only an administrator can modify the membership list of an administrative group. -. - -MessageId=8506 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOD_PRIMARYGROUPID -Language=Bulgarian -ERROR_DS_CANT_MOD_PRIMARYGROUPID - Cannot change the primary group ID of a domain controller account. -. - -MessageId=8507 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD -Language=Bulgarian -ERROR_DS_ILLEGAL_BASE_SCHEMA_MOD - An attempt is made to modify the base schema. -. - -MessageId=8508 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NONSAFE_SCHEMA_CHANGE -Language=Bulgarian -ERROR_DS_NONSAFE_SCHEMA_CHANGE - Adding a new mandatory attribute to an existing class, deleting a mandatory attribute from an existing class, or adding an optional attribute to the special class Top that is not a backlink attribute (directly or through inheritance, for example, by adding or deleting an auxiliary class) is not allowed. -. - -MessageId=8509 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SCHEMA_UPDATE_DISALLOWED -Language=Bulgarian -ERROR_DS_SCHEMA_UPDATE_DISALLOWED - Schema update is not allowed on this DC because the DC is not the schema FSMO Role Owner. -. - -MessageId=8510 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_CREATE_UNDER_SCHEMA -Language=Bulgarian -ERROR_DS_CANT_CREATE_UNDER_SCHEMA - An object of this class cannot be created under the schema container. You can only create attribute-schema and class-schema objects under the schema container. -. - -MessageId=8511 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INSTALL_NO_SRC_SCH_VERSION -Language=Bulgarian -ERROR_DS_INSTALL_NO_SRC_SCH_VERSION - The replica/child install failed to get the objectVersion attribute on the schema container on the source DC. Either the attribute is missing on the schema container or the credentials supplied do not have permission to read it. -. - -MessageId=8512 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE -Language=Bulgarian -ERROR_DS_INSTALL_NO_SCH_VERSION_IN_INIFILE - The replica/child install failed to read the objectVersion attribute in the SCHEMA section of the file schema.ini in the system32 directory. -. - -MessageId=8513 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_GROUP_TYPE -Language=Bulgarian -ERROR_DS_INVALID_GROUP_TYPE - The specified group type is invalid. -. - -MessageId=8514 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN -Language=Bulgarian -ERROR_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN - Cannot nest global groups in a mixed domain if the group is security-enabled. -. - -MessageId=8515 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN -Language=Bulgarian -ERROR_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN - Cannot nest local groups in a mixed domain if the group is security-enabled. -. - -MessageId=8516 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER -Language=Bulgarian -ERROR_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER - A global group cannot have a local group as a member. -. - -MessageId=8517 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER -Language=Bulgarian -ERROR_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER - A global group cannot have a universal group as a member. -. - -MessageId=8518 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER -Language=Bulgarian -ERROR_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER - A universal group cannot have a local group as a member. -. - -MessageId=8519 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER -Language=Bulgarian -ERROR_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER - A global group cannot have a cross-domain member. -. - -MessageId=8520 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER -Language=Bulgarian -ERROR_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER - A local group cannot have another cross-domain local group as a member. -. - -MessageId=8521 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_HAVE_PRIMARY_MEMBERS -Language=Bulgarian -ERROR_DS_HAVE_PRIMARY_MEMBERS - A group with primary members cannot change to a security-disabled group. -. - -MessageId=8522 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_STRING_SD_CONVERSION_FAILED -Language=Bulgarian -ERROR_DS_STRING_SD_CONVERSION_FAILED - The schema cache load failed to convert the string default SD on a class-schema object. -. - -MessageId=8523 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAMING_MASTER_GC -Language=Bulgarian -ERROR_DS_NAMING_MASTER_GC - Only DSAs configured to be Global Catalog servers should be allowed to hold the Domain Naming Master FSMO role. (Applies only to Windows 2000 servers) -. - -MessageId=8524 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOOKUP_FAILURE -Language=Bulgarian -ERROR_DS_LOOKUP_FAILURE - The DSA operation is unable to proceed because of a DNS lookup failure. -. - -MessageId=8525 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_COULDNT_UPDATE_SPNS -Language=Bulgarian -ERROR_DS_COULDNT_UPDATE_SPNS - While processing a change to the DNS Host Name for an object, the Service Principal Name values could not be kept in sync. -. - -MessageId=8526 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_RETRIEVE_SD -Language=Bulgarian -ERROR_DS_CANT_RETRIEVE_SD - The Security Descriptor attribute could not be read. -. - -MessageId=8527 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_KEY_NOT_UNIQUE -Language=Bulgarian -ERROR_DS_KEY_NOT_UNIQUE - The object requested was not found, but an object with that key was found. -. - -MessageId=8528 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_WRONG_LINKED_ATT_SYNTAX -Language=Bulgarian -ERROR_DS_WRONG_LINKED_ATT_SYNTAX - The syntax of the linked attributed being added is incorrect. Forward links can only have syntax 2.5.5.1, 2.5.5.7, and 2.5.5.14, and backlinks can only have syntax 2.5.5.1. -. - -MessageId=8529 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD -Language=Bulgarian -ERROR_DS_SAM_NEED_BOOTKEY_PASSWORD - Security Account Manager needs to get the boot password. -. - -MessageId=8530 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY -Language=Bulgarian -ERROR_DS_SAM_NEED_BOOTKEY_FLOPPY - Security Account Manager needs to get the boot key from floppy disk. -. - -MessageId=8531 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_START -Language=Bulgarian -ERROR_DS_CANT_START - Directory Service cannot start. -. - -MessageId=8532 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INIT_FAILURE -Language=Bulgarian -ERROR_DS_INIT_FAILURE - Directory Services could not start. -. - -MessageId=8533 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION -Language=Bulgarian -ERROR_DS_NO_PKT_PRIVACY_ON_CONNECTION - The connection between client and server requires packet privacy or better. -. - -MessageId=8534 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SOURCE_DOMAIN_IN_FOREST -Language=Bulgarian -ERROR_DS_SOURCE_DOMAIN_IN_FOREST - The source domain may not be in the same forest as destination. -. - -MessageId=8535 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST -Language=Bulgarian -ERROR_DS_DESTINATION_DOMAIN_NOT_IN_FOREST - The destination domain must be in the forest. -. - -MessageId=8536 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED -Language=Bulgarian -ERROR_DS_DESTINATION_AUDITING_NOT_ENABLED - The operation requires that destination domain auditing be enabled. -. - -MessageId=8537 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN -Language=Bulgarian -ERROR_DS_CANT_FIND_DC_FOR_SRC_DOMAIN - The operation couldn't locate a DC for the source domain. -. - -MessageId=8538 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER -Language=Bulgarian -ERROR_DS_SRC_OBJ_NOT_GROUP_OR_USER - The source object must be a group or user. -. - -MessageId=8539 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_SID_EXISTS_IN_FOREST -Language=Bulgarian -ERROR_DS_SRC_SID_EXISTS_IN_FOREST - The source object's SID already exists in destination forest. -. - -MessageId=8540 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH -Language=Bulgarian -ERROR_DS_SRC_AND_DST_OBJECT_CLASS_MISMATCH - The source and destination object must be of the same type. -. - -MessageId=8541 -Severity=Success -Facility=System -SymbolicName=ERROR_SAM_INIT_FAILURE -Language=Bulgarian -ERROR_SAM_INIT_FAILURE - Security Accounts Manager initialization failed because of the following error: %1. -Error Status: 0x%2. Click OK to shut down the system and reboot into Safe Mode. Check the event log for detailed information. -. - -MessageId=8542 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SCHEMA_INFO_SHIP -Language=Bulgarian -ERROR_DS_DRA_SCHEMA_INFO_SHIP - Schema information could not be included in the replication request. -. - -MessageId=8543 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_SCHEMA_CONFLICT -Language=Bulgarian -ERROR_DS_DRA_SCHEMA_CONFLICT - The replication operation could not be completed due to a schema incompatibility. -. - -MessageId=8544 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT -Language=Bulgarian -ERROR_DS_DRA_EARLIER_SCHEMA_CONLICT - The replication operation could not be completed due to a previous schema incompatibility. -. - -MessageId=8545 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_OBJ_NC_MISMATCH -Language=Bulgarian -ERROR_DS_DRA_OBJ_NC_MISMATCH - The replication update could not be applied because either the source or the destination has not yet received information regarding a recent cross-domain move operation. -. - -MessageId=8546 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NC_STILL_HAS_DSAS -Language=Bulgarian -ERROR_DS_NC_STILL_HAS_DSAS - The requested domain could not be deleted because there exist domain controllers that still host this domain. -. - -MessageId=8547 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GC_REQUIRED -Language=Bulgarian -ERROR_DS_GC_REQUIRED - The requested operation can be performed only on a global catalog server. -. - -MessageId=8548 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY -Language=Bulgarian -ERROR_DS_LOCAL_MEMBER_OF_LOCAL_ONLY - A local group can only be a member of other local groups in the same domain. -. - -MessageId=8549 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS -Language=Bulgarian -ERROR_DS_NO_FPO_IN_UNIVERSAL_GROUPS - Foreign security principals cannot be members of universal groups. -. - -MessageId=8550 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ADD_TO_GC -Language=Bulgarian -ERROR_DS_CANT_ADD_TO_GC - The attribute is not allowed to be replicated to the GC because of security reasons. -. - -MessageId=8551 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_CHECKPOINT_WITH_PDC -Language=Bulgarian -ERROR_DS_NO_CHECKPOINT_WITH_PDC - The checkpoint with the PDC could not be taken because there are too many modifications being processed currently. -. - -MessageId=8552 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SOURCE_AUDITING_NOT_ENABLED -Language=Bulgarian -ERROR_DS_SOURCE_AUDITING_NOT_ENABLED - The operation requires that source domain auditing be enabled. -. - -MessageId=8553 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC -Language=Bulgarian -ERROR_DS_CANT_CREATE_IN_NONDOMAIN_NC - Security principal objects can only be created inside domain naming contexts. -. - -MessageId=8554 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_NAME_FOR_SPN -Language=Bulgarian -ERROR_DS_INVALID_NAME_FOR_SPN - A Service Principal Name (SPN) could not be constructed because the provided hostname is not in the necessary format. -. - -MessageId=8555 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS -Language=Bulgarian -ERROR_DS_FILTER_USES_CONTRUCTED_ATTRS - A Filter was passed that uses constructed attributes. -. - -MessageId=8556 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_UNICODEPWD_NOT_IN_QUOTES -Language=Bulgarian -ERROR_DS_UNICODEPWD_NOT_IN_QUOTES - The unicodePwd attribute value must be enclosed in double quotes. -. - -MessageId=8557 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED - Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased. -. - -MessageId=8558 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MUST_BE_RUN_ON_DST_DC -Language=Bulgarian -ERROR_DS_MUST_BE_RUN_ON_DST_DC - For security reasons, the operation must be run on the destination DC. -. - -MessageId=8559 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER -Language=Bulgarian -ERROR_DS_SRC_DC_MUST_BE_SP4_OR_GREATER - For security reasons, the source DC must be NT4SP4 or greater. -. - -MessageId=8560 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ -Language=Bulgarian -ERROR_DS_CANT_TREE_DELETE_CRITICAL_OBJ - Critical Directory Service System objects cannot be deleted during tree delete operations. The tree delete may have been partially performed. -. - -MessageId=8561 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INIT_FAILURE_CONSOLE -Language=Bulgarian -ERROR_DS_INIT_FAILURE_CONSOLE - Directory Services could not start because of the following error: %1. -Error Status: 0x%2. Please click OK to shutdown the system. You can use the recovery console to diagnose the system further. -. - -MessageId=8562 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SAM_INIT_FAILURE_CONSOLE -Language=Bulgarian -ERROR_DS_SAM_INIT_FAILURE_CONSOLE - Security Accounts Manager initialization failed because of the following error: %1. -Error Status: 0x%2. Please click OK to shutdown the system. You can use the recovery console to diagnose the system further. -. - -MessageId=8563 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_FOREST_VERSION_TOO_HIGH -Language=Bulgarian -ERROR_DS_FOREST_VERSION_TOO_HIGH - The version of the operating system installed is incompatible with the current forest functional level. You must upgrade to a new version of the operating system before this server can become a domain controller in this forest. -. - -MessageId=8564 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DOMAIN_VERSION_TOO_HIGH -Language=Bulgarian -ERROR_DS_DOMAIN_VERSION_TOO_HIGH - The version of the operating system installed is incompatible with the current domain functional level. You must upgrade to a new version of the operating system before this server can become a domain controller in this domain. -. - -MessageId=8565 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_FOREST_VERSION_TOO_LOW -Language=Bulgarian -ERROR_DS_FOREST_VERSION_TOO_LOW - This version of the operating system installed on this server no longer supports the current forest functional level. You must raise the forest functional level before this server can become a domain controller in this forest. -. - -MessageId=8566 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DOMAIN_VERSION_TOO_LOW -Language=Bulgarian -ERROR_DS_DOMAIN_VERSION_TOO_LOW - This version of the operating system installed on this server no longer supports the current domain functional level. You must raise the domain functional level before this server can become a domain controller in this domain. -. - -MessageId=8567 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INCOMPATIBLE_VERSION -Language=Bulgarian -ERROR_DS_INCOMPATIBLE_VERSION - The version of the operating system installed on this server is incompatible with the functional level of the domain or forest. -. - -MessageId=8568 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LOW_DSA_VERSION -Language=Bulgarian -ERROR_DS_LOW_DSA_VERSION - The functional level of the domain (or forest) cannot be raised to the requested value, because there exist one or more domain controllers in the domain (or forest) that are at a lower incompatible functional level. -. - -MessageId=8569 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN -Language=Bulgarian -ERROR_DS_NO_BEHAVIOR_VERSION_IN_MIXEDDOMAIN - The forest functional level cannot be raised to the requested level since one or more domains are still in mixed domain mode. All domains in the forest must be in native mode before you can raise the forest functional level. -. - -MessageId=8570 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_SUPPORTED_SORT_ORDER -Language=Bulgarian -ERROR_DS_NOT_SUPPORTED_SORT_ORDER - The sort order requested is not supported. -. - -MessageId=8571 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_NOT_UNIQUE -Language=Bulgarian -ERROR_DS_NAME_NOT_UNIQUE - The requested name already exists as a unique identifier. -. - -MessageId=8572 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 -Language=Bulgarian -ERROR_DS_MACHINE_ACCOUNT_CREATED_PRENT4 - The machine account was created pre-NT4. The account needs to be recreated. -. - -MessageId=8573 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_OUT_OF_VERSION_STORE -Language=Bulgarian -ERROR_DS_OUT_OF_VERSION_STORE - The database is out of version store. -. - -MessageId=8574 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INCOMPATIBLE_CONTROLS_USED -Language=Bulgarian -ERROR_DS_INCOMPATIBLE_CONTROLS_USED - Unable to continue operation because multiple conflicting controls were used. -. - -MessageId=8575 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_REF_DOMAIN -Language=Bulgarian -ERROR_DS_NO_REF_DOMAIN - Unable to find a valid security descriptor reference domain for this partition. -. - -MessageId=8576 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_RESERVED_LINK_ID -Language=Bulgarian -ERROR_DS_RESERVED_LINK_ID - Schema update failed: The link identifier is reserved. -. - -MessageId=8577 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LINK_ID_NOT_AVAILABLE -Language=Bulgarian -ERROR_DS_LINK_ID_NOT_AVAILABLE - Schema update failed: There are no link identifiers available. -. - -MessageId=8578 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER -Language=Bulgarian -ERROR_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER - An account group cannot have a universal group as a member. -. - -MessageId=8579 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE -Language=Bulgarian -ERROR_DS_MODIFYDN_DISALLOWED_BY_INSTANCE_TYPE - Rename or move operations on naming context heads or read-only objects are not allowed. -. - -MessageId=8580 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC -Language=Bulgarian -ERROR_DS_NO_OBJECT_MOVE_IN_SCHEMA_NC - Move operations on objects in the schema naming context are not allowed. -. - -MessageId=8581 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG -Language=Bulgarian -ERROR_DS_MODIFYDN_DISALLOWED_BY_FLAG - A system flag has been set on the object and does not allow the object to be moved or renamed. -. - -MessageId=8582 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_MODIFYDN_WRONG_GRANDPARENT -Language=Bulgarian -ERROR_DS_MODIFYDN_WRONG_GRANDPARENT - This object is not allowed to change its grandparent container. Moves are not forbidden on this object, but are restricted to sibling containers. -. - -MessageId=8583 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NAME_ERROR_TRUST_REFERRAL -Language=Bulgarian -ERROR_DS_NAME_ERROR_TRUST_REFERRAL - Unable to resolve completely, a referral to another forest is generated. -. - -MessageId=8584 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER -Language=Bulgarian -ERROR_NOT_SUPPORTED_ON_STANDARD_SERVER - The requested action is not supported on standard server. -. - -MessageId=8585 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD -Language=Bulgarian -ERROR_DS_CANT_ACCESS_REMOTE_PART_OF_AD - Could not access a partition of the Active Directory located on a remote server. Make sure at least one server is running for the partition in question. -. - -MessageId=8586 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 -Language=Bulgarian -ERROR_DS_CR_IMPOSSIBLE_TO_VALIDATE_V2 - The directory cannot validate the proposed naming context (or partition) name because it does not hold a replica nor can it contact a replica of the naming context above the proposed naming context. Please ensure that the parent naming context is properly registered in DNS, and at least one replica of this naming context is reachable by the Domain Naming master. -. - -MessageId=8587 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_THREAD_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_DS_THREAD_LIMIT_EXCEEDED - The thread limit for this request was exceeded. -. - -MessageId=8588 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NOT_CLOSEST -Language=Bulgarian -ERROR_DS_NOT_CLOSEST - The Global catalog server is not in the closet site. -. - -MessageId=8589 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF -Language=Bulgarian -ERROR_DS_CANT_DERIVE_SPN_WITHOUT_SERVER_REF - The DS cannot derive a service principal name (SPN) with which to mutually authenticate the target server because the corresponding server object in the local DS database has no serverReference attribute. -. - -MessageId=8590 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_SINGLE_USER_MODE_FAILED -Language=Bulgarian -ERROR_DS_SINGLE_USER_MODE_FAILED - The Directory Service failed to enter single user mode. -. - -MessageId=8591 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NTDSCRIPT_SYNTAX_ERROR -Language=Bulgarian -ERROR_DS_NTDSCRIPT_SYNTAX_ERROR - The Directory Service cannot parse the script because of a syntax error. -. - -MessageId=8592 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NTDSCRIPT_PROCESS_ERROR -Language=Bulgarian -ERROR_DS_NTDSCRIPT_PROCESS_ERROR - The Directory Service cannot process the script because of an error. -. - -MessageId=8593 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DIFFERENT_REPL_EPOCHS -Language=Bulgarian -ERROR_DS_DIFFERENT_REPL_EPOCHS - The directory service cannot perform the requested operation because the servers involved are of different replication epochs (which is usually related to a domain rename that is in progress). -. - -MessageId=8594 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRS_EXTENSIONS_CHANGED -Language=Bulgarian -ERROR_DS_DRS_EXTENSIONS_CHANGED - The directory service binding must be renegotiated due to a change in the server extensions information. -. - -MessageId=8595 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR -Language=Bulgarian -ERROR_DS_REPLICA_SET_CHANGE_NOT_ALLOWED_ON_DISABLED_CR - Operation not allowed on a disabled cross ref. -. - -MessageId=8596 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_NO_MSDS_INTID -Language=Bulgarian -ERROR_DS_NO_MSDS_INTID - Schema update failed: No values for msDS-IntId are available. -. - -MessageId=8597 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUP_MSDS_INTID -Language=Bulgarian -ERROR_DS_DUP_MSDS_INTID - Schema update failed: Duplicate msDS-IntId. Retry the operation. -. - -MessageId=8598 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTS_IN_RDNATTID -Language=Bulgarian -ERROR_DS_EXISTS_IN_RDNATTID - Schema deletion failed: attribute is used in rDNAttID. -. - -MessageId=8599 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_AUTHORIZATION_FAILED -Language=Bulgarian -ERROR_DS_AUTHORIZATION_FAILED - The directory service failed to authorize the request. -. - -MessageId=8600 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INVALID_SCRIPT -Language=Bulgarian -ERROR_DS_INVALID_SCRIPT - The Directory Service cannot process the script because it is invalid. -. - -MessageId=8601 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REMOTE_CROSSREF_OP_FAILED -Language=Bulgarian -ERROR_DS_REMOTE_CROSSREF_OP_FAILED - The remote create cross reference operation failed on the Domain Naming Master FSMO. The operation's error is in the extended data. -. - -MessageId=8602 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CROSS_REF_BUSY -Language=Bulgarian -ERROR_DS_CROSS_REF_BUSY - A cross reference is in use locally with the same name. -. - -MessageId=8603 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN -Language=Bulgarian -ERROR_DS_CANT_DERIVE_SPN_FOR_DELETED_DOMAIN - The DS cannot derive a service principal name (SPN) with which to mutually authenticate the target server because the server's domain has been deleted from the forest. -. - -MessageId=8604 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC -Language=Bulgarian -ERROR_DS_CANT_DEMOTE_WITH_WRITEABLE_NC - Writeable NCs prevent this DC from demoting. -. - -MessageId=8605 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DUPLICATE_ID_FOUND -Language=Bulgarian -ERROR_DS_DUPLICATE_ID_FOUND - The requested object has a non-unique identifier and cannot be retrieved. -. - -MessageId=8606 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT -Language=Bulgarian -ERROR_DS_INSUFFICIENT_ATTR_TO_CREATE_OBJECT - Insufficient attributes were given to create an object. This object may not exist because it may have been deleted and already garbage collected. -. - -MessageId=8607 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_GROUP_CONVERSION_ERROR -Language=Bulgarian -ERROR_DS_GROUP_CONVERSION_ERROR - The group cannot be converted due to attribute restrictions on the requested group type. -. - -MessageId=8608 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOVE_APP_BASIC_GROUP -Language=Bulgarian -ERROR_DS_CANT_MOVE_APP_BASIC_GROUP - Cross-domain move of non-empty basic application groups is not allowed. -. - -MessageId=8609 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_CANT_MOVE_APP_QUERY_GROUP -Language=Bulgarian -ERROR_DS_CANT_MOVE_APP_QUERY_GROUP - Cross-domain move on non-empty query based application groups is not allowed. -. - -MessageId=8610 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_ROLE_NOT_VERIFIED -Language=Bulgarian -ERROR_DS_ROLE_NOT_VERIFIED - The role owner could not be verified because replication of its partition has not occurred recently. -. - -MessageId=8611 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL -Language=Bulgarian -ERROR_DS_WKO_CONTAINER_CANNOT_BE_SPECIAL - The target container for a redirection of a well-known object container cannot already be a special container. -. - -MessageId=8612 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DOMAIN_RENAME_IN_PROGRESS -Language=Bulgarian -ERROR_DS_DOMAIN_RENAME_IN_PROGRESS - The Directory Service cannot perform the requested operation because a domain rename operation is in progress. -. - -MessageId=8613 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_EXISTING_AD_CHILD_NC -Language=Bulgarian -ERROR_DS_EXISTING_AD_CHILD_NC - The Active Directory detected an Active Directory child partition below the requested new partition name. The Active Directory's partition hierarchy must be created in a top-down method. -. - -MessageId=8614 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_REPL_LIFETIME_EXCEEDED -Language=Bulgarian -ERROR_DS_REPL_LIFETIME_EXCEEDED - The Active Directory cannot replicate with this server because the time since the last replication with this server has exceeded the tombstone lifetime. -. - -MessageId=8615 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER -Language=Bulgarian -ERROR_DS_DISALLOWED_IN_SYSTEM_CONTAINER - The requested operation is not allowed on an object under the system container. -. - -MessageId=8616 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_LDAP_SEND_QUEUE_FULL -Language=Bulgarian -ERROR_DS_LDAP_SEND_QUEUE_FULL - The LDAP servers network send queue has filled up because the client is not processing the results of it's requests fast enough. No more requests will be processed until the client catches up. If the client does not catch up then it will be disconnected. -. - -MessageId=8617 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_DRA_OUT_SCHEDULE_WINDOW -Language=Bulgarian -ERROR_DS_DRA_OUT_SCHEDULE_WINDOW - The scheduled replication did not take place because the system was too busy to execute the request within the schedule window. The replication queue is overloaded. Consider reducing the number of partners or decreasing the scheduled replication frequency. -. - -MessageId=9001 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_FORMAT_ERROR -Language=Bulgarian -DNS_ERROR_RCODE_FORMAT_ERROR - DNS server unable to interpret format. -. - -MessageId=9002 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_SERVER_FAILURE -Language=Bulgarian -DNS_ERROR_RCODE_SERVER_FAILURE - DNS server failure. -. - -MessageId=9003 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_NAME_ERROR -Language=Bulgarian -DNS_ERROR_RCODE_NAME_ERROR - DNS name does not exist. -. - -MessageId=9004 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_NOT_IMPLEMENTED -Language=Bulgarian -DNS_ERROR_RCODE_NOT_IMPLEMENTED - DNS request not supported by name server. -. - -MessageId=9005 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_REFUSED -Language=Bulgarian -DNS_ERROR_RCODE_REFUSED - DNS operation refused. -. - -MessageId=9006 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_YXDOMAIN -Language=Bulgarian -DNS_ERROR_RCODE_YXDOMAIN - DNS name that ought not exist, does exist. -. - -MessageId=9007 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_YXRRSET -Language=Bulgarian -DNS_ERROR_RCODE_YXRRSET - DNS RR set that ought not exist, does exist. -. - -MessageId=9008 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_NXRRSET -Language=Bulgarian -DNS_ERROR_RCODE_NXRRSET - DNS RR set that ought to exist, does not exist. -. - -MessageId=9009 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_NOTAUTH -Language=Bulgarian -DNS_ERROR_RCODE_NOTAUTH - DNS server not authoritative for zone. -. - -MessageId=9010 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_NOTZONE -Language=Bulgarian -DNS_ERROR_RCODE_NOTZONE - DNS name in update or prereq is not in zone. -. - -MessageId=9016 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_BADSIG -Language=Bulgarian -DNS_ERROR_RCODE_BADSIG - DNS signature failed to verify. -. - -MessageId=9017 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_BADKEY -Language=Bulgarian -DNS_ERROR_RCODE_BADKEY - DNS bad key. -. - -MessageId=9018 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE_BADTIME -Language=Bulgarian -DNS_ERROR_RCODE_BADTIME - DNS signature validity expired. -. - -MessageId=9501 -Severity=Success -Facility=System -SymbolicName=DNS_INFO_NO_RECORDS -Language=Bulgarian -DNS_INFO_NO_RECORDS - No records found for given DNS query. -. - -MessageId=9502 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_BAD_PACKET -Language=Bulgarian -DNS_ERROR_BAD_PACKET - Bad DNS packet. -. - -MessageId=9503 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_PACKET -Language=Bulgarian -DNS_ERROR_NO_PACKET - No DNS packet. -. - -MessageId=9504 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RCODE -Language=Bulgarian -DNS_ERROR_RCODE - DNS error, check rcode. -. - -MessageId=9505 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_UNSECURE_PACKET -Language=Bulgarian -DNS_ERROR_UNSECURE_PACKET - Unsecured DNS packet. -. - -MessageId=9551 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_TYPE -Language=Bulgarian -DNS_ERROR_INVALID_TYPE - Invalid DNS type. -. - -MessageId=9552 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_IP_ADDRESS -Language=Bulgarian -DNS_ERROR_INVALID_IP_ADDRESS - Invalid IP address. -. - -MessageId=9553 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_PROPERTY -Language=Bulgarian -DNS_ERROR_INVALID_PROPERTY - Invalid property. -. - -MessageId=9554 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_TRY_AGAIN_LATER -Language=Bulgarian -DNS_ERROR_TRY_AGAIN_LATER - Try DNS operation again later. -. - -MessageId=9555 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NOT_UNIQUE -Language=Bulgarian -DNS_ERROR_NOT_UNIQUE - Record for given name and type is not unique. -. - -MessageId=9556 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NON_RFC_NAME -Language=Bulgarian -DNS_ERROR_NON_RFC_NAME - DNS name does not comply with RFC specifications. -. - -MessageId=9557 -Severity=Success -Facility=System -SymbolicName=DNS_STATUS_FQDN -Language=Bulgarian -DNS_STATUS_FQDN - DNS name is a fully-qualified DNS name. -. - -MessageId=9558 -Severity=Success -Facility=System -SymbolicName=DNS_STATUS_DOTTED_NAME -Language=Bulgarian -DNS_STATUS_DOTTED_NAME - DNS name is dotted (multi-label). -. - -MessageId=9559 -Severity=Success -Facility=System -SymbolicName=DNS_STATUS_SINGLE_PART_NAME -Language=Bulgarian -DNS_STATUS_SINGLE_PART_NAME - DNS name is a single-part name. -. - -MessageId=9560 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_NAME_CHAR -Language=Bulgarian -DNS_ERROR_INVALID_NAME_CHAR - DSN name contains an invalid character. -. - -MessageId=9561 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NUMERIC_NAME -Language=Bulgarian -DNS_ERROR_NUMERIC_NAME - DNS name is entirely numeric. -. - -MessageId=9562 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER -Language=Bulgarian -DNS_ERROR_NOT_ALLOWED_ON_ROOT_SERVER - The operation requested is not permitted on a DNS root server. -. - -MessageId=9563 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION -Language=Bulgarian -DNS_ERROR_NOT_ALLOWED_UNDER_DELEGATION - The record could not be created because this part of the DNS namespace has been delegated to another server. -. - -MessageId=9564 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_CANNOT_FIND_ROOT_HINTS -Language=Bulgarian -DNS_ERROR_CANNOT_FIND_ROOT_HINTS - The DNS server could not find a set of root hints. -. - -MessageId=9565 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INCONSISTENT_ROOT_HINTS -Language=Bulgarian -DNS_ERROR_INCONSISTENT_ROOT_HINTS - The DNS server found root hints but they were not consistent across all adapters. -. - -MessageId=9601 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_DOES_NOT_EXIST -Language=Bulgarian -DNS_ERROR_ZONE_DOES_NOT_EXIST - DNS zone does not exist. -. - -MessageId=9602 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_ZONE_INFO -Language=Bulgarian -DNS_ERROR_NO_ZONE_INFO - DNS zone information not available. -. - -MessageId=9603 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_ZONE_OPERATION -Language=Bulgarian -DNS_ERROR_INVALID_ZONE_OPERATION - Invalid operation for DNS zone. -. - -MessageId=9604 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_CONFIGURATION_ERROR -Language=Bulgarian -DNS_ERROR_ZONE_CONFIGURATION_ERROR - Invalid DNS zone configuration. -. - -MessageId=9605 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_HAS_NO_SOA_RECORD -Language=Bulgarian -DNS_ERROR_ZONE_HAS_NO_SOA_RECORD - DNS zone has no start of authority (SOA) record. -. - -MessageId=9606 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_HAS_NO_NS_RECORDS -Language=Bulgarian -DNS_ERROR_ZONE_HAS_NO_NS_RECORDS - DNS zone has no name server (NS) record. -. - -MessageId=9607 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_LOCKED -Language=Bulgarian -DNS_ERROR_ZONE_LOCKED - DNS zone is locked. -. - -MessageId=9608 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_CREATION_FAILED -Language=Bulgarian -DNS_ERROR_ZONE_CREATION_FAILED - DNS zone creation failed. -. - -MessageId=9609 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_ZONE_ALREADY_EXISTS - DNS zone already exists. -. - -MessageId=9610 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_AUTOZONE_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_AUTOZONE_ALREADY_EXISTS - DNS automatic zone already exists. -. - -MessageId=9611 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_ZONE_TYPE -Language=Bulgarian -DNS_ERROR_INVALID_ZONE_TYPE - Invalid DNS zone type. -. - -MessageId=9612 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP -Language=Bulgarian -DNS_ERROR_SECONDARY_REQUIRES_MASTER_IP - Secondary DNS zone requires master IP address. -. - -MessageId=9613 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_NOT_SECONDARY -Language=Bulgarian -DNS_ERROR_ZONE_NOT_SECONDARY - DNS zone not secondary. -. - -MessageId=9614 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NEED_SECONDARY_ADDRESSES -Language=Bulgarian -DNS_ERROR_NEED_SECONDARY_ADDRESSES - Need secondary IP address. -. - -MessageId=9615 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_WINS_INIT_FAILED -Language=Bulgarian -DNS_ERROR_WINS_INIT_FAILED - WINS initialization failed. -. - -MessageId=9616 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NEED_WINS_SERVERS -Language=Bulgarian -DNS_ERROR_NEED_WINS_SERVERS - Need WINS servers. -. - -MessageId=9617 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NBSTAT_INIT_FAILED -Language=Bulgarian -DNS_ERROR_NBSTAT_INIT_FAILED - NBTSTAT initialization call failed. -. - -MessageId=9618 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_SOA_DELETE_INVALID -Language=Bulgarian -DNS_ERROR_SOA_DELETE_INVALID - Invalid delete of start of authority (SOA) -. - -MessageId=9619 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_FORWARDER_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_FORWARDER_ALREADY_EXISTS - A conditional forwarding zone already exists for that name. -. - -MessageId=9620 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_REQUIRES_MASTER_IP -Language=Bulgarian -DNS_ERROR_ZONE_REQUIRES_MASTER_IP - This zone must be configured with one or more master DNS server IP addresses. -. - -MessageId=9621 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_ZONE_IS_SHUTDOWN -Language=Bulgarian -DNS_ERROR_ZONE_IS_SHUTDOWN - The operation cannot be performed because this zone is shutdown. -. - -MessageId=9651 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_PRIMARY_REQUIRES_DATAFILE -Language=Bulgarian -DNS_ERROR_PRIMARY_REQUIRES_DATAFILE - Primary DNS zone requires datafile. -. - -MessageId=9652 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_INVALID_DATAFILE_NAME -Language=Bulgarian -DNS_ERROR_INVALID_DATAFILE_NAME - Invalid datafile name for DNS zone. -. - -MessageId=9653 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DATAFILE_OPEN_FAILURE -Language=Bulgarian -DNS_ERROR_DATAFILE_OPEN_FAILURE - Failed to open datafile for DNS zone. -. - -MessageId=9654 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_FILE_WRITEBACK_FAILED -Language=Bulgarian -DNS_ERROR_FILE_WRITEBACK_FAILED - Failed to write datafile for DNS zone. -. - -MessageId=9655 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DATAFILE_PARSING -Language=Bulgarian -DNS_ERROR_DATAFILE_PARSING - Failure while reading datafile for DNS zone. -. - -MessageId=9701 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RECORD_DOES_NOT_EXIST -Language=Bulgarian -DNS_ERROR_RECORD_DOES_NOT_EXIST - DNS record does not exist. -. - -MessageId=9702 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RECORD_FORMAT -Language=Bulgarian -DNS_ERROR_RECORD_FORMAT - DNS record format error. -. - -MessageId=9703 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NODE_CREATION_FAILED -Language=Bulgarian -DNS_ERROR_NODE_CREATION_FAILED - Node creation failure in DNS. -. - -MessageId=9704 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_UNKNOWN_RECORD_TYPE -Language=Bulgarian -DNS_ERROR_UNKNOWN_RECORD_TYPE - Unknown DNS record type. -. - -MessageId=9705 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RECORD_TIMED_OUT -Language=Bulgarian -DNS_ERROR_RECORD_TIMED_OUT - DNS record timed out. -. - -MessageId=9706 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NAME_NOT_IN_ZONE -Language=Bulgarian -DNS_ERROR_NAME_NOT_IN_ZONE - Name not in DNS zone. -. - -MessageId=9707 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_CNAME_LOOP -Language=Bulgarian -DNS_ERROR_CNAME_LOOP - CNAME loop detected. -. - -MessageId=9708 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NODE_IS_CNAME -Language=Bulgarian -DNS_ERROR_NODE_IS_CNAME - Node is a CNAME DNS record. -. - -MessageId=9709 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_CNAME_COLLISION -Language=Bulgarian -DNS_ERROR_CNAME_COLLISION - A CNAME record already exists for given name. -. - -MessageId=9710 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT -Language=Bulgarian -DNS_ERROR_RECORD_ONLY_AT_ZONE_ROOT - Record only at DNS zone root. -. - -MessageId=9711 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_RECORD_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_RECORD_ALREADY_EXISTS - DNS record already exists. -. - -MessageId=9712 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_SECONDARY_DATA -Language=Bulgarian -DNS_ERROR_SECONDARY_DATA - Secondary DNS zone data error. -. - -MessageId=9713 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_CREATE_CACHE_DATA -Language=Bulgarian -DNS_ERROR_NO_CREATE_CACHE_DATA - Could not create DNS cache data. -. - -MessageId=9714 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NAME_DOES_NOT_EXIST -Language=Bulgarian -DNS_ERROR_NAME_DOES_NOT_EXIST - DNS name does not exist. -. - -MessageId=9715 -Severity=Success -Facility=System -SymbolicName=DNS_WARNING_PTR_CREATE_FAILED -Language=Bulgarian -DNS_WARNING_PTR_CREATE_FAILED - Could not create pointer (PTR) record. -. - -MessageId=9716 -Severity=Success -Facility=System -SymbolicName=DNS_WARNING_DOMAIN_UNDELETED -Language=Bulgarian -DNS_WARNING_DOMAIN_UNDELETED - DNS domain was undeleted. -. - -MessageId=9717 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DS_UNAVAILABLE -Language=Bulgarian -DNS_ERROR_DS_UNAVAILABLE - The directory service is unavailable. -. - -MessageId=9718 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DS_ZONE_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_DS_ZONE_ALREADY_EXISTS - DNS zone already exists in the directory service. -. - -MessageId=9719 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE -Language=Bulgarian -DNS_ERROR_NO_BOOTFILE_IF_DS_ZONE - DNS server not creating or reading the boot file for the directory service integrated DNS zone. -. - -MessageId=9751 -Severity=Success -Facility=System -SymbolicName=DNS_INFO_AXFR_COMPLETE -Language=Bulgarian -DNS_INFO_AXFR_COMPLETE - DNS AXFR (zone transfer) complete. -. - -MessageId=9752 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_AXFR -Language=Bulgarian -DNS_ERROR_AXFR - DNS zone transfer failed. -. - -MessageId=9753 -Severity=Success -Facility=System -SymbolicName=DNS_INFO_ADDED_LOCAL_WINS -Language=Bulgarian -DNS_INFO_ADDED_LOCAL_WINS - Added local WINS server. -. - -MessageId=9801 -Severity=Success -Facility=System -SymbolicName=DNS_STATUS_CONTINUE_NEEDED -Language=Bulgarian -DNS_STATUS_CONTINUE_NEEDED - Secure update call needs to continue update request. -. - -MessageId=9851 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_TCPIP -Language=Bulgarian -DNS_ERROR_NO_TCPIP - TCP/IP network protocol not installed. -. - -MessageId=9852 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_NO_DNS_SERVERS -Language=Bulgarian -DNS_ERROR_NO_DNS_SERVERS - No DNS servers configured for local system. -. - -MessageId=9901 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_DOES_NOT_EXIST -Language=Bulgarian -DNS_ERROR_DP_DOES_NOT_EXIST - The specified directory partition does not exist. -. - -MessageId=9902 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_ALREADY_EXISTS -Language=Bulgarian -DNS_ERROR_DP_ALREADY_EXISTS - The specified directory partition already exists. -. - -MessageId=9903 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_NOT_ENLISTED -Language=Bulgarian -DNS_ERROR_DP_NOT_ENLISTED - The DNS server is not enlisted in the specified directory partition. -. - -MessageId=9904 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_ALREADY_ENLISTED -Language=Bulgarian -DNS_ERROR_DP_ALREADY_ENLISTED - The DNS server is already enlisted in the specified directory partition. -. - -MessageId=9905 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_NOT_AVAILABLE -Language=Bulgarian -DNS_ERROR_DP_NOT_AVAILABLE - The directory partition is not available at this time. Please wait a few minutes and try again. -. - -MessageId=9906 -Severity=Success -Facility=System -SymbolicName=DNS_ERROR_DP_FSMO_ERROR -Language=Bulgarian -DNS_ERROR_DP_FSMO_ERROR - The application directory partition operation failed. The domain controller holding the domain naming master role is down or unable to service the request or is not running Windows Server 2003. -. - -MessageId=10004 -Severity=Success -Facility=System -SymbolicName=WSAEINTR -Language=Bulgarian -WSAEINTR - A blocking operation was interrupted by a call to WSACancelBlockingCall. -. - -MessageId=10009 -Severity=Success -Facility=System -SymbolicName=WSAEBADF -Language=Bulgarian -WSAEBADF - The file handle supplied is not valid. -. - -MessageId=10013 -Severity=Success -Facility=System -SymbolicName=WSAEACCES -Language=Bulgarian -WSAEACCES - An attempt was made to access a socket in a way forbidden by its access permissions. -. - -MessageId=10014 -Severity=Success -Facility=System -SymbolicName=WSAEFAULT -Language=Bulgarian -WSAEFAULT - The system detected an invalid pointer address in attempting to use a pointer argument in a call. -. - -MessageId=10022 -Severity=Success -Facility=System -SymbolicName=WSAEINVAL -Language=Bulgarian -WSAEINVAL - An invalid argument was supplied. -. - -MessageId=10024 -Severity=Success -Facility=System -SymbolicName=WSAEMFILE -Language=Bulgarian -WSAEMFILE - Too many open sockets. -. - -MessageId=10035 -Severity=Success -Facility=System -SymbolicName=WSAEWOULDBLOCK -Language=Bulgarian -WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately. -. - -MessageId=10036 -Severity=Success -Facility=System -SymbolicName=WSAEINPROGRESS -Language=Bulgarian -WSAEINPROGRESS - A blocking operation is currently executing. -. - -MessageId=10037 -Severity=Success -Facility=System -SymbolicName=WSAEALREADY -Language=Bulgarian -WSAEALREADY - An operation was attempted on a non-blocking socket that already had an operation in progress. -. - -MessageId=10038 -Severity=Success -Facility=System -SymbolicName=WSAENOTSOCK -Language=Bulgarian -WSAENOTSOCK - An operation was attempted on something that is not a socket. -. - -MessageId=10039 -Severity=Success -Facility=System -SymbolicName=WSAEDESTADDRREQ -Language=Bulgarian -WSAEDESTADDRREQ - A required address was omitted from an operation on a socket. -. - -MessageId=10040 -Severity=Success -Facility=System -SymbolicName=WSAEMSGSIZE -Language=Bulgarian -WSAEMSGSIZE - A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself. -. - -MessageId=10041 -Severity=Success -Facility=System -SymbolicName=WSAEPROTOTYPE -Language=Bulgarian -WSAEPROTOTYPE - A protocol was specified in the socket function call that does not support the semantics of the socket type requested. -. - -MessageId=10042 -Severity=Success -Facility=System -SymbolicName=WSAENOPROTOOPT -Language=Bulgarian -WSAENOPROTOOPT - An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call. -. - -MessageId=10043 -Severity=Success -Facility=System -SymbolicName=WSAEPROTONOSUPPORT -Language=Bulgarian -WSAEPROTONOSUPPORT - The requested protocol has not been configured into the system, or no implementation for it exists. -. - -MessageId=10044 -Severity=Success -Facility=System -SymbolicName=WSAESOCKTNOSUPPORT -Language=Bulgarian -WSAESOCKTNOSUPPORT - The support for the specified socket type does not exist in this address family. -. - -MessageId=10045 -Severity=Success -Facility=System -SymbolicName=WSAEOPNOTSUPP -Language=Bulgarian -WSAEOPNOTSUPP - The attempted operation is not supported for the type of object referenced. -. - -MessageId=10046 -Severity=Success -Facility=System -SymbolicName=WSAEPFNOSUPPORT -Language=Bulgarian -WSAEPFNOSUPPORT - The protocol family has not been configured into the system or no implementation for it exists. -. - -MessageId=10047 -Severity=Success -Facility=System -SymbolicName=WSAEAFNOSUPPORT -Language=Bulgarian -WSAEAFNOSUPPORT - An address incompatible with the requested protocol was used. -. - -MessageId=10048 -Severity=Success -Facility=System -SymbolicName=WSAEADDRINUSE -Language=Bulgarian -WSAEADDRINUSE - Only one usage of each socket address (protocol/network address/port) is normally permitted. -. - -MessageId=10049 -Severity=Success -Facility=System -SymbolicName=WSAEADDRNOTAVAIL -Language=Bulgarian -WSAEADDRNOTAVAIL - The requested address is not valid in its context. -. - -MessageId=10050 -Severity=Success -Facility=System -SymbolicName=WSAENETDOWN -Language=Bulgarian -WSAENETDOWN - A socket operation encountered a dead network. -. - -MessageId=10051 -Severity=Success -Facility=System -SymbolicName=WSAENETUNREACH -Language=Bulgarian -WSAENETUNREACH - A socket operation was attempted to an unreachable network. -. - -MessageId=10052 -Severity=Success -Facility=System -SymbolicName=WSAENETRESET -Language=Bulgarian -WSAENETRESET - The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. -. - -MessageId=10053 -Severity=Success -Facility=System -SymbolicName=WSAECONNABORTED -Language=Bulgarian -WSAECONNABORTED - An established connection was aborted by the software in your host machine. -. - -MessageId=10054 -Severity=Success -Facility=System -SymbolicName=WSAECONNRESET -Language=Bulgarian -WSAECONNRESET - An existing connection was forcibly closed by the remote host. -. - -MessageId=10055 -Severity=Success -Facility=System -SymbolicName=WSAENOBUFS -Language=Bulgarian -WSAENOBUFS - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. -. - -MessageId=10056 -Severity=Success -Facility=System -SymbolicName=WSAEISCONN -Language=Bulgarian -WSAEISCONN - A connect request was made on an already connected socket. -. - -MessageId=10057 -Severity=Success -Facility=System -SymbolicName=WSAENOTCONN -Language=Bulgarian -WSAENOTCONN - A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied. -. - -MessageId=10058 -Severity=Success -Facility=System -SymbolicName=WSAESHUTDOWN -Language=Bulgarian -WSAESHUTDOWN - A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. -. - -MessageId=10059 -Severity=Success -Facility=System -SymbolicName=WSAETOOMANYREFS -Language=Bulgarian -WSAETOOMANYREFS - Too many references to some kernel object. -. - -MessageId=10060 -Severity=Success -Facility=System -SymbolicName=WSAETIMEDOUT -Language=Bulgarian -WSAETIMEDOUT - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. -. - -MessageId=10061 -Severity=Success -Facility=System -SymbolicName=WSAECONNREFUSED -Language=Bulgarian -WSAECONNREFUSED - No connection could be made because the target machine actively refused it. -. - -MessageId=10062 -Severity=Success -Facility=System -SymbolicName=WSAELOOP -Language=Bulgarian -WSAELOOP - Cannot translate name. -. - -MessageId=10063 -Severity=Success -Facility=System -SymbolicName=WSAENAMETOOLONG -Language=Bulgarian -WSAENAMETOOLONG - Name component or name was too long. -. - -MessageId=10064 -Severity=Success -Facility=System -SymbolicName=WSAEHOSTDOWN -Language=Bulgarian -WSAEHOSTDOWN - A socket operation failed because the destination host was down. -. - -MessageId=10065 -Severity=Success -Facility=System -SymbolicName=WSAEHOSTUNREACH -Language=Bulgarian -WSAEHOSTUNREACH - A socket operation was attempted to an unreachable host. -. - -MessageId=10066 -Severity=Success -Facility=System -SymbolicName=WSAENOTEMPTY -Language=Bulgarian -WSAENOTEMPTY - Cannot remove a directory that is not empty. -. - -MessageId=10067 -Severity=Success -Facility=System -SymbolicName=WSAEPROCLIM -Language=Bulgarian -WSAEPROCLIM - A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously. -. - -MessageId=10068 -Severity=Success -Facility=System -SymbolicName=WSAEUSERS -Language=Bulgarian -WSAEUSERS - Ran out of quota. -. - -MessageId=10069 -Severity=Success -Facility=System -SymbolicName=WSAEDQUOT -Language=Bulgarian -WSAEDQUOT - Ran out of disk quota. -. - -MessageId=10070 -Severity=Success -Facility=System -SymbolicName=WSAESTALE -Language=Bulgarian -WSAESTALE - File handle reference is no longer available. -. - -MessageId=10071 -Severity=Success -Facility=System -SymbolicName=WSAEREMOTE -Language=Bulgarian -WSAEREMOTE - Item is not available locally. -. - -MessageId=10091 -Severity=Success -Facility=System -SymbolicName=WSASYSNOTREADY -Language=Bulgarian -WSASYSNOTREADY - WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable. -. - -MessageId=10092 -Severity=Success -Facility=System -SymbolicName=WSAVERNOTSUPPORTED -Language=Bulgarian -WSAVERNOTSUPPORTED - The Windows Sockets version requested is not supported. -. - -MessageId=10093 -Severity=Success -Facility=System -SymbolicName=WSANOTINITIALISED -Language=Bulgarian -WSANOTINITIALISED - Either the application has not called WSAStartup, or WSAStartup failed. -. - -MessageId=10101 -Severity=Success -Facility=System -SymbolicName=WSAEDISCON -Language=Bulgarian -WSAEDISCON - Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence. -. - -MessageId=10102 -Severity=Success -Facility=System -SymbolicName=WSAENOMORE -Language=Bulgarian -WSAENOMORE - No more results can be returned by WSALookupServiceNext. -. - -MessageId=10103 -Severity=Success -Facility=System -SymbolicName=WSAECANCELLED -Language=Bulgarian -WSAECANCELLED - A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. -. - -MessageId=10104 -Severity=Success -Facility=System -SymbolicName=WSAEINVALIDPROCTABLE -Language=Bulgarian -WSAEINVALIDPROCTABLE - The procedure call table is invalid. -. - -MessageId=10105 -Severity=Success -Facility=System -SymbolicName=WSAEINVALIDPROVIDER -Language=Bulgarian -WSAEINVALIDPROVIDER - The requested service provider is invalid. -. - -MessageId=10106 -Severity=Success -Facility=System -SymbolicName=WSAEPROVIDERFAILEDINIT -Language=Bulgarian -WSAEPROVIDERFAILEDINIT - The requested service provider could not be loaded or initialized. -. - -MessageId=10107 -Severity=Success -Facility=System -SymbolicName=WSASYSCALLFAILURE -Language=Bulgarian -WSASYSCALLFAILURE - A system call that should never fail has failed. -. - -MessageId=10108 -Severity=Success -Facility=System -SymbolicName=WSASERVICE_NOT_FOUND -Language=Bulgarian -WSASERVICE_NOT_FOUND - No such service is known. The service cannot be found in the specified name space. -. - -MessageId=10109 -Severity=Success -Facility=System -SymbolicName=WSATYPE_NOT_FOUND -Language=Bulgarian -WSATYPE_NOT_FOUND - The specified class was not found. -. - -MessageId=10110 -Severity=Success -Facility=System -SymbolicName=WSA_E_NO_MORE -Language=Bulgarian -WSA_E_NO_MORE - No more results can be returned by WSALookupServiceNext. -. - -MessageId=10111 -Severity=Success -Facility=System -SymbolicName=WSA_E_CANCELLED -Language=Bulgarian -WSA_E_CANCELLED - A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled. -. - -MessageId=10112 -Severity=Success -Facility=System -SymbolicName=WSAEREFUSED -Language=Bulgarian -WSAEREFUSED - A database query failed because it was actively refused. -. - -MessageId=11001 -Severity=Success -Facility=System -SymbolicName=WSAHOST_NOT_FOUND -Language=Bulgarian -WSAHOST_NOT_FOUND - No such host is known. -. - -MessageId=11002 -Severity=Success -Facility=System -SymbolicName=WSATRY_AGAIN -Language=Bulgarian -WSATRY_AGAIN - This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server. -. - -MessageId=11003 -Severity=Success -Facility=System -SymbolicName=WSANO_RECOVERY -Language=Bulgarian -WSANO_RECOVERY - A non-recoverable error occurred during a database lookup. -. - -MessageId=11004 -Severity=Success -Facility=System -SymbolicName=WSANO_DATA -Language=Bulgarian -WSANO_DATA - The requested name is valid, but no data of the requested type was found. -. - -MessageId=11005 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_RECEIVERS -Language=Bulgarian -WSA_QOS_RECEIVERS - At least one reserve has arrived. -. - -MessageId=11006 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_SENDERS -Language=Bulgarian -WSA_QOS_SENDERS - At least one path has arrived. -. - -MessageId=11007 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_NO_SENDERS -Language=Bulgarian -WSA_QOS_NO_SENDERS - There are no senders. -. - -MessageId=11008 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_NO_RECEIVERS -Language=Bulgarian -WSA_QOS_NO_RECEIVERS - There are no receivers. -. - -MessageId=11009 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_REQUEST_CONFIRMED -Language=Bulgarian -WSA_QOS_REQUEST_CONFIRMED - Reserve has been confirmed. -. - -MessageId=11010 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_ADMISSION_FAILURE -Language=Bulgarian -WSA_QOS_ADMISSION_FAILURE - Error due to lack of resources. -. - -MessageId=11011 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_POLICY_FAILURE -Language=Bulgarian -WSA_QOS_POLICY_FAILURE - Rejected for administrative reasons - bad credentials. -. - -MessageId=11012 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_BAD_STYLE -Language=Bulgarian -WSA_QOS_BAD_STYLE - Unknown or conflicting style. -. - -MessageId=11013 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_BAD_OBJECT -Language=Bulgarian -WSA_QOS_BAD_OBJECT - Problem with some part of the filterspec or providerspecific buffer in general. -. - -MessageId=11014 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_TRAFFIC_CTRL_ERROR -Language=Bulgarian -WSA_QOS_TRAFFIC_CTRL_ERROR - Problem with some part of the flowspec. -. - -MessageId=11015 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_GENERIC_ERROR -Language=Bulgarian -WSA_QOS_GENERIC_ERROR - General QOS error. -. - -MessageId=11016 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_ESERVICETYPE -Language=Bulgarian -WSA_QOS_ESERVICETYPE - An invalid or unrecognized service type was found in the flowspec. -. - -MessageId=11017 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFLOWSPEC -Language=Bulgarian -WSA_QOS_EFLOWSPEC - An invalid or inconsistent flowspec was found in the QOS structure. -. - -MessageId=11018 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EPROVSPECBUF -Language=Bulgarian -WSA_QOS_EPROVSPECBUF - Invalid QOS provider-specific buffer. -. - -MessageId=11019 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFILTERSTYLE -Language=Bulgarian -WSA_QOS_EFILTERSTYLE - An invalid QOS filter style was used. -. - -MessageId=11020 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFILTERTYPE -Language=Bulgarian -WSA_QOS_EFILTERTYPE - An invalid QOS filter type was used. -. - -MessageId=11021 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFILTERCOUNT -Language=Bulgarian -WSA_QOS_EFILTERCOUNT - An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR. -. - -MessageId=11022 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EOBJLENGTH -Language=Bulgarian -WSA_QOS_EOBJLENGTH - An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer. -. - -MessageId=11023 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFLOWCOUNT -Language=Bulgarian -WSA_QOS_EFLOWCOUNT - An incorrect number of flow descriptors was specified in the QOS structure. -. - -MessageId=11024 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EUNKNOWNPSOBJ -Language=Bulgarian -WSA_QOS_EUNKNOWNPSOBJ - An unrecognized object was found in the QOS provider-specific buffer. -. - -MessageId=11025 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EPOLICYOBJ -Language=Bulgarian -WSA_QOS_EPOLICYOBJ - An invalid policy object was found in the QOS provider-specific buffer. -. - -MessageId=11026 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EFLOWDESC -Language=Bulgarian -WSA_QOS_EFLOWDESC - An invalid QOS flow descriptor was found in the flow descriptor list. -. - -MessageId=11027 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EPSFLOWSPEC -Language=Bulgarian -WSA_QOS_EPSFLOWSPEC - An invalid or inconsistent flowspec was found in the QOS provider-specific buffer. -. - -MessageId=11028 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_EPSFILTERSPEC -Language=Bulgarian -WSA_QOS_EPSFILTERSPEC - An invalid FILTERSPEC was found in the QOS provider-specific buffer. -. - -MessageId=11029 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_ESDMODEOBJ -Language=Bulgarian -WSA_QOS_ESDMODEOBJ - An invalid shape discard mode object was found in the QOS provider-specific buffer. -. - -MessageId=11030 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_ESHAPERATEOBJ -Language=Bulgarian -WSA_QOS_ESHAPERATEOBJ - An invalid shaping rate object was found in the QOS provider-specific buffer. -. - -MessageId=11031 -Severity=Success -Facility=System -SymbolicName=WSA_QOS_RESERVED_PETYPE -Language=Bulgarian -WSA_QOS_RESERVED_PETYPE - A reserved policy element was found in the QOS provider-specific buffer. -. - -MessageId=12000 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_IO_COMPLETE -Language=Bulgarian -ERROR_FLT_IO_COMPLETE - The IO was completed by a filter. -. - -MessageId=12001 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_BUFFER_TOO_SMALL -Language=Bulgarian -ERROR_FLT_BUFFER_TOO_SMALL - The buffer is too small to contain the entry. No information has been written to the buffer. -. - -MessageId=12002 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NO_HANDLER_DEFINED -Language=Bulgarian -ERROR_FLT_NO_HANDLER_DEFINED - A handler was not defined by the filter for this operation. -. - -MessageId=12003 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_CONTEXT_ALREADY_DEFINED -Language=Bulgarian -ERROR_FLT_CONTEXT_ALREADY_DEFINED - A context is already defined for this object. -. - -MessageId=12004 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST -Language=Bulgarian -ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST - Asynchronous requests are not valid for this operation. -. - -MessageId=12005 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_DISALLOW_FAST_IO -Language=Bulgarian -ERROR_FLT_DISALLOW_FAST_IO - Disallow the Fast IO path for this operation. -. - -MessageId=12006 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INVALID_NAME_REQUEST -Language=Bulgarian -ERROR_FLT_INVALID_NAME_REQUEST - An invalid name request was made. The name requested cannot be retrieved at this time. -. - -MessageId=12007 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NOT_SAFE_TO_POST_OPERATION -Language=Bulgarian -ERROR_FLT_NOT_SAFE_TO_POST_OPERATION - Posting this operation to a worker thread for further processing is not safe at this time because it could lead to a system deadlock. -. - -MessageId=12008 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NOT_INITIALIZED -Language=Bulgarian -ERROR_FLT_NOT_INITIALIZED - The Filter Manager was not initialized when a filter tried to register. Make sure that the Filter Manager is getting loaded as a driver. -. - -MessageId=12009 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_FILTER_NOT_READY -Language=Bulgarian -ERROR_FLT_FILTER_NOT_READY - The filter is not ready for attachment to volumes because it has not finished initializing (FltStartFiltering has not been called). -. - -MessageId=12010 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_POST_OPERATION_CLEANUP -Language=Bulgarian -ERROR_FLT_POST_OPERATION_CLEANUP - The filter must cleanup any operation specific context at this time because it is being removed from the system before the operation is completed by the lower drivers. -. - -MessageId=12011 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INTERNAL_ERROR -Language=Bulgarian -ERROR_FLT_INTERNAL_ERROR - The Filter Manager had an internal error from which it cannot recover, therefore the operation has been failed. This is usually the result of a filter returning an invalid value from a pre-operation callback. -. - -MessageId=12012 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_DELETING_OBJECT -Language=Bulgarian -ERROR_FLT_DELETING_OBJECT - The object specified for this action is in the process of being deleted, therefore the action requested cannot be completed at this time. -. - -MessageId=12013 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_MUST_BE_NONPAGED_POOL -Language=Bulgarian -ERROR_FLT_MUST_BE_NONPAGED_POOL - Non-paged pool must be used for this type of context. -. - -MessageId=12014 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_DUPLICATE_ENTRY -Language=Bulgarian -ERROR_FLT_DUPLICATE_ENTRY - A duplicate handler definition has been provided for an operation. -. - -MessageId=12015 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_CBDQ_DISABLED -Language=Bulgarian -ERROR_FLT_CBDQ_DISABLED - The callback data queue has been disabled. -. - -MessageId=12016 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_DO_NOT_ATTACH -Language=Bulgarian -ERROR_FLT_DO_NOT_ATTACH - Do not attach the filter to the volume at this time. -. - -MessageId=12017 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_DO_NOT_DETACH -Language=Bulgarian -ERROR_FLT_DO_NOT_DETACH - Do not detach the filter from the volume at this time. -. - -MessageId=12018 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INSTANCE_ALTITUDE_COLLISION -Language=Bulgarian -ERROR_FLT_INSTANCE_ALTITUDE_COLLISION - An instance already exists at this altitude on the volume specified. -. - -MessageId=12019 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INSTANCE_NAME_COLLISION -Language=Bulgarian -ERROR_FLT_INSTANCE_NAME_COLLISION - An instance already exists with this name on the volume specified. -. - -MessageId=12020 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_FILTER_NOT_FOUND -Language=Bulgarian -ERROR_FLT_FILTER_NOT_FOUND - The system could not find the filter specified. -. - -MessageId=12021 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_VOLUME_NOT_FOUND -Language=Bulgarian -ERROR_FLT_VOLUME_NOT_FOUND - The system could not find the volume specified. -. - -MessageId=12022 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INSTANCE_NOT_FOUND -Language=Bulgarian -ERROR_FLT_INSTANCE_NOT_FOUND - The system could not find the instance specified. -. - -MessageId=12023 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND -Language=Bulgarian -ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND - No registered context allocation definition was found for the given request. -. - -MessageId=12024 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_INVALID_CONTEXT_REGISTRATION -Language=Bulgarian -ERROR_FLT_INVALID_CONTEXT_REGISTRATION - An invalid parameter was specified during context registration. -. - -MessageId=12025 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NAME_CACHE_MISS -Language=Bulgarian -ERROR_FLT_NAME_CACHE_MISS - The name requested was not found in Filter Manager's name cache and could not be retrieved from the file system. -. - -MessageId=12026 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NO_DEVICE_OBJECT -Language=Bulgarian -ERROR_FLT_NO_DEVICE_OBJECT - The requested device object does not exist for the given volume. -. - -MessageId=12027 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_VOLUME_ALREADY_MOUNTED -Language=Bulgarian -ERROR_FLT_VOLUME_ALREADY_MOUNTED - The specified volume is already mounted. -. - -MessageId=12028 -Severity=Success -Facility=System -SymbolicName=ERROR_FLT_NO_WAITER_FOR_REPLY -Language=Bulgarian -ERROR_FLT_NO_WAITER_FOR_REPLY - No waiter is present for the filter's reply to this message. -. - -MessageId=13000 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_QM_POLICY_EXISTS -Language=Bulgarian -ERROR_IPSEC_QM_POLICY_EXISTS - The specified quick mode policy already exists. -. - -MessageId=13001 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_QM_POLICY_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_QM_POLICY_NOT_FOUND - The specified quick mode policy was not found. -. - -MessageId=13002 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_QM_POLICY_IN_USE -Language=Bulgarian -ERROR_IPSEC_QM_POLICY_IN_USE - The specified quick mode policy is being used. -. - -MessageId=13003 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_POLICY_EXISTS -Language=Bulgarian -ERROR_IPSEC_MM_POLICY_EXISTS - The specified main mode policy already exists. -. - -MessageId=13004 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_POLICY_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_MM_POLICY_NOT_FOUND - The specified main mode policy was not found. -. - -MessageId=13005 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_POLICY_IN_USE -Language=Bulgarian -ERROR_IPSEC_MM_POLICY_IN_USE - The specified main mode policy is being used. -. - -MessageId=13006 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_FILTER_EXISTS -Language=Bulgarian -ERROR_IPSEC_MM_FILTER_EXISTS - The specified main mode filter already exists. -. - -MessageId=13007 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_FILTER_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_MM_FILTER_NOT_FOUND - The specified main mode filter was not found. -. - -MessageId=13008 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_EXISTS -Language=Bulgarian -ERROR_IPSEC_TRANSPORT_FILTER_EXISTS - The specified transport mode filter already exists. -. - -MessageId=13009 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND - The specified transport mode filter does not exist. -. - -MessageId=13010 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_AUTH_EXISTS -Language=Bulgarian -ERROR_IPSEC_MM_AUTH_EXISTS - The specified main mode authentication list exists. -. - -MessageId=13011 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_AUTH_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_MM_AUTH_NOT_FOUND - The specified main mode authentication list was not found. -. - -MessageId=13012 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_AUTH_IN_USE -Language=Bulgarian -ERROR_IPSEC_MM_AUTH_IN_USE - The specified quick mode policy is being used. -. - -MessageId=13013 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND - The specified main mode policy was not found. -. - -MessageId=13014 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND - The specified quick mode policy was not found. -. - -MessageId=13015 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND - The manifest file contains one or more syntax errors. -. - -MessageId=13016 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_EXISTS -Language=Bulgarian -ERROR_IPSEC_TUNNEL_FILTER_EXISTS - The application attempted to activate a disabled activation context. -. - -MessageId=13017 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND -Language=Bulgarian -ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND - The requested lookup key was not found in any active activation context. -. - -MessageId=13018 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_FILTER_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_MM_FILTER_PENDING_DELETION - The Main Mode filter is pending deletion. -. - -MessageId=13019 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION - The transport filter is pending deletion. -. - -MessageId=13020 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION - The tunnel filter is pending deletion. -. - -MessageId=13021 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_POLICY_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_MM_POLICY_PENDING_DELETION - The Main Mode policy is pending deletion. -. - -MessageId=13022 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_MM_AUTH_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_MM_AUTH_PENDING_DELETION - The Main Mode authentication bundle is pending deletion. -. - -MessageId=13023 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_QM_POLICY_PENDING_DELETION -Language=Bulgarian -ERROR_IPSEC_QM_POLICY_PENDING_DELETION - The Quick Mode policy is pending deletion. -. - -MessageId=13024 -Severity=Success -Facility=System -SymbolicName=WARNING_IPSEC_MM_POLICY_PRUNED -Language=Bulgarian -WARNING_IPSEC_MM_POLICY_PRUNED - The Main Mode policy was successfully added, but some of the requested offers are not supported. -. - -MessageId=13025 -Severity=Success -Facility=System -SymbolicName=WARNING_IPSEC_QM_POLICY_PRUNED -Language=Bulgarian -WARNING_IPSEC_QM_POLICY_PRUNED - The Quick Mode policy was successfully added, but some of the requested offers are not supported. -. - -MessageId=13801 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_AUTH_FAIL -Language=Bulgarian -ERROR_IPSEC_IKE_AUTH_FAIL - IKE authentication credentials are unacceptable. -. - -MessageId=13802 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_ATTRIB_FAIL -Language=Bulgarian -ERROR_IPSEC_IKE_ATTRIB_FAIL - IKE security attributes are unacceptable. -. - -MessageId=13803 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NEGOTIATION_PENDING -Language=Bulgarian -ERROR_IPSEC_IKE_NEGOTIATION_PENDING - IKE Negotiation in progress. -. - -MessageId=13804 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR -Language=Bulgarian -ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR - General processing error. -. - -MessageId=13805 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_TIMED_OUT -Language=Bulgarian -ERROR_IPSEC_IKE_TIMED_OUT - Negotiation timed out. -. - -MessageId=13806 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_CERT -Language=Bulgarian -ERROR_IPSEC_IKE_NO_CERT - IKE failed to find valid machine certificate. -. - -MessageId=13807 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SA_DELETED -Language=Bulgarian -ERROR_IPSEC_IKE_SA_DELETED - IKE SA deleted by peer before establishment completed. -. - -MessageId=13808 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SA_REAPED -Language=Bulgarian -ERROR_IPSEC_IKE_SA_REAPED - IKE SA deleted before establishment completed. -. - -MessageId=13809 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_MM_ACQUIRE_DROP -Language=Bulgarian -ERROR_IPSEC_IKE_MM_ACQUIRE_DROP - Negotiation request sat in Queue too long. -. - -MessageId=13810 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_QM_ACQUIRE_DROP -Language=Bulgarian -ERROR_IPSEC_IKE_QM_ACQUIRE_DROP - Negotiation request sat in Queue too long. -. - -MessageId=13811 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_QUEUE_DROP_MM -Language=Bulgarian -ERROR_IPSEC_IKE_QUEUE_DROP_MM - Negotiation request sat in Queue too long. -. - -MessageId=13812 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM -Language=Bulgarian -ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM - Negotiation request sat in Queue too long. -. - -MessageId=13813 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_DROP_NO_RESPONSE -Language=Bulgarian -ERROR_IPSEC_IKE_DROP_NO_RESPONSE - No response from peer. -. - -MessageId=13814 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_MM_DELAY_DROP -Language=Bulgarian -ERROR_IPSEC_IKE_MM_DELAY_DROP - Negotiation took too long. -. - -MessageId=13815 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_QM_DELAY_DROP -Language=Bulgarian -ERROR_IPSEC_IKE_QM_DELAY_DROP - Negotiation took too long. -. - -MessageId=13816 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_ERROR -Language=Bulgarian -ERROR_IPSEC_IKE_ERROR - Unknown error occurred. -. - -MessageId=13817 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_CRL_FAILED -Language=Bulgarian -ERROR_IPSEC_IKE_CRL_FAILED - Certificate Revocation Check failed. -. - -MessageId=13818 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_KEY_USAGE -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_KEY_USAGE - Invalid certificate key usage. -. - -MessageId=13819 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_CERT_TYPE -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_CERT_TYPE - Invalid certificate type. -. - -MessageId=13820 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_PRIVATE_KEY -Language=Bulgarian -ERROR_IPSEC_IKE_NO_PRIVATE_KEY - No private key associated with machine certificate. -. - -MessageId=13822 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_DH_FAIL -Language=Bulgarian -ERROR_IPSEC_IKE_DH_FAIL - Failure in Diffie-Hellman computation. -. - -MessageId=13824 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_HEADER -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_HEADER - Invalid header. -. - -MessageId=13825 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_POLICY -Language=Bulgarian -ERROR_IPSEC_IKE_NO_POLICY - No policy configured. -. - -MessageId=13826 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_SIGNATURE -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_SIGNATURE - Failed to verify signature. -. - -MessageId=13827 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_KERBEROS_ERROR -Language=Bulgarian -ERROR_IPSEC_IKE_KERBEROS_ERROR - Failed to authenticate using Kerberos. -. - -MessageId=13828 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_PUBLIC_KEY -Language=Bulgarian -ERROR_IPSEC_IKE_NO_PUBLIC_KEY - Peer's certificate did not have a public key. -. - -MessageId=13829 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR - Error processing error payload. -. - -MessageId=13830 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_SA -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_SA - Error processing SA payload. -. - -MessageId=13831 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_PROP -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_PROP - Error processing Proposal payload. -. - -MessageId=13832 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_TRANS -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_TRANS - Error processing Transform payload. -. - -MessageId=13833 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_KE -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_KE - Error processing KE payload. -. - -MessageId=13834 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_ID -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_ID - Error processing ID payload. -. - -MessageId=13835 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_CERT -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_CERT - Error processing Cert payload. -. - -MessageId=13836 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ - Error processing Certificate Request payload. -. - -MessageId=13837 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_HASH -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_HASH - Error processing Hash payload. -. - -MessageId=13838 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_SIG -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_SIG - Error processing Signature payload. -. - -MessageId=13839 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_NONCE -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_NONCE - Error processing Nonce payload. -. - -MessageId=13840 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY - Error processing Notify payload. -. - -MessageId=13841 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_DELETE -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_DELETE - Error processing Delete Payload. -. - -MessageId=13842 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR -Language=Bulgarian -ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR - Error processing VendorId payload. -. - -MessageId=13843 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_PAYLOAD -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_PAYLOAD - Invalid payload received. -. - -MessageId=13844 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_LOAD_SOFT_SA -Language=Bulgarian -ERROR_IPSEC_IKE_LOAD_SOFT_SA - Soft SA loaded. -. - -MessageId=13845 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN -Language=Bulgarian -ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN - Soft SA torn down. -. - -MessageId=13846 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_COOKIE -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_COOKIE - Invalid cookie received.. -. - -MessageId=13847 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_PEER_CERT -Language=Bulgarian -ERROR_IPSEC_IKE_NO_PEER_CERT - Peer failed to send valid machine certificate. -. - -MessageId=13848 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_PEER_CRL_FAILED -Language=Bulgarian -ERROR_IPSEC_IKE_PEER_CRL_FAILED - Certification Revocation check of peer's certificate failed. -. - -MessageId=13849 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_POLICY_CHANGE -Language=Bulgarian -ERROR_IPSEC_IKE_POLICY_CHANGE - New policy invalidated SAs formed with old policy. -. - -MessageId=13850 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NO_MM_POLICY -Language=Bulgarian -ERROR_IPSEC_IKE_NO_MM_POLICY - There is no available Main Mode IKE policy. -. - -MessageId=13851 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NOTCBPRIV -Language=Bulgarian -ERROR_IPSEC_IKE_NOTCBPRIV - Failed to enabled TCB privilege. -. - -MessageId=13852 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SECLOADFAIL -Language=Bulgarian -ERROR_IPSEC_IKE_SECLOADFAIL - Failed to load SECURITY.DLL. -. - -MessageId=13853 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_FAILSSPINIT -Language=Bulgarian -ERROR_IPSEC_IKE_FAILSSPINIT - Failed to obtain security function table dispatch address from SSPI. -. - -MessageId=13854 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_FAILQUERYSSP -Language=Bulgarian -ERROR_IPSEC_IKE_FAILQUERYSSP - Failed to query Kerberos package to obtain max token size. -. - -MessageId=13855 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SRVACQFAIL -Language=Bulgarian -ERROR_IPSEC_IKE_SRVACQFAIL - Failed to obtain Kerberos server credentials for ISAKMP/ERROR_IPSEC_IKE service. Kerberos authentication will not function. The most likely reason for this is lack of domain membership. This is normal if your computer is a member of a workgroup. -. - -MessageId=13856 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_SRVQUERYCRED -Language=Bulgarian -ERROR_IPSEC_IKE_SRVQUERYCRED - Failed to determine SSPI principal name for ISAKMP/ERROR_IPSEC_IKE service (QueryCredentialsAttributes). -. - -MessageId=13857 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_GETSPIFAIL -Language=Bulgarian -ERROR_IPSEC_IKE_GETSPIFAIL - Failed to obtain new SPI for the inbound SA from IPSec driver. The most common cause for this is that the driver does not have the correct filter. Check your policy to verify the filters. -. - -MessageId=13858 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_FILTER -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_FILTER - Given filter is invalid. -. - -MessageId=13859 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_OUT_OF_MEMORY -Language=Bulgarian -ERROR_IPSEC_IKE_OUT_OF_MEMORY - Memory allocation failed. -. - -MessageId=13860 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED -Language=Bulgarian -ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED - Failed to add Security Association to IPSec Driver. The most common cause for this is if the IKE negotiation took too long to complete. If the problem persists, reduce the load on the faulting machine. -. - -MessageId=13861 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_POLICY -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_POLICY - Invalid policy. -. - -MessageId=13862 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_UNKNOWN_DOI -Language=Bulgarian -ERROR_IPSEC_IKE_UNKNOWN_DOI - Invalid DOI. -. - -MessageId=13863 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_SITUATION -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_SITUATION - Invalid situation. -. - -MessageId=13864 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_DH_FAILURE -Language=Bulgarian -ERROR_IPSEC_IKE_DH_FAILURE - Diffie-Hellman failure. -. - -MessageId=13865 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_GROUP -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_GROUP - Invalid Diffie-Hellman group. -. - -MessageId=13866 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_ENCRYPT -Language=Bulgarian -ERROR_IPSEC_IKE_ENCRYPT - Error encrypting payload. -. - -MessageId=13867 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_DECRYPT -Language=Bulgarian -ERROR_IPSEC_IKE_DECRYPT - Error decrypting payload. -. - -MessageId=13868 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_POLICY_MATCH -Language=Bulgarian -ERROR_IPSEC_IKE_POLICY_MATCH - Policy match error. -. - -MessageId=13869 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_UNSUPPORTED_ID -Language=Bulgarian -ERROR_IPSEC_IKE_UNSUPPORTED_ID - Unsupported ID. -. - -MessageId=13870 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_HASH - Hash verification failed. -. - -MessageId=13871 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH_ALG -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_HASH_ALG - Invalid hash algorithm. -. - -MessageId=13872 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_HASH_SIZE -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_HASH_SIZE - Invalid hash size. -. - -MessageId=13873 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG - Invalid encryption algorithm. -. - -MessageId=13874 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_AUTH_ALG -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_AUTH_ALG - Invalid authentication algorithm. -. - -MessageId=13875 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_SIG -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_SIG - Invalid certificate signature. -. - -MessageId=13876 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_LOAD_FAILED -Language=Bulgarian -ERROR_IPSEC_IKE_LOAD_FAILED - Load failed. -. - -MessageId=13877 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_RPC_DELETE -Language=Bulgarian -ERROR_IPSEC_IKE_RPC_DELETE - Deleted via RPC call. -. - -MessageId=13878 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_BENIGN_REINIT -Language=Bulgarian -ERROR_IPSEC_IKE_BENIGN_REINIT - Temporary state created to perform reinit. This is not a real failure. -. - -MessageId=13879 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY - The lifetime value received in the Responder Lifetime Notify is below the Windows 2000 configured minimum value. Please fix the policy on the peer machine. -. - -MessageId=13881 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN -Language=Bulgarian -ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN - Key length in certificate is too small for configured security requirements. -. - -MessageId=13882 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_MM_LIMIT -Language=Bulgarian -ERROR_IPSEC_IKE_MM_LIMIT - Max number of established MM SAs to peer exceeded. -. - -MessageId=13883 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NEGOTIATION_DISABLED -Language=Bulgarian -ERROR_IPSEC_IKE_NEGOTIATION_DISABLED - IKE received a policy that disables negotiation. -. - -MessageId=13884 -Severity=Success -Facility=System -SymbolicName=ERROR_IPSEC_IKE_NEG_STATUS_END -Language=Bulgarian -ERROR_IPSEC_IKE_NEG_STATUS_END - ERROR_IPSEC_IKE_NEG_STATUS_END -. - -MessageId=14000 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_SECTION_NOT_FOUND -Language=Bulgarian -ERROR_SXS_SECTION_NOT_FOUND - The requested section was not present in the activation context. -. - -MessageId=14001 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_CANT_GEN_ACTCTX -Language=Bulgarian -ERROR_SXS_CANT_GEN_ACTCTX - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. -. - -MessageId=14002 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_ACTCTXDATA_FORMAT -Language=Bulgarian -ERROR_SXS_INVALID_ACTCTXDATA_FORMAT - The application binding data format is invalid. -. - -MessageId=14003 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_ASSEMBLY_NOT_FOUND -Language=Bulgarian -ERROR_SXS_ASSEMBLY_NOT_FOUND - The referenced assembly is not installed on your system. -. - -MessageId=14004 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MANIFEST_FORMAT_ERROR -Language=Bulgarian -ERROR_SXS_MANIFEST_FORMAT_ERROR - The manifest file does not begin with the required tag and format information. -. - -MessageId=14005 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MANIFEST_PARSE_ERROR -Language=Bulgarian -ERROR_SXS_MANIFEST_PARSE_ERROR - The manifest file contains one or more syntax errors. -. - -MessageId=14006 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_ACTIVATION_CONTEXT_DISABLED -Language=Bulgarian -ERROR_SXS_ACTIVATION_CONTEXT_DISABLED - The application attempted to activate a disabled activation context. -. - -MessageId=14007 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_KEY_NOT_FOUND -Language=Bulgarian -ERROR_SXS_KEY_NOT_FOUND - The requested lookup key was not found in any active activation context. -. - -MessageId=14008 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_VERSION_CONFLICT -Language=Bulgarian -ERROR_SXS_VERSION_CONFLICT - A component version required by the application conflicts with another component version already active. -. - -MessageId=14009 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_WRONG_SECTION_TYPE -Language=Bulgarian -ERROR_SXS_WRONG_SECTION_TYPE - The type requested activation context section does not match the query API used. -. - -MessageId=14010 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_THREAD_QUERIES_DISABLED -Language=Bulgarian -ERROR_SXS_THREAD_QUERIES_DISABLED - Lack of system resources has required isolated activation to be disabled for the current thread of execution. -. - -MessageId=14011 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET -Language=Bulgarian -ERROR_SXS_PROCESS_DEFAULT_ALREADY_SET - An attempt to set the process default activation context failed because the process default activation context was already set. -. - -MessageId=14012 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_UNKNOWN_ENCODING_GROUP -Language=Bulgarian -ERROR_SXS_UNKNOWN_ENCODING_GROUP - The encoding group identifier specified is not recognized. -. - -MessageId=14013 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_UNKNOWN_ENCODING -Language=Bulgarian -ERROR_SXS_UNKNOWN_ENCODING - The encoding requested is not recognized. -. - -MessageId=14014 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_XML_NAMESPACE_URI -Language=Bulgarian -ERROR_SXS_INVALID_XML_NAMESPACE_URI - The manifest contains a reference to an invalid URI. -. - -MessageId=14015 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED -Language=Bulgarian -ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED - The application manifest contains a reference to a dependent assembly which is not installed. -. - -MessageId=14016 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED -Language=Bulgarian -ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED - The manifest for an assembly used by the application has a reference to a dependent assembly which is not installed. -. - -MessageId=14017 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE -Language=Bulgarian -ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE - The manifest contains an attribute for the assembly identity which is not valid. -. - -MessageId=14018 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE -Language=Bulgarian -ERROR_SXS_MANIFEST_MISSING_REQUIRED_DEFAULT_NAMESPACE - The manifest is missing the required default namespace specification on the assembly element. -. - -MessageId=14019 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE -Language=Bulgarian -ERROR_SXS_MANIFEST_INVALID_REQUIRED_DEFAULT_NAMESPACE - The manifest has a default namespace specified on the assembly element but its value is not \"urn:schemas-microsoft-com:asm.v1\". -. - -MessageId=14020 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT -Language=Bulgarian -ERROR_SXS_PRIVATE_MANIFEST_CROSS_PATH_WITH_REPARSE_POINT - The private manifest probe has crossed the reparse-point-associated path. -. - -MessageId=14021 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_DLL_NAME -Language=Bulgarian -ERROR_SXS_DUPLICATE_DLL_NAME - Two or more components referenced directly or indirectly by the application manifest have files by the same name. -. - -MessageId=14022 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME -Language=Bulgarian -ERROR_SXS_DUPLICATE_WINDOWCLASS_NAME - Two or more components referenced directly or indirectly by the application manifest have window classes with the same name. -. - -MessageId=14023 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_CLSID -Language=Bulgarian -ERROR_SXS_DUPLICATE_CLSID - Two or more components referenced directly or indirectly by the application manifest have the same COM server CLSIDs. -. - -MessageId=14024 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_IID -Language=Bulgarian -ERROR_SXS_DUPLICATE_IID - Two or more components referenced directly or indirectly by the application manifest have proxies for the same COM interface IIDs. -. - -MessageId=14025 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_TLBID -Language=Bulgarian -ERROR_SXS_DUPLICATE_TLBID - Two or more components referenced directly or indirectly by the application manifest have the same COM type library TLBIDs. -. - -MessageId=14026 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_PROGID -Language=Bulgarian -ERROR_SXS_DUPLICATE_PROGID - Two or more components referenced directly or indirectly by the application manifest have the same COM ProgIDs. -. - -MessageId=14027 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_DUPLICATE_ASSEMBLY_NAME -Language=Bulgarian -ERROR_SXS_DUPLICATE_ASSEMBLY_NAME - Two or more components referenced directly or indirectly by the application manifest are different versions of the same component which is not permitted. -. - -MessageId=14028 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_FILE_HASH_MISMATCH -Language=Bulgarian -ERROR_SXS_FILE_HASH_MISMATCH - A component's file does not match the verification information present in the component manifest. -. - -MessageId=14029 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_POLICY_PARSE_ERROR -Language=Bulgarian -ERROR_SXS_POLICY_PARSE_ERROR - The policy manifest contains one or more syntax errors. -. - -MessageId=14030 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSINGQUOTE -Language=Bulgarian -ERROR_SXS_XML_E_MISSINGQUOTE - Manifest Parse Error : A string literal was expected, but no opening quote character was found. -. - -MessageId=14031 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_COMMENTSYNTAX -Language=Bulgarian -ERROR_SXS_XML_E_COMMENTSYNTAX - Manifest Parse Error : Incorrect syntax was used in a comment. -. - -MessageId=14032 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADSTARTNAMECHAR -Language=Bulgarian -ERROR_SXS_XML_E_BADSTARTNAMECHAR - Manifest Parse Error : A name was started with an invalid character. -. - -MessageId=14033 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADNAMECHAR -Language=Bulgarian -ERROR_SXS_XML_E_BADNAMECHAR - Manifest Parse Error : A name contained an invalid character. -. - -MessageId=14034 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADCHARINSTRING -Language=Bulgarian -ERROR_SXS_XML_E_BADCHARINSTRING - Manifest Parse Error : A string literal contained an invalid character. -. - -MessageId=14035 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_XMLDECLSYNTAX -Language=Bulgarian -ERROR_SXS_XML_E_XMLDECLSYNTAX - Manifest Parse Error : Invalid syntax for an XML declaration. -. - -MessageId=14036 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADCHARDATA -Language=Bulgarian -ERROR_SXS_XML_E_BADCHARDATA - Manifest Parse Error : An invalid character was found in text content. -. - -MessageId=14037 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSINGWHITESPACE -Language=Bulgarian -ERROR_SXS_XML_E_MISSINGWHITESPACE - Manifest Parse Error : Required white space was missing. -. - -MessageId=14038 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_EXPECTINGTAGEND -Language=Bulgarian -ERROR_SXS_XML_E_EXPECTINGTAGEND - Manifest Parse Error : The character '>' was expected. -. - -MessageId=14039 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSINGSEMICOLON -Language=Bulgarian -ERROR_SXS_XML_E_MISSINGSEMICOLON - Manifest Parse Error : A semi colon character was expected. -. - -MessageId=14040 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNBALANCEDPAREN -Language=Bulgarian -ERROR_SXS_XML_E_UNBALANCEDPAREN - Manifest Parse Error : Unbalanced parentheses. -. - -MessageId=14041 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INTERNALERROR -Language=Bulgarian -ERROR_SXS_XML_E_INTERNALERROR - Manifest Parse Error : Internal error. -. - -MessageId=14042 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE -Language=Bulgarian -ERROR_SXS_XML_E_UNEXPECTED_WHITESPACE - Manifest Parse Error : White space is not allowed at this location. -. - -MessageId=14043 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INCOMPLETE_ENCODING -Language=Bulgarian -ERROR_SXS_XML_E_INCOMPLETE_ENCODING - Manifest Parse Error : End of file reached in invalid state for current encoding. -. - -MessageId=14044 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSING_PAREN -Language=Bulgarian -ERROR_SXS_XML_E_MISSING_PAREN - Manifest Parse Error : Missing parenthesis. -. - -MessageId=14045 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE -Language=Bulgarian -ERROR_SXS_XML_E_EXPECTINGCLOSEQUOTE - Manifest Parse Error : A single or double closing quote character (\' or \") is missing. -. - -MessageId=14046 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MULTIPLE_COLONS -Language=Bulgarian -ERROR_SXS_XML_E_MULTIPLE_COLONS - Manifest Parse Error : Multiple colons are not allowed in a name. -. - -MessageId=14047 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALID_DECIMAL -Language=Bulgarian -ERROR_SXS_XML_E_INVALID_DECIMAL - Manifest Parse Error : Invalid character for decimal digit. -. - -MessageId=14048 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALID_HEXIDECIMAL -Language=Bulgarian -ERROR_SXS_XML_E_INVALID_HEXIDECIMAL - Manifest Parse Error : Invalid character for hexadecimal digit. -. - -MessageId=14049 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALID_UNICODE -Language=Bulgarian -ERROR_SXS_XML_E_INVALID_UNICODE - Manifest Parse Error : Invalid Unicode character value for this platform. -. - -MessageId=14050 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK -Language=Bulgarian -ERROR_SXS_XML_E_WHITESPACEORQUESTIONMARK - Manifest Parse Error : Expecting white space or '?'. -. - -MessageId=14051 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNEXPECTEDENDTAG -Language=Bulgarian -ERROR_SXS_XML_E_UNEXPECTEDENDTAG - Manifest Parse Error : End tag was not expected at this location. -. - -MessageId=14052 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDTAG -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDTAG - Manifest Parse Error : The following tags were not closed: %1. -. - -MessageId=14053 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_DUPLICATEATTRIBUTE -Language=Bulgarian -ERROR_SXS_XML_E_DUPLICATEATTRIBUTE - Manifest Parse Error : Duplicate attribute. -. - -MessageId=14054 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MULTIPLEROOTS -Language=Bulgarian -ERROR_SXS_XML_E_MULTIPLEROOTS - Manifest Parse Error : Only one top level element is allowed in an XML document. -. - -MessageId=14055 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALIDATROOTLEVEL -Language=Bulgarian -ERROR_SXS_XML_E_INVALIDATROOTLEVEL - Manifest Parse Error : Invalid at the top level of the document. -. - -MessageId=14056 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADXMLDECL -Language=Bulgarian -ERROR_SXS_XML_E_BADXMLDECL - Manifest Parse Error : Invalid XML declaration. -. - -MessageId=14057 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSINGROOT -Language=Bulgarian -ERROR_SXS_XML_E_MISSINGROOT - Manifest Parse Error : XML document must have a top level element. -. - -MessageId=14058 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNEXPECTEDEOF -Language=Bulgarian -ERROR_SXS_XML_E_UNEXPECTEDEOF - Manifest Parse Error : Unexpected end of file. -. - -MessageId=14059 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADPEREFINSUBSET -Language=Bulgarian -ERROR_SXS_XML_E_BADPEREFINSUBSET - Manifest Parse Error : Parameter entities cannot be used inside markup declarations in an internal subset. -. - -MessageId=14060 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDSTARTTAG -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDSTARTTAG - Manifest Parse Error : Element was not closed. -. - -MessageId=14061 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDENDTAG -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDENDTAG - Manifest Parse Error : End element was missing the character '>'. -. - -MessageId=14062 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDSTRING -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDSTRING - Manifest Parse Error : A string literal was not closed. -. - -MessageId=14063 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDCOMMENT -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDCOMMENT - Manifest Parse Error : A comment was not closed. -. - -MessageId=14064 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDDECL -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDDECL - Manifest Parse Error : A declaration was not closed. -. - -MessageId=14065 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNCLOSEDCDATA -Language=Bulgarian -ERROR_SXS_XML_E_UNCLOSEDCDATA - Manifest Parse Error : A CDATA section was not closed. -. - -MessageId=14066 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_RESERVEDNAMESPACE -Language=Bulgarian -ERROR_SXS_XML_E_RESERVEDNAMESPACE - Manifest Parse Error : The namespace prefix is not allowed to start with the reserved string \"xml\". -. - -MessageId=14067 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALIDENCODING -Language=Bulgarian -ERROR_SXS_XML_E_INVALIDENCODING - Manifest Parse Error : System does not support the specified encoding. -. - -MessageId=14068 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALIDSWITCH -Language=Bulgarian -ERROR_SXS_XML_E_INVALIDSWITCH - Manifest Parse Error : Switch from current encoding to specified encoding not supported. -. - -MessageId=14069 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_BADXMLCASE -Language=Bulgarian -ERROR_SXS_XML_E_BADXMLCASE - Manifest Parse Error : The name 'xml' is reserved and must be lower case. -. - -MessageId=14070 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALID_STANDALONE -Language=Bulgarian -ERROR_SXS_XML_E_INVALID_STANDALONE - Manifest Parse Error : The standalone attribute must have the value 'yes' or 'no'. -. - -MessageId=14071 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_UNEXPECTED_STANDALONE -Language=Bulgarian -ERROR_SXS_XML_E_UNEXPECTED_STANDALONE - Manifest Parse Error : The standalone attribute cannot be used in external entities. -. - -MessageId=14072 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_INVALID_VERSION -Language=Bulgarian -ERROR_SXS_XML_E_INVALID_VERSION - Manifest Parse Error : Invalid version number. -. - -MessageId=14073 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_XML_E_MISSINGEQUALS -Language=Bulgarian -ERROR_SXS_XML_E_MISSINGEQUALS - Manifest Parse Error : Missing equals sign between attribute and attribute value. -. - -MessageId=14074 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROTECTION_RECOVERY_FAILED -Language=Bulgarian -ERROR_SXS_PROTECTION_RECOVERY_FAILED - Assembly Protection Error: Unable to recover the specified assembly. -. - -MessageId=14075 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT -Language=Bulgarian -ERROR_SXS_PROTECTION_PUBLIC_KEY_TOO_SHORT - Assembly Protection Error: The public key for an assembly was too short to be allowed. -. - -MessageId=14076 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROTECTION_CATALOG_NOT_VALID -Language=Bulgarian -ERROR_SXS_PROTECTION_CATALOG_NOT_VALID - Assembly Protection Error: The catalog for an assembly is not valid, or does not match the assembly's manifest. -. - -MessageId=14077 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_UNTRANSLATABLE_HRESULT -Language=Bulgarian -ERROR_SXS_UNTRANSLATABLE_HRESULT - An HRESULT could not be translated to a corresponding Win32 error code. -. - -MessageId=14078 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING -Language=Bulgarian -ERROR_SXS_PROTECTION_CATALOG_FILE_MISSING - Assembly Protection Error: The catalog for an assembly is missing. -. - -MessageId=14079 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE -Language=Bulgarian -ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE - The supplied assembly identity is missing one or more attributes which must be present in this context. -. - -MessageId=14080 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME -Language=Bulgarian -ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME - The supplied assembly identity has one or more attribute names that contain characters not permitted in XML names. -. - -MessageId=14081 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_ASSEMBLY_MISSING -Language=Bulgarian -ERROR_SXS_ASSEMBLY_MISSING - The referenced assembly could not be found. -. - -MessageId=14082 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_CORRUPT_ACTIVATION_STACK -Language=Bulgarian -ERROR_SXS_CORRUPT_ACTIVATION_STACK - The activation context activation stack for the running thread of execution is corrupt. -. - -MessageId=14083 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_CORRUPTION -Language=Bulgarian -ERROR_SXS_CORRUPTION - The application isolation metadata for this process or thread has become corrupt. -. - -MessageId=14084 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_EARLY_DEACTIVATION -Language=Bulgarian -ERROR_SXS_EARLY_DEACTIVATION - The activation context being deactivated is not the most recently activated one. -. - -MessageId=14085 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_DEACTIVATION -Language=Bulgarian -ERROR_SXS_INVALID_DEACTIVATION - The activation context being deactivated is not active for the current thread of execution. -. - -MessageId=14086 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_MULTIPLE_DEACTIVATION -Language=Bulgarian -ERROR_SXS_MULTIPLE_DEACTIVATION - The activation context being deactivated has already been deactivated. -. - -MessageId=14087 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_PROCESS_TERMINATION_REQUESTED -Language=Bulgarian -ERROR_SXS_PROCESS_TERMINATION_REQUESTED - A component used by the isolation facility has requested to terminate the process. -. - -MessageId=14088 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_RELEASE_ACTIVATION_CONTEXT -Language=Bulgarian -ERROR_SXS_RELEASE_ACTIVATION_CONTEXT - A kernel mode component is releasing a reference on an activation context. -. - -MessageId=14089 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY -Language=Bulgarian -ERROR_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY - The activation context of system default assembly could not be generated. -. - -MessageId=14090 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE -Language=Bulgarian -ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE - The value of an attribute in an identity is not within the legal range. -. - -MessageId=14091 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME -Language=Bulgarian -ERROR_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME - The name of an attribute in an identity is not within the legal range. -. - -MessageId=14092 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE -Language=Bulgarian -ERROR_SXS_IDENTITY_DUPLICATE_ATTRIBUTE - An identity contains two definitions for the same attribute. -. - -MessageId=14093 -Severity=Success -Facility=System -SymbolicName=ERROR_SXS_IDENTITY_PARSE_ERROR -Language=Bulgarian -ERROR_SXS_IDENTITY_PARSE_ERROR - The identity string is malformed. This may be due to a trailing comma, more than two unnamed attributes, missing attribute name or missing attribute value. -. - -MessageId=15000 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_INVALID_CHANNEL_PATH -Language=Bulgarian -ERROR_EVT_INVALID_CHANNEL_PATH - The specified channel path is invalid. See extended error info for more details. -. - -MessageId=15001 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_INVALID_QUERY -Language=Bulgarian -ERROR_EVT_INVALID_QUERY - The specified query is invalid. See extended error info for more details. -. - -MessageId=15002 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_PUBLISHER_MANIFEST_NOT_FOUND -Language=Bulgarian -ERROR_EVT_PUBLISHER_MANIFEST_NOT_FOUND - The publisher did indicate they have a manifest/resource but a manifest/resource could not be found. -. - -MessageId=15003 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_PUBLISHER_MANIFEST_NOT_SPECIFIED -Language=Bulgarian -ERROR_EVT_PUBLISHER_MANIFEST_NOT_SPECIFIED - The publisher does not have a manifest and is performing an operation which requires they have a manifest. -. - -MessageId=15004 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_NO_REGISTERED_TEMPLATE -Language=Bulgarian -ERROR_EVT_NO_REGISTERED_TEMPLATE - There is no registered template for specified event id. -. - -MessageId=15005 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_EVENT_CHANNEL_MISMATCH -Language=Bulgarian -ERROR_EVT_EVENT_CHANNEL_MISMATCH - The specified event was declared in the manifest to go a different channel than the one this publisher handle is bound to. -. - -MessageId=15006 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_UNEXPECTED_VALUE_TYPE -Language=Bulgarian -ERROR_EVT_UNEXPECTED_VALUE_TYPE - The type of a specified substitution value does not match the type expected from the template definition. -. - -MessageId=15007 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_UNEXPECTED_NUM_VALUES -Language=Bulgarian -ERROR_EVT_UNEXPECTED_NUM_VALUES - The number of specified substitution values does not match the number expected from the template definition. -. - -MessageId=15008 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_CHANNEL_NOT_FOUND -Language=Bulgarian -ERROR_EVT_CHANNEL_NOT_FOUND - The specified channel could not be found. Check channel configuration. -. - -MessageId=15009 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_MALFORMED_XML_TEXT -Language=Bulgarian -ERROR_EVT_MALFORMED_XML_TEXT - The specified xml text was not well-formed. See Extended Error for more details. -. - -MessageId=15010 -Severity=Success -Facility=System -SymbolicName=ERROR_EVT_CHANNEL_PATH_TOO_GENERAL -Language=Bulgarian -ERROR_EVT_CHANNEL_PATH_TOO_GENERAL - The specified channel path selects more than one instance of a channel. The operation requires that only one channel be selected. It may be necessary to scope channel path to version / publicKeyToken to select only one instance. -. - - -; Facility=WIN32 - -MessageId=0x000E -Severity=Warning -Facility=WIN32 -SymbolicName=E_OUTOFMEMORY -Language=Bulgarian -E_OUTOFMEMORY - Out of memory -. - -MessageId=0x0057 -Severity=Warning -Facility=WIN32 -SymbolicName=E_INVALIDARG -Language=Bulgarian -E_INVALIDARG - One or more arguments are invalid -. - -MessageId=0x0006 -Severity=Warning -Facility=WIN32 -SymbolicName=E_HANDLE -Language=Bulgarian -E_POINTER - Invalid handle -. - -MessageId=0x0005 -Severity=Warning -Facility=WIN32 -SymbolicName=E_ACCESSDENIED -Language=Bulgarian -E_ACCESSDENIED - WIN32 access denied error -. - - -; Facility=ITF - -MessageId=0x0000 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_OLEVERB -Language=Bulgarian -OLE_E_OLEVERB - Invalid OLEVERB structure -. - -MessageId=0x0001 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_ADVF -Language=Bulgarian -OLE_E_ADVF - Invalid advise flags -. - -MessageId=0x0002 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_ENUM_NOMORE -Language=Bulgarian -OLE_E_ENUM_NOMORE - Can't enumerate any more, because the associated data is missing -. - -MessageId=0x0003 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_ADVISENOTSUPPORTED -Language=Bulgarian -OLE_E_ADVISENOTSUPPORTED - This implementation doesn't take advises -. - -MessageId=0x0004 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_NOCONNECTION -Language=Bulgarian -OLE_E_NOCONNECTION - There is no connection for this connection ID -. - -MessageId=0x0005 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_NOTRUNNING -Language=Bulgarian -OLE_E_NOTRUNNING - Need to run the object to perform this operation -. - -MessageId=0x0006 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_NOCACHE -Language=Bulgarian -OLE_E_NOCACHE - There is no cache to operate on -. - -MessageId=0x0007 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_BLANK -Language=Bulgarian -OLE_E_BLANK - Uninitialized object -. - -MessageId=0x0008 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_CLASSDIFF -Language=Bulgarian -OLE_E_CLASSDIFF - Linked object's source class has changed -. - -MessageId=0x0009 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_CANT_GETMONIKER -Language=Bulgarian -OLE_E_CANT_GETMONIKER - Not able to get the moniker of the object -. - -MessageId=0x000A -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_CANT_BINDTOSOURCE -Language=Bulgarian -OLE_E_CANT_BINDTOSOURCE - Not able to bind to the source -. - -MessageId=0x000B -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_STATIC -Language=Bulgarian -OLE_E_STATIC - Object is static; operation not allowed -. - -MessageId=0x000C -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_PROMPTSAVECANCELLED -Language=Bulgarian -OLE_E_PROMPTSAVECANCELLED - User canceled out of save dialog -. - -MessageId=0x000D -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_INVALIDRECT -Language=Bulgarian -OLE_E_INVALIDRECT - Invalid rectangle -. - -MessageId=0x000E -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_WRONGCOMPOBJ -Language=Bulgarian -OLE_E_WRONGCOMPOBJ - compobj.dll is too old for the ole2.dll initialized -. - -MessageId=0x000F -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_INVALIDHWND -Language=Bulgarian -OLE_E_INVALIDHWND - Invalid window handle -. - -MessageId=0x0010 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_NOT_INPLACEACTIVE -Language=Bulgarian -OLE_E_NOT_INPLACEACTIVE - Object is not in any of the inplace active states -. - -MessageId=0x0011 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_CANTCONVERT -Language=Bulgarian -OLE_E_CANTCONVERT - Not able to convert object -. - -MessageId=0x0012 -Severity=Warning -Facility=ITF -SymbolicName=OLE_E_NOSTORAGE -Language=Bulgarian -OLE_E_NOSTORAGE - Not able to perform the operation because object is not given storage yet -. - -MessageId=0x0064 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_FORMATETC -Language=Bulgarian -DV_E_FORMATETC - Invalid FORMATETC structure -. - -MessageId=0x0065 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_DVTARGETDEVICE -Language=Bulgarian -DV_E_DVTARGETDEVICE - Invalid DVTARGETDEVICE structure -. - -MessageId=0x0066 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_STGMEDIUM -Language=Bulgarian -DV_E_STGMEDIUM - Invalid STDGMEDIUM structure -. - -MessageId=0x0067 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_STATDATA -Language=Bulgarian -DV_E_STATDATA - Invalid STATDATA structure -. - -MessageId=0x0068 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_LINDEX -Language=Bulgarian -DV_E_LINDEX - Invalid lindex -. - -MessageId=0x0069 -Severity=Warning -Facility=ITF -SymbolicName=DV_E_TYMED -Language=Bulgarian -DV_E_TYMED - Invalid tymed -. - -MessageId=0x006A -Severity=Warning -Facility=ITF -SymbolicName=DV_E_CLIPFORMAT -Language=Bulgarian -DV_E_CLIPFORMAT - Invalid clipboard format -. - -MessageId=0x006B -Severity=Warning -Facility=ITF -SymbolicName=DV_E_DVASPECT -Language=Bulgarian -DV_E_DVASPECT - Invalid aspect(s) -. - -MessageId=0x006C -Severity=Warning -Facility=ITF -SymbolicName=DV_E_DVTARGETDEVICE_SIZE -Language=Bulgarian -DV_E_DVTARGETDEVICE_SIZE - tdSize parameter of the DVTARGETDEVICE structure is invalid -. - -MessageId=0x006D -Severity=Warning -Facility=ITF -SymbolicName=DV_E_NOIVIEWOBJECT -Language=Bulgarian -DV_E_NOIVIEWOBJECT - Object doesn't support IViewObject interface -. - -MessageId=0x0100 -Severity=Warning -Facility=ITF -SymbolicName=DRAGDROP_E_NOTREGISTERED -Language=Bulgarian -DRAGDROP_E_NOTREGISTERED - Trying to revoke a drop target that has not been registered -. - -MessageId=0x0101 -Severity=Warning -Facility=ITF -SymbolicName=DRAGDROP_E_ALREADYREGISTERED -Language=Bulgarian -DRAGDROP_E_ALREADYREGISTERED - This window has already been registered as a drop target -. - -MessageId=0x0102 -Severity=Warning -Facility=ITF -SymbolicName=DRAGDROP_E_INVALIDHWND -Language=Bulgarian -DRAGDROP_E_INVALIDHWND - Invalid window handle -. - -MessageId=0x0110 -Severity=Warning -Facility=ITF -SymbolicName=CLASS_E_NOAGGREGATION -Language=Bulgarian -CLASS_E_NOAGGREGATION - Class does not support aggregation (or class object is remote) -. - -MessageId=0x0111 -Severity=Warning -Facility=ITF -SymbolicName=CLASS_E_CLASSNOTAVAILABLE -Language=Bulgarian -CLASS_E_CLASSNOTAVAILABLE - ClassFactory cannot supply requested class -. - -MessageId=0x0112 -Severity=Warning -Facility=ITF -SymbolicName=CLASS_E_NOTLICENSED -Language=Bulgarian -CLASS_E_NOTLICENSED - Class is not licensed for use -. - -; EOF -; -; kernel32.mc MESSAGE resources for kernel32.dll -; - -MessageIdTypedef=ULONG - -SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS - Informational=0x1:STATUS_SEVERITY_INFORMATIONAL - Warning=0x2:STATUS_SEVERITY_WARNING - Error=0x3:STATUS_SEVERITY_ERROR - ) - -FacilityNames=(System=0x0:FACILITY_SYSTEM - ITF=0x4:FACILITY_ITF - WIN32=0x7:FACILITY_GENERAL - ) - -LanguageNames=(Bulgarian=0x419:MSG00419) - - -; -; message definitions -; - -; Facility=System - -MessageId=0 -Severity=Success -Facility=System -SymbolicName=ERROR_SUCCESS -Language=Bulgarian -ERROR_SUCCESS - ト裨粨褪 鈞糶褊 褸. -. - -MessageId=1 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FUNCTION -Language=Bulgarian -ERROR_INVALID_FUNCTION - テ褸 . -. - -MessageId=2 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_NOT_FOUND -Language=Bulgarian -ERROR_FILE_NOT_FOUND - ヤ琺 頸. -. - -MessageId=3 -Severity=Success -Facility=System -SymbolicName=ERROR_PATH_NOT_FOUND -Language=Bulgarian -ERROR_PATH_NOT_FOUND - マ 頸. -. - -MessageId=4 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_OPEN_FILES -Language=Bulgarian -ERROR_TOO_MANY_OPEN_FILES - メ糶蒟 胛 粽褊 琺粢. -. - -MessageId=5 -Severity=Success -Facility=System -SymbolicName=ERROR_ACCESS_DENIED -Language=Bulgarian -ERROR_ACCESS_DENIED - ト 珸瑙. -. - -MessageId=6 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_HANDLE -Language=Bulgarian -ERROR_INVALID_HANDLE - テ褸褊 蕣赳褄. -. - -MessageId=7 -Severity=Success -Facility=System -SymbolicName=ERROR_ARENA_TRASHED -Language=Bulgarian -ERROR_ARENA_TRASHED - The storage control blocks were destroyed. -. - -MessageId=8 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_ENOUGH_MEMORY -Language=Bulgarian -ERROR_NOT_ENOUGH_MEMORY - Not enough storage is available to process this command. -. - -MessageId=9 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_BLOCK -Language=Bulgarian -ERROR_INVALID_BLOCK - The storage control block address is invalid. -. - -MessageId=10 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_ENVIRONMENT -Language=Bulgarian -ERROR_BAD_ENVIRONMENT - ム裝瑣 襃珞齏. -. - -MessageId=11 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_FORMAT -Language=Bulgarian -ERROR_BAD_FORMAT - ヘ瑜珞褊 頸 鈞 鈞褂萵 齏趺韃 襃珞齏褊 瑣. -. - -MessageId=12 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ACCESS -Language=Bulgarian -ERROR_INVALID_ACCESS - ハ蕣 鈞 蒡 胙褸褊. -. - -MessageId=13 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DATA -Language=Bulgarian -ERROR_INVALID_DATA - ヘ襃珞齏 萵. -. - -MessageId=14 -Severity=Success -Facility=System -SymbolicName=ERROR_OUTOFMEMORY -Language=Bulgarian -ERROR_OUTOFMEMORY - Not enough storage is available to complete this operation. -. - -MessageId=15 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_DRIVE -Language=Bulgarian -ERROR_INVALID_DRIVE - モ裝矜 趺 萵 瑟褞 珸瑙 鴦粽. -. - -MessageId=16 -Severity=Success -Facility=System -SymbolicName=ERROR_CURRENT_DIRECTORY -Language=Bulgarian -ERROR_CURRENT_DIRECTORY - ネ銓鞣瑙褪 瑜瑣 裘銕跫. -. - -MessageId=17 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SAME_DEVICE -Language=Bulgarian -ERROR_NOT_SAME_DEVICE - モ裝矜 趺 萵 褌褥 琺 蓿胛 蒻粽 鴦粽. -. - -MessageId=18 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_FILES -Language=Bulgarian -ERROR_NO_MORE_FILES - ヘ 粢 琺粢. -. - -MessageId=19 -Severity=Success -Facility=System -SymbolicName=ERROR_WRITE_PROTECT -Language=Bulgarian -ERROR_WRITE_PROTECT - ヘ頸褄 鈞頸褊 鞣 鈞頌. -. - -MessageId=20 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_UNIT -Language=Bulgarian -ERROR_BAD_UNIT - モ裝矜 趺 萵 瑟褞 珸瑙 鴦粽. -. - -MessageId=21 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_READY -Language=Bulgarian -ERROR_NOT_READY - モ鴦粽 胛粽. -. - -MessageId=22 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_COMMAND -Language=Bulgarian -ERROR_BAD_COMMAND - モ鴦粽 珸鈿珞 瑙萵. -. - -MessageId=23 -Severity=Success -Facility=System -SymbolicName=ERROR_CRC -Language=Bulgarian -ERROR_CRC - テ褸 萵頸 (粢 韭顆 瑣 (crc)). -. - -MessageId=24 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_LENGTH -Language=Bulgarian -ERROR_BAD_LENGTH - マ胙瑟瑣 韈萵蒟 瑙萵, 蕣跖瑣 瑙萵 胙褸. -. - -MessageId=25 -Severity=Success -Facility=System -SymbolicName=ERROR_SEEK -Language=Bulgarian -ERROR_SEEK - モム鴦粽 趺 萵 韃 裝褄褊 硴瑰 齏 褶瑣 蒻. -. - -MessageId=26 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_DOS_DISK -Language=Bulgarian -ERROR_NOT_DOS_DISK - モ珸瑙 蒻 齏 蒻褪 趺 萵 磅蒟 蒡褊. -. - -MessageId=27 -Severity=Success -Facility=System -SymbolicName=ERROR_SECTOR_NOT_FOUND -Language=Bulgarian -ERROR_SECTOR_NOT_FOUND - モ鴦粽 趺 萵 瑟褞 鈞粢 裲 (裲). -. - -MessageId=28 -Severity=Success -Facility=System -SymbolicName=ERROR_OUT_OF_PAPER -Language=Bulgarian -ERROR_OUT_OF_PAPER - ユ瑩 褶瑣璞 糶. -. - -MessageId=29 -Severity=Success -Facility=System -SymbolicName=ERROR_WRITE_FAULT -Language=Bulgarian -ERROR_WRITE_FAULT - モ裝矜 趺 萵 顏 珸瑙 鴦粽. -. - -MessageId=30 -Severity=Success -Facility=System -SymbolicName=ERROR_READ_FAULT -Language=Bulgarian -ERROR_READ_FAULT - モ裝矜 趺 萵 褪 珸瑙 鴦粽.. - -MessageId=31 -Severity=Success -Facility=System -SymbolicName=ERROR_GEN_FAILURE -Language=Bulgarian -ERROR_GEN_FAILURE - A device attached to the system is not functioning. -. - -MessageId=32 -Severity=Success -Facility=System -SymbolicName=ERROR_SHARING_VIOLATION -Language=Bulgarian -ERROR_SHARING_VIOLATION - The process cannot access the file because it is being used by another process. -. - -MessageId=33 -Severity=Success -Facility=System -SymbolicName=ERROR_LOCK_VIOLATION -Language=Bulgarian -ERROR_LOCK_VIOLATION - The process cannot access the file because another process has locked a portion of the file. -. - -MessageId=34 -Severity=Success -Facility=System -SymbolicName=ERROR_WRONG_DISK -Language=Bulgarian -ERROR_WRONG_DISK - The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1. -. - -MessageId=36 -Severity=Success -Facility=System -SymbolicName=ERROR_SHARING_BUFFER_EXCEEDED -Language=Bulgarian -ERROR_SHARING_BUFFER_EXCEEDED - Too many files opened for sharing. -. - -MessageId=38 -Severity=Success -Facility=System -SymbolicName=ERROR_HANDLE_EOF -Language=Bulgarian -ERROR_HANDLE_EOF - Reached the end of the file. -. - -MessageId=39 -Severity=Success -Facility=System -SymbolicName=ERROR_HANDLE_DISK_FULL -Language=Bulgarian -ERROR_HANDLE_DISK_FULL - ト頌 褊. -. - -MessageId=50 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SUPPORTED -Language=Bulgarian -ERROR_NOT_SUPPORTED - ヌ粲瑣 蒿赳. -. - -MessageId=51 -Severity=Success -Facility=System -SymbolicName=ERROR_REM_NOT_LIST -Language=Bulgarian -ERROR_REM_NOT_LIST - Windows cannot find the network path. Verify that the network path is correct and the destination computer is not busy or turned off. If Windows still cannot find the network path, contact your network administrator. -. - -MessageId=52 -Severity=Success -Facility=System -SymbolicName=ERROR_DUP_NAME -Language=Bulgarian -ERROR_DUP_NAME - You were not connected because a duplicate name exists on the network. Go to System in the Control Panel to change the computer name and try again. -. - -MessageId=53 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_NETPATH -Language=Bulgarian -ERROR_BAD_NETPATH - フ褂粨 頸. -. - -MessageId=54 -Severity=Success -Facility=System -SymbolicName=ERROR_NETWORK_BUSY -Language=Bulgarian -ERROR_NETWORK_BUSY - フ褂瑣 鈞褪. -. - -MessageId=55 -Severity=Success -Facility=System -SymbolicName=ERROR_DEV_NOT_EXIST -Language=Bulgarian -ERROR_DEV_NOT_EXIST - The specified network resource or device is no longer available. -. - -MessageId=56 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_CMDS -Language=Bulgarian -ERROR_TOO_MANY_CMDS - The network BIOS command limit has been reached. -. - -MessageId=57 -Severity=Success -Facility=System -SymbolicName=ERROR_ADAP_HDW_ERR -Language=Bulgarian -ERROR_ADAP_HDW_ERR - A network adapter hardware error occurred. -. - -MessageId=58 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_NET_RESP -Language=Bulgarian -ERROR_BAD_NET_RESP - The specified server cannot perform the requested operation. -. - -MessageId=59 -Severity=Success -Facility=System -SymbolicName=ERROR_UNEXP_NET_ERR -Language=Bulgarian -ERROR_UNEXP_NET_ERR - An unexpected network error occurred. -. - -MessageId=60 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_REM_ADAP -Language=Bulgarian -ERROR_BAD_REM_ADAP - The remote adapter is not compatible. -. - -MessageId=61 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINTQ_FULL -Language=Bulgarian -ERROR_PRINTQ_FULL - The printer queue is full. -. - -MessageId=62 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SPOOL_SPACE -Language=Bulgarian -ERROR_NO_SPOOL_SPACE - Space to store the file waiting to be printed is not available on the server. -. - -MessageId=63 -Severity=Success -Facility=System -SymbolicName=ERROR_PRINT_CANCELLED -Language=Bulgarian -ERROR_PRINT_CANCELLED - Your file waiting to be printed was deleted. -. - -MessageId=64 -Severity=Success -Facility=System -SymbolicName=ERROR_NETNAME_DELETED -Language=Bulgarian -ERROR_NETNAME_DELETED - The specified network name is no longer available. -. - -MessageId=65 -Severity=Success -Facility=System -SymbolicName=ERROR_NETWORK_ACCESS_DENIED -Language=Bulgarian -ERROR_NETWORK_ACCESS_DENIED - Network access is denied. -. - -MessageId=66 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DEV_TYPE -Language=Bulgarian -ERROR_BAD_DEV_TYPE - The network resource type is not correct. -. - -MessageId=67 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_NET_NAME -Language=Bulgarian -ERROR_BAD_NET_NAME - ム褪裘 韲 琺蒟. -. - -MessageId=68 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_NAMES -Language=Bulgarian -ERROR_TOO_MANY_NAMES - The name limit for the local computer network adapter card was exceeded. -. - -MessageId=69 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_SESS -Language=Bulgarian -ERROR_TOO_MANY_SESS - The network BIOS session limit was exceeded. -. - -MessageId=70 -Severity=Success -Facility=System -SymbolicName=ERROR_SHARING_PAUSED -Language=Bulgarian -ERROR_SHARING_PAUSED - The remote server has been paused or is in the process of being started. -. - -MessageId=71 -Severity=Success -Facility=System -SymbolicName=ERROR_REQ_NOT_ACCEP -Language=Bulgarian -ERROR_REQ_NOT_ACCEP - No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept. -. - -MessageId=72 -Severity=Success -Facility=System -SymbolicName=ERROR_REDIR_PAUSED -Language=Bulgarian -ERROR_REDIR_PAUSED - The specified printer or disk device has been paused. -. - -MessageId=80 -Severity=Success -Facility=System -SymbolicName=ERROR_FILE_EXISTS -Language=Bulgarian -ERROR_FILE_EXISTS - ヤ琺 褥糒褪. -. - -MessageId=82 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_MAKE -Language=Bulgarian -ERROR_CANNOT_MAKE - ヘ 萵 鈕瑣 琺 齏 蒻裲. -. - -MessageId=83 -Severity=Success -Facility=System -SymbolicName=ERROR_FAIL_I24 -Language=Bulgarian -ERROR_FAIL_I24 - Fail on INT 24. -. - -MessageId=84 -Severity=Success -Facility=System -SymbolicName=ERROR_OUT_OF_STRUCTURES -Language=Bulgarian -ERROR_OUT_OF_STRUCTURES - Storage to process this request is not available. -. - -MessageId=85 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_ASSIGNED -Language=Bulgarian -ERROR_ALREADY_ASSIGNED - The local device name is already in use. -. - -MessageId=86 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PASSWORD -Language=Bulgarian -ERROR_INVALID_PASSWORD - The specified network password is not correct. -. - -MessageId=87 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PARAMETER -Language=Bulgarian -ERROR_INVALID_PARAMETER - ヘ裲裲 瑩瑟褪. -. - -MessageId=88 -Severity=Success -Facility=System -SymbolicName=ERROR_NET_WRITE_FAULT -Language=Bulgarian -ERROR_NET_WRITE_FAULT - A write fault occurred on the network. -. - -MessageId=89 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_PROC_SLOTS -Language=Bulgarian -ERROR_NO_PROC_SLOTS - The system cannot start another process at this time. -. - -MessageId=100 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_SEMAPHORES -Language=Bulgarian -ERROR_TOO_MANY_SEMAPHORES - Cannot create another system semaphore. -. - -MessageId=101 -Severity=Success -Facility=System -SymbolicName=ERROR_EXCL_SEM_ALREADY_OWNED -Language=Bulgarian -ERROR_EXCL_SEM_ALREADY_OWNED - The exclusive semaphore is owned by another process. -. - -MessageId=102 -Severity=Success -Facility=System -SymbolicName=ERROR_SEM_IS_SET -Language=Bulgarian -ERROR_SEM_IS_SET - The semaphore is set and cannot be closed. -. - -MessageId=103 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_SEM_REQUESTS -Language=Bulgarian -ERROR_TOO_MANY_SEM_REQUESTS - The semaphore cannot be set again. -. - -MessageId=104 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_AT_INTERRUPT_TIME -Language=Bulgarian -ERROR_INVALID_AT_INTERRUPT_TIME - Cannot request exclusive semaphores at interrupt time. -. - -MessageId=105 -Severity=Success -Facility=System -SymbolicName=ERROR_SEM_OWNER_DIED -Language=Bulgarian -ERROR_SEM_OWNER_DIED - The previous ownership of this semaphore has ended. -. - -MessageId=106 -Severity=Success -Facility=System -SymbolicName=ERROR_SEM_USER_LIMIT -Language=Bulgarian -ERROR_SEM_USER_LIMIT - ツ珞 蒻褪 蒻粽 %1. -. - -MessageId=107 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_CHANGE -Language=Bulgarian -ERROR_DISK_CHANGE - The program stopped because an alternate diskette was not inserted. -. - -MessageId=108 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVE_LOCKED -Language=Bulgarian -ERROR_DRIVE_LOCKED - The disk is in use or locked by another process. -. - -MessageId=109 -Severity=Success -Facility=System -SymbolicName=ERROR_BROKEN_PIPE -Language=Bulgarian -ERROR_BROKEN_PIPE - The pipe has been ended. -. - -MessageId=110 -Severity=Success -Facility=System -SymbolicName=ERROR_OPEN_FAILED -Language=Bulgarian -ERROR_OPEN_FAILED - ム頌褌 萵 珸瑙 琺 齏 鴦粽. -. - -MessageId=111 -Severity=Success -Facility=System -SymbolicName=ERROR_BUFFER_OVERFLOW -Language=Bulgarian -ERROR_BUFFER_OVERFLOW - ネ 琺 顏 蓁竟. -. - -MessageId=112 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_FULL -Language=Bulgarian -ERROR_DISK_FULL - There is not enough space on the disk. -. - -MessageId=113 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_SEARCH_HANDLES -Language=Bulgarian -ERROR_NO_MORE_SEARCH_HANDLES - No more internal file identifiers available. -. - -MessageId=114 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_TARGET_HANDLE -Language=Bulgarian -ERROR_INVALID_TARGET_HANDLE - The target internal file identifier is incorrect. -. - -MessageId=117 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_CATEGORY -Language=Bulgarian -ERROR_INVALID_CATEGORY - The IOCTL call made by the application program is not correct. -. - -MessageId=118 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_VERIFY_SWITCH -Language=Bulgarian -ERROR_INVALID_VERIFY_SWITCH - The verify-on-write switch parameter value is not correct. -. - -MessageId=119 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DRIVER_LEVEL -Language=Bulgarian -ERROR_BAD_DRIVER_LEVEL - The system does not support the command requested. -. - -MessageId=120 -Severity=Success -Facility=System -SymbolicName=ERROR_CALL_NOT_IMPLEMENTED -Language=Bulgarian -ERROR_CALL_NOT_IMPLEMENTED - ン 蒿褞跖籵褪 萵 頌褌. -. - -MessageId=121 -Severity=Success -Facility=System -SymbolicName=ERROR_SEM_TIMEOUT -Language=Bulgarian -ERROR_SEM_TIMEOUT - The semaphore timeout period has expired. -. - -MessageId=122 -Severity=Success -Facility=System -SymbolicName=ERROR_INSUFFICIENT_BUFFER -Language=Bulgarian -ERROR_INSUFFICIENT_BUFFER - The data area passed to a system call is too small. -. - -MessageId=123 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_NAME -Language=Bulgarian -ERROR_INVALID_NAME - ネ 琺, 蒻裲韋 齏 褪 蒻 韲 裘褞 竟瑕頌. -. - -MessageId=124 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LEVEL -Language=Bulgarian -ERROR_INVALID_LEVEL - The system call level is not correct. -. - -MessageId=125 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_VOLUME_LABEL -Language=Bulgarian -ERROR_NO_VOLUME_LABEL - ト頌 韲裹 褪 . -. - -MessageId=126 -Severity=Success -Facility=System -SymbolicName=ERROR_MOD_NOT_FOUND -Language=Bulgarian -ERROR_MOD_NOT_FOUND - モ珸瑙 蔘 琺蒟. -. - -MessageId=127 -Severity=Success -Facility=System -SymbolicName=ERROR_PROC_NOT_FOUND -Language=Bulgarian -ERROR_PROC_NOT_FOUND - モ珸瑙 裝 琺蒟. -. - -MessageId=128 -Severity=Success -Facility=System -SymbolicName=ERROR_WAIT_NO_CHILDREN -Language=Bulgarian -ERROR_WAIT_NO_CHILDREN - There are no child processes to wait for. -. - -MessageId=129 -Severity=Success -Facility=System -SymbolicName=ERROR_CHILD_NOT_COMPLETE -Language=Bulgarian -ERROR_CHILD_NOT_COMPLETE - マ齏趺韃 %1 趺 磊 鈞褊 褂韲 Win32. -. - -MessageId=130 -Severity=Success -Facility=System -SymbolicName=ERROR_DIRECT_ACCESS_HANDLE -Language=Bulgarian -ERROR_DIRECT_ACCESS_HANDLE - Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O. -. - -MessageId=131 -Severity=Success -Facility=System -SymbolicName=ERROR_NEGATIVE_SEEK -Language=Bulgarian -ERROR_NEGATIVE_SEEK - An attempt was made to move the file pointer before the beginning of the file. -. - -MessageId=132 -Severity=Success -Facility=System -SymbolicName=ERROR_SEEK_ON_DEVICE -Language=Bulgarian -ERROR_SEEK_ON_DEVICE - The file pointer cannot be set on the specified device or file. -. - -MessageId=133 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_JOIN_TARGET -Language=Bulgarian -ERROR_IS_JOIN_TARGET - A JOIN or SUBST command cannot be used for a drive that contains previously joined drives. -. - -MessageId=134 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_JOINED -Language=Bulgarian -ERROR_IS_JOINED - An attempt was made to use a JOIN or SUBST command on a drive that has already been joined. -. - -MessageId=135 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_SUBSTED -Language=Bulgarian -ERROR_IS_SUBSTED - An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted. -. - -MessageId=136 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_JOINED -Language=Bulgarian -ERROR_NOT_JOINED - The system tried to delete the JOIN of a drive that is not joined. -. - -MessageId=137 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SUBSTED -Language=Bulgarian -ERROR_NOT_SUBSTED - The system tried to delete the substitution of a drive that is not substituted. -. - -MessageId=138 -Severity=Success -Facility=System -SymbolicName=ERROR_JOIN_TO_JOIN -Language=Bulgarian -ERROR_JOIN_TO_JOIN - The system tried to join a drive to a directory on a joined drive. -. - -MessageId=139 -Severity=Success -Facility=System -SymbolicName=ERROR_SUBST_TO_SUBST -Language=Bulgarian -ERROR_SUBST_TO_SUBST - The system tried to substitute a drive to a directory on a substituted drive. -. - -MessageId=140 -Severity=Success -Facility=System -SymbolicName=ERROR_JOIN_TO_SUBST -Language=Bulgarian -ERROR_JOIN_TO_SUBST - The system tried to join a drive to a directory on a substituted drive. -. - -MessageId=141 -Severity=Success -Facility=System -SymbolicName=ERROR_SUBST_TO_JOIN -Language=Bulgarian -ERROR_SUBST_TO_JOIN - The system tried to SUBST a drive to a directory on a joined drive. -. - -MessageId=142 -Severity=Success -Facility=System -SymbolicName=ERROR_BUSY_DRIVE -Language=Bulgarian -ERROR_BUSY_DRIVE - The system cannot perform a JOIN or SUBST at this time. -. - -MessageId=143 -Severity=Success -Facility=System -SymbolicName=ERROR_SAME_DRIVE -Language=Bulgarian -ERROR_SAME_DRIVE - The system cannot join or substitute a drive to or for a directory on the same drive. -. - -MessageId=144 -Severity=Success -Facility=System -SymbolicName=ERROR_DIR_NOT_ROOT -Language=Bulgarian -ERROR_DIR_NOT_ROOT - The directory is not a subdirectory of the root directory. -. - -MessageId=145 -Severity=Success -Facility=System -SymbolicName=ERROR_DIR_NOT_EMPTY -Language=Bulgarian -ERROR_DIR_NOT_EMPTY - ト頏裲 . -. - -MessageId=146 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_SUBST_PATH -Language=Bulgarian -ERROR_IS_SUBST_PATH - The path specified is being used in a substitute. -. - -MessageId=147 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_JOIN_PATH -Language=Bulgarian -ERROR_IS_JOIN_PATH - Not enough resources are available to process this command. -. - -MessageId=148 -Severity=Success -Facility=System -SymbolicName=ERROR_PATH_BUSY -Language=Bulgarian -ERROR_PATH_BUSY - モ珸瑙 趺 磊 頌鉋籵 萵 糅褌. -. - -MessageId=149 -Severity=Success -Facility=System -SymbolicName=ERROR_IS_SUBST_TARGET -Language=Bulgarian -ERROR_IS_SUBST_TARGET - An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute. -. - -MessageId=150 -Severity=Success -Facility=System -SymbolicName=ERROR_SYSTEM_TRACE -Language=Bulgarian -ERROR_SYSTEM_TRACE - System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. -. - -MessageId=151 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EVENT_COUNT -Language=Bulgarian -ERROR_INVALID_EVENT_COUNT - The number of specified semaphore events for DosMuxSemWait is not correct. -. - -MessageId=152 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_MUXWAITERS -Language=Bulgarian -ERROR_TOO_MANY_MUXWAITERS - DosMuxSemWait did not execute; too many semaphores are already set. -. - -MessageId=153 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LIST_FORMAT -Language=Bulgarian -ERROR_INVALID_LIST_FORMAT - The DosMuxSemWait list is not correct. -. - -MessageId=154 -Severity=Success -Facility=System -SymbolicName=ERROR_LABEL_TOO_LONG -Language=Bulgarian -ERROR_LABEL_TOO_LONG - The volume label you entered exceeds the label character limit of the target file system. -. - -MessageId=155 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_TCBS -Language=Bulgarian -ERROR_TOO_MANY_TCBS - ヘ裘銕跫 鈕瑣 蓿胛 . -. - -MessageId=156 -Severity=Success -Facility=System -SymbolicName=ERROR_SIGNAL_REFUSED -Language=Bulgarian -ERROR_SIGNAL_REFUSED - The recipient process has refused the signal. -. - -MessageId=157 -Severity=Success -Facility=System -SymbolicName=ERROR_DISCARDED -Language=Bulgarian -ERROR_DISCARDED - The segment is already discarded and cannot be locked. -. - -MessageId=158 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_LOCKED -Language=Bulgarian -ERROR_NOT_LOCKED - The segment is already unlocked. -. - -MessageId=159 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_THREADID_ADDR -Language=Bulgarian -ERROR_BAD_THREADID_ADDR - The address for the thread ID is not correct. -. - -MessageId=160 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_ARGUMENTS -Language=Bulgarian -ERROR_BAD_ARGUMENTS - The argument string passed to DosExecPgm is not correct. -. - -MessageId=161 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_PATHNAME -Language=Bulgarian -ERROR_BAD_PATHNAME - モ珸瑙 裘褞. -. - -MessageId=162 -Severity=Success -Facility=System -SymbolicName=ERROR_SIGNAL_PENDING -Language=Bulgarian -ERROR_SIGNAL_PENDING - A signal is already pending. -. - -MessageId=164 -Severity=Success -Facility=System -SymbolicName=ERROR_MAX_THRDS_REACHED -Language=Bulgarian -ERROR_MAX_THRDS_REACHED - No more threads can be created in the system. -. - -MessageId=167 -Severity=Success -Facility=System -SymbolicName=ERROR_LOCK_FAILED -Language=Bulgarian -ERROR_LOCK_FAILED - Unable to lock a region of a file. -. - -MessageId=170 -Severity=Success -Facility=System -SymbolicName=ERROR_BUSY -Language=Bulgarian -ERROR_BUSY - メ裔褌 褥 趺 頌銛褪. -. - -MessageId=173 -Severity=Success -Facility=System -SymbolicName=ERROR_CANCEL_VIOLATION -Language=Bulgarian -ERROR_CANCEL_VIOLATION - A lock request was not outstanding for the supplied cancel region. -. - -MessageId=174 -Severity=Success -Facility=System -SymbolicName=ERROR_ATOMIC_LOCKS_NOT_SUPPORTED -Language=Bulgarian -ERROR_ATOMIC_LOCKS_NOT_SUPPORTED - The file system does not support atomic changes to the lock type. -. - -MessageId=180 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SEGMENT_NUMBER -Language=Bulgarian -ERROR_INVALID_SEGMENT_NUMBER - The system detected a segment number that was not correct. -. - -MessageId=182 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ORDINAL -Language=Bulgarian -ERROR_INVALID_ORDINAL - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=183 -Severity=Success -Facility=System -SymbolicName=ERROR_ALREADY_EXISTS -Language=Bulgarian -ERROR_ALREADY_EXISTS - Cannot create a file when that file already exists. -. - -MessageId=186 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_FLAG_NUMBER -Language=Bulgarian -ERROR_INVALID_FLAG_NUMBER - The flag passed is not correct. -. - -MessageId=187 -Severity=Success -Facility=System -SymbolicName=ERROR_SEM_NOT_FOUND -Language=Bulgarian -ERROR_SEM_NOT_FOUND - The specified system semaphore name was not found. -. - -MessageId=188 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_STARTING_CODESEG -Language=Bulgarian -ERROR_INVALID_STARTING_CODESEG - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=189 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_STACKSEG -Language=Bulgarian -ERROR_INVALID_STACKSEG - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=190 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MODULETYPE -Language=Bulgarian -ERROR_INVALID_MODULETYPE - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=191 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EXE_SIGNATURE -Language=Bulgarian -ERROR_INVALID_EXE_SIGNATURE - ヘ裘銕跫 鈞頸 %1 褂韲 Win32. -. - -MessageId=192 -Severity=Success -Facility=System -SymbolicName=ERROR_EXE_MARKED_INVALID -Language=Bulgarian -ERROR_EXE_MARKED_INVALID - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=193 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_EXE_FORMAT -Language=Bulgarian -ERROR_BAD_EXE_FORMAT - %1 裲褪 Win32 齏趺韃. -. - -MessageId=194 -Severity=Success -Facility=System -SymbolicName=ERROR_ITERATED_DATA_EXCEEDS_64k -Language=Bulgarian -ERROR_ITERATED_DATA_EXCEEDS_64k - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=195 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_MINALLOCSIZE -Language=Bulgarian -ERROR_INVALID_MINALLOCSIZE - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=196 -Severity=Success -Facility=System -SymbolicName=ERROR_DYNLINK_FROM_INVALID_RING -Language=Bulgarian -ERROR_DYNLINK_FROM_INVALID_RING - The operating system cannot run this application program. -. - -MessageId=197 -Severity=Success -Facility=System -SymbolicName=ERROR_IOPL_NOT_ENABLED -Language=Bulgarian -ERROR_IOPL_NOT_ENABLED - The operating system is not presently configured to run this application. -. - -MessageId=198 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SEGDPL -Language=Bulgarian -ERROR_INVALID_SEGDPL - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=199 -Severity=Success -Facility=System -SymbolicName=ERROR_AUTODATASEG_EXCEEDS_64k -Language=Bulgarian -ERROR_AUTODATASEG_EXCEEDS_64k - The operating system cannot run this application program. -. - -MessageId=200 -Severity=Success -Facility=System -SymbolicName=ERROR_RING2SEG_MUST_BE_MOVABLE -Language=Bulgarian -ERROR_RING2SEG_MUST_BE_MOVABLE - The code segment cannot be greater than or equal to 64K. -. - -MessageId=201 -Severity=Success -Facility=System -SymbolicName=ERROR_RELOC_CHAIN_XEEDS_SEGLIM -Language=Bulgarian -ERROR_RELOC_CHAIN_XEEDS_SEGLIM - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=202 -Severity=Success -Facility=System -SymbolicName=ERROR_INFLOOP_IN_RELOC_CHAIN -Language=Bulgarian -ERROR_INFLOOP_IN_RELOC_CHAIN - ホ褞璋韶 頌褌 趺 鈞頸 %1. -. - -MessageId=203 -Severity=Success -Facility=System -SymbolicName=ERROR_ENVVAR_NOT_FOUND -Language=Bulgarian -ERROR_ENVVAR_NOT_FOUND - The system could not find the environment option that was entered. -. - -MessageId=205 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_SIGNAL_SENT -Language=Bulgarian -ERROR_NO_SIGNAL_SENT - No process in the command subtree has a signal handler. -. - -MessageId=206 -Severity=Success -Facility=System -SymbolicName=ERROR_FILENAME_EXCED_RANGE -Language=Bulgarian -ERROR_FILENAME_EXCED_RANGE - ネ 琺 齏 瑰頏褊韃 顏 蓁竟. -. - -MessageId=207 -Severity=Success -Facility=System -SymbolicName=ERROR_RING2_STACK_IN_USE -Language=Bulgarian -ERROR_RING2_STACK_IN_USE - The ring 2 stack is in use. -. - -MessageId=208 -Severity=Success -Facility=System -SymbolicName=ERROR_META_EXPANSION_TOO_LONG -Language=Bulgarian -ERROR_META_EXPANSION_TOO_LONG - The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified. -. - -MessageId=209 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_SIGNAL_NUMBER -Language=Bulgarian -ERROR_INVALID_SIGNAL_NUMBER - The signal being posted is not correct. -. - -MessageId=210 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_1_INACTIVE -Language=Bulgarian -ERROR_THREAD_1_INACTIVE - The signal handler cannot be set. -. - -MessageId=212 -Severity=Success -Facility=System -SymbolicName=ERROR_LOCKED -Language=Bulgarian -ERROR_LOCKED - The segment is locked and cannot be reallocated. -. - -MessageId=214 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_MODULES -Language=Bulgarian -ERROR_TOO_MANY_MODULES - Too many dynamic-link modules are attached to this program or dynamic-link module. -. - -MessageId=215 -Severity=Success -Facility=System -SymbolicName=ERROR_NESTING_NOT_ALLOWED -Language=Bulgarian -ERROR_NESTING_NOT_ALLOWED - Cannot nest calls to LoadModule. -. - -MessageId=216 -Severity=Success -Facility=System -SymbolicName=ERROR_EXE_MACHINE_TYPE_MISMATCH -Language=Bulgarian -ERROR_EXE_MACHINE_TYPE_MISMATCH - The image file %1 is valid, but is for a machine type other than the current machine. -. - -MessageId=217 -Severity=Success -Facility=System -SymbolicName=ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY -Language=Bulgarian -ERROR_EXE_CANNOT_MODIFY_SIGNED_BINARY - The image file %1 is signed, unable to modify. -. - -MessageId=218 -Severity=Success -Facility=System -SymbolicName=ERRO_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY -Language=Bulgarian -ERRO_EXE_CANNOT_MODIFY_STRONG_SIGNED_BINARY - The image file %1 is strong signed, unable to modify. -. - -MessageId=230 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_PIPE -Language=Bulgarian -ERROR_BAD_PIPE - The pipe state is invalid. -. - -MessageId=231 -Severity=Success -Facility=System -SymbolicName=ERROR_PIPE_BUSY -Language=Bulgarian -ERROR_PIPE_BUSY - All pipe instances are busy. -. - -MessageId=232 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_DATA -Language=Bulgarian -ERROR_NO_DATA - The pipe is being closed. -. - -MessageId=233 -Severity=Success -Facility=System -SymbolicName=ERROR_PIPE_NOT_CONNECTED -Language=Bulgarian -ERROR_PIPE_NOT_CONNECTED - No process is on the other end of the pipe. -. - -MessageId=234 -Severity=Success -Facility=System -SymbolicName=ERROR_MORE_DATA -Language=Bulgarian -ERROR_MORE_DATA - ト肛 萵 裝. -. - -MessageId=240 -Severity=Success -Facility=System -SymbolicName=ERROR_VC_DISCONNECTED -Language=Bulgarian -ERROR_VC_DISCONNECTED - ム褥 磊 褊褊. -. - -MessageId=254 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EA_NAME -Language=Bulgarian -ERROR_INVALID_EA_NAME - The specified extended attribute name was invalid. -. - -MessageId=255 -Severity=Success -Facility=System -SymbolicName=ERROR_EA_LIST_INCONSISTENT -Language=Bulgarian -ERROR_EA_LIST_INCONSISTENT - ミ瑰頏褊 瑣鞦 裘褶鞣. -. - -MessageId=258 -Severity=Success -Facility=System -SymbolicName=WAIT_TIMEOUT -Language=Bulgarian -WAIT_TIMEOUT - The wait operation timed out. -. - -MessageId=259 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_ITEMS -Language=Bulgarian -ERROR_NO_MORE_ITEMS - No more data is available. -. - -MessageId=266 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_COPY -Language=Bulgarian -ERROR_CANNOT_COPY - ヤ 頏籵 趺 磊 頌鉋籵. -. - -MessageId=267 -Severity=Success -Facility=System -SymbolicName=ERROR_DIRECTORY -Language=Bulgarian -ERROR_DIRECTORY - ヘ裘褞 韲 蒻裲韋. -. - -MessageId=275 -Severity=Success -Facility=System -SymbolicName=ERROR_EAS_DIDNT_FIT -Language=Bulgarian -ERROR_EAS_DIDNT_FIT - The extended attributes did not fit in the buffer. -. - -MessageId=276 -Severity=Success -Facility=System -SymbolicName=ERROR_EA_FILE_CORRUPT -Language=Bulgarian -ERROR_EA_FILE_CORRUPT - The extended attribute file on the mounted file system is corrupt. -. - -MessageId=277 -Severity=Success -Facility=System -SymbolicName=ERROR_EA_TABLE_FULL -Language=Bulgarian -ERROR_EA_TABLE_FULL - The extended attribute table file is full. -. - -MessageId=278 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_EA_HANDLE -Language=Bulgarian -ERROR_INVALID_EA_HANDLE - The specified extended attribute handle is invalid. -. - -MessageId=282 -Severity=Success -Facility=System -SymbolicName=ERROR_EAS_NOT_SUPPORTED -Language=Bulgarian -ERROR_EAS_NOT_SUPPORTED - ム頏籵 琺籵 頌褌 蒿褞跖籵褪 瑰頏褊 瑣鞦. -. - -MessageId=288 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_OWNER -Language=Bulgarian -ERROR_NOT_OWNER - Attempt to release mutex not owned by caller. -. - -MessageId=298 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_POSTS -Language=Bulgarian -ERROR_TOO_MANY_POSTS - Too many posts were made to a semaphore. -. - -MessageId=299 -Severity=Success -Facility=System -SymbolicName=ERROR_PARTIAL_COPY -Language=Bulgarian -ERROR_PARTIAL_COPY - Only part of a ReadProcessMemory or WriteProcessMemory request was completed. -. - -MessageId=300 -Severity=Success -Facility=System -SymbolicName=ERROR_OPLOCK_NOT_GRANTED -Language=Bulgarian -ERROR_OPLOCK_NOT_GRANTED - The oplock request is denied. -. - -MessageId=301 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_OPLOCK_PROTOCOL -Language=Bulgarian -ERROR_INVALID_OPLOCK_PROTOCOL - An invalid oplock acknowledgment was received by the system. -. - -MessageId=302 -Severity=Success -Facility=System -SymbolicName=ERROR_DISK_TOO_FRAGMENTED -Language=Bulgarian -ERROR_DISK_TOO_FRAGMENTED - The volume is too fragmented to complete this operation. -. - -MessageId=303 -Severity=Success -Facility=System -SymbolicName=ERROR_DELETE_PENDING -Language=Bulgarian -ERROR_DELETE_PENDING - The file cannot be opened because it is in the process of being deleted. -. - -MessageId=317 -Severity=Success -Facility=System -SymbolicName=ERROR_MR_MID_NOT_FOUND -Language=Bulgarian -ERROR_MR_MID_NOT_FOUND - The system cannot find message text for message number 0x%1 in the message file for %2. -. - -MessageId=318 -Severity=Success -Facility=System -SymbolicName=ERROR_SCOPE_NOT_FOUND -Language=Bulgarian -ERROR_SCOPE_NOT_FOUND - The scope specified was not found. -. - -MessageId=487 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_ADDRESS -Language=Bulgarian -ERROR_INVALID_ADDRESS - Attempt to access invalid address. -. - -MessageId=534 -Severity=Success -Facility=System -SymbolicName=ERROR_ARITHMETIC_OVERFLOW -Language=Bulgarian -ERROR_ARITHMETIC_OVERFLOW - Arithmetic result exceeded 32 bits. -. - -MessageId=535 -Severity=Success -Facility=System -SymbolicName=ERROR_PIPE_CONNECTED -Language=Bulgarian -ERROR_PIPE_CONNECTED - There is a process on other end of the pipe. -. - -MessageId=536 -Severity=Success -Facility=System -SymbolicName=ERROR_PIPE_LISTENING -Language=Bulgarian -ERROR_PIPE_LISTENING - Waiting for a process to open the other end of the pipe. -. - -MessageId=537 -Severity=Success -Facility=System -SymbolicName=ERROR_ACPI_ERROR -Language=Bulgarian -ERROR_ACPI_ERROR - マ韈 鞦 蓴頌褌 ACPI. -. - -MessageId=538 -Severity=Success -Facility=System -SymbolicName=ERROR_ABIOS_ERROR -Language=Bulgarian -ERROR_ABIOS_ERROR - マ韈 鞦 蓴頌褌 ABIOS. -. - -MessageId=539 -Severity=Success -Facility=System -SymbolicName=ERROR_WX86_WARNING -Language=Bulgarian -ERROR_WX86_WARNING - A warning occurred in the WX86 subsystem. -. - -MessageId=540 -Severity=Success -Facility=System -SymbolicName=ERROR_WX86_ERROR -Language=Bulgarian -ERROR_WX86_ERROR - マ韈 鞦 蓴頌褌 WX86. -. - -MessageId=541 -Severity=Success -Facility=System -SymbolicName=ERROR_TIMER_NOT_CANCELED -Language=Bulgarian -ERROR_TIMER_NOT_CANCELED - An attempt was made to cancel or set a timer that has an associated APC and the subject thread is not the thread that originally set the timer with an associated APC routine. -. - -MessageId=542 -Severity=Success -Facility=System -SymbolicName=ERROR_UNWIND -Language=Bulgarian -ERROR_UNWIND - Unwind exception code. -. - -MessageId=543 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_STACK -Language=Bulgarian -ERROR_BAD_STACK - An invalid or unaligned stack was encountered during an unwind operation. -. - -MessageId=544 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_UNWIND_TARGET -Language=Bulgarian -ERROR_INVALID_UNWIND_TARGET - An invalid unwind target was encountered during an unwind operation. -. - -MessageId=545 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PORT_ATTRIBUTES -Language=Bulgarian -ERROR_INVALID_PORT_ATTRIBUTES - Invalid Object Attributes specified to NtCreatePort or invalid Port Attributes specified to NtConnectPort -. - -MessageId=546 -Severity=Success -Facility=System -SymbolicName=ERROR_PORT_MESSAGE_TOO_LONG -Language=Bulgarian -ERROR_PORT_MESSAGE_TOO_LONG - Length of message passed to NtRequestPort or NtRequestWaitReplyPort was longer than the maximum message allowed by the port. -. - -MessageId=547 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_QUOTA_LOWER -Language=Bulgarian -ERROR_INVALID_QUOTA_LOWER - An attempt was made to lower a quota limit below the current usage. -. - -MessageId=548 -Severity=Success -Facility=System -SymbolicName=ERROR_DEVICE_ALREADY_ATTACHED -Language=Bulgarian -ERROR_DEVICE_ALREADY_ATTACHED - An attempt was made to attach to a device that was already attached to another device. -. - -MessageId=549 -Severity=Success -Facility=System -SymbolicName=ERROR_INSTRUCTION_MISALIGNMENT -Language=Bulgarian -ERROR_INSTRUCTION_MISALIGNMENT - An attempt was made to execute an instruction at an unaligned address and the host system does not support unaligned instruction references. -. - -MessageId=550 -Severity=Success -Facility=System -SymbolicName=ERROR_PROFILING_NOT_STARTED -Language=Bulgarian -ERROR_PROFILING_NOT_STARTED - Profiling not started. -. - -MessageId=551 -Severity=Success -Facility=System -SymbolicName=ERROR_PROFILING_NOT_STOPPED -Language=Bulgarian -ERROR_PROFILING_NOT_STOPPED - Profiling not stopped. -. - -MessageId=552 -Severity=Success -Facility=System -SymbolicName=ERROR_COULD_NOT_INTERPRET -Language=Bulgarian -ERROR_COULD_NOT_INTERPRET - The passed ACL did not contain the minimum required information. -. - -MessageId=553 -Severity=Success -Facility=System -SymbolicName=ERROR_PROFILING_AT_LIMIT -Language=Bulgarian -ERROR_PROFILING_AT_LIMIT - The number of active profiling objects is at the maximum and no more may be started. -. - -MessageId=554 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_WAIT -Language=Bulgarian -ERROR_CANT_WAIT - Used to indicate that an operation cannot continue without blocking for I/O. -. - -MessageId=555 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_TERMINATE_SELF -Language=Bulgarian -ERROR_CANT_TERMINATE_SELF - Indicates that a thread attempted to terminate itself by default (called NtTerminateThread with NULL) and it was the last thread in the current process. -. - -MessageId=556 -Severity=Success -Facility=System -SymbolicName=ERROR_UNEXPECTED_MM_CREATE_ERR -Language=Bulgarian -ERROR_UNEXPECTED_MM_CREATE_ERR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. -. - -MessageId=557 -Severity=Success -Facility=System -SymbolicName=ERROR_UNEXPECTED_MM_MAP_ERROR -Language=Bulgarian -ERROR_UNEXPECTED_MM_MAP_ERROR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. -. - -MessageId=558 -Severity=Success -Facility=System -SymbolicName=ERROR_UNEXPECTED_MM_EXTEND_ERR -Language=Bulgarian -ERROR_UNEXPECTED_MM_EXTEND_ERR - If an MM error is returned which is not defined in the standard FsRtl filter, it is converted to one of the following errors which is guaranteed to be in the filter. In this case information is lost, however, the filter correctly handles the exception. -. - -MessageId=559 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_FUNCTION_TABLE -Language=Bulgarian -ERROR_BAD_FUNCTION_TABLE - A malformed function table was encountered during an unwind operation. -. - -MessageId=560 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_GUID_TRANSLATION -Language=Bulgarian -ERROR_NO_GUID_TRANSLATION - Indicates that an attempt was made to assign protection to a file system file or directory and one of the SIDs in the security descriptor could not be translated into a GUID that could be stored by the file system. This causes the protection attempt to fail, which may cause a file creation attempt to fail. -. - -MessageId=561 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LDT_SIZE -Language=Bulgarian -ERROR_INVALID_LDT_SIZE - Indicates that an attempt was made to grow an LDT by setting its size, or that the size was not an even number of selectors. -. - -MessageId=563 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LDT_OFFSET -Language=Bulgarian -ERROR_INVALID_LDT_OFFSET - Indicates that the starting value for the LDT information was not an integral multiple of the selector size. -. - -MessageId=564 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_LDT_DESCRIPTOR -Language=Bulgarian -ERROR_INVALID_LDT_DESCRIPTOR - Indicates that the user supplied an invalid descriptor when trying to set up Ldt descriptors. -. - -MessageId=565 -Severity=Success -Facility=System -SymbolicName=ERROR_TOO_MANY_THREADS -Language=Bulgarian -ERROR_TOO_MANY_THREADS - Indicates a process has too many threads to perform the requested action. For example, assignment of a primary token may only be performed when a process has zero or one threads. -. - -MessageId=566 -Severity=Success -Facility=System -SymbolicName=ERROR_THREAD_NOT_IN_PROCESS -Language=Bulgarian -ERROR_THREAD_NOT_IN_PROCESS - An attempt was made to operate on a thread within a specific process, but the thread specified is not in the process specified. -. - -MessageId=567 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGEFILE_QUOTA_EXCEEDED -Language=Bulgarian -ERROR_PAGEFILE_QUOTA_EXCEEDED - Page file quota was exceeded. -. - -MessageId=568 -Severity=Success -Facility=System -SymbolicName=ERROR_LOGON_SERVER_CONFLICT -Language=Bulgarian -ERROR_LOGON_SERVER_CONFLICT - The Netlogon service cannot start because another Netlogon service running in the domain conflicts with the specified role. -. - -MessageId=569 -Severity=Success -Facility=System -SymbolicName=ERROR_SYNCHRONIZATION_REQUIRED -Language=Bulgarian -ERROR_SYNCHRONIZATION_REQUIRED - The SAM database on a Windows Server is significantly out of synchronization with the copy on the Domain Controller. A complete synchronization is required. -. - -MessageId=570 -Severity=Success -Facility=System -SymbolicName=ERROR_NET_OPEN_FAILED -Language=Bulgarian -ERROR_NET_OPEN_FAILED - The NtCreateFile API failed. This error should never be returned to an application, it is a place holder for the Windows Lan Manager Redirector to use in its internal error mapping routines. -. - -MessageId=571 -Severity=Success -Facility=System -SymbolicName=ERROR_IO_PRIVILEGE_FAILED -Language=Bulgarian -ERROR_IO_PRIVILEGE_FAILED - The I/O permissions for the process could not be changed. -. - -MessageId=572 -Severity=Success -Facility=System -SymbolicName=ERROR_CONTROL_C_EXIT -Language=Bulgarian -ERROR_CONTROL_C_EXIT - The application terminated as a result of a CTRL+C. -. - -MessageId=573 -Severity=Success -Facility=System -SymbolicName=ERROR_MISSING_SYSTEMFILE -Language=Bulgarian -ERROR_MISSING_SYSTEMFILE - The required system file %hs is bad or missing. -. - -MessageId=574 -Severity=Success -Facility=System -SymbolicName=ERROR_UNHANDLED_EXCEPTION -Language=Bulgarian -ERROR_UNHANDLED_EXCEPTION - The exception %s (0x%08lx) occurred in the application at location 0x%08lx. -. - -MessageId=575 -Severity=Success -Facility=System -SymbolicName=ERROR_APP_INIT_FAILURE -Language=Bulgarian -ERROR_APP_INIT_FAILURE - The application failed to initialize properly (0x%lx). Click on OK to terminate the application. -. - -MessageId=576 -Severity=Success -Facility=System -SymbolicName=ERROR_PAGEFILE_CREATE_FAILED -Language=Bulgarian -ERROR_PAGEFILE_CREATE_FAILED - The creation of the paging file %hs failed (%lx). The requested size was %ld. -. - -MessageId=578 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_PAGEFILE -Language=Bulgarian -ERROR_NO_PAGEFILE - No paging file was specified in the system configuration. -. - -MessageId=579 -Severity=Success -Facility=System -SymbolicName=ERROR_ILLEGAL_FLOAT_CONTEXT -Language=Bulgarian -ERROR_ILLEGAL_FLOAT_CONTEXT - A real-mode application issued a floating-point instruction and floating-point hardware is not present. -. - -MessageId=580 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_EVENT_PAIR -Language=Bulgarian -ERROR_NO_EVENT_PAIR - An event pair synchronization operation was performed using the thread specific client/server event pair object, but no event pair object was associated with the thread. -. - -MessageId=581 -Severity=Success -Facility=System -SymbolicName=ERROR_DOMAIN_CTRLR_CONFIG_ERROR -Language=Bulgarian -ERROR_DOMAIN_CTRLR_CONFIG_ERROR - A Windows Server has an incorrect configuration. -. - -MessageId=582 -Severity=Success -Facility=System -SymbolicName=ERROR_ILLEGAL_CHARACTER -Language=Bulgarian -ERROR_ILLEGAL_CHARACTER - An illegal character was encountered. For a multi-byte character set this includes a lead byte without a succeeding trail byte. For the Unicode character set this includes the characters 0xFFFF and 0xFFFE. -. - -MessageId=583 -Severity=Success -Facility=System -SymbolicName=ERROR_UNDEFINED_CHARACTER -Language=Bulgarian -ERROR_UNDEFINED_CHARACTER - The Unicode character is not defined in the Unicode character set installed on the system. -. - -MessageId=584 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOPPY_VOLUME -Language=Bulgarian -ERROR_FLOPPY_VOLUME - The paging file cannot be created on a floppy diskette. -. - -MessageId=585 -Severity=Success -Facility=System -SymbolicName=ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT -Language=Bulgarian -ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT - The system bios failed to connect a system interrupt to the device or bus for which the device is connected. -. - -MessageId=586 -Severity=Success -Facility=System -SymbolicName=ERROR_BACKUP_CONTROLLER -Language=Bulgarian -ERROR_BACKUP_CONTROLLER - This operation is only allowed for the Primary Domain Controller of the domain. -. - -MessageId=587 -Severity=Success -Facility=System -SymbolicName=ERROR_MUTANT_LIMIT_EXCEEDED -Language=Bulgarian -ERROR_MUTANT_LIMIT_EXCEEDED - An attempt was made to acquire a mutant such that its maximum count would have been exceeded. -. - -MessageId=588 -Severity=Success -Facility=System -SymbolicName=ERROR_FS_DRIVER_REQUIRED -Language=Bulgarian -ERROR_FS_DRIVER_REQUIRED - A volume has been accessed for which a file system driver is required that has not yet been loaded. -. - -MessageId=589 -Severity=Success -Facility=System -SymbolicName=ERROR_CANNOT_LOAD_REGISTRY_FILE -Language=Bulgarian -ERROR_CANNOT_LOAD_REGISTRY_FILE - The registry cannot load the hive (file): %hs or its log or alternate. It is corrupt, absent, or not writable. -. - -MessageId=590 -Severity=Success -Facility=System -SymbolicName=ERROR_DEBUG_ATTACH_FAILED -Language=Bulgarian -ERROR_DEBUG_ATTACH_FAILED - An unexpected failure occurred while processing a DebugActiveProcess API request. You may choose OK to terminate the process, or Cancel to ignore the error. -. - -MessageId=591 -Severity=Success -Facility=System -SymbolicName=ERROR_SYSTEM_PROCESS_TERMINATED -Language=Bulgarian -ERROR_SYSTEM_PROCESS_TERMINATED - The %hs system process terminated unexpectedly with a status of 0x%08x (0x%08x 0x%08x). The system has been shut down. -. - -MessageId=592 -Severity=Success -Facility=System -SymbolicName=ERROR_DATA_NOT_ACCEPTED -Language=Bulgarian -ERROR_DATA_NOT_ACCEPTED - The TDI client could not handle the data received during an indication. -. - -MessageId=593 -Severity=Success -Facility=System -SymbolicName=ERROR_VDM_HARD_ERROR -Language=Bulgarian -ERROR_VDM_HARD_ERROR - NTVDM encountered a hard error. -. - -MessageId=594 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVER_CANCEL_TIMEOUT -Language=Bulgarian -ERROR_DRIVER_CANCEL_TIMEOUT - The driver %hs failed to complete a cancelled I/O request in the allotted time. -. - -MessageId=595 -Severity=Success -Facility=System -SymbolicName=ERROR_REPLY_MESSAGE_MISMATCH -Language=Bulgarian -ERROR_REPLY_MESSAGE_MISMATCH - An attempt was made to reply to an LPC message, but the thread specified by the client ID in the message was not waiting on that message. -. - -MessageId=596 -Severity=Success -Facility=System -SymbolicName=ERROR_LOST_WRITEBEHIND_DATA -Language=Bulgarian -ERROR_LOST_WRITEBEHIND_DATA - Windows was unable to save all the data for the file %hs. The data has been lost. This error may be caused by a failure of your computer hardware or network connection. Please try to save this file elsewhere. -. - -MessageId=597 -Severity=Success -Facility=System -SymbolicName=ERROR_CLIENT_SERVER_PARAMETERS_INVALID -Language=Bulgarian -ERROR_CLIENT_SERVER_PARAMETERS_INVALID - The parameter(s) passed to the server in the client/server shared memory window were invalid. Too much data may have been put in the shared memory window. -. - -MessageId=598 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_TINY_STREAM -Language=Bulgarian -ERROR_NOT_TINY_STREAM - The stream is not a tiny stream. -. - -MessageId=599 -Severity=Success -Facility=System -SymbolicName=ERROR_STACK_OVERFLOW_READ -Language=Bulgarian -ERROR_STACK_OVERFLOW_READ - The request must be handled by the stack overflow code. -. - -MessageId=600 -Severity=Success -Facility=System -SymbolicName=ERROR_CONVERT_TO_LARGE -Language=Bulgarian -ERROR_CONVERT_TO_LARGE - Internal OFS status codes indicating how an allocation operation is handled. Either it is retried after the containing onode is moved or the extent stream is converted to a large stream. -. - -MessageId=601 -Severity=Success -Facility=System -SymbolicName=ERROR_FOUND_OUT_OF_SCOPE -Language=Bulgarian -ERROR_FOUND_OUT_OF_SCOPE - The attempt to find the object found an object matching by ID on the volume but it is out of the scope of the handle used for the operation. -. - -MessageId=602 -Severity=Success -Facility=System -SymbolicName=ERROR_ALLOCATE_BUCKET -Language=Bulgarian -ERROR_ALLOCATE_BUCKET - The bucket array must be grown. Retry transaction after doing so. -. - -MessageId=603 -Severity=Success -Facility=System -SymbolicName=ERROR_MARSHALL_OVERFLOW -Language=Bulgarian -ERROR_MARSHALL_OVERFLOW - The user/kernel marshalling buffer has overflowed. -. - -MessageId=604 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_VARIANT -Language=Bulgarian -ERROR_INVALID_VARIANT - The supplied variant structure contains invalid data. -. - -MessageId=605 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_COMPRESSION_BUFFER -Language=Bulgarian -ERROR_BAD_COMPRESSION_BUFFER - The specified buffer contains ill-formed data. -. - -MessageId=606 -Severity=Success -Facility=System -SymbolicName=ERROR_AUDIT_FAILED -Language=Bulgarian -ERROR_AUDIT_FAILED - An attempt to generate a security audit failed. -. - -MessageId=607 -Severity=Success -Facility=System -SymbolicName=ERROR_TIMER_RESOLUTION_NOT_SET -Language=Bulgarian -ERROR_TIMER_RESOLUTION_NOT_SET - The timer resolution was not previously set by the current process. -. - -MessageId=608 -Severity=Success -Facility=System -SymbolicName=ERROR_INSUFFICIENT_LOGON_INFO -Language=Bulgarian -ERROR_INSUFFICIENT_LOGON_INFO - There is insufficient account information to log you on. -. - -MessageId=609 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_DLL_ENTRYPOINT -Language=Bulgarian -ERROR_BAD_DLL_ENTRYPOINT - The dynamic link library %hs is not written correctly. The stack pointer has been left in an inconsistent state. The entrypoint should be declared as WINAPI or STDCALL. Select YES to fail the DLL load. Select NO to continue execution. Selecting NO may cause the application to operate incorrectly. -. - -MessageId=610 -Severity=Success -Facility=System -SymbolicName=ERROR_BAD_SERVICE_ENTRYPOINT -Language=Bulgarian -ERROR_BAD_SERVICE_ENTRYPOINT - The %hs service is not written correctly. The stack pointer has been left in an inconsistent state. The callback entrypoint should be declared as WINAPI or STDCALL. Selecting OK will cause the service to continue operation. However, the service process may operate incorrectly. -. - -MessageId=611 -Severity=Success -Facility=System -SymbolicName=ERROR_IP_ADDRESS_CONFLICT1 -Language=Bulgarian -ERROR_IP_ADDRESS_CONFLICT1 - There is an IP address conflict with another system on the network -. - -MessageId=612 -Severity=Success -Facility=System -SymbolicName=ERROR_IP_ADDRESS_CONFLICT2 -Language=Bulgarian -ERROR_IP_ADDRESS_CONFLICT2 - There is an IP address conflict with another system on the network -. - -MessageId=613 -Severity=Success -Facility=System -SymbolicName=ERROR_REGISTRY_QUOTA_LIMIT -Language=Bulgarian -ERROR_REGISTRY_QUOTA_LIMIT - The system has reached the maximum size allowed for the system part of the registry. Additional storage requests will be ignored. -. - -MessageId=614 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_CALLBACK_ACTIVE -Language=Bulgarian -ERROR_NO_CALLBACK_ACTIVE - A callback return system service cannot be executed when no callback is active. -. - -MessageId=615 -Severity=Success -Facility=System -SymbolicName=ERROR_PWD_TOO_SHORT -Language=Bulgarian -ERROR_PWD_TOO_SHORT - The password provided is too short to meet the policy of your user account. Please choose a longer password. -. - -MessageId=616 -Severity=Success -Facility=System -SymbolicName=ERROR_PWD_TOO_RECENT -Language=Bulgarian -ERROR_PWD_TOO_RECENT - The policy of your user account does not allow you to change passwords too frequently. This is done to prevent users from changing back to a familiar, but potentially discovered, password. If you feel your password has been compromised then please contact your administrator immediately to have a new one assigned. -. - -MessageId=617 -Severity=Success -Facility=System -SymbolicName=ERROR_PWD_HISTORY_CONFLICT -Language=Bulgarian -ERROR_PWD_HISTORY_CONFLICT - You have attempted to change your password to one that you have used in the past. The policy of your user account does not allow this. Please select a password that you have not previously used. -. - -MessageId=618 -Severity=Success -Facility=System -SymbolicName=ERROR_UNSUPPORTED_COMPRESSION -Language=Bulgarian -ERROR_UNSUPPORTED_COMPRESSION - The specified compression format is unsupported. -. - -MessageId=619 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_HW_PROFILE -Language=Bulgarian -ERROR_INVALID_HW_PROFILE - The specified hardware profile configuration is invalid. -. - -MessageId=620 -Severity=Success -Facility=System -SymbolicName=ERROR_INVALID_PLUGPLAY_DEVICE_PATH -Language=Bulgarian -ERROR_INVALID_PLUGPLAY_DEVICE_PATH - The specified Plug and Play registry device path is invalid. -. - -MessageId=621 -Severity=Success -Facility=System -SymbolicName=ERROR_QUOTA_LIST_INCONSISTENT -Language=Bulgarian -ERROR_QUOTA_LIST_INCONSISTENT - The specified quota list is internally inconsistent with its descriptor. -. - -MessageId=622 -Severity=Success -Facility=System -SymbolicName=ERROR_EVALUATION_EXPIRATION -Language=Bulgarian -ERROR_EVALUATION_EXPIRATION - The evaluation period for this installation of Windows has expired. This system will shutdown in 1 hour. To restore access to this installation of Windows, please upgrade this installation using a licensed distribution of this product. -. - -MessageId=623 -Severity=Success -Facility=System -SymbolicName=ERROR_ILLEGAL_DLL_RELOCATION -Language=Bulgarian -ERROR_ILLEGAL_DLL_RELOCATION - The system DLL %hs was relocated in memory. The application will not run properly. The relocation occurred because the DLL %hs occupied an address range reserved for Windows system DLLs. The vendor supplying the DLL should be contacted for a new DLL. -. - -MessageId=624 -Severity=Success -Facility=System -SymbolicName=ERROR_DLL_INIT_FAILED_LOGOFF -Language=Bulgarian -ERROR_DLL_INIT_FAILED_LOGOFF - The application failed to initialize because the window station is shutting down. -. - -MessageId=625 -Severity=Success -Facility=System -SymbolicName=ERROR_VALIDATE_CONTINUE -Language=Bulgarian -ERROR_VALIDATE_CONTINUE - The validation process needs to continue on to the next step. -. - -MessageId=626 -Severity=Success -Facility=System -SymbolicName=ERROR_NO_MORE_MATCHES -Language=Bulgarian -ERROR_NO_MORE_MATCHES - There are no more matches for the current index enumeration. -. - -MessageId=627 -Severity=Success -Facility=System -SymbolicName=ERROR_RANGE_LIST_CONFLICT -Language=Bulgarian -ERROR_RANGE_LIST_CONFLICT - The range could not be added to the range list because of a conflict. -. - -MessageId=628 -Severity=Success -Facility=System -SymbolicName=ERROR_SERVER_SID_MISMATCH -Language=Bulgarian -ERROR_SERVER_SID_MISMATCH - The server process is running under a SID different than that required by client. -. - -MessageId=629 -Severity=Success -Facility=System -SymbolicName=ERROR_CANT_ENABLE_DENY_ONLY -Language=Bulgarian -ERROR_CANT_ENABLE_DENY_ONLY - A group marked use for deny only cannot be enabled. -. - -MessageId=630 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOAT_MULTIPLE_FAULTS -Language=Bulgarian -ERROR_FLOAT_MULTIPLE_FAULTS - Multiple floating point faults. -. - -MessageId=631 -Severity=Success -Facility=System -SymbolicName=ERROR_FLOAT_MULTIPLE_TRAPS -Language=Bulgarian -ERROR_FLOAT_MULTIPLE_TRAPS - Multiple floating point traps. -. - -MessageId=632 -Severity=Success -Facility=System -SymbolicName=ERROR_NOINTERFACE -Language=Bulgarian -ERROR_NOINTERFACE - The requested interface is not supported. -. - -MessageId=633 -Severity=Success -Facility=System -SymbolicName=ERROR_DRIVER_FAILED_SLEEP -Language=Bulgarian -ERROR_DRIVER_FAILED_SLEEP - The driver %hs does not support standby mode. Updating this driver may allow the system to go to standby mode. -. - -MessageId=634 -Severity=Success -Facility=System -SymbolicName=ERROR_CORRUPT_SYSTEM_FILE -Language=Bulgarian -ERROR_CORRUPT_SYSTEM_FILE - The system file %1 has become corrupt and has been replaced. -. - -MessageId=635 -Severity=Success -Facility=System -SymbolicName=ERROR_COMMITMENT_MINIMUM -Language=Bulgarian -ERROR_COMMITMENT_MINIMUM - Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied. For more information, see Help. -. - -MessageId=636 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_RESTART_ENUMERATION -Language=Bulgarian -ERROR_PNP_RESTART_ENUMERATION - A device was removed so enumeration must be restarted. -. - -MessageId=637 -Severity=Success -Facility=System -SymbolicName=ERROR_SYSTEM_IMAGE_BAD_SIGNATURE -Language=Bulgarian -ERROR_SYSTEM_IMAGE_BAD_SIGNATURE - The system image %s is not properly signed. The file has been replaced with the signed file. The system has been shut down. -. - -MessageId=638 -Severity=Success -Facility=System -SymbolicName=ERROR_PNP_REBOOT_REQUIRED -Language=Bulgarian -ERROR_PNP_REBOOT_REQUIRED - Device will not start without a reboot. -. - -MessageId=639 -Severity=Success -Facility=System -SymbolicName=ERROR_INSUFFICIENT_POWER -Language=Bulgarian -ERROR_INSUFFICIENT_POWER - There is not enough power to complete the requested operation. -. - -MessageId=641 -Severity=Success -Facility=System -SymbolicName=ERROR_SYSTEM_SHUTDOWN -Language=Bulgarian -ERROR_SYSTEM_SHUTDOWN - The system is in the process of shutting down. -. - -MessageId=642 -Severity=Success -Facility=System -SymbolicName=ERROR_PORT_NOT_SET -Language=Bulgarian -ERROR_PORT_NOT_SET - An attempt to remove a processes DebugPort was made, but a port was not already associated with the process. -. - -MessageId=643 -Severity=Success -Facility=System -SymbolicName=ERROR_DS_VERSION_CHECK_FAILURE -Language=Bulgarian -ERROR_DS_VERSION_CHECK_FAILURE - This version of Windows is not compatible with the behavior version of directory forest, domain or domain controller. -. - -MessageId=644 -Severity=Success -Facility=System -SymbolicName=ERROR_RANGE_NOT_FOUND -Language=Bulgarian -ERROR_RANGE_NOT_FOUND - The specified range could not be found in the range list. -. - -MessageId=646 -Severity=Success -Facility=System -SymbolicName=ERROR_NOT_SAFE_MODE_DRIVER -Language=Bulgarian -ERROR_NOT_SAFE_MODE_DRIVER - The driver was not loaded because the system is booting into safe mode. -. - -MessageId=647 -Severity=Success -Facility=System -SymbolicName=ERROR_FAILED_DRIVER_ENTRY -Language=Bulgarian -ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. +ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed its initialization call. . MessageId=648 diff --git a/dll/win32/kernel32/lang/de-DE.mc b/dll/win32/kernel32/lang/de-DE.mc index 04d9f804689..13c1381a7e7 100644 --- a/dll/win32/kernel32/lang/de-DE.mc +++ b/dll/win32/kernel32/lang/de-DE.mc @@ -101,7 +101,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INVALID_BLOCK Language=German -ERROR_INVALID_BLOCK - Die Speicherkontrolladdresse ist ungltig. +ERROR_INVALID_BLOCK - Die Speicherkontrolladresse ist ungltig. . MessageId=10 @@ -885,7 +885,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SUBST_TO_SUBST Language=German -ERROR_SUBST_TO_SUBST -Das System versuchte ein Verzeichnis zu einem Laufwerk auf einen gesubsteten Laufwerk zu substen. +ERROR_SUBST_TO_SUBST - Das System versuchte ein Verzeichnis zu einem Laufwerk auf einen gesubsteten Laufwerk zu substen. . MessageId=140 @@ -965,7 +965,7 @@ Severity=Success Facility=System SymbolicName=ERROR_IS_SUBST_TARGET Language=German -ERROR_IS_SUBST_TARGET - Es wurde versucht, von einem Laufwerk zu substen oder zu joinen das schon gesubst ist. +ERROR_IS_SUBST_TARGET - Es wurde versucht, von einem Laufwerk zu substen oder zu joinen, das schon gesubst ist. . MessageId=150 @@ -1093,7 +1093,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BUSY Language=German -ERROR_BUSY - Die angeforderte Ressource wird beutzt. +ERROR_BUSY - Die angeforderte Ressource wird benutzt. . MessageId=173 @@ -1109,7 +1109,7 @@ Severity=Success Facility=System SymbolicName=ERROR_ATOMIC_LOCKS_NOT_SUPPORTED Language=German -ERROR_ATOMIC_LOCKS_NOT_SUPPORTED - Das Dateisysten untersttzt keine ununterbrechbaren Sperrungen. +ERROR_ATOMIC_LOCKS_NOT_SUPPORTED - Das Dateisysten untersttzt keine nicht unterbrechbaren Sperren. . MessageId=180 @@ -1229,7 +1229,7 @@ Severity=Success Facility=System SymbolicName=ERROR_IOPL_NOT_ENABLED Language=German -ERROR_IOPL_NOT_ENABLED - Das Betriebssystem ist zur Zeit nicht konfiguiert, um dieses Programm auszufhren. +ERROR_IOPL_NOT_ENABLED - Das Betriebssystem ist zur Zeit nicht konfiguriert, um dieses Programm auszufhren. . MessageId=198 @@ -1277,7 +1277,7 @@ Severity=Success Facility=System SymbolicName=ERROR_ENVVAR_NOT_FOUND Language=German -ERROR_ENVVAR_NOT_FOUND - Das System konnte die Umgebungs-Option, die eingegeben wurde, nicht finden. +ERROR_ENVVAR_NOT_FOUND - Das System konnte die Umgebungsvariable, die eingegeben wurde, nicht finden. . MessageId=205 @@ -1309,7 +1309,7 @@ Severity=Success Facility=System SymbolicName=ERROR_META_EXPANSION_TOO_LONG Language=German -ERROR_META_EXPANSION_TOO_LONG - Es wurden zu viele Platzhalter, wie ? oder *, eingegeben. +ERROR_META_EXPANSION_TOO_LONG - Es wurden zu viele Platzhalter wie ? oder * eingegeben. . MessageId=209 @@ -1341,7 +1341,7 @@ Severity=Success Facility=System SymbolicName=ERROR_TOO_MANY_MODULES Language=German -ERROR_TOO_MANY_MODULES - Es werden zu viele DLLs von diesem Programm oder DLL benutzt. +ERROR_TOO_MANY_MODULES - Es werden zu viele DLLs von diesem Programm oder dieser DLL benutzt. . MessageId=215 @@ -1653,7 +1653,7 @@ Severity=Success Facility=System SymbolicName=ERROR_TIMER_NOT_CANCELED Language=German -ERROR_TIMER_NOT_CANCELED - Es wurde der Versuch gemacht, einen Timer zu setzen oder zu lschen, der nicht dem Aufrufer gehrt. +ERROR_TIMER_NOT_CANCELED - Es wurde der Versuch unternommen, einen Timer zu setzen oder zu lschen, der nicht dem Aufrufer gehrt. . MessageId=542 @@ -1717,7 +1717,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INSTRUCTION_MISALIGNMENT Language=German -ERROR_INSTRUCTION_MISALIGNMENT - Es wurde versucht, einen Befehl an einer nicht angeschlossenen Adresse auzufhren, was dieses System nicht untersttzt. +ERROR_INSTRUCTION_MISALIGNMENT - Es wurde versucht, einen Befehl an einer nicht angeschlossenen Adresse auszufhren, was dieses System nicht untersttzt. . MessageId=550 @@ -1861,7 +1861,7 @@ Severity=Success Facility=System SymbolicName=ERROR_LOGON_SERVER_CONFLICT Language=German -ERROR_LOGON_SERVER_CONFLICT - Der Netlogon-Dienst kann nicht starten weil ein anderer Netlogon-Dienst mit der gleichen Rolle lauft und ein Dom舅en-Konflikt auftritt. +ERROR_LOGON_SERVER_CONFLICT - Der Netlogon-Dienst kann nicht starten, weil ein anderer Netlogon-Dienst mit der gleichen Rolle l舫ft und ein Dom舅en-Konflikt auftritt. . MessageId=569 @@ -1965,7 +1965,7 @@ Severity=Success Facility=System SymbolicName=ERROR_ILLEGAL_CHARACTER Language=German -ERROR_ILLEGAL_CHARACTER - Es wurde ein illegales Zeichen gefunden. Fr einen Multi-Byte-Zeichensatz schlie゚t dies ein Fhrungs-Byte ohne ein fogendes Anschluss-Byte ein. Fr den Unicode-Zeichensatz schlie゚t dies die Zeichen 0xFFFF und 0xFFFE ein. +ERROR_ILLEGAL_CHARACTER - Es wurde ein ungltiges Zeichen gefunden. Fr einen Multi-Byte-Zeichensatz schlie゚t dies ein Fhrungs-Byte ohne ein folgendes Anschluss-Byte ein. Fr den Unicode-Zeichensatz schlie゚t dies die Zeichen 0xFFFF und 0xFFFE ein. . MessageId=583 @@ -1989,7 +1989,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT Language=German -ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT - Das System-BIOS konnte einen Systeminterupt nicht an das Ger舩 oder dessen Bus verbinden. +ERROR_BIOS_FAILED_TO_CONNECT_INTERRUPT - Das System-BIOS konnte einen Systeminterrupt nicht an das Ger舩 oder dessen Bus weiterleiten. . MessageId=586 @@ -2021,7 +2021,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CANNOT_LOAD_REGISTRY_FILE Language=German -ERROR_CANNOT_LOAD_REGISTRY_FILE - Die Registrierungsdatenbank kann den Zweig nicht laden: %hs, sein Log oder die Alternative. Sie ist korrupt, fehlt oder ist nicht beschreibbar. +ERROR_CANNOT_LOAD_REGISTRY_FILE - Die Registrierungsdatenbank kann den Zweig nicht laden: %hs, sein Log oder die Alternative. Sie ist besch臈igt, fehlt oder ist nicht beschreibbar. . MessageId=590 @@ -2109,7 +2109,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CONVERT_TO_LARGE Language=German -ERROR_CONVERT_TO_LARGE - Interne OFS-Statuscodes zeigen an, dass eine Allokation behandelt wird. Either es ist retried after the containing onode ist moved oder the extent Stream ist converted to ein lang Stream. +ERROR_CONVERT_TO_LARGE - Interne OFS-Statuscodes zeigen an, dass eine Allokation behandelt wird. Entweder wird es erneut versucht, nachdem der kontaktierende Knoten verschoben wurde, oder der erweiterte Stream wird in einen langen Stream konvertiert. . MessageId=601 @@ -2117,7 +2117,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FOUND_OUT_OF_SCOPE Language=German -ERROR_FOUND_OUT_OF_SCOPE - Der Versuch to find the Objekt gefunden ein Objekt matching von ID on der datentr臠er aber es ist out von the bereich von the Handle used fr the Operation. +ERROR_FOUND_OUT_OF_SCOPE - Ein Objekt, das der ID des Datentr臠ers entspricht, wurde gefunden, aber es ist au゚erhalb des Bereichs fr das Handle fr diesen Vorgang. . MessageId=602 @@ -2125,7 +2125,7 @@ Severity=Success Facility=System SymbolicName=ERROR_ALLOCATE_BUCKET Language=German -ERROR_ALLOCATE_BUCKET - The bucket array must be grown. Retry transaction after doing so. +ERROR_ALLOCATE_BUCKET - Das Bucketarray muss vergr゚ert werden. Versuchen Sie es anschlie゚end erneut. . MessageId=603 @@ -2165,7 +2165,7 @@ Severity=Success Facility=System SymbolicName=ERROR_TIMER_RESOLUTION_NOT_SET Language=German -ERROR_TIMER_RESOLUTION_NOT_SET - Die Auflsung des Zeitgebers wurde vorher nicht vom aktuellen Ptozess gesetzt. +ERROR_TIMER_RESOLUTION_NOT_SET - Die Auflsung des Zeitgebers wurde vorher nicht vom aktuellen Prozess gesetzt. . MessageId=608 @@ -2173,7 +2173,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INSUFFICIENT_LOGON_INFO Language=German -ERROR_INSUFFICIENT_LOGON_INFO - Es gibt zu wenig Account-Informationen um sich einzuloggen. +ERROR_INSUFFICIENT_LOGON_INFO - Es gibt zu wenig Account-Informationen, um sich einzuloggen. . MessageId=609 @@ -2181,7 +2181,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BAD_DLL_ENTRYPOINT Language=German -ERROR_BAD_DLL_ENTRYPOINT - Die DLL %hs wurde nicht korrekt geschrieben. Der Stack-Zeiger wurde in einem unvereinbaren Status gelassen. The entrypoint should be declared as WINAPI or STDCALL. Select YES to fail the DLL load. Select NO to continue execution. Selecting NO may cause the Programm to operate incorrectly. +ERROR_BAD_DLL_ENTRYPOINT - Die DLL %hs wurde nicht korrekt geschrieben. Der Stack-Zeiger wurde in einem unvereinbaren Status gelassen. Der Einstiegspunkt sollte als WINAPI oder STDCALL deklariert werden. W臧len Sie JA aus, um das Laden der DLL abzubrechen. W臧len sie NEIN aus, um die Ausfhrung fortzusetzen. Die Auswahl von NEIN knnte dazu fhren, dass das Programm nicht richtig funktioniert. . MessageId=610 @@ -2189,7 +2189,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BAD_SERVICE_ENTRYPOINT Language=German -ERROR_BAD_SERVICE_ENTRYPOINT - Der %hs-Dienst wurde nicht korrekt geschrieben. Der Stack-Zeiger wurde in einem unvereinbaren Status gelassen. The callback entrypoint should be declared as WINAPI oder STDCALL. Selecting OK will cause the service to continue Operation. However, the service Prozess may operate incorrectly. +ERROR_BAD_SERVICE_ENTRYPOINT - Der %hs-Dienst wurde nicht korrekt geschrieben. Der Stack-Zeiger wurde in einem unvereinbaren Status gelassen. Der Callback-Einstiegspunkt sollte als WINAPI oder STDCALL deklariert werden. Die Auswahl OK wird die Ausfhrung des Prozesses fortsetzen. Der Dienstprozess knnte jedoch fehlerhaft arbeiten. . MessageId=611 @@ -2213,7 +2213,7 @@ Severity=Success Facility=System SymbolicName=ERROR_REGISTRY_QUOTA_LIMIT Language=German -ERROR_REGISTRY_QUOTA_LIMIT - Der Systemteil der Registierungsdatenbank erreichte seine maximale Gr゚e. Weitere Speicheranforderungen werden ignoriert. +ERROR_REGISTRY_QUOTA_LIMIT - Der Systemteil der Registrierungsdatenbank erreichte seine maximale Gr゚e. Weitere Speicheranforderungen werden ignoriert. . MessageId=614 @@ -2245,7 +2245,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PWD_HISTORY_CONFLICT Language=German -ERROR_PWD_HISTORY_CONFLICT - Das Passwort wurde schon einaml benutzt, was in den Richtlinien verboten ist. +ERROR_PWD_HISTORY_CONFLICT - Das Passwort wurde schon einmal benutzt, was in den Richtlinien verboten ist. . MessageId=618 @@ -2317,7 +2317,7 @@ Severity=Success Facility=System SymbolicName=ERROR_NO_MORE_MATCHES Language=German -ERROR_NO_MORE_MATCHES - There are no more matches for the current index enumeration. +ERROR_NO_MORE_MATCHES - Es gibt keine weiteren ワbereinstimmungen fr die derzeitige Indexaufz臧lung. . MessageId=627 @@ -2325,7 +2325,7 @@ Severity=Success Facility=System SymbolicName=ERROR_RANGE_LIST_CONFLICT Language=German -ERROR_RANGE_LIST_CONFLICT - The range could not be added to the range list because of a conflict. +ERROR_RANGE_LIST_CONFLICT - Der Bereich konnte wegen eines Konflikts nicht in die Bereichsliste bernommen werden. . MessageId=628 @@ -2333,7 +2333,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SERVER_SID_MISMATCH Language=German -ERROR_SERVER_SID_MISMATCH - The server process is running under a SID different than that required by client. +ERROR_SERVER_SID_MISMATCH - Der Serverprozess l舫ft unter einer SID, die sich von der vom Client angeforderten unterscheidet. . MessageId=629 @@ -2349,7 +2349,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FLOAT_MULTIPLE_FAULTS Language=German -ERROR_FLOAT_MULTIPLE_FAULTS - Multiple floating point faults. +ERROR_FLOAT_MULTIPLE_FAULTS - Mehrere Flie゚kommafehler. . MessageId=631 @@ -2357,7 +2357,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FLOAT_MULTIPLE_TRAPS Language=German -ERROR_FLOAT_MULTIPLE_TRAPS - Multiple floating point traps. +ERROR_FLOAT_MULTIPLE_TRAPS - Mehrere Flie゚kommafallen. . MessageId=632 @@ -2365,7 +2365,7 @@ Severity=Success Facility=System SymbolicName=ERROR_NOINTERFACE Language=German -ERROR_NOINTERFACE - The requested interface is not supported. +ERROR_NOINTERFACE - Das angeforderte Interface wird nicht untersttzt. . MessageId=633 @@ -2373,7 +2373,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DRIVER_FAILED_SLEEP Language=German -ERROR_DRIVER_FAILED_SLEEP - The driver %hs does not support standby mode. Updating this driver may allow the system to go to standby mode. +ERROR_DRIVER_FAILED_SLEEP - Der Treiber %hs untersttzt keinen Stromsparmodus. Die Aktualisierung des Treibers knnte dem System den Stromsparmodus ermglichen. . MessageId=634 @@ -2381,7 +2381,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CORRUPT_SYSTEM_FILE Language=German -ERROR_CORRUPT_SYSTEM_FILE - The system file %1 has become corrupt and has been replaced. +ERROR_CORRUPT_SYSTEM_FILE - Die Systemdatei %1 wurde besch臈igt und ausgewechselt. . MessageId=635 @@ -2389,7 +2389,7 @@ Severity=Success Facility=System SymbolicName=ERROR_COMMITMENT_MINIMUM Language=German -ERROR_COMMITMENT_MINIMUM - Your system is low on virtual memory. ReactOS is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied. For more information, see Help. +ERROR_COMMITMENT_MINIMUM - Ihr System hat nur noch wenig virtuellen Speicher. ReactOS vergr゚ert ihre Pagingdatei. W臧rend dieses Vorgangs knnten Speicheranfragen von Anwendungen abgelehnt werden. Fr weitere Informationen siehe Hilfe. . MessageId=636 @@ -2397,7 +2397,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_RESTART_ENUMERATION Language=German -ERROR_PNP_RESTART_ENUMERATION - A device was removed so enumeration must be restarted. +ERROR_PNP_RESTART_ENUMERATION - Ein Ger舩 wurde entfernt, so dass die Nummerierung neu gestartet werden muss. . MessageId=637 @@ -2405,7 +2405,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SYSTEM_IMAGE_BAD_SIGNATURE Language=German -ERROR_SYSTEM_IMAGE_BAD_SIGNATURE - The system image %s is not properly signed. The file has been replaced with the signed file. The system has been shut down. +ERROR_SYSTEM_IMAGE_BAD_SIGNATURE - Das Systemabbild %s wurde nicht korrekt signiert. Die Datei wurde mit der signierten Datei ersetzt. Das System wurde heruntergefahren. . MessageId=638 @@ -2413,7 +2413,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_REBOOT_REQUIRED Language=German -ERROR_PNP_REBOOT_REQUIRED - Device will not start without a reboot. +ERROR_PNP_REBOOT_REQUIRED - Das Ger舩 wird ohne einen Neustart nicht gestartet werden. . MessageId=639 @@ -2421,7 +2421,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INSUFFICIENT_POWER Language=German -ERROR_INSUFFICIENT_POWER - There is not enough power to complete the requested operation. +ERROR_INSUFFICIENT_POWER - Es gibt nicht genug Strom, um den angeforderten Vorgang abzuschlie゚en. . MessageId=641 @@ -2429,7 +2429,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SYSTEM_SHUTDOWN Language=German -ERROR_SYSTEM_SHUTDOWN - The system is in the process of shutting down. +ERROR_SYSTEM_SHUTDOWN - Das System wird heruntergefahren. . MessageId=642 @@ -2437,7 +2437,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PORT_NOT_SET Language=German -ERROR_PORT_NOT_SET - An attempt to remove a processes DebugPort was made, but a port was not already associated with the process. +ERROR_PORT_NOT_SET - Ein Versuch, den DebugPort eines Prozesses zu entfernen, wurde unternommen, aber dem Prozess war noch kein solcher Port zugewiesen. . MessageId=643 @@ -2453,7 +2453,7 @@ Severity=Success Facility=System SymbolicName=ERROR_RANGE_NOT_FOUND Language=German -ERROR_RANGE_NOT_FOUND - The specified range could not be found in the range list. +ERROR_RANGE_NOT_FOUND - Der angegebene Bereich konnte nicht in der Bereichsliste gefunden werden. . MessageId=646 @@ -2461,7 +2461,7 @@ Severity=Success Facility=System SymbolicName=ERROR_NOT_SAFE_MODE_DRIVER Language=German -ERROR_NOT_SAFE_MODE_DRIVER - The driver was not loaded because the system is booting into safe mode. +ERROR_NOT_SAFE_MODE_DRIVER - Der Treiber wurde nicht geladen, da das System im sicheren Modus gestartet wird. . MessageId=647 @@ -2469,7 +2469,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FAILED_DRIVER_ENTRY Language=German -ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. +ERROR_FAILED_DRIVER_ENTRY - Der Treiber wurde nicht geladen, weil sein Initialisierungsaufruf fehlschlug. . MessageId=648 @@ -2477,7 +2477,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DEVICE_ENUMERATION_ERROR Language=German -ERROR_DEVICE_ENUMERATION_ERROR - The \"%hs\" encountered an error while applying power or reading the device configuration. This may be caused by a failure of your hardware or by a poor connection. +ERROR_DEVICE_ENUMERATION_ERROR - Es ist ein Fehler mit \"%hs\" bei der Stromversorgung oder bei der Prfung der Ger舩eeigenschaften aufgetreten. Dies knnte an einem Hardwarefehler oder an einer schlechten Verbindung liegen. . MessageId=649 @@ -2485,7 +2485,7 @@ Severity=Success Facility=System SymbolicName=ERROR_MOUNT_POINT_NOT_RESOLVED Language=German -ERROR_MOUNT_POINT_NOT_RESOLVED - The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached. +ERROR_MOUNT_POINT_NOT_RESOLVED - Der Erstellvorgang ist fehlgeschlagen, da der Name mindestens einen Mountpunkt enthielt, der auf eine Partition zeigt, an die das angegebene Ger舩 nicht angeh舅gt ist. . MessageId=650 @@ -2493,7 +2493,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INVALID_DEVICE_OBJECT_PARAMETER Language=German -ERROR_INVALID_DEVICE_OBJECT_PARAMETER - The device object parameter is either not a valid device object or is not attached to the volume specified by the file name. +ERROR_INVALID_DEVICE_OBJECT_PARAMETER - Der Ger舩eparameter ist entweder kein gltiges Ger舩 oder nicht an den im Dateinamen angegebenen Datentr臠er angeh舅gt. . MessageId=651 @@ -2501,7 +2501,7 @@ Severity=Success Facility=System SymbolicName=ERROR_MCA_OCCURED Language=German -ERROR_MCA_OCCURED - A Machine Check Error has occurred. Please check the system eventlog for additional information. +ERROR_MCA_OCCURED - Ein Computerprffehler ist aufgetreten. Bitte berprfen Sie die Ereignisanzeige fr weitere Informationen. . MessageId=652 @@ -2509,7 +2509,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DRIVER_DATABASE_ERROR Language=German -ERROR_DRIVER_DATABASE_ERROR - There was error [%2] processing the driver database. +ERROR_DRIVER_DATABASE_ERROR - Fehler [%2] ist beim Verarbeiten der Ger舩edatenbank aufgetreten. . MessageId=653 @@ -2517,7 +2517,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SYSTEM_HIVE_TOO_LARGE Language=German -ERROR_SYSTEM_HIVE_TOO_LARGE - System hive size has exceeded its limit. +ERROR_SYSTEM_HIVE_TOO_LARGE - Die Gr゚e des Systemzweiges hat ihre Grenze berschritten. . MessageId=654 @@ -2525,7 +2525,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DRIVER_FAILED_PRIOR_UNLOAD Language=German -ERROR_DRIVER_FAILED_PRIOR_UNLOAD - The driver could not be loaded because a previous version of the driver is still in memory. +ERROR_DRIVER_FAILED_PRIOR_UNLOAD - Der Treiber konnte nicht geladen werden, da sich eine frhere Version des Treibers noch im Speicher befindet. . MessageId=655 @@ -2533,7 +2533,7 @@ Severity=Success Facility=System SymbolicName=ERROR_VOLSNAP_PREPARE_HIBERNATE Language=German -ERROR_VOLSNAP_PREPARE_HIBERNATE - Please wait while the Volume Shadow Copy Service prepares volume %hs for hibernation. +ERROR_VOLSNAP_PREPARE_HIBERNATE - Bitte warten Sie, w臧rend der Schattenkopiedienst das Laufwerk %hs auf den Ruhezustand vorbereitet. . MessageId=656 @@ -2549,7 +2549,7 @@ Severity=Success Facility=System SymbolicName=ERROR_HUNG_DISPLAY_DRIVER_THREAD Language=German -ERROR_HUNG_DISPLAY_DRIVER_THREAD - The %hs display driver has stopped working normally. Save your work and reboot the system to restore full display functionality. The next time you reboot the machine a dialog will be displayed giving you a chance to report this failure to Microsoft. +ERROR_HUNG_DISPLAY_DRIVER_THREAD - Der Anzeigetreiber %hs funktioniert nicht mehr normal. Speichern Sie Ihre Daten und starten Sie das System neu, um die volle Anzeigefunktionalit舩 wiederherzustellen. Beim n臘hsten Start des Computers wird ein Dialog erscheinen, der es Ihnen ermglicht, Microsoft diesen Fehler zu melden. . MessageId=665 @@ -2557,7 +2557,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FILE_SYSTEM_LIMITATION Language=German -ERROR_FILE_SYSTEM_LIMITATION - The requested operation could not be completed due to a file system limitation. +ERROR_FILE_SYSTEM_LIMITATION - Der angeforderte Vorgang wurde wegen Einschr舅kungen des Dateisystems nicht ausgefhrt. . MessageId=668 @@ -2573,7 +2573,7 @@ Severity=Success Facility=System SymbolicName=ERROR_VERIFIER_STOP Language=German -ERROR_VERIFIER_STOP - Application verifier has found an error in the current process. +ERROR_VERIFIER_STOP - Die Anwendungsprfung hat einen Fehler in dem laufenden Prozess festgestellt. . MessageId=670 @@ -2589,7 +2589,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_BAD_MPS_TABLE Language=German -ERROR_PNP_BAD_MPS_TABLE - A device is missing in the system BIOS MPS table. This device will not be used. Please contact your system vendor for system BIOS update. +ERROR_PNP_BAD_MPS_TABLE - Ein Ger舩 fehlt in der BIOS-MPS-Tabelle. Dieses Ger舩 wird nicht verwendet. Bitte kontaktieren Sie den Hersteller Ihres Systems fr eine Aktualisierung des BIOS. . MessageId=672 @@ -2597,7 +2597,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_TRANSLATION_FAILED Language=German -ERROR_PNP_TRANSLATION_FAILED - A translator failed to translate resources. +ERROR_PNP_TRANSLATION_FAILED - Ein ワbersetzer konnte Ressourcen nicht bersetzen. . MessageId=673 @@ -2605,7 +2605,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_IRQ_TRANSLATION_FAILED Language=German -ERROR_PNP_IRQ_TRANSLATION_FAILED - A IRQ translator failed to translate resources. +ERROR_PNP_IRQ_TRANSLATION_FAILED - Ein IRQ-ワbersetzer konnte Ressourcen nicht bersetzen. . MessageId=674 @@ -2613,7 +2613,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PNP_INVALID_ID Language=German -ERROR_PNP_INVALID_ID - Driver %2 returned invalid ID for a child device (%3). +ERROR_PNP_INVALID_ID - Der Treiber %2 gab eine ungltige ID fr ein Kindger舩 (%3) zurck. . MessageId=675 @@ -2621,7 +2621,7 @@ Severity=Success Facility=System SymbolicName=ERROR_WAKE_SYSTEM_DEBUGGER Language=German -ERROR_WAKE_SYSTEM_DEBUGGER - The system debugger was awakened by an interrupt. +ERROR_WAKE_SYSTEM_DEBUGGER - Der Systemdebugger wurde mittels Interrupt erweckt. . MessageId=676 @@ -2629,7 +2629,7 @@ Severity=Success Facility=System SymbolicName=ERROR_HANDLES_CLOSED Language=German -ERROR_HANDLES_CLOSED - Handles to objects have been automatically closed as a result of the requested operation. +ERROR_HANDLES_CLOSED - Handles auf Objekte wurden als Ergebnis des angeforderten Vorgangs automatisch geschlossen. . MessageId=677 @@ -2637,7 +2637,7 @@ Severity=Success Facility=System SymbolicName=ERROR_EXTRANEOUS_INFORMATION Language=German -ERROR_EXTRANEOUS_INFORMATION - he specified access control list (ACL) contained more information than was expected. +ERROR_EXTRANEOUS_INFORMATION - Die angegebene Zugangskontrollliste (ACL) beinhaltete mehr Informationen als erwartet. . MessageId=678 @@ -2669,7 +2669,7 @@ Severity=Success Facility=System SymbolicName=ERROR_STOPPED_ON_SYMLINK Language=German -ERROR_STOPPED_ON_SYMLINK - The create operation stopped after reaching a symbolic link. +ERROR_STOPPED_ON_SYMLINK - Die Erzeugung wurde beim Erreichen eines symbolischen Verweises beendet. . MessageId=682 @@ -2677,7 +2677,7 @@ Severity=Success Facility=System SymbolicName=ERROR_LONGJUMP Language=German -ERROR_LONGJUMP - A long jump has been executed. +ERROR_LONGJUMP - Ein langer Sprung wurde ausgefhrt. . MessageId=683 @@ -2685,7 +2685,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PLUGPLAY_QUERY_VETOED Language=German -ERROR_PLUGPLAY_QUERY_VETOED - The Plug and Play query operation was not successful. +ERROR_PLUGPLAY_QUERY_VETOED - Der Plug-and-Play-Vorgang war nicht erfolgreich. . MessageId=684 @@ -2701,7 +2701,7 @@ Severity=Success Facility=System SymbolicName=ERROR_REGISTRY_HIVE_RECOVERED Language=German -ERROR_REGISTRY_HIVE_RECOVERED - Registry hive (file): %hs was corrupted and it has been recovered. Some data might have been lost. +ERROR_REGISTRY_HIVE_RECOVERED - Der Registryzweig (Datei) %hs war defekt und wurde wiederhergestellt. Es knnten Daten verloren gegangen sein. . MessageId=686 @@ -2709,7 +2709,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DLL_MIGHT_BE_INSECURE Language=German -ERROR_DLL_MIGHT_BE_INSECURE - The application is attempting to run executable code from the module %hs. This may be insecure. An alternative, %hs, is available. Should the application use the secure module %hs? +ERROR_DLL_MIGHT_BE_INSECURE - Die Anwendung versucht, ausfhrbaren Code aus dem Modul %hs zu laden. Dies knnte unsicher sein. Eine Alternative, %hs, ist verfgbar. Soll die Anwendung das sichere Modul %hs nutzen? . MessageId=687 @@ -2717,7 +2717,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DLL_MIGHT_BE_INCOMPATIBLE Language=German -ERROR_DLL_MIGHT_BE_INCOMPATIBLE - The application is loading executable code from the module %hs. This is secure, but may be incompatible with previous releases of the operating system. An alternative, %hs, is available. Should the application use the secure module %hs? +ERROR_DLL_MIGHT_BE_INCOMPATIBLE - Die Anwendung versucht, ausfhrbaren Code aus dem Modul %hs zu laden. Dies ist sicher, aber knnte mit frheren Versionen des Betriebssystems inkompatibel sein. Eine Alternative, %hs, ist verfgbar. Soll die Anwendung das sichere Modul %hs nutzen? . MessageId=688 @@ -2725,7 +2725,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_EXCEPTION_NOT_HANDLED Language=German -ERROR_DBG_EXCEPTION_NOT_HANDLED - Debugger did not handle the exception. +ERROR_DBG_EXCEPTION_NOT_HANDLED - Der Debugger behandelte die Ausnahme nicht. . MessageId=689 @@ -2733,7 +2733,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_REPLY_LATER Language=German -ERROR_DBG_REPLY_LATER - Debugger will reply later. +ERROR_DBG_REPLY_LATER - Der Debugger wird sp舩er antworten. . MessageId=690 @@ -2741,7 +2741,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE Language=German -ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE - Debugger can not provide handle. +ERROR_DBG_UNABLE_TO_PROVIDE_HANDLE - Der Debugger kann das Handle nicht bereitstellen. . MessageId=691 @@ -2749,7 +2749,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_TERMINATE_THREAD Language=German -ERROR_DBG_TERMINATE_THREAD - Debugger terminated thread. +ERROR_DBG_TERMINATE_THREAD - Der Debugger hat den Thread terminiert. . MessageId=692 @@ -2757,7 +2757,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_TERMINATE_PROCESS Language=German -ERROR_DBG_TERMINATE_PROCESS - Debugger terminated process. +ERROR_DBG_TERMINATE_PROCESS - Der Debugger hat den Prozess terminiert. . MessageId=693 @@ -2765,7 +2765,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_CONTROL_C Language=German -ERROR_DBG_CONTROL_C - Debugger got control C. +ERROR_DBG_CONTROL_C - Der Debugger erhielt Strg-C. . MessageId=694 @@ -2773,7 +2773,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_PRINTEXCEPTION_C Language=German -ERROR_DBG_PRINTEXCEPTION_C - Debugger printed exception on control C. +ERROR_DBG_PRINTEXCEPTION_C - Der Debugger gab fr Strg-C eine Ausnahme aus. . MessageId=695 @@ -2781,7 +2781,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_RIPEXCEPTION Language=German -ERROR_DBG_RIPEXCEPTION - Debugger received RIP exception. +ERROR_DBG_RIPEXCEPTION - Der Debugger erhielt eine RIP-Ausnahme. . MessageId=696 @@ -2789,7 +2789,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_CONTROL_BREAK Language=German -ERROR_DBG_CONTROL_BREAK - Debugger received control break. +ERROR_DBG_CONTROL_BREAK - Der Debugger erhielt Strg-Pause. . MessageId=697 @@ -2805,7 +2805,7 @@ Severity=Success Facility=System SymbolicName=ERROR_OBJECT_NAME_EXISTS Language=German -ERROR_OBJECT_NAME_EXISTS - An attempt was made to create an object and the object name already existed. +ERROR_OBJECT_NAME_EXISTS - Ein Versuch wurde unternommen, ein Objekt zu erzeugen, und der Name des Objekts existierte bereits. . MessageId=699 @@ -2837,7 +2837,7 @@ Severity=Success Facility=System SymbolicName=ERROR_SEGMENT_NOTIFICATION Language=German -ERROR_SEGMENT_NOTIFICATION - A virtual DOS machine (VDM) is loading, unloading, or moving an MS-DOS or Win16 program segment image. An exception is raised so a debugger can load, unload or track symbols and breakpoints within these 16-bit segments. +ERROR_SEGMENT_NOTIFICATION - Eine virtuelle DOS-Maschine (VDM) l臈t, entl臈t oder verschiebt ein MS-DOS- oder Win16-Programmsegmentabbild. Eine Ausnahme wird bereitgestellt, so dass ein Debugger Symbole und Haltepunkte innerhalb dieser 16-Bit-Segmente laden, entladen oder verfolgen kann. . MessageId=703 @@ -2869,7 +2869,7 @@ Severity=Success Facility=System SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH Language=German -ERROR_IMAGE_MACHINE_TYPE_MISMATCH - The image file %hs is valid, but is for a machine type other than the current machine. Select OK to continue, or CANCEL to fail the DLL load. +ERROR_IMAGE_MACHINE_TYPE_MISMATCH - Das Abbild %hs ist gltig, aber es ist fr einen anderen Ger舩etypen bestimmt. W臧len Sie OK zum Fortfahren oder ABBRECHEN aus, um das Laden der DLL abzubrechen. . MessageId=707 @@ -2877,7 +2877,7 @@ Severity=Success Facility=System SymbolicName=ERROR_RECEIVE_PARTIAL Language=German -ERROR_RECEIVE_PARTIAL - The network transport returned partial data to its client. The remaining data will be sent later. +ERROR_RECEIVE_PARTIAL - Der Netzwerktransport gab Teildaten an den Client weiter. Die verbleibenden Daten werden sp舩er gesendet. . MessageId=708 @@ -2917,7 +2917,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CHECKING_FILE_SYSTEM Language=German -ERROR_CHECKING_FILE_SYSTEM - Checking file system on %wZ. +ERROR_CHECKING_FILE_SYSTEM - Prfe Dateisystem auf %wZ. . MessageId=714 @@ -2925,7 +2925,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PREDEFINED_HANDLE Language=German -ERROR_PREDEFINED_HANDLE - The specified registry key is referenced by a predefined handle. +ERROR_PREDEFINED_HANDLE - Der angegebene Registryschlssel wird von einem vordefinierten Handle referenziert. . MessageId=715 @@ -2941,7 +2941,7 @@ Severity=Success Facility=System SymbolicName=ERROR_WAS_LOCKED Language=German -ERROR_WAS_LOCKED - One of the pages to lock was already locked. +ERROR_WAS_LOCKED - Eine der zu schlie゚enden Seiten war bereits verschlossen. . MessageId=720 @@ -2949,7 +2949,7 @@ Severity=Success Facility=System SymbolicName=ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE Language=German -ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE - The image file %hs is valid, but is for a machine type other than the current machine. +ERROR_IMAGE_MACHINE_TYPE_MISMATCH_EXE - Das Abbild %hs ist gltig, aber fr einen anderen Ger舩etypen bestimmt. . MessageId=721 @@ -2997,7 +2997,7 @@ Severity=Success Facility=System SymbolicName=ERROR_HIBERNATED Language=German -ERROR_HIBERNATED - The system was put into hibernation. +ERROR_HIBERNATED - Das System wurde in den Ruhezustand versetzt. . MessageId=727 @@ -3005,7 +3005,7 @@ Severity=Success Facility=System SymbolicName=ERROR_RESUME_HIBERNATION Language=German -ERROR_RESUME_HIBERNATION - The system was resumed from hibernation. +ERROR_RESUME_HIBERNATION - Das System wurde aus dem Ruhezustand fortgesetzt. . MessageId=728 @@ -3013,7 +3013,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FIRMWARE_UPDATED Language=German -ERROR_FIRMWARE_UPDATED - ReactOS has detected that the system firmware (BIOS) was updated [previous firmware date = %2, current firmware date %3]. +ERROR_FIRMWARE_UPDATED - ReactOS hat festgestellt, dass die Systemfirmware (BIOS) aktualisiert wurde [voriges Firmwaredatum = %2, aktuelles Firmwaredatum = %3]. . MessageId=729 @@ -3029,7 +3029,7 @@ Severity=Success Facility=System SymbolicName=ERROR_WAKE_SYSTEM Language=German -ERROR_WAKE_SYSTEM - The system has awoken +ERROR_WAKE_SYSTEM - Das System ist erwacht . MessageId=741 @@ -3053,7 +3053,7 @@ Severity=Success Facility=System SymbolicName=ERROR_VOLUME_MOUNTED Language=German -ERROR_VOLUME_MOUNTED - A new volume has been mounted by a file system. +ERROR_VOLUME_MOUNTED - Ein neuer Datentr臠er wurde durch ein Dateisystem gemountet. . MessageId=744 @@ -3133,7 +3133,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CRASH_DUMP Language=German -ERROR_CRASH_DUMP - Crash dump exists in paging file. +ERROR_CRASH_DUMP - Absturzabbild existiert in Pagetabelle. . MessageId=754 @@ -3141,7 +3141,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BUFFER_ALL_ZEROS Language=German -ERROR_BUFFER_ALL_ZEROS - Specified buffer contains all zeros. +ERROR_BUFFER_ALL_ZEROS - Der angegebene Puffer enth舁t nur Nullen. . MessageId=755 @@ -3181,7 +3181,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PROCESS_NOT_IN_JOB Language=German -ERROR_PROCESS_NOT_IN_JOB - The specified process is not part of a job. +ERROR_PROCESS_NOT_IN_JOB - Der angegebene Prozess ist nicht Teil eines Auftrags. . MessageId=760 @@ -3189,7 +3189,7 @@ Severity=Success Facility=System SymbolicName=ERROR_PROCESS_IN_JOB Language=German -ERROR_PROCESS_IN_JOB - The specified process is part of a job. +ERROR_PROCESS_IN_JOB - Der angegebene Prozess ist Teil eines Auftrags. . MessageId=761 @@ -3197,7 +3197,7 @@ Severity=Success Facility=System SymbolicName=ERROR_VOLSNAP_HIBERNATE_READY Language=German -ERROR_VOLSNAP_HIBERNATE_READY - The system is now ready for hibernation. +ERROR_VOLSNAP_HIBERNATE_READY - Das System ist nun fr den Ruhezustand bereit. . MessageId=762 @@ -3237,7 +3237,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_EXCEPTION_HANDLED Language=German -ERROR_DBG_EXCEPTION_HANDLED - Debugger handled exception. +ERROR_DBG_EXCEPTION_HANDLED - Der Debugger hat eine Ausnahme behandelt. . MessageId=767 @@ -3245,7 +3245,7 @@ Severity=Success Facility=System SymbolicName=ERROR_DBG_CONTINUE Language=German -ERROR_DBG_CONTINUE - Debugger continued +ERROR_DBG_CONTINUE - Debugger fortgesetzt . MessageId=768 @@ -3261,7 +3261,7 @@ Severity=Success Facility=System SymbolicName=ERROR_COMPRESSION_DISABLED Language=German -ERROR_COMPRESSION_DISABLED - Compression is disabled for this volume. +ERROR_COMPRESSION_DISABLED - Komprimierung ist fr diesen Datentr臠er deaktiviert. . MessageId=770 @@ -3301,7 +3301,7 @@ Severity=Success Facility=System SymbolicName=ERROR_ERRORS_ENCOUNTERED Language=German -ERROR_ERRORS_ENCOUNTERED - One or more errors occurred while processing the request. +ERROR_ERRORS_ENCOUNTERED - Ein oder mehrere Fehler sind beim Verarbeiten der Anfrage aufgetreten. . MessageId=775 @@ -3309,7 +3309,7 @@ Severity=Success Facility=System SymbolicName=ERROR_NOT_CAPABLE Language=German -ERROR_NOT_CAPABLE - The implementation is not capable of performing the request. +ERROR_NOT_CAPABLE - Die Implementierung ist nicht in der Lage, die Anfrage zu verarbeiten. . MessageId=776 @@ -3325,7 +3325,7 @@ Severity=Success Facility=System SymbolicName=ERROR_VERSION_PARSE_ERROR Language=German -ERROR_VERSION_PARSE_ERROR - A version number could not be parsed. +ERROR_VERSION_PARSE_ERROR - Eine Versionsnummer konnte nicht ausgelesen werden. . MessageId=778 @@ -3333,7 +3333,7 @@ Severity=Success Facility=System SymbolicName=ERROR_BADSTARTPOSITION Language=German -ERROR_BADSTARTPOSITION - The iterator's start position is invalid. +ERROR_BADSTARTPOSITION - Die Startposition des Iterators ist ungltig. . MessageId=994 @@ -3341,7 +3341,7 @@ Severity=Success Facility=System SymbolicName=ERROR_EA_ACCESS_DENIED Language=German -ERROR_EA_ACCESS_DENIED - Access to the extended attribute was denied. +ERROR_EA_ACCESS_DENIED - Zugriff auf das erweiterte Attribut wurde verweigert. . MessageId=995 @@ -3373,7 +3373,7 @@ Severity=Success Facility=System SymbolicName=ERROR_NOACCESS Language=German -ERROR_NOACCESS - Invalid access to memory location. +ERROR_NOACCESS - Ungltiger Zugriff auf Speicheradresse. . MessageId=999 @@ -3389,7 +3389,7 @@ Severity=Success Facility=System SymbolicName=ERROR_STACK_OVERFLOW Language=German -ERROR_STACK_OVERFLOW - Recursion too deep; the stack overflowed. +ERROR_STACK_OVERFLOW - Rekursion zu tief; Stapelberlauf. . MessageId=1002 @@ -3405,7 +3405,7 @@ Severity=Success Facility=System SymbolicName=ERROR_CAN_NOT_COMPLETE Language=German -ERROR_CAN_NOT_COMPLETE - Cannot complete this function. +ERROR_CAN_NOT_COMPLETE - Kann diese Funktion nicht beenden. . MessageId=1004 @@ -3413,7 +3413,7 @@ Severity=Success Facility=System SymbolicName=ERROR_INVALID_FLAGS Language=German -ERROR_INVALID_FLAGS - Invalid flags. +ERROR_INVALID_FLAGS - Ungltige Flags. . MessageId=1005 diff --git a/dll/win32/kernel32/lang/pl-PL.mc b/dll/win32/kernel32/lang/pl-PL.mc index 440c01f2c09..fade0b86145 100644 --- a/dll/win32/kernel32/lang/pl-PL.mc +++ b/dll/win32/kernel32/lang/pl-PL.mc @@ -2471,7 +2471,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FAILED_DRIVER_ENTRY Language=English -ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. +ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed its initialization call. . MessageId=648 diff --git a/dll/win32/kernel32/lang/ru-RU.mc b/dll/win32/kernel32/lang/ru-RU.mc index b92b1be1493..89dc623a7ef 100644 --- a/dll/win32/kernel32/lang/ru-RU.mc +++ b/dll/win32/kernel32/lang/ru-RU.mc @@ -2469,7 +2469,7 @@ Severity=Success Facility=System SymbolicName=ERROR_FAILED_DRIVER_ENTRY Language=Russian -ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed it's initialization call. +ERROR_FAILED_DRIVER_ENTRY - The driver was not loaded because it failed its initialization call. . MessageId=648 diff --git a/dll/win32/kernel32/mem/global.c b/dll/win32/kernel32/mem/global.c index 9537cbc774a..f2cfca5b01c 100644 --- a/dll/win32/kernel32/mem/global.c +++ b/dll/win32/kernel32/mem/global.c @@ -380,44 +380,53 @@ GlobalLock(HGLOBAL hMem) /* Check if this was a simple allocated heap entry */ if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)) { - /* Then simply return the pointer */ - return hMem; + /* Verify and return the pointer */ + return IsBadReadPtr(hMem, 1) ? NULL : hMem; } /* Otherwise, lock the heap */ RtlLockHeap(hProcessHeap); - /* Get the handle entry */ - HandleEntry = BaseHeapGetEntry(hMem); - BASE_TRACE_HANDLE(HandleEntry, hMem); + _SEH2_TRY + { + /* Get the handle entry */ + HandleEntry = BaseHeapGetEntry(hMem); + BASE_TRACE_HANDLE(HandleEntry, hMem); - /* Make sure it's valid */ - if (!BaseHeapValidateEntry(HandleEntry)) - { - /* It's not, fail */ - BASE_TRACE_FAILURE(); - SetLastError(ERROR_INVALID_HANDLE); - Ptr = NULL; - } - else - { - /* Otherwise, get the pointer */ - Ptr = HandleEntry->Object; - if (Ptr) + /* Make sure it's valid */ + if (!BaseHeapValidateEntry(HandleEntry)) { - /* Increase the lock count, unless we've went too far */ - if (HandleEntry->LockCount++ == GMEM_LOCKCOUNT) - { - /* In which case we simply unlock once */ - HandleEntry->LockCount--; - } + /* It's not, fail */ + BASE_TRACE_FAILURE(); + SetLastError(ERROR_INVALID_HANDLE); + Ptr = NULL; } else { - /* The handle is still there but the memory was already freed */ - SetLastError(ERROR_DISCARDED); + /* Otherwise, get the pointer */ + Ptr = HandleEntry->Object; + if (Ptr) + { + /* Increase the lock count, unless we've went too far */ + if (HandleEntry->LockCount++ == GMEM_LOCKCOUNT) + { + /* In which case we simply unlock once */ + HandleEntry->LockCount--; + } + } + else + { + /* The handle is still there but the memory was already freed */ + SetLastError(ERROR_DISCARDED); + } } } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastError(ERROR_INVALID_HANDLE); + Ptr = NULL; + } + _SEH2_END /* All done. Unlock the heap and return the pointer */ RtlUnlockHeap(hProcessHeap); @@ -702,65 +711,74 @@ GlobalSize(HGLOBAL hMem) /* Lock the heap */ RtlLockHeap(hProcessHeap); - /* Check if this is a simple RTL Heap Managed block */ - if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)) + _SEH2_TRY { - /* Then we'll query RTL Heap */ - RtlGetUserInfoHeap(hProcessHeap, Flags, hMem, &Handle, &Flags); - BASE_TRACE_PTR(Handle, hMem); - - /* - * Check if RTL Heap didn't give us a handle or said that this heap - * isn't movable. - */ - if (!(Handle) || !(Flags & BASE_HEAP_FLAG_MOVABLE)) + /* Check if this is a simple RTL Heap Managed block */ + if (!((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY)) { - /* This implies we're not a handle heap, so use the generic call */ - dwSize = RtlSizeHeap(hProcessHeap, HEAP_NO_SERIALIZE, hMem); + /* Then we'll query RTL Heap */ + RtlGetUserInfoHeap(hProcessHeap, Flags, hMem, &Handle, &Flags); + BASE_TRACE_PTR(Handle, hMem); + + /* + * Check if RTL Heap didn't give us a handle or said that this heap + * isn't movable. + */ + if (!(Handle) || !(Flags & BASE_HEAP_FLAG_MOVABLE)) + { + /* This implies we're not a handle heap, so use the generic call */ + dwSize = RtlSizeHeap(hProcessHeap, HEAP_NO_SERIALIZE, hMem); + } + else + { + /* Otherwise we're a handle heap, so get the internal handle */ + hMem = Handle; + } } - else + + /* Make sure that this is an entry in our handle database */ + if ((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY) { - /* Otherwise we're a handle heap, so get the internal handle */ - hMem = Handle; + /* Get the entry */ + HandleEntry = BaseHeapGetEntry(hMem); + BASE_TRACE_HANDLE(HandleEntry, hMem); + + /* Make sure the handle is valid */ + if (!BaseHeapValidateEntry(HandleEntry)) + { + /* Fail */ + BASE_TRACE_FAILURE(); + SetLastError(ERROR_INVALID_HANDLE); + } + else if (HandleEntry->Flags & BASE_HEAP_ENTRY_FLAG_REUSE) + { + /* We've reused this block, but we've saved the size for you */ + dwSize = HandleEntry->OldSize; + } + else + { + /* Otherwise, query RTL about it */ + dwSize = RtlSizeHeap(hProcessHeap, + HEAP_NO_SERIALIZE, + HandleEntry->Object); + } } - } - /* Make sure that this is an entry in our handle database */ - if ((ULONG_PTR)hMem & BASE_HEAP_IS_HANDLE_ENTRY) - { - /* Get the entry */ - HandleEntry = BaseHeapGetEntry(hMem); - BASE_TRACE_HANDLE(HandleEntry, hMem); - - /* Make sure the handle is valid */ - if (!BaseHeapValidateEntry(HandleEntry)) + /* Check if by now, we still haven't gotten any useful size */ + if (dwSize == MAXULONG_PTR) { /* Fail */ BASE_TRACE_FAILURE(); SetLastError(ERROR_INVALID_HANDLE); - } - else if (HandleEntry->Flags & BASE_HEAP_ENTRY_FLAG_REUSE) - { - /* We've reused this block, but we've saved the size for you */ - dwSize = HandleEntry->OldSize; - } - else - { - /* Otherwise, query RTL about it */ - dwSize = RtlSizeHeap(hProcessHeap, - HEAP_NO_SERIALIZE, - HandleEntry->Object); + dwSize = 0; } } - - /* Check if by now, we still haven't gotten any useful size */ - if (dwSize == MAXULONG_PTR) + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - /* Fail */ - BASE_TRACE_FAILURE(); SetLastError(ERROR_INVALID_HANDLE); dwSize = 0; } + _SEH2_END /* All done! Unlock heap and return the size */ RtlUnlockHeap(hProcessHeap); @@ -798,31 +816,40 @@ GlobalUnlock(HGLOBAL hMem) HandleEntry = BaseHeapGetEntry(hMem); BASE_TRACE_HANDLE(HandleEntry, hMem); - /* Make sure it's valid */ - if (!BaseHeapValidateEntry(HandleEntry)) + _SEH2_TRY { - /* It's not, fail */ - BASE_TRACE_FAILURE(); - SetLastError(ERROR_INVALID_HANDLE); + /* Make sure it's valid */ + if (!BaseHeapValidateEntry(HandleEntry)) + { + /* It's not, fail */ + BASE_TRACE_FAILURE(); + SetLastError(ERROR_INVALID_HANDLE); + RetVal = FALSE; + } + else + { + /* Otherwise, decrement lock count, unless we're already at 0*/ + if (!HandleEntry->LockCount--) + { + /* In which case we simply lock it back and fail */ + HandleEntry->LockCount++; + SetLastError(ERROR_NOT_LOCKED); + RetVal = FALSE; + } + else if (!HandleEntry->LockCount) + { + /* Nothing to unlock */ + SetLastError(NO_ERROR); + RetVal = FALSE; + } + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastError(ERROR_INVALID_PARAMETER); RetVal = FALSE; } - else - { - /* Otherwise, decrement lock count, unless we're already at 0*/ - if (!HandleEntry->LockCount--) - { - /* In which case we simply lock it back and fail */ - HandleEntry->LockCount++; - SetLastError(ERROR_NOT_LOCKED); - RetVal = FALSE; - } - else if (!HandleEntry->LockCount) - { - /* Nothing to unlock */ - SetLastError(NO_ERROR); - RetVal = FALSE; - } - } + _SEH2_END /* All done. Unlock the heap and return the pointer */ RtlUnlockHeap(hProcessHeap); diff --git a/dll/win32/kernel32/misc/console.c b/dll/win32/kernel32/misc/console.c index 5a5871d8939..594b8ac2abb 100644 --- a/dll/win32/kernel32/misc/console.c +++ b/dll/win32/kernel32/misc/console.c @@ -993,11 +993,11 @@ OpenConsoleW(LPCWSTR wsName, ULONG CsrRequest; NTSTATUS Status = STATUS_SUCCESS; - if (0 == _wcsicmp(wsName, L"CONIN$")) + if (wsName && 0 == _wcsicmp(wsName, L"CONIN$")) { CsrRequest = MAKE_CSR_API(GET_INPUT_HANDLE, CSR_NATIVE); } - else if (0 == _wcsicmp(wsName, L"CONOUT$")) + else if (wsName && 0 == _wcsicmp(wsName, L"CONOUT$")) { CsrRequest = MAKE_CSR_API(GET_OUTPUT_HANDLE, CSR_NATIVE); } @@ -3086,16 +3086,29 @@ FlushConsoleInputBuffer(HANDLE hConsoleInput) /*-------------------------------------------------------------- * SetConsoleScreenBufferSize * - * @unimplemented + * @implemented */ BOOL WINAPI SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize) { - DPRINT1("SetConsoleScreenBufferSize(0x%x, 0x%x) UNIMPLEMENTED!\n", hConsoleOutput, dwSize); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + CSR_API_MESSAGE Request; + ULONG CsrRequest; + NTSTATUS Status; + + CsrRequest = MAKE_CSR_API(SET_SCREEN_BUFFER_SIZE, CSR_CONSOLE); + Request.Data.SetScreenBufferSize.OutputHandle = hConsoleOutput; + Request.Data.SetScreenBufferSize.Size = dwSize; + + Status = CsrClientCallServer(&Request, NULL, CsrRequest, sizeof(CSR_API_MESSAGE)); + if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Request.Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; } /*-------------------------------------------------------------- diff --git a/dll/win32/kernel32/misc/dllmain.c b/dll/win32/kernel32/misc/dllmain.c index 02199f9349d..ef47c4d538f 100644 --- a/dll/win32/kernel32/misc/dllmain.c +++ b/dll/win32/kernel32/misc/dllmain.c @@ -330,6 +330,9 @@ DllMain(HANDLE hDll, wcscpy(SystemDirectory.Buffer, WindowsDirectory.Buffer); wcscat(SystemDirectory.Buffer, L"\\System32"); + /* Initialize command line */ + InitCommandLines(); + /* Open object base directory */ Status = OpenBaseDirectory(&hBaseDir); if (!NT_SUCCESS(Status)) diff --git a/dll/win32/kernel32/misc/nls.c b/dll/win32/kernel32/misc/nls.c index 58a5b81c294..4e082011b17 100644 --- a/dll/win32/kernel32/misc/nls.c +++ b/dll/win32/kernel32/misc/nls.c @@ -1260,6 +1260,170 @@ IsValidCodePage(UINT CodePage) return GetCPFileNameFromRegistry(CodePage, NULL, 0); } +static const signed char +base64inv[] = +{ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 +}; + +static VOID Utf7Base64Decode(BYTE *pbDest, LPCSTR pszSrc, INT cchSrc) +{ + INT i, j, n; + BYTE b; + + for(i = 0; i < cchSrc / 4 * 4; i += 4) + { + for(j = n = 0; j < 4; ) + { + b = (BYTE) base64inv[(BYTE) *pszSrc++]; + n |= (((INT) b) << ((3 - j) * 6)); + j++; + } + for(j = 0; j < 3; j++) + *pbDest++ = (BYTE) ((n >> (8 * (2 - j))) & 0xFF); + } + for(j = n = 0; j < cchSrc % 4; ) + { + b = (BYTE) base64inv[(BYTE) *pszSrc++]; + n |= (((INT) b) << ((3 - j) * 6)); + j++; + } + for(j = 0; j < ((cchSrc % 4) * 6 / 8); j++) + *pbDest++ = (BYTE) ((n >> (8 * (2 - j))) & 0xFF); +} + +static VOID myswab(LPVOID pv, INT cw) +{ + LPBYTE pb = (LPBYTE) pv; + BYTE b; + while(cw > 0) + { + b = *pb; + *pb = pb[1]; + pb[1] = b; + pb += 2; + cw--; + } +} + +static INT Utf7ToWideCharSize(LPCSTR pszUtf7, INT cchUtf7) +{ + INT n, c, cch; + CHAR ch; + LPCSTR pch; + + c = 0; + while(cchUtf7 > 0) + { + ch = *pszUtf7++; + if (ch == '+') + { + ch = *pszUtf7; + if (ch == '-') + { + c++; + pszUtf7++; + cchUtf7 -= 2; + continue; + } + cchUtf7--; + pch = pszUtf7; + while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && + base64inv[*pszUtf7] >= 0) + { + cchUtf7--; + pszUtf7++; + } + cch = pszUtf7 - pch; + n = (cch * 3) / 8; + c += n; + if (cchUtf7 > 0 && *pszUtf7 == '-') + { + pszUtf7++; + cchUtf7--; + } + } + else + { + c++; + cchUtf7--; + } + } + + return c; +} + +static INT Utf7ToWideChar(LPCSTR pszUtf7, INT cchUtf7, LPWSTR pszWide, INT cchWide) +{ + INT n, c, cch; + CHAR ch; + LPCSTR pch; + WORD *pwsz; + + c = Utf7ToWideCharSize(pszUtf7, cchUtf7); + if (cchWide == 0) + return c; + + if (cchWide < c) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + + while(cchUtf7 > 0) + { + ch = *pszUtf7++; + if (ch == '+') + { + if (*pszUtf7 == '-') + { + *pszWide++ = L'+'; + pszUtf7++; + cchUtf7 -= 2; + continue; + } + cchUtf7--; + pch = pszUtf7; + while(cchUtf7 > 0 && (BYTE) *pszUtf7 < 0x80 && + base64inv[*pszUtf7] >= 0) + { + cchUtf7--; + pszUtf7++; + } + cch = pszUtf7 - pch; + n = (cch * 3) / 8; + pwsz = (WORD *) HeapAlloc(GetProcessHeap(), 0, (n + 1) * sizeof(WORD)); + if (pwsz == NULL) + return 0; + ZeroMemory(pwsz, n * sizeof(WORD)); + Utf7Base64Decode((BYTE *) pwsz, pch, cch); + myswab(pwsz, n); + CopyMemory(pszWide, pwsz, n * sizeof(WORD)); + HeapFree(GetProcessHeap(), 0, pwsz); + pszWide += n; + if (cchUtf7 > 0 && *pszUtf7 == '-') + { + pszUtf7++; + cchUtf7--; + } + } + else + { + *pszWide++ = (WCHAR) ch; + cchUtf7--; + } + } + + return c; +} + /** * @name MultiByteToWideChar * @@ -1325,8 +1489,13 @@ MultiByteToWideChar(UINT CodePage, WideCharCount); case CP_UTF7: - DPRINT1("MultiByteToWideChar for CP_UTF7 is not implemented!\n"); - return 0; + if (Flags) + { + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + return Utf7ToWideChar(MultiByteString, MultiByteCount, + WideCharString, WideCharCount); case CP_SYMBOL: return IntMultiByteToWideCharSYMBOL(Flags, @@ -1344,6 +1513,162 @@ MultiByteToWideChar(UINT CodePage, } } +static const char mustshift[] = +{ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 +}; + +static const char base64[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +static INT WideCharToUtf7Size(LPCWSTR pszWide, INT cchWide) +{ + WCHAR wch; + INT c = 0; + BOOL fShift = FALSE; + + while(cchWide > 0) + { + wch = *pszWide; + if (wch < 0x80 && !mustshift[wch]) + { + c++; + cchWide--; + pszWide++; + } + else + { + if (wch == L'+') + { + c++; + c++; + cchWide--; + pszWide++; + continue; + } + if (!fShift) + { + c++; + fShift = TRUE; + } + pszWide++; + cchWide--; + c += 3; + if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide])) + { + pszWide++; + cchWide--; + c += 3; + if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide])) + { + pszWide++; + cchWide--; + c += 2; + } + } + if (cchWide > 0 && *pszWide < 0x80 && !mustshift[*pszWide]) + { + c++; + fShift = FALSE; + } + } + } + if (fShift) + c++; + + return c; +} + +static INT WideCharToUtf7(LPCWSTR pszWide, INT cchWide, LPSTR pszUtf7, INT cchUtf7) +{ + WCHAR wch; + INT c, n; + WCHAR wsz[3]; + BOOL fShift = FALSE; + + c = WideCharToUtf7Size(pszWide, cchWide); + if (cchUtf7 == 0) + return c; + + if (cchUtf7 < c) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return 0; + } + + while(cchWide > 0) + { + wch = *pszWide; + if (wch < 0x80 && !mustshift[wch]) + { + *pszUtf7++ = (CHAR) wch; + cchWide--; + pszWide++; + } + else + { + if (wch == L'+') + { + *pszUtf7++ = '+'; + *pszUtf7++ = '-'; + cchWide--; + pszWide++; + continue; + } + if (!fShift) + { + *pszUtf7++ = '+'; + fShift = TRUE; + } + wsz[0] = *pszWide++; + cchWide--; + n = 1; + if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide])) + { + wsz[1] = *pszWide++; + cchWide--; + n++; + if (cchWide > 0 && (*pszWide >= 0x80 || mustshift[*pszWide])) + { + wsz[2] = *pszWide++; + cchWide--; + n++; + } + } + *pszUtf7++ = base64[wsz[0] >> 10]; + *pszUtf7++ = base64[(wsz[0] >> 4) & 0x3F]; + *pszUtf7++ = base64[(wsz[0] << 2 | wsz[1] >> 14) & 0x3F]; + if (n >= 2) + { + *pszUtf7++ = base64[(wsz[1] >> 8) & 0x3F]; + *pszUtf7++ = base64[(wsz[1] >> 2) & 0x3F]; + *pszUtf7++ = base64[(wsz[1] << 4 | wsz[2] >> 12) & 0x3F]; + if (n >= 3) + { + *pszUtf7++ = base64[(wsz[2] >> 6) & 0x3F]; + *pszUtf7++ = base64[wsz[2] & 0x3F]; + } + } + if (cchWide > 0 && *pszWide < 0x80 && !mustshift[*pszWide]) + { + *pszUtf7++ = '-'; + fShift = FALSE; + } + } + } + if (fShift) + *pszUtf7 = '-'; + + return c; +} + /** * @name WideCharToMultiByte * @@ -1423,8 +1748,18 @@ WideCharToMultiByte(UINT CodePage, UsedDefaultChar); case CP_UTF7: - DPRINT1("WideCharToMultiByte for CP_UTF7 is not implemented!\n"); - return 0; + if (DefaultChar != NULL || UsedDefaultChar != NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + if (Flags) + { + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + return WideCharToUtf7(WideCharString, WideCharCount, + MultiByteString, MultiByteCount); case CP_SYMBOL: if ((DefaultChar!=NULL) || (UsedDefaultChar!=NULL)) diff --git a/dll/win32/kernel32/misc/stubs.c b/dll/win32/kernel32/misc/stubs.c index d22e9baed17..c852f34d1f9 100644 --- a/dll/win32/kernel32/misc/stubs.c +++ b/dll/win32/kernel32/misc/stubs.c @@ -885,9 +885,9 @@ NlsGetCacheUpdateCount(VOID) return 0; } -BOOL +BOOLEAN WINAPI -Wow64EnableWow64FsRedirection (BOOL Wow64EnableWow64FsRedirection) +Wow64EnableWow64FsRedirection (BOOLEAN Wow64EnableWow64FsRedirection) { STUB; return FALSE; diff --git a/dll/win32/kernel32/misc/utils.c b/dll/win32/kernel32/misc/utils.c index cebd500232b..04fde77fc82 100644 --- a/dll/win32/kernel32/misc/utils.c +++ b/dll/win32/kernel32/misc/utils.c @@ -364,7 +364,7 @@ BasepInitializeContext(IN PCONTEXT Context, } else if (ContextType == 2) /* For Fibers */ { - //Context->Eip = (ULONG)BaseFiberStartup; + Context->Eip = (ULONG)BaseFiberStartup; } else /* For first thread in a Process */ { diff --git a/dll/win32/kernel32/process/cmdline.c b/dll/win32/kernel32/process/cmdline.c index 9b84ab92a74..2c2b2421966 100644 --- a/dll/win32/kernel32/process/cmdline.c +++ b/dll/win32/kernel32/process/cmdline.c @@ -27,19 +27,17 @@ static BOOL bCommandLineInitialized = FALSE; /* FUNCTIONS ****************************************************************/ -static VOID +WINAPI InitCommandLines(VOID) { PRTL_USER_PROCESS_PARAMETERS Params; - /* FIXME - not thread-safe! */ - - // get command line + /* get command line */ Params = NtCurrentPeb()->ProcessParameters; RtlNormalizeProcessParams (Params); - // initialize command line buffers + /* initialize command line buffers */ CommandLineStringW.Length = Params->CommandLine.Length; CommandLineStringW.MaximumLength = CommandLineStringW.Length + sizeof(WCHAR); CommandLineStringW.Buffer = RtlAllocateHeap(GetProcessHeap(), @@ -80,13 +78,7 @@ LPSTR WINAPI GetCommandLineA(VOID) { - if (bCommandLineInitialized == FALSE) - { - InitCommandLines(); - } - DPRINT("CommandLine \'%s\'\n", CommandLineStringA.Buffer); - return CommandLineStringA.Buffer; } @@ -98,13 +90,7 @@ LPWSTR WINAPI GetCommandLineW(VOID) { - if (bCommandLineInitialized == FALSE) - { - InitCommandLines(); - } - DPRINT("CommandLine \'%S\'\n", CommandLineStringW.Buffer); - return CommandLineStringW.Buffer; } diff --git a/dll/win32/kernel32/thread/fiber.c b/dll/win32/kernel32/thread/fiber.c index 656bc6ee19d..6ba2016b648 100644 --- a/dll/win32/kernel32/thread/fiber.c +++ b/dll/win32/kernel32/thread/fiber.c @@ -146,9 +146,8 @@ CreateFiberEx(SIZE_T dwStackCommitSize, PFIBER pfCurFiber; NTSTATUS nErrCode; INITIAL_TEB usFiberInitialTeb; - CONTEXT ctxFiberContext; PVOID ActivationContextStack = NULL; - DPRINT1("Creating Fiber\n"); + DPRINT("Creating Fiber\n"); #ifdef SXS_SUPPORT_ENABLED /* Allocate the Activation Context Stack */ @@ -203,7 +202,7 @@ CreateFiberEx(SIZE_T dwStackCommitSize, } /* initialize the context for the fiber */ - BasepInitializeContext(&ctxFiberContext, + BasepInitializeContext(&pfCurFiber->Context, lpParameter, lpStartAddress, usFiberInitialTeb.StackBase, @@ -253,10 +252,10 @@ WINAPI BaseFiberStartup(VOID) { #ifdef _M_IX86 - PFIBER Fiber = GetFiberData(); + PFIBER Fiber = GetCurrentFiber(); /* Call the Thread Startup Routine */ - DPRINT1("Starting Fiber\n"); + DPRINT("Starting Fiber\n"); BaseThreadStartup((LPTHREAD_START_ROUTINE)Fiber->Context.Eax, (LPVOID)Fiber->Context.Ebx); #else diff --git a/dll/win32/kernel32/thread/i386/fiber.S b/dll/win32/kernel32/thread/i386/fiber.S index cf8bbe06064..57358ffeed4 100644 --- a/dll/win32/kernel32/thread/i386/fiber.S +++ b/dll/win32/kernel32/thread/i386/fiber.S @@ -24,7 +24,11 @@ _SwitchToFiber@4: mov [eax+FIBER_CONTEXT_ESI], esi mov [eax+FIBER_CONTEXT_EDI], edi mov [eax+FIBER_CONTEXT_EBP], ebp - + + /* Save the return address */ + mov ebx, [esp] + mov [eax+FIBER_CONTEXT_EIP], ebx + /* Check if we're to save FPU State */ cmp dword ptr [eax+FIBER_CONTEXT_FLAGS], CONTEXT_FULL | CONTEXT_FLOATING_POINT jnz NoFpuStateSave @@ -115,7 +119,7 @@ NoFpuStateRestore: mov eax, [ecx+FIBER_FLS_DATA] mov [edx+TEB_FLS_DATA], eax - /* Return */ - ret 4 - + /* Jump to new fiber */ + jmp [ecx+FIBER_CONTEXT_EIP] + /* EOF */ diff --git a/dll/win32/localspl/provider.c b/dll/win32/localspl/provider.c index b17e074b845..322418804c3 100644 --- a/dll/win32/localspl/provider.c +++ b/dll/win32/localspl/provider.c @@ -1375,7 +1375,7 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo } /* Verified with the Adobe PS Driver, that w2k does not use di.Version */ - RegSetValueExW(hdrv, versionW, 0, REG_DWORD, (LPBYTE) &env->driverversion, + RegSetValueExW(hdrv, versionW, 0, REG_DWORD, (const BYTE*) &env->driverversion, sizeof(DWORD)); RegSetValueExW(hdrv, driverW, 0, REG_SZ, (LPBYTE) di.pDriverPath, @@ -1395,7 +1395,7 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (LPBYTE) di.pHelpFile, (lstrlenW(di.pHelpFile)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, help_fileW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); apd_copyfile(di.pHelpFile, &apd); @@ -1404,7 +1404,7 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (LPBYTE) di.pDependentFiles, multi_sz_lenW(di.pDependentFiles)); else - RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, dependent_filesW, 0, REG_MULTI_SZ, (const BYTE*)emptyW, sizeof(emptyW)); while ((ptr != NULL) && (ptr[0])) { if (apd_copyfile(ptr, &apd)) { ptr += lstrlenW(ptr) + 1; @@ -1420,20 +1420,20 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (LPBYTE) di.pMonitorName, (lstrlenW(di.pMonitorName)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, monitorW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); if (di.pDefaultDataType) RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (LPBYTE) di.pDefaultDataType, (lstrlenW(di.pDefaultDataType)+1)* sizeof(WCHAR)); else - RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, datatypeW, 0, REG_SZ, (const BYTE*)emptyW, sizeof(emptyW)); /* settings for level 4 */ if (di.pszzPreviousNames) RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (LPBYTE) di.pszzPreviousNames, multi_sz_lenW(di.pszzPreviousNames)); else - RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (LPBYTE)emptyW, sizeof(emptyW)); + RegSetValueExW(hdrv, previous_namesW, 0, REG_MULTI_SZ, (const BYTE*)emptyW, sizeof(emptyW)); if (level > 5) TRACE("level %u for Driver %s is incomplete\n", level, debugstr_w(di.pName)); diff --git a/dll/win32/lpk/dllmain.c b/dll/win32/lpk/dllmain.c index 9b7c8e11d0d..1d5bdc0e781 100644 --- a/dll/win32/lpk/dllmain.c +++ b/dll/win32/lpk/dllmain.c @@ -36,7 +36,7 @@ LpkDllInitialize ( case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hDll); /* Tell usp10 it is activated usp10 */ - LpkPresent(); + //LpkPresent(); break; default: diff --git a/dll/win32/mciavi32/mciavi.c b/dll/win32/mciavi32/mciavi.c index d77525ca4ff..1c15dc55dbc 100644 --- a/dll/win32/mciavi32/mciavi.c +++ b/dll/win32/mciavi32/mciavi.c @@ -89,6 +89,7 @@ static DWORD MCIAVI_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp) wma->hStopEvent = CreateEventW(NULL, FALSE, FALSE, NULL); wma->wDevID = modp->wDeviceID; wma->wCommandTable = mciLoadCommandResource(MCIAVI_hInstance, mciAviWStr, 0); + wma->dwStatus = MCI_MODE_NOT_READY; modp->wCustomCommandTable = wma->wCommandTable; modp->wType = MCI_DEVTYPE_DIGITAL_VIDEO; mciSetDriverData(wma->wDevID, (DWORD_PTR)wma); @@ -301,11 +302,11 @@ DWORD MCIAVI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) wma = MCIAVI_mciGetOpenDev(wDevID); if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; + MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); + EnterCriticalSection(&wma->cs); if (wma->nUseCount == 1) { - if (wma->dwStatus != MCI_MODE_STOP) - dwRet = MCIAVI_mciStop(wDevID, MCI_WAIT, NULL); MCIAVI_CleanUp(wma); if ((dwFlags & MCI_NOTIFY) && lpParms) { @@ -836,14 +837,14 @@ static DWORD MCIAVI_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_P { WINE_MCIAVI *wma; - FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms); - if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + FIXME("(%04x, %08x, %p) Item %04x: stub\n", wDevID, dwFlags, lpParms, dwFlags & MCI_DGV_SETAUDIO_ITEM ? lpParms->dwItem : 0); + wma = MCIAVI_mciGetOpenDev(wDevID); if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - return MCIERR_UNSUPPORTED_FUNCTION; /* like w2k */ + return 0; } /****************************************************************************** @@ -870,14 +871,14 @@ static DWORD MCIAVI_mciSetVideo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETVIDEO_P { WINE_MCIAVI *wma; - FIXME("(%04x, %08x, %p) : stub\n", wDevID, dwFlags, lpParms); - if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK; + FIXME("(%04x, %08x, %p) Item %04x: stub\n", wDevID, dwFlags, lpParms, dwFlags & MCI_DGV_SETVIDEO_ITEM ? lpParms->dwItem : 0); + wma = MCIAVI_mciGetOpenDev(wDevID); if (wma == NULL) return MCIERR_INVALID_DEVICE_ID; - return MCIERR_UNSUPPORTED_FUNCTION; /* like w2k */ + return 0; } /****************************************************************************** diff --git a/dll/win32/mcicda/mcicda.c b/dll/win32/mcicda/mcicda.c index cf9132cdcff..6ea996a21b9 100644 --- a/dll/win32/mcicda/mcicda.c +++ b/dll/win32/mcicda/mcicda.c @@ -420,7 +420,8 @@ static DWORD MCICDA_Open(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpOpenPar if (dwFlags & MCI_OPEN_ELEMENT) { if (dwFlags & MCI_OPEN_ELEMENT_ID) { WARN("MCI_OPEN_ELEMENT_ID %p! Abort\n", lpOpenParms->lpstrElementName); - return MCIERR_NO_ELEMENT_ALLOWED; + ret = MCIERR_NO_ELEMENT_ALLOWED; + goto the_error; } TRACE("MCI_OPEN_ELEMENT element name: %s\n", debugstr_w(lpOpenParms->lpstrElementName)); if (!isalpha(lpOpenParms->lpstrElementName[0]) || lpOpenParms->lpstrElementName[1] != ':' || @@ -483,6 +484,8 @@ static DWORD MCICDA_Close(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParm if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; + MCICDA_Stop(wDevID, MCI_WAIT, NULL); + if (--wmcda->nUseCount == 0) { CloseHandle(wmcda->handle); } diff --git a/dll/win32/mciqtz32/mciqtz.c b/dll/win32/mciqtz32/mciqtz.c index b98e163ebbc..c826de17633 100644 --- a/dll/win32/mciqtz32/mciqtz.c +++ b/dll/win32/mciqtz32/mciqtz.c @@ -153,7 +153,8 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags, MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL); - CoInitializeEx(NULL, COINIT_MULTITHREADED); + hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); + wma->uninit = SUCCEEDED(hr); hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (LPVOID*)&wma->pgraph); if (FAILED(hr)) { @@ -197,7 +198,8 @@ err: IMediaControl_Release(wma->pmctrl); wma->pmctrl = NULL; - CoUninitialize(); + if (wma->uninit) + CoUninitialize(); return MCIERR_INTERNAL; } @@ -220,7 +222,8 @@ static DWORD MCIQTZ_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpP if (wma->opened) { IGraphBuilder_Release(wma->pgraph); IMediaControl_Release(wma->pmctrl); - CoUninitialize(); + if (wma->uninit) + CoUninitialize(); wma->opened = FALSE; } diff --git a/dll/win32/mciqtz32/mciqtz_private.h b/dll/win32/mciqtz32/mciqtz_private.h index dcfcad0eb4a..caf80de4dc9 100644 --- a/dll/win32/mciqtz32/mciqtz_private.h +++ b/dll/win32/mciqtz32/mciqtz_private.h @@ -28,6 +28,7 @@ typedef struct { MCIDEVICEID wDevID; BOOL opened; + BOOL uninit; IGraphBuilder* pgraph; IMediaControl* pmctrl; BOOL started; diff --git a/dll/win32/mciseq/mcimidi.c b/dll/win32/mciseq/mcimidi.c index 301428d517d..87753c33dde 100644 --- a/dll/win32/mciseq/mcimidi.c +++ b/dll/win32/mciseq/mcimidi.c @@ -62,6 +62,7 @@ typedef struct tagWINE_MCIMIDI { UINT wDevID; /* the MCI one */ HMIDI hMidi; int nUseCount; /* Incremented for each shared open */ + WORD wPort; /* the WINMM device unit */ WORD wNotifyDeviceID; /* MCI device ID with a pending notification */ HANDLE hCallback; /* Callback handle for pending notification */ HMMIO hFile; /* mmio file handle open as Element */ @@ -726,6 +727,7 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSW lpParms) wmm->hFile = 0; wmm->hMidi = 0; + wmm->wPort = MIDI_MAPPER; wmm->lpstrElementName = NULL; dwDeviceID = lpParms->wDeviceID; @@ -962,8 +964,8 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */ } - dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); - /* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/ + dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL); + /* dwRet = midiInOpen(&wmm->hMidi, wmm->wPort, 0L, 0L, CALLBACK_NULL);*/ if (dwRet != MMSYSERR_NOERROR) { return dwRet; } @@ -1290,7 +1292,7 @@ static DWORD MIDI_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPa /************************************************************************** * MIDI_mciSet [internal] */ -static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) +static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SEQ_SET_PARMS lpParms) { WINE_MCIMIDI* wmm = MIDI_mciGetOpenDev(wDevID); @@ -1359,8 +1361,15 @@ static DWORD MIDI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) TRACE("MCI_SEQ_SET_SLAVE !\n"); if (dwFlags & MCI_SEQ_SET_OFFSET) TRACE("MCI_SEQ_SET_OFFSET !\n"); - if (dwFlags & MCI_SEQ_SET_PORT) - TRACE("MCI_SEQ_SET_PORT !\n"); + if (dwFlags & MCI_SEQ_SET_PORT) { + TRACE("MCI_SEQ_SET_PORT = %d\n", lpParms->dwPort); + if ((UINT16)lpParms->dwPort != (UINT16)MIDI_MAPPER && + (UINT16)lpParms->dwPort >= midiOutGetNumDevs()) + /* FIXME: input/output port distinction? */ + return MCIERR_SEQ_PORT_NONEXISTENT; + /* FIXME: Native manages to swap the device while playing! */ + wmm->wPort = lpParms->dwPort; + } if (dwFlags & MCI_SEQ_SET_TEMPO) TRACE("MCI_SEQ_SET_TEMPO !\n"); return 0; @@ -1459,8 +1468,13 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar lpParms->dwReturn = 0; break; case MCI_SEQ_STATUS_PORT: - TRACE("MCI_SEQ_STATUS_PORT (%u)!\n", wmm->wDevID); - lpParms->dwReturn = MIDI_MAPPER; + if (wmm->wPort != (UINT16)MIDI_MAPPER) + lpParms->dwReturn = wmm->wPort; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(MIDI_MAPPER, MCI_SEQ_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_SEQ_STATUS_PORT (%u) => %d\n", wmm->wDevID, wmm->wPort); break; case MCI_SEQ_STATUS_TEMPO: TRACE("MCI_SEQ_STATUS_TEMPO !\n"); @@ -1664,7 +1678,7 @@ LRESULT CALLBACK MCIMIDI_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, case MCI_PLAY: return MIDI_mciPlay (dwDevID, dwParam1, (LPMCI_PLAY_PARMS) dwParam2); case MCI_RECORD: return MIDI_mciRecord (dwDevID, dwParam1, (LPMCI_RECORD_PARMS) dwParam2); case MCI_STOP: return MIDI_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); - case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2); + case MCI_SET: return MIDI_mciSet (dwDevID, dwParam1, (LPMCI_SEQ_SET_PARMS) dwParam2); case MCI_PAUSE: return MIDI_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_RESUME: return MIDI_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_STATUS: return MIDI_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2); diff --git a/dll/win32/mciwave/mciwave.c b/dll/win32/mciwave/mciwave.c index 24e75ee9dac..87dc260207c 100644 --- a/dll/win32/mciwave/mciwave.c +++ b/dll/win32/mciwave/mciwave.c @@ -47,6 +47,8 @@ typedef struct { WAVEFORMATEX wfxRef; LPWAVEFORMATEX lpWaveFormat; /* Points to wfxRef until set by OPEN or RECORD */ BOOL fInput; /* FALSE = Output, TRUE = Input */ + WORD wInput; /* wave input device */ + WORD wOutput; /* wave output device */ volatile WORD dwStatus; /* one from MCI_MODE_xxxx */ DWORD dwMciTimeFormat;/* One of the supported MCI_FORMAT_xxxx */ DWORD dwPosition; /* position in bytes in chunk */ @@ -529,6 +531,7 @@ static LRESULT WAVE_mciOpen(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_OPEN_P wmw->nUseCount++; + wmw->wInput = wmw->wOutput = WAVE_MAPPER; wmw->fInput = FALSE; wmw->hWave = 0; wmw->dwStatus = MCI_MODE_NOT_READY; @@ -831,8 +834,7 @@ static DWORD WAVE_mciPlay(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt, */ mmioSeek(wmw->hFile, wmw->ckWaveData.dwDataOffset + wmw->dwPosition, SEEK_SET); /* >= 0 */ - /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveOutOpen((HWAVEOUT *)&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveOutOpen((HWAVEOUT *)&wmw->hWave, wmw->wOutput, wmw->lpWaveFormat, (DWORD_PTR)WAVE_mciPlayCallback, (DWORD_PTR)wmw, CALLBACK_FUNCTION); if (dwRet != 0) { @@ -1064,11 +1066,7 @@ static DWORD WAVE_mciRecord(MCIDEVICEID wDevID, DWORD_PTR dwFlags, DWORD_PTR pmt */ mmioSeek(wmw->hFile, wmw->ckWaveData.dwDataOffset + wmw->dwPosition, SEEK_SET); /* >= 0 */ - /* By default the device will be opened for output, the MCI_CUE function is there to - * change from output to input and back - */ - /* FIXME: how to choose between several output channels ? here mapper is forced */ - dwRet = waveInOpen((HWAVEIN*)&wmw->hWave, WAVE_MAPPER, wmw->lpWaveFormat, + dwRet = waveInOpen((HWAVEIN*)&wmw->hWave, wmw->wInput, wmw->lpWaveFormat, (DWORD_PTR)WAVE_mciRecordCallback, (DWORD_PTR)wmw, CALLBACK_FUNCTION); if (dwRet != MMSYSERR_NOERROR) { @@ -1279,7 +1277,7 @@ static DWORD WAVE_mciSeek(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lp /************************************************************************** * WAVE_mciSet [internal] */ -static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) +static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_WAVE_SET_PARMS lpParms) { WINE_MCIWAVE* wmw = WAVE_mciGetOpenDev(wDevID); @@ -1337,44 +1335,64 @@ static DWORD WAVE_mciSet(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpPa default: WARN("Unknown audio channel %u\n", lpParms->dwAudio); break; } } - if (dwFlags & MCI_WAVE_INPUT) - TRACE("MCI_WAVE_INPUT !\n"); - if (dwFlags & MCI_WAVE_OUTPUT) - TRACE("MCI_WAVE_OUTPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYINPUT) - TRACE("MCI_WAVE_SET_ANYINPUT !\n"); - if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) - TRACE("MCI_WAVE_SET_ANYOUTPUT !\n"); + if (dwFlags & MCI_WAVE_INPUT) { + TRACE("MCI_WAVE_INPUT = %d\n", lpParms->wInput); + if (lpParms->wInput >= waveInGetNumDevs()) + return MCIERR_OUTOFRANGE; + if (wmw->wInput != (WORD)lpParms->wInput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wInput = lpParms->wInput; + } + if (dwFlags & MCI_WAVE_OUTPUT) { + TRACE("MCI_WAVE_OUTPUT = %d\n", lpParms->wOutput); + if (lpParms->wOutput >= waveOutGetNumDevs()) + return MCIERR_OUTOFRANGE; + if (wmw->wOutput != (WORD)lpParms->wOutput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wOutput = lpParms->wOutput; + } + if (dwFlags & MCI_WAVE_SET_ANYINPUT) { + TRACE("MCI_WAVE_SET_ANYINPUT\n"); + if (wmw->wInput != (WORD)lpParms->wInput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wInput = WAVE_MAPPER; + } + if (dwFlags & MCI_WAVE_SET_ANYOUTPUT) { + TRACE("MCI_WAVE_SET_ANYOUTPUT\n"); + if (wmw->wOutput != (WORD)lpParms->wOutput) + WAVE_mciStop(wDevID, MCI_WAIT, NULL); + wmw->wOutput = WAVE_MAPPER; + } /* Set wave format parameters is refused after Open or Record.*/ if (dwFlags & MCI_WAVE_SET_FORMATTAG) { - TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", ((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag); + TRACE("MCI_WAVE_SET_FORMATTAG = %d\n", lpParms->wFormatTag); if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - if (((LPMCI_WAVE_SET_PARMS)lpParms)->wFormatTag != WAVE_FORMAT_PCM) + if (lpParms->wFormatTag != WAVE_FORMAT_PCM) return MCIERR_OUTOFRANGE; } if (dwFlags & MCI_WAVE_SET_AVGBYTESPERSEC) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nAvgBytesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nAvgBytesPerSec; + wmw->wfxRef.nAvgBytesPerSec = lpParms->nAvgBytesPerSec; TRACE("MCI_WAVE_SET_AVGBYTESPERSEC = %d\n", wmw->wfxRef.nAvgBytesPerSec); } if (dwFlags & MCI_WAVE_SET_BITSPERSAMPLE) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.wBitsPerSample = ((LPMCI_WAVE_SET_PARMS)lpParms)->wBitsPerSample; + wmw->wfxRef.wBitsPerSample = lpParms->wBitsPerSample; TRACE("MCI_WAVE_SET_BITSPERSAMPLE = %d\n", wmw->wfxRef.wBitsPerSample); } if (dwFlags & MCI_WAVE_SET_BLOCKALIGN) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nBlockAlign = ((LPMCI_WAVE_SET_PARMS)lpParms)->nBlockAlign; + wmw->wfxRef.nBlockAlign = lpParms->nBlockAlign; TRACE("MCI_WAVE_SET_BLOCKALIGN = %d\n", wmw->wfxRef.nBlockAlign); } if (dwFlags & MCI_WAVE_SET_CHANNELS) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nChannels = ((LPMCI_WAVE_SET_PARMS)lpParms)->nChannels; + wmw->wfxRef.nChannels = lpParms->nChannels; TRACE("MCI_WAVE_SET_CHANNELS = %d\n", wmw->wfxRef.nChannels); } if (dwFlags & MCI_WAVE_SET_SAMPLESPERSEC) { if (wmw->lpWaveFormat != &wmw->wfxRef) return MCIERR_NONAPPLICABLE_FUNCTION; - wmw->wfxRef.nSamplesPerSec = ((LPMCI_WAVE_SET_PARMS)lpParms)->nSamplesPerSec; + wmw->wfxRef.nSamplesPerSec = lpParms->nSamplesPerSec; TRACE("MCI_WAVE_SET_SAMPLESPERSEC = %d\n", wmw->wfxRef.nSamplesPerSec); } if (dwFlags & MCI_NOTIFY) @@ -1500,24 +1518,34 @@ static DWORD WAVE_mciStatus(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_STATUS_PARM ret = MCI_RESOURCE_RETURNED; break; case MCI_WAVE_INPUT: - TRACE("MCI_WAVE_INPUT !\n"); - lpParms->dwReturn = 0; - ret = MCIERR_WAVE_INPUTUNSPECIFIED; + if (wmw->wInput != (WORD)WAVE_MAPPER) + lpParms->dwReturn = wmw->wInput; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_MAPPER, WAVE_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_WAVE_INPUT => %d\n", (signed)wmw->wInput); break; case MCI_WAVE_OUTPUT: - TRACE("MCI_WAVE_OUTPUT !\n"); - { - UINT id; - if (waveOutGetID(wmw->hWave, &id) == MMSYSERR_NOERROR) { - lpParms->dwReturn = id; - } else { - lpParms->dwReturn = 0; - ret = MCIERR_WAVE_OUTPUTUNSPECIFIED; - } + if (wmw->wOutput != (WORD)WAVE_MAPPER) + lpParms->dwReturn = wmw->wOutput; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_MAPPER, WAVE_MAPPER_S); + ret = MCI_RESOURCE_RETURNED; } + TRACE("MCI_WAVE_OUTPUT => %d\n", (signed)wmw->wOutput); break; /* It is always ok to query wave format parameters, * except on auto-open yield MCIERR_UNSUPPORTED_FUNCTION. */ + case MCI_WAVE_STATUS_FORMATTAG: + if (wmw->lpWaveFormat->wFormatTag != WAVE_FORMAT_PCM) + lpParms->dwReturn = wmw->lpWaveFormat->wFormatTag; + else { + lpParms->dwReturn = MAKEMCIRESOURCE(WAVE_FORMAT_PCM, WAVE_FORMAT_PCM_S); + ret = MCI_RESOURCE_RETURNED; + } + TRACE("MCI_WAVE_FORMATTAG => %lu\n", lpParms->dwReturn); + break; case MCI_WAVE_STATUS_AVGBYTESPERSEC: lpParms->dwReturn = wmw->lpWaveFormat->nAvgBytesPerSec; TRACE("MCI_WAVE_STATUS_AVGBYTESPERSEC => %lu\n", lpParms->dwReturn); @@ -1534,10 +1562,6 @@ static DWORD WAVE_mciStatus(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_STATUS_PARM lpParms->dwReturn = wmw->lpWaveFormat->nChannels; TRACE("MCI_WAVE_STATUS_CHANNELS => %lu\n", lpParms->dwReturn); break; - case MCI_WAVE_STATUS_FORMATTAG: - lpParms->dwReturn = wmw->lpWaveFormat->wFormatTag; - TRACE("MCI_WAVE_FORMATTAG => %lu\n", lpParms->dwReturn); - break; case MCI_WAVE_STATUS_SAMPLESPERSEC: lpParms->dwReturn = wmw->lpWaveFormat->nSamplesPerSec; TRACE("MCI_WAVE_STATUS_SAMPLESPERSEC => %lu\n", lpParms->dwReturn); @@ -1705,7 +1729,7 @@ LRESULT CALLBACK MCIWAVE_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, case MCI_PLAY: return WAVE_mciPlay (dwDevID, dwParam1, dwParam2, NULL); case MCI_RECORD: return WAVE_mciRecord (dwDevID, dwParam1, dwParam2, NULL); case MCI_STOP: return WAVE_mciStop (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); - case MCI_SET: return WAVE_mciSet (dwDevID, dwParam1, (LPMCI_SET_PARMS) dwParam2); + case MCI_SET: return WAVE_mciSet (dwDevID, dwParam1, (LPMCI_WAVE_SET_PARMS) dwParam2); case MCI_PAUSE: return WAVE_mciPause (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_RESUME: return WAVE_mciResume (dwDevID, dwParam1, (LPMCI_GENERIC_PARMS) dwParam2); case MCI_STATUS: return WAVE_mciStatus (dwDevID, dwParam1, (LPMCI_STATUS_PARMS) dwParam2); diff --git a/dll/win32/mscoree/mscoree.rbuild b/dll/win32/mscoree/mscoree.rbuild index 2fa0743f07a..a014334a962 100644 --- a/dll/win32/mscoree/mscoree.rbuild +++ b/dll/win32/mscoree/mscoree.rbuild @@ -5,6 +5,7 @@ wine advapi32 + shell32 uuid corruntimehost.c mscoree_main.c diff --git a/dll/win32/mscoree/mscoree_main.c b/dll/win32/mscoree/mscoree_main.c index 5b20c854c2e..0e6f25204cc 100644 --- a/dll/win32/mscoree/mscoree_main.c +++ b/dll/win32/mscoree/mscoree_main.c @@ -21,11 +21,14 @@ #include +#include "wine/unicode.h" #include "windef.h" #include "winbase.h" #include "winuser.h" +#include "winnls.h" #include "winreg.h" #include "ole2.h" +#include "shellapi.h" #include "initguid.h" #include "cor.h" @@ -36,26 +39,25 @@ WINE_DEFAULT_DEBUG_CHANNEL( mscoree ); -static LPWSTR get_mono_exe(void) +static BOOL get_mono_path(LPWSTR path) { - static const WCHAR mono_exe[] = {'b','i','n','\\','m','o','n','o','.','e','x','e',' ',0}; static const WCHAR mono_key[] = {'S','o','f','t','w','a','r','e','\\','N','o','v','e','l','l','\\','M','o','n','o',0}; static const WCHAR defaul_clr[] = {'D','e','f','a','u','l','t','C','L','R',0}; static const WCHAR install_root[] = {'S','d','k','I','n','s','t','a','l','l','R','o','o','t',0}; static const WCHAR slash[] = {'\\',0}; - WCHAR version[64], version_key[MAX_PATH], root[MAX_PATH], *ret; - DWORD len, size; + WCHAR version[64], version_key[MAX_PATH]; + DWORD len; HKEY key; if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, mono_key, 0, KEY_READ, &key)) - return NULL; + return FALSE; len = sizeof(version); if (RegQueryValueExW(key, defaul_clr, 0, NULL, (LPBYTE)version, &len)) { RegCloseKey(key); - return NULL; + return FALSE; } RegCloseKey(key); @@ -64,24 +66,129 @@ static LPWSTR get_mono_exe(void) lstrcatW(version_key, version); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, version_key, 0, KEY_READ, &key)) - return NULL; + return FALSE; - len = sizeof(root); - if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)root, &len)) + len = sizeof(WCHAR) * MAX_PATH; + if (RegQueryValueExW(key, install_root, 0, NULL, (LPBYTE)path, &len)) { RegCloseKey(key); - return NULL; + return FALSE; } RegCloseKey(key); - size = len + sizeof(slash) + sizeof(mono_exe); - if (!(ret = HeapAlloc(GetProcessHeap(), 0, size))) return NULL; + return TRUE; +} - lstrcpyW(ret, root); - lstrcatW(ret, slash); - lstrcatW(ret, mono_exe); +static CRITICAL_SECTION mono_lib_cs; +static CRITICAL_SECTION_DEBUG mono_lib_cs_debug = +{ + 0, 0, &mono_lib_cs, + { &mono_lib_cs_debug.ProcessLocksList, + &mono_lib_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": mono_lib_cs") } +}; +static CRITICAL_SECTION mono_lib_cs = { &mono_lib_cs_debug, -1, 0, 0, 0, 0 }; - return ret; +HMODULE mono_handle; + +void (*mono_config_parse)(const char *filename); +MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name); +void (*mono_jit_cleanup)(MonoDomain *domain); +int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); +MonoDomain* (*mono_jit_init)(const char *file); +int (*mono_jit_set_trace_options)(const char* options); +void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir); + +static void set_environment(LPCWSTR bin_path) +{ + WCHAR path_env[MAX_PATH]; + int len; + + static const WCHAR pathW[] = {'P','A','T','H',0}; + + /* We have to modify PATH as Mono loads other DLLs from this directory. */ + GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR)); + len = strlenW(path_env); + path_env[len++] = ';'; + strcpyW(path_env+len, bin_path); + SetEnvironmentVariableW(pathW, path_env); +} + +static HMODULE load_mono(void) +{ + static const WCHAR mono_dll[] = {'\\','b','i','n','\\','m','o','n','o','.','d','l','l',0}; + static const WCHAR libmono_dll[] = {'\\','b','i','n','\\','l','i','b','m','o','n','o','.','d','l','l',0}; + static const WCHAR bin[] = {'\\','b','i','n',0}; + static const WCHAR lib[] = {'\\','l','i','b',0}; + static const WCHAR etc[] = {'\\','e','t','c',0}; + HMODULE result; + WCHAR mono_path[MAX_PATH], mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4]; + WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4]; + char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH]; + + EnterCriticalSection(&mono_lib_cs); + + if (!mono_handle) + { + if (!get_mono_path(mono_path)) goto end; + + strcpyW(mono_bin_path, mono_path); + strcatW(mono_bin_path, bin); + set_environment(mono_bin_path); + + strcpyW(mono_lib_path, mono_path); + strcatW(mono_lib_path, lib); + WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL); + + strcpyW(mono_etc_path, mono_path); + strcatW(mono_etc_path, etc); + WideCharToMultiByte(CP_UTF8, 0, mono_etc_path, -1, mono_etc_path_a, MAX_PATH, NULL, NULL); + + strcpyW(mono_dll_path, mono_path); + strcatW(mono_dll_path, mono_dll); + mono_handle = LoadLibraryW(mono_dll_path); + + if (!mono_handle) + { + strcpyW(mono_dll_path, mono_path); + strcatW(mono_dll_path, libmono_dll); + mono_handle = LoadLibraryW(mono_dll_path); + } + + if (!mono_handle) goto end; + +#define LOAD_MONO_FUNCTION(x) do { \ + x = (void*)GetProcAddress(mono_handle, #x); \ + if (!x) { \ + mono_handle = NULL; \ + goto end; \ + } \ +} while (0); + + LOAD_MONO_FUNCTION(mono_config_parse); + LOAD_MONO_FUNCTION(mono_domain_assembly_open); + LOAD_MONO_FUNCTION(mono_jit_cleanup); + LOAD_MONO_FUNCTION(mono_jit_exec); + LOAD_MONO_FUNCTION(mono_jit_init); + LOAD_MONO_FUNCTION(mono_jit_set_trace_options); + LOAD_MONO_FUNCTION(mono_set_dirs); + +#undef LOAD_MONO_FUNCTION + + mono_set_dirs(mono_lib_path_a, mono_etc_path_a); + + mono_config_parse(NULL); + } + +end: + result = mono_handle; + + LeaveCriticalSection(&mono_lib_cs); + + if (!result) + MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n"); + + return result; } HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, @@ -89,20 +196,16 @@ HRESULT WINAPI CorBindToRuntimeHost(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor DWORD startupFlags, REFCLSID rclsid, REFIID riid, LPVOID *ppv) { - WCHAR *mono_exe; - FIXME("(%s, %s, %s, %p, %d, %s, %s, %p): semi-stub!\n", debugstr_w(pwszVersion), debugstr_w(pwszBuildFlavor), debugstr_w(pwszHostConfigFile), pReserved, startupFlags, debugstr_guid(rclsid), debugstr_guid(riid), ppv); - if (!(mono_exe = get_mono_exe())) + if (!get_mono_path(NULL)) { MESSAGE("wine: Install the Windows version of Mono to run .NET executables\n"); return E_FAIL; } - HeapFree(GetProcessHeap(), 0, mono_exe); - return S_OK; } @@ -138,68 +241,73 @@ BOOL WINAPI _CorDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } +static void get_utf8_args(int *argc, char ***argv) +{ + WCHAR **argvw; + int size=0, i; + char *current_arg; + + argvw = CommandLineToArgvW(GetCommandLineW(), argc); + + for (i=0; i<*argc; i++) + { + size += sizeof(char*); + size += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); + } + size += sizeof(char*); + + *argv = HeapAlloc(GetProcessHeap(), 0, size); + current_arg = (char*)(*argv + *argc + 1); + + for (i=0; i<*argc; i++) + { + (*argv)[i] = current_arg; + current_arg += WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, current_arg, size, NULL, NULL); + } + + (*argv)[*argc] = NULL; + + HeapFree(GetProcessHeap(), 0, argvw); +} + __int32 WINAPI _CorExeMain(void) { - STARTUPINFOW si; - PROCESS_INFORMATION pi; - WCHAR *mono_exe, *cmd_line; - DWORD size, exit_code; - static const WCHAR WINE_MONO_TRACE[]={'W','I','N','E','_','M','O','N','O','_','T','R','A','C','E',0}; - static const WCHAR trace_switch_start[]={'"','-','-','t','r','a','c','e','=',0}; - static const WCHAR trace_switch_end[]={'"',' ',0}; + int exit_code; int trace_size; - WCHAR trace_setting[256]; + char trace_setting[256]; + int argc; + char **argv; + MonoDomain *domain; + MonoAssembly *assembly; + char filename[MAX_PATH]; - if (!(mono_exe = get_mono_exe())) + if (!load_mono()) { - MESSAGE("install the Windows version of Mono to run .NET executables\n"); return -1; } - trace_size = GetEnvironmentVariableW(WINE_MONO_TRACE, trace_setting, sizeof(trace_setting)/sizeof(WCHAR)); + get_utf8_args(&argc, &argv); - size = (lstrlenW(mono_exe) + lstrlenW(GetCommandLineW()) + 1) * sizeof(WCHAR); - - if (trace_size) - size += (trace_size + lstrlenW(trace_switch_start) + lstrlenW(trace_switch_end)) * sizeof(WCHAR); - - if (!(cmd_line = HeapAlloc(GetProcessHeap(), 0, size))) - { - HeapFree(GetProcessHeap(), 0, mono_exe); - return -1; - } - - lstrcpyW(cmd_line, mono_exe); - HeapFree(GetProcessHeap(), 0, mono_exe); + trace_size = GetEnvironmentVariableA("WINE_MONO_TRACE", trace_setting, sizeof(trace_setting)); if (trace_size) { - lstrcatW(cmd_line, trace_switch_start); - lstrcatW(cmd_line, trace_setting); - lstrcatW(cmd_line, trace_switch_end); + mono_jit_set_trace_options(trace_setting); } - lstrcatW(cmd_line, GetCommandLineW()); + GetModuleFileNameA(NULL, filename, MAX_PATH); - TRACE("new command line: %s\n", debugstr_w(cmd_line)); + domain = mono_jit_init(filename); - memset(&si, 0, sizeof(si)); - si.cb = sizeof(si); - if (!CreateProcessW(NULL, cmd_line, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - HeapFree(GetProcessHeap(), 0, cmd_line); - return -1; - } - HeapFree(GetProcessHeap(), 0, cmd_line); + assembly = mono_domain_assembly_open(domain, filename); - /* wait for the process to exit */ - WaitForSingleObject(pi.hProcess, INFINITE); - GetExitCodeProcess(pi.hProcess, &exit_code); + exit_code = mono_jit_exec(domain, assembly, argc, argv); - CloseHandle(pi.hThread); - CloseHandle(pi.hProcess); + mono_jit_cleanup(domain); - return (int)exit_code; + HeapFree(GetProcessHeap(), 0, argv); + + return exit_code; } __int32 WINAPI _CorExeMain2(PBYTE ptrMemory, DWORD cntMemory, LPWSTR imageName, LPWSTR loaderName, LPWSTR cmdLine) diff --git a/dll/win32/mscoree/mscoree_private.h b/dll/win32/mscoree/mscoree_private.h index f329455fff1..f14da1d15cd 100644 --- a/dll/win32/mscoree/mscoree_private.h +++ b/dll/win32/mscoree/mscoree_private.h @@ -22,5 +22,18 @@ extern IUnknown* create_corruntimehost(void); +/* Mono 2.6 embedding */ +typedef struct _MonoDomain MonoDomain; +typedef struct _MonoAssembly MonoAssembly; + +extern HMODULE mono_handle; + +extern void (*mono_config_parse)(const char *filename); +extern MonoAssembly* (*mono_domain_assembly_open) (MonoDomain *domain, const char *name); +extern void (*mono_jit_cleanup)(MonoDomain *domain); +extern int (*mono_jit_exec)(MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); +extern MonoDomain* (*mono_jit_init)(const char *file); +extern int (*mono_jit_set_trace_options)(const char* options); +extern void (*mono_set_dirs)(const char *assembly_dir, const char *config_dir); #endif /* __MSCOREE_PRIVATE__ */ diff --git a/dll/win32/msctf/displayattributemgr.c b/dll/win32/msctf/displayattributemgr.c new file mode 100644 index 00000000000..75248cd4393 --- /dev/null +++ b/dll/win32/msctf/displayattributemgr.c @@ -0,0 +1,139 @@ +/* + * ITfDisplayAttributeMgr implementation + * + * Copyright 2010 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "wine/debug.h" +#include "winbase.h" +#include "winreg.h" +#include "shlwapi.h" + +#include "msctf.h" +#include "msctf_internal.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msctf); + +typedef struct tagDisplayAttributeMgr { + const ITfDisplayAttributeMgrVtbl *DisplayAttributeMgrVtbl; + + LONG refCount; + +} DisplayAttributeMgr; + +static void DisplayAttributeMgr_Destructor(DisplayAttributeMgr *This) +{ + TRACE("destroying %p\n", This); + + HeapFree(GetProcessHeap(),0,This); +} + +static HRESULT WINAPI DisplayAttributeMgr_QueryInterface(ITfDisplayAttributeMgr *iface, REFIID iid, LPVOID *ppvOut) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + *ppvOut = NULL; + + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfDisplayAttributeMgr)) + { + *ppvOut = This; + } + + if (*ppvOut) + { + IUnknown_AddRef(iface); + return S_OK; + } + + WARN("unsupported interface: %s\n", debugstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI DisplayAttributeMgr_AddRef(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + return InterlockedIncrement(&This->refCount); +} + +static ULONG WINAPI DisplayAttributeMgr_Release(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + ULONG ret; + + ret = InterlockedDecrement(&This->refCount); + if (ret == 0) + DisplayAttributeMgr_Destructor(This); + return ret; +} + +/***************************************************** + * ITfDisplayAttributeMgr functions + *****************************************************/ + +static HRESULT WINAPI DisplayAttributeMgr_OnUpdateInfo(ITfDisplayAttributeMgr *iface) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DisplayAttributeMgr_EnumDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, IEnumTfDisplayAttributeInfo **ppEnum) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI DisplayAttributeMgr_GetDisplayAttributeInfo(ITfDisplayAttributeMgr *iface, REFGUID guid, ITfDisplayAttributeInfo **ppInfo, CLSID *pclsidOwner) +{ + DisplayAttributeMgr *This = (DisplayAttributeMgr *)iface; + + FIXME("STUB:(%p)\n",This); + return E_NOTIMPL; +} + +static const ITfDisplayAttributeMgrVtbl DisplayAttributeMgr_DisplayAttributeMgrVtbl = +{ + DisplayAttributeMgr_QueryInterface, + DisplayAttributeMgr_AddRef, + DisplayAttributeMgr_Release, + + DisplayAttributeMgr_OnUpdateInfo, + DisplayAttributeMgr_EnumDisplayAttributeInfo, + DisplayAttributeMgr_GetDisplayAttributeInfo +}; + +HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut) +{ + DisplayAttributeMgr *This; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + This = HeapAlloc(GetProcessHeap(),0,sizeof(DisplayAttributeMgr)); + if (This == NULL) + return E_OUTOFMEMORY; + + This->DisplayAttributeMgrVtbl= &DisplayAttributeMgr_DisplayAttributeMgrVtbl; + This->refCount = 1; + + TRACE("returning %p\n", This); + *ppOut = (IUnknown *)This; + return S_OK; +} diff --git a/dll/win32/msctf/inputprocessor.c b/dll/win32/msctf/inputprocessor.c index ba4a76d83b5..34e35c41cb1 100644 --- a/dll/win32/msctf/inputprocessor.c +++ b/dll/win32/msctf/inputprocessor.c @@ -279,8 +279,8 @@ static HRESULT WINAPI InputProcessorProfiles_AddLanguageProfile( if (!res) { DWORD zero = 0x0; - RegSetValueExW(fmtkey, desc, 0, REG_SZ, (LPBYTE)pchDesc, cchDesc * sizeof(WCHAR)); - RegSetValueExW(fmtkey, icnf, 0, REG_SZ, (LPBYTE)pchIconFile, cchFile * sizeof(WCHAR)); + RegSetValueExW(fmtkey, desc, 0, REG_SZ, (const BYTE*)pchDesc, cchDesc * sizeof(WCHAR)); + RegSetValueExW(fmtkey, icnf, 0, REG_SZ, (const BYTE*)pchIconFile, cchFile * sizeof(WCHAR)); RegSetValueExW(fmtkey, icni, 0, REG_DWORD, (LPBYTE)&uIconIndex, sizeof(DWORD)); if (disposition == REG_CREATED_NEW_KEY) RegSetValueExW(fmtkey, szwEnable, 0, REG_DWORD, (LPBYTE)&zero, sizeof(DWORD)); diff --git a/dll/win32/msctf/msctf.c b/dll/win32/msctf/msctf.c index 62d1ff2abd8..759fe7ec579 100644 --- a/dll/win32/msctf/msctf.c +++ b/dll/win32/msctf/msctf.c @@ -88,6 +88,7 @@ static const struct { {&CLSID_TF_InputProcessorProfiles, InputProcessorProfiles_Constructor}, {&CLSID_TF_CategoryMgr, CategoryMgr_Constructor}, {&CLSID_TF_LangBarMgr, LangBarMgr_Constructor}, + {&CLSID_TF_DisplayAttributeMgr, DisplayAttributeMgr_Constructor}, {NULL, NULL} }; diff --git a/dll/win32/msctf/msctf.rbuild b/dll/win32/msctf/msctf.rbuild index de8f52bf64d..cb072f676e7 100644 --- a/dll/win32/msctf/msctf.rbuild +++ b/dll/win32/msctf/msctf.rbuild @@ -11,6 +11,7 @@ categorymgr.c compartmentmgr.c context.c + displayattributemgr.c documentmgr.c inputprocessor.c langbarmgr.c diff --git a/dll/win32/msctf/msctf_internal.h b/dll/win32/msctf/msctf_internal.h index 57423e996fc..9aaaad0fb1b 100644 --- a/dll/win32/msctf/msctf_internal.h +++ b/dll/win32/msctf/msctf_internal.h @@ -41,6 +41,7 @@ extern HRESULT Range_Constructor(ITfContext *context, ITextStoreACP *textstore, extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut); extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This); extern HRESULT LangBarMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); +extern HRESULT DisplayAttributeMgr_Constructor(IUnknown *pUnkOuter, IUnknown **ppOut); extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager); extern HRESULT Context_Uninitialize(ITfContext *cxt); diff --git a/dll/win32/msctf/regsvr.c b/dll/win32/msctf/regsvr.c index 2af1f241154..65ebb1da122 100644 --- a/dll/win32/msctf/regsvr.c +++ b/dll/win32/msctf/regsvr.c @@ -469,6 +469,13 @@ static struct regsvr_coclass const coclass_list[] = { "msctf.dll", "Apartment" }, + { + &CLSID_TF_DisplayAttributeMgr, + "TF_DisplayAttributeMgr", + NULL, + "msctf.dll", + "Apartment" + }, { NULL } /* list terminator */ }; diff --git a/dll/win32/msgina/lang/bg-BG.rc b/dll/win32/msgina/lang/bg-BG.rc index fc0e8300ddb..16c3c31cfab 100644 --- a/dll/win32/msgina/lang/bg-BG.rc +++ b/dll/win32/msgina/lang/bg-BG.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ツ" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "マ裔頸褄:",IDC_STATIC,36,75,45,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "マ瑩:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "ト碣",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "ホ珸",IDCANCEL,115,122,50,14 PUSHBUTTON "ネ鉤籵",IDC_SHUTDOWN,179,122,50,14 - LTEXT "マ裔頸褄:",IDC_STATIC,36,75,45,8 - LTEXT "マ瑩:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ム鞳" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "ホ珸",IDCANCEL,130,95,99,14 - PUSHBUTTON "ネ鋏",IDC_LOGOFF,90,76,75,14 - PUSHBUTTON "ネ鉤籵",IDC_SHUTDOWN,170,76,75,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "ハ瑕粽 趺瑯?",IDC_STATIC,86,60,87,8 PUSHBUTTON "ヌ瑕籵 ",IDC_LOCK,25,95,99,14 + PUSHBUTTON "ネ鋏",IDC_LOGOFF,90,76,75,14 + PUSHBUTTON "ネ鉤籵",IDC_SHUTDOWN,170,76,75,14 PUSHBUTTON "ヌ琅璞褊 珞頸褄",IDC_TASKMGR,10,76,75,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "ホ珸",IDCANCEL,130,95,99,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/cs-CZ.rc b/dll/win32/msgina/lang/cs-CZ.rc index 7ecf432f4a8..79391bb58bf 100644 --- a/dll/win32/msgina/lang/cs-CZ.rc +++ b/dll/win32/msgina/lang/cs-CZ.rc @@ -27,14 +27,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Pihl癩en" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Jm駭o:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Heslo:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Storno",IDCANCEL,115,122,50,14 PUSHBUTTON "Vypnout",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Jm駭o:",IDC_STATIC,36,75,40,8 - LTEXT "Heslo:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -42,13 +42,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Bezpe鈩ost" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Storno",IDCANCEL,170,95,70,14 - PUSHBUTTON "Odhl疽it",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Vypnout",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Co chcete udlat?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Uzamknout po竟ta",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Odhl疽it",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Vypnout",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Spr疱ce loh",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Storno",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/de-DE.rc b/dll/win32/msgina/lang/de-DE.rc index 9d3704138b5..3dad1cee158 100644 --- a/dll/win32/msgina/lang/de-DE.rc +++ b/dll/win32/msgina/lang/de-DE.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Logon" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Benutzername:",IDC_STATIC,26, 75, 54, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Passwort:",IDC_STATIC,43, 93, 38, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,41, 122, 50, 14,BS_DEFPUSHBUTTON PUSHBUTTON "Abbrechen",IDCANCEL,103, 122, 50, 14 PUSHBUTTON "Herunterfahren",IDC_SHUTDOWN,165, 122, 64, 14 - LTEXT "Benutzername:",IDC_STATIC,26, 75, 54, 8 - LTEXT "Passwort:",IDC_STATIC,43, 93, 38, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Sicherheit" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Abbrechen",IDCANCEL,170,95,70,14 - PUSHBUTTON "Abmelden",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Herunterfahren",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Was wollen Sie tun?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Computer sperren",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Abmelden",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Herunterfahren",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Taskmanager",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Abbrechen",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/en-US.rc b/dll/win32/msgina/lang/en-US.rc index ed5a0e2ea42..4324b99098c 100644 --- a/dll/win32/msgina/lang/en-US.rc +++ b/dll/win32/msgina/lang/en-US.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Logon" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Username:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Password:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Cancel",IDCANCEL,115,122,50,14 PUSHBUTTON "Shutdown",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Username:",IDC_STATIC,36,75,40,8 - LTEXT "Password:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Security" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Cancel",IDCANCEL,170,95,70,14 - PUSHBUTTON "Log off",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Shutdown",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "What do you want to do?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Lock computer",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Log off",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Shutdown",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Task manager",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Cancel",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/es-ES.rc b/dll/win32/msgina/lang/es-ES.rc index 68a4f57212a..05f89339be1 100644 --- a/dll/win32/msgina/lang/es-ES.rc +++ b/dll/win32/msgina/lang/es-ES.rc @@ -27,14 +27,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Acceder" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Usuario:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Contrasea:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "Aceptar",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Cancelar",IDCANCEL,115,122,50,14 PUSHBUTTON "Cerrar",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Usuario:",IDC_STATIC,36,75,40,8 - LTEXT "Contrasea:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0, 0, 261, 116 @@ -42,13 +42,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Seguridad" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Cancelar",IDCANCEL, 186, 95, 70, 14 - PUSHBUTTON "Salir",IDC_LOGOFF, 92, 76, 88, 14 - PUSHBUTTON "Cerrar",IDC_SHUTDOWN, 186, 76, 70, 14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "ソQu quieres hacer?",IDC_STATIC, 94, 60, 87, 8 PUSHBUTTON "Bloquear computadora",IDC_LOCK, 4, 76, 83, 14 + PUSHBUTTON "Salir",IDC_LOGOFF, 92, 76, 88, 14 + PUSHBUTTON "Cerrar",IDC_SHUTDOWN, 186, 76, 70, 14 PUSHBUTTON "Administrador de tareas",IDC_TASKMGR, 92, 95, 88, 14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Cancelar",IDCANCEL, 186, 95, 70, 14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/fr-FR.rc b/dll/win32/msgina/lang/fr-FR.rc index a0bda097c78..c4d453edefa 100644 --- a/dll/win32/msgina/lang/fr-FR.rc +++ b/dll/win32/msgina/lang/fr-FR.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Connexion" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Utilisateur:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Mot de passe:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Annuler",IDCANCEL,115,122,50,14 PUSHBUTTON "ノteindre",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Utilisateur:",IDC_STATIC,36,75,40,8 - LTEXT "Mot de passe:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0, 0, 258, 116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "S馗urit" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Annuler",IDCANCEL, 184, 95, 70, 14 - PUSHBUTTON "D馗onnecter",IDC_LOGOFF, 93, 76, 85, 14 - PUSHBUTTON "ノteindre",IDC_SHUTDOWN, 184, 76, 70, 14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Que voulez vous faire?",IDC_STATIC, 94, 60, 87, 8 PUSHBUTTON "Verrouiller l'ordinateur",IDC_LOCK, 4, 76, 82, 14 + PUSHBUTTON "D馗onnecter",IDC_LOGOFF, 93, 76, 85, 14 + PUSHBUTTON "ノteindre",IDC_SHUTDOWN, 184, 76, 70, 14 PUSHBUTTON "Gestionnaire de t稍hes",IDC_TASKMGR, 93, 95, 85, 14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Annuler",IDCANCEL, 184, 95, 70, 14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/id-ID.rc b/dll/win32/msgina/lang/id-ID.rc index be8b462e790..c73970da164 100644 --- a/dll/win32/msgina/lang/id-ID.rc +++ b/dll/win32/msgina/lang/id-ID.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Masuk" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Nama pengguna:",IDC_STATIC,22, 75, 61, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Kata sandi:",IDC_STATIC, 40, 93, 42, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Batal",IDCANCEL,115,122,50,14 PUSHBUTTON "Matikan",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Nama pengguna:",IDC_STATIC,22, 75, 61, 8 - LTEXT "Kata sandi:",IDC_STATIC, 40, 93, 42, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Keamanan" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Batal",IDCANCEL,170,95,70,14 - PUSHBUTTON "Keluar",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Matikan",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Apa yang ingin anda lakukan?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Kunci komputer",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Keluar",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Matikan",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Manager Tugas",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Batal",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/it-IT.rc b/dll/win32/msgina/lang/it-IT.rc index 8246a87c0f1..dd1858b93df 100644 --- a/dll/win32/msgina/lang/it-IT.rc +++ b/dll/win32/msgina/lang/it-IT.rc @@ -30,14 +30,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Logon" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Utente:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Password:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Annulla",IDCANCEL,115,122,50,14 PUSHBUTTON "Spegnimento",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Utente:",IDC_STATIC,36,75,40,8 - LTEXT "Password:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -45,13 +45,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Sicurezza" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Annulla",IDCANCEL,170,95,70,14 - PUSHBUTTON "Fine sessione",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Spegnimento",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Cosa volete fare?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Bloccare il computer",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Fine sessione",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Spegnimento",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Task manager",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Annulla",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/ja-JP.rc b/dll/win32/msgina/lang/ja-JP.rc index 76843fc3dc1..071c9476ece 100644 --- a/dll/win32/msgina/lang/ja-JP.rc +++ b/dll/win32/msgina/lang/ja-JP.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ログオン" FONT 9, "MS UI Gothic",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "ユーザー名:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "パスワード:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "キャンセル",IDCANCEL,115,122,50,14 PUSHBUTTON "シャットダウン",IDC_SHUTDOWN,179,122,50,14 - LTEXT "ユーザー名:",IDC_STATIC,36,75,40,8 - LTEXT "パスワード:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "セキュリティ" FONT 9, "MS UI Gothic",400,0,1 BEGIN - PUSHBUTTON "キャンセル",IDCANCEL,170,95,70,14 - PUSHBUTTON "ログオフ",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "シャットダウン",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "何をしますか?",IDC_STATIC,86,60,87,8 PUSHBUTTON "コンピュータのロック",IDC_LOCK,10,76,70,14 + PUSHBUTTON "ログオフ",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "シャットダウン",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "タスク マネージャ",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "キャンセル",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/no-NO.rc b/dll/win32/msgina/lang/no-NO.rc index 4de3810fe25..15594a92ea6 100644 --- a/dll/win32/msgina/lang/no-NO.rc +++ b/dll/win32/msgina/lang/no-NO.rc @@ -22,14 +22,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Logg p ReactOS" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Brukernavn:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Passord:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Avbryt",IDCANCEL,115,122,50,14 PUSHBUTTON "Avslutt",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Brukernavn:",IDC_STATIC,36,75,40,8 - LTEXT "Passord:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0, 0, 247, 116 @@ -37,13 +37,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ReactOS-sikkerhet" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Avbryt",IDCANCEL, 170, 95, 70, 14 - PUSHBUTTON "Logg av...",IDC_LOGOFF, 86, 76, 78, 14 - PUSHBUTTON "Avslutt...",IDC_SHUTDOWN, 170, 76, 70, 14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Hva vil du gjre?",IDC_STATIC, 92, 60, 87, 8 PUSHBUTTON "L蚶 datamaskinen...",IDC_LOCK, 7, 76, 74, 14 + PUSHBUTTON "Logg av...",IDC_LOGOFF, 86, 76, 78, 14 + PUSHBUTTON "Avslutt...",IDC_SHUTDOWN, 170, 76, 70, 14 PUSHBUTTON "Oppgavebehandling...",IDC_TASKMGR, 86, 95, 78, 14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Avbryt",IDCANCEL, 170, 95, 70, 14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/pl-PL.rc b/dll/win32/msgina/lang/pl-PL.rc index cd477b68fb8..8c33319d571 100644 --- a/dll/win32/msgina/lang/pl-PL.rc +++ b/dll/win32/msgina/lang/pl-PL.rc @@ -29,14 +29,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Logon" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Nazwa uソytkownika:",IDC_STATIC, 11, 75, 70, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Hasウo:",IDC_STATIC, 56, 93, 27, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Anuluj",IDCANCEL,115,122,50,14 PUSHBUTTON "Wyウケcz",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Nazwa uソytkownika:",IDC_STATIC, 11, 75, 70, 8 - LTEXT "Hasウo:",IDC_STATIC, 56, 93, 27, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -44,13 +44,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Bezpieczestwo" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Anuluj",IDCANCEL,170,95,70,14 - PUSHBUTTON "Wyloguj",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Wyウケcz",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "Co chcesz teraz zrobi?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Blokada komputera",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Wyloguj",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Wyウケcz",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Menedソer zada",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Anuluj",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/ro-RO.rc b/dll/win32/msgina/lang/ro-RO.rc index 156e8940c0f..b02a01c484b 100644 --- a/dll/win32/msgina/lang/ro-RO.rc +++ b/dll/win32/msgina/lang/ro-RO.rc @@ -1,10 +1,10 @@ -LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL +サソLANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL #pragma code_page(65001) IDD_STATUSWINDOW_DLG DIALOGEX 0,0,274,26 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP -CAPTION "Vト rugトノ aネ冲eptaネ嬖..." +CAPTION "Va rugam a?tepta?i..." FONT 8,"MS Shell Dlg",400,0,1 BEGIN LTEXT "",IDC_STATUSLABEL,7,8,234,12,SS_WORDELLIPSIS @@ -16,7 +16,7 @@ CAPTION "Bun venit la ReactOS" FONT 8,"MS Shell Dlg",400,0,1 BEGIN ICON IDI_LOCKICON, -1, 7, 5, 32, 32 - LTEXT "Apトピaネ嬖 combinaネ嬖a de taste Ctrl-Alt-Del",IDC_STATIC, 38, 10, 144, 14 + LTEXT "Apasa?i combina?ia de taste Ctrl-Alt-Del",IDC_STATIC, 38, 10, 144, 14 END IDD_LOGGEDOUT_DLG DIALOGEX 0,0,275,147 @@ -24,14 +24,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Autentificare" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Nume utilizator:",IDC_STATIC,36,75,40,8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Parola:",IDC_STATIC,36,93,42,8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Anulare",IDCANCEL,115,122,50,14 PUSHBUTTON "テ始chidere",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Nume utilizator:",IDC_STATIC,36,75,40,8 - LTEXT "Parolト:",IDC_STATIC,36,93,42,8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -39,23 +39,23 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Securitate" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Anulare",IDCANCEL,170,95,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + LTEXT "Ce vre?i sa face?i?",IDC_STATIC,86,60,87,8 + PUSHBUTTON "Blocare computer",IDC_LOCK,10,76,70,14 PUSHBUTTON "Deautentificare",IDC_LOGOFF,90,76,70,14 PUSHBUTTON "テ始chidere",IDC_SHUTDOWN,170,76,70,14 - LTEXT "Ce vreネ嬖 sト faceネ嬖?",IDC_STATIC,86,60,87,8 - PUSHBUTTON "Blocare computer",IDC_LOCK,10,76,70,14 - PUSHBUTTON "Gestionar activitトκ嬖",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Gestionar activita?i",IDC_TASKMGR,90,95,70,14 + PUSHBUTTON "Anulare",IDCANCEL,170,95,70,14 END STRINGTABLE BEGIN IDS_LOGGEDOUTSAS "Bun venit!" IDS_LOCKEDSAS "Computerul este acum blocat." - IDS_PRESSCTRLALTDELETE "Apトピaネ嬖 Control+Alt+Delete pentru a vト autentifica." + IDS_PRESSCTRLALTDELETE "Apasa?i Control+Alt+Delete pentru a va autentifica." IDS_ASKFORUSER "Nume utilizator: " - IDS_ASKFORPASSWORD "Parolト: " - IDS_FORCELOGOFF "Aceastト acネ嬖une va テョnchide sesiunea utilizatorului curent ネ冓 va pierde datele nesalvate de acesta. Sigur continuaネ嬖?" + IDS_ASKFORPASSWORD "Parola: " + IDS_FORCELOGOFF "Aceasta ac?iune va テョnchide sesiunea utilizatorului curent ?i va pierde datele nesalvate de acesta. Sigur continua?i?" END #pragma code_page(default) diff --git a/dll/win32/msgina/lang/ru-RU.rc b/dll/win32/msgina/lang/ru-RU.rc index cb1c1df1acd..d795535b54b 100644 --- a/dll/win32/msgina/lang/ru-RU.rc +++ b/dll/win32/msgina/lang/ru-RU.rc @@ -24,14 +24,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ツ" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + RTEXT "ネ 鉋籵褄:", IDC_STATIC, 6, 75, 70, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + RTEXT "マ瑩:", IDC_STATIC, 6, 93, 70, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK", IDOK, 47, 122, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "ホ褊", IDCANCEL, 109, 122, 50, 14 PUSHBUTTON "ツ褊韃", IDC_SHUTDOWN, 171, 122, 58, 14 - RTEXT "ネ 鉋籵褄:", IDC_STATIC, 6, 75, 70, 8 - RTEXT "マ瑩:", IDC_STATIC, 6, 93, 70, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0, 0, 275, 116 @@ -39,13 +39,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "チ裼瑰" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "ホ褊", IDCANCEL, 198, 95, 70, 14 - PUSHBUTTON "ヌ珞褞褊韃 裄", IDC_LOGOFF, 102, 76, 86, 14 - PUSHBUTTON "ツ褊韃",IDC_SHUTDOWN, 198, 76, 70, 14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "ツ砒頸 褓磆蒻 蒟鴦粨:", IDC_STATIC, 7, 60, 123, 8 PUSHBUTTON "ヌ珮頏籵", IDC_LOCK, 7, 76, 86, 14 + PUSHBUTTON "ヌ珞褞褊韃 裄", IDC_LOGOFF, 102, 76, 86, 14 + PUSHBUTTON "ツ褊韃",IDC_SHUTDOWN, 198, 76, 70, 14 PUSHBUTTON "ト頌褪褞 鈞萵",IDC_TASKMGR, 102, 95, 86, 14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "ホ褊", IDCANCEL, 198, 95, 70, 14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/sk-SK.rc b/dll/win32/msgina/lang/sk-SK.rc index ab4d82577fa..4298f1a389d 100644 --- a/dll/win32/msgina/lang/sk-SK.rc +++ b/dll/win32/msgina/lang/sk-SK.rc @@ -26,14 +26,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Prihl疽enie" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "Meno pou橲vateセa:",IDC_STATIC,18, 75, 64, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "Heslo:",IDC_STATIC,56, 93, 24, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,51,122,50,14,BS_DEFPUSHBUTTON PUSHBUTTON "Zru喨",IDCANCEL,115,122,50,14 PUSHBUTTON "Vypn",IDC_SHUTDOWN,179,122,50,14 - LTEXT "Meno pou橲vateセa:",IDC_STATIC,18, 75, 64, 8 - LTEXT "Heslo:",IDC_STATIC,56, 93, 24, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0,0,247,116 @@ -41,13 +41,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "Bezpe鈩os" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "Zru喨",IDCANCEL,170,95,70,14 - PUSHBUTTON "Odhl疽i",IDC_LOGOFF,90,76,70,14 - PUSHBUTTON "Vypn",IDC_SHUTDOWN,170,76,70,14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "ネo chcete urobi?",IDC_STATIC,86,60,87,8 PUSHBUTTON "Uzamkn po竟ta",IDC_LOCK,10,76,70,14 + PUSHBUTTON "Odhl疽i",IDC_LOGOFF,90,76,70,14 + PUSHBUTTON "Vypn",IDC_SHUTDOWN,170,76,70,14 PUSHBUTTON "Spr疱ca loh",IDC_TASKMGR,90,95,70,14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "Zru喨",IDCANCEL,170,95,70,14 END STRINGTABLE diff --git a/dll/win32/msgina/lang/uk-UA.rc b/dll/win32/msgina/lang/uk-UA.rc index 49dc902602a..0fa79c3b624 100644 --- a/dll/win32/msgina/lang/uk-UA.rc +++ b/dll/win32/msgina/lang/uk-UA.rc @@ -30,14 +30,14 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "ツウ" FONT 8,"MS Shell Dlg",400,0,1 BEGIN + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 + LTEXT "ハ頌籵:",IDC_STATIC,33, 75, 48, 8 + EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL + LTEXT "マ瑩:",IDC_STATIC,48, 93, 34, 8 + EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK",IDOK,37, 122, 50, 14,BS_DEFPUSHBUTTON PUSHBUTTON "ム瑰籵",IDCANCEL,93, 122, 50, 14 PUSHBUTTON "ヌ珞褞褊 碚...",IDC_SHUTDOWN,148, 122, 86, 14 - LTEXT "ハ頌籵:",IDC_STATIC,33, 75, 48, 8 - LTEXT "マ瑩:",IDC_STATIC,48, 93, 34, 8 - EDITTEXT IDC_USERNAME,84,72,119,14,ES_AUTOHSCROLL - EDITTEXT IDC_PASSWORD,84,91,119,14,ES_AUTOHSCROLL | ES_PASSWORD - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,275,59 END IDD_LOGGEDON_DLG DIALOGEX 0, 0, 257, 116 @@ -45,13 +45,13 @@ STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS CAPTION "チ裼裲" FONT 8,"MS Shell Dlg",400,0,1 BEGIN - PUSHBUTTON "ム瑰籵",IDCANCEL, 165, 95, 86, 14 - PUSHBUTTON "ツ頷ウ ウ 頌褌...",IDC_LOGOFF, 80, 76, 80, 14 - PUSHBUTTON "ヌ珞褞褊 碚...",IDC_SHUTDOWN, 165, 76, 86, 14 + CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 LTEXT "ル ツ 褪 銜礪?",IDC_STATIC, 86, 60, 87, 8 PUSHBUTTON "チ籵",IDC_LOCK, 6, 76, 70, 14 + PUSHBUTTON "ツ頷ウ ウ 頌褌...",IDC_LOGOFF, 80, 76, 80, 14 + PUSHBUTTON "ヌ珞褞褊 碚...",IDC_SHUTDOWN, 165, 76, 86, 14 PUSHBUTTON "ト頌褪褞 鈞粭瑙",IDC_TASKMGR, 80, 95, 80, 14 - CONTROL IDI_ROSLOGO,IDC_ROSLOGO,"Static",SS_BITMAP,0,0,247,53 + PUSHBUTTON "ム瑰籵",IDCANCEL, 165, 95, 86, 14 END STRINGTABLE diff --git a/dll/win32/msgina/msgina.c b/dll/win32/msgina/msgina.c index 4ac03fed363..02c619d3e32 100644 --- a/dll/win32/msgina/msgina.c +++ b/dll/win32/msgina/msgina.c @@ -415,8 +415,9 @@ DoLoginTasks( IN PWSTR Password) { LPWSTR ProfilePath = NULL; + LPWSTR lpEnvironment = NULL; TOKEN_STATISTICS Stats; - PWLX_PROFILE_V1_0 pProfile = NULL; + PWLX_PROFILE_V2_0 pProfile = NULL; DWORD cbStats, cbSize; BOOL bResult; @@ -449,15 +450,25 @@ DoLoginTasks( } /* Allocate memory for profile */ - pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V1_0)); + pProfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WLX_PROFILE_V2_0)); if (!pProfile) { WARN("HeapAlloc() failed\n"); goto cleanup; } - pProfile->dwType = WLX_PROFILE_TYPE_V1_0; + pProfile->dwType = WLX_PROFILE_TYPE_V2_0; pProfile->pszProfile = ProfilePath; + lpEnvironment = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32 * sizeof(WCHAR)); + if (!lpEnvironment) + { + WARN("HeapAlloc() failed\n"); + goto cleanup; + } + wcscpy(lpEnvironment, L"LOGONSERVER=\\\\Test"); + + pProfile->pszEnvironment = lpEnvironment; + if (!GetTokenInformation(pgContext->UserToken, TokenStatistics, (PVOID)&Stats, @@ -467,6 +478,7 @@ DoLoginTasks( WARN("Couldn't get Authentication id from user token!\n"); goto cleanup; } + *pgContext->pAuthenticationId = Stats.AuthenticationId; pgContext->pMprNotifyInfo->pszUserName = DuplicationString(UserName); pgContext->pMprNotifyInfo->pszDomain = DuplicationString(Domain); @@ -477,6 +489,10 @@ DoLoginTasks( return TRUE; cleanup: + if (pProfile) + { + HeapFree(GetProcessHeap(), 0, pProfile->pszEnvironment); + } HeapFree(GetProcessHeap(), 0, pProfile); HeapFree(GetProcessHeap(), 0, ProfilePath); return FALSE; diff --git a/dll/win32/msgsm32.acm/msgsm32.c b/dll/win32/msgsm32.acm/msgsm32.c index e760ac3a0ed..12dfef91d3b 100644 --- a/dll/win32/msgsm32.acm/msgsm32.c +++ b/dll/win32/msgsm32.acm/msgsm32.c @@ -179,10 +179,10 @@ static DWORD GSM_FormatValidate(const WAVEFORMATEX *wfx) WARN("GSM nBlockAlign %u\n", wfx->nBlockAlign); return 0; } - if (((GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320) + if (((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock != 320) { WARN("GSM wSamplesPerBlock %u\n", - ((GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock); + ((const GSM610WAVEFORMAT*)wfx)->wSamplesPerBlock); return 0; } if (wfx->nAvgBytesPerSec != wfx->nSamplesPerSec * 65 / 320) diff --git a/dll/win32/mshtml/dispex.c b/dll/win32/mshtml/dispex.c index 4b1bd882e5e..de0c94871f6 100644 --- a/dll/win32/mshtml/dispex.c +++ b/dll/win32/mshtml/dispex.c @@ -52,8 +52,11 @@ struct dispex_data_t { typedef struct { VARIANT var; LPWSTR name; + DWORD flags; } dynamic_prop_t; +#define DYNPROP_DELETED 0x01 + typedef struct { DispatchEx dispex; const IUnknownVtbl *lpIUnknownVtbl; @@ -245,12 +248,12 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, const FUN static int dispid_cmp(const void *p1, const void *p2) { - return ((func_info_t*)p1)->id - ((func_info_t*)p2)->id; + return ((const func_info_t*)p1)->id - ((const func_info_t*)p2)->id; } static int func_name_cmp(const void *p1, const void *p2) { - return strcmpiW((*(func_info_t**)p1)->name, (*(func_info_t**)p2)->name); + return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); } static dispex_data_t *preprocess_dispex_data(DispatchEx *This) @@ -319,7 +322,7 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This) static int id_cmp(const void *p1, const void *p2) { - return *(DISPID*)p1 - *(DISPID*)p2; + return *(const DISPID*)p1 - *(const DISPID*)p2; } HRESULT get_dispids(tid_t tid, DWORD *ret_size, DISPID **ret) @@ -442,7 +445,7 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags { const BOOL alloc = flags & fdexNameEnsure; dispex_dynamic_data_t *data; - unsigned i; + dynamic_prop_t *prop; data = get_dynamic_data(This, alloc); if(!data) { @@ -453,9 +456,14 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags return DISP_E_UNKNOWNNAME; } - for(i=0; i < data->prop_cnt; i++) { - if(flags & fdexNameCaseInsensitive ? !strcmpiW(data->props[i].name, name) : !strcmpW(data->props[i].name, name)) { - *ret = data->props+i; + for(prop = data->props; prop < data->props+data->prop_cnt; prop++) { + if(flags & fdexNameCaseInsensitive ? !strcmpiW(prop->name, name) : !strcmpW(prop->name, name)) { + if(prop->flags & DYNPROP_DELETED) { + if(!alloc) + return DISP_E_UNKNOWNNAME; + prop->flags &= ~DYNPROP_DELETED; + } + *ret = prop; return S_OK; } } @@ -481,10 +489,16 @@ static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, DWORD flags data->buf_size <<= 1; } - data->props[data->prop_cnt].name = heap_strdupW(name); - VariantInit(&data->props[data->prop_cnt].var); - *ret = data->props + data->prop_cnt++; + prop = data->props + data->prop_cnt; + prop->name = heap_strdupW(name); + if(!prop->name) + return E_OUTOFMEMORY; + + VariantInit(&prop->var); + prop->flags = 0; + data->prop_cnt++; + *ret = prop; return S_OK; } @@ -729,6 +743,109 @@ static HRESULT get_builtin_func(dispex_data_t *data, DISPID id, func_info_t **re return DISP_E_UNKNOWNNAME; } +static HRESULT get_builtin_id(DispatchEx *This, BSTR name, DWORD grfdex, DISPID *ret) +{ + dispex_data_t *data; + int min, max, n, c; + + data = get_dispex_data(This); + if(!data) + return E_FAIL; + + min = 0; + max = data->func_cnt-1; + + while(min <= max) { + n = (min+max)/2; + + c = strcmpiW(data->name_table[n]->name, name); + if(!c) { + if((grfdex & fdexNameCaseSensitive) && strcmpW(data->name_table[n]->name, name)) + break; + + *ret = data->name_table[n]->id; + return S_OK; + } + + if(c > 0) + max = n-1; + else + min = n+1; + } + + if(This->data->vtbl && This->data->vtbl->get_dispid) { + HRESULT hres; + + hres = This->data->vtbl->get_dispid(This->outer, name, grfdex, ret); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + } + + return DISP_E_UNKNOWNNAME; +} + +static HRESULT invoke_builtin_prop(DispatchEx *This, DISPID id, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) +{ + dispex_data_t *data; + func_info_t *func; + HRESULT hres; + + data = get_dispex_data(This); + if(!data) + return E_FAIL; + + hres = get_builtin_func(data, id, &func); + if(id == DISPID_VALUE && hres == DISP_E_UNKNOWNNAME) + return dispex_value(This, lcid, flags, dp, res, ei, caller); + if(FAILED(hres)) + return hres; + + if(func->func_disp_idx == -1) + hres = typeinfo_invoke(This, func, flags, dp, res, ei); + else + hres = function_invoke(This, func, flags, dp, res, ei); + + return hres; +} + +HRESULT remove_prop(DispatchEx *This, BSTR name, VARIANT_BOOL *success) +{ + dynamic_prop_t *prop; + DISPID id; + HRESULT hres; + + hres = get_builtin_id(This, name, 0, &id); + if(hres == S_OK) { + DISPID named_id = DISPID_PROPERTYPUT; + VARIANT var; + DISPPARAMS dp = {&var,&named_id,1,1}; + EXCEPINFO ei; + + V_VT(&var) = VT_EMPTY; + memset(&ei, 0, sizeof(ei)); + hres = invoke_builtin_prop(This, id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL); + if(FAILED(hres)) + return hres; + + *success = VARIANT_TRUE; + return S_OK; + } + + hres = get_dynamic_prop(This, name, 0, &prop); + if(FAILED(hres)) { + if(hres != DISP_E_UNKNOWNNAME) + return hres; + *success = VARIANT_FALSE; + return S_OK; + } + + VariantClear(&prop->var); + prop->flags |= DYNPROP_DELETED; + *success = VARIANT_TRUE; + return S_OK; +} + #define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface) static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) @@ -815,8 +932,6 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW { DispatchEx *This = DISPATCHEX_THIS(iface); dynamic_prop_t *dprop; - dispex_data_t *data; - int min, max, n, c; HRESULT hres; TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid); @@ -824,38 +939,9 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %x\n", grfdex); - data = get_dispex_data(This); - if(!data) - return E_FAIL; - - min = 0; - max = data->func_cnt-1; - - while(min <= max) { - n = (min+max)/2; - - c = strcmpiW(data->name_table[n]->name, bstrName); - if(!c) { - if((grfdex & fdexNameCaseSensitive) && strcmpW(data->name_table[n]->name, bstrName)) - break; - - *pid = data->name_table[n]->id; - return S_OK; - } - - if(c > 0) - max = n-1; - else - min = n+1; - } - - if(This->data->vtbl && This->data->vtbl->get_dispid) { - HRESULT hres; - - hres = This->data->vtbl->get_dispid(This->outer, bstrName, grfdex, pid); - if(hres != DISP_E_UNKNOWNNAME) - return hres; - } + hres = get_builtin_id(This, bstrName, grfdex, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; hres = get_dynamic_prop(This, bstrName, grfdex, &dprop); if(FAILED(hres)) @@ -869,8 +955,6 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { DispatchEx *This = DISPATCHEX_THIS(iface); - dispex_data_t *data; - func_info_t *func; HRESULT hres; TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); @@ -893,12 +977,12 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(is_dynamic_dispid(id)) { DWORD idx = id - DISPID_DYNPROP_0; - VARIANT *var; + dynamic_prop_t *prop; if(!This->dynamic_data || This->dynamic_data->prop_cnt <= idx) return DISP_E_UNKNOWNNAME; - var = &This->dynamic_data->props[idx].var; + prop = This->dynamic_data->props+idx; switch(wFlags) { case DISPATCH_METHOD|DISPATCH_PROPERTYGET: @@ -909,8 +993,8 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc DISPPARAMS dp = {NULL, &named_arg, 0, 1}; IDispatchEx *dispex; - if(V_VT(var) != VT_DISPATCH) { - FIXME("invoke vt %d\n", V_VT(var)); + if(V_VT(&prop->var) != VT_DISPATCH) { + FIXME("invoke %s\n", debugstr_variant(&prop->var)); return E_NOTIMPL; } @@ -929,14 +1013,14 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc V_VT(dp.rgvarg) = VT_DISPATCH; V_DISPATCH(dp.rgvarg) = (IDispatch*)DISPATCHEX(This); - hres = IDispatch_QueryInterface(V_DISPATCH(var), &IID_IDispatchEx, (void**)&dispex); + hres = IDispatch_QueryInterface(V_DISPATCH(&prop->var), &IID_IDispatchEx, (void**)&dispex); TRACE("%s call\n", debugstr_w(This->dynamic_data->props[idx].name)); if(SUCCEEDED(hres)) { hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, lcid, wFlags, &dp, pvarRes, pei, pspCaller); IDispatchEx_Release(dispex); }else { ULONG err = 0; - hres = IDispatch_Invoke(V_DISPATCH(var), DISPID_VALUE, &IID_NULL, lcid, wFlags, pdp, pvarRes, pei, &err); + hres = IDispatch_Invoke(V_DISPATCH(&prop->var), DISPID_VALUE, &IID_NULL, lcid, wFlags, pdp, pvarRes, pei, &err); } TRACE("%s ret %08x\n", debugstr_w(This->dynamic_data->props[idx].name), hres); @@ -944,7 +1028,9 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc return hres; } case DISPATCH_PROPERTYGET: - return VariantCopy(pvarRes, var); + if(prop->flags & DYNPROP_DELETED) + return DISP_E_UNKNOWNNAME; + return VariantCopy(pvarRes, &prop->var); case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF: case DISPATCH_PROPERTYPUT: if(pdp->cArgs != 1 || (pdp->cNamedArgs == 1 && *pdp->rgdispidNamedArgs != DISPID_PROPERTYPUT) @@ -954,30 +1040,20 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc } TRACE("put %s\n", debugstr_variant(pdp->rgvarg)); - VariantClear(var); - return VariantCopy(var, pdp->rgvarg); + VariantClear(&prop->var); + hres = VariantCopy(&prop->var, pdp->rgvarg); + if(FAILED(hres)) + return hres; + + prop->flags &= ~DYNPROP_DELETED; + return S_OK; default: FIXME("unhandled wFlags %x\n", wFlags); return E_NOTIMPL; } } - data = get_dispex_data(This); - if(!data) - return E_FAIL; - - hres = get_builtin_func(data, id, &func); - if(id == DISPID_VALUE && hres == DISP_E_UNKNOWNNAME) - return dispex_value(This, lcid, wFlags, pdp, pvarRes, pei, pspCaller); - if(FAILED(hres)) - return hres; - - if(func->func_disp_idx == -1) - hres = typeinfo_invoke(This, func, wFlags, pdp, pvarRes, pei); - else - hres = function_invoke(This, func, wFlags, pdp, pvarRes, pei); - - return hres; + return invoke_builtin_prop(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); } static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) @@ -1055,12 +1131,14 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, if(!This->dynamic_data || This->dynamic_data->prop_cnt <= idx) return DISP_E_UNKNOWNNAME; - if(idx+1 == This->dynamic_data->prop_cnt) { + while(++idx < This->dynamic_data->prop_cnt && This->dynamic_data->props[idx].flags & DYNPROP_DELETED); + + if(idx == This->dynamic_data->prop_cnt) { *pid = DISPID_STARTENUM; return S_FALSE; } - *pid = id+1; + *pid = DISPID_DYNPROP_0+idx; return S_OK; } diff --git a/dll/win32/mshtml/editor.c b/dll/win32/mshtml/editor.c index 961bb916370..14e7ebb6f64 100644 --- a/dll/win32/mshtml/editor.c +++ b/dll/win32/mshtml/editor.c @@ -508,7 +508,6 @@ void handle_edit_event(HTMLDocument *This, nsIDOMEvent *event) void handle_edit_load(HTMLDocument *This) { - This->doc_obj->nscontainer->reset_focus = GetFocus(); get_editor_controller(This->doc_obj->nscontainer); } diff --git a/dll/win32/mshtml/htmlelem.c b/dll/win32/mshtml/htmlelem.c index e77c1dc4c42..b0cb791a1e8 100644 --- a/dll/win32/mshtml/htmlelem.c +++ b/dll/win32/mshtml/htmlelem.c @@ -198,8 +198,10 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA LONG lFlags, VARIANT_BOOL *pfSuccess) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, pfSuccess); + + return remove_prop(&This->node.dispex, strAttributeName, pfSuccess); } static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v) diff --git a/dll/win32/mshtml/htmlwindow.c b/dll/win32/mshtml/htmlwindow.c index 2aafaa3e4b4..5dbea55905c 100644 --- a/dll/win32/mshtml/htmlwindow.c +++ b/dll/win32/mshtml/htmlwindow.c @@ -57,6 +57,26 @@ static void window_set_docnode(HTMLWindow *window, HTMLDocumentNode *doc_node) if(doc_node) htmldoc_addref(&doc_node->basedoc); } + + if(doc_node && window->doc_obj->usermode == EDITMODE) { + nsIDOMNSHTMLDocument *nshtmldoc; + nsAString mode_str; + nsresult nsres; + + static const PRUnichar onW[] = {'o','n',0}; + + nsres = nsIDOMHTMLDocument_QueryInterface(doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc); + if(NS_SUCCEEDED(nsres)) { + nsAString_Init(&mode_str, onW); + nsres = nsIDOMNSHTMLDocument_SetDesignMode(nshtmldoc, &mode_str); + nsAString_Finish(&mode_str); + nsIDOMNSHTMLDocument_Release(nshtmldoc); + if(NS_FAILED(nsres)) + ERR("SetDesignMode failed: %08x\n", nsres); + }else { + ERR("Could not get nsIDOMNSHTMLDocument interface: %08x\n", nsres); + } + } } nsIDOMWindow *get_nsdoc_window(nsIDOMDocument *nsdoc) diff --git a/dll/win32/mshtml/install.c b/dll/win32/mshtml/install.c index e47c28423d0..4122194a7cc 100644 --- a/dll/win32/mshtml/install.c +++ b/dll/win32/mshtml/install.c @@ -60,11 +60,6 @@ static const WCHAR mshtml_keyW[] = '\\','W','i','n','e', '\\','M','S','H','T','M','L',0}; -static const CHAR mshtml_keyA[] = - {'S','o','f','t','w','a','r','e', - '\\','W','i','n','e', - '\\','M','S','H','T','M','L',0}; - static HWND install_dialog = NULL; static LPWSTR tmp_file_name = NULL; static HANDLE tmp_file = INVALID_HANDLE_VALUE; @@ -230,18 +225,23 @@ static BOOL install_from_unix_file(const char *file_name) static BOOL install_from_registered_dir(void) { char *file_name; + HKEY hkey; DWORD res, type, size = MAX_PATH; BOOL ret; - file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME)); /* @@ Wine registry key: HKCU\Software\Wine\MSHTML */ - res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)file_name, &size); + res = RegOpenKeyW(HKEY_CURRENT_USER, mshtml_keyW, &hkey); + if(res != ERROR_SUCCESS) + return FALSE; + + file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME)); + res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); if(res == ERROR_MORE_DATA) { file_name = heap_realloc(file_name, size+sizeof(GECKO_FILE_NAME)); - res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir", RRF_RT_ANY, &type, (PBYTE)file_name, &size); + res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type, (PBYTE)file_name, &size); } - - if(res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ)) { + RegCloseKey(hkey); + if(res != ERROR_SUCCESS || type != REG_SZ) { heap_free(file_name); return FALSE; } diff --git a/dll/win32/mshtml/mshtml_private.h b/dll/win32/mshtml/mshtml_private.h index 228be35864e..3db8d791e48 100644 --- a/dll/win32/mshtml/mshtml_private.h +++ b/dll/win32/mshtml/mshtml_private.h @@ -38,6 +38,7 @@ #define NS_ERROR_FAILURE ((nsresult)0x80004005L) #define NS_NOINTERFACE ((nsresult)0x80004002L) #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L) +#define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L) #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L) #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL) #define NS_ERROR_UNKNOWN_PROTOCOL ((nsresult)0x804b0012L) @@ -171,6 +172,7 @@ void release_dispex(DispatchEx*); BOOL dispex_query_interface(DispatchEx*,REFIID,void**); HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**); HRESULT get_dispids(tid_t,DWORD*,DISPID**); +HRESULT remove_prop(DispatchEx*,BSTR,VARIANT_BOOL*); typedef struct HTMLWindow HTMLWindow; typedef struct HTMLDocumentNode HTMLDocumentNode; @@ -435,8 +437,6 @@ struct NSContainer { nsIURIContentListener *content_listener; HWND hwnd; - - HWND reset_focus; /* hack */ }; typedef struct nsWineURI nsWineURI; @@ -461,9 +461,16 @@ typedef struct { char *content_type; char *charset; PRUint32 response_status; + struct list response_headers; UINT url_scheme; } nsChannel; +struct ResponseHeader { + struct list entry; + WCHAR *header; + WCHAR *data; +}; + typedef struct { HRESULT (*qi)(HTMLDOMNode*,REFIID,void**); void (*destructor)(HTMLDOMNode*); @@ -836,7 +843,6 @@ void update_title(HTMLDocumentObj*); /* editor */ void init_editor(HTMLDocument*); -void set_ns_editmode(NSContainer*); void handle_edit_event(HTMLDocument*,nsIDOMEvent*); HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*); HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*); diff --git a/dll/win32/mshtml/navigate.c b/dll/win32/mshtml/navigate.c index cc2aeb3f6c2..7a777957ce1 100644 --- a/dll/win32/mshtml/navigate.c +++ b/dll/win32/mshtml/navigate.c @@ -62,7 +62,7 @@ typedef struct { HRESULT (*stop_binding)(BSCallback*,HRESULT); HRESULT (*read_data)(BSCallback*,IStream*); HRESULT (*on_progress)(BSCallback*,ULONG,LPCWSTR); - HRESULT (*on_response)(BSCallback*,DWORD); + HRESULT (*on_response)(BSCallback*,DWORD,LPCWSTR); } BSCallbackVtbl; struct BSCallback { @@ -493,7 +493,7 @@ static HRESULT WINAPI HttpNegotiate_OnResponse(IHttpNegotiate2 *iface, DWORD dwR TRACE("(%p)->(%d %s %s %p)\n", This, dwResponseCode, debugstr_w(szResponseHeaders), debugstr_w(szRequestHeaders), pszAdditionalRequestHeaders); - return This->vtbl->on_response(This, dwResponseCode); + return This->vtbl->on_response(This, dwResponseCode, szResponseHeaders); } static HRESULT WINAPI HttpNegotiate_GetRootSecurityId(IHttpNegotiate2 *iface, @@ -825,7 +825,8 @@ static HRESULT BufferBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCWSTR return S_OK; } -static HRESULT BufferBSC_on_response(BSCallback *bsc, DWORD response_code) +static HRESULT BufferBSC_on_response(BSCallback *bsc, DWORD response_code, + LPCWSTR response_headers) { return S_OK; } @@ -1099,11 +1100,72 @@ static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCW return S_OK; } -static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code) +static HRESULT nsChannelBSC_on_response(BSCallback *bsc, DWORD response_code, + LPCWSTR response_headers) { nsChannelBSC *This = NSCHANNELBSC_THIS(bsc); This->nschannel->response_status = response_code; + + if(response_headers) { + const WCHAR *hdr_start, *hdr_end; + + hdr_start = strchrW(response_headers, '\r'); + while(hdr_start) { + const WCHAR *colon; + struct ResponseHeader *new_header; + int len; + + hdr_start += 2; + hdr_end = strchrW(hdr_start, '\r'); + if(!hdr_end) { + WARN("Header doesn't end with CRLF: %s\n", wine_dbgstr_w(hdr_start)); + break; + } + if(hdr_end == hdr_start) + break; + + for(colon = hdr_start; *colon != ':' && colon != hdr_end; ++colon); + if(*colon != ':') { + WARN("Header missing colon: %s\n", wine_dbgstr_w(hdr_start)); + hdr_start = strchrW(hdr_start, '\r'); + continue; + } + + new_header = heap_alloc(sizeof(struct ResponseHeader)); + if(!new_header) + return E_OUTOFMEMORY; + + len = colon - hdr_start; + new_header->header = heap_alloc((len + 1) * sizeof(WCHAR)); + if(!new_header->header) { + heap_free(new_header); + return E_OUTOFMEMORY; + } + memcpy(new_header->header, hdr_start, len * sizeof(WCHAR)); + new_header->header[len] = 0; + + colon++; + while(*colon == ' ') + colon++; + + len = hdr_end - colon; + new_header->data = heap_alloc((len + 1) * sizeof(WCHAR)); + if(!new_header->data) { + heap_free(new_header->header); + heap_free(new_header); + return E_OUTOFMEMORY; + } + memcpy(new_header->data, colon, len * sizeof(WCHAR)); + new_header->data[len] = 0; + + list_add_head(&This->nschannel->response_headers, &new_header->entry); + TRACE("Adding header to list: (%s):(%s)\n", wine_dbgstr_w(new_header->header), wine_dbgstr_w(new_header->data)); + + hdr_start = strchrW(hdr_start, '\r'); + } + } + return S_OK; } diff --git a/dll/win32/mshtml/nsembed.c b/dll/win32/mshtml/nsembed.c index fa8aa41fedf..8a590079278 100644 --- a/dll/win32/mshtml/nsembed.c +++ b/dll/win32/mshtml/nsembed.c @@ -80,8 +80,6 @@ static const WCHAR wszNsContainer[] = {'N','s','C','o','n','t','a','i','n','e',' static ATOM nscontainer_class; -#define WM_RESETFOCUS_HACK WM_USER+600 - static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { NSContainer *This; @@ -106,20 +104,13 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP WARN("SetSize failed: %08x\n", nsres); break; - case WM_RESETFOCUS_HACK: - /* - * FIXME - * Gecko grabs focus in edit mode and some apps don't like it. - * We should somehow prevent grabbing focus. - */ + case WM_PARENTNOTIFY: + TRACE("WM_PARENTNOTIFY %x\n", (unsigned)wParam); - TRACE("WM_RESETFOCUS_HACK\n"); - - if(This->reset_focus) { - SetFocus(This->reset_focus); - This->reset_focus = NULL; - if(This->doc) - This->doc->focus = FALSE; + switch(wParam) { + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + nsIWebBrowserFocus_Activate(This->focus); } } @@ -776,46 +767,6 @@ void get_editor_controller(NSContainer *This) } } -void set_ns_editmode(NSContainer *This) -{ - nsIEditingSession *editing_session = NULL; - nsIURIContentListener *listener = NULL; - nsIDOMWindow *dom_window = NULL; - nsresult nsres; - - nsres = get_nsinterface((nsISupports*)This->webbrowser, &IID_nsIEditingSession, - (void**)&editing_session); - if(NS_FAILED(nsres)) { - ERR("Could not get nsIEditingSession: %08x\n", nsres); - return; - } - - nsres = nsIWebBrowser_GetContentDOMWindow(This->webbrowser, &dom_window); - if(NS_FAILED(nsres)) { - ERR("Could not get content DOM window: %08x\n", nsres); - nsIEditingSession_Release(editing_session); - return; - } - - nsres = nsIEditingSession_MakeWindowEditable(editing_session, dom_window, - NULL, FALSE, TRUE, TRUE); - nsIEditingSession_Release(editing_session); - nsIDOMWindow_Release(dom_window); - if(NS_FAILED(nsres)) { - ERR("MakeWindowEditable failed: %08x\n", nsres); - return; - } - - /* MakeWindowEditable changes WebBrowser's parent URI content listener. - * It seams to be a bug in Gecko. To workaround it we set our content - * listener again and Gecko's one as its parent. - */ - nsIWebBrowser_GetParentURIContentListener(This->webbrowser, &listener); - nsIURIContentListener_SetParentContentListener(NSURICL(This), listener); - nsIURIContentListener_Release(listener); - nsIWebBrowser_SetParentURIContentListener(This->webbrowser, NSURICL(This)); -} - void close_gecko(void) { TRACE("()\n"); @@ -1316,9 +1267,6 @@ static nsresult NSAPI nsEmbeddingSiteWindow_SetFocus(nsIEmbeddingSiteWindow *ifa TRACE("(%p)\n", This); - if(This->reset_focus) - PostMessageW(This->hwnd, WM_RESETFOCUS_HACK, 0, 0); - return nsIBaseWindow_SetFocus(This->window); } diff --git a/dll/win32/mshtml/nsevents.c b/dll/win32/mshtml/nsevents.c index c491424fdd4..3e0314966db 100644 --- a/dll/win32/mshtml/nsevents.c +++ b/dll/win32/mshtml/nsevents.c @@ -109,11 +109,11 @@ static nsrefcnt NSAPI nsDOMEventListener_Release(nsIDOMEventListener *iface) return release_listener(This); } -static BOOL is_doc_child_focus(HTMLDocumentObj *doc) +static BOOL is_doc_child_focus(NSContainer *nscontainer) { HWND hwnd; - for(hwnd = GetFocus(); hwnd && hwnd != doc->hwnd; hwnd = GetParent(hwnd)); + for(hwnd = GetFocus(); hwnd && hwnd != nscontainer->hwnd; hwnd = GetParent(hwnd)); return hwnd != NULL; } @@ -129,7 +129,7 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event return NS_ERROR_FAILURE; doc_obj = doc->basedoc.doc_obj; - if(!doc_obj->nscontainer->reset_focus && doc_obj->focus && !is_doc_child_focus(doc_obj)) { + if(doc_obj->focus && !is_doc_child_focus(doc_obj->nscontainer)) { doc_obj->focus = FALSE; notif_focus(doc_obj); } @@ -148,7 +148,7 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even return NS_ERROR_FAILURE; doc_obj = doc->basedoc.doc_obj; - if(!doc_obj->nscontainer->reset_focus && !doc_obj->focus) { + if(!doc_obj->focus) { doc_obj->focus = TRUE; notif_focus(doc_obj); } diff --git a/dll/win32/mshtml/nsio.c b/dll/win32/mshtml/nsio.c index 88a4e55254b..0c8e45704d7 100644 --- a/dll/win32/mshtml/nsio.c +++ b/dll/win32/mshtml/nsio.c @@ -307,7 +307,7 @@ static void set_uri_window(nsWineURI *This, HTMLWindow *window) static inline BOOL is_http_channel(nsChannel *This) { - return This->url_scheme == URL_SCHEME_HTTP || This->url_scheme == URL_SCHEME_HTTP; + return This->url_scheme == URL_SCHEME_HTTP || This->url_scheme == URL_SCHEME_HTTPS; } #define NSCHANNEL_THIS(iface) DEFINE_THIS(nsChannel, HttpChannel, iface) @@ -363,6 +363,8 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface) LONG ref = InterlockedDecrement(&This->ref); if(!ref) { + struct ResponseHeader *header, *next_hdr; + nsIURI_Release(NSURI(This->uri)); if(This->owner) nsISupports_Release(This->owner); @@ -376,6 +378,14 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface) nsIURI_Release(This->original_uri); heap_free(This->content_type); heap_free(This->charset); + + LIST_FOR_EACH_ENTRY_SAFE(header, next_hdr, &This->response_headers, struct ResponseHeader, entry) { + list_remove(&header->entry); + heap_free(header->header); + heap_free(header->data); + heap_free(header); + } + heap_free(This); } @@ -933,9 +943,9 @@ static nsresult NSAPI nsChannel_SetRequestMethod(nsIHttpChannel *iface, { nsChannel *This = NSCHANNEL_THIS(iface); - FIXME("(%p)->(%p)\n", This, aRequestMethod); + TRACE("(%p)->(%p): Returning NS_OK\n", This, aRequestMethod); - return NS_ERROR_NOT_IMPLEMENTED; + return NS_OK; } static nsresult NSAPI nsChannel_GetReferrer(nsIHttpChannel *iface, nsIURI **aReferrer) @@ -1052,19 +1062,48 @@ static nsresult NSAPI nsChannel_GetRequestSucceeded(nsIHttpChannel *iface, { nsChannel *This = NSCHANNEL_THIS(iface); - FIXME("(%p)->(%p)\n", This, aRequestSucceeded); + TRACE("(%p)->(%p)\n", This, aRequestSucceeded); - return NS_ERROR_NOT_IMPLEMENTED; + if(!This->response_status) + return NS_ERROR_NOT_AVAILABLE; + + *aRequestSucceeded = This->response_status/100 == 2; + + return NS_OK; } static nsresult NSAPI nsChannel_GetResponseHeader(nsIHttpChannel *iface, const nsACString *header, nsACString *_retval) { nsChannel *This = NSCHANNEL_THIS(iface); + const char *header_str; + WCHAR *header_wstr; + struct ResponseHeader *this_header; - FIXME("(%p)->(%p %p)\n", This, header, _retval); + nsACString_GetData(header, &header_str); + TRACE("(%p)->(%p(%s) %p)\n", This, header, header_str, _retval); - return NS_ERROR_NOT_IMPLEMENTED; + header_wstr = heap_strdupAtoW(header_str); + if(!header_wstr) + return NS_ERROR_UNEXPECTED; + + LIST_FOR_EACH_ENTRY(this_header, &This->response_headers, struct ResponseHeader, entry) { + if(!strcmpW(this_header->header, header_wstr)) { + char *data = heap_strdupWtoA(this_header->data); + if(!data) { + heap_free(header_wstr); + return NS_ERROR_UNEXPECTED; + } + nsACString_SetData(_retval, data); + heap_free(data); + heap_free(header_wstr); + return NS_OK; + } + } + + heap_free(header_wstr); + + return NS_ERROR_NOT_AVAILABLE; } static nsresult NSAPI nsChannel_SetResponseHeader(nsIHttpChannel *iface, @@ -2414,7 +2453,6 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * HTMLWindow *window = NULL; nsIURI *uri = NULL; LPCWSTR base_wine_url = NULL; - BOOL is_wine_uri = FALSE; nsresult nsres; nsACString_GetData(aSpec, &spec); @@ -2425,10 +2463,8 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * if(is_gecko_special_uri(spec)) return nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, _retval); - if(!strncmp(spec, "wine:", 5)) { + if(!strncmp(spec, "wine:", 5)) spec += 5; - is_wine_uri = TRUE; - } if(aBaseURI) { PARSEDURLA parsed_url = {sizeof(PARSEDURLA)}; @@ -2473,7 +2509,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString * set_wine_url(wine_uri, url); else WARN("CoCombineUrl failed: %08x\n", hres); - }else if(is_wine_uri) { + }else { WCHAR url[INTERNET_MAX_URL_LENGTH]; MultiByteToWideChar(CP_ACP, 0, spec, -1, url, sizeof(url)/sizeof(WCHAR)); @@ -2516,6 +2552,7 @@ static nsresult NSAPI nsIOService_NewChannelFromURI(nsIIOService *iface, nsIURI ret->lpIHttpChannelInternalVtbl = &nsHttpChannelInternalVtbl; ret->ref = 1; ret->uri = wine_uri; + list_init(&ret->response_headers); nsIURI_AddRef(aURI); ret->original_uri = aURI; diff --git a/dll/win32/mshtml/olecmd.c b/dll/win32/mshtml/olecmd.c index b54f06420fb..4d5967a923f 100644 --- a/dll/win32/mshtml/olecmd.c +++ b/dll/win32/mshtml/olecmd.c @@ -616,9 +616,6 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, IDocHostUIHandler_HideUI(This->doc_obj->hostui); } - if(This->doc_obj->nscontainer) - set_ns_editmode(This->doc_obj->nscontainer); - if(This->doc_obj->ui_active) { RECT rcBorderWidths; diff --git a/dll/win32/mshtml/view.c b/dll/win32/mshtml/view.c index 261e959b0ad..5c096ed9928 100644 --- a/dll/win32/mshtml/view.c +++ b/dll/win32/mshtml/view.c @@ -92,7 +92,6 @@ static void activate_gecko(NSContainer *This) nsIBaseWindow_SetVisibility(This->window, TRUE); nsIBaseWindow_SetEnabled(This->window, TRUE); - nsIWebBrowserFocus_Activate(This->focus); } void update_doc(HTMLDocument *This, DWORD flags) @@ -216,6 +215,10 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case WM_TIMER: return on_timer(This); + case WM_SETFOCUS: + TRACE("(%p) WM_SETFOCUS\n", This); + nsIWebBrowserFocus_Activate(This->nscontainer->focus); + break; case WM_MOUSEACTIVATE: return MA_ACTIVATE; } @@ -664,6 +667,8 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f This->doc_obj->ui_active = TRUE; }else { + This->doc_obj->focus = FALSE; + nsIWebBrowserFocus_Deactivate(This->doc_obj->nscontainer->focus); if(This->doc_obj->ui_active) { This->doc_obj->ui_active = FALSE; if(This->doc_obj->ip_window) @@ -811,7 +816,7 @@ static HRESULT WINAPI ViewObject_SetAdvise(IViewObjectEx *iface, DWORD aspects, TRACE("(%p)->(%d %d %p)\n", This, aspects, advf, pAdvSink); if(aspects != DVASPECT_CONTENT || advf != ADVF_PRIMEFIRST) - FIXME("unsuported arguments\n"); + FIXME("unsupported arguments\n"); if(This->doc_obj->view_sink) IAdviseSink_Release(This->doc_obj->view_sink); diff --git a/dll/win32/msvfw32/mciwnd.c b/dll/win32/msvfw32/mciwnd.c index ff8a0369df0..96b64207825 100644 --- a/dll/win32/msvfw32/mciwnd.c +++ b/dll/win32/msvfw32/mciwnd.c @@ -1298,30 +1298,23 @@ end_of_mci_open: } case MCI_SEEK: + case MCI_STEP: { - MCI_SEEK_PARMS mci_seek; - - switch (lParam) - { - case MCIWND_START: - lParam = SendMessageW(hWnd, MCIWNDM_GETSTART, 0, 0); - break; - - case MCIWND_END: - lParam = SendMessageW(hWnd, MCIWNDM_GETEND, 0, 0); - break; - } + MCI_SEEK_PARMS mci_seek; /* Layout is usable as MCI_XYZ_STEP_PARMS */ + DWORD flags = MCI_STEP == wMsg ? 0 : + MCIWND_START == lParam ? MCI_SEEK_TO_START : + MCIWND_END == lParam ? MCI_SEEK_TO_END : MCI_TO; mci_seek.dwTo = lParam; - mwi->lasterror = mciSendCommandW(mwi->mci, MCI_SEEK, - MCI_TO, (DWORD_PTR)&mci_seek); + mwi->lasterror = mciSendCommandW(mwi->mci, wMsg, + flags, (DWORD_PTR)&mci_seek); if (mwi->lasterror) { MCIWND_notify_error(mwi); return mwi->lasterror; } /* update window to reflect the state */ - InvalidateRect(hWnd, NULL, TRUE); + else InvalidateRect(hWnd, NULL, TRUE); return 0; } @@ -1364,15 +1357,9 @@ end_of_mci_open: } case MCI_PAUSE: - case MCI_STEP: case MCI_STOP: case MCI_RESUME: mci_generic_command(mwi, wMsg); - if (wMsg == MCI_STEP && !mwi->lasterror) - { - /* update window to reflect the state */ - InvalidateRect(hWnd, NULL, TRUE); - } return mwi->lasterror; case MCI_CONFIGURE: diff --git a/dll/win32/msvfw32/msvfw32_ros.diff b/dll/win32/msvfw32/msvfw32_ros.diff deleted file mode 100644 index 331b478ad6d..00000000000 --- a/dll/win32/msvfw32/msvfw32_ros.diff +++ /dev/null @@ -1,14 +0,0 @@ -Index: msvideo_private.h -=================================================================== ---- msvideo_private.h (revision 25690) -+++ msvideo_private.h (working copy) -@@ -19,6 +19,9 @@ - #ifndef __WINE_MSVIDEO_PRIVATE_H - #define __WINE_MSVIDEO_PRIVATE_H - -+/* Installable Compressor Manager */ -+#define ICVERSION 0x0104 -+ - #define ICM_CHOOSE_COMPRESSOR 1 - #define IDC_COMP_LIST 880 - #define IDS_FULLFRAMES 901 diff --git a/dll/win32/msvfw32/msvideo16.c b/dll/win32/msvfw32/msvideo16.c deleted file mode 100644 index c873da57f45..00000000000 --- a/dll/win32/msvfw32/msvideo16.c +++ /dev/null @@ -1,916 +0,0 @@ -/* - * msvideo 16-bit functions - * - * Copyright 1998 Marcus Meissner - * Copyright 2000 Bradley Baetz - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winver.h" -#include "winnls.h" -#include "winreg.h" -#include "winuser.h" -#include "vfw16.h" -#include "msvideo_private.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msvideo); - -/* Drivers32 settings */ -#define HKLM_DRIVERS32 "Software\\Microsoft\\Windows NT\\CurrentVersion\\Drivers32" - -/*********************************************************************** - * DrawDibOpen [MSVIDEO.102] - */ -HDRAWDIB16 VFWAPI DrawDibOpen16(void) -{ - return HDRAWDIB_16(DrawDibOpen()); -} - -/*********************************************************************** - * DrawDibClose [MSVIDEO.103] - */ -BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) -{ - return DrawDibClose(HDRAWDIB_32(hdd)); -} - -/************************************************************************ - * DrawDibBegin [MSVIDEO.104] - */ -BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd, HDC16 hdc, INT16 dxDst, - INT16 dyDst, LPBITMAPINFOHEADER lpbi, INT16 dxSrc, - INT16 dySrc, UINT16 wFlags) -{ - return DrawDibBegin(HDRAWDIB_32(hdd), HDC_32(hdc), dxDst, dyDst, lpbi, - dxSrc, dySrc, wFlags); -} - -/*********************************************************************** - * DrawDibEnd [MSVIDEO.105] - */ -BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) -{ - return DrawDibEnd(HDRAWDIB_32(hdd)); -} - -/********************************************************************** - * DrawDibDraw [MSVIDEO.106] - */ -BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd, HDC16 hdc, INT16 xDst, INT16 yDst, - INT16 dxDst, INT16 dyDst, LPBITMAPINFOHEADER lpbi, - LPVOID lpBits, INT16 xSrc, INT16 ySrc, INT16 dxSrc, - INT16 dySrc, UINT16 wFlags) -{ - return DrawDibDraw(HDRAWDIB_32(hdd), HDC_32(hdc), xDst, yDst, dxDst, - dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags); -} - -/*********************************************************************** - * DrawDibGetPalette [MSVIDEO.108] - */ -HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) -{ - return HPALETTE_16(DrawDibGetPalette(HDRAWDIB_32(hdd))); -} - -/*********************************************************************** - * DrawDibSetPalette [MSVIDEO.110] - */ -BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) -{ - return DrawDibSetPalette(HDRAWDIB_32(hdd), HPALETTE_32(hpal)); -} - -/*********************************************************************** - * DrawDibRealize [MSVIDEO.112] - */ -UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, - BOOL16 fBackground) -{ - return (UINT16)DrawDibRealize(HDRAWDIB_32(hdd), HDC_32(hdc), fBackground); -} - -/************************************************************************* - * DrawDibStart [MSVIDEO.118] - */ -BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) -{ - return DrawDibStart(HDRAWDIB_32(hdd), rate); -} - -/************************************************************************* - * DrawDibStop [MSVIDEO.119] - */ -BOOL16 VFWAPI DrawDibStop16(HDRAWDIB16 hdd) -{ - return DrawDibStop(HDRAWDIB_32(hdd)); -} - -/*********************************************************************** - * ICOpen [MSVIDEO.203] - */ -HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHandler, UINT16 wMode) -{ - return HIC_16(ICOpen(fccType, fccHandler, wMode)); -} - -/*********************************************************************** - * ICClose [MSVIDEO.204] - */ -LRESULT WINAPI ICClose16(HIC16 hic) -{ - return ICClose(HIC_32(hic)); -} - -/*********************************************************************** - * _ICMessage [MSVIDEO.207] - */ -LRESULT VFWAPIV ICMessage16( HIC16 hic, UINT16 msg, UINT16 cb, VA_LIST16 valist ) -{ - LPWORD lpData; - SEGPTR segData; - LRESULT ret; - UINT16 i; - - lpData = HeapAlloc(GetProcessHeap(), 0, cb); - - TRACE("0x%08x, %u, %u, ...)\n", (DWORD) hic, msg, cb); - - for (i = 0; i < cb / sizeof(WORD); i++) - { - lpData[i] = VA_ARG16(valist, WORD); - } - - segData = MapLS(lpData); - ret = ICSendMessage16(hic, msg, segData, (DWORD) cb); - UnMapLS(segData); - HeapFree(GetProcessHeap(), 0, lpData); - return ret; -} - -/*********************************************************************** - * ICGetInfo [MSVIDEO.212] - */ -LRESULT VFWAPI ICGetInfo16(HIC16 hic, ICINFO16 * picinfo, DWORD cb) -{ - LRESULT ret; - - TRACE("(0x%08x,%p,%d)\n", (DWORD) hic, picinfo, cb); - ret = ICSendMessage16(hic, ICM_GETINFO, (DWORD) picinfo, cb); - TRACE(" -> 0x%08lx\n", ret); - return ret; -} - -/*********************************************************************** - * ICLocate [MSVIDEO.213] - */ -HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, - LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, - WORD wFlags) -{ - return HIC_16(ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags)); -} - -/*********************************************************************** - * _ICCompress [MSVIDEO.224] - */ -DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, - LPBITMAPINFOHEADER lpbiOutput, LPVOID lpData, - LPBITMAPINFOHEADER lpbiInput, LPVOID lpBits, - LPDWORD lpckid, LPDWORD lpdwFlags, - LONG lFrameNum, DWORD dwFrameSize, - DWORD dwQuality, LPBITMAPINFOHEADER lpbiPrev, - LPVOID lpPrev) -{ - DWORD ret; - ICCOMPRESS iccmp; - SEGPTR seg_iccmp; - - TRACE("(0x%08x,%d,%p,%p,%p,%p,...)\n", (DWORD) hic, dwFlags, - lpbiOutput, lpData, lpbiInput, lpBits); - - iccmp.dwFlags = dwFlags; - - iccmp.lpbiOutput = lpbiOutput; - iccmp.lpOutput = lpData; - iccmp.lpbiInput = lpbiInput; - iccmp.lpInput = lpBits; - - iccmp.lpckid = lpckid; - iccmp.lpdwFlags = lpdwFlags; - iccmp.lFrameNum = lFrameNum; - iccmp.dwFrameSize = dwFrameSize; - iccmp.dwQuality = dwQuality; - iccmp.lpbiPrev = lpbiPrev; - iccmp.lpPrev = lpPrev; - seg_iccmp = MapLS(&iccmp); - ret = ICSendMessage16(hic, ICM_COMPRESS, seg_iccmp, sizeof(ICCOMPRESS)); - UnMapLS(seg_iccmp); - return ret; -} - -/*********************************************************************** - * _ICDecompress [MSVIDEO.230] - */ -DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, - LPBITMAPINFOHEADER lpbiFormat, LPVOID lpData, - LPBITMAPINFOHEADER lpbi, LPVOID lpBits) -{ - ICDECOMPRESS icd; - SEGPTR segptr; - DWORD ret; - - TRACE("(0x%08x,%d,%p,%p,%p,%p)\n", (DWORD) hic, dwFlags, lpbiFormat, - lpData, lpbi, lpBits); - - icd.dwFlags = dwFlags; - icd.lpbiInput = lpbiFormat; - icd.lpInput = lpData; - icd.lpbiOutput = lpbi; - icd.lpOutput = lpBits; - icd.ckid = 0; - segptr = MapLS(&icd); - ret = ICSendMessage16(hic, ICM_DECOMPRESS, segptr, sizeof(ICDECOMPRESS)); - UnMapLS(segptr); - return ret; -} - -/*********************************************************************** - * _ICDrawBegin [MSVIDEO.232] - */ -DWORD VFWAPIV ICDrawBegin16(HIC16 hic, /* [in] */ - DWORD dwFlags, /* [in] flags */ - HPALETTE16 hpal, /* [in] palette to draw with */ - HWND16 hwnd, /* [in] window to draw to */ - HDC16 hdc, /* [in] HDC to draw to */ - INT16 xDst, /* [in] destination rectangle */ - INT16 yDst, /* [in] */ - INT16 dxDst, /* [in] */ - INT16 dyDst, /* [in] */ - LPBITMAPINFOHEADER lpbi, /* [in] format of frame to draw NOTE: SEGPTR */ - INT16 xSrc, /* [in] source rectangle */ - INT16 ySrc, /* [in] */ - INT16 dxSrc, /* [in] */ - INT16 dySrc, /* [in] */ - DWORD dwRate, /* [in] frames/second = (dwRate/dwScale) */ - DWORD dwScale) /* [in] */ -{ - DWORD ret; - ICDRAWBEGIN16 icdb; - SEGPTR seg_icdb; - - TRACE ("(0x%08x,%d,0x%08x,0x%08x,0x%08x,%u,%u,%u,%u,%p,%u,%u,%u,%u,%d,%d)\n", - (DWORD) hic, dwFlags, (DWORD) hpal, (DWORD) hwnd, (DWORD) hdc, - xDst, yDst, dxDst, dyDst, lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, - dwScale); - - icdb.dwFlags = dwFlags; - icdb.hpal = hpal; - icdb.hwnd = hwnd; - icdb.hdc = hdc; - icdb.xDst = xDst; - icdb.yDst = yDst; - icdb.dxDst = dxDst; - icdb.dyDst = dyDst; - icdb.lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */ - icdb.xSrc = xSrc; - icdb.ySrc = ySrc; - icdb.dxSrc = dxSrc; - icdb.dySrc = dySrc; - icdb.dwRate = dwRate; - icdb.dwScale = dwScale; - seg_icdb = MapLS(&icdb); - ret = (DWORD) ICSendMessage16(hic, ICM_DRAW_BEGIN, seg_icdb, - sizeof(ICDRAWBEGIN16)); - UnMapLS(seg_icdb); - return ret; -} - -/*********************************************************************** - * _ICDraw [MSVIDEO.234] - */ -DWORD VFWAPIV ICDraw16(HIC16 hic, DWORD dwFlags, - LPVOID lpFormat, /* [???] NOTE: SEGPTR */ - LPVOID lpData, /* [???] NOTE: SEGPTR */ - DWORD cbData, LONG lTime) -{ - DWORD ret; - ICDRAW icd; - SEGPTR seg_icd; - - TRACE("(0x%08x,0x%08x,%p,%p,%d,%d)\n", (DWORD) hic, dwFlags, - lpFormat, lpData, cbData, lTime); - icd.dwFlags = dwFlags; - icd.lpFormat = lpFormat; - icd.lpData = lpData; - icd.cbData = cbData; - icd.lTime = lTime; - seg_icd = MapLS(&icd); - ret = ICSendMessage16(hic, ICM_DRAW, seg_icd, sizeof(ICDRAW)); - UnMapLS(seg_icd); - return ret; -} - -/*********************************************************************** - * ICGetDisplayFormat [MSVIDEO.239] - */ -HIC16 VFWAPI ICGetDisplayFormat16(HIC16 hic, LPBITMAPINFOHEADER lpbiIn, - LPBITMAPINFOHEADER lpbiOut, INT16 depth, - INT16 dx, INT16 dy) -{ - return HIC_16(ICGetDisplayFormat(HIC_32(hic), lpbiIn, lpbiOut, depth, - dx, dy)); -} - -#define COPY(x,y) (x->y = x##16->y); -#define COPYPTR(x,y) (x->y = MapSL((SEGPTR)x##16->y)); - -/****************************************************************** - * MSVIDEO_MapICDEX16To32 - * - * - */ -static LPVOID MSVIDEO_MapICDEX16To32(LPDWORD lParam) -{ - LPVOID ret; - - ICDECOMPRESSEX *icdx = HeapAlloc(GetProcessHeap(), 0, sizeof(ICDECOMPRESSEX)); - ICDECOMPRESSEX16 *icdx16 = MapSL(*lParam); - ret = icdx16; - - COPY(icdx, dwFlags); - COPYPTR(icdx, lpbiSrc); - COPYPTR(icdx, lpSrc); - COPYPTR(icdx, lpbiDst); - COPYPTR(icdx, lpDst); - COPY(icdx, xDst); - COPY(icdx, yDst); - COPY(icdx, dxDst); - COPY(icdx, dyDst); - COPY(icdx, xSrc); - COPY(icdx, ySrc); - COPY(icdx, dxSrc); - COPY(icdx, dySrc); - - *lParam = (DWORD)(icdx); - return ret; -} - -/****************************************************************** - * MSVIDEO_MapMsg16To32 - * - * - */ -static LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) -{ - LPVOID ret = 0; - - TRACE("Mapping %d\n", msg); - - switch (msg) - { - case DRV_LOAD: - case DRV_ENABLE: - case DRV_CLOSE: - case DRV_DISABLE: - case DRV_FREE: - case ICM_ABOUT: - case ICM_CONFIGURE: - case ICM_COMPRESS_END: - case ICM_DECOMPRESS_END: - case ICM_DECOMPRESSEX_END: - case ICM_SETQUALITY: - case ICM_DRAW_START_PLAY: - case ICM_DRAW_STOP_PLAY: - case ICM_DRAW_REALIZE: - case ICM_DRAW_RENDERBUFFER: - case ICM_DRAW_END: - break; - case DRV_OPEN: - case ICM_GETDEFAULTQUALITY: - case ICM_GETQUALITY: - case ICM_SETSTATE: - case ICM_DRAW_WINDOW: - case ICM_GETBUFFERSWANTED: - *lParam1 = (DWORD)MapSL(*lParam1); - break; - case ICM_GETINFO: - { - ICINFO *ici = HeapAlloc(GetProcessHeap(), 0, sizeof(ICINFO)); - ICINFO16 *ici16; - - ici16 = MapSL(*lParam1); - ret = ici16; - - ici->dwSize = sizeof(ICINFO); - COPY(ici, fccType); - COPY(ici, fccHandler); - COPY(ici, dwFlags); - COPY(ici, dwVersion); - COPY(ici, dwVersionICM); - MultiByteToWideChar( CP_ACP, 0, ici16->szName, -1, ici->szName, 16 ); - MultiByteToWideChar( CP_ACP, 0, ici16->szDescription, -1, ici->szDescription, 128 ); - MultiByteToWideChar( CP_ACP, 0, ici16->szDriver, -1, ici->szDriver, 128 ); - *lParam1 = (DWORD)(ici); - *lParam2 = sizeof(ICINFO); - } - break; - case ICM_COMPRESS: - { - ICCOMPRESS *icc = HeapAlloc(GetProcessHeap(), 0, sizeof(ICCOMPRESS)); - ICCOMPRESS *icc16; - - icc16 = MapSL(*lParam1); - ret = icc16; - - COPY(icc, dwFlags); - COPYPTR(icc, lpbiOutput); - COPYPTR(icc, lpOutput); - COPYPTR(icc, lpbiInput); - COPYPTR(icc, lpInput); - COPYPTR(icc, lpckid); - COPYPTR(icc, lpdwFlags); - COPY(icc, lFrameNum); - COPY(icc, dwFrameSize); - COPY(icc, dwQuality); - COPYPTR(icc, lpbiPrev); - COPYPTR(icc, lpPrev); - - *lParam1 = (DWORD)(icc); - *lParam2 = sizeof(ICCOMPRESS); - } - break; - case ICM_DECOMPRESS: - { - ICDECOMPRESS *icd = HeapAlloc(GetProcessHeap(), 0, sizeof(ICDECOMPRESS)); - ICDECOMPRESS *icd16; /* Same structure except for the pointers */ - - icd16 = MapSL(*lParam1); - ret = icd16; - - COPY(icd, dwFlags); - COPYPTR(icd, lpbiInput); - COPYPTR(icd, lpInput); - COPYPTR(icd, lpbiOutput); - COPYPTR(icd, lpOutput); - COPY(icd, ckid); - - *lParam1 = (DWORD)(icd); - *lParam2 = sizeof(ICDECOMPRESS); - } - break; - case ICM_COMPRESS_BEGIN: - case ICM_COMPRESS_GET_FORMAT: - case ICM_COMPRESS_GET_SIZE: - case ICM_COMPRESS_QUERY: - case ICM_DECOMPRESS_GET_FORMAT: - case ICM_DECOMPRESS_QUERY: - case ICM_DECOMPRESS_BEGIN: - case ICM_DECOMPRESS_SET_PALETTE: - case ICM_DECOMPRESS_GET_PALETTE: - *lParam1 = (DWORD)MapSL(*lParam1); - *lParam2 = (DWORD)MapSL(*lParam2); - break; - case ICM_DECOMPRESSEX_QUERY: - if ((*lParam2 != sizeof(ICDECOMPRESSEX16)) && (*lParam2 != 0)) - WARN("*lParam2 has unknown value %p\n", (ICDECOMPRESSEX16*)*lParam2); - /* FIXME: *lParm2 is meant to be 0 or an ICDECOMPRESSEX16*, but is sizeof(ICDECOMRPESSEX16) - * This is because of ICMessage(). Special case it? - { - LPVOID* addr = HeapAlloc(GetProcessHeap(), 0, 2*sizeof(LPVOID)); - addr[0] = MSVIDEO_MapICDEX16To32(lParam1); - if (*lParam2) - addr[1] = MSVIDEO_MapICDEX16To32(lParam2); - else - addr[1] = 0; - - ret = addr; - } - break;*/ - case ICM_DECOMPRESSEX_BEGIN: - case ICM_DECOMPRESSEX: - ret = MSVIDEO_MapICDEX16To32(lParam1); - *lParam2 = sizeof(ICDECOMPRESSEX); - break; - case ICM_DRAW_BEGIN: - { - ICDRAWBEGIN *icdb = HeapAlloc(GetProcessHeap(), 0, sizeof(ICDRAWBEGIN)); - ICDRAWBEGIN16 *icdb16 = MapSL(*lParam1); - ret = icdb16; - - COPY(icdb, dwFlags); - icdb->hpal = HPALETTE_32(icdb16->hpal); - icdb->hwnd = HWND_32(icdb16->hwnd); - icdb->hdc = HDC_32(icdb16->hdc); - COPY(icdb, xDst); - COPY(icdb, yDst); - COPY(icdb, dxDst); - COPY(icdb, dyDst); - COPYPTR(icdb, lpbi); - COPY(icdb, xSrc); - COPY(icdb, ySrc); - COPY(icdb, dxSrc); - COPY(icdb, dySrc); - COPY(icdb, dwRate); - COPY(icdb, dwScale); - - *lParam1 = (DWORD)(icdb); - *lParam2 = sizeof(ICDRAWBEGIN); - } - break; - case ICM_DRAW_SUGGESTFORMAT: - { - ICDRAWSUGGEST *icds = HeapAlloc(GetProcessHeap(), 0, sizeof(ICDRAWSUGGEST)); - ICDRAWSUGGEST16 *icds16 = MapSL(*lParam1); - - ret = icds16; - - COPY(icds, dwFlags); - COPYPTR(icds, lpbiIn); - COPYPTR(icds, lpbiSuggest); - COPY(icds, dxSrc); - COPY(icds, dySrc); - COPY(icds, dxDst); - COPY(icds, dyDst); - icds->hicDecompressor = HIC_32(icds16->hicDecompressor); - - *lParam1 = (DWORD)(icds); - *lParam2 = sizeof(ICDRAWSUGGEST); - } - break; - case ICM_DRAW: - { - ICDRAW *icd = HeapAlloc(GetProcessHeap(), 0, sizeof(ICDRAW)); - ICDRAW *icd16 = MapSL(*lParam1); - ret = icd16; - - COPY(icd, dwFlags); - COPYPTR(icd, lpFormat); - COPYPTR(icd, lpData); - COPY(icd, cbData); - COPY(icd, lTime); - - *lParam1 = (DWORD)(icd); - *lParam2 = sizeof(ICDRAW); - } - break; - case ICM_DRAW_START: - case ICM_DRAW_STOP: - break; - default: - FIXME("%d is not yet handled. Expect a crash.\n", msg); - } - return ret; -} - -#undef COPY -#undef COPYPTR - -/****************************************************************** - * MSVIDEO_UnmapMsg16To32 - * - * - */ -static void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID data16, LPDWORD lParam1, LPDWORD lParam2) -{ - TRACE("Unmapping %d\n", msg); - -#define UNCOPY(x, y) (x##16->y = x->y); - - switch (msg) - { - case ICM_GETINFO: - { - ICINFO *ici = (ICINFO*)(*lParam1); - ICINFO16 *ici16 = data16; - - UNCOPY(ici, fccType); - UNCOPY(ici, fccHandler); - UNCOPY(ici, dwFlags); - UNCOPY(ici, dwVersion); - UNCOPY(ici, dwVersionICM); - WideCharToMultiByte( CP_ACP, 0, ici->szName, -1, ici16->szName, - sizeof(ici16->szName), NULL, NULL ); - ici16->szName[sizeof(ici16->szName)-1] = 0; - WideCharToMultiByte( CP_ACP, 0, ici->szDescription, -1, ici16->szDescription, - sizeof(ici16->szDescription), NULL, NULL ); - ici16->szDescription[sizeof(ici16->szDescription)-1] = 0; - /* This just gives garbage for some reason - BB - lstrcpynWtoA(ici16->szDriver, ici->szDriver, 128);*/ - - HeapFree(GetProcessHeap(), 0, ici); - } - break; - case ICM_DECOMPRESS_QUERY: - /*{ - LPVOID* x = data16; - HeapFree(GetProcessHeap(), 0, x[0]); - if (x[1]) - HeapFree(GetProcessHeap(), 0, x[1]); - } - break;*/ - case ICM_COMPRESS: - case ICM_DECOMPRESS: - case ICM_DECOMPRESSEX_QUERY: - case ICM_DECOMPRESSEX_BEGIN: - case ICM_DECOMPRESSEX: - case ICM_DRAW_BEGIN: - case ICM_DRAW_SUGGESTFORMAT: - case ICM_DRAW: - HeapFree(GetProcessHeap(), 0, data16); - break; - default: - ERR("Unmapping unmapped msg %d\n", msg); - } -#undef UNCOPY -} - -/*********************************************************************** - * ICInfo [MSVIDEO.200] - */ -BOOL16 VFWAPI ICInfo16(DWORD fccType, DWORD fccHandler, ICINFO16 *lpicinfo) -{ - BOOL16 ret; - LPVOID lpv; - DWORD lParam = (DWORD)lpicinfo; - DWORD size = ((ICINFO*)(MapSL((SEGPTR)lpicinfo)))->dwSize; - - /* Use the mapping functions to map the ICINFO structure */ - lpv = MSVIDEO_MapMsg16To32(ICM_GETINFO, &lParam, &size); - - ret = ICInfo(fccType, fccHandler, (ICINFO*)lParam); - - MSVIDEO_UnmapMsg16To32(ICM_GETINFO, lpv, &lParam, &size); - - return ret; -} - -/****************************************************************** - * IC_Callback3216 - * - * - */ -static LRESULT CALLBACK IC_Callback3216(HIC hic, HDRVR hdrv, UINT msg, DWORD lp1, DWORD lp2) -{ - WINE_HIC* whic; - WORD args[8]; - - whic = MSVIDEO_GetHicPtr(hic); - if (whic) - { - DWORD ret = 0; - switch (msg) - { - case DRV_OPEN: - lp2 = (DWORD)MapLS((void*)lp2); - break; - } - args[7] = HIWORD(hic); - args[6] = LOWORD(hic); - args[5] = HDRVR_16(whic->hdrv); - args[4] = msg; - args[3] = HIWORD(lp1); - args[2] = LOWORD(lp1); - args[1] = HIWORD(lp2); - args[0] = LOWORD(lp2); - WOWCallback16Ex( whic->driverproc16, WCB16_PASCAL, sizeof(args), args, &ret ); - - switch (msg) - { - case DRV_OPEN: - UnMapLS(lp2); - break; - } - return ret; - } - else return ICERR_BADHANDLE; -} - -/*********************************************************************** - * ICOpenFunction [MSVIDEO.206] - */ -HIC16 VFWAPI ICOpenFunction16(DWORD fccType, DWORD fccHandler, UINT16 wMode, FARPROC16 lpfnHandler) -{ - HIC hic32; - - hic32 = MSVIDEO_OpenFunction(fccType, fccHandler, wMode, - (DRIVERPROC)IC_Callback3216, (DWORD)lpfnHandler); - return HIC_16(hic32); -} - -/*********************************************************************** - * ICSendMessage [MSVIDEO.205] - */ -LRESULT VFWAPI ICSendMessage16(HIC16 hic, UINT16 msg, DWORD lParam1, DWORD lParam2) -{ - LRESULT ret = ICERR_BADHANDLE; - WINE_HIC* whic; - - whic = MSVIDEO_GetHicPtr(HIC_32(hic)); - if (whic) - { - /* we've got a 16 bit driver proc... call it directly */ - if (whic->driverproc16) - { - WORD args[8]; - DWORD result; - - /* FIXME: original code was passing hdrv first and hic second */ - /* but this doesn't match what IC_Callback3216 does */ - args[7] = HIWORD(hic); - args[6] = LOWORD(hic); - args[5] = HDRVR_16(whic->hdrv); - args[4] = msg; - args[3] = HIWORD(lParam1); - args[2] = LOWORD(lParam1); - args[1] = HIWORD(lParam2); - args[0] = LOWORD(lParam2); - WOWCallback16Ex( whic->driverproc16, WCB16_PASCAL, sizeof(args), args, &result ); - ret = result; - } - else - { - /* map the message for a 32 bit infrastructure, and pass it along */ - void* data16 = MSVIDEO_MapMsg16To32(msg, &lParam1, &lParam2); - - ret = MSVIDEO_SendMessage(whic, msg, lParam1, lParam2); - if (data16) - MSVIDEO_UnmapMsg16To32(msg, data16, &lParam1, &lParam2); - } - } - return ret; -} - -/*********************************************************************** - * VideoCapDriverDescAndVer [MSVIDEO.22] - */ -DWORD WINAPI VideoCapDriverDescAndVer16(WORD nr, LPSTR buf1, WORD buf1len, - LPSTR buf2, WORD buf2len) -{ - static const char version_info_spec[] = "\\StringFileInfo\\040904E4\\FileDescription"; - DWORD verhandle; - DWORD infosize; - UINT subblocklen; - char *s, buf[2048], fn[260]; - LPBYTE infobuf; - LPVOID subblock; - DWORD i, cnt = 0, lRet; - DWORD bufLen, fnLen; - FILETIME lastWrite; - HKEY hKey; - BOOL found = FALSE; - - TRACE("(%d,%p,%d,%p,%d)\n", nr, buf1, buf1len, buf2, buf2len); - lRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE, HKLM_DRIVERS32, 0, KEY_QUERY_VALUE, &hKey); - if (lRet == ERROR_SUCCESS) - { - RegQueryInfoKeyA( hKey, 0, 0, 0, &cnt, 0, 0, 0, 0, 0, 0, 0); - for (i = 0; i < cnt; i++) - { - bufLen = sizeof(buf) / sizeof(buf[0]); - lRet = RegEnumKeyExA(hKey, i, buf, &bufLen, 0, 0, 0, &lastWrite); - if (lRet != ERROR_SUCCESS) continue; - if (strncasecmp(buf, "vid", 3)) continue; - if (nr--) continue; - fnLen = sizeof(fn); - lRet = RegQueryValueExA(hKey, buf, 0, 0, (LPBYTE)fn, &fnLen); - if (lRet == ERROR_SUCCESS) found = TRUE; - break; - } - RegCloseKey( hKey ); - } - - /* search system.ini if not found in the registry */ - if (!found && GetPrivateProfileStringA("drivers32", NULL, NULL, buf, sizeof(buf), "system.ini")) - { - for (s = buf; *s; s += strlen(s) + 1) - { - if (strncasecmp(s, "vid", 3)) continue; - if (nr--) continue; - if (GetPrivateProfileStringA("drivers32", s, NULL, fn, sizeof(fn), "system.ini")) - found = TRUE; - break; - } - } - - if (!found) - { - TRACE("No more VID* entries found nr=%d\n", nr); - return 20; - } - infosize = GetFileVersionInfoSizeA(fn, &verhandle); - if (!infosize) - { - TRACE("%s has no fileversioninfo.\n", fn); - return 18; - } - infobuf = HeapAlloc(GetProcessHeap(), 0, infosize); - if (GetFileVersionInfoA(fn, verhandle, infosize, infobuf)) - { - /* Yes, two space behind : */ - /* FIXME: test for buflen */ - snprintf(buf2, buf2len, "Version: %d.%d.%d.%d\n", - ((WORD*)infobuf)[0x0f], - ((WORD*)infobuf)[0x0e], - ((WORD*)infobuf)[0x11], - ((WORD*)infobuf)[0x10] - ); - TRACE("version of %s is %s\n", fn, buf2); - } - else - { - TRACE("GetFileVersionInfoA failed for %s.\n", fn); - lstrcpynA(buf2, fn, buf2len); /* msvideo.dll appears to copy fn*/ - } - /* FIXME: language problem? */ - if (VerQueryValueA( infobuf, - version_info_spec, - &subblock, - &subblocklen - )) - { - UINT copylen = min(subblocklen,buf1len-1); - memcpy(buf1, subblock, copylen); - buf1[copylen] = '\0'; - TRACE("VQA returned %s\n", (LPCSTR)subblock); - } - else - { - TRACE("VQA did not return on query \\StringFileInfo\\040904E4\\FileDescription?\n"); - lstrcpynA(buf1, fn, buf1len); /* msvideo.dll appears to copy fn*/ - } - HeapFree(GetProcessHeap(), 0, infobuf); - return 0; -} - -/****************************************************************** - * IC_CallTo16 - * - * - */ -static LRESULT CALLBACK IC_CallTo16(HDRVR hdrv, HIC hic, UINT msg, LPARAM lp1, LPARAM lp2) -{ -#if 0 - WINE_HIC* whic = IC_GetPtr(hic); - LRESULT ret = 0; - - - if (whic->driverproc) - { - ret = whic->driverproc(hic, whic->hdrv, msg, lParam1, lParam2); - } - else - { - ret = SendDriverMessage(whic->hdrv, msg, lParam1, lParam2); - } -#else - FIXME("No 32=>16 conversion yet\n"); -#endif - return 0; -} - -/************************************************************************** - * DllEntryPoint (MSVIDEO.3) - * - * MSVIDEO DLL entry point - * - */ -BOOL WINAPI VIDEO_LibMain(DWORD fdwReason, HINSTANCE hinstDLL, WORD ds, - WORD wHeapSize, DWORD dwReserved1, WORD wReserved2) -{ - switch (fdwReason) - { - case DLL_PROCESS_ATTACH: - /* hook in our 16 bit management functions */ - pFnCallTo16 = IC_CallTo16; - break; - case DLL_PROCESS_DETACH: - /* remove our 16 bit management functions */ - pFnCallTo16 = NULL; - break; - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - break; - } - return TRUE; -} diff --git a/dll/win32/msvfw32/vfw16.h b/dll/win32/msvfw32/vfw16.h deleted file mode 100644 index 5cf97915dbc..00000000000 --- a/dll/win32/msvfw32/vfw16.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 1999 Marcus Meissner - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_VFW16_H -#define __WINE_VFW16_H - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "vfw.h" -#include "wownt32.h" -#include "wine/windef16.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -typedef HANDLE16 HDRAWDIB16; - -#include "pshpack1.h" - -typedef struct { - DWORD dwSize; - DWORD fccType; - DWORD fccHandler; - DWORD dwFlags; - DWORD dwVersion; - DWORD dwVersionICM; - /* - * under Win16, normal chars are used - */ - CHAR szName[16]; - CHAR szDescription[128]; - CHAR szDriver[128]; -} ICINFO16; - -typedef struct { - DWORD dwFlags; - LPBITMAPINFOHEADER lpbiSrc; - LPVOID lpSrc; - LPBITMAPINFOHEADER lpbiDst; - LPVOID lpDst; - - INT16 xDst; /* destination rectangle */ - INT16 yDst; - INT16 dxDst; - INT16 dyDst; - - INT16 xSrc; /* source rectangle */ - INT16 ySrc; - INT16 dxSrc; - INT16 dySrc; -} ICDECOMPRESSEX16; - -typedef struct { - DWORD dwFlags; - HPALETTE16 hpal; - HWND16 hwnd; - HDC16 hdc; - INT16 xDst; - INT16 yDst; - INT16 dxDst; - INT16 dyDst; - LPBITMAPINFOHEADER lpbi; - INT16 xSrc; - INT16 ySrc; - INT16 dxSrc; - INT16 dySrc; - DWORD dwRate; - DWORD dwScale; -} ICDRAWBEGIN16; - -#include "poppack.h" - -typedef struct { - DWORD dwFlags; - LPBITMAPINFOHEADER lpbiIn; - LPBITMAPINFOHEADER lpbiSuggest; - INT16 dxSrc; - INT16 dySrc; - INT16 dxDst; - INT16 dyDst; - HIC16 hicDecompressor; -} ICDRAWSUGGEST16; - -DWORD VFWAPIV ICDraw16(HIC16,DWORD,LPVOID,LPVOID,DWORD,LONG); -DWORD VFWAPIV ICDrawBegin16(HIC16,DWORD,HPALETTE16,HWND16,HDC16,INT16, - INT16,INT16,INT16,LPBITMAPINFOHEADER, - INT16,INT16,INT16,INT16,DWORD,DWORD); -LRESULT WINAPI ICClose16(HIC16); -DWORD VFWAPIV ICCompress16(HIC16,DWORD,LPBITMAPINFOHEADER,LPVOID, - LPBITMAPINFOHEADER,LPVOID,LPDWORD, - LPDWORD,LONG,DWORD,DWORD, - LPBITMAPINFOHEADER,LPVOID); -DWORD VFWAPIV ICDecompress16(HIC16,DWORD,LPBITMAPINFOHEADER,LPVOID, - LPBITMAPINFOHEADER,LPVOID); -HIC16 VFWAPI ICGetDisplayFormat16(HIC16,LPBITMAPINFOHEADER, - LPBITMAPINFOHEADER,INT16,INT16, - INT16); -LRESULT VFWAPI ICGetInfo16(HIC16,ICINFO16 *,DWORD); -BOOL16 VFWAPI ICInfo16(DWORD,DWORD,ICINFO16 *); -HIC16 VFWAPI ICLocate16(DWORD,DWORD,LPBITMAPINFOHEADER, - LPBITMAPINFOHEADER,WORD); -LRESULT VFWAPIV ICMessage16( HIC16 hic, UINT16 msg, UINT16 cb, VA_LIST16 valist ); -HIC16 VFWAPI ICOpen16(DWORD,DWORD,UINT16); -HIC16 VFWAPI ICOpenFunction16(DWORD,DWORD,UINT16,FARPROC16); -LRESULT VFWAPI ICSendMessage16(HIC16,UINT16,DWORD,DWORD); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __WINE_VFW16_H */ diff --git a/dll/win32/msvidc32/msvideo1.c b/dll/win32/msvidc32/msvideo1.c index 19784eb888e..68a52c651dd 100644 --- a/dll/win32/msvidc32/msvideo1.c +++ b/dll/win32/msvidc32/msvideo1.c @@ -95,10 +95,18 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s blocks_high = height / 4; total_blocks = blocks_wide * blocks_high; block_inc = 4; +#ifdef ORIGINAL row_dec = stride + 4; +#else + row_dec = - (stride - 4); /* such that -row_dec > 0 */ +#endif for (block_y = blocks_high; block_y > 0; block_y--) { +#ifdef ORIGINAL block_ptr = ((block_y * 4) - 1) * stride; +#else + block_ptr = ((blocks_high - block_y) * 4) * stride; +#endif for (block_x = blocks_wide; block_x > 0; block_x--) { /* check if this block should be skipped */ if (skip_blocks) { @@ -131,16 +139,7 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) - { -#ifdef ORIGINAL pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1]; -#else - pixels[width*(height-(pixel_ptr/width)-1) + - pixel_ptr%width] = - colors[(flags & 0x1) ^ 1]; - pixel_ptr++; -#endif - } pixel_ptr -= row_dec; } } else if (byte_b >= 0x90) { @@ -153,19 +152,9 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) - { -#ifdef ORIGINAL - pixels[pixel_ptr++] = - colors[((pixel_y & 0x2) << 1) + + pixels[pixel_ptr++] = + colors[((pixel_y & 0x2) << 1) + (pixel_x & 0x2) + ((flags & 0x1) ^ 1)]; -#else - pixels[width*(height-(pixel_ptr/width)-1) + - pixel_ptr%width] = - colors[((pixel_y & 0x2) << 1) + - (pixel_x & 0x2) + ((flags & 0x1) ^ 1)]; - pixel_ptr++; -#endif - } pixel_ptr -= row_dec; } } else { @@ -174,15 +163,7 @@ msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_s for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++) - { -#ifdef ORIGINAL pixels[pixel_ptr++] = colors[0]; -#else - pixels[width*(height-(pixel_ptr/width)-1) + - pixel_ptr%width] = colors[0]; - pixel_ptr++; -#endif - } pixel_ptr -= row_dec; } } @@ -218,10 +199,18 @@ msvideo1_decode_16bit( int width, int height, const unsigned char *buf, int buf_ blocks_high = height / 4; total_blocks = blocks_wide * blocks_high; block_inc = 4; +#ifdef ORIGINAL row_dec = stride + 4; +#else + row_dec = - (stride - 4); /* such that -row_dec > 0 */ +#endif for (block_y = blocks_high; block_y > 0; block_y--) { +#ifdef ORIGINAL block_ptr = ((block_y * 4) - 1) * stride; +#else + block_ptr = ((blocks_high - block_y) * 4) * stride; +#endif for (block_x = blocks_wide; block_x > 0; block_x--) { /* check if this block should be skipped */ if (skip_blocks) { @@ -272,8 +261,8 @@ msvideo1_decode_16bit( int width, int height, const unsigned char *buf, int buf_ for (pixel_y = 0; pixel_y < 4; pixel_y++) { for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1) - pixels[pixel_ptr++] = - colors[((pixel_y & 0x2) << 1) + + pixels[pixel_ptr++] = + colors[((pixel_y & 0x2) << 1) + (pixel_x & 0x2) + ((flags & 0x1) ^ 1)]; pixel_ptr -= row_dec; } @@ -408,7 +397,7 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD width = icd->lpbiInput->biWidth; height = icd->lpbiInput->biHeight; bit_per_pixel = icd->lpbiInput->biBitCount; - stride = width*bit_per_pixel/8; + stride = width; /* in bytes or 16bit words */ sz = icd->lpbiInput->biSizeImage; if (info->mode_8bit) @@ -440,7 +429,7 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW width = icd->lpbiSrc->biWidth; height = icd->lpbiSrc->biHeight; bit_per_pixel = icd->lpbiSrc->biBitCount; - stride = width*bit_per_pixel/8; + stride = width; sz = icd->lpbiSrc->biSizeImage; if (info->mode_8bit) @@ -562,6 +551,10 @@ LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, (DWORD) lParam2 ); break; + case ICM_DECOMPRESS_END: + r = ICERR_OK; + break; + case ICM_COMPRESS_QUERY: FIXME("compression not implemented\n"); r = ICERR_BADFORMAT; diff --git a/dll/win32/msxml3/dispex.c b/dll/win32/msxml3/dispex.c index 529f9a452ee..09b71fed39d 100644 --- a/dll/win32/msxml3/dispex.c +++ b/dll/win32/msxml3/dispex.c @@ -196,12 +196,12 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, DISPID id static int dispid_cmp(const void *p1, const void *p2) { - return ((func_info_t*)p1)->id - ((func_info_t*)p2)->id; + return ((const func_info_t*)p1)->id - ((const func_info_t*)p2)->id; } static int func_name_cmp(const void *p1, const void *p2) { - return strcmpiW((*(func_info_t**)p1)->name, (*(func_info_t**)p2)->name); + return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); } static dispex_data_t *preprocess_dispex_data(DispatchEx *This) diff --git a/dll/win32/msxml3/element.c b/dll/win32/msxml3/element.c index b6caf73df15..617c008e288 100644 --- a/dll/win32/msxml3/element.c +++ b/dll/win32/msxml3/element.c @@ -594,7 +594,7 @@ static HRESULT WINAPI domelem_removeAttribute( IXMLDOMNamedNodeMap *attr; HRESULT hr; - TRACE("(%p)->(%s)", This, debugstr_w(p)); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); hr = IXMLDOMElement_get_attributes(iface, &attr); if (hr != S_OK) return hr; diff --git a/dll/win32/msxml3/main.c b/dll/win32/msxml3/main.c index 9b1eb823fbe..60b0cbd7b53 100644 --- a/dll/win32/msxml3/main.c +++ b/dll/win32/msxml3/main.c @@ -62,7 +62,7 @@ static int wineXmlMatchCallback (char const * filename) static void *wineXmlOpenCallback (char const * filename) { - BSTR sFilename = bstr_from_xmlChar( (xmlChar*)filename); + BSTR sFilename = bstr_from_xmlChar( (const xmlChar*)filename); HANDLE hFile; TRACE("%s\n", debugstr_w(sFilename)); diff --git a/dll/win32/msxml3/node.c b/dll/win32/msxml3/node.c index ac97681aac9..e263a2a143d 100644 --- a/dll/win32/msxml3/node.c +++ b/dll/win32/msxml3/node.c @@ -934,8 +934,9 @@ static HRESULT WINAPI xmlnode_get_specified( VARIANT_BOOL* isSpecified) { xmlnode *This = impl_from_IXMLDOMNode( iface ); - FIXME("(%p)->(%p)\n", This, isSpecified); - return E_NOTIMPL; + FIXME("(%p)->(%p) stub!\n", This, isSpecified); + *isSpecified = VARIANT_TRUE; + return S_OK; } static HRESULT WINAPI xmlnode_get_definition( @@ -1190,8 +1191,8 @@ static HRESULT WINAPI xmlnode_get_dataType( switch ( This->node->type ) { case XML_ELEMENT_NODE: - pVal = xmlGetNsProp(This->node, (xmlChar*)"dt", - (xmlChar*)"urn:schemas-microsoft-com:datatypes"); + pVal = xmlGetNsProp(This->node, (const xmlChar*)"dt", + (const xmlChar*)"urn:schemas-microsoft-com:datatypes"); if (pVal) { V_VT(dataTypeName) = VT_BSTR; @@ -1260,20 +1261,20 @@ static HRESULT WINAPI xmlnode_put_dataType( xmlAttrPtr pAttr = NULL; xmlChar* str = xmlChar_from_wchar(dataTypeName); - pAttr = xmlHasNsProp(This->node, (xmlChar*)"dt", - (xmlChar*)"urn:schemas-microsoft-com:datatypes"); + pAttr = xmlHasNsProp(This->node, (const xmlChar*)"dt", + (const xmlChar*)"urn:schemas-microsoft-com:datatypes"); if (pAttr) { - pAttr = xmlSetNsProp(This->node, pAttr->ns, (xmlChar*)"dt", str); + pAttr = xmlSetNsProp(This->node, pAttr->ns, (const xmlChar*)"dt", str); hr = S_OK; } else { - pNS = xmlNewNs(This->node, (xmlChar*)"urn:schemas-microsoft-com:datatypes", (xmlChar*)"dt"); + pNS = xmlNewNs(This->node, (const xmlChar*)"urn:schemas-microsoft-com:datatypes", (const xmlChar*)"dt"); if(pNS) { - pAttr = xmlNewNsProp(This->node, pNS, (xmlChar*)"dt", str); + pAttr = xmlNewNsProp(This->node, pNS, (const xmlChar*)"dt", str); if(pAttr) { xmlAddChild(This->node, (xmlNodePtr)pAttr); @@ -1294,8 +1295,6 @@ static HRESULT WINAPI xmlnode_put_dataType( static BSTR EnsureCorrectEOL(BSTR sInput) { - static const WCHAR SZ_RETURN[] = {'\n',0}; - static const WCHAR SZ_LINEFEED[] = {'\r',0}; int nNum = 0; BSTR sNew; int nLen; @@ -1305,7 +1304,7 @@ static BSTR EnsureCorrectEOL(BSTR sInput) /* Count line endings */ for(i=0; i < nLen; i++) { - if(sInput[i] == SZ_RETURN[0]) + if(sInput[i] == '\n') nNum++; } @@ -1318,9 +1317,9 @@ static BSTR EnsureCorrectEOL(BSTR sInput) sNew = SysAllocStringLen(NULL, nLen + nNum+1); for(i=0; i < nLen; i++) { - if(sInput[i] == SZ_RETURN[0]) + if(sInput[i] == '\n') { - sNew[i+nPlace] = SZ_LINEFEED[0]; + sNew[i+nPlace] = '\r'; nPlace++; } sNew[i+nPlace] = sInput[i]; @@ -1371,7 +1370,7 @@ static BSTR EnsureNoEncoding(BSTR sInput) /* * We are trying to replicate the same behaviour as msxml by converting - * line endings to \r\n and using idents as \t. The problem is that msxml + * line endings to \r\n and using indents as \t. The problem is that msxml * only formats nodes that have a line ending. Using libxml we cannot * reproduce behaviour exactly. * @@ -1402,7 +1401,7 @@ static HRESULT WINAPI xmlnode_get_xml( /* Attribute Nodes return a space in front of their name */ pContent = xmlBufferContent(pXmlBuf); - if( ((char*)pContent)[0] == ' ') + if( ((const char*)pContent)[0] == ' ') bstrContent = bstr_from_xmlChar(pContent+1); else bstrContent = bstr_from_xmlChar(pContent); @@ -1550,8 +1549,9 @@ static HRESULT WINAPI xmlnode_get_parsed( VARIANT_BOOL* isParsed) { xmlnode *This = impl_from_IXMLDOMNode( iface ); - FIXME("(%p)->(%p)\n", This, isParsed); - return E_NOTIMPL; + FIXME("(%p)->(%p) stub!\n", This, isParsed); + *isParsed = VARIANT_TRUE; + return S_OK; } static HRESULT WINAPI xmlnode_get_namespaceURI( diff --git a/dll/win32/netcfgx/netcfgx.c b/dll/win32/netcfgx/netcfgx.c index c9d8a4520d8..ba89dff123a 100644 --- a/dll/win32/netcfgx/netcfgx.c +++ b/dll/win32/netcfgx/netcfgx.c @@ -325,7 +325,6 @@ InstallNetDevice( HKEY hLinkageKey = NULL; HKEY hConnectionKey = NULL; DWORD dwShowIcon, dwLength; - SP_DEVINSTALL_PARAMS_W installParams; /* Get Instance ID */ if (SetupDiGetDeviceInstanceIdW(DeviceInfoSet, DeviceInfoData, NULL, 0, &dwLength)) @@ -550,31 +549,6 @@ InstallNetDevice( goto cleanup; } - /* HACK: hpoussin, Dec 2005. TCP/IP driver is not able to manage devices - * which are installed after its startup. So, we have to reboot to take - * this new netcard into account. - */ - /* Should we reboot? */ - installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W); - if (!SetupDiGetDeviceInstallParamsW( - DeviceInfoSet, - DeviceInfoData, - &installParams)) - { - rc = GetLastError(); - DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc); - goto cleanup; - } - installParams.Flags |= DI_NEEDRESTART; - if (!SetupDiSetDeviceInstallParamsW( - DeviceInfoSet, - DeviceInfoData, - &installParams)) - { - rc = GetLastError(); - DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc); - goto cleanup; - } rc = ERROR_SUCCESS; cleanup: diff --git a/dll/win32/netcfgx/netcfgx.rbuild b/dll/win32/netcfgx/netcfgx.rbuild index f846715255d..1ff2adb7838 100644 --- a/dll/win32/netcfgx/netcfgx.rbuild +++ b/dll/win32/netcfgx/netcfgx.rbuild @@ -1,6 +1,7 @@ + 0x0600 ntdll rpcrt4 setupapi diff --git a/dll/win32/netcfgx/tcpipconf_notify.c b/dll/win32/netcfgx/tcpipconf_notify.c index 91c57ec1a2e..14b9a4ab2f4 100644 --- a/dll/win32/netcfgx/tcpipconf_notify.c +++ b/dll/win32/netcfgx/tcpipconf_notify.c @@ -1762,6 +1762,7 @@ StoreDNSSettings( pLast = pCur; pCur = pCur->Next; } + This->pCurrentConfig->AutoconfigActive = FALSE; } INT_PTR @@ -2046,7 +2047,6 @@ TcpipAdvancedDnsDlg( VOID LaunchAdvancedTcpipSettings( - HWND hDlg, HWND hwndDlg, TcpipConfNotifyImpl * This) { @@ -2069,14 +2069,14 @@ LaunchAdvancedTcpipSettings( pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW; pinfo.u3.phpage = hppages; pinfo.nPages = 3; - pinfo.hwndParent = hDlg; + pinfo.hwndParent = hwndDlg; pinfo.pszCaption = szBuffer; StoreTcpipBasicSettings(hwndDlg, This, FALSE); PropertySheetW(&pinfo); InitializeTcpipBasicDlgCtrls(hwndDlg, This->pCurrentConfig); - PropSheet_Changed(hDlg, hwndDlg); + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); } INT_PTR @@ -2328,6 +2328,8 @@ InitializeTcpipBasicDlgCtrls( else { SendDlgItemMessageW(hwndDlg, IDC_FIXEDDNS, BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), TRUE); if (pCurSettings->Ns) { SendDlgItemMessageW(hwndDlg, IDC_DNS1, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ns->IpAddress); @@ -2521,7 +2523,7 @@ TcpipBasicDlg( } break; case IDC_ADVANCED: - LaunchAdvancedTcpipSettings(GetParent(hwndDlg), hwndDlg, (TcpipConfNotifyImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER)); + LaunchAdvancedTcpipSettings(hwndDlg, (TcpipConfNotifyImpl*)GetWindowLongPtr(hwndDlg, DWLP_USER)); break; } break; @@ -3278,23 +3280,25 @@ INetCfgComponentControl_fnApplyRegistryChanges( RegSetValueExW(hKey, L"DefaultGateway", 0, REG_MULTI_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR)); RegSetValueExW(hKey, L"DefaultGatewayMetric", 0, REG_MULTI_SZ, (LPBYTE)L"\0", sizeof(WCHAR) * 2); } - - if (!pCurrentConfig->Ns || pCurrentConfig->AutoconfigActive) - { - RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR)); - } - else - { - pStr = CreateMultiSzString(pCurrentConfig->Ns, IPADDR, &dwSize, TRUE); - if(pStr) - { - RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)pStr, dwSize); - RegDeleteValueW(hKey, L"DhcpNameServer"); - CoTaskMemFree(pStr); - } - } - RegCloseKey(hKey); } + + if (!pCurrentConfig->Ns || pCurrentConfig->AutoconfigActive) + { + RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR)); + } + else + { + pStr = CreateMultiSzString(pCurrentConfig->Ns, IPADDR, &dwSize, TRUE); + if(pStr) + { + + RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)pStr, dwSize); + RegDeleteValueW(hKey, L"DhcpNameServer"); + CoTaskMemFree(pStr); + } + } + + RegCloseKey(hKey); } return S_OK; } diff --git a/dll/win32/netshell/lang/bg-BG.rc b/dll/win32/netshell/lang/bg-BG.rc index a42b9b510fc..c47a1813b80 100644 --- a/dll/win32/netshell/lang/bg-BG.rc +++ b/dll/win32/netshell/lang/bg-BG.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "ム:", -1, 19, 48, 60, 8 GROUPBOX "ト裨", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "マ瑣褊", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 18, 20 + ICON "", IDC_NETSTAT, 110, 85, 18, 20 LTEXT "マ褊", -1, 149, 90, 37, 8 LTEXT "チ琺:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/cs-CZ.rc b/dll/win32/netshell/lang/cs-CZ.rc index b98ecf7c9b8..c0818ab9754 100644 --- a/dll/win32/netshell/lang/cs-CZ.rc +++ b/dll/win32/netshell/lang/cs-CZ.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Rychlost:", -1, 19, 48, 60, 8 GROUPBOX "Aktivita", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Odesl疣o", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Pijato", -1, 149, 90, 37, 8 LTEXT "Byt:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/da-DK.rc b/dll/win32/netshell/lang/da-DK.rc index 682914a6d5a..d23e9c59471 100644 --- a/dll/win32/netshell/lang/da-DK.rc +++ b/dll/win32/netshell/lang/da-DK.rc @@ -36,7 +36,7 @@ BEGIN LTEXT "Hastighed:", -1, 19, 48, 60, 8 GROUPBOX "Netv誡ks Aktivitet", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Sendt", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT " Modtaget", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 73, 115, 44, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/de-DE.rc b/dll/win32/netshell/lang/de-DE.rc index 3192b29f977..de2c06bb65b 100644 --- a/dll/win32/netshell/lang/de-DE.rc +++ b/dll/win32/netshell/lang/de-DE.rc @@ -16,7 +16,7 @@ BEGIN GROUPBOX "Beschreibung", -1, 9, 153, 230, 46, BS_GROUPBOX LTEXT "Hier wird die Beschreibung des Elementes stehen....", IDC_DESCRIPTION, 15, 165, 217, 28, WS_GROUP CHECKBOX "&Symbol bei Verbindung im Infobereich anzeigen", IDC_SHOWTASKBAR, 9, 206, 230, 12, BS_AUTOCHECKBOX | WS_TABSTOP - CHECKBOX "&Benachrichtigen, wenn diese Verbindung eingeschr舅kte oder\nkeine Konnektivit舩 besitzt", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 24, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Benachrichtigen, wenn diese Verbindung eingeschr舅kte oder keine Konnektivit舩 besitzt", IDC_NOTIFYNOCONNECTION, 9, 220, 230, 24, BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP END IDD_STATUS DIALOGEX DISCARDABLE 0, 0, 200, 280 @@ -54,16 +54,16 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Netzwerkuntersttzung" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Verbindungsstatus", -1, 9, 8, 200, 88, BS_GROUPBOX + GROUPBOX "Verbindungsstatus", -1, 9, 8, 182, 88, BS_GROUPBOX LTEXT "Adresstyp:", -1, 22, 20, 80, 8 LTEXT "IP-Adresse:", -1, 22, 34, 80, 8 LTEXT "Subnetzmaske:", -1, 22, 48, 80, 8 LTEXT "Standardgateway:", -1, 22, 62, 80, 8 - RTEXT "Nicht verfgbar", IDC_DETAILSTYPE, 122, 20, 80, 8 - RTEXT "000.000.000.000", IDC_DETAILSIP, 122, 34, 80, 8 - RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 122, 48, 80, 8 - RTEXT "", IDC_DETAILSGATEWAY, 122, 62, 80, 8 + RTEXT "Nicht verfgbar", IDC_DETAILSTYPE, 100, 20, 80, 8 + RTEXT "000.000.000.000", IDC_DETAILSIP, 100, 34, 80, 8 + RTEXT "000.000.000.000", IDC_DETAILSSUBNET, 100, 48, 80, 8 + RTEXT "", IDC_DETAILSGATEWAY, 100, 62, 80, 8 PUSHBUTTON "&Details...", IDC_DETAILS, 22, 76, 62, 14 END diff --git a/dll/win32/netshell/lang/el-GR.rc b/dll/win32/netshell/lang/el-GR.rc index 9df47c3fc46..c0eacd68648 100644 --- a/dll/win32/netshell/lang/el-GR.rc +++ b/dll/win32/netshell/lang/el-GR.rc @@ -36,7 +36,7 @@ BEGIN LTEXT "ヤ磔鉚:", -1, 19, 48, 60, 8 GROUPBOX "ナ褥肅鳰鉚", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "チ褫ワ銛硼", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "ナ゙韈硼", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/en-US.rc b/dll/win32/netshell/lang/en-US.rc index 350e73cd20f..a9d17bca423 100644 --- a/dll/win32/netshell/lang/en-US.rc +++ b/dll/win32/netshell/lang/en-US.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Speed:", -1, 19, 48, 60, 8 GROUPBOX "Activity", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Sent", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Received", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/es-ES.rc b/dll/win32/netshell/lang/es-ES.rc index 284425b4607..bc6cedc6539 100644 --- a/dll/win32/netshell/lang/es-ES.rc +++ b/dll/win32/netshell/lang/es-ES.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Velocidad:", -1, 19, 48, 60, 8 GROUPBOX "Actividad ", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Enviados", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Recibidos", -1, 149, 90, 37, 8 LTEXT "Paquetes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/fr-FR.rc b/dll/win32/netshell/lang/fr-FR.rc index 6ca04cc5996..ed4926ca34e 100644 --- a/dll/win32/netshell/lang/fr-FR.rc +++ b/dll/win32/netshell/lang/fr-FR.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Vitesse :", -1, 19, 48, 60, 8 GROUPBOX "Activit", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Envoy駸", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Re輹s", -1, 149, 90, 37, 8 LTEXT "Octets :", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/hu-HU.rc b/dll/win32/netshell/lang/hu-HU.rc index dc6b75047a4..1365ac40837 100644 --- a/dll/win32/netshell/lang/hu-HU.rc +++ b/dll/win32/netshell/lang/hu-HU.rc @@ -36,7 +36,7 @@ BEGIN LTEXT "Sebess馮:", -1, 19, 48, 60, 8 GROUPBOX "Tev駝enys馮", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Elkldtt", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Be駻kezett", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/id-ID.rc b/dll/win32/netshell/lang/id-ID.rc index b6936192f0c..25675a79643 100644 --- a/dll/win32/netshell/lang/id-ID.rc +++ b/dll/win32/netshell/lang/id-ID.rc @@ -36,7 +36,7 @@ BEGIN LTEXT "Kecepatan:", -1, 19, 48, 60, 8 GROUPBOX "Aktivitas", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Dikirim", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Diterima", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/it-IT.rc b/dll/win32/netshell/lang/it-IT.rc index b7168eae222..330fbb88484 100644 --- a/dll/win32/netshell/lang/it-IT.rc +++ b/dll/win32/netshell/lang/it-IT.rc @@ -21,12 +21,11 @@ END IDD_STATUS DIALOGEX DISCARDABLE 0, 0, 200, 280 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Allgemein" +CAPTION "Generale" FONT 8, "MS Shell Dlg" BEGIN END - IDD_LAN_NETSTATUS DIALOGEX DISCARDABLE 0, 0, 200,180 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION CAPTION "Generale" @@ -39,7 +38,7 @@ BEGIN GROUPBOX "Attivit", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Inviati", -1, 26, 90, 60, 8 ICON IDI_HORIZONTAL, -1, 90, 85, 18, 20 - ICON IDI_NETSTAT, -1, 110, 85, 18, 20 + ICON "", IDC_NETSTAT, 110, 85, 18, 20 ICON IDI_HORIZONTAL, -1, 130, 85, 18, 20 LTEXT "Ricevuti", -1, 149, 90, 37, 8 LTEXT "Byte:", -1, 17, 115, 32, 8 @@ -74,10 +73,10 @@ END IDD_LAN_NETSTATUSDETAILS DIALOGEX DISCARDABLE 0, 0, 200,200 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION -CAPTION "Network Connection Details" +CAPTION "Dettagli della connessione di rete" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Network Connection &Details:", -1, 15, 9, 170, 12 + LTEXT "Dettagli della connessione di &rete:", -1, 15, 9, 170, 12 CONTROL "", IDC_DETAILS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 15, 25, 170, 130 PUSHBUTTON "&Close", IDC_CLOSE, 125, 165, 62, 14 END @@ -90,7 +89,7 @@ BEGIN IDS_DEF_GATEWAY "Default Gateway" IDS_DHCP_SERVER "DHCP Server" IDS_LEASE_OBTAINED "Indirizzo ottenuto" - IDS_LEASE_EXPIRES "Indirizzo con scadenza" + IDS_LEASE_EXPIRES "Scadenza indirizzo" IDS_DNS_SERVERS "DNS Servers" IDS_WINS_SERVERS "WINS Servers" IDS_PROPERTY "Propriet" @@ -116,6 +115,7 @@ BEGIN IDS_NET_REPAIR "Ripara" IDS_NET_CREATELINK "Crea collegamento" IDS_NET_DELETE "Cancella" + IDS_NET_RENAME "Rinomina" IDS_NET_PROPERTIES "Propriet" IDS_FORMAT_BIT "%u Bit/s" diff --git a/dll/win32/netshell/lang/ja-JP.rc b/dll/win32/netshell/lang/ja-JP.rc index c9bdf75b1d5..dfe0ff7c58e 100644 --- a/dll/win32/netshell/lang/ja-JP.rc +++ b/dll/win32/netshell/lang/ja-JP.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "速度:", -1, 19, 48, 60, 8 GROUPBOX "動作状況", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "送信", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "受信", -1, 149, 90, 37, 8 LTEXT "バイト:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/nl-NL.rc b/dll/win32/netshell/lang/nl-NL.rc index 914abced291..bae6286dc86 100644 --- a/dll/win32/netshell/lang/nl-NL.rc +++ b/dll/win32/netshell/lang/nl-NL.rc @@ -39,7 +39,7 @@ BEGIN LTEXT "Snelheid:", -1, 19, 48, 60, 8 GROUPBOX "Activiteit", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Verzonden", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Ontvangen", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/no-NO.rc b/dll/win32/netshell/lang/no-NO.rc index 31fafa28464..b93f14261b8 100644 --- a/dll/win32/netshell/lang/no-NO.rc +++ b/dll/win32/netshell/lang/no-NO.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Hastighet:", -1, 19, 48, 60, 8 GROUPBOX "Aktivitet", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Sendt", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Mottatt", -1, 149, 90, 37, 8 LTEXT "Byte:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/pl-PL.rc b/dll/win32/netshell/lang/pl-PL.rc index f8c9cc8dcd1..38ff75b21b2 100644 --- a/dll/win32/netshell/lang/pl-PL.rc +++ b/dll/win32/netshell/lang/pl-PL.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Szybko懈:", -1, 19, 48, 60, 8 GROUPBOX "Aktywno懈", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Wysウano", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Odebrano", -1, 149, 90, 37, 8 LTEXT "bajtw:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/ro-RO.rc b/dll/win32/netshell/lang/ro-RO.rc index 3a52b7df5b2..06ca39c1bf8 100644 --- a/dll/win32/netshell/lang/ro-RO.rc +++ b/dll/win32/netshell/lang/ro-RO.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Vitez:", -1, 19, 48, 60, 8 GROUPBOX "Activitate", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Trimis", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Primit", -1, 149, 90, 37, 8 LTEXT "Octei:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/ru-RU.rc b/dll/win32/netshell/lang/ru-RU.rc index 74c2b698959..91daab64e12 100644 --- a/dll/win32/netshell/lang/ru-RU.rc +++ b/dll/win32/netshell/lang/ru-RU.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "ム:", -1, 19, 48, 60, 8 GROUPBOX "タ鞣", -1, 9, 74, 198, 70, BS_GROUPBOX RTEXT "ホ珞褊", -1, 20, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "マ竟", -1, 158, 90, 37, 8 LTEXT "チ琺:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 54, 115, 44, 8 diff --git a/dll/win32/netshell/lang/sv-SE.rc b/dll/win32/netshell/lang/sv-SE.rc index d7243c4e8be..78651fccbfa 100644 --- a/dll/win32/netshell/lang/sv-SE.rc +++ b/dll/win32/netshell/lang/sv-SE.rc @@ -37,7 +37,7 @@ BEGIN LTEXT "Hastighet:", -1, 19, 48, 60, 8 GROUPBOX "Aktivitet", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "Skickat", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "Mottaget", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/uk-UA.rc b/dll/win32/netshell/lang/uk-UA.rc index a8abd4067c4..f109166df5a 100644 --- a/dll/win32/netshell/lang/uk-UA.rc +++ b/dll/win32/netshell/lang/uk-UA.rc @@ -45,7 +45,7 @@ BEGIN LTEXT "リ粨蓐ウ:", -1, 19, 48, 60, 8 GROUPBOX "タ鞣ウ", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "ヘ琅ウ瑙", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "ホ韲瑙", -1, 149, 90, 37, 8 LTEXT "チ琺ウ:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lang/zh-CN.rc b/dll/win32/netshell/lang/zh-CN.rc index 184a73c0f7a..45acd1f3aa6 100644 --- a/dll/win32/netshell/lang/zh-CN.rc +++ b/dll/win32/netshell/lang/zh-CN.rc @@ -36,7 +36,7 @@ BEGIN LTEXT "ヒルカネ:", -1, 19, 48, 60, 8 GROUPBOX "Activity", -1, 9, 74, 182, 70, BS_GROUPBOX RTEXT "キ「ヒヘ", -1, 26, 90, 60, 8 - ICON IDI_NETSTAT, -1, 110, 85, 32, 32 + ICON "", IDC_NETSTAT, 110, 85, 32, 32 LTEXT "スモハユ", -1, 149, 90, 37, 8 LTEXT "Bytes:", -1, 17, 115, 32, 8 RTEXT "000.000.000", IDC_SEND, 63, 115, 44, 8 diff --git a/dll/win32/netshell/lanstatusui.c b/dll/win32/netshell/lanstatusui.c index 3691289caac..1292ef1a843 100644 --- a/dll/win32/netshell/lanstatusui.c +++ b/dll/win32/netshell/lanstatusui.c @@ -165,8 +165,8 @@ UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext) } else if (pContext->dwInOctets != IfEntry.dwInOctets && pContext->dwOutOctets != IfEntry.dwOutOctets && pContext->Status != 1) { + hIcon = LoadImage(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANSREC), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR); pContext->Status = 1; - hIcon = LoadImage(netshell_hInstance, MAKEINTRESOURCE(IDI_NET_TRANSREC), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR); } else if (pContext->dwInOctets != IfEntry.dwInOctets && pContext->Status != 2) { @@ -196,7 +196,7 @@ UpdateLanStatus(HWND hwndDlg, LANSTATUSUI_CONTEXT * pContext) } } - if (hwndDlg) + if (hwndDlg && hIcon) { hOldIcon = (HICON)SendDlgItemMessageW(hwndDlg, IDC_NETSTAT, STM_SETICON, (WPARAM)hIcon, 0); if (hOldIcon) diff --git a/dll/win32/netshell/netshell.rbuild b/dll/win32/netshell/netshell.rbuild index f76dbdee79c..a5cfbce03a7 100644 --- a/dll/win32/netshell/netshell.rbuild +++ b/dll/win32/netshell/netshell.rbuild @@ -3,6 +3,7 @@ . + 0x600 shlwapi shell32 version diff --git a/dll/win32/ole32/compobj.c b/dll/win32/ole32/compobj.c index 0625c0b8949..0fb074dc50c 100644 --- a/dll/win32/ole32/compobj.c +++ b/dll/win32/ole32/compobj.c @@ -1506,7 +1506,7 @@ HRESULT WINAPI CoCreateGuid(GUID *pguid) * SEE ALSO * StringFromCLSID */ -static HRESULT __CLSIDFromString(LPCWSTR s, CLSID *id) +static HRESULT __CLSIDFromString(LPCWSTR s, LPCLSID id) { int i; BYTE table[256]; @@ -4153,11 +4153,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) case DLL_PROCESS_ATTACH: hProxyDll = hinstDLL; COMPOBJ_InitProcess(); - if (TRACE_ON(ole)) CoRegisterMallocSpy((LPVOID)-1); break; case DLL_PROCESS_DETACH: - if (TRACE_ON(ole)) CoRevokeMallocSpy(); OLEDD_UnInitialize(); COMPOBJ_UninitProcess(); RPC_UnregisterAllChannelHooks(); diff --git a/dll/win32/ole32/ftmarshal.c b/dll/win32/ole32/ftmarshal.c index 13802854fa6..d8f4bf649b8 100644 --- a/dll/win32/ole32/ftmarshal.c +++ b/dll/win32/ole32/ftmarshal.c @@ -204,8 +204,11 @@ FTMarshalImpl_MarshalInterface (LPMARSHAL iface, IStream * pStm, REFIID riid, vo hres = IStream_Write (pStm, &object, sizeof (object), NULL); if (hres != S_OK) return STG_E_MEDIUMFULL; - hres = IStream_Write (pStm, &constant, sizeof (constant), NULL); - if (hres != S_OK) return STG_E_MEDIUMFULL; + if (sizeof(object) == sizeof(DWORD)) + { + hres = IStream_Write (pStm, &constant, sizeof (constant), NULL); + if (hres != S_OK) return STG_E_MEDIUMFULL; + } hres = IStream_Write (pStm, &unknown_guid, sizeof (unknown_guid), NULL); if (hres != S_OK) return STG_E_MEDIUMFULL; @@ -237,10 +240,13 @@ FTMarshalImpl_UnmarshalInterface (LPMARSHAL iface, IStream * pStm, REFIID riid, hres = IStream_Read (pStm, &object, sizeof (object), NULL); if (hres != S_OK) return STG_E_READFAULT; - hres = IStream_Read (pStm, &constant, sizeof (constant), NULL); - if (hres != S_OK) return STG_E_READFAULT; - if (constant != 0) - FIXME("constant is 0x%x instead of 0\n", constant); + if (sizeof(object) == sizeof(DWORD)) + { + hres = IStream_Read (pStm, &constant, sizeof (constant), NULL); + if (hres != S_OK) return STG_E_READFAULT; + if (constant != 0) + FIXME("constant is 0x%x instead of 0\n", constant); + } hres = IStream_Read (pStm, &unknown_guid, sizeof (unknown_guid), NULL); if (hres != S_OK) return STG_E_READFAULT; @@ -267,10 +273,13 @@ static HRESULT WINAPI FTMarshalImpl_ReleaseMarshalData (LPMARSHAL iface, IStream hres = IStream_Read (pStm, &object, sizeof (object), NULL); if (hres != S_OK) return STG_E_READFAULT; - hres = IStream_Read (pStm, &constant, sizeof (constant), NULL); - if (hres != S_OK) return STG_E_READFAULT; - if (constant != 0) - FIXME("constant is 0x%x instead of 0\n", constant); + if (sizeof(object) == sizeof(DWORD)) + { + hres = IStream_Read (pStm, &constant, sizeof (constant), NULL); + if (hres != S_OK) return STG_E_READFAULT; + if (constant != 0) + FIXME("constant is 0x%x instead of 0\n", constant); + } hres = IStream_Read (pStm, &unknown_guid, sizeof (unknown_guid), NULL); if (hres != S_OK) return STG_E_READFAULT; diff --git a/dll/win32/ole32/ifs.c b/dll/win32/ole32/ifs.c index dc625bcc99e..c6a6962cd72 100644 --- a/dll/win32/ole32/ifs.c +++ b/dll/win32/ole32/ifs.c @@ -359,173 +359,6 @@ static const IMallocVtbl VT_IMalloc32 = IMalloc_fnHeapMinimize }; -/****************************************************************************** - * IMallocSpy implementation - *****************************************************************************/ - -/* set the vtable later */ -static const IMallocSpyVtbl VT_IMallocSpy; - -typedef struct { - const IMallocSpyVtbl *lpVtbl; - LONG ref; -} _MallocSpy; - -/* this is the static object instance */ -static _MallocSpy MallocSpy = {&VT_IMallocSpy, 0}; - -/****************************************************************************** - * IMalloc32_QueryInterface [VTABLE] - */ -static HRESULT WINAPI IMallocSpy_fnQueryInterface(LPMALLOCSPY iface,REFIID refiid,LPVOID *obj) -{ - - TRACE("(%s,%p)\n",debugstr_guid(refiid),obj); - - if (IsEqualIID(&IID_IUnknown,refiid) || IsEqualIID(&IID_IMallocSpy,refiid)) { - *obj = &MallocSpy; - return S_OK; - } - return E_NOINTERFACE; -} - -/****************************************************************************** - * IMalloc32_AddRef [VTABLE] - */ -static ULONG WINAPI IMallocSpy_fnAddRef (LPMALLOCSPY iface) -{ - - _MallocSpy *This = (_MallocSpy *)iface; - ULONG ref = InterlockedIncrement(&This->ref); - - TRACE ("(%p)->(count=%u)\n", This, ref - 1); - - return ref; -} - -/****************************************************************************** - * IMalloc32_AddRelease [VTABLE] - * - * NOTES - * Our MallocSpy is static. If the count reaches 0 we dump the leaks - */ -static ULONG WINAPI IMallocSpy_fnRelease (LPMALLOCSPY iface) -{ - - _MallocSpy *This = (_MallocSpy *)iface; - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE ("(%p)->(count=%u)\n", This, ref + 1); - - if (!ref) { - /* our allocation list MUST be empty here */ - } - return ref; -} - -static ULONG WINAPI IMallocSpy_fnPreAlloc(LPMALLOCSPY iface, ULONG cbRequest) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%u)\n", This, cbRequest); - return cbRequest; -} -static PVOID WINAPI IMallocSpy_fnPostAlloc(LPMALLOCSPY iface, void* pActual) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p)\n", This, pActual); - return pActual; -} - -static PVOID WINAPI IMallocSpy_fnPreFree(LPMALLOCSPY iface, void* pRequest, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed); - return pRequest; -} -static void WINAPI IMallocSpy_fnPostFree(LPMALLOCSPY iface, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%u)\n", This, fSpyed); -} - -static ULONG WINAPI IMallocSpy_fnPreRealloc(LPMALLOCSPY iface, void* pRequest, ULONG cbRequest, void** ppNewRequest, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u %u)\n", This, pRequest, cbRequest, fSpyed); - *ppNewRequest = pRequest; - return cbRequest; -} - -static PVOID WINAPI IMallocSpy_fnPostRealloc(LPMALLOCSPY iface, void* pActual, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u)\n", This, pActual, fSpyed); - return pActual; -} - -static PVOID WINAPI IMallocSpy_fnPreGetSize(LPMALLOCSPY iface, void* pRequest, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed); - return pRequest; -} - -static ULONG WINAPI IMallocSpy_fnPostGetSize(LPMALLOCSPY iface, ULONG cbActual, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%u %u)\n", This, cbActual, fSpyed); - return cbActual; -} - -static PVOID WINAPI IMallocSpy_fnPreDidAlloc(LPMALLOCSPY iface, void* pRequest, BOOL fSpyed) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u)\n", This, pRequest, fSpyed); - return pRequest; -} - -static int WINAPI IMallocSpy_fnPostDidAlloc(LPMALLOCSPY iface, void* pRequest, BOOL fSpyed, int fActual) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->(%p %u %u)\n", This, pRequest, fSpyed, fActual); - return fActual; -} - -static void WINAPI IMallocSpy_fnPreHeapMinimize(LPMALLOCSPY iface) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->()\n", This); -} - -static void WINAPI IMallocSpy_fnPostHeapMinimize(LPMALLOCSPY iface) -{ - _MallocSpy *This = (_MallocSpy *)iface; - TRACE ("(%p)->()\n", This); -} - -static void MallocSpyDumpLeaks(void) { - TRACE("leaks: %u\n", Malloc32.SpyedAllocationsLeft); -} - -static const IMallocSpyVtbl VT_IMallocSpy = -{ - IMallocSpy_fnQueryInterface, - IMallocSpy_fnAddRef, - IMallocSpy_fnRelease, - IMallocSpy_fnPreAlloc, - IMallocSpy_fnPostAlloc, - IMallocSpy_fnPreFree, - IMallocSpy_fnPostFree, - IMallocSpy_fnPreRealloc, - IMallocSpy_fnPostRealloc, - IMallocSpy_fnPreGetSize, - IMallocSpy_fnPostGetSize, - IMallocSpy_fnPreDidAlloc, - IMallocSpy_fnPostDidAlloc, - IMallocSpy_fnPreHeapMinimize, - IMallocSpy_fnPostHeapMinimize -}; - /****************************************************************************** * CoGetMalloc [OLE32.@] * @@ -620,9 +453,6 @@ HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy) TRACE("\n"); - /* HACK TO ACTIVATE OUT SPY */ - if (pMallocSpy == (LPVOID)-1) pMallocSpy =(IMallocSpy*)&MallocSpy; - if(Malloc32.pSpy) return CO_E_OBJISREG; EnterCriticalSection(&IMalloc32_SpyCS); @@ -661,11 +491,6 @@ HRESULT WINAPI CoRevokeMallocSpy(void) EnterCriticalSection(&IMalloc32_SpyCS); - /* if it's our spy it's time to dump the leaks */ - if (Malloc32.pSpy == (IMallocSpy*)&MallocSpy) { - MallocSpyDumpLeaks(); - } - if (Malloc32.SpyedAllocationsLeft) { TRACE("SpyReleasePending with %u allocations left\n", Malloc32.SpyedAllocationsLeft); Malloc32.SpyReleasePending = TRUE; diff --git a/dll/win32/ole32/moniker.c b/dll/win32/ole32/moniker.c index a7c5a11c98b..2fb03ae6650 100644 --- a/dll/win32/ole32/moniker.c +++ b/dll/win32/ole32/moniker.c @@ -127,6 +127,7 @@ static BOOL start_rpcss(void) WCHAR cmd[MAX_PATH]; static const WCHAR rpcss[] = {'\\','r','p','c','s','s','.','e','x','e',0}; BOOL rslt; + void *redir; TRACE("\n"); @@ -135,7 +136,9 @@ static BOOL start_rpcss(void) GetSystemDirectoryW( cmd, MAX_PATH - sizeof(rpcss)/sizeof(WCHAR) ); strcatW( cmd, rpcss ); + Wow64DisableWow64FsRedirection( &redir ); rslt = CreateProcessW( cmd, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + Wow64RevertWow64FsRedirection( redir ); if (rslt) { diff --git a/dll/win32/ole32/ole32.rbuild b/dll/win32/ole32/ole32.rbuild index 24f60c87a32..85710a6b20f 100644 --- a/dll/win32/ole32/ole32.rbuild +++ b/dll/win32/ole32/ole32.rbuild @@ -20,6 +20,7 @@ ole32_irot_client ole32_proxy rpcrt4 + kernel32 ntdll uuid pseh diff --git a/dll/win32/ole32/rpc.c b/dll/win32/ole32/rpc.c index 0daa4ab815d..75b6b1f7ab3 100644 --- a/dll/win32/ole32/rpc.c +++ b/dll/win32/ole32/rpc.c @@ -144,6 +144,28 @@ typedef struct /* [size_is((size+7)&~7)] */ unsigned char data[1]; } WIRE_ORPC_EXTENT; +typedef struct +{ + ULONG size; + ULONG reserved; + unsigned char extent[1]; +} WIRE_ORPC_EXTENT_ARRAY; + +typedef struct +{ + ULONG version; + ULONG flags; + ULONG reserved1; + GUID cid; + unsigned char extensions[1]; +} WIRE_ORPCTHIS; + +typedef struct +{ + ULONG flags; + unsigned char extensions[1]; +} WIRE_ORPCTHAT; + struct channel_hook_entry { struct list entry; @@ -503,10 +525,10 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, extensions_size = ChannelHooks_ServerGetSize(&message_state->channel_hook_info, &channel_hook_data, &channel_hook_count, &extension_count); - msg->BufferLength += FIELD_OFFSET(ORPCTHAT, extensions) + 4; + msg->BufferLength += FIELD_OFFSET(WIRE_ORPCTHAT, extensions) + sizeof(DWORD); if (extensions_size) { - msg->BufferLength += FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent) + 2*sizeof(DWORD) + extensions_size; + msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent[2*sizeof(DWORD) + extensions_size]); if (extension_count & 1) msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]); } @@ -523,7 +545,7 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, status = I_RpcGetBuffer(msg); orpcthat = msg->Buffer; - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHAT, extensions); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHAT, extensions); orpcthat->flags = ORPCF_NULL /* FIXME? */; @@ -533,10 +555,10 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, if (extensions_size) { - ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer; + WIRE_ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer; orpc_extent_array->size = extension_count; orpc_extent_array->reserved = 0; - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent); /* NDR representation of orpc_extent_array->extent */ *(DWORD *)msg->Buffer = 1; msg->Buffer = (char *)msg->Buffer + sizeof(DWORD); @@ -645,10 +667,10 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, extensions_size = ChannelHooks_ClientGetSize(&message_state->channel_hook_info, &channel_hook_data, &channel_hook_count, &extension_count); - msg->BufferLength += FIELD_OFFSET(ORPCTHIS, extensions) + 4; + msg->BufferLength += FIELD_OFFSET(WIRE_ORPCTHIS, extensions) + sizeof(DWORD); if (extensions_size) { - msg->BufferLength += FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent) + 2*sizeof(DWORD) + extensions_size; + msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent[2*sizeof(DWORD) + extensions_size]); if (extension_count & 1) msg->BufferLength += FIELD_OFFSET(WIRE_ORPC_EXTENT, data[0]); } @@ -703,7 +725,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, if (status == RPC_S_OK) { orpcthis = msg->Buffer; - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHIS, extensions); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHIS, extensions); orpcthis->version.MajorVersion = COM_MAJOR_VERSION; orpcthis->version.MinorVersion = COM_MINOR_VERSION; @@ -720,7 +742,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, ORPC_EXTENT_ARRAY *orpc_extent_array = msg->Buffer; orpc_extent_array->size = extension_count; orpc_extent_array->reserved = 0; - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent); /* NDR representation of orpc_extent_array->extent */ *(DWORD *)msg->Buffer = 1; msg->Buffer = (char *)msg->Buffer + sizeof(DWORD); @@ -1152,8 +1174,8 @@ static HRESULT unmarshal_ORPC_EXTENT_ARRAY(RPC_MESSAGE *msg, const char *end, DWORD pointer_id; DWORD i; - memcpy(extensions, msg->Buffer, FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent)); - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPC_EXTENT_ARRAY, extent); + memcpy(extensions, msg->Buffer, FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent)); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPC_EXTENT_ARRAY, extent); if ((const char *)msg->Buffer + 2 * sizeof(DWORD) > end) return RPC_E_INVALID_HEADER; @@ -1205,14 +1227,14 @@ static HRESULT unmarshal_ORPCTHIS(RPC_MESSAGE *msg, ORPCTHIS *orpcthis, *first_wire_orpc_extent = NULL; - if (msg->BufferLength < FIELD_OFFSET(ORPCTHIS, extensions) + 4) + if (msg->BufferLength < FIELD_OFFSET(WIRE_ORPCTHIS, extensions) + sizeof(DWORD)) { ERR("invalid buffer length\n"); return RPC_E_INVALID_HEADER; } - memcpy(orpcthis, msg->Buffer, FIELD_OFFSET(ORPCTHIS, extensions)); - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHIS, extensions); + memcpy(orpcthis, msg->Buffer, FIELD_OFFSET(WIRE_ORPCTHIS, extensions)); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHIS, extensions); if ((const char *)msg->Buffer + sizeof(DWORD) > end) return RPC_E_INVALID_HEADER; @@ -1256,14 +1278,14 @@ static HRESULT unmarshal_ORPCTHAT(RPC_MESSAGE *msg, ORPCTHAT *orpcthat, *first_wire_orpc_extent = NULL; - if (msg->BufferLength < FIELD_OFFSET(ORPCTHAT, extensions) + 4) + if (msg->BufferLength < FIELD_OFFSET(WIRE_ORPCTHAT, extensions) + sizeof(DWORD)) { ERR("invalid buffer length\n"); return RPC_E_INVALID_HEADER; } - memcpy(orpcthat, msg->Buffer, FIELD_OFFSET(ORPCTHAT, extensions)); - msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(ORPCTHAT, extensions); + memcpy(orpcthat, msg->Buffer, FIELD_OFFSET(WIRE_ORPCTHAT, extensions)); + msg->Buffer = (char *)msg->Buffer + FIELD_OFFSET(WIRE_ORPCTHAT, extensions); if ((const char *)msg->Buffer + sizeof(DWORD) > end) return RPC_E_INVALID_HEADER; diff --git a/dll/win32/ole32/storage32.c b/dll/win32/ole32/storage32.c index f1706da72fb..434d8b24606 100644 --- a/dll/win32/ole32/storage32.c +++ b/dll/win32/ole32/storage32.c @@ -2583,6 +2583,7 @@ static HRESULT StorageImpl_Construct( DWORD openFlags, BOOL fileBased, BOOL create, + ULONG sector_size, StorageImpl** result) { StorageImpl* This; @@ -2634,7 +2635,7 @@ static HRESULT StorageImpl_Construct( /* * Initialize the big block cache. */ - This->bigBlockSize = DEF_BIG_BLOCK_SIZE; + This->bigBlockSize = sector_size; This->smallBlockSize = DEF_SMALL_BLOCK_SIZE; This->bigBlockFile = BIGBLOCKFILE_Construct(hFile, pLkbyt, @@ -2665,8 +2666,12 @@ static HRESULT StorageImpl_Construct( This->bigBlockDepotCount = 1; This->bigBlockDepotStart[0] = 0; This->rootStartBlock = 1; + This->smallBlockLimit = LIMIT_TO_USE_SMALL_BLOCK; This->smallBlockDepotStart = BLOCK_END_OF_CHAIN; - This->bigBlockSizeBits = DEF_BIG_BLOCK_SIZE_BITS; + if (sector_size == 4096) + This->bigBlockSizeBits = MAX_BIG_BLOCK_SIZE_BITS; + else + This->bigBlockSizeBits = MIN_BIG_BLOCK_SIZE_BITS; This->smallBlockSizeBits = DEF_SMALL_BLOCK_SIZE_BITS; This->extBigBlockDepotStart = BLOCK_END_OF_CHAIN; This->extBigBlockDepotCount = 0; @@ -2711,6 +2716,8 @@ static HRESULT StorageImpl_Construct( */ This->prevFreeBlock = 0; + This->firstFreeSmallBlock = 0; + /* * Create the block chain abstractions. */ @@ -3348,6 +3355,11 @@ static HRESULT StorageImpl_LoadFileHeader( OFFSET_ROOTSTARTBLOCK, &This->rootStartBlock); + StorageUtl_ReadDWord( + headerBigBlock, + OFFSET_SMALLBLOCKLIMIT, + &This->smallBlockLimit); + StorageUtl_ReadDWord( headerBigBlock, OFFSET_SBDEPOTSTART, @@ -3382,9 +3394,11 @@ static HRESULT StorageImpl_LoadFileHeader( * blocks, just make sure they are what we're expecting. */ if ((This->bigBlockSize != MIN_BIG_BLOCK_SIZE && This->bigBlockSize != MAX_BIG_BLOCK_SIZE) || - This->smallBlockSize != DEF_SMALL_BLOCK_SIZE) + This->smallBlockSize != DEF_SMALL_BLOCK_SIZE || + This->smallBlockLimit != LIMIT_TO_USE_SMALL_BLOCK) { - WARN("Broken OLE storage file\n"); + FIXME("Broken OLE storage file? bigblock=0x%x, smallblock=0x%x, sblimit=0x%x\n", + This->bigBlockSize, This->smallBlockSize, This->smallBlockLimit); hr = STG_E_INVALIDHEADER; } else @@ -3438,7 +3452,6 @@ static void StorageImpl_SaveFileHeader( StorageUtl_WriteWord(headerBigBlock, 0x18, 0x3b); StorageUtl_WriteWord(headerBigBlock, 0x1a, 0x3); StorageUtl_WriteWord(headerBigBlock, 0x1c, (WORD)-2); - StorageUtl_WriteDWord(headerBigBlock, 0x38, (DWORD)0x1000); } /* @@ -3464,6 +3477,11 @@ static void StorageImpl_SaveFileHeader( OFFSET_ROOTSTARTBLOCK, This->rootStartBlock); + StorageUtl_WriteDWord( + headerBigBlock, + OFFSET_SMALLBLOCKLIMIT, + This->smallBlockLimit); + StorageUtl_WriteDWord( headerBigBlock, OFFSET_SBDEPOTSTART, @@ -4341,13 +4359,14 @@ static HRESULT Storage_Construct( DWORD openFlags, BOOL fileBased, BOOL create, + ULONG sector_size, StorageBaseImpl** result) { StorageImpl *newStorage; StorageBaseImpl *newTransactedStorage; HRESULT hr; - hr = StorageImpl_Construct(hFile, pwcsName, pLkbyt, openFlags, fileBased, create, &newStorage); + hr = StorageImpl_Construct(hFile, pwcsName, pLkbyt, openFlags, fileBased, create, sector_size, &newStorage); if (FAILED(hr)) goto end; if (openFlags & STGM_TRANSACTED) @@ -4840,6 +4859,7 @@ static StorageInternalImpl* StorageInternalImpl_Construct( * Initialize the virtual function table. */ newStorage->base.lpVtbl = &Storage32InternalImpl_Vtbl; + newStorage->base.pssVtbl = &IPropertySetStorage_Vtbl; newStorage->base.baseVtbl = &StorageInternalImpl_BaseVtbl; newStorage->base.openFlags = (openFlags & ~STGM_CREATE); @@ -5710,7 +5730,7 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock( ULARGE_INTEGER offsetOfBlockInDepot; DWORD buffer; ULONG bytesRead; - ULONG blockIndex = 0; + ULONG blockIndex = This->parentStorage->firstFreeSmallBlock; ULONG nextBlockIndex = BLOCK_END_OF_CHAIN; HRESULT res = S_OK; ULONG smallBlocksPerBigBlock; @@ -5819,6 +5839,8 @@ static ULONG SmallBlockChainStream_GetNextFreeBlock( } } + This->parentStorage->firstFreeSmallBlock = blockIndex+1; + smallBlocksPerBigBlock = This->parentStorage->bigBlockSize / This->parentStorage->smallBlockSize; @@ -6117,6 +6139,7 @@ static BOOL SmallBlockChainStream_Shrink( &blockIndex))) return FALSE; SmallBlockChainStream_FreeBlock(This, extraBlock); + This->parentStorage->firstFreeSmallBlock = min(This->parentStorage->firstFreeSmallBlock, extraBlock); extraBlock = blockIndex; } @@ -6293,30 +6316,13 @@ static ULARGE_INTEGER SmallBlockChainStream_GetSize(SmallBlockChainStream* This) return chainEntry.size; } -/****************************************************************************** - * StgCreateDocfile [OLE32.@] - * Creates a new compound file storage object - * - * PARAMS - * pwcsName [ I] Unicode string with filename (can be relative or NULL) - * grfMode [ I] Access mode for opening the new storage object (see STGM_ constants) - * reserved [ ?] unused?, usually 0 - * ppstgOpen [IO] A pointer to IStorage pointer to the new onject - * - * RETURNS - * S_OK if the file was successfully created - * some STG_E_ value if error - * NOTES - * if pwcsName is NULL, create file with new unique name - * the function can returns - * STG_S_CONVERTED if the specified file was successfully converted to storage format - * (unrealized now) - */ -HRESULT WINAPI StgCreateDocfile( +static HRESULT create_storagefile( LPCOLESTR pwcsName, DWORD grfMode, - DWORD reserved, - IStorage **ppstgOpen) + DWORD grfAttrs, + STGOPTIONS* pStgOptions, + REFIID riid, + void** ppstgOpen) { StorageBaseImpl* newStorage = 0; HANDLE hFile = INVALID_HANDLE_VALUE; @@ -6327,13 +6333,10 @@ HRESULT WINAPI StgCreateDocfile( DWORD fileAttributes; WCHAR tempFileName[MAX_PATH]; - TRACE("(%s, %x, %d, %p)\n", - debugstr_w(pwcsName), grfMode, - reserved, ppstgOpen); - if (ppstgOpen == 0) return STG_E_INVALIDPOINTER; - if (reserved != 0) + + if (pStgOptions->ulSectorSize != MIN_BIG_BLOCK_SIZE && pStgOptions->ulSectorSize != MAX_BIG_BLOCK_SIZE) return STG_E_INVALIDPARAMETER; /* if no share mode given then DENY_NONE is the default */ @@ -6435,6 +6438,7 @@ HRESULT WINAPI StgCreateDocfile( grfMode, TRUE, TRUE, + pStgOptions->ulSectorSize, &newStorage); if (FAILED(hr)) @@ -6442,10 +6446,9 @@ HRESULT WINAPI StgCreateDocfile( goto end; } - /* - * Get an "out" pointer for the caller. - */ - *ppstgOpen = (IStorage*)newStorage; + hr = IStorage_QueryInterface((IStorage*)newStorage, riid, ppstgOpen); + + IStorage_Release((IStorage*)newStorage); end: TRACE("<-- %p r = %08x\n", *ppstgOpen, hr); @@ -6453,6 +6456,45 @@ end: return hr; } +/****************************************************************************** + * StgCreateDocfile [OLE32.@] + * Creates a new compound file storage object + * + * PARAMS + * pwcsName [ I] Unicode string with filename (can be relative or NULL) + * grfMode [ I] Access mode for opening the new storage object (see STGM_ constants) + * reserved [ ?] unused?, usually 0 + * ppstgOpen [IO] A pointer to IStorage pointer to the new onject + * + * RETURNS + * S_OK if the file was successfully created + * some STG_E_ value if error + * NOTES + * if pwcsName is NULL, create file with new unique name + * the function can returns + * STG_S_CONVERTED if the specified file was successfully converted to storage format + * (unrealized now) + */ +HRESULT WINAPI StgCreateDocfile( + LPCOLESTR pwcsName, + DWORD grfMode, + DWORD reserved, + IStorage **ppstgOpen) +{ + STGOPTIONS stgoptions = {1, 0, 512}; + + TRACE("(%s, %x, %d, %p)\n", + debugstr_w(pwcsName), grfMode, + reserved, ppstgOpen); + + if (ppstgOpen == 0) + return STG_E_INVALIDPOINTER; + if (reserved != 0) + return STG_E_INVALIDPARAMETER; + + return create_storagefile(pwcsName, grfMode, 0, &stgoptions, &IID_IStorage, (void**)ppstgOpen); +} + /****************************************************************************** * StgCreateStorageEx [OLE32.@] */ @@ -6481,10 +6523,10 @@ HRESULT WINAPI StgCreateStorageEx(const WCHAR* pwcsName, DWORD grfMode, DWORD st if (stgfmt == STGFMT_STORAGE || stgfmt == STGFMT_DOCFILE) { - FIXME("Stub: calling StgCreateDocfile, but ignoring pStgOptions and grfAttrs\n"); - return StgCreateDocfile(pwcsName, grfMode, 0, (IStorage **)ppObjectOpen); + return create_storagefile(pwcsName, grfMode, grfAttrs, pStgOptions, riid, ppObjectOpen); } + ERR("Invalid stgfmt argument\n"); return STG_E_INVALIDPARAMETER; } @@ -6707,6 +6749,7 @@ HRESULT WINAPI StgOpenStorage( grfMode, TRUE, FALSE, + 512, &newStorage); if (FAILED(hr)) @@ -6754,6 +6797,7 @@ HRESULT WINAPI StgCreateDocfileOnILockBytes( grfMode, FALSE, TRUE, + 512, &newStorage); if (FAILED(hr)) @@ -6801,6 +6845,7 @@ HRESULT WINAPI StgOpenStorageOnILockBytes( grfMode, FALSE, FALSE, + 512, &newStorage); if (FAILED(hr)) diff --git a/dll/win32/ole32/storage32.h b/dll/win32/ole32/storage32.h index fad5d7766f7..36a7d679af6 100644 --- a/dll/win32/ole32/storage32.h +++ b/dll/win32/ole32/storage32.h @@ -46,6 +46,7 @@ static const ULONG OFFSET_BIGBLOCKSIZEBITS = 0x0000001e; static const ULONG OFFSET_SMALLBLOCKSIZEBITS = 0x00000020; static const ULONG OFFSET_BBDEPOTCOUNT = 0x0000002C; static const ULONG OFFSET_ROOTSTARTBLOCK = 0x00000030; +static const ULONG OFFSET_SMALLBLOCKLIMIT = 0x00000038; static const ULONG OFFSET_SBDEPOTSTART = 0x0000003C; static const ULONG OFFSET_SBDEPOTCOUNT = 0x00000040; static const ULONG OFFSET_EXTBBDEPOTSTART = 0x00000044; @@ -65,6 +66,8 @@ static const ULONG OFFSET_PS_MTIMEHIGH = 0x00000070; static const ULONG OFFSET_PS_STARTBLOCK = 0x00000074; static const ULONG OFFSET_PS_SIZE = 0x00000078; static const WORD DEF_BIG_BLOCK_SIZE_BITS = 0x0009; +static const WORD MIN_BIG_BLOCK_SIZE_BITS = 0x0009; +static const WORD MAX_BIG_BLOCK_SIZE_BITS = 0x000c; static const WORD DEF_SMALL_BLOCK_SIZE_BITS = 0x0006; static const WORD DEF_BIG_BLOCK_SIZE = 0x0200; static const WORD DEF_SMALL_BLOCK_SIZE = 0x0040; @@ -97,6 +100,8 @@ static const ULONG DIRENTRY_NULL = 0xFFFFFFFF; #define STGTY_ROOT 0x05 #define COUNT_BBDEPOTINHEADER 109 + +/* FIXME: This value is stored in the header, but we hard-code it to 0x1000. */ #define LIMIT_TO_USE_SMALL_BLOCK 0x1000 #define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f) @@ -351,6 +356,7 @@ struct StorageImpl ULONG smallBlockSize; ULONG bigBlockDepotCount; ULONG rootStartBlock; + ULONG smallBlockLimit; ULONG smallBlockDepotStart; ULONG extBigBlockDepotStart; ULONG extBigBlockDepotCount; @@ -360,6 +366,9 @@ struct StorageImpl ULONG indexBlockDepotCached; ULONG prevFreeBlock; + /* All small blocks before this one are known to be in use. */ + ULONG firstFreeSmallBlock; + /* * Abstraction of the big block chains for the chains of the header. */ diff --git a/dll/win32/oleaut32/olepicture.c b/dll/win32/oleaut32/olepicture.c index 7a5bc29a4e5..c7a3411cf04 100644 --- a/dll/win32/oleaut32/olepicture.c +++ b/dll/win32/oleaut32/olepicture.c @@ -1273,7 +1273,7 @@ static HRESULT OLEPictureImpl_LoadEnhMetafile(OLEPictureImpl *This, static HRESULT OLEPictureImpl_LoadAPM(OLEPictureImpl *This, const BYTE *data, ULONG size) { - APM_HEADER *header = (APM_HEADER *)data; + const APM_HEADER *header = (const APM_HEADER *)data; HMETAFILE hmf; if (size < sizeof(APM_HEADER)) diff --git a/dll/win32/oleaut32/regsvr.c b/dll/win32/oleaut32/regsvr.c index 12f64faa516..f97544f51ed 100644 --- a/dll/win32/oleaut32/regsvr.c +++ b/dll/win32/oleaut32/regsvr.c @@ -480,6 +480,12 @@ static struct regsvr_coclass const coclass_list[] = { "Obsolete Font", "OldFont" }, + { &IID_ISupportErrorInfo, + "PSSupportErrorInfo", + "ole2disp.dll", + "oleaut32.dll", + NULL + }, { NULL } /* list terminator */ }; diff --git a/dll/win32/oleaut32/typelib.c b/dll/win32/oleaut32/typelib.c index b09f7ab64d1..5792cc51870 100644 --- a/dll/win32/oleaut32/typelib.c +++ b/dll/win32/oleaut32/typelib.c @@ -283,30 +283,9 @@ static WCHAR *get_lcid_subkey( LCID lcid, SYSKIND syskind, WCHAR *buffer ) static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath, ITypeLib2 **ppTypeLib); -/**************************************************************************** - * QueryPathOfRegTypeLib [OLEAUT32.164] - * - * Gets the path to a registered type library. - * - * PARAMS - * guid [I] referenced guid - * wMaj [I] major version - * wMin [I] minor version - * lcid [I] locale id - * path [O] path of typelib - * - * RETURNS - * Success: S_OK. - * Failure: If the type library is not registered then TYPE_E_LIBNOTREGISTERED - * or TYPE_E_REGISTRYACCESS if the type library registration key couldn't be - * opened. - */ -HRESULT WINAPI QueryPathOfRegTypeLib( - REFGUID guid, - WORD wMaj, - WORD wMin, - LCID lcid, - LPBSTR path ) +/* Get the path to a registered type library. Helper for QueryPathOfRegTypeLib. */ +static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin, + SYSKIND syskind, LCID lcid, LPBSTR path ) { HRESULT hr = TYPE_E_LIBNOTREGISTERED; LCID myLCID = lcid; @@ -336,7 +315,7 @@ HRESULT WINAPI QueryPathOfRegTypeLib( { LONG dwPathLen = sizeof(Path); - get_lcid_subkey( myLCID, SYS_WIN32, buffer ); + get_lcid_subkey( myLCID, syskind, buffer ); if (RegQueryValueW(hkey, buffer, Path, &dwPathLen)) { @@ -368,6 +347,29 @@ HRESULT WINAPI QueryPathOfRegTypeLib( return hr; } +/**************************************************************************** + * QueryPathOfRegTypeLib [OLEAUT32.164] + * + * Gets the path to a registered type library. + * + * PARAMS + * guid [I] referenced guid + * wMaj [I] major version + * wMin [I] minor version + * lcid [I] locale id + * path [O] path of typelib + * + * RETURNS + * Success: S_OK. + * Failure: If the type library is not registered then TYPE_E_LIBNOTREGISTERED + * or TYPE_E_REGISTRYACCESS if the type library registration key couldn't be + * opened. + */ +HRESULT WINAPI QueryPathOfRegTypeLib( REFGUID guid, WORD wMaj, WORD wMin, LCID lcid, LPBSTR path ) +{ + return query_typelib_path( guid, wMaj, wMin, SYS_WIN32, lcid, path ); +} + /****************************************************************************** * CreateTypeLib [OLEAUT32.160] creates a typelib * @@ -691,7 +693,10 @@ HRESULT WINAPI RegisterTypeLib( MESSAGE("\n"); } - if (tattr->wTypeFlags & (TYPEFLAG_FOLEAUTOMATION|TYPEFLAG_FDUAL|TYPEFLAG_FDISPATCHABLE)) + /* Register all dispinterfaces (which includes dual interfaces) and + oleautomation interfaces */ + if ((kind == TKIND_INTERFACE && (tattr->wTypeFlags & TYPEFLAG_FOLEAUTOMATION)) || + kind == TKIND_DISPATCH) { /* register interface<->typelib coupling */ get_interface_key( &tattr->guid, keyName ); @@ -796,7 +801,7 @@ HRESULT WINAPI UnRegisterTypeLib( } /* get the path to the typelib on disk */ - if (QueryPathOfRegTypeLib(libid, wVerMajor, wVerMinor, lcid, &tlibPath) != S_OK) { + if (query_typelib_path(libid, wVerMajor, wVerMinor, syskind, lcid, &tlibPath) != S_OK) { result = E_INVALIDARG; goto end; } @@ -832,19 +837,23 @@ HRESULT WINAPI UnRegisterTypeLib( goto enddeleteloop; } - /* the path to the type */ - get_interface_key( &typeAttr->guid, subKeyName ); + if ((kind == TKIND_INTERFACE && (typeAttr->wTypeFlags & TYPEFLAG_FOLEAUTOMATION)) || + kind == TKIND_DISPATCH) + { + /* the path to the type */ + get_interface_key( &typeAttr->guid, subKeyName ); - /* Delete its bits */ - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, subKeyName, 0, KEY_WRITE, &subKey) != ERROR_SUCCESS) { - goto enddeleteloop; + /* Delete its bits */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, subKeyName, 0, KEY_WRITE, &subKey) != ERROR_SUCCESS) + goto enddeleteloop; + + RegDeleteKeyW(subKey, ProxyStubClsidW); + RegDeleteKeyW(subKey, ProxyStubClsid32W); + RegDeleteKeyW(subKey, TypeLibW); + RegCloseKey(subKey); + subKey = NULL; + RegDeleteKeyW(HKEY_CLASSES_ROOT, subKeyName); } - RegDeleteKeyW(subKey, ProxyStubClsidW); - RegDeleteKeyW(subKey, ProxyStubClsid32W); - RegDeleteKeyW(subKey, TypeLibW); - RegCloseKey(subKey); - subKey = NULL; - RegDeleteKeyW(HKEY_CLASSES_ROOT, subKeyName); enddeleteloop: if (typeAttr) ITypeInfo_ReleaseTypeAttr(typeInfo, typeAttr); @@ -1901,7 +1910,7 @@ MSFT_DoFuncs(TLBContext* pcx, { if (!IS_INTRESOURCE(pFuncRec->OptAttr[2])) ERR("ordinal 0x%08x invalid, IS_INTRESOURCE is false\n", pFuncRec->OptAttr[2]); - (*pptfd)->Entry = (BSTR)pFuncRec->OptAttr[2]; + (*pptfd)->Entry = (BSTR)(DWORD_PTR)LOWORD(pFuncRec->OptAttr[2]); } else { @@ -2927,7 +2936,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) else if(td[0] == VT_CARRAY) { /* array descr table here */ - pTypeLibImpl->pTypeDesc[i].u.lpadesc = (void *)((int) td[2]); /* temp store offset in*/ + pTypeLibImpl->pTypeDesc[i].u.lpadesc = (void *)(INT_PTR)td[2]; /* temp store offset in*/ } else if(td[0] == VT_USERDEFINED) { @@ -2942,7 +2951,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) if(pTypeLibImpl->pTypeDesc[i].vt != VT_CARRAY) continue; if(tlbSegDir.pArrayDescriptions.offset>0) { - MSFT_ReadLEWords(td, sizeof(td), &cx, tlbSegDir.pArrayDescriptions.offset + (int) pTypeLibImpl->pTypeDesc[i].u.lpadesc); + MSFT_ReadLEWords(td, sizeof(td), &cx, tlbSegDir.pArrayDescriptions.offset + (INT_PTR)pTypeLibImpl->pTypeDesc[i].u.lpadesc); pTypeLibImpl->pTypeDesc[i].u.lpadesc = TLB_Alloc(sizeof(ARRAYDESC)+sizeof(SAFEARRAYBOUND)*(td[3]-1)); if(td[1]<0) @@ -4779,13 +4788,7 @@ static HRESULT WINAPI ITypeLibComp_fnBind( &subtypeinfo, &subdesckind, &subbindptr); if (SUCCEEDED(hr) && (subdesckind != DESCKIND_NONE)) { - TYPEDESC tdesc_appobject = - { - { - (TYPEDESC *)pTypeInfo->hreftype - }, - VT_USERDEFINED - }; + TYPEDESC tdesc_appobject; const VARDESC vardesc_appobject = { -2, /* memid */ @@ -4807,6 +4810,9 @@ static HRESULT WINAPI ITypeLibComp_fnBind( VAR_STATIC /* varkind */ }; + tdesc_appobject.u.hreftype = pTypeInfo->hreftype; + tdesc_appobject.vt = VT_USERDEFINED; + TRACE("found in implicit app object: %s\n", debugstr_w(szName)); /* cleanup things filled in by Bind call so we can put our @@ -5696,7 +5702,8 @@ _invoke(FARPROC func,CALLCONV callconv, int nrargs, DWORD *args) { if (TRACE_ON(ole)) { int i; TRACE("Calling %p(",func); - for (i=0;i 30) TRACE("..."); TRACE(")\n"); } @@ -6102,10 +6109,11 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( continue; } + src_arg = NULL; + if (cNamedArgs) { USHORT j; - src_arg = NULL; for (j = 0; j < cNamedArgs; j++) if (rgdispidNamedArgs[j] == i || (i == func_desc->cParams-1 && rgdispidNamedArgs[j] == DISPID_PROPERTYPUT)) { @@ -6113,9 +6121,10 @@ static HRESULT WINAPI ITypeInfo_fnInvoke( break; } } - else + + if (!src_arg && vargs_converted + cNamedArgs < pDispParams->cArgs) { - src_arg = vargs_converted < pDispParams->cArgs ? &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted] : NULL; + src_arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted]; vargs_converted++; } @@ -6596,7 +6605,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDllEntry( ITypeInfo2 *iface, MEMBERID memid if (pBstrName) *pBstrName = NULL; if (pwOrdinal) - *pwOrdinal = (DWORD)pFDesc->Entry; + *pwOrdinal = LOWORD(pFDesc->Entry); return S_OK; } return TYPE_E_ELEMENTNOTFOUND; diff --git a/dll/win32/oleaut32/typelib2.c b/dll/win32/oleaut32/typelib2.c index 6b1aea062ba..a93e5a4962a 100644 --- a/dll/win32/oleaut32/typelib2.c +++ b/dll/win32/oleaut32/typelib2.c @@ -2456,7 +2456,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnLayOut( return hres; } - This->typeinfo->cbSizeVft = typeattr->cbSizeVft; + This->typeinfo->cbSizeVft = typeattr->cbSizeVft * 4 / sizeof(void *); ITypeInfo_ReleaseTypeAttr(inherited, typeattr); ITypeInfo_Release(inherited); @@ -2928,7 +2928,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeAttr( (*ppTypeAttr)->cFuncs += 7; (*ppTypeAttr)->cVars = This->typeinfo->cElement>>16; (*ppTypeAttr)->cImplTypes = This->typeinfo->cImplTypes; - (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 28 : This->typeinfo->cbSizeVft; + (*ppTypeAttr)->cbSizeVft = This->typekind==TKIND_DISPATCH ? 7 * sizeof(void*) : This->typeinfo->cbSizeVft; (*ppTypeAttr)->cbAlignment = (This->typeinfo->typekind>>11) & 0x1f; (*ppTypeAttr)->wTypeFlags = This->typeinfo->flags; (*ppTypeAttr)->wMajorVerNum = This->typeinfo->version&0xffff; diff --git a/dll/win32/oleaut32/vartype.c b/dll/win32/oleaut32/vartype.c index da1288d4a7c..cfd5e8f8353 100644 --- a/dll/win32/oleaut32/vartype.c +++ b/dll/win32/oleaut32/vartype.c @@ -3503,7 +3503,7 @@ HRESULT WINAPI VarCyFromR4(FLOAT fltIn, CY* pCyOut) */ HRESULT WINAPI VarCyFromR8(double dblIn, CY* pCyOut) { -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) /* This code gives identical results to Win32 on Intel. * Here we use fp exceptions to catch overflows when storing the value. */ diff --git a/dll/win32/qmgr/qmgr.inf b/dll/win32/qmgr/qmgr.inf index ef51f9b3d99..c3d0380cd90 100644 --- a/dll/win32/qmgr/qmgr.inf +++ b/dll/win32/qmgr/qmgr.inf @@ -12,5 +12,5 @@ HKCR,"AppID\BITS","AppID",,"%CLSID_BackgroundCopyQMgr%" HKCR,"AppID\%CLSID_BackgroundCopyQMgr%","LocalService",,"BITS" HKCR,"CLSID\%CLSID_BackgroundCopyManager%","AppID",,"%CLSID_BackgroundCopyQMgr%" -HKLM,"Software\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010000,"BITS" +HKLM,"Software\Microsoft\Windows NT\CurrentVersion\SvcHost","netsvcs",0x00010008,"BITS" HKLM,"System\CurrentControlSet\Services\BITS\Parameters","ServiceDll",0x00020000,"qmgr.dll" diff --git a/dll/win32/rsaenh/rsaenh.c b/dll/win32/rsaenh/rsaenh.c index 74ad392f2f2..8a5be9935c3 100644 --- a/dll/win32/rsaenh/rsaenh.c +++ b/dll/win32/rsaenh/rsaenh.c @@ -3354,6 +3354,33 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam setup_key(pCryptKey); return TRUE; + case KP_SALT: + switch (pCryptKey->aiAlgid) { + case CALG_RC2: + case CALG_RC4: + if (!pbData) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + /* MSDN: the base provider always sets eleven bytes of + * salt value. + */ + memcpy(pCryptKey->abKeyValue + pCryptKey->dwKeyLen, + pbData, 11); + pCryptKey->dwSaltLen = 11; + setup_key(pCryptKey); + /* Strange but true: salt length reset to 0 after setting + * it via KP_SALT. + */ + pCryptKey->dwSaltLen = 0; + break; + default: + SetLastError(NTE_BAD_KEY); + return FALSE; + } + return TRUE; + case KP_SALT_EX: { CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)pbData; @@ -3486,8 +3513,16 @@ BOOL WINAPI RSAENH_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam pCryptKey->dwBlockLen); case KP_SALT: - return copy_param(pbData, pdwDataLen, - &pCryptKey->abKeyValue[pCryptKey->dwKeyLen], pCryptKey->dwSaltLen); + switch (pCryptKey->aiAlgid) { + case CALG_RC2: + case CALG_RC4: + return copy_param(pbData, pdwDataLen, + &pCryptKey->abKeyValue[pCryptKey->dwKeyLen], + pCryptKey->dwSaltLen); + default: + SetLastError(NTE_BAD_KEY); + return FALSE; + } case KP_PADDING: dwValue = PKCS5_PADDING; diff --git a/dll/win32/rsaenh/sha2.c b/dll/win32/rsaenh/sha2.c index 559323c54e5..ea5bb28b48f 100644 --- a/dll/win32/rsaenh/sha2.c +++ b/dll/win32/rsaenh/sha2.c @@ -273,7 +273,7 @@ static const char sha2_hex_digits[] = "0123456789abcdef"; /*** SHA-256: *********************************************************/ void SHA256_Init(SHA256_CTX* context) { - if (context == (SHA256_CTX*)0) { + if (context == NULL) { return; } MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); @@ -465,7 +465,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { } /* Sanity check: */ - assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); + assert(context != NULL && data != NULL); usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; if (usedspace > 0) { @@ -490,7 +490,7 @@ void SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA256_Transform(context, (sha2_word32*)data); + SHA256_Transform(context, (const sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; @@ -509,10 +509,10 @@ void SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { unsigned int usedspace; /* Sanity check: */ - assert(context != (SHA256_CTX*)0); + assert(context != NULL); /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { + if (digest != NULL) { usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH; #ifndef WORDS_BIGENDIAN /* Convert FROM host byte order */ @@ -572,9 +572,9 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { int i; /* Sanity check: */ - assert(context != (SHA256_CTX*)0); + assert(context != NULL); - if (buffer != (char*)0) { + if (buffer != NULL) { SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { @@ -582,7 +582,7 @@ char *SHA256_End(SHA256_CTX* context, char buffer[]) { *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } - *buffer = (char)0; + *buffer = 0; } else { MEMSET_BZERO(context, sizeof(context)); } @@ -601,7 +601,7 @@ char* SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_S /*** SHA-512: *********************************************************/ void SHA512_Init(SHA512_CTX* context) { - if (context == (SHA512_CTX*)0) { + if (context == NULL) { return; } MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); @@ -787,7 +787,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { } /* Sanity check: */ - assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); + assert(context != NULL && data != NULL); usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH; if (usedspace > 0) { @@ -812,7 +812,7 @@ void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ - SHA512_Transform(context, (sha2_word64*)data); + SHA512_Transform(context, (const sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; @@ -871,10 +871,10 @@ void SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ - assert(context != (SHA512_CTX*)0); + assert(context != NULL); /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { + if (digest != NULL) { SHA512_Last(context); /* Save the hash data for output: */ @@ -901,9 +901,9 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { int i; /* Sanity check: */ - assert(context != (SHA512_CTX*)0); + assert(context != NULL); - if (buffer != (char*)0) { + if (buffer != NULL) { SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { @@ -911,7 +911,7 @@ char *SHA512_End(SHA512_CTX* context, char buffer[]) { *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } - *buffer = (char)0; + *buffer = 0; } else { MEMSET_BZERO(context, sizeof(context)); } @@ -930,7 +930,7 @@ char* SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_S /*** SHA-384: *********************************************************/ void SHA384_Init(SHA384_CTX* context) { - if (context == (SHA384_CTX*)0) { + if (context == NULL) { return; } MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); @@ -946,10 +946,10 @@ void SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ - assert(context != (SHA384_CTX*)0); + assert(context != NULL); /* If no digest buffer is passed, we don't bother doing this: */ - if (digest != (sha2_byte*)0) { + if (digest != NULL) { SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ @@ -976,9 +976,9 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { int i; /* Sanity check: */ - assert(context != (SHA384_CTX*)0); + assert(context != NULL); - if (buffer != (char*)0) { + if (buffer != NULL) { SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { @@ -986,7 +986,7 @@ char *SHA384_End(SHA384_CTX* context, char buffer[]) { *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } - *buffer = (char)0; + *buffer = 0; } else { MEMSET_BZERO(context, sizeof(context)); } diff --git a/dll/win32/schannel/lsamode.c b/dll/win32/schannel/lsamode.c index 23d85994cc4..f43150e3d3a 100644 --- a/dll/win32/schannel/lsamode.c +++ b/dll/win32/schannel/lsamode.c @@ -109,6 +109,12 @@ static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2] = NULL, /* SetExtendedInformation */ NULL, /* SetContextAttributes */ NULL, /* SetCredentialsAttributes */ + NULL, /* ChangeAccountPassword */ + NULL, /* QueryMetaData */ + NULL, /* ExchangeMetaData */ + NULL, /* GetCredUIContext */ + NULL, /* UpdateCredentials */ + NULL, /* ValidateTargetInfo */ }, { NULL, /* InitializePackage */ NULL, /* LsaLogonUser */ @@ -139,6 +145,12 @@ static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2] = NULL, /* SetExtendedInformation */ NULL, /* SetContextAttributes */ NULL, /* SetCredentialsAttributes */ + NULL, /* ChangeAccountPassword */ + NULL, /* QueryMetaData */ + NULL, /* ExchangeMetaData */ + NULL, /* GetCredUIContext */ + NULL, /* UpdateCredentials */ + NULL, /* ValidateTargetInfo */ } }; @@ -150,7 +162,7 @@ NTSTATUS WINAPI SpLsaModeInitialize(ULONG LsaVersion, PULONG PackageVersion, { TRACE("(%u, %p, %p, %p)\n", LsaVersion, PackageVersion, ppTables, pcTables); - *PackageVersion = SECPKG_INTERFACE_VERSION_3; + *PackageVersion = SECPKG_INTERFACE_VERSION_6; *pcTables = 2; *ppTables = secPkgFunctionTable; diff --git a/dll/win32/setupapi/install.c b/dll/win32/setupapi/install.c index a89081c7d6d..0d1fd062321 100644 --- a/dll/win32/setupapi/install.c +++ b/dll/win32/setupapi/install.c @@ -250,7 +250,7 @@ static void append_multi_sz_value( HKEY hkey, const WCHAR *value, const WCHAR *s if (total != size) { TRACE( "setting value %s to %s\n", debugstr_w(value), debugstr_w(buffer) ); - RegSetValueExW( hkey, value, 0, REG_MULTI_SZ, (BYTE *)buffer, total ); + RegSetValueExW( hkey, value, 0, REG_MULTI_SZ, (BYTE *)buffer, total + sizeof(WCHAR) ); } done: HeapFree( GetProcessHeap(), 0, buffer ); diff --git a/dll/win32/setupapi/interface.c b/dll/win32/setupapi/interface.c index 1d207097d00..e7556cec75f 100644 --- a/dll/win32/setupapi/interface.c +++ b/dll/win32/setupapi/interface.c @@ -399,7 +399,13 @@ InstallOneInterface( HeapFree(GetProcessHeap(), 0, Path); } - return SetupInstallFromInfSectionW(NULL, /* FIXME */ hInf, InterfaceSection, SPINST_REGISTRY, hKey, NULL, 0, NULL, NULL, NULL, NULL); + if (RegCreateKeyExW(hKey, L"Device Parameters", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hRefKey, NULL) != ERROR_SUCCESS) + { + RegCloseKey(hKey); + return FALSE; + } + + return SetupInstallFromInfSectionW(NULL, /* FIXME */ hInf, InterfaceSection, SPINST_REGISTRY, hRefKey, NULL, 0, NULL, NULL, NULL, NULL); } /*********************************************************************** diff --git a/dll/win32/shell32/folder_options.c b/dll/win32/shell32/folder_options.c index c862c79855b..0e8ccbfe93d 100644 --- a/dll/win32/shell32/folder_options.c +++ b/dll/win32/shell32/folder_options.c @@ -41,6 +41,13 @@ typedef struct WCHAR szFolderPath[MAX_PATH]; }FOLDER_PROPERTIES_CONTEXT, *PFOLDER_PROPERTIES_CONTEXT; +typedef struct +{ + WCHAR FileExtension[30]; + WCHAR FileDescription[100]; + WCHAR ClassKey[MAX_PATH]; +}FOLDER_FILE_TYPE_ENTRY, *PFOLDER_FILE_TYPE_ENTRY; + typedef struct { LPCWSTR szKeyName; @@ -155,20 +162,49 @@ InitializeFileTypesListCtrlColumns(HWND hDlgCtrl) RECT clientRect; LVCOLUMNW col; WCHAR szName[50]; + DWORD dwStyle; + int columnSize = 140; + if (!LoadStringW(shell32_hInstance, IDS_COLUMN_EXTENSION, szName, sizeof(szName) / sizeof(WCHAR))) - szName[0] = 0; + { + /* default to english */ + wcscpy(szName, L"Extensions"); + } + + /* make sure its null terminated */ szName[(sizeof(szName)/sizeof(WCHAR))-1] = 0; GetClientRect(hDlgCtrl, &clientRect); ZeroMemory(&col, sizeof(LV_COLUMN)); - col.mask = LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT; - col.iSubItem = 0; - col.pszText = szName; - col.fmt = LVCFMT_LEFT; - col.cx = (clientRect.right - clientRect.left) - GetSystemMetrics(SM_CXVSCROLL); + columnSize = 140; //FIXME + col.iSubItem = 0; + col.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; + col.fmt = LVCFMT_FIXED_WIDTH; + col.cx = columnSize | LVCFMT_LEFT; + col.cchTextMax = wcslen(szName); + col.pszText = szName; (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&col); + + if (!LoadStringW(shell32_hInstance, IDS_FILE_TYPES, szName, sizeof(szName) / sizeof(WCHAR))) + { + /* default to english */ + wcscpy(szName, L"FileTypes"); + } + + col.iSubItem = 1; + col.cx = clientRect.right - clientRect.left - columnSize; + col.cchTextMax = wcslen(szName); + col.pszText = szName; + (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 1, (LPARAM)&col); + + /* set full select style */ + dwStyle = (DWORD) SendMessage(hDlgCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0); + dwStyle = dwStyle | LVS_EX_FULLROWSELECT; + SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle); + } + INT FindItem(HWND hDlgCtrl, WCHAR * ItemName) { @@ -181,45 +217,105 @@ FindItem(HWND hDlgCtrl, WCHAR * ItemName) } VOID -InsertFileType(HWND hDlgCtrl, WCHAR * szName, DWORD Size, INT iItem) +InsertFileType(HWND hDlgCtrl, WCHAR * szName, PINT iItem, WCHAR * szFile) { - WCHAR szPath[100]; + PFOLDER_FILE_TYPE_ENTRY Entry; HKEY hKey; LVITEMW lvItem; DWORD dwSize; - if (FindItem(hDlgCtrl, szName) != -1) + if (szName[0] != L'.') + { + /* FIXME handle URL protocol handlers */ + return; + } + + /* allocate file type entry */ + Entry = (PFOLDER_FILE_TYPE_ENTRY)HeapAlloc(GetProcessHeap(), 0, sizeof(FOLDER_FILE_TYPE_ENTRY)); + + if (!Entry) return; - wcscpy(szPath, szName); - /* get the name */ - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + /* open key */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szName, 0, KEY_READ, &hKey) != ERROR_SUCCESS) + return; + + /* FIXME check for duplicates */ + + /* query for the default key */ + dwSize = sizeof(Entry->ClassKey); + if (RegQueryValueExW(hKey, NULL, NULL, NULL, (LPBYTE)Entry->ClassKey, &dwSize) != ERROR_SUCCESS) { - if (RegLoadMUIStringW(hKey, L"FriendlyTypeName", szName, Size, NULL, 0, NULL) != ERROR_SUCCESS) - { - dwSize = Size; - if (RegQueryValueExW(hKey, NULL, NULL, NULL, (LPBYTE)szName, &dwSize) != ERROR_SUCCESS) - { - wcscpy(szName, szPath); - } - } - RegCloseKey(hKey); - szName[(Size/sizeof(WCHAR))-1] = 0; + /* no link available */ + Entry->ClassKey[0] = 0; + } + + if (Entry->ClassKey[0]) + { + HKEY hTemp; + /* try open linked key */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, Entry->ClassKey, 0, KEY_READ, &hTemp) == ERROR_SUCCESS) + { + /* use linked key */ + RegCloseKey(hKey); + hKey = hTemp; + } + } + + /* read friendly type name */ + if (RegLoadMUIStringW(hKey, L"FriendlyTypeName", Entry->FileDescription, sizeof(Entry->FileDescription), NULL, 0, NULL) != ERROR_SUCCESS) + { + /* read file description */ + dwSize = sizeof(Entry->FileDescription); + Entry->FileDescription[0] = 0; + + /* read default key */ + RegQueryValueExW(hKey, NULL, NULL, NULL, (LPBYTE)Entry->FileDescription, &dwSize); + } + + /* close key */ + RegCloseKey(hKey); + + /* convert extension to upper case */ + wcscpy(Entry->FileExtension, szName); + _wcsupr(Entry->FileExtension); + + if (!Entry->FileDescription[0]) + { + /* construct default 'FileExtensionFile' */ + wcscpy(Entry->FileDescription, &Entry->FileExtension[1]); + wcscat(Entry->FileDescription, L" "); + wcscat(Entry->FileDescription, szFile); } - wcscat(szPath, L"\\shell"); ZeroMemory(&lvItem, sizeof(LVITEMW)); - lvItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE; - lvItem.state = LVIS_SELECTED; - lvItem.pszText = szName; - lvItem.iItem = iItem; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iSubItem = 0; + lvItem.pszText = &Entry->FileExtension[1]; + lvItem.iItem = *iItem; + lvItem.lParam = (LPARAM)Entry; + (void)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szPath, 0, KEY_READ, &hKey) == ERROR_SUCCESS) - { - lvItem.lParam = 0; - (void)SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem); - RegCloseKey(hKey); - } + ZeroMemory(&lvItem, sizeof(LVITEMW)); + lvItem.mask = LVIF_TEXT; + lvItem.pszText = Entry->FileDescription; + lvItem.iItem = *iItem; + lvItem.iSubItem = 1; + + (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&lvItem); + (*iItem)++; +} + +int +CALLBACK +ListViewCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) +{ + PFOLDER_FILE_TYPE_ENTRY Entry1, Entry2; + + Entry1 = (PFOLDER_FILE_TYPE_ENTRY)lParam1; + Entry2 = (PFOLDER_FILE_TYPE_ENTRY)lParam2; + + return wcsicmp(Entry1->FileExtension, Entry2->FileExtension); } BOOL @@ -228,22 +324,70 @@ InitializeFileTypesListCtrl(HWND hwndDlg) HWND hDlgCtrl; DWORD dwIndex = 0; WCHAR szName[50]; + WCHAR szFile[100]; DWORD dwName; + LVITEMW lvItem; INT iItem = 0; hDlgCtrl = GetDlgItem(hwndDlg, 14000); InitializeFileTypesListCtrlColumns(hDlgCtrl); + szFile[0] = 0; + if (!LoadStringW(shell32_hInstance, IDS_SHV_COLUMN1, szFile, sizeof(szFile) / sizeof(WCHAR))) + { + /* default to english */ + wcscpy(szFile, L"File"); + } + szFile[(sizeof(szFile)/sizeof(WCHAR))-1] = 0; + dwName = sizeof(szName) / sizeof(WCHAR); while(RegEnumKeyExW(HKEY_CLASSES_ROOT, dwIndex++, szName, &dwName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - InsertFileType(hDlgCtrl, szName, sizeof(szName), iItem++); + InsertFileType(hDlgCtrl, szName, &iItem, szFile); dwName = sizeof(szName) / sizeof(WCHAR); } + + /* sort list */ + ListView_SortItems(hDlgCtrl, ListViewCompareProc, NULL); + + /* select first item */ + ZeroMemory(&lvItem, sizeof(LVITEMW)); + lvItem.mask = LVIF_STATE; + lvItem.stateMask = (UINT)-1; + lvItem.state = LVIS_FOCUSED|LVIS_SELECTED; + lvItem.iItem = 0; + (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&lvItem); + return TRUE; } +PFOLDER_FILE_TYPE_ENTRY +FindSelectedItem( + HWND hDlgCtrl) +{ + UINT Count, Index; + LVITEMW lvItem; + + Count = ListView_GetItemCount(hDlgCtrl); + + for (Index = 0; Index < Count; Index++) + { + ZeroMemory(&lvItem, sizeof(LVITEM)); + lvItem.mask = LVIF_PARAM | LVIF_STATE; + lvItem.iItem = Index; + lvItem.stateMask = (UINT)-1; + + if (ListView_GetItem(hDlgCtrl, &lvItem)) + { + if (lvItem.state & LVIS_SELECTED) + return (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; + } + } + + return NULL; +} + INT_PTR CALLBACK @@ -251,14 +395,65 @@ FolderOptionsFileTypesDlg( HWND hwndDlg, UINT uMsg, WPARAM wParam, - LPARAM lParam -) + LPARAM lParam) { + LPNMLISTVIEW lppl; + LVITEMW lvItem; + WCHAR Buffer[200], FormatBuffer[100]; + PFOLDER_FILE_TYPE_ENTRY pItem; + OPENASINFO Info; + switch(uMsg) { case WM_INITDIALOG: InitializeFileTypesListCtrl(hwndDlg); return TRUE; + case WM_COMMAND: + switch(LOWORD(wParam)) + { + case 14006: + pItem = FindSelectedItem(GetDlgItem(hwndDlg, 14000)); + if (pItem) + { + Info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT; + Info.pcszClass = pItem->FileExtension; + SHOpenWithDialog(hwndDlg, &Info); + } + break; + } + + break; + case WM_NOTIFY: + lppl = (LPNMLISTVIEW) lParam; + + if (lppl->hdr.code == LVN_ITEMCHANGING) + { + ZeroMemory(&lvItem, sizeof(LVITEM)); + lvItem.mask = LVIF_PARAM; + lvItem.iItem = lppl->iItem; + if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&lvItem)) + return TRUE; + + pItem = (PFOLDER_FILE_TYPE_ENTRY)lvItem.lParam; + if (!pItem) + return TRUE; + + if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED)) + { + /* new focused item */ + if (!LoadStringW(shell32_hInstance, IDS_FILE_DETAILS, FormatBuffer, sizeof(FormatBuffer) / sizeof(WCHAR))) + { + /* use default english format string */ + wcscpy(FormatBuffer, L"Details for '%s' extension"); + } + + /* format buffer */ + swprintf(Buffer, FormatBuffer, &pItem->FileExtension[1]); + /* update dialog */ + SendDlgItemMessageW(hwndDlg, 14003, WM_SETTEXT, 0, (LPARAM)Buffer); + } + } + break; } return FALSE; diff --git a/dll/win32/shell32/folders.c b/dll/win32/shell32/folders.c index 9b71506a5f0..d1a6c672b51 100644 --- a/dll/win32/shell32/folders.c +++ b/dll/win32/shell32/folders.c @@ -257,6 +257,7 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl) case DRIVE_CDROM: icon_idx = IDI_SHELL_CDROM; break; case DRIVE_REMOTE: icon_idx = IDI_SHELL_NETDRIVE; break; case DRIVE_RAMDISK: icon_idx = IDI_SHELL_RAMDISK; break; + case DRIVE_NO_ROOT_DIR: icon_idx = IDI_SHELL_CDROM; break; } } diff --git a/dll/win32/shell32/lang/cs-CZ.rc b/dll/win32/shell32/lang/cs-CZ.rc index 1f4fc948540..6c80a3e3ce7 100644 --- a/dll/win32/shell32/lang/cs-CZ.rc +++ b/dll/win32/shell32/lang/cs-CZ.rc @@ -1,6 +1,6 @@ /* FILE: dll/win32/shell32/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) - * UPDATED: 2010-04-05 + * UPDATED: 2010-05-06 * THANKS TO: navaraf, who translated major part of this file */ @@ -739,5 +739,5 @@ BEGIN IDS_DEFAULT_CLUSTER_SIZE "Vchoz aloka鈩 velikost" IDS_COPY_OF "Kopie " - IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file." + IDS_SHLEXEC_NOASSOC "Pro oteven tohoto souboru nen nakonfigurov疣 榱dn program." END diff --git a/dll/win32/shell32/lang/en-US.rc b/dll/win32/shell32/lang/en-US.rc index 6e8aef34ee0..04df98d1e60 100644 --- a/dll/win32/shell32/lang/en-US.rc +++ b/dll/win32/shell32/lang/en-US.rc @@ -373,6 +373,17 @@ BEGIN PUSHBUTTON "Cancel", 14006, 206, 236, 50, 14 END +IDD_SH_FILE_COPY DIALOGEX 0, 0, 264, 45 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION +CAPTION "Copying..." +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + PUSHBUTTON "Cancel", 14002, 195, 14, 60, 16 + CONTROL "", 14000, "MSCTLS_PROGRESS32", 0, 8, 20, 170, 10 + LTEXT "File", 14001, 8, 6, 169, 10 +END + + FOLDER_OPTIONS_GENERAL_DLG DIALOGEX 0, 0, 264, 256 STYLE DS_SHELLFONT | WS_POPUP | WS_CAPTION CAPTION "General" diff --git a/dll/win32/shell32/lang/it-IT.rc b/dll/win32/shell32/lang/it-IT.rc index 8372b351e75..18bafe2a6fd 100644 --- a/dll/win32/shell32/lang/it-IT.rc +++ b/dll/win32/shell32/lang/it-IT.rc @@ -753,5 +753,5 @@ BEGIN IDS_DEFAULT_CLUSTER_SIZE "Dimensione predefinita di allocazione" IDS_COPY_OF "Copia di" - IDS_SHLEXEC_NOASSOC "There is no Windows program configured to open this type of file." + IDS_SHLEXEC_NOASSOC "Non c' un programma configurato per aprire questo tipo di file." END diff --git a/dll/win32/shell32/shelllink.c b/dll/win32/shell32/shelllink.c index 2d9ef1c20ee..b2dd1cb6ff8 100644 --- a/dll/win32/shell32/shelllink.c +++ b/dll/win32/shell32/shelllink.c @@ -2672,6 +2672,9 @@ SH_ShellLinkDlgProc( case 14021: if (This->sIcoPath) wcscpy(szBuffer, This->sIcoPath); + else + wcscpy(szBuffer, This->sPath); + IconIndex = This->iIcoNdx; if (PickIconDlg(hwndDlg, szBuffer, MAX_PATH, &IconIndex)) { diff --git a/dll/win32/shell32/shfldr_cpanel.c b/dll/win32/shell32/shfldr_cpanel.c index bf8b632f8eb..c9f5b932de6 100644 --- a/dll/win32/shell32/shfldr_cpanel.c +++ b/dll/win32/shell32/shfldr_cpanel.c @@ -315,9 +315,6 @@ static PIDLCPanelStruct* _ILGetCPanelPointer(LPCITEMIDLIST pidl) return NULL; } - /************************************************************************** - * ISF_ControlPanel_fnEnumObjects - */ static BOOL SHELL_RegisterCPanelApp(IEnumIDList* list, LPCSTR path) { LPITEMIDLIST pidl; @@ -1017,8 +1014,8 @@ ExecuteAppletFromCLSID(LPOLESTR pOleStr) dwSize = sizeof(szCmd); if (RegGetValueW(HKEY_CLASSES_ROOT, szBuffer, NULL, RRF_RT_REG_SZ, &dwType, (PVOID)szCmd, &dwSize) != ERROR_SUCCESS) { - ERR("RegGetValueW failed with %u\n", GetLastError()); - return E_FAIL; + wcscpy(szCmd, L"%SystemRoot%\\Explorer.exe ::"); + wcscat(szCmd, pOleStr); } #if 0 @@ -1346,7 +1343,7 @@ static HRESULT WINAPI ICPanel_IContextMenu2_InvokeCommand( } else { - FIXME("\n"); + FIXME("Couldn't retrieve pointer to cpl structure\n"); return E_FAIL; } if (SUCCEEDED(IShellLink_Constructor(NULL, &IID_IShellLinkA, (LPVOID*)&isl))) diff --git a/dll/win32/shell32/shfldr_desktop.c b/dll/win32/shell32/shfldr_desktop.c index db810ba87c7..cdcae285023 100644 --- a/dll/win32/shell32/shfldr_desktop.c +++ b/dll/win32/shell32/shfldr_desktop.c @@ -387,6 +387,9 @@ static BOOL CreateDesktopEnumList(IEnumIDList *list, DWORD dwFlags) ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_DESKTOPDIRECTORY, FALSE); ret = ret && CreateFolderEnumList(list, szPath, dwFlags); + ret = ret && SHGetSpecialFolderPathW(0, szPath, CSIDL_COMMON_DESKTOPDIRECTORY, FALSE); + ret = ret && CreateFolderEnumList(list, szPath, dwFlags); + return ret; } @@ -739,6 +742,22 @@ static HRESULT WINAPI ISF_Desktop_fnGetDisplayNameOf (IShellFolder2 * iface, _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); if (!_ILIsFolder(pidl)) SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); + + if (GetFileAttributes(pszPath) == INVALID_FILE_ATTRIBUTES) + { + /* file system folder or file rooted at the AllUsers desktop */ + if ((GET_SHGDN_FOR(dwFlags) == SHGDN_FORPARSING) && + (GET_SHGDN_RELATION(dwFlags) != SHGDN_INFOLDER)) + { + SHGetSpecialFolderPathW(0, pszPath, CSIDL_COMMON_DESKTOPDIRECTORY, FALSE); + PathAddBackslashW(pszPath); + cLen = wcslen(pszPath); + } + + _ILSimpleGetTextW(pidl, pszPath + cLen, MAX_PATH - cLen); + if (!_ILIsFolder(pidl)) + SHELL_FS_ProcessDisplayFilename(pszPath, dwFlags); + } } } else diff --git a/dll/win32/shell32/shlfileop.c b/dll/win32/shell32/shlfileop.c index 6992d187ee4..defe95facd6 100644 --- a/dll/win32/shell32/shlfileop.c +++ b/dll/win32/shell32/shlfileop.c @@ -33,6 +33,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); #define IsDotDir(x) ((x[0] == '.') && ((x[1] == 0) || ((x[1] == '.') && (x[2] == 0)))) #define FO_MASK 0xF +#define WM_FILE (WM_USER + 1) +#define TIMER_ID (100) static const WCHAR wWildcardFile[] = {'*',0}; static const WCHAR wWildcardChars[] = {'*','?',0}; @@ -52,6 +54,40 @@ typedef struct BOOL bCancelled; } FILE_OPERATION; +#define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026 + +typedef struct +{ + DWORD attributes; + LPWSTR szDirectory; + LPWSTR szFilename; + LPWSTR szFullPath; + BOOL bFromWildcard; + BOOL bFromRelative; + BOOL bExists; +} FILE_ENTRY; + +typedef struct +{ + FILE_ENTRY *feFiles; + DWORD num_alloc; + DWORD dwNumFiles; + BOOL bAnyFromWildcard; + BOOL bAnyDirectories; + BOOL bAnyDontExist; +} FILE_LIST; + +typedef struct +{ + FILE_LIST * from; + FILE_LIST * to; + FILE_OPERATION * op; + DWORD Index; + HWND hDlgCtrl; + HWND hwndDlg; +}FILE_OPERATION_CONTEXT; + + /* Confirm dialogs with an optional "Yes To All" as used in file operations confirmations */ static const WCHAR CONFIRM_MSG_PROP[] = {'W','I','N','E','_','C','O','N','F','I','R','M',0}; @@ -514,6 +550,163 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest) return GetLastError(); } +static WINAPI DWORD SHOperationProgressRoutine(LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData) +{ + FILE_OPERATION_CONTEXT * Context; + LARGE_INTEGER Progress; + + /* get context */ + Context = (FILE_OPERATION_CONTEXT*)lpData; + + if (TotalBytesTransferred.QuadPart) + { + Progress.QuadPart = (TotalBytesTransferred.QuadPart * 100) / TotalFileSize.QuadPart; + } + else + { + Progress.QuadPart = 1; + } + + /* update progress bar */ + SendMessageW(Context->hDlgCtrl, PBM_SETPOS, (WPARAM)Progress.u.LowPart, 0); + + if (TotalBytesTransferred.QuadPart == TotalFileSize.QuadPart) + { + /* file was copied */ + Context->Index++; + PostMessageW(Context->hwndDlg, WM_FILE, 0, 0); + } + + return PROGRESS_CONTINUE; +} + +BOOL +QueueFile( + FILE_OPERATION_CONTEXT * Context) +{ + FILE_ENTRY * from, *to; + BOOL bRet = FALSE; + + if (Context->Index >= Context->from->dwNumFiles) + return FALSE; + + /* get current file */ + from = &Context->from->feFiles[Context->Index]; + + if (Context->op->req->fFlags != FO_DELETE) + to = &Context->to->feFiles[Context->Index]; + + /* update status */ + SendDlgItemMessageW(Context->hwndDlg, 14001, WM_SETTEXT, 0, (LPARAM)from->szFullPath); + + if (Context->op->req->wFunc == FO_COPY) + { + bRet = CopyFileExW(from->szFullPath, to->szFullPath, SHOperationProgressRoutine, (LPVOID)Context, &Context->op->bCancelled, 0); + } + else if (Context->op->req->wFunc == FO_MOVE) + { + //bRet = MoveFileWithProgressW(from->szFullPath, to->szFullPath, SHOperationProgressRoutine, (LPVOID)Context, MOVEFILE_COPY_ALLOWED); + } + else if (Context->op->req->wFunc == FO_DELETE) + { + bRet = DeleteFile(from->szFullPath); + } + + return bRet; +} + +static INT_PTR CALLBACK SHOperationDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + FILE_OPERATION_CONTEXT * Context; + + Context = (FILE_OPERATION_CONTEXT*) GetWindowLongPtr(hwndDlg, DWLP_USER); + + switch(uMsg) + { + case WM_INITDIALOG: + SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG)lParam); + + /* get context */ + Context = (FILE_OPERATION_CONTEXT*)lParam; + + /* store progress bar handle */ + Context->hDlgCtrl = GetDlgItem(hwndDlg, 14000); + + /* store window handle */ + Context->hwndDlg = hwndDlg; + + /* set progress bar range */ + (void)SendMessageW(Context->hDlgCtrl, (UINT) PBM_SETRANGE, 0, MAKELPARAM(0, 100)); + + /* start file queueing */ + SetTimer(hwndDlg, TIMER_ID, 1000, NULL); + //QueueFile(Context); + + return TRUE; + + case WM_CLOSE: + Context->op->bCancelled = TRUE; + EndDialog(hwndDlg, Context->op->bCancelled); + return TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == 14002) + { + Context->op->bCancelled = TRUE; + EndDialog(hwndDlg, Context->op->bCancelled); + return TRUE; + } + break; + case WM_TIMER: + if (wParam == TIMER_ID) + { + QueueFile(Context); + KillTimer(hwndDlg, TIMER_ID); + } + break; + case WM_FILE: + if (!QueueFile(Context)) + EndDialog(hwndDlg, Context->op->bCancelled); + default: + break; + } + return FALSE; +} + +HRESULT +SHShowFileOperationDialog(FILE_OPERATION *op, FILE_LIST *flFrom, FILE_LIST *flTo) +{ + HWND hwnd; + BOOL bRet; + MSG msg; + FILE_OPERATION_CONTEXT Context; + + Context.from = flFrom; + Context.to = flTo; + Context.op = op; + Context.Index = 0; + Context.op->bCancelled = FALSE; + + hwnd = CreateDialogParam(shell32_hInstance, MAKEINTRESOURCE(IDD_SH_FILE_COPY), NULL, SHOperationDialog, (LPARAM)&Context); + if (hwnd == NULL) + { + ERR("Failed to create dialog\n"); + return E_FAIL; + } + ShowWindow(hwnd, SW_SHOWNORMAL); + + while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) + { + if (!IsWindow(hwnd) || !IsDialogMessage(hwnd, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return NOERROR; +} + + /************************************************************************ * SHNotifyCopyFile [internal] * @@ -808,28 +1001,7 @@ int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp) return retCode; } -#define ERROR_SHELL_INTERNAL_FILE_NOT_FOUND 1026 -typedef struct -{ - DWORD attributes; - LPWSTR szDirectory; - LPWSTR szFilename; - LPWSTR szFullPath; - BOOL bFromWildcard; - BOOL bFromRelative; - BOOL bExists; -} FILE_ENTRY; - -typedef struct -{ - FILE_ENTRY *feFiles; - DWORD num_alloc; - DWORD dwNumFiles; - BOOL bAnyFromWildcard; - BOOL bAnyDirectories; - BOOL bAnyDontExist; -} FILE_LIST; static void __inline grow_list(FILE_LIST *list) diff --git a/dll/win32/shell32/shlview.c b/dll/win32/shell32/shlview.c index ef7f587f7c1..c1030254bea 100644 --- a/dll/win32/shell32/shlview.c +++ b/dll/win32/shell32/shlview.c @@ -1511,6 +1511,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn msg.pt = 0;*/ LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh; + SHORT ctrl = GetKeyState(VK_CONTROL) & 0x8000; /* initiate a rename of the selected file or directory */ if(plvKeyDown->wVKey == VK_F2) @@ -1591,6 +1592,14 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn IShellBrowser_BrowseObject(lpSb, NULL, SBSP_PARENT); } } + else if(plvKeyDown->wVKey == 'C' && ctrl) + { + FIXME("Need to copy\n"); + } + else if(plvKeyDown->wVKey == 'V' && ctrl) + { + FIXME("Need to paste\n"); + } else FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey); } diff --git a/dll/win32/shell32/shresdef.h b/dll/win32/shell32/shresdef.h index 981e17ff9ce..43e409cbf44 100644 --- a/dll/win32/shell32/shresdef.h +++ b/dll/win32/shell32/shresdef.h @@ -139,6 +139,8 @@ #define IDS_SYS_FILE 171 #define IDS_EMPTY_BITBUCKET 172 #define IDS_SHLEXEC_NOASSOC 173 +#define IDS_FILE_TYPES 174 +#define IDS_FILE_DETAILS 175 #define IDS_OPEN_VERB 300 #define IDS_RUNAS_VERB 301 @@ -191,6 +193,7 @@ #define IDD_TREEVIEW 0x3741 #define SHELL_EXTENDED_SHORTCUT_DLG 0x4000 #define OPEN_WITH_PROGRAMM_DLG 0x4001 +#define IDD_SH_FILE_COPY 0x4002 /* ID's of the ShellAbout controls */ // Part 1 - ID's identical to Windows Server 2003 SP1's shell32.dll diff --git a/dll/win32/shlwapi/ordinal.c b/dll/win32/shlwapi/ordinal.c index 364bbfe8af8..332bdb67f79 100644 --- a/dll/win32/shlwapi/ordinal.c +++ b/dll/win32/shlwapi/ordinal.c @@ -42,6 +42,7 @@ #include "mmsystem.h" #include "objbase.h" #include "exdisp.h" +#include "shdeprecated.h" #include "shlobj.h" #include "shlwapi.h" #include "shellapi.h" @@ -309,24 +310,22 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) BSTR property; IEnumFORMATETC* pIEnumFormatEtc = NULL; VARIANTARG var; - HRESULT hRet; - IWebBrowserApp* pBrowser = NULL; + HRESULT hr; + IWebBrowserApp* pBrowser; TRACE("(%p, %p)\n", lpBC, lpUnknown); - /* Get An IWebBrowserApp interface from lpUnknown */ - hRet = IUnknown_QueryService(lpUnknown, &IID_IWebBrowserApp, &IID_IWebBrowserApp, (PVOID)&pBrowser); - if (FAILED(hRet) || !pBrowser) - return E_NOINTERFACE; + hr = IUnknown_QueryService(lpUnknown, &IID_IWebBrowserApp, &IID_IWebBrowserApp, (void**)&pBrowser); + if (FAILED(hr)) + return hr; V_VT(&var) = VT_EMPTY; /* The property we get is the browsers clipboard enumerator */ property = SysAllocString(szProperty); - hRet = IWebBrowserApp_GetProperty(pBrowser, property, &var); + hr = IWebBrowserApp_GetProperty(pBrowser, property, &var); SysFreeString(property); - if (FAILED(hRet)) - return hRet; + if (FAILED(hr)) goto exit; if (V_VT(&var) == VT_EMPTY) { @@ -340,7 +339,10 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) if (!RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\Current" "Version\\Internet Settings\\Accepted Documents", &hDocs)) - return E_FAIL; + { + hr = E_FAIL; + goto exit; + } /* Get count of values in key */ while (!dwRet) @@ -355,7 +357,11 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) /* Note: dwCount = number of items + 1; The extra item is the end node */ format = formatList = HeapAlloc(GetProcessHeap(), 0, dwCount * sizeof(FORMATETC)); if (!formatList) - return E_OUTOFMEMORY; + { + RegCloseKey(hDocs); + hr = E_OUTOFMEMORY; + goto exit; + } if (dwNumValues > 1) { @@ -372,7 +378,12 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) dwRet = RegEnumValueA(hDocs, dwCount, szKeyBuff, &dwKeySize, 0, &dwType, (PBYTE)szValueBuff, &dwValueSize); if (!dwRet) - return E_FAIL; + { + HeapFree(GetProcessHeap(), 0, formatList); + RegCloseKey(hDocs); + hr = E_FAIL; + goto exit; + } format->cfFormat = RegisterClipboardFormatA(szValueBuff); format->ptd = NULL; @@ -385,6 +396,8 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) } } + RegCloseKey(hDocs); + /* Terminate the (maybe empty) list, last entry has a cfFormat of 0 */ format->cfFormat = 0; format->ptd = NULL; @@ -393,22 +406,21 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) format->tymed = -1; /* Create a clipboard enumerator */ - hRet = CreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc); - - if (FAILED(hRet) || !pIEnumFormatEtc) - return hRet; + hr = CreateFormatEnumerator(dwNumValues, formatList, &pIEnumFormatEtc); + HeapFree(GetProcessHeap(), 0, formatList); + if (FAILED(hr)) goto exit; /* Set our enumerator as the browsers property */ V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)pIEnumFormatEtc; property = SysAllocString(szProperty); - hRet = IWebBrowserApp_PutProperty(pBrowser, property, var); + hr = IWebBrowserApp_PutProperty(pBrowser, property, var); SysFreeString(property); - if (FAILED(hRet)) + if (FAILED(hr)) { IEnumFORMATETC_Release(pIEnumFormatEtc); - goto RegisterDefaultAcceptHeaders_Exit; + goto exit; } } @@ -422,28 +434,26 @@ HRESULT WINAPI RegisterDefaultAcceptHeaders(LPBC lpBC, IUnknown *lpUnknown) /* Get an IEnumFormatEtc interface from the variants value */ pIEnumFormatEtc = NULL; - hRet = IUnknown_QueryInterface(pIUnknown, &IID_IEnumFORMATETC, - (PVOID)&pIEnumFormatEtc); - if (hRet == S_OK && pIEnumFormatEtc) + hr = IUnknown_QueryInterface(pIUnknown, &IID_IEnumFORMATETC, (void**)&pIEnumFormatEtc); + if (hr == S_OK && pIEnumFormatEtc) { /* Clone and register the enumerator */ - hRet = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone); - if (hRet == S_OK && pClone) + hr = IEnumFORMATETC_Clone(pIEnumFormatEtc, &pClone); + if (hr == S_OK && pClone) { RegisterFormatEnumerator(lpBC, pClone, 0); IEnumFORMATETC_Release(pClone); } - /* Release the IEnumFormatEtc interface */ IEnumFORMATETC_Release(pIUnknown); } IUnknown_Release(V_UNKNOWN(&var)); } -RegisterDefaultAcceptHeaders_Exit: +exit: IWebBrowserApp_Release(pBrowser); - return hRet; + return hr; } /************************************************************************* @@ -500,7 +510,7 @@ HRESULT WINAPI GetAcceptLanguagesW( LPWSTR langbuf, LPDWORD buflen) return S_OK; } - /* Did not find a value in the registry or the user buffer is to small */ + /* Did not find a value in the registry or the user buffer is too small */ mylcid = GetUserDefaultLCID(); retval = LcidToRfc1766W(mylcid, mystr, mystrlen); len = lstrlenW(mystr); @@ -1201,7 +1211,7 @@ HRESULT WINAPI ConnectToConnectionPoint(IUnknown* lpUnkSink, REFIID riid, BOOL f /************************************************************************* * @ [SHLWAPI.169] * - * Release an interface. + * Release an interface and zero a supplied pointer. * * PARAMS * lpUnknown [I] Object to release @@ -1209,19 +1219,16 @@ HRESULT WINAPI ConnectToConnectionPoint(IUnknown* lpUnkSink, REFIID riid, BOOL f * RETURNS * Nothing. */ -DWORD WINAPI IUnknown_AtomicRelease(IUnknown ** lpUnknown) +void WINAPI IUnknown_AtomicRelease(IUnknown ** lpUnknown) { - IUnknown *temp; + TRACE("(%p)\n", lpUnknown); - TRACE("(%p)\n",lpUnknown); - - if(!lpUnknown || !*((LPDWORD)lpUnknown)) return 0; - temp = *lpUnknown; - *lpUnknown = NULL; + if(!lpUnknown || !*lpUnknown) return; TRACE("doing Release\n"); - return IUnknown_Release(temp); + IUnknown_Release(*lpUnknown); + *lpUnknown = NULL; } /************************************************************************* @@ -1258,9 +1265,10 @@ LPCSTR WINAPI PathSkipLeadingSlashesA(LPCSTR lpszSrc) */ BOOL WINAPI SHIsSameObject(IUnknown* lpInt1, IUnknown* lpInt2) { - LPVOID lpUnknown1, lpUnknown2; + IUnknown *lpUnknown1, *lpUnknown2; + BOOL ret; - TRACE("%p %p\n", lpInt1, lpInt2); + TRACE("(%p %p)\n", lpInt1, lpInt2); if (!lpInt1 || !lpInt2) return FALSE; @@ -1268,16 +1276,21 @@ BOOL WINAPI SHIsSameObject(IUnknown* lpInt1, IUnknown* lpInt2) if (lpInt1 == lpInt2) return TRUE; - if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown, &lpUnknown1))) + if (IUnknown_QueryInterface(lpInt1, &IID_IUnknown, (void**)&lpUnknown1) != S_OK) return FALSE; - if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown, &lpUnknown2))) + if (IUnknown_QueryInterface(lpInt2, &IID_IUnknown, (void**)&lpUnknown2) != S_OK) + { + IUnknown_Release(lpUnknown1); return FALSE; + } - if (lpUnknown1 == lpUnknown2) - return TRUE; + ret = lpUnknown1 == lpUnknown2; - return FALSE; + IUnknown_Release(lpUnknown1); + IUnknown_Release(lpUnknown2); + + return ret; } /************************************************************************* @@ -1337,36 +1350,32 @@ HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd) /************************************************************************* * @ [SHLWAPI.173] * - * Call a method on as as yet unidentified object. + * Call a SetOwner method of IShellService from specified object. * * PARAMS - * pUnk [I] Object supporting the unidentified interface, - * arg [I] Argument for the call on the object. + * iface [I] Object that supports IShellService + * pUnk [I] Argument for the SetOwner call * * RETURNS - * S_OK. + * Corresponding return value from last call or E_FAIL for null input */ -HRESULT WINAPI IUnknown_SetOwner(IUnknown *pUnk, ULONG arg) +HRESULT WINAPI IUnknown_SetOwner(IUnknown *iface, IUnknown *pUnk) { - static const GUID guid_173 = { - 0x5836fb00, 0x8187, 0x11cf, { 0xa1,0x2b,0x00,0xaa,0x00,0x4a,0xe8,0x37 } - }; - IMalloc *pUnk2; + IShellService *service; + HRESULT hr; - TRACE("(%p,%d)\n", pUnk, arg); + TRACE("(%p, %p)\n", iface, pUnk); - /* Note: arg may not be a ULONG and pUnk2 is for sure not an IMalloc - - * We use this interface as its vtable entry is compatible with the - * object in question. - * FIXME: Find out what this object is and where it should be defined. - */ - if (pUnk && - SUCCEEDED(IUnknown_QueryInterface(pUnk, &guid_173, (void**)&pUnk2))) + if (!iface) return E_FAIL; + + hr = IUnknown_QueryInterface(iface, &IID_IShellService, (void**)&service); + if (hr == S_OK) { - IMalloc_Alloc(pUnk2, arg); /* Faked call!! */ - IMalloc_Release(pUnk2); + hr = IShellService_SetOwner(service, pUnk); + IShellService_Release(service); } - return S_OK; + + return hr; } /************************************************************************* @@ -1473,7 +1482,6 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri if (!lpUnknown) return E_FAIL; - /* Get an IServiceProvider interface from the object */ hRet = IUnknown_QueryInterface(lpUnknown, &IID_IServiceProvider, (LPVOID*)&pService); @@ -1486,12 +1494,92 @@ HRESULT WINAPI IUnknown_QueryService(IUnknown* lpUnknown, REFGUID sid, REFIID ri TRACE("(IServiceProvider*)%p returned (IUnknown*)%p\n", pService, *lppOut); - /* Release the IServiceProvider interface */ IUnknown_Release(pService); } return hRet; } +/************************************************************************* + * @ [SHLWAPI.484] + * + * Calls IOleCommandTarget::Exec() for specified service object. + * + * PARAMS + * lpUnknown [I] Object to get an IServiceProvider interface from + * service [I] Service ID for IServiceProvider_QueryService() call + * group [I] Group ID for IOleCommandTarget::Exec() call + * cmdId [I] Command ID for IOleCommandTarget::Exec() call + * cmdOpt [I] Options flags for command + * pIn [I] Input arguments for command + * pOut [O] Output arguments for command + * + * RETURNS + * Success: S_OK. lppOut contains an object providing the requested service + * Failure: An HRESULT error code + * + * NOTES + * lpUnknown is expected to support the IServiceProvider interface. + */ +HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *lpUnknown, REFIID service, + const GUID *group, DWORD cmdId, DWORD cmdOpt, VARIANT *pIn, VARIANT *pOut) +{ + IOleCommandTarget *target; + HRESULT hr; + + TRACE("%p %s %s %d %08x %p %p\n", lpUnknown, debugstr_guid(service), + debugstr_guid(group), cmdId, cmdOpt, pIn, pOut); + + hr = IUnknown_QueryService(lpUnknown, service, &IID_IOleCommandTarget, (void**)&target); + if (hr == S_OK) + { + hr = IOleCommandTarget_Exec(target, group, cmdId, cmdOpt, pIn, pOut); + IOleCommandTarget_Release(target); + } + + TRACE("<-- hr=0x%08x\n", hr); + + return hr; +} + +/************************************************************************* + * @ [SHLWAPI.514] + * + * Calls IProfferService methods to proffer/revoke specified service. + * + * PARAMS + * lpUnknown [I] Object to get an IServiceProvider interface from + * service [I] Service ID for IProfferService::Proffer/Revoke calls + * pService [I] Service to proffer. If NULL ::Revoke is called + * pCookie [IO] Group ID for IOleCommandTarget::Exec() call + * + * RETURNS + * Success: S_OK. IProffer method returns S_OK + * Failure: An HRESULT error code + * + * NOTES + * lpUnknown is expected to support the IServiceProvider interface. + */ +HRESULT WINAPI IUnknown_ProfferService(IUnknown *lpUnknown, REFGUID service, IServiceProvider *pService, DWORD *pCookie) +{ + IProfferService *proffer; + HRESULT hr; + + TRACE("%p %s %p %p\n", lpUnknown, debugstr_guid(service), pService, pCookie); + + hr = IUnknown_QueryService(lpUnknown, &IID_IProfferService, &IID_IProfferService, (void**)&proffer); + if (hr == S_OK) + { + if (pService) + hr = IProfferService_ProfferService(proffer, service, pService, pCookie); + else + hr = IProfferService_RevokeService(proffer, *pCookie); + + IProfferService_Release(proffer); + } + + return hr; +} + /************************************************************************* * @ [SHLWAPI.479] * @@ -1546,6 +1634,8 @@ BOOL WINAPI SHLoadMenuPopup(HINSTANCE hInst, LPCWSTR szName) { HMENU hMenu; + TRACE("%p %s\n", hInst, debugstr_w(szName)); + if ((hMenu = LoadMenuW(hInst, szName))) { if (GetSubMenu(hMenu, 0)) @@ -1629,6 +1719,9 @@ void WINAPI SHPropagateMessage(HWND hWnd, UINT uiMsgId, WPARAM wParam, LPARAM lP DWORD WINAPI SHRemoveAllSubMenus(HMENU hMenu) { int iItemCount = GetMenuItemCount(hMenu) - 1; + + TRACE("%p\n", hMenu); + while (iItemCount >= 0) { HMENU hSubMenu = GetSubMenu(hMenu, iItemCount); @@ -1654,6 +1747,7 @@ DWORD WINAPI SHRemoveAllSubMenus(HMENU hMenu) */ UINT WINAPI SHEnableMenuItem(HMENU hMenu, UINT wItemID, BOOL bEnable) { + TRACE("%p, %u, %d\n", hMenu, wItemID, bEnable); return EnableMenuItem(hMenu, wItemID, bEnable ? MF_ENABLED : MF_GRAYED); } @@ -1672,6 +1766,7 @@ UINT WINAPI SHEnableMenuItem(HMENU hMenu, UINT wItemID, BOOL bEnable) */ DWORD WINAPI SHCheckMenuItem(HMENU hMenu, UINT uID, BOOL bCheck) { + TRACE("%p, %u, %d\n", hMenu, uID, bCheck); return CheckMenuItem(hMenu, uID, bCheck ? MF_CHECKED : MF_UNCHECKED); } @@ -1703,6 +1798,8 @@ BOOL WINAPI SHSimulateDrop(IDropTarget *pDrop, IDataObject *pDataObj, DWORD dwEffect = DROPEFFECT_LINK | DROPEFFECT_MOVE | DROPEFFECT_COPY; POINTL pt = { 0, 0 }; + TRACE("%p %p 0x%08x %p %p\n", pDrop, pDataObj, grfKeyState, lpPt, pdwEffect); + if (!lpPt) lpPt = &pt; @@ -1711,7 +1808,7 @@ BOOL WINAPI SHSimulateDrop(IDropTarget *pDrop, IDataObject *pDataObj, IDropTarget_DragEnter(pDrop, pDataObj, grfKeyState, *lpPt, pdwEffect); - if (*pdwEffect) + if (*pdwEffect != DROPEFFECT_NONE) return IDropTarget_Drop(pDrop, pDataObj, grfKeyState, *lpPt, pdwEffect); IDropTarget_DragLeave(pDrop); @@ -1803,7 +1900,7 @@ HRESULT WINAPI IUnknown_OnFocusOCS(IUnknown *lpUnknown, BOOL fGotFocus) IOleControlSite* lpCSite = NULL; HRESULT hRet = E_FAIL; - TRACE("(%p,%s)\n", lpUnknown, fGotFocus ? "TRUE" : "FALSE"); + TRACE("(%p, %d)\n", lpUnknown, fGotFocus); if (lpUnknown) { hRet = IUnknown_QueryInterface(lpUnknown, &IID_IOleControlSite, @@ -2061,12 +2158,10 @@ VOID WINAPI IUnknown_Set(IUnknown **lppDest, IUnknown *lpUnknown) { TRACE("(%p,%p)\n", lppDest, lpUnknown); - if (lppDest) - IUnknown_AtomicRelease(lppDest); /* Release existing interface */ + IUnknown_AtomicRelease(lppDest); if (lpUnknown) { - /* Copy */ IUnknown_AddRef(lpUnknown); *lppDest = lpUnknown; } @@ -2256,12 +2351,6 @@ BOOL WINAPI FDSA_DeleteItem(FDSA_info *info, DWORD where) return TRUE; } - -typedef struct { - REFIID refid; - DWORD indx; -} IFACE_INDEX_TBL; - /************************************************************************* * @ [SHLWAPI.219] * @@ -2272,22 +2361,22 @@ typedef struct { * Failure: E_POINTER or E_NOINTERFACE. */ HRESULT WINAPI QISearch( - LPVOID w, /* [in] Table of interfaces */ - IFACE_INDEX_TBL *x, /* [in] Array of REFIIDs and indexes into the table */ + void *base, /* [in] Table of interfaces */ + const QITAB *table, /* [in] Array of REFIIDs and indexes into the table */ REFIID riid, /* [in] REFIID to get interface for */ - LPVOID *ppv) /* [out] Destination for interface pointer */ + void **ppv) /* [out] Destination for interface pointer */ { HRESULT ret; IUnknown *a_vtbl; - IFACE_INDEX_TBL *xmove; + const QITAB *xmove; - TRACE("(%p %p %s %p)\n", w,x,debugstr_guid(riid),ppv); + TRACE("(%p %p %s %p)\n", base, table, debugstr_guid(riid), ppv); if (ppv) { - xmove = x; - while (xmove->refid) { - TRACE("trying (indx %d) %s\n", xmove->indx, debugstr_guid(xmove->refid)); - if (IsEqualIID(riid, xmove->refid)) { - a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w); + xmove = table; + while (xmove->piid) { + TRACE("trying (offset %d) %s\n", xmove->dwOffset, debugstr_guid(xmove->piid)); + if (IsEqualIID(riid, xmove->piid)) { + a_vtbl = (IUnknown*)(xmove->dwOffset + (LPBYTE)base); TRACE("matched, returning (%p)\n", a_vtbl); *ppv = a_vtbl; IUnknown_AddRef(a_vtbl); @@ -2297,7 +2386,7 @@ HRESULT WINAPI QISearch( } if (IsEqualIID(riid, &IID_IUnknown)) { - a_vtbl = (IUnknown*)(x->indx + (LPBYTE)w); + a_vtbl = (IUnknown*)(table->dwOffset + (LPBYTE)base); TRACE("returning first for IUnknown (%p)\n", a_vtbl); *ppv = a_vtbl; IUnknown_AddRef(a_vtbl); @@ -2506,27 +2595,27 @@ HRESULT WINAPI IUnknown_GetSite(LPUNKNOWN lpUnknown, REFIID iid, PVOID *lppSite) * dwExStyle [I] Extra style flags * dwStyle [I] Style flags * hMenu [I] Window menu - * z [I] Unknown + * wnd_extra [I] Window extra bytes value * * RETURNS * Success: The window handle of the newly created window. * Failure: 0. */ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle, - DWORD dwStyle, HMENU hMenu, LONG z) + DWORD dwStyle, HMENU hMenu, LONG_PTR wnd_extra) { static const char szClass[] = "WorkerA"; WNDCLASSA wc; HWND hWnd; - TRACE("(0x%08x,%p,0x%08x,0x%08x,%p,0x%08x)\n", - wndProc, hWndParent, dwExStyle, dwStyle, hMenu, z); + TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08lx)\n", + wndProc, hWndParent, dwExStyle, dwStyle, hMenu, wnd_extra); /* Create Window class */ wc.style = 0; wc.lpfnWndProc = DefWindowProcA; wc.cbClsExtra = 0; - wc.cbWndExtra = 4; + wc.cbWndExtra = sizeof(LONG_PTR); wc.hInstance = shlwapi_hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW); @@ -2534,19 +2623,17 @@ HWND WINAPI SHCreateWorkerWindowA(LONG wndProc, HWND hWndParent, DWORD dwExStyle wc.lpszMenuName = NULL; wc.lpszClassName = szClass; - SHRegisterClassA(&wc); /* Register class */ - - /* FIXME: Set extra bits in dwExStyle */ + SHRegisterClassA(&wc); hWnd = CreateWindowExA(dwExStyle, szClass, 0, dwStyle, 0, 0, 0, 0, hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, z); + SetWindowLongPtrW(hWnd, 0, wnd_extra); - if (wndProc) - SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc); + if (wndProc) SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc); } + return hWnd; } @@ -2729,7 +2816,7 @@ BOOL WINAPI GUIDFromStringA(LPCSTR idstr, CLSID *id) */ BOOL WINAPI GUIDFromStringW(LPCWSTR idstr, CLSID *id) { - return SUCCEEDED(CLSIDFromString((LPOLESTR)idstr, id)); + return SUCCEEDED(CLSIDFromString((LPCOLESTR)idstr, id)); } /************************************************************************* @@ -2804,18 +2891,21 @@ DWORD WINAPI WhichPlatform(void) * Unicode version of SHCreateWorkerWindowA. */ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle, - DWORD dwStyle, HMENU hMenu, LONG z) + DWORD dwStyle, HMENU hMenu, LONG msg_result) { - static const WCHAR szClass[] = { 'W', 'o', 'r', 'k', 'e', 'r', 'W', '\0' }; + static const WCHAR szClass[] = { 'W', 'o', 'r', 'k', 'e', 'r', 'W', 0 }; WNDCLASSW wc; HWND hWnd; - TRACE("(0x%08x,%p,0x%08x,0x%08x,%p,0x%08x)\n", - wndProc, hWndParent, dwExStyle, dwStyle, hMenu, z); + TRACE("(0x%08x, %p, 0x%08x, 0x%08x, %p, 0x%08x)\n", + wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result); - /* If our OS is natively ASCII, use the ASCII version */ - if (!(GetVersion() & 0x80000000)) /* NT */ - return SHCreateWorkerWindowA(wndProc, hWndParent, dwExStyle, dwStyle, hMenu, z); + /* If our OS is natively ANSI, use the ANSI version */ + if (GetVersion() & 0x80000000) /* not NT */ + { + TRACE("fallback to ANSI, ver 0x%08x\n", GetVersion()); + return SHCreateWorkerWindowA(wndProc, hWndParent, dwExStyle, dwStyle, hMenu, msg_result); + } /* Create Window class */ wc.style = 0; @@ -2829,19 +2919,17 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle wc.lpszMenuName = NULL; wc.lpszClassName = szClass; - SHRegisterClassW(&wc); /* Register class */ - - /* FIXME: Set extra bits in dwExStyle */ + SHRegisterClassW(&wc); hWnd = CreateWindowExW(dwExStyle, szClass, 0, dwStyle, 0, 0, 0, 0, hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, z); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, msg_result); - if (wndProc) - SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc); + if (wndProc) SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc); } + return hWnd; } @@ -2861,7 +2949,8 @@ HWND WINAPI SHCreateWorkerWindowW(LONG wndProc, HWND hWndParent, DWORD dwExStyle */ HRESULT WINAPI SHInvokeDefaultCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST lpApidl) { - return SHInvokeCommand(hWnd, lpFolder, lpApidl, FALSE); + TRACE("%p %p %p\n", hWnd, lpFolder, lpApidl); + return SHInvokeCommand(hWnd, lpFolder, lpApidl, FALSE); } /************************************************************************* @@ -3376,12 +3465,12 @@ UINT WINAPI SHDefExtractIconWrapW(LPCWSTR pszIconFile, int iIndex, UINT uFlags, HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST lpApidl, BOOL bInvokeDefault) { IContextMenu *iContext; - HRESULT hRet = E_FAIL; + HRESULT hRet; - TRACE("(%p,%p,%p,%d)\n", hWnd, lpFolder, lpApidl, bInvokeDefault); + TRACE("(%p, %p, %p, %d)\n", hWnd, lpFolder, lpApidl, bInvokeDefault); if (!lpFolder) - return hRet; + return E_FAIL; /* Get the context menu from the shell folder */ hRet = IShellFolder_GetUIObjectOf(lpFolder, hWnd, 1, &lpApidl, @@ -3401,7 +3490,7 @@ HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST if (SUCCEEDED(hQuery)) { if (bInvokeDefault && - (dwDefaultId = GetMenuDefaultItem(hMenu, 0, 0)) != 0xFFFFFFFF) + (dwDefaultId = GetMenuDefaultItem(hMenu, 0, 0)) != (UINT)-1) { CMINVOKECOMMANDINFO cmIci; /* Invoke the default item */ @@ -3810,7 +3899,7 @@ DWORD WINAPI SHSendMessageBroadcastW(UINT uMsg, WPARAM wParam, LPARAM lParam) */ HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR idstr, CLSID *id) { - return CLSIDFromString((LPOLESTR)idstr, id); + return CLSIDFromString((LPCOLESTR)idstr, id); } /************************************************************************* @@ -4171,18 +4260,24 @@ BOOL WINAPI SHIsLowMemoryMachine (DWORD x) */ INT WINAPI GetMenuPosFromID(HMENU hMenu, UINT wID) { - MENUITEMINFOW mi; - INT nCount = GetMenuItemCount(hMenu), nIter = 0; + MENUITEMINFOW mi; + INT nCount = GetMenuItemCount(hMenu), nIter = 0; - while (nIter < nCount) - { - mi.cbSize = sizeof(mi); - mi.fMask = MIIM_ID; - if (GetMenuItemInfoW(hMenu, nIter, TRUE, &mi) && mi.wID == wID) - return nIter; - nIter++; - } - return -1; + TRACE("%p %u\n", hMenu, wID); + + while (nIter < nCount) + { + mi.cbSize = sizeof(mi); + mi.fMask = MIIM_ID; + if (GetMenuItemInfoW(hMenu, nIter, TRUE, &mi) && mi.wID == wID) + { + TRACE("ret %d\n", nIter); + return nIter; + } + nIter++; + } + + return -1; } /************************************************************************* @@ -4192,6 +4287,7 @@ INT WINAPI GetMenuPosFromID(HMENU hMenu, UINT wID) */ DWORD WINAPI SHMenuIndexFromID(HMENU hMenu, UINT uID) { + TRACE("%p %u\n", hMenu, uID); return GetMenuPosFromID(hMenu, uID); } @@ -4270,10 +4366,10 @@ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid) /*********************************************************************** * SHGetShellKey (SHLWAPI.@) */ -DWORD WINAPI SHGetShellKey(DWORD a, DWORD b, DWORD c) +HKEY WINAPI SHGetShellKey(DWORD flags, LPCWSTR sub_key, BOOL create) { - FIXME("(%x, %x, %x): stub\n", a, b, c); - return 0x50; + FIXME("(0x%08x, %s, %d): stub\n", flags, debugstr_w(sub_key), create); + return (HKEY)0x50; } /*********************************************************************** @@ -4422,20 +4518,6 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText, return ret; } -HRESULT WINAPI IUnknown_QueryServiceExec(IUnknown *unk, REFIID service, REFIID clsid, - DWORD x1, DWORD x2, DWORD x3, void **ppvOut) -{ - FIXME("%p %s %s %08x %08x %08x %p\n", unk, - debugstr_guid(service), debugstr_guid(clsid), x1, x2, x3, ppvOut); - return E_NOTIMPL; -} - -HRESULT WINAPI IUnknown_ProfferService(IUnknown *unk, void *x0, void *x1, void *x2) -{ - FIXME("%p %p %p %p\n", unk, x0, x1, x2); - return E_NOTIMPL; -} - /*********************************************************************** * ZoneComputePaneSize [SHLWAPI.382] */ diff --git a/dll/win32/shlwapi/shlwapi.spec b/dll/win32/shlwapi/shlwapi.spec index d899232f9c5..367046b5ebc 100644 --- a/dll/win32/shlwapi/shlwapi.spec +++ b/dll/win32/shlwapi/shlwapi.spec @@ -216,7 +216,7 @@ 216 stdcall -noname SHAnsiToUnicodeCP(long str ptr long) 217 stdcall -noname SHUnicodeToAnsi(wstr ptr ptr) 218 stdcall -noname SHUnicodeToAnsiCP(long wstr ptr long) -219 stdcall -noname QISearch(long long long long) +219 stdcall QISearch(long long long long) 220 stdcall -noname SHSetDefaultDialogFont(ptr long) 221 stdcall -noname SHRemoveDefaultDialogFont(ptr) 222 stdcall -noname SHGlobalCounterCreate(long) diff --git a/dll/win32/shlwapi/url.c b/dll/win32/shlwapi/url.c index 958a8429f53..cd83b457178 100644 --- a/dll/win32/shlwapi/url.c +++ b/dll/win32/shlwapi/url.c @@ -278,7 +278,8 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, { HRESULT hr = S_OK; DWORD EscapeFlags; - LPWSTR lpszUrlCpy, wk1, wk2, mp, mp2, root; + LPCWSTR wk1, root; + LPWSTR lpszUrlCpy, wk2, mp, mp2; INT state; DWORD nByteLen, nLen, nWkLen; WCHAR slash = '/'; @@ -322,7 +323,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized, * 6 have location (found /) save root location */ - wk1 = (LPWSTR)pszUrl; + wk1 = pszUrl; wk2 = lpszUrlCpy; state = 0; @@ -662,7 +663,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, } } - /* If there is a '#' and the characters immediately preceeding it are + /* If there is a '#' and the characters immediately preceding it are * ".htm[l]", then begin looking for the last leaf starting from * the '#'. Otherwise the '#' is not meaningful and just start * looking from the end. */ @@ -1718,6 +1719,9 @@ BOOL WINAPI UrlIsA(LPCSTR pszUrl, URLIS Urlis) TRACE("(%s %d)\n", debugstr_a(pszUrl), Urlis); + if(!pszUrl) + return FALSE; + switch (Urlis) { case URLIS_OPAQUE: @@ -1768,6 +1772,9 @@ BOOL WINAPI UrlIsW(LPCWSTR pszUrl, URLIS Urlis) TRACE("(%s %d)\n", debugstr_w(pszUrl), Urlis); + if(!pszUrl) + return FALSE; + switch (Urlis) { case URLIS_OPAQUE: diff --git a/dll/win32/sti/regsvr.c b/dll/win32/sti/regsvr.c index 018c1781ef6..3e582ec4964 100644 --- a/dll/win32/sti/regsvr.c +++ b/dll/win32/sti/regsvr.c @@ -19,7 +19,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ - #include #include @@ -31,6 +30,7 @@ #include "objbase.h" #include "initguid.h" #include "sti.h" +#include "wia_lh.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -395,8 +395,11 @@ static struct regsvr_interface const interface_list[] = { { NULL } /* list terminator */ }; +extern HRESULT WINAPI STI_DllRegisterServer(void) DECLSPEC_HIDDEN; +extern HRESULT WINAPI STI_DllUnregisterServer(void) DECLSPEC_HIDDEN; + /*********************************************************************** - * DllRegisterServer (INETCOMM.@) + * DllRegisterServer (STI.@) */ HRESULT WINAPI DllRegisterServer(void) { @@ -404,14 +407,16 @@ HRESULT WINAPI DllRegisterServer(void) TRACE("\n"); - hr = register_coclasses(coclass_list); + hr = STI_DllRegisterServer(); + if (SUCCEEDED(hr)) + hr = register_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = register_interfaces(interface_list); return hr; } /*********************************************************************** - * DllUnregisterServer (INETCOMM.@) + * DllUnregisterServer (STI.@) */ HRESULT WINAPI DllUnregisterServer(void) { @@ -422,5 +427,7 @@ HRESULT WINAPI DllUnregisterServer(void) hr = unregister_coclasses(coclass_list); if (SUCCEEDED(hr)) hr = unregister_interfaces(interface_list); + if (SUCCEEDED(hr)) + hr = STI_DllUnregisterServer(); return hr; } diff --git a/dll/win32/sti/sti.c b/dll/win32/sti/sti.c new file mode 100644 index 00000000000..974bd06f693 --- /dev/null +++ b/dll/win32/sti/sti.c @@ -0,0 +1,352 @@ +/* + * Copyright (C) 2002 Aric Stewart for CodeWeavers + * Copyright (C) 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winreg.h" +#include "winerror.h" +#include "objbase.h" +#include "sti.h" + +#include "sti_private.h" + +#include "wine/debug.h" +#include "wine/unicode.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sti); + +static const WCHAR registeredAppsLaunchPath[] = { + 'S','O','F','T','W','A','R','E','\\', + 'M','i','c','r','o','s','o','f','t','\\', + 'W','i','n','d','o','w','s','\\', + 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\', + 'S','t','i','l','l','I','m','a','g','e','\\', + 'R','e','g','i','s','t','e','r','e','d',' ','A','p','p','l','i','c','a','t','i','o','n','s',0 +}; + +static inline stillimage *impl_from_StillImageW(IStillImageW *iface) +{ + return (stillimage *)((char*)iface - FIELD_OFFSET(stillimage, lpVtbl)); +} + +static HRESULT WINAPI stillimagew_QueryInterface(IStillImageW *iface, REFIID riid, void **ppvObject) +{ + stillimage *This = impl_from_StillImageW(iface); + TRACE("(%p %s %p)\n", This, debugstr_guid(riid), ppvObject); + return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); +} + +static ULONG WINAPI stillimagew_AddRef(IStillImageW *iface) +{ + stillimage *This = impl_from_StillImageW(iface); + return IUnknown_AddRef(This->pUnkOuter); +} + +static ULONG WINAPI stillimagew_Release(IStillImageW *iface) +{ + stillimage *This = impl_from_StillImageW(iface); + return IUnknown_Release(This->pUnkOuter); +} + +static HRESULT WINAPI stillimagew_Initialize(IStillImageW *iface, HINSTANCE hinst, DWORD dwVersion) +{ + stillimage *This = impl_from_StillImageW(iface); + TRACE("(%p, %p, 0x%X)\n", This, hinst, dwVersion); + return S_OK; +} + +static HRESULT WINAPI stillimagew_GetDeviceList(IStillImageW *iface, DWORD dwType, DWORD dwFlags, + DWORD *pdwItemsReturned, LPVOID *ppBuffer) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %u, 0x%X, %p, %p): stub\n", This, dwType, dwFlags, pdwItemsReturned, ppBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_GetDeviceInfo(IStillImageW *iface, LPWSTR pwszDeviceName, + LPVOID *ppBuffer) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), ppBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_CreateDevice(IStillImageW *iface, LPWSTR pwszDeviceName, DWORD dwMode, + PSTIDEVICEW *pDevice, LPUNKNOWN pUnkOuter) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %u, %p, %p): stub\n", This, debugstr_w(pwszDeviceName), dwMode, pDevice, pUnkOuter); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_GetDeviceValue(IStillImageW *iface, LPWSTR pwszDeviceName, LPWSTR pValueName, + LPDWORD pType, LPBYTE pData, LPDWORD cbData) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %s, %p, %p, %p): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pValueName), + pType, pData, cbData); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_SetDeviceValue(IStillImageW *iface, LPWSTR pwszDeviceName, LPWSTR pValueName, + DWORD type, LPBYTE pData, DWORD cbData) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %s, %u, %p, %u): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pValueName), + type, pData, cbData); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_GetSTILaunchInformation(IStillImageW *iface, LPWSTR pwszDeviceName, + DWORD *pdwEventCode, LPWSTR pwszEventName) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %p, %p, %p): stub\n", This, pwszDeviceName, + pdwEventCode, pwszEventName); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_RegisterLaunchApplication(IStillImageW *iface, LPWSTR pwszAppName, + LPWSTR pwszCommandLine) +{ + static const WCHAR format[] = {'%','s',' ','%','s',0}; + static const WCHAR commandLineSuffix[] = { + '/','S','t','i','D','e','v','i','c','e',':','%','1',' ', + '/','S','t','i','E','v','e','n','t',':','%','2',0}; + HKEY registeredAppsKey = NULL; + DWORD ret; + HRESULT hr = S_OK; + stillimage *This = impl_from_StillImageW(iface); + + TRACE("(%p, %s, %s)\n", This, debugstr_w(pwszAppName), debugstr_w(pwszCommandLine)); + + ret = RegCreateKeyW(HKEY_LOCAL_MACHINE, registeredAppsLaunchPath, ®isteredAppsKey); + if (ret == ERROR_SUCCESS) + { + WCHAR *value = HeapAlloc(GetProcessHeap(), 0, + (lstrlenW(pwszCommandLine) + 1 + lstrlenW(commandLineSuffix) + 1) * sizeof(WCHAR)); + if (value) + { + sprintfW(value, format, pwszCommandLine, commandLineSuffix); + ret = RegSetValueExW(registeredAppsKey, pwszAppName, 0, + REG_SZ, (BYTE*)value, (lstrlenW(value)+1)*sizeof(WCHAR)); + if (ret != ERROR_SUCCESS) + hr = HRESULT_FROM_WIN32(ret); + HeapFree(GetProcessHeap(), 0, value); + } + else + hr = E_OUTOFMEMORY; + RegCloseKey(registeredAppsKey); + } + else + hr = HRESULT_FROM_WIN32(ret); + return hr; +} + +static HRESULT WINAPI stillimagew_UnregisterLaunchApplication(IStillImageW *iface, LPWSTR pwszAppName) +{ + stillimage *This = impl_from_StillImageW(iface); + HKEY registeredAppsKey = NULL; + DWORD ret; + HRESULT hr = S_OK; + + TRACE("(%p, %s)\n", This, debugstr_w(pwszAppName)); + + ret = RegCreateKeyW(HKEY_LOCAL_MACHINE, registeredAppsLaunchPath, ®isteredAppsKey); + if (ret == ERROR_SUCCESS) + { + ret = RegDeleteValueW(registeredAppsKey, pwszAppName); + if (ret != ERROR_SUCCESS) + hr = HRESULT_FROM_WIN32(ret); + RegCloseKey(registeredAppsKey); + } + else + hr = HRESULT_FROM_WIN32(ret); + return hr; +} + +static HRESULT WINAPI stillimagew_EnableHwNotifications(IStillImageW *iface, LPCWSTR pwszDeviceName, + BOOL bNewState) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %u): stub\n", This, debugstr_w(pwszDeviceName), bNewState); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_GetHwNotificationState(IStillImageW *iface, LPCWSTR pwszDeviceName, + BOOL *pbCurrentState) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), pbCurrentState); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_RefreshDeviceBus(IStillImageW *iface, LPCWSTR pwszDeviceName) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s): stub\n", This, debugstr_w(pwszDeviceName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_LaunchApplicationForDevice(IStillImageW *iface, LPWSTR pwszDeviceName, + LPWSTR pwszAppName, LPSTINOTIFY pStiNotify) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %s, %s, %p): stub\n", This, debugstr_w(pwszDeviceName), debugstr_w(pwszAppName), + pStiNotify); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_SetupDeviceParameters(IStillImageW *iface, PSTI_DEVICE_INFORMATIONW pDevInfo) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %p): stub\n", This, pDevInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI stillimagew_WriteToErrorLog(IStillImageW *iface, DWORD dwMessageType, LPCWSTR pszMessage) +{ + stillimage *This = impl_from_StillImageW(iface); + FIXME("(%p, %u, %s): stub\n", This, dwMessageType, debugstr_w(pszMessage)); + return E_NOTIMPL; +} + +static const struct IStillImageWVtbl stillimagew_vtbl = +{ + stillimagew_QueryInterface, + stillimagew_AddRef, + stillimagew_Release, + stillimagew_Initialize, + stillimagew_GetDeviceList, + stillimagew_GetDeviceInfo, + stillimagew_CreateDevice, + stillimagew_GetDeviceValue, + stillimagew_SetDeviceValue, + stillimagew_GetSTILaunchInformation, + stillimagew_RegisterLaunchApplication, + stillimagew_UnregisterLaunchApplication, + stillimagew_EnableHwNotifications, + stillimagew_GetHwNotificationState, + stillimagew_RefreshDeviceBus, + stillimagew_LaunchApplicationForDevice, + stillimagew_SetupDeviceParameters, + stillimagew_WriteToErrorLog +}; + +static inline stillimage *impl_from_InternalUnknown(IUnknown *iface) +{ + return (stillimage *)((char*)iface - FIELD_OFFSET(stillimage, lpInternalUnkVtbl)); +} + +static HRESULT WINAPI Internal_QueryInterface(IUnknown *iface, REFIID riid, void **ppvObject) +{ + stillimage *This = impl_from_InternalUnknown(iface); + + TRACE("(%p %s %p)\n", This, debugstr_guid(riid), ppvObject); + + if (IsEqualGUID(riid, &IID_IUnknown)) + *ppvObject = iface; + else if (IsEqualGUID(riid, &IID_IStillImageW)) + *ppvObject = &This->lpVtbl; + else + { + if (IsEqualGUID(riid, &IID_IStillImageA)) + FIXME("interface IStillImageA is unsupported on Windows Vista too, please report if it's needed\n"); + else + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + *ppvObject = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*) *ppvObject); + return S_OK; +} + +static ULONG WINAPI Internal_AddRef(IUnknown *iface) +{ + stillimage *This = impl_from_InternalUnknown(iface); + return InterlockedIncrement(&This->ref); +} + +static ULONG WINAPI Internal_Release(IUnknown *iface) +{ + ULONG ref; + stillimage *This = impl_from_InternalUnknown(iface); + + ref = InterlockedDecrement(&This->ref); + if (ref == 0) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static const struct IUnknownVtbl internal_unk_vtbl = +{ + Internal_QueryInterface, + Internal_AddRef, + Internal_Release +}; + +/****************************************************************************** + * StiCreateInstanceA (STI.@) + */ +HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter) +{ + FIXME("(%p, %u, %p, %p): stub, unimplemented on Windows Vista too, please report if it's needed\n", hinst, dwVer, ppSti, pUnkOuter); + return STG_E_UNIMPLEMENTEDFUNCTION; +} + +/****************************************************************************** + * StiCreateInstanceW (STI.@) + */ +HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter) +{ + stillimage *This; + HRESULT hr; + + TRACE("(%p, %u, %p, %p)\n", hinst, dwVer, ppSti, pUnkOuter); + + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(stillimage)); + if (This) + { + This->lpVtbl = &stillimagew_vtbl; + This->lpInternalUnkVtbl = &internal_unk_vtbl; + if (pUnkOuter) + This->pUnkOuter = pUnkOuter; + else + This->pUnkOuter = (IUnknown*) &This->lpInternalUnkVtbl; + This->ref = 1; + + hr = IStillImage_Initialize((IStillImageW*) &This->lpVtbl, hinst, dwVer); + if (SUCCEEDED(hr)) + { + if (pUnkOuter) + *ppSti = (IStillImageW*) &This->lpInternalUnkVtbl; + else + *ppSti = (IStillImageW*) &This->lpVtbl; + } + } + else + hr = E_OUTOFMEMORY; + + return hr; +} diff --git a/dll/win32/sti/sti.rbuild b/dll/win32/sti/sti.rbuild index 592c5f123af..edce67acab8 100644 --- a/dll/win32/sti/sti.rbuild +++ b/dll/win32/sti/sti.rbuild @@ -8,11 +8,29 @@ include/reactos/wine 0x600 + STI_ + + + regsvr.c + sti.c sti_main.c + sti_wia.idl wine - advapi32 + sti_proxy ole32 + oleaut32 + rpcrt4 + advapi32 + pseh + uuid ntdll + + + STI_ + + + sti_wia.idl + diff --git a/dll/win32/sti/sti.spec b/dll/win32/sti/sti.spec index 186f382f195..300e7fac4b7 100644 --- a/dll/win32/sti/sti.spec +++ b/dll/win32/sti/sti.spec @@ -1,7 +1,7 @@ -@ stub DllCanUnloadNow -@ stub DllGetClassObject +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() -@ stdcall StiCreateInstance(ptr long ptr ptr) +@ stdcall StiCreateInstance(ptr long ptr ptr) StiCreateInstanceW @ stdcall StiCreateInstanceA(ptr long ptr ptr) @ stdcall StiCreateInstanceW(ptr long ptr ptr) diff --git a/dll/win32/sti/sti_main.c b/dll/win32/sti/sti_main.c index 1d4e6ad0408..711c17f14eb 100644 --- a/dll/win32/sti/sti_main.c +++ b/dll/win32/sti/sti_main.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Aric Stewart for CodeWeavers + * Copyright (C) 2009 Damjan Jovanovic * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,31 +19,148 @@ #include +#define COBJMACROS + #include "windef.h" #include "winbase.h" #include "winreg.h" #include "winerror.h" +#include "objbase.h" +#include "sti.h" -/****************************************************************************** - * StiCreateInstance (STI.@) - */ -HRESULT WINAPI StiCreateInstance( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sti); + +extern HRESULT WINAPI STI_DllGetClassObject(REFCLSID, REFIID, LPVOID *) DECLSPEC_HIDDEN; +extern BOOL WINAPI STI_DllMain(HINSTANCE, DWORD, LPVOID) DECLSPEC_HIDDEN; + +typedef HRESULT (*fnCreateInstance)(REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj); + +typedef struct { - return STG_E_UNIMPLEMENTEDFUNCTION; + const struct IClassFactoryVtbl *vtbl; + fnCreateInstance pfnCreateInstance; +} sti_cf; + +static inline sti_cf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return (sti_cf *)((char *)iface - FIELD_OFFSET( sti_cf, vtbl )); +} + +static HRESULT sti_create( REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj ) +{ + if (pUnkOuter != NULL && !IsEqualIID(riid, &IID_IUnknown)) + return CLASS_E_NOAGGREGATION; + + if (IsEqualGUID(riid, &IID_IUnknown)) + return StiCreateInstanceW(GetCurrentProcess(), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, (PSTIW*) ppObj, pUnkOuter); + else if (IsEqualGUID(riid, &IID_IStillImageW)) + return StiCreateInstanceW(GetCurrentProcess(), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, (PSTIW*) ppObj, NULL); + else if (IsEqualGUID(riid, &IID_IStillImageA)) + return StiCreateInstanceA(GetCurrentProcess(), STI_VERSION_REAL, (PSTIA*) ppObj, NULL); + else + { + FIXME("no interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } +} + +static HRESULT WINAPI sti_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI sti_cf_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI sti_cf_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI sti_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj ) +{ + sti_cf *This = impl_from_IClassFactory( iface ); + HRESULT r; + IUnknown *punk; + + TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + r = This->pfnCreateInstance( riid, pOuter, (LPVOID *)&punk ); + if (FAILED(r)) + return r; + + r = IUnknown_QueryInterface( punk, riid, ppobj ); + if (FAILED(r)) + return r; + + IUnknown_Release( punk ); + return r; +} + +static HRESULT WINAPI sti_cf_LockServer( IClassFactory *iface, BOOL dolock ) +{ + FIXME("(%p)->(%d)\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl sti_cf_vtbl = +{ + sti_cf_QueryInterface, + sti_cf_AddRef, + sti_cf_Release, + sti_cf_CreateInstance, + sti_cf_LockServer +}; + +static sti_cf the_sti_cf = { &sti_cf_vtbl, sti_create }; + +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n",hInstDLL,fdwReason,lpvReserved); + + if (fdwReason == DLL_WINE_PREATTACH) + return FALSE; + return STI_DllMain(hInstDLL, fdwReason, lpvReserved); } /****************************************************************************** - * StiCreateInstanceA (STI.@) + * DllGetClassObject (STI.@) */ -HRESULT WINAPI StiCreateInstanceA( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv ) { - return STG_E_UNIMPLEMENTEDFUNCTION; + IClassFactory *cf = NULL; + + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if (IsEqualGUID( rclsid, &CLSID_Sti )) + { + cf = (IClassFactory *)&the_sti_cf.vtbl; + } + + if (cf) + return IClassFactory_QueryInterface( cf, iid, ppv ); + return STI_DllGetClassObject( rclsid, iid, ppv ); } /****************************************************************************** - * StiCreateInstanceW (STI.@) + * DllCanUnloadNow (STI.@) */ -HRESULT WINAPI StiCreateInstanceW( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +HRESULT WINAPI DllCanUnloadNow( void ) { - return STG_E_UNIMPLEMENTEDFUNCTION; + return S_FALSE; } diff --git a/dll/win32/sti/sti_private.h b/dll/win32/sti/sti_private.h new file mode 100644 index 00000000000..b5e106b60b6 --- /dev/null +++ b/dll/win32/sti/sti_private.h @@ -0,0 +1,32 @@ +/* + * STI private definitions + * + * Copyright 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __STI_PRIVATE__ +#define __STI_PRIVATE__ + +typedef struct _stillimage +{ + const struct IStillImageWVtbl *lpVtbl; + const struct IUnknownVtbl *lpInternalUnkVtbl; + IUnknown *pUnkOuter; + LONG ref; +} stillimage; + +#endif /* __STI_PRIVATE__ */ diff --git a/dll/win32/sti/sti_wia.idl b/dll/win32/sti/sti_wia.idl new file mode 100644 index 00000000000..aaac943445f --- /dev/null +++ b/dll/win32/sti/sti_wia.idl @@ -0,0 +1,19 @@ +/* + * Copyright 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wia_lh.idl" diff --git a/dll/win32/syssetup/wizard.c b/dll/win32/syssetup/wizard.c index 7a084f56c26..63d6bc2ed88 100644 --- a/dll/win32/syssetup/wizard.c +++ b/dll/win32/syssetup/wizard.c @@ -1960,6 +1960,7 @@ FinishDlgProc(HWND hwndDlg, case WM_DESTROY: { SetupIsActive(0); + PostQuitMessage(0); return TRUE; } @@ -1999,7 +2000,7 @@ FinishDlgProc(HWND hwndDlg, break; case PSN_WIZFINISH: - /* Handle a Finish button click, if necessary */ + DestroyWindow(GetParent(hwndDlg)); break; default: @@ -2269,6 +2270,8 @@ InstallWizard(VOID) HPROPSHEETPAGE ahpsp[8]; PROPSHEETPAGE psp = {0}; UINT nPages = 0; + HWND hWnd; + MSG msg; /* Clear setup data */ ZeroMemory(&SetupData, sizeof(SETUPDATA)); @@ -2345,7 +2348,7 @@ InstallWizard(VOID) /* Create the property sheet */ psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; + psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS; psh.hInstance = hDllInstance; psh.hwndParent = NULL; psh.nPages = nPages; @@ -2358,7 +2361,17 @@ InstallWizard(VOID) SetupData.hTitleFont = CreateTitleFont(); /* Display the wizard */ - PropertySheet(&psh); + hWnd = (HWND)PropertySheet(&psh); + ShowWindow(hWnd, SW_SHOW); + + while (GetMessage(&msg, NULL, 0, 0)) + { + if(!IsDialogMessage(hWnd, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } DeleteObject(SetupData.hTitleFont); } diff --git a/dll/win32/urlmon/bindprot.c b/dll/win32/urlmon/bindprot.c index 07d6fc2f525..29b8532b13d 100644 --- a/dll/win32/urlmon/bindprot.c +++ b/dll/win32/urlmon/bindprot.c @@ -155,7 +155,7 @@ HWND get_notif_hwnd(void) NULL }; - wndclass.hInstance = URLMON_hInstance; + wndclass.hInstance = hProxyDll; wnd_class = RegisterClassExW(&wndclass); if (!wnd_class && GetLastError() == ERROR_CLASS_ALREADY_EXISTS) @@ -164,7 +164,7 @@ HWND get_notif_hwnd(void) tls_data->notif_hwnd = CreateWindowExW(0, wszURLMonikerNotificationWindow, wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE, - NULL, URLMON_hInstance, NULL); + NULL, hProxyDll, NULL); if(tls_data->notif_hwnd) tls_data->notif_hwnd_cnt++; diff --git a/dll/win32/urlmon/regsvr.c b/dll/win32/urlmon/regsvr.c index 9e278259e37..6e417ac9607 100644 --- a/dll/win32/urlmon/regsvr.c +++ b/dll/win32/urlmon/regsvr.c @@ -560,7 +560,7 @@ static HRESULT register_inf(BOOL doregister) hAdvpack = LoadLibraryW(wszAdvpack); pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); - hres = pRegInstall(URLMON_hInstance, doregister ? "RegisterDll" : "UnregisterDll", &strtable); + hres = pRegInstall(hProxyDll, doregister ? "RegisterDll" : "UnregisterDll", &strtable); for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++) heap_free(pse[i].pszValue); diff --git a/dll/win32/urlmon/urlmon_main.c b/dll/win32/urlmon/urlmon_main.c index 272884eb2a6..edaad42289f 100644 --- a/dll/win32/urlmon/urlmon_main.c +++ b/dll/win32/urlmon/urlmon_main.c @@ -34,7 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); LONG URLMON_refCount = 0; -HINSTANCE URLMON_hInstance = 0; static HMODULE hCabinet = NULL; static DWORD urlmon_tls = TLS_OUT_OF_INDEXES; @@ -144,9 +143,10 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) { TRACE("%p 0x%x %p\n", hinstDLL, fdwReason, fImpLoad); + URLMON_DllMain( hinstDLL, fdwReason, fImpLoad ); + switch(fdwReason) { case DLL_PROCESS_ATTACH: - URLMON_hInstance = hinstDLL; init_session(TRUE); break; diff --git a/dll/win32/urlmon/urlmon_main.h b/dll/win32/urlmon/urlmon_main.h index 8db786b7d80..071af8dd73e 100644 --- a/dll/win32/urlmon/urlmon_main.h +++ b/dll/win32/urlmon/urlmon_main.h @@ -36,7 +36,7 @@ #include "wine/unicode.h" #include "wine/list.h" -extern HINSTANCE URLMON_hInstance; +extern HINSTANCE hProxyDll DECLSPEC_HIDDEN; extern HRESULT SecManagerImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT ZoneMgrImpl_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT StdURLMoniker_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); @@ -48,6 +48,7 @@ extern HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MkProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); extern HRESULT MimeFilter_Construct(IUnknown *pUnkOuter, LPVOID *ppobj); +extern BOOL WINAPI URLMON_DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllRegisterServer(void) DECLSPEC_HIDDEN; extern HRESULT WINAPI URLMON_DllUnregisterServer(void) DECLSPEC_HIDDEN; diff --git a/dll/win32/urlmon/urlmon_urlmon.idl b/dll/win32/urlmon/urlmon_urlmon.idl index 71a0719d7d9..d45ba07e456 100644 --- a/dll/win32/urlmon/urlmon_urlmon.idl +++ b/dll/win32/urlmon/urlmon_urlmon.idl @@ -1,5 +1,5 @@ /* - * Copyright 2009 Piotr Caban for Codeweavers + * Copyright 2009 Piotr Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/dll/win32/urlmon/usrmarshal.c b/dll/win32/urlmon/usrmarshal.c index b94556362be..6ff8f04ef26 100644 --- a/dll/win32/urlmon/usrmarshal.c +++ b/dll/win32/urlmon/usrmarshal.c @@ -1,5 +1,5 @@ /* - * Copyright 2009 Piotr Caban for Codeweavers + * Copyright 2009 Piotr Caban for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/dll/win32/user32/controls/button.c b/dll/win32/user32/controls/button.c index 1f448bd1885..8b4003bbe58 100644 --- a/dll/win32/user32/controls/button.c +++ b/dll/win32/user32/controls/button.c @@ -829,7 +829,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc) */ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) { - RECT rc, focus_rect, r; + RECT rc, r; UINT dtFlags, uState; HPEN hOldPen; HBRUSH hOldBrush; @@ -865,13 +865,11 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom); InflateRect( &rc, -1, -1 ); } - - focus_rect = rc; /* completely skip the drawing if only focus has changed */ if (action == ODA_FOCUS) goto draw_focus; - uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT; + uState = DFCS_BUTTONPUSH; if (style & BS_FLAT) uState |= DFCS_MONO; @@ -898,8 +896,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) if (pushedState) OffsetRect(&r, 1, 1); - IntersectClipRect(hDC, rc.left, rc.top, rc.right, rc.bottom); - oldTxtColor = SetTextColor( hDC, GetSysColor(COLOR_BTNTEXT) ); BUTTON_DrawLabel(hwnd, hDC, dtFlags, &r); @@ -912,9 +908,8 @@ draw_focus: { if (!(get_ui_state(hwnd) & UISF_HIDEFOCUS)) { - InflateRect( &focus_rect, -1, -1 ); - IntersectRect(&focus_rect, &focus_rect, &rc); - DrawFocusRect( hDC, &focus_rect ); + InflateRect( &rc, -2, -2 ); + DrawFocusRect( hDC, &rc ); } } diff --git a/dll/win32/user32/user32.rbuild b/dll/win32/user32/user32.rbuild index e905d747d31..21ee5444b6b 100644 --- a/dll/win32/user32/user32.rbuild +++ b/dll/win32/user32/user32.rbuild @@ -3,6 +3,7 @@ . include include/reactos/subsys + include/reactos/wine wine gdi32 advapi32 diff --git a/dll/win32/user32/windows/menu.c b/dll/win32/user32/windows/menu.c index ade437c840a..d5723bb3271 100644 --- a/dll/win32/user32/windows/menu.c +++ b/dll/win32/user32/windows/menu.c @@ -2206,8 +2206,8 @@ DrawMenuBarTemp(HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font) SelectObject(DC, GetStockObject(DC_PEN)); SetDCPenColor(DC, GetSysColor(COLOR_3DFACE)); - MoveToEx(DC, Rect->left, Rect->bottom, NULL); - LineTo(DC, Rect->right, Rect->bottom); + MoveToEx(DC, Rect->left, Rect->bottom - 1, NULL); + LineTo(DC, Rect->right, Rect->bottom - 1); if (0 == MenuInfo.MenuItemCount) { @@ -3524,11 +3524,11 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT /*********************************************************************** * MenuExitTracking */ -static BOOL FASTCALL MenuExitTracking(HWND hWnd) +static BOOL FASTCALL MenuExitTracking(HWND hWnd, BOOL bPopup) { TRACE("hwnd=%p\n", hWnd); - SendMessageW( hWnd, WM_EXITMENULOOP, 0, 0 ); + SendMessageW( hWnd, WM_EXITMENULOOP, bPopup, 0 ); ShowCaret(0); top_popup = 0; top_popup_hmenu = NULL; @@ -3558,7 +3558,7 @@ VOID MenuTrackMouseMenuBar( HWND hWnd, ULONG ht, POINT pt) MenuInitTracking(hWnd, hMenu, FALSE, wFlags); MenuTrackMenu(hMenu, wFlags, pt.x, pt.y, hWnd, NULL); - MenuExitTracking(hWnd); + MenuExitTracking(hWnd, FALSE); } } @@ -3633,7 +3633,7 @@ VOID MenuTrackKbdMenuBar(HWND hwnd, UINT wParam, WCHAR wChar) track_menu: MenuTrackMenu( hTrackMenu, wFlags, 0, 0, hwnd, NULL ); - MenuExitTracking( hwnd ); + MenuExitTracking( hwnd, FALSE ); } @@ -3660,7 +3660,7 @@ BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y, if (MenuShowPopup(Wnd, Menu, 0, Flags, x, y, 0, 0 )) ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd, Tpm ? &Tpm->rcExclude : NULL); - MenuExitTracking(Wnd); + MenuExitTracking(Wnd, TRUE); return ret; } diff --git a/dll/win32/user32/windows/window.c b/dll/win32/user32/windows/window.c index 6ed38cce020..2427cd76ee0 100644 --- a/dll/win32/user32/windows/window.c +++ b/dll/win32/user32/windows/window.c @@ -137,6 +137,34 @@ CloseWindow(HWND hWnd) return (BOOL)(hWnd); } +VOID +FORCEINLINE +RtlInitLargeString( + OUT PLARGE_STRING plstr, + LPCVOID psz, + BOOL bUnicode) +{ + if(bUnicode) + { + RtlInitLargeUnicodeString((PLARGE_UNICODE_STRING)plstr, (PWSTR)psz, 0); + } + else + { + RtlInitLargeAnsiString((PLARGE_ANSI_STRING)plstr, (PSTR)psz, 0); + } +} + +VOID +NTAPI +RtlFreeLargeString( + IN PLARGE_STRING LargeString) +{ + if (LargeString->Buffer) + { + RtlFreeHeap(GetProcessHeap(), 0, LargeString->Buffer); + RtlZeroMemory(LargeString, sizeof(LARGE_STRING)); + } +} HWND WINAPI User32CreateWindowEx(DWORD dwExStyle, @@ -153,11 +181,12 @@ User32CreateWindowEx(DWORD dwExStyle, LPVOID lpParam, BOOL Unicode) { - UNICODE_STRING WindowName; + LARGE_STRING WindowName; + LARGE_STRING lstrClassName, *plstrClassName; UNICODE_STRING ClassName; WNDCLASSEXA wceA; WNDCLASSEXW wceW; - HWND Handle; + HWND Handle = NULL; #if 0 DbgPrint("[window] User32CreateWindowEx style %d, exstyle %d, parent %d\n", dwStyle, dwExStyle, hWndParent); @@ -171,8 +200,7 @@ User32CreateWindowEx(DWORD dwExStyle, if (IS_ATOM(lpClassName)) { - RtlInitUnicodeString(&ClassName, NULL); - ClassName.Buffer = (LPWSTR)lpClassName; + plstrClassName = (PVOID)lpClassName; } else { @@ -180,26 +208,49 @@ User32CreateWindowEx(DWORD dwExStyle, RtlInitUnicodeString(&ClassName, (PCWSTR)lpClassName); else { - if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName), (PCSZ)lpClassName)) + if (!RtlCreateUnicodeStringFromAsciiz(&ClassName, (PCSZ)lpClassName)) { SetLastError(ERROR_OUTOFMEMORY); return (HWND)0; } } + + /* Copy it to a LARGE_STRING */ + lstrClassName.Buffer = ClassName.Buffer; + lstrClassName.Length = ClassName.Length; + lstrClassName.MaximumLength = ClassName.MaximumLength; + plstrClassName = &lstrClassName; } - if (Unicode) - RtlInitUnicodeString(&WindowName, (PCWSTR)lpWindowName); - else + /* Initialize a LARGE_STRING */ + RtlInitLargeString(&WindowName, lpWindowName, Unicode); + + // HACK: The current implementation expects the Window name to be UNICODE + if (!Unicode) { - if (!RtlCreateUnicodeStringFromAsciiz(&WindowName, (PCSZ)lpWindowName)) + NTSTATUS Status; + PSTR AnsiBuffer = WindowName.Buffer; + ULONG AnsiLength = WindowName.Length; + + WindowName.Length = 0; + WindowName.MaximumLength = AnsiLength * sizeof(WCHAR); + WindowName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + 0, + WindowName.MaximumLength); + if (!WindowName.Buffer) { - if (!IS_ATOM(lpClassName)) - { - RtlFreeUnicodeString(&ClassName); - } SetLastError(ERROR_OUTOFMEMORY); - return (HWND)0; + goto cleanup; + } + + Status = RtlMultiByteToUnicodeN(WindowName.Buffer, + WindowName.MaximumLength, + &WindowName.Length, + AnsiBuffer, + AnsiLength); + if (!NT_SUCCESS(Status)) + { + goto cleanup; } } @@ -223,8 +274,11 @@ User32CreateWindowEx(DWORD dwExStyle, } } + if (!Unicode) dwExStyle |= WS_EX_SETANSICREATOR; + Handle = NtUserCreateWindowEx(dwExStyle, - &ClassName, + plstrClassName, + NULL, &WindowName, dwStyle, x, @@ -235,23 +289,23 @@ User32CreateWindowEx(DWORD dwExStyle, hMenu, hInstance, lpParam, - SW_SHOW, - Unicode, - 0); + 0, + NULL); #if 0 DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle); #endif - +cleanup: if(!Unicode) { - RtlFreeUnicodeString(&WindowName); - if (!IS_ATOM(lpClassName)) { RtlFreeUnicodeString(&ClassName); } + + RtlFreeLargeString(&WindowName); } + return Handle; } @@ -287,6 +341,18 @@ CreateWindowExA(DWORD dwExStyle, POINT mPos[2]; UINT id = 0; HWND top_child; + PWND WndParent; + PCLS pcls; + + if(!(WndParent = ValidateHwnd(hWndParent)) || + !(pcls = DesktopPtrToUser(WndParent->pcls))) + return 0; + + if (pcls->fnid != FNID_MDICLIENT) + { + ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent); + return 0; + } /* lpParams of WM_[NC]CREATE is different for MDI children. * MDICREATESTRUCT members have the originally passed values. @@ -399,6 +465,24 @@ CreateWindowExW(DWORD dwExStyle, POINT mPos[2]; UINT id = 0; HWND top_child; + PWND WndParent; + PCLS pcls; + + WndParent = ValidateHwnd(hWndParent); + + if(!WndParent) + return 0; + + pcls = DesktopPtrToUser(WndParent->pcls); + + if(!pcls) + return 0; + + if (pcls->fnid != FNID_MDICLIENT) + { + ERR("WS_EX_MDICHILD, but parent %p is not MDIClient\n", hWndParent); + return 0; + } /* lpParams of WM_[NC]CREATE is different for MDI children. * MDICREATESTRUCT members have the originally passed values. diff --git a/dll/win32/userenv/environment.c b/dll/win32/userenv/environment.c index 16f1acb4053..0a148abb20b 100644 --- a/dll/win32/userenv/environment.c +++ b/dll/win32/userenv/environment.c @@ -32,394 +32,443 @@ static BOOL -SetUserEnvironmentVariable (LPVOID *Environment, - LPWSTR lpName, - LPWSTR lpValue, - BOOL bExpand) +SetUserEnvironmentVariable(LPVOID *Environment, + LPWSTR lpName, + LPWSTR lpValue, + BOOL bExpand) { - WCHAR ShortName[MAX_PATH]; - UNICODE_STRING Name; - UNICODE_STRING SrcValue; - UNICODE_STRING DstValue; - ULONG Length; - NTSTATUS Status; - PVOID Buffer=NULL; + WCHAR ShortName[MAX_PATH]; + UNICODE_STRING Name; + UNICODE_STRING SrcValue; + UNICODE_STRING DstValue; + ULONG Length; + NTSTATUS Status; + PVOID Buffer = NULL; - if (bExpand) - { - RtlInitUnicodeString(&SrcValue, - lpValue); - - Length = 2 * MAX_PATH * sizeof(WCHAR); - - DstValue.Length = 0; - DstValue.MaximumLength = Length; - DstValue.Buffer = Buffer = LocalAlloc(LPTR, - Length); - - if (DstValue.Buffer == NULL) - { - DPRINT1("LocalAlloc() failed\n"); - return FALSE; - } - - Status = RtlExpandEnvironmentStrings_U((PWSTR)*Environment, - &SrcValue, - &DstValue, - &Length); - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlExpandEnvironmentStrings_U() failed (Status %lx)\n", Status); - DPRINT1("Length %lu\n", Length); - if (Buffer) LocalFree(Buffer); - return FALSE; - } - } - else - { - RtlInitUnicodeString(&DstValue, - lpValue); - } - - if (!_wcsicmp (lpName, L"temp") || !_wcsicmp (lpName, L"tmp")) - { - if (!GetShortPathNameW(DstValue.Buffer, ShortName, MAX_PATH)) - { - DPRINT1("GetShortPathNameW() failed for %S (Error %lu)\n", DstValue.Buffer, GetLastError()); - if (Buffer) LocalFree(Buffer); - return FALSE; - } - - DPRINT("Buffer: %S\n", ShortName); - RtlInitUnicodeString(&DstValue, - ShortName); - } - - RtlInitUnicodeString(&Name, - lpName); - - DPRINT("Value: %wZ\n", &DstValue); - - Status = RtlSetEnvironmentVariable((PWSTR*)Environment, - &Name, - &DstValue); - - if (Buffer) LocalFree(Buffer); - - if (!NT_SUCCESS(Status)) + if (bExpand) { - DPRINT1("RtlSetEnvironmentVariable() failed (Status %lx)\n", Status); - return FALSE; + RtlInitUnicodeString(&SrcValue, + lpValue); + + Length = 2 * MAX_PATH * sizeof(WCHAR); + + DstValue.Length = 0; + DstValue.MaximumLength = Length; + DstValue.Buffer = Buffer = LocalAlloc(LPTR, + Length); + if (DstValue.Buffer == NULL) + { + DPRINT1("LocalAlloc() failed\n"); + return FALSE; + } + + Status = RtlExpandEnvironmentStrings_U((PWSTR)*Environment, + &SrcValue, + &DstValue, + &Length); + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlExpandEnvironmentStrings_U() failed (Status %lx)\n", Status); + DPRINT1("Length %lu\n", Length); + if (Buffer) + LocalFree(Buffer); + return FALSE; + } + } + else + { + RtlInitUnicodeString(&DstValue, + lpValue); } - return TRUE; + if (!_wcsicmp(lpName, L"temp") || !_wcsicmp(lpName, L"tmp")) + { + if (!GetShortPathNameW(DstValue.Buffer, ShortName, MAX_PATH)) + { + DPRINT1("GetShortPathNameW() failed for %S (Error %lu)\n", DstValue.Buffer, GetLastError()); + if (Buffer) + LocalFree(Buffer); + return FALSE; + } + + DPRINT("Buffer: %S\n", ShortName); + RtlInitUnicodeString(&DstValue, + ShortName); + } + + RtlInitUnicodeString(&Name, + lpName); + + DPRINT("Value: %wZ\n", &DstValue); + + Status = RtlSetEnvironmentVariable((PWSTR*)Environment, + &Name, + &DstValue); + + if (Buffer) + LocalFree(Buffer); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlSetEnvironmentVariable() failed (Status %lx)\n", Status); + return FALSE; + } + + return TRUE; } static BOOL -AppendUserEnvironmentVariable (LPVOID *Environment, - LPWSTR lpName, - LPWSTR lpValue) +AppendUserEnvironmentVariable(LPVOID *Environment, + LPWSTR lpName, + LPWSTR lpValue) { - UNICODE_STRING Name; - UNICODE_STRING Value; - NTSTATUS Status; + UNICODE_STRING Name; + UNICODE_STRING Value; + NTSTATUS Status; - RtlInitUnicodeString (&Name, - lpName); + RtlInitUnicodeString(&Name, + lpName); - Value.Length = 0; - Value.MaximumLength = 1024 * sizeof(WCHAR); - Value.Buffer = LocalAlloc (LPTR, - 1024 * sizeof(WCHAR)); - if (Value.Buffer == NULL) + Value.Length = 0; + Value.MaximumLength = 1024 * sizeof(WCHAR); + Value.Buffer = LocalAlloc(LPTR, + 1024 * sizeof(WCHAR)); + if (Value.Buffer == NULL) { - return FALSE; + return FALSE; } - Value.Buffer[0] = UNICODE_NULL; + Value.Buffer[0] = UNICODE_NULL; - Status = RtlQueryEnvironmentVariable_U ((PWSTR)*Environment, - &Name, - &Value); - if (NT_SUCCESS(Status)) + Status = RtlQueryEnvironmentVariable_U((PWSTR)*Environment, + &Name, + &Value); + if (NT_SUCCESS(Status)) { - RtlAppendUnicodeToString (&Value, - L";"); + RtlAppendUnicodeToString(&Value, + L";"); } - RtlAppendUnicodeToString (&Value, - lpValue); + RtlAppendUnicodeToString(&Value, + lpValue); - Status = RtlSetEnvironmentVariable ((PWSTR*)Environment, - &Name, - &Value); - LocalFree (Value.Buffer); - if (!NT_SUCCESS(Status)) + Status = RtlSetEnvironmentVariable((PWSTR*)Environment, + &Name, + &Value); + LocalFree(Value.Buffer); + if (!NT_SUCCESS(Status)) { - DPRINT1 ("RtlSetEnvironmentVariable() failed (Status %lx)\n", Status); - return FALSE; + DPRINT1("RtlSetEnvironmentVariable() failed (Status %lx)\n", Status); + return FALSE; } - return TRUE; + return TRUE; } static HKEY -GetCurrentUserKey (HANDLE hToken) +GetCurrentUserKey(HANDLE hToken) { - UNICODE_STRING SidString; - HKEY hKey; - LONG Error; + UNICODE_STRING SidString; + HKEY hKey; + LONG Error; - if (!GetUserSidFromToken (hToken, - &SidString)) + if (!GetUserSidFromToken(hToken, + &SidString)) { - DPRINT1 ("GetUserSidFromToken() failed\n"); - return NULL; + DPRINT1("GetUserSidFromToken() failed\n"); + return NULL; } - Error = RegOpenKeyExW (HKEY_USERS, - SidString.Buffer, - 0, - MAXIMUM_ALLOWED, - &hKey); - if (Error != ERROR_SUCCESS) + Error = RegOpenKeyExW(HKEY_USERS, + SidString.Buffer, + 0, + MAXIMUM_ALLOWED, + &hKey); + if (Error != ERROR_SUCCESS) { - DPRINT1 ("RegOpenKeyExW() failed (Error %ld)\n", Error); - RtlFreeUnicodeString (&SidString); - SetLastError((DWORD)Error); - return NULL; + DPRINT1("RegOpenKeyExW() failed (Error %ld)\n", Error); + RtlFreeUnicodeString(&SidString); + SetLastError((DWORD)Error); + return NULL; } - RtlFreeUnicodeString (&SidString); + RtlFreeUnicodeString(&SidString); - return hKey; + return hKey; } static BOOL -SetUserEnvironment (LPVOID *lpEnvironment, - HKEY hKey, - LPWSTR lpSubKeyName) +SetUserEnvironment(LPVOID *lpEnvironment, + HKEY hKey, + LPWSTR lpSubKeyName) { - HKEY hEnvKey; - DWORD dwValues; - DWORD dwMaxValueNameLength; - DWORD dwMaxValueDataLength; - DWORD dwValueNameLength; - DWORD dwValueDataLength; - DWORD dwType; - DWORD i; - LPWSTR lpValueName; - LPWSTR lpValueData; - LONG Error; + HKEY hEnvKey; + DWORD dwValues; + DWORD dwMaxValueNameLength; + DWORD dwMaxValueDataLength; + DWORD dwValueNameLength; + DWORD dwValueDataLength; + DWORD dwType; + DWORD i; + LPWSTR lpValueName; + LPWSTR lpValueData; + LONG Error; - Error = RegOpenKeyExW (hKey, - lpSubKeyName, - 0, - KEY_QUERY_VALUE, - &hEnvKey); - if (Error != ERROR_SUCCESS) + Error = RegOpenKeyExW(hKey, + lpSubKeyName, + 0, + KEY_QUERY_VALUE, + &hEnvKey); + if (Error != ERROR_SUCCESS) { - DPRINT1 ("RegOpenKeyExW() failed (Error %ld)\n", Error); - SetLastError((DWORD)Error); - return FALSE; + DPRINT1("RegOpenKeyExW() failed (Error %ld)\n", Error); + SetLastError((DWORD)Error); + return FALSE; } - Error = RegQueryInfoKey (hEnvKey, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - &dwValues, - &dwMaxValueNameLength, - &dwMaxValueDataLength, - NULL, - NULL); - if (Error != ERROR_SUCCESS) + Error = RegQueryInfoKey(hEnvKey, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + &dwValues, + &dwMaxValueNameLength, + &dwMaxValueDataLength, + NULL, + NULL); + if (Error != ERROR_SUCCESS) { - DPRINT1 ("RegQueryInforKey() failed (Error %ld)\n", Error); - RegCloseKey (hEnvKey); - SetLastError((DWORD)Error); - return FALSE; + DPRINT1("RegQueryInforKey() failed (Error %ld)\n", Error); + RegCloseKey(hEnvKey); + SetLastError((DWORD)Error); + return FALSE; } - if (dwValues == 0) + if (dwValues == 0) { - RegCloseKey (hEnvKey); - return TRUE; + RegCloseKey(hEnvKey); + return TRUE; } - /* Allocate buffers */ - lpValueName = LocalAlloc (LPTR, - dwMaxValueNameLength * sizeof(WCHAR)); - if (lpValueName == NULL) + /* Allocate buffers */ + lpValueName = LocalAlloc(LPTR, + dwMaxValueNameLength * sizeof(WCHAR)); + if (lpValueName == NULL) { - RegCloseKey (hEnvKey); - return FALSE; + RegCloseKey(hEnvKey); + return FALSE; } - lpValueData = LocalAlloc (LPTR, - dwMaxValueDataLength); - if (lpValueData == NULL) + lpValueData = LocalAlloc(LPTR, + dwMaxValueDataLength); + if (lpValueData == NULL) { - LocalFree (lpValueName); - RegCloseKey (hEnvKey); - return FALSE; + LocalFree(lpValueName); + RegCloseKey(hEnvKey); + return FALSE; } - /* Enumerate values */ - for (i = 0; i < dwValues; i++) + /* Enumerate values */ + for (i = 0; i < dwValues; i++) { - dwValueNameLength = dwMaxValueNameLength; - dwValueDataLength = dwMaxValueDataLength; - RegEnumValueW (hEnvKey, - i, - lpValueName, - &dwValueNameLength, - NULL, - &dwType, - (LPBYTE)lpValueData, - &dwValueDataLength); + dwValueNameLength = dwMaxValueNameLength; + dwValueDataLength = dwMaxValueDataLength; + RegEnumValueW(hEnvKey, + i, + lpValueName, + &dwValueNameLength, + NULL, + &dwType, + (LPBYTE)lpValueData, + &dwValueDataLength); - if (!_wcsicmp (lpValueName, L"path")) - { - /* Append 'Path' environment variable */ - AppendUserEnvironmentVariable (lpEnvironment, - lpValueName, - lpValueData); - } - else - { - /* Set environment variable */ - SetUserEnvironmentVariable (lpEnvironment, - lpValueName, - lpValueData, - (dwType == REG_EXPAND_SZ)); - } + if (!_wcsicmp (lpValueName, L"path")) + { + /* Append 'Path' environment variable */ + AppendUserEnvironmentVariable(lpEnvironment, + lpValueName, + lpValueData); + } + else + { + /* Set environment variable */ + SetUserEnvironmentVariable(lpEnvironment, + lpValueName, + lpValueData, + (dwType == REG_EXPAND_SZ)); + } } - LocalFree (lpValueData); - LocalFree (lpValueName); - RegCloseKey (hEnvKey); + LocalFree(lpValueData); + LocalFree(lpValueName); + RegCloseKey(hEnvKey); - return TRUE; -} - - -BOOL WINAPI -CreateEnvironmentBlock (LPVOID *lpEnvironment, - HANDLE hToken, - BOOL bInherit) -{ - WCHAR Buffer[MAX_PATH]; - DWORD Length; - HKEY hKeyUser; - NTSTATUS Status; - - DPRINT("CreateEnvironmentBlock() called\n"); - - if (lpEnvironment == NULL) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - Status = RtlCreateEnvironment ((BOOLEAN)bInherit, - (PWSTR*)lpEnvironment); - if (!NT_SUCCESS (Status)) - { - DPRINT1 ("RtlCreateEnvironment() failed (Status %lx)\n", Status); - SetLastError (RtlNtStatusToDosError (Status)); - return FALSE; - } - - /* Set 'COMPUTERNAME' variable */ - Length = MAX_PATH; - if (GetComputerNameW (Buffer, - &Length)) - { - SetUserEnvironmentVariable(lpEnvironment, - L"COMPUTERNAME", - Buffer, - FALSE); - } - - if (hToken == NULL) return TRUE; - - hKeyUser = GetCurrentUserKey (hToken); - if (hKeyUser == NULL) - { - DPRINT1 ("GetCurrentUserKey() failed\n"); - RtlDestroyEnvironment (*lpEnvironment); - return FALSE; - } - - /* Set 'ALLUSERSPROFILE' variable */ - Length = MAX_PATH; - if (GetAllUsersProfileDirectoryW (Buffer, - &Length)) - { - SetUserEnvironmentVariable(lpEnvironment, - L"ALLUSERSPROFILE", - Buffer, - FALSE); - } - - /* Set 'USERPROFILE' variable */ - Length = MAX_PATH; - if (GetUserProfileDirectoryW (hToken, - Buffer, - &Length)) - { - SetUserEnvironmentVariable(lpEnvironment, - L"USERPROFILE", - Buffer, - FALSE); - } - - /* FIXME: Set 'USERDOMAIN' variable */ - - Length = MAX_PATH; - if (GetUserNameW(Buffer, - &Length)) - { - SetUserEnvironmentVariable(lpEnvironment, - L"USERNAME", - Buffer, - FALSE); - } - - - - /* Set user environment variables */ - SetUserEnvironment (lpEnvironment, - hKeyUser, - L"Environment"); - - RegCloseKey (hKeyUser); - - return TRUE; } BOOL WINAPI -DestroyEnvironmentBlock (LPVOID lpEnvironment) +CreateEnvironmentBlock(LPVOID *lpEnvironment, + HANDLE hToken, + BOOL bInherit) { - DPRINT ("DestroyEnvironmentBlock() called\n"); + WCHAR Buffer[MAX_PATH]; + WCHAR szValue[1024]; + DWORD Length; + DWORD dwType; + HKEY hKey; + HKEY hKeyUser; + NTSTATUS Status; + LONG lError; - if (lpEnvironment == NULL) + DPRINT("CreateEnvironmentBlock() called\n"); + + if (lpEnvironment == NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; } - RtlDestroyEnvironment (lpEnvironment); + Status = RtlCreateEnvironment((BOOLEAN)bInherit, + (PWSTR*)lpEnvironment); + if (!NT_SUCCESS (Status)) + { + DPRINT1("RtlCreateEnvironment() failed (Status %lx)\n", Status); + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } - return TRUE; + /* Set 'COMPUTERNAME' variable */ + Length = MAX_PATH; + if (GetComputerNameW(Buffer, + &Length)) + { + SetUserEnvironmentVariable(lpEnvironment, + L"COMPUTERNAME", + Buffer, + FALSE); + } + + /* Set 'ALLUSERSPROFILE' variable */ + Length = MAX_PATH; + if (GetAllUsersProfileDirectoryW(Buffer, + &Length)) + { + SetUserEnvironmentVariable(lpEnvironment, + L"ALLUSERSPROFILE", + Buffer, + FALSE); + } + + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", + 0, + KEY_READ, + &hKey); + if (lError == ERROR_SUCCESS) + { + Length = 1024 * sizeof(WCHAR); + lError = RegQueryValueExW(hKey, + L"ProgramFilesDir", + NULL, + &dwType, + (LPBYTE)szValue, + &Length); + if (lError == ERROR_SUCCESS) + { + SetUserEnvironmentVariable(lpEnvironment, + L"ProgramFiles", + szValue, + FALSE); + } + + Length = 1024 * sizeof(WCHAR); + lError = RegQueryValueExW(hKey, + L"CommonFilesDir", + NULL, + &dwType, + (LPBYTE)szValue, + &Length); + if (lError == ERROR_SUCCESS) + { + SetUserEnvironmentVariable(lpEnvironment, + L"CommonProgramFiles", + szValue, + FALSE); + } + + RegCloseKey(hKey); + } + + if (hToken == NULL) + return TRUE; + + hKeyUser = GetCurrentUserKey(hToken); + if (hKeyUser == NULL) + { + DPRINT1("GetCurrentUserKey() failed\n"); + RtlDestroyEnvironment(*lpEnvironment); + return FALSE; + } + + /* Set 'USERPROFILE' variable */ + Length = MAX_PATH; + if (GetUserProfileDirectoryW(hToken, + Buffer, + &Length)) + { + SetUserEnvironmentVariable(lpEnvironment, + L"USERPROFILE", + Buffer, + FALSE); + } + + /* FIXME: Set 'USERDOMAIN' variable */ + + Length = MAX_PATH; + if (GetUserNameW(Buffer, + &Length)) + { + SetUserEnvironmentVariable(lpEnvironment, + L"USERNAME", + Buffer, + FALSE); + } + + /* Set user environment variables */ + SetUserEnvironment(lpEnvironment, + hKeyUser, + L"Environment"); + + /* Set user volatile environment variables */ + SetUserEnvironment(lpEnvironment, + hKeyUser, + L"Volatile Environment"); + + RegCloseKey(hKeyUser); + + return TRUE; +} + + +BOOL WINAPI +DestroyEnvironmentBlock(LPVOID lpEnvironment) +{ + DPRINT("DestroyEnvironmentBlock() called\n"); + + if (lpEnvironment == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + RtlDestroyEnvironment(lpEnvironment); + + return TRUE; } diff --git a/dll/win32/userenv/lang/de-DE.rc b/dll/win32/userenv/lang/de-DE.rc index 3c28dc6f153..55f626ea564 100644 --- a/dll/win32/userenv/lang/de-DE.rc +++ b/dll/win32/userenv/lang/de-DE.rc @@ -34,7 +34,7 @@ BEGIN IDS_MYVIDEOS "Eigene Dateien\\Eigene Videos" IDS_TEMPLATES "Vorlagen" IDS_RECENT "Recent" - IDS_SENDTO "SendTo" + IDS_SENDTO "Senden an" IDS_PRINTHOOD "Druckumgebung" IDS_NETHOOD "Netzwerkumgebung" IDS_LOCALSETTINGS "Lokale Einstellungen" @@ -44,5 +44,5 @@ BEGIN IDS_HISTORY "Lokale Einstellungen\\Verlauf" IDS_COOKIES "Cookies" IDS_PROGRAMFILES "%SystemDrive%\\Programme" - IDS_COMMONFILES "Common Files" + IDS_COMMONFILES "Gemeinsame Dateien" END diff --git a/dll/win32/userenv/lang/es-ES.rc b/dll/win32/userenv/lang/es-ES.rc index 448fe4145b5..dcfd07f92d8 100644 --- a/dll/win32/userenv/lang/es-ES.rc +++ b/dll/win32/userenv/lang/es-ES.rc @@ -37,10 +37,10 @@ BEGIN IDS_MYDOCUMENTS "Mis Documentos" IDS_MYPICTURES "Mis Documentos\\Mis im疊enes" IDS_MYMUSIC "Mis Documentos\\Mi msica" - IDS_MYVIDEOS "Mis Documentos\\Mis vdeos" + IDS_MYVIDEOS "Mis Documentos\\Mis videos" IDS_TEMPLATES "Plantillas" - IDS_RECENT "Reciente" - IDS_SENDTO "SendTo" + IDS_RECENT "Documentos recientes" + IDS_SENDTO "Enviar a" IDS_PRINTHOOD "Impresoras" IDS_NETHOOD "Entorno de red" IDS_LOCALSETTINGS "Configuracin local" diff --git a/dll/win32/userenv/lang/fr-FR.rc b/dll/win32/userenv/lang/fr-FR.rc index e95f2b0c52b..a3baf6ea524 100644 --- a/dll/win32/userenv/lang/fr-FR.rc +++ b/dll/win32/userenv/lang/fr-FR.rc @@ -44,5 +44,5 @@ BEGIN IDS_HISTORY "Local Settings\\Historique" IDS_COOKIES "Cookies" IDS_PROGRAMFILES "%SystemDrive%\\Program Files" - IDS_COMMONFILES "Common Files" + IDS_COMMONFILES "Fichiers communs" END diff --git a/dll/win32/userenv/lang/it-IT.rc b/dll/win32/userenv/lang/it-IT.rc index 91448130eee..fa6106f922e 100644 --- a/dll/win32/userenv/lang/it-IT.rc +++ b/dll/win32/userenv/lang/it-IT.rc @@ -38,5 +38,5 @@ BEGIN IDS_HISTORY "Impostazioni locali\\Cronologia" IDS_COOKIES "Cookies" IDS_PROGRAMFILES "%SystemDrive%\\Programmi" - IDS_COMMONFILES "File condivisi" + IDS_COMMONFILES "File comuni" END diff --git a/dll/win32/userenv/profile.c b/dll/win32/userenv/profile.c index c2de4087c02..9e3f2b19114 100644 --- a/dll/win32/userenv/profile.c +++ b/dll/win32/userenv/profile.c @@ -170,10 +170,12 @@ CreateUserProfileW(PSID Sid, WCHAR szProfilesPath[MAX_PATH]; WCHAR szUserProfilePath[MAX_PATH]; WCHAR szDefaultUserPath[MAX_PATH]; + WCHAR szUserProfileName[MAX_PATH]; WCHAR szBuffer[MAX_PATH]; LPWSTR SidString; DWORD dwLength; DWORD dwDisposition; + UINT i; HKEY hKey; LONG Error; @@ -245,14 +247,11 @@ CreateUserProfileW(PSID Sid, RegCloseKey (hKey); + wcscpy(szUserProfileName, lpUserName); + wcscpy(szUserProfilePath, szProfilesPath); wcscat(szUserProfilePath, L"\\"); - wcscat(szUserProfilePath, lpUserName); - if (!AppendSystemPostfix(szUserProfilePath, MAX_PATH)) - { - DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); - return FALSE; - } + wcscat(szUserProfilePath, szUserProfileName); wcscpy(szDefaultUserPath, szProfilesPath); wcscat(szDefaultUserPath, L"\\"); @@ -266,6 +265,24 @@ CreateUserProfileW(PSID Sid, DPRINT1("Error: %lu\n", GetLastError()); return FALSE; } + + for (i = 0; i < 1000; i++) + { + swprintf(szUserProfileName, L"%s.%03u", lpUserName, i); + + wcscpy(szUserProfilePath, szProfilesPath); + wcscat(szUserProfilePath, L"\\"); + wcscat(szUserProfilePath, szUserProfileName); + + if (CreateDirectoryW(szUserProfilePath, NULL)) + break; + + if (GetLastError() != ERROR_ALREADY_EXISTS) + { + DPRINT1("Error: %lu\n", GetLastError()); + return FALSE; + } + } } /* Copy default user directory */ @@ -308,14 +325,7 @@ CreateUserProfileW(PSID Sid, /* Create non-expanded user profile path */ wcscpy(szBuffer, szRawProfilesPath); wcscat(szBuffer, L"\\"); - wcscat(szBuffer, lpUserName); - if (!AppendSystemPostfix(szBuffer, MAX_PATH)) - { - DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); - LocalFree((HLOCAL)SidString); - RegCloseKey (hKey); - return FALSE; - } + wcscat(szBuffer, szUserProfileName); /* Set 'ProfileImagePath' value (non-expanded) */ Error = RegSetValueExW(hKey, @@ -958,16 +968,9 @@ LoadUserProfileW(IN HANDLE hToken, } } + /* Create user hive name */ wcscat(szUserHivePath, L"\\"); wcscat(szUserHivePath, lpProfileInfo->lpUserName); - dwLength = sizeof(szUserHivePath) / sizeof(szUserHivePath[0]); - if (!AppendSystemPostfix(szUserHivePath, dwLength)) - { - DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); - return FALSE; - } - - /* Create user hive name */ wcscat(szUserHivePath, L"\\ntuser.dat"); DPRINT("szUserHivePath: %S\n", szUserHivePath); @@ -1129,8 +1132,21 @@ UnloadUserProfile(HANDLE hToken, DPRINT("SidString: '%wZ'\n", &SidString); + /* Acquire restore privilege */ + if (!AcquireRemoveRestorePrivilege(TRUE)) + { + DPRINT1("AcquireRemoveRestorePrivilege() failed (Error %ld)\n", GetLastError()); + RtlFreeUnicodeString(&SidString); + return FALSE; + } + + /* Unload the hive */ Error = RegUnLoadKeyW(HKEY_USERS, SidString.Buffer); + + /* Remove restore privilege */ + AcquireRemoveRestorePrivilege(FALSE); + if (Error != ERROR_SUCCESS) { DPRINT1("RegUnLoadKeyW() failed (Error %ld)\n", Error); diff --git a/dll/win32/userenv/setup.c b/dll/win32/userenv/setup.c index ca422dd5e9f..783d35621c9 100644 --- a/dll/win32/userenv/setup.c +++ b/dll/win32/userenv/setup.c @@ -140,22 +140,6 @@ InitializeProfiles(VOID) return FALSE; } - /* Store profiles directory path */ - dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR); - Error = RegSetValueExW(hKey, - L"ProfilesDirectory", - 0, - REG_EXPAND_SZ, - (LPBYTE)szBuffer, - dwLength); - if (Error != ERROR_SUCCESS) - { - DPRINT1("Error: %lu\n", Error); - RegCloseKey(hKey); - SetLastError((DWORD)Error); - return FALSE; - } - /* Expand it */ if (!ExpandEnvironmentStringsW(szBuffer, szProfilesPath, @@ -177,15 +161,66 @@ InitializeProfiles(VOID) } } - /* Set 'DefaultUserProfile' value */ - wcscpy(szBuffer, L"Default User"); - if (!AppendSystemPostfix(szBuffer, MAX_PATH)) + /* Store the profiles directory path in the registry */ + dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR); + Error = RegSetValueExW(hKey, + L"ProfilesDirectory", + 0, + REG_EXPAND_SZ, + (LPBYTE)szBuffer, + dwLength); + if (Error != ERROR_SUCCESS) { - DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); + DPRINT1("Error: %lu\n", Error); RegCloseKey(hKey); + SetLastError((DWORD)Error); return FALSE; } + /* Set 'DefaultUserProfile' value */ + wcscpy(szBuffer, L"Default User"); + + /* Create Default User profile directory path */ + wcscpy(szProfilePath, szProfilesPath); + wcscat(szProfilePath, L"\\"); + wcscat(szProfilePath, szBuffer); + + /* Attempt default user directory creation */ + if (!CreateDirectoryW (szProfilePath, NULL)) + { + if (GetLastError() != ERROR_ALREADY_EXISTS) + { + DPRINT1("Error: %lu\n", GetLastError()); + RegCloseKey(hKey); + return FALSE; + } + + /* Directory existed, let's try to append the postfix */ + if (!AppendSystemPostfix(szBuffer, MAX_PATH)) + { + DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); + RegCloseKey(hKey); + return FALSE; + } + + /* Create Default User profile directory path again */ + wcscpy(szProfilePath, szProfilesPath); + wcscat(szProfilePath, L"\\"); + wcscat(szProfilePath, szBuffer); + + /* Attempt creation again with appended postfix */ + if (!CreateDirectoryW(szProfilePath, NULL)) + { + if (GetLastError() != ERROR_ALREADY_EXISTS) + { + DPRINT1("Error: %lu\n", GetLastError()); + RegCloseKey(hKey); + return FALSE; + } + } + } + + /* Store the default user profile path in the registry */ dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR); Error = RegSetValueExW(hKey, L"DefaultUserProfile", @@ -203,19 +238,6 @@ InitializeProfiles(VOID) RegCloseKey(hKey); - /* Create 'Default User' profile directory */ - wcscpy(szProfilePath, szProfilesPath); - wcscat(szProfilePath, L"\\"); - wcscat(szProfilePath, szBuffer); - if (!CreateDirectoryW (szProfilePath, NULL)) - { - if (GetLastError() != ERROR_ALREADY_EXISTS) - { - DPRINT1("Error: %lu\n", GetLastError()); - return FALSE; - } - } - /* Set current user profile */ SetEnvironmentVariableW(L"USERPROFILE", szProfilePath); @@ -382,10 +404,41 @@ InitializeProfiles(VOID) /* Set 'AllUsersProfile' value */ wcscpy(szBuffer, L"All Users"); - if (!AppendSystemPostfix(szBuffer, MAX_PATH)) + + /* Create 'All Users' profile directory path */ + wcscpy(szProfilePath, szProfilesPath); + wcscat(szProfilePath, L"\\"); + wcscat(szProfilePath, szBuffer); + + /* Attempt 'All Users' directory creation */ + if (!CreateDirectoryW (szProfilePath, NULL)) { - DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); - return FALSE; + if (GetLastError() != ERROR_ALREADY_EXISTS) + { + DPRINT1("Error: %lu\n", GetLastError()); + return FALSE; + } + + /* Directory existed, let's try to append the postfix */ + if (!AppendSystemPostfix(szBuffer, MAX_PATH)) + { + DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); + return FALSE; + } + + /* Attempt again creation with appended postfix */ + wcscpy(szProfilePath, szProfilesPath); + wcscat(szProfilePath, L"\\"); + wcscat(szProfilePath, szBuffer); + + if (!CreateDirectoryW(szProfilePath, NULL)) + { + if (GetLastError() != ERROR_ALREADY_EXISTS) + { + DPRINT1("Error: %lu\n", GetLastError()); + return FALSE; + } + } } Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE, @@ -407,27 +460,14 @@ InitializeProfiles(VOID) REG_SZ, (LPBYTE)szBuffer, dwLength); - if (Error != ERROR_SUCCESS) - { - DPRINT1("Error: %lu\n", Error); - RegCloseKey(hKey); - SetLastError((DWORD)Error); - return FALSE; - } RegCloseKey(hKey); - /* Create 'All Users' profile directory */ - wcscpy(szProfilePath, szProfilesPath); - wcscat(szProfilePath, L"\\"); - wcscat(szProfilePath, szBuffer); - if (!CreateDirectoryW(szProfilePath, NULL)) + if (Error != ERROR_SUCCESS) { - if (GetLastError() != ERROR_ALREADY_EXISTS) - { - DPRINT1("Error: %lu\n", GetLastError()); - return FALSE; - } + DPRINT1("Error: %lu\n", Error); + SetLastError((DWORD)Error); + return FALSE; } /* Set 'All Users' profile */ diff --git a/dll/win32/usp10/bidi.c b/dll/win32/usp10/bidi.c new file mode 100644 index 00000000000..28b5d3e76ce --- /dev/null +++ b/dll/win32/usp10/bidi.c @@ -0,0 +1,893 @@ +/* + * Uniscribe BiDirectional handling + * + * Copyright 2003 Shachar Shemesh + * Copyright 2007 Maarten Lankhorst + * Copyright 2010 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + * Code derived from the modified reference implementation + * that was found in revision 17 of http://unicode.org/reports/tr9/ + * "Unicode Standard Annex #9: THE BIDIRECTIONAL ALGORITHM" + * + * -- Copyright (C) 1999-2005, ASMUS, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of the Unicode data files and any associated documentation (the + * "Data Files") or Unicode software and any associated documentation (the + * "Software") to deal in the Data Files or Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, and/or sell copies of the Data Files or Software, + * and to permit persons to whom the Data Files or Software are furnished + * to do so, provided that (a) the above copyright notice(s) and this + * permission notice appear with all copies of the Data Files or Software, + * (b) both the above copyright notice(s) and this permission notice appear + * in associated documentation, and (c) there is clear notice in each + * modified Data File or in the Software as well as in the documentation + * associated with the Data File(s) or Software that the data or software + * has been modified. + */ + +#include "config.h" + +#include +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winnls.h" +#include "usp10.h" +#include "wine/unicode.h" +#include "wine/debug.h" + +#include "usp10_internal.h" + +WINE_DEFAULT_DEBUG_CHANNEL(bidi); + +#define ASSERT(x) do { if (!(x)) FIXME("assert failed: %s\n", #x); } while(0) +#define MAX_LEVEL 61 + +/* HELPER FUNCTIONS AND DECLARATIONS */ + +/*------------------------------------------------------------------------ + Bidirectional Character Types + + as defined by the Unicode Bidirectional Algorithm Table 3-7. + + Note: + + The list of bidirectional character types here is not grouped the + same way as the table 3-7, since the numberic values for the types + are chosen to keep the state and action tables compact. +------------------------------------------------------------------------*/ +enum directions +{ + /* input types */ + /* ON MUST be zero, code relies on ON = N = 0 */ + ON = 0, /* Other Neutral */ + L, /* Left Letter */ + R, /* Right Letter */ + AN, /* Arabic Number */ + EN, /* European Number */ + AL, /* Arabic Letter (Right-to-left) */ + NSM, /* Non-spacing Mark */ + CS, /* Common Separator */ + ES, /* European Separator */ + ET, /* European Terminator (post/prefix e.g. $ and %) */ + + /* resolved types */ + BN, /* Boundary neutral (type of RLE etc after explicit levels) */ + + /* input types, */ + S, /* Segment Separator (TAB) // used only in L1 */ + WS, /* White space // used only in L1 */ + B, /* Paragraph Separator (aka as PS) */ + + /* types for explicit controls */ + RLO, /* these are used only in X1-X9 */ + RLE, + LRO, + LRE, + PDF, + + /* resolved types, also resolved directions */ + N = ON, /* alias, where ON, WS and S are treated the same */ +}; + +/* HELPER FUNCTIONS */ +/* the character type contains the C1_* flags in the low 12 bits */ +/* and the C2_* type in the high 4 bits */ +static __inline unsigned short get_char_typeW( WCHAR ch ) +{ + WORD CharType; + GetStringTypeW(CT_CTYPE1, &ch, 1, &CharType); + return CharType; +} + +/* Convert the libwine information to the direction enum */ +static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c) +{ + static const enum directions dir_map[16] = + { + L, /* unassigned defaults to L */ + L, + R, + EN, + ES, + ET, + AN, + CS, + B, + S, + WS, + ON, + AL, + NSM, + BN, + PDF /* also LRE, LRO, RLE, RLO */ + }; + + unsigned i; + + for (i = 0; i < uCount; ++i) + { + chartype[i] = dir_map[get_char_typeW(lpString[i]) >> 12]; + switch (chartype[i]) + { + case ES: + if (!c->fLegacyBidiClass) break; + switch (lpString[i]) + { + case '-': + case '+': chartype[i] = N; break; + case '/': chartype[i] = CS; break; + } + break; + case PDF: + switch (lpString[i]) + { + case 0x202A: chartype[i] = LRE; break; + case 0x202B: chartype[i] = RLE; break; + case 0x202C: chartype[i] = PDF; break; + case 0x202D: chartype[i] = LRO; break; + case 0x202E: chartype[i] = RLO; break; + } + break; + } + } +} + +/* Set a run of cval values at locations all prior to, but not including */ +/* iStart, to the new value nval. */ +static void SetDeferredRun(WORD *pval, int cval, int iStart, int nval) +{ + int i = iStart - 1; + for (; i >= iStart - cval; i--) + { + pval[i] = nval; + } +} + +/* RESOLVE EXPLICIT */ + +static WORD GreaterEven(int i) +{ + return odd(i) ? i + 1 : i + 2; +} + +static WORD GreaterOdd(int i) +{ + return odd(i) ? i + 2 : i + 1; +} + +static WORD EmbeddingDirection(int level) +{ + return odd(level) ? R : L; +} + +/*------------------------------------------------------------------------ + Function: resolveExplicit + + Recursively resolves explicit embedding levels and overrides. + Implements rules X1-X9, of the Unicode Bidirectional Algorithm. + + Input: Base embedding level and direction + Character count + + Output: Array of embedding levels + + In/Out: Array of direction classes + + + Note: The function uses two simple counters to keep track of + matching explicit codes and PDF. Use the default argument for + the outermost call. The nesting counter counts the recursion + depth and not the embedding level. +------------------------------------------------------------------------*/ + +static int resolveExplicit(int level, int dir, WORD *pcls, WORD *plevel, int cch, int nNest) +{ + /* always called with a valid nesting level + nesting levels are != embedding levels */ + int nLastValid = nNest; + int ich = 0; + + /* check input values */ + ASSERT(nNest >= 0 && level >= 0 && level <= MAX_LEVEL); + + /* process the text */ + for (; ich < cch; ich++) + { + WORD cls = pcls[ich]; + switch (cls) + { + case LRO: + case LRE: + nNest++; + if (GreaterEven(level) <= MAX_LEVEL - (cls == LRO ? 2 : 0)) + { + plevel[ich] = GreaterEven(level); + pcls[ich] = BN; + ich += resolveExplicit(plevel[ich], (cls == LRE ? N : L), + &pcls[ich+1], &plevel[ich+1], + cch - (ich+1), nNest); + nNest--; + continue; + } + cls = pcls[ich] = BN; + break; + + case RLO: + case RLE: + nNest++; + if (GreaterOdd(level) <= MAX_LEVEL - (cls == RLO ? 2 : 0)) + { + plevel[ich] = GreaterOdd(level); + pcls[ich] = BN; + ich += resolveExplicit(plevel[ich], (cls == RLE ? N : R), + &pcls[ich+1], &plevel[ich+1], + cch - (ich+1), nNest); + nNest--; + continue; + } + cls = pcls[ich] = BN; + break; + + case PDF: + cls = pcls[ich] = BN; + if (nNest) + { + if (nLastValid < nNest) + { + nNest--; + } + else + { + cch = ich; /* break the loop, but complete body */ + } + } + } + + /* Apply the override */ + if (dir != N) + { + cls = dir; + } + plevel[ich] = level; + if (pcls[ich] != BN) + pcls[ich] = cls; + } + + return ich; +} + +/* RESOLVE WEAK TYPES */ + +enum states /* possible states */ +{ + xa, /* arabic letter */ + xr, /* right letter */ + xl, /* left letter */ + + ao, /* arabic lett. foll by ON */ + ro, /* right lett. foll by ON */ + lo, /* left lett. foll by ON */ + + rt, /* ET following R */ + lt, /* ET following L */ + + cn, /* EN, AN following AL */ + ra, /* arabic number foll R */ + re, /* european number foll R */ + la, /* arabic number foll L */ + le, /* european number foll L */ + + ac, /* CS following cn */ + rc, /* CS following ra */ + rs, /* CS,ES following re */ + lc, /* CS following la */ + ls, /* CS,ES following le */ + + ret, /* ET following re */ + let, /* ET following le */ +} ; + +static const int stateWeak[][10] = +{ + /* N, L, R, AN, EN, AL,NSM, CS, ES, ET */ +/*xa*/ { ao, xl, xr, cn, cn, xa, xa, ao, ao, ao }, /* arabic letter */ +/*xr*/ { ro, xl, xr, ra, re, xa, xr, ro, ro, rt }, /* right letter */ +/*xl*/ { lo, xl, xr, la, le, xa, xl, lo, lo, lt }, /* left letter */ + +/*ao*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* arabic lett. foll by ON*/ +/*ro*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* right lett. foll by ON */ +/*lo*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* left lett. foll by ON */ + +/*rt*/ { ro, xl, xr, ra, re, xa, rt, ro, ro, rt }, /* ET following R */ +/*lt*/ { lo, xl, xr, la, le, xa, lt, lo, lo, lt }, /* ET following L */ + +/*cn*/ { ao, xl, xr, cn, cn, xa, cn, ac, ao, ao }, /* EN, AN following AL */ +/*ra*/ { ro, xl, xr, ra, re, xa, ra, rc, ro, rt }, /* arabic number foll R */ +/*re*/ { ro, xl, xr, ra, re, xa, re, rs, rs,ret }, /* european number foll R */ +/*la*/ { lo, xl, xr, la, le, xa, la, lc, lo, lt }, /* arabic number foll L */ +/*le*/ { lo, xl, xr, la, le, xa, le, ls, ls,let }, /* european number foll L */ + +/*ac*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* CS following cn */ +/*rc*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS following ra */ +/*rs*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS,ES following re */ +/*lc*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS following la */ +/*ls*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS,ES following le */ + +/*ret*/{ ro, xl, xr, ra, re, xa,ret, ro, ro,ret }, /* ET following re */ +/*let*/{ lo, xl, xr, la, le, xa,let, lo, lo,let }, /* ET following le */ +}; + +enum actions /* possible actions */ +{ + /* primitives */ + IX = 0x100, /* increment */ + XX = 0xF, /* no-op */ + + /* actions */ + xxx = (XX << 4) + XX, /* no-op */ + xIx = IX + xxx, /* increment run */ + xxN = (XX << 4) + ON, /* set current to N */ + xxE = (XX << 4) + EN, /* set current to EN */ + xxA = (XX << 4) + AN, /* set current to AN */ + xxR = (XX << 4) + R, /* set current to R */ + xxL = (XX << 4) + L, /* set current to L */ + Nxx = (ON << 4) + 0xF, /* set run to neutral */ + Axx = (AN << 4) + 0xF, /* set run to AN */ + ExE = (EN << 4) + EN, /* set run to EN, set current to EN */ + NIx = (ON << 4) + 0xF + IX, /* set run to N, increment */ + NxN = (ON << 4) + ON, /* set run to N, set current to N */ + NxR = (ON << 4) + R, /* set run to N, set current to R */ + NxE = (ON << 4) + EN, /* set run to N, set current to EN */ + + AxA = (AN << 4) + AN, /* set run to AN, set current to AN */ + NxL = (ON << 4) + L, /* set run to N, set current to L */ + LxL = (L << 4) + L, /* set run to L, set current to L */ +} ; + +static const int actionWeak[][10] = +{ + /* N, L, R, AN, EN, AL, NSM, CS, ES, ET */ +/*xa*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxR, xxN, xxN, xxN }, /* arabic letter */ +/*xr*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxR, xxN, xxN, xIx }, /* right letter */ +/*xl*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xIx }, /* left letter */ + +/*ao*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxN, xxN, xxN, xxN }, /* arabic lett. foll by ON */ +/*ro*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxN, xxN, xxN, xIx }, /* right lett. foll by ON */ +/*lo*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxN, xxN, xxN, xIx }, /* left lett. foll by ON */ + +/*rt*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, xIx, NxN, NxN, xIx }, /* ET following R */ +/*lt*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, xIx, NxN, NxN, xIx }, /* ET following L */ + +/*cn*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxA, xIx, xxN, xxN }, /* EN, AN following AL */ +/*ra*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxA, xIx, xxN, xIx }, /* arabic number foll R */ +/*re*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxE, xIx, xIx, xxE }, /* european number foll R */ +/*la*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxA, xIx, xxN, xIx }, /* arabic number foll L */ +/*le*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xIx, xIx, xxL }, /* european number foll L */ + +/*ac*/ { Nxx, Nxx, Nxx, Axx, AxA, NxR, NxN, NxN, NxN, NxN }, /* CS following cn */ +/*rc*/ { Nxx, Nxx, Nxx, Axx, NxE, NxR, NxN, NxN, NxN, NIx }, /* CS following ra */ +/*rs*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following re */ +/*lc*/ { Nxx, Nxx, Nxx, Axx, NxL, NxR, NxN, NxN, NxN, NIx }, /* CS following la */ +/*ls*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following le */ + +/*ret*/{ xxx, xxx, xxx, xxx, xxE, xxR, xxE, xxN, xxN, xxE }, /* ET following re */ +/*let*/{ xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xxL }, /* ET following le */ +}; + +static int GetDeferredType(int action) +{ + return (action >> 4) & 0xF; +} + +static int GetResolvedType(int action) +{ + return action & 0xF; +} + +/* Note on action table: + + States can be of two kinds: + - Immediate Resolution State, where each input token + is resolved as soon as it is seen. These states have + only single action codes (xxN) or the no-op (xxx) + for static input tokens. + - Deferred Resolution State, where input tokens either + either extend the run (xIx) or resolve its Type (e.g. Nxx). + + Input classes are of three kinds + - Static Input Token, where the class of the token remains + unchanged on output (AN, L, N, R) + - Replaced Input Token, where the class of the token is + always replaced on output (AL, BN, NSM, CS, ES, ET) + - Conditional Input Token, where the class of the token is + changed on output in some, but not all, cases (EN) + + Where tokens are subject to change, a double action + (e.g. NxA, or NxN) is _required_ after deferred states, + resolving both the deferred state and changing the current token. +*/ + +/*------------------------------------------------------------------------ + Function: resolveWeak + + Resolves the directionality of numeric and other weak character types + + Implements rules X10 and W1-W6 of the Unicode Bidirectional Algorithm. + + Input: Array of embedding levels + Character count + + In/Out: Array of directional classes + + Note: On input only these directional classes are expected + AL, HL, R, L, ON, BN, NSM, AN, EN, ES, ET, CS, +------------------------------------------------------------------------*/ +static void resolveWeak(int baselevel, WORD *pcls, WORD *plevel, int cch) +{ + int state = odd(baselevel) ? xr : xl; + int cls; + + int level = baselevel; + int action, clsRun, clsNew; + int cchRun = 0; + int ich = 0; + + for (; ich < cch; ich++) + { + /* ignore boundary neutrals */ + if (pcls[ich] == BN) + { + /* must flatten levels unless at a level change; */ + plevel[ich] = level; + + /* lookahead for level changes */ + if (ich + 1 == cch && level != baselevel) + { + /* have to fixup last BN before end of the loop, since + * its fix-upped value will be needed below the assert */ + pcls[ich] = EmbeddingDirection(level); + } + else if (ich + 1 < cch && level != plevel[ich+1] && pcls[ich+1] != BN) + { + /* fixup LAST BN in front / after a level run to make + * it act like the SOR/EOR in rule X10 */ + int newlevel = plevel[ich+1]; + if (level > newlevel) { + newlevel = level; + } + plevel[ich] = newlevel; + + /* must match assigned level */ + pcls[ich] = EmbeddingDirection(newlevel); + level = plevel[ich+1]; + } + else + { + /* don't interrupt runs */ + if (cchRun) + { + cchRun++; + } + continue; + } + } + + ASSERT(pcls[ich] <= BN); + cls = pcls[ich]; + + action = actionWeak[state][cls]; + + /* resolve the directionality for deferred runs */ + clsRun = GetDeferredType(action); + if (clsRun != XX) + { + SetDeferredRun(pcls, cchRun, ich, clsRun); + cchRun = 0; + } + + /* resolve the directionality class at the current location */ + clsNew = GetResolvedType(action); + if (clsNew != XX) + pcls[ich] = clsNew; + + /* increment a deferred run */ + if (IX & action) + cchRun++; + + state = stateWeak[state][cls]; + } + + /* resolve any deferred runs + * use the direction of the current level to emulate PDF */ + cls = EmbeddingDirection(level); + + /* resolve the directionality for deferred runs */ + clsRun = GetDeferredType(actionWeak[state][cls]); + if (clsRun != XX) + SetDeferredRun(pcls, cchRun, ich, clsRun); +} + +/* RESOLVE NEUTRAL TYPES */ + +/* action values */ +enum neutralactions +{ + /* action to resolve previous input */ + nL = L, /* resolve EN to L */ + En = 3 << 4, /* resolve neutrals run to embedding level direction */ + Rn = R << 4, /* resolve neutrals run to strong right */ + Ln = L << 4, /* resolved neutrals run to strong left */ + In = (1<<8), /* increment count of deferred neutrals */ + LnL = (1<<4)+L, /* set run and EN to L */ +}; + +static int GetDeferredNeutrals(int action, int level) +{ + action = (action >> 4) & 0xF; + if (action == (En >> 4)) + return EmbeddingDirection(level); + else + return action; +} + +static int GetResolvedNeutrals(int action) +{ + action = action & 0xF; + if (action == In) + return 0; + else + return action; +} + +/* state values */ +enum resolvestates +{ + /* new temporary class */ + r, /* R and characters resolved to R */ + l, /* L and characters resolved to L */ + rn, /* N preceded by right */ + ln, /* N preceded by left */ + a, /* AN preceded by left (the abbreviation 'la' is used up above) */ + na, /* N preceded by a */ +} ; + + +/*------------------------------------------------------------------------ + Notes: + + By rule W7, whenever a EN is 'dominated' by an L (including start of + run with embedding direction = L) it is resolved to, and further treated + as L. + + This leads to the need for 'a' and 'na' states. +------------------------------------------------------------------------*/ + +static const int actionNeutrals[][5] = +{ +/* N, L, R, AN, EN = cls */ + { In, 0, 0, 0, 0 }, /* r right */ + { In, 0, 0, 0, L }, /* l left */ + + { In, En, Rn, Rn, Rn }, /* rn N preceded by right */ + { In, Ln, En, En, LnL}, /* ln N preceded by left */ + + { In, 0, 0, 0, L }, /* a AN preceded by left */ + { In, En, Rn, Rn, En }, /* na N preceded by a */ +} ; + +static const int stateNeutrals[][5] = +{ +/* N, L, R, AN, EN */ + { rn, l, r, r, r }, /* r right */ + { ln, l, r, a, l }, /* l left */ + + { rn, l, r, r, r }, /* rn N preceded by right */ + { ln, l, r, a, l }, /* ln N preceded by left */ + + { na, l, r, a, l }, /* a AN preceded by left */ + { na, l, r, a, l }, /* na N preceded by la */ +} ; + +/*------------------------------------------------------------------------ + Function: resolveNeutrals + + Resolves the directionality of neutral character types. + + Implements rules W7, N1 and N2 of the Unicode Bidi Algorithm. + + Input: Array of embedding levels + Character count + Baselevel + + In/Out: Array of directional classes + + Note: On input only these directional classes are expected + R, L, N, AN, EN and BN + + W8 resolves a number of ENs to L +------------------------------------------------------------------------*/ +static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int cch) +{ + /* the state at the start of text depends on the base level */ + int state = odd(baselevel) ? r : l; + int cls; + + int cchRun = 0; + int level = baselevel; + + int action, clsRun, clsNew; + int ich = 0; + for (; ich < cch; ich++) + { + /* ignore boundary neutrals */ + if (pcls[ich] == BN) + { + /* include in the count for a deferred run */ + if (cchRun) + cchRun++; + + /* skip any further processing */ + continue; + } + + ASSERT(pcls[ich] < 5); /* "Only N, L, R, AN, EN are allowed" */ + cls = pcls[ich]; + + action = actionNeutrals[state][cls]; + + /* resolve the directionality for deferred runs */ + clsRun = GetDeferredNeutrals(action, level); + if (clsRun != N) + { + SetDeferredRun(pcls, cchRun, ich, clsRun); + cchRun = 0; + } + + /* resolve the directionality class at the current location */ + clsNew = GetResolvedNeutrals(action); + if (clsNew != N) + pcls[ich] = clsNew; + + if (In & action) + cchRun++; + + state = stateNeutrals[state][cls]; + level = plevel[ich]; + } + + /* resolve any deferred runs */ + cls = EmbeddingDirection(level); /* eor has type of current level */ + + /* resolve the directionality for deferred runs */ + clsRun = GetDeferredNeutrals(actionNeutrals[state][cls], level); + if (clsRun != N) + SetDeferredRun(pcls, cchRun, ich, clsRun); +} + +/* RESOLVE IMPLICIT */ + +/*------------------------------------------------------------------------ + Function: resolveImplicit + + Recursively resolves implicit embedding levels. + Implements rules I1 and I2 of the Unicode Bidirectional Algorithm. + + Input: Array of direction classes + Character count + Base level + + In/Out: Array of embedding levels + + Note: levels may exceed 15 on output. + Accepted subset of direction classes + R, L, AN, EN +------------------------------------------------------------------------*/ +static const WORD addLevel[][4] = +{ + /* L, R, AN, EN */ +/* even */ { 0, 1, 2, 2, }, +/* odd */ { 1, 0, 1, 1, } + +}; + +static void resolveImplicit(const WORD * pcls, WORD *plevel, int cch) +{ + int ich = 0; + for (; ich < cch; ich++) + { + /* cannot resolve bn here, since some bn were resolved to strong + * types in resolveWeak. To remove these we need the original + * types, which are available again in resolveWhiteSpace */ + if (pcls[ich] == BN) + { + continue; + } + ASSERT(pcls[ich] > 0); /* "No Neutrals allowed to survive here." */ + ASSERT(pcls[ich] < 5); /* "Out of range." */ + plevel[ich] += addLevel[odd(plevel[ich])][pcls[ich] - 1]; + } +} + +/************************************************************* + * BIDI_DeterminLevels + */ +BOOL BIDI_DetermineLevels( + LPCWSTR lpString, /* [in] The string for which information is to be returned */ + INT uCount, /* [in] Number of WCHARs in string. */ + const SCRIPT_STATE *s, + const SCRIPT_CONTROL *c, + WORD *lpOutLevels /* [out] final string levels */ + ) +{ + WORD *chartype; + unsigned baselevel = 0,j; + TRACE("%s, %d", debugstr_wn(lpString, uCount), uCount); + + chartype = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WORD)); + if (!chartype) + { + WARN("Out of memory\n"); + return FALSE; + } + + baselevel = s->uBidiLevel; + + classify(lpString, chartype, uCount, c); + + for (j = 0; j < uCount; ++j) + switch(chartype[j]) + { + case B: + case S: + case WS: + case ON: chartype[j] = N; + default: continue; + } + + /* resolve explicit */ + resolveExplicit(baselevel, N, chartype, lpOutLevels, uCount, 0); + + /* resolve weak */ + resolveWeak(baselevel, chartype, lpOutLevels, uCount); + + /* resolve neutrals */ + resolveNeutrals(baselevel, chartype, lpOutLevels, uCount); + + /* resolveImplicit */ + resolveImplicit(chartype, lpOutLevels, uCount); + + HeapFree(GetProcessHeap(), 0, chartype); + return TRUE; +} + +/* reverse cch indexes */ +static void reverse(int *pidx, int cch) +{ + int temp; + int ich = 0; + for (; ich < --cch; ich++) + { + temp = pidx[ich]; + pidx[ich] = pidx[cch]; + pidx[cch] = temp; + } +} + + +/*------------------------------------------------------------------------ + Functions: reorder/reorderLevel + + Recursively reorders the display string + "From the highest level down, reverse all characters at that level and + higher, down to the lowest odd level" + + Implements rule L2 of the Unicode bidi Algorithm. + + Input: Array of embedding levels + Character count + Flag enabling reversal (set to false by initial caller) + + In/Out: Text to reorder + + Note: levels may exceed 15 resp. 61 on input. + + Rule L3 - reorder combining marks is not implemented here + Rule L4 - glyph mirroring is implemented as a display option below + + Note: this should be applied a line at a time +-------------------------------------------------------------------------*/ +int BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) +{ + int ich = 0; + + /* true as soon as first odd level encountered */ + fReverse = fReverse || odd(level); + + for (; ich < cch; ich++) + { + if (plevel[ich] < level) + { + break; + } + else if (plevel[ich] > level) + { + ich += BIDI_ReorderV2lLevel(level + 1, pIndexs + ich, plevel + ich, + cch - ich, fReverse) - 1; + } + } + if (fReverse) + { + reverse(pIndexs, ich); + } + return ich; +} + +/* Applies the reorder in reverse. Taking an already reordered string and returing the original */ +int BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse) +{ + int ich = 0; + int newlevel = -1; + + /* true as soon as first odd level encountered */ + fReverse = fReverse || odd(level); + + for (; ich < cch; ich++) + { + if (plevel[ich] < level) + break; + else if (plevel[ich] > level) + newlevel = ich; + } + if (fReverse) + { + reverse(pIndexs, ich); + } + + if (newlevel > 1) + { + ich = 0; + for (; ich < cch; ich++) + if (plevel[ich] > level) + ich += BIDI_ReorderL2vLevel(level + 1, pIndexs + ich, plevel + ich, + cch - ich, fReverse) - 1; + } + + return ich; +} diff --git a/dll/win32/usp10/usp10.c b/dll/win32/usp10/usp10.c index cdd6d7b2919..85957143557 100644 --- a/dll/win32/usp10/usp10.c +++ b/dll/win32/usp10/usp10.c @@ -3,6 +3,7 @@ * * Copyright 2005 Steven Edwards for CodeWeavers * Copyright 2006 Hans Leidekker + * Copyright 2010 CodeWeavers, Aric Stewart * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +33,8 @@ #include "winnls.h" #include "usp10.h" +#include "usp10_internal.h" + #include "wine/debug.h" #include "wine/unicode.h" @@ -524,6 +527,7 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem int cnt = 0, index = 0; int New_Script = SCRIPT_UNDEFINED; + WORD *levels = NULL; TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); @@ -531,6 +535,24 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem if (!pwcInChars || !cInChars || !pItems || cMaxItems < 2) return E_INVALIDARG; + if (psState && psControl) + { + int i; + levels = heap_alloc_zero(cInChars * sizeof(WORD)); + if (!levels) + return E_OUTOFMEMORY; + + BIDI_DetermineLevels(pwcInChars, cInChars, psState, psControl, levels); + for (i = 0; i < cInChars; i++) + if (levels[i]!=levels[0]) + break; + if (i >= cInChars) + { + heap_free(levels); + levels = NULL; + } + } + pItems[index].iCharPos = 0; memset(&pItems[index].a, 0, sizeof(SCRIPT_ANALYSIS)); @@ -549,15 +571,29 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem if (pwcInChars[cnt] >= Latin_start && pwcInChars[cnt] <= Latin_stop) pItems[index].a.eScript = Script_Latin; - if (pItems[index].a.eScript == Script_Arabic) + if (levels) + { + pItems[index].a.fRTL = odd(levels[cnt]); + pItems[index].a.fLayoutRTL = odd(levels[cnt]); + pItems[index].a.s.uBidiLevel = levels[cnt]; + } + else if (pItems[index].a.eScript == Script_Arabic) + { pItems[index].a.s.uBidiLevel = 1; + pItems[index].a.fRTL = 1; + pItems[index].a.fLayoutRTL = 1; + } - TRACE("New_Script=%d, eScript=%d index=%d cnt=%d iCharPos=%d\n", - New_Script, pItems[index].a.eScript, index, cnt, + + TRACE("New_Level=%i New_Script=%d, eScript=%d index=%d cnt=%d iCharPos=%d\n", + levels?levels[cnt]:-1, New_Script, pItems[index].a.eScript, index, cnt, pItems[index].iCharPos); for (cnt=1; cnt < cInChars; cnt++) { + if (levels && (levels[cnt] == pItems[index].a.s.uBidiLevel)) + continue; + if (pwcInChars[cnt] == '\r') New_Script = Script_CR; else @@ -578,9 +614,9 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem else New_Script = SCRIPT_UNDEFINED; - if (New_Script != pItems[index].a.eScript) + if ((levels && (levels[cnt] != pItems[index].a.s.uBidiLevel)) || New_Script != pItems[index].a.eScript) { - TRACE("New_Script=%d, eScript=%d ", New_Script, pItems[index].a.eScript); + TRACE("New_Level = %i, New_Script=%d, eScript=%d ", levels?levels[cnt]:-1, New_Script, pItems[index].a.eScript); index++; if (index+1 > cMaxItems) return E_OUTOFMEMORY; @@ -588,9 +624,18 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem pItems[index].iCharPos = cnt; memset(&pItems[index].a, 0, sizeof(SCRIPT_ANALYSIS)); - if (New_Script == Script_Arabic) + if (levels) + { + pItems[index].a.fRTL = odd(levels[cnt]); + pItems[index].a.fLayoutRTL = odd(levels[cnt]); + pItems[index].a.s.uBidiLevel = levels[cnt]; + } + else if (New_Script == Script_Arabic) + { pItems[index].a.s.uBidiLevel = 1; - + pItems[index].a.fRTL = 1; + pItems[index].a.fLayoutRTL = 1; + } pItems[index].a.eScript = New_Script; TRACE("index=%d cnt=%d iCharPos=%d\n", index, cnt, pItems[index].iCharPos); @@ -610,6 +655,7 @@ HRESULT WINAPI ScriptItemize(const WCHAR *pwcInChars, int cInChars, int cMaxItem /* Set SCRIPT_ITEM */ pItems[index+1].iCharPos = cnt; /* the last + 1 item contains the ptr to the lastchar */ + heap_free(levels); return S_OK; } @@ -686,7 +732,7 @@ HRESULT WINAPI ScriptStringAnalyse(HDC hdc, const void *pString, int cString, int numGlyphsReturned; /* FIXME: non unicode strings */ - WCHAR* pStr = (WCHAR*)pString; + const WCHAR* pStr = (const WCHAR*)pString; hr = ScriptShape(hdc, sc, &pStr[analysis->pItem[i].iCharPos], cChar, numGlyphs, &analysis->pItem[i].a, glyphs, pwLogClust, psva, &numGlyphsReturned); @@ -1286,6 +1332,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, { HRESULT hr; unsigned int i; + BOOL rtl; TRACE("(%p, %p, %s, %d, %d, %p, %p, %p, %p, %p)\n", hdc, psc, debugstr_wn(pwcChars, cChars), cChars, cMaxGlyphs, psa, pwOutGlyphs, pwLogClust, psva, pcGlyphs); @@ -1295,6 +1342,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, if (!psva || !pcGlyphs) return E_INVALIDARG; if (cChars > cMaxGlyphs) return E_OUTOFMEMORY; + rtl = (!psa->fLogicalOrder && psa->fRTL); *pcGlyphs = cChars; if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr; @@ -1304,33 +1352,42 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars, { for (i = 0; i < cChars; i++) { - if (!(pwOutGlyphs[i] = get_cache_glyph(psc, pwcChars[i]))) + int idx = i; + if (rtl) idx = cChars - 1 - i; + if (!(pwOutGlyphs[i] = get_cache_glyph(psc, pwcChars[idx]))) { WORD glyph; if (!hdc) return E_PENDING; - if (GetGlyphIndicesW(hdc, &pwcChars[i], 1, &glyph, 0) == GDI_ERROR) return S_FALSE; - pwOutGlyphs[i] = set_cache_glyph(psc, pwcChars[i], glyph); + if (GetGlyphIndicesW(hdc, &pwcChars[idx], 1, &glyph, 0) == GDI_ERROR) return S_FALSE; + pwOutGlyphs[i] = set_cache_glyph(psc, pwcChars[idx], glyph); } } } else { TRACE("no glyph translation\n"); - for (i = 0; i < cChars; i++) pwOutGlyphs[i] = pwcChars[i]; + for (i = 0; i < cChars; i++) + { + int idx = i; + if (rtl) idx = cChars - 1 - i; + pwOutGlyphs[i] = pwcChars[idx]; + } } /* set up a valid SCRIPT_VISATTR and LogClust for each char in this run */ for (i = 0; i < cChars; i++) { + int idx = i; + if (rtl) idx = cChars - 1 - i; /* FIXME: set to better values */ - psva[i].uJustification = (pwcChars[i] == ' ') ? SCRIPT_JUSTIFY_BLANK : SCRIPT_JUSTIFY_CHARACTER; + psva[i].uJustification = (pwcChars[idx] == ' ') ? SCRIPT_JUSTIFY_BLANK : SCRIPT_JUSTIFY_CHARACTER; psva[i].fClusterStart = 1; psva[i].fDiacritic = 0; psva[i].fZeroWidth = 0; psva[i].fReserved = 0; psva[i].fShapeReserved = 0; - pwLogClust[i] = i; + pwLogClust[i] = idx; } return S_OK; } @@ -1573,28 +1630,45 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB */ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *logtovis) { - int i, j = runs - 1, k = 0; + int* indexs; + int ich; TRACE("(%d, %p, %p, %p)\n", runs, level, vistolog, logtovis); if (!level || (!vistolog && !logtovis)) return E_INVALIDARG; - for (i = 0; i < runs; i++) + indexs = heap_alloc(sizeof(int) * runs); + if (!indexs) + return E_OUTOFMEMORY; + + + if (vistolog) { - if (level[i] % 2) - { - if (vistolog) *vistolog++ = j; - if (logtovis) *logtovis++ = j; - j--; - } - else - { - if (vistolog) *vistolog++ = k; - if (logtovis) *logtovis++ = k; - k++; - } + for( ich = 0; ich < runs; ich++) + indexs[ich] = ich; + + ich = 0; + while (ich < runs) + ich += BIDI_ReorderV2lLevel(0, indexs+ich, level+ich, runs - ich, FALSE); + for (ich = 0; ich < runs; ich++) + vistolog[ich] = indexs[ich]; } + + + if (logtovis) + { + for( ich = 0; ich < runs; ich++) + indexs[ich] = ich; + + ich = 0; + while (ich < runs) + ich += BIDI_ReorderL2vLevel(0, indexs+ich, level+ich, runs - ich, FALSE); + for (ich = 0; ich < runs; ich++) + logtovis[ich] = indexs[ich]; + } + heap_free(indexs); + return S_OK; } @@ -1839,9 +1913,3 @@ HRESULT WINAPI ScriptJustify(const SCRIPT_VISATTR *sva, const int *advance, for (i = 0; i < num_glyphs; i++) justify[i] = advance[i]; return S_OK; } - -BOOL gbLpkPresent = FALSE; -VOID WINAPI LpkPresent() -{ - gbLpkPresent = TRUE; /* Turn it on this way! Wine is out of control! */ -} diff --git a/dll/win32/usp10/usp10.rbuild b/dll/win32/usp10/usp10.rbuild index ad071018a46..527578c6edd 100644 --- a/dll/win32/usp10/usp10.rbuild +++ b/dll/win32/usp10/usp10.rbuild @@ -6,6 +6,7 @@ . include/reactos/wine + bidi.c usp10.c wine gdi32 diff --git a/dll/win32/usp10/usp10.spec b/dll/win32/usp10/usp10.spec index 0f7b0aa87c5..5e358707c41 100644 --- a/dll/win32/usp10/usp10.spec +++ b/dll/win32/usp10/usp10.spec @@ -1,4 +1,4 @@ -@ stdcall LpkPresent() +@ stub LpkPresent @ stdcall ScriptApplyDigitSubstitution(ptr ptr ptr) @ stdcall ScriptApplyLogicalWidth(ptr long long ptr ptr ptr ptr ptr ptr) @ stdcall ScriptBreak(ptr long ptr ptr) diff --git a/dll/win32/usp10/usp10_internal.h b/dll/win32/usp10/usp10_internal.h new file mode 100644 index 00000000000..60e4eff14ab --- /dev/null +++ b/dll/win32/usp10/usp10_internal.h @@ -0,0 +1,28 @@ +/* + * Implementation of Uniscribe Script Processor (usp10.dll) + * + * Copyright 2010 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#define odd(x) ((x) & 1) + +BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s, + const SCRIPT_CONTROL *c, WORD *lpOutLevels ); + +INT BIDI_ReorderV2lLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse); +INT BIDI_ReorderL2vLevel(int level, int *pIndexs, const BYTE* plevel, int cch, BOOL fReverse); diff --git a/dll/win32/version/resource.c b/dll/win32/version/resource.c index 1e3d9bc0958..e793d0a2d99 100644 --- a/dll/win32/version/resource.c +++ b/dll/win32/version/resource.c @@ -199,7 +199,11 @@ static BOOL find_ne_resource( HFILE lzfd, DWORD *resLen, DWORD *resOff ) */ static BOOL find_pe_resource( HFILE lzfd, DWORD *resLen, DWORD *resOff ) { - IMAGE_NT_HEADERS pehd; + union + { + IMAGE_NT_HEADERS32 nt32; + IMAGE_NT_HEADERS64 nt64; + } pehd; DWORD pehdoffset; PIMAGE_DATA_DIRECTORY resDataDir; PIMAGE_SECTION_HEADER sections; @@ -208,14 +212,27 @@ static BOOL find_pe_resource( HFILE lzfd, DWORD *resLen, DWORD *resOff ) const void *resDir; const IMAGE_RESOURCE_DIRECTORY *resPtr; const IMAGE_RESOURCE_DATA_ENTRY *resData; - int i, nSections; + int i, len, nSections; BOOL ret = FALSE; /* Read in PE header */ pehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); - if ( sizeof(pehd) != LZRead( lzfd, (LPSTR)&pehd, sizeof(pehd) ) ) return 0; + len = LZRead( lzfd, (LPSTR)&pehd, sizeof(pehd) ); + if (len < sizeof(pehd.nt32.FileHeader)) return 0; + if (len < sizeof(pehd)) memset( (char *)&pehd + len, 0, sizeof(pehd) - len ); + + switch (pehd.nt32.OptionalHeader.Magic) + { + case IMAGE_NT_OPTIONAL_HDR32_MAGIC: + resDataDir = pehd.nt32.OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_RESOURCE; + break; + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + resDataDir = pehd.nt64.OptionalHeader.DataDirectory + IMAGE_DIRECTORY_ENTRY_RESOURCE; + break; + default: + return 0; + } - resDataDir = pehd.OptionalHeader.DataDirectory+IMAGE_DIRECTORY_ENTRY_RESOURCE; if ( !resDataDir->Size ) { TRACE("No resources in PE dll\n" ); @@ -223,15 +240,13 @@ static BOOL find_pe_resource( HFILE lzfd, DWORD *resLen, DWORD *resOff ) } /* Read in section table */ - nSections = pehd.FileHeader.NumberOfSections; + nSections = pehd.nt32.FileHeader.NumberOfSections; sections = HeapAlloc( GetProcessHeap(), 0, nSections * sizeof(IMAGE_SECTION_HEADER) ); if ( !sections ) return FALSE; - LZSeek( lzfd, pehdoffset + - sizeof(DWORD) + /* Signature */ - sizeof(IMAGE_FILE_HEADER) + - pehd.FileHeader.SizeOfOptionalHeader, SEEK_SET ); + len = FIELD_OFFSET( IMAGE_NT_HEADERS32, OptionalHeader ) + pehd.nt32.FileHeader.SizeOfOptionalHeader; + LZSeek( lzfd, pehdoffset + len, SEEK_SET ); if ( nSections * sizeof(IMAGE_SECTION_HEADER) != LZRead( lzfd, (LPSTR)sections, nSections * sizeof(IMAGE_SECTION_HEADER) ) ) diff --git a/dll/win32/windowscodecs/bmpdecode.c b/dll/win32/windowscodecs/bmpdecode.c index 5c805c8c098..854b3374b02 100644 --- a/dll/win32/windowscodecs/bmpdecode.c +++ b/dll/win32/windowscodecs/bmpdecode.c @@ -58,12 +58,14 @@ typedef struct { DWORD bc2AppData; } BITMAPCOREHEADER2; -struct BmpFrameDecode; -typedef HRESULT (*ReadDataFunc)(struct BmpFrameDecode* This); +struct BmpDecoder; +typedef HRESULT (*ReadDataFunc)(struct BmpDecoder* This); -typedef struct BmpFrameDecode { - const IWICBitmapFrameDecodeVtbl *lpVtbl; +typedef struct BmpDecoder { + const IWICBitmapDecoderVtbl *lpVtbl; + const IWICBitmapFrameDecodeVtbl *lpFrameVtbl; LONG ref; + BOOL initialized; IStream *stream; BITMAPFILEHEADER bfh; BITMAPV5HEADER bih; @@ -73,12 +75,17 @@ typedef struct BmpFrameDecode { INT stride; BYTE *imagedata; BYTE *imagedatastart; -} BmpFrameDecode; + CRITICAL_SECTION lock; /* must be held when initialized/imagedata is set or stream is accessed */ +} BmpDecoder; + +static inline BmpDecoder *impl_from_frame(IWICBitmapFrameDecode *iface) +{ + return CONTAINING_RECORD(iface, BmpDecoder, lpFrameVtbl); +} static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, void **ppv) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); if (!ppv) return E_INVALIDARG; @@ -87,7 +94,7 @@ static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface IsEqualIID(&IID_IWICBitmapSource, iid) || IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) { - *ppv = This; + *ppv = iface; } else { @@ -101,35 +108,22 @@ static HRESULT WINAPI BmpFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface static ULONG WINAPI BmpFrameDecode_AddRef(IWICBitmapFrameDecode *iface) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; - ULONG ref = InterlockedIncrement(&This->ref); + BmpDecoder *This = impl_from_frame(iface); - TRACE("(%p) refcount=%u\n", iface, ref); - - return ref; + return IUnknown_AddRef((IUnknown*)This); } static ULONG WINAPI BmpFrameDecode_Release(IWICBitmapFrameDecode *iface) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; - ULONG ref = InterlockedDecrement(&This->ref); + BmpDecoder *This = impl_from_frame(iface); - TRACE("(%p) refcount=%u\n", iface, ref); - - if (ref == 0) - { - IStream_Release(This->stream); - HeapFree(GetProcessHeap(), 0, This->imagedata); - HeapFree(GetProcessHeap(), 0, This); - } - - return ref; + return IUnknown_Release((IUnknown*)This); } static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; + BmpDecoder *This = impl_from_frame(iface); TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight); if (This->bih.bV5Size == sizeof(BITMAPCOREHEADER)) @@ -149,7 +143,7 @@ static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; + BmpDecoder *This = impl_from_frame(iface); TRACE("(%p,%p)\n", iface, pPixelFormat); memcpy(pPixelFormat, This->pixelformat, sizeof(GUID)); @@ -180,7 +174,7 @@ static HRESULT BmpHeader_GetResolution(BITMAPV5HEADER *bih, double *pDpiX, doubl static HRESULT WINAPI BmpFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, double *pDpiX, double *pDpiY) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; + BmpDecoder *This = impl_from_frame(iface); TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY); return BmpHeader_GetResolution(&This->bih, pDpiX, pDpiY); @@ -190,13 +184,15 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, IWICPalette *pIPalette) { HRESULT hr; - BmpFrameDecode *This = (BmpFrameDecode*)iface; + BmpDecoder *This = impl_from_frame(iface); int count; WICColor *wiccolors=NULL; RGBTRIPLE *bgrcolors=NULL; TRACE("(%p,%p)\n", iface, pIPalette); + EnterCriticalSection(&This->lock); + if (This->bih.bV5Size == sizeof(BITMAPCOREHEADER)) { BITMAPCOREHEADER *bch = (BITMAPCOREHEADER*)&This->bih; @@ -238,7 +234,8 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, } else { - return WINCODEC_ERR_PALETTEUNAVAILABLE; + hr = WINCODEC_ERR_PALETTEUNAVAILABLE; + goto end; } } else @@ -256,7 +253,11 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, tablesize = sizeof(WICColor) * count; wiccolors = HeapAlloc(GetProcessHeap(), 0, tablesize); - if (!wiccolors) return E_OUTOFMEMORY; + if (!wiccolors) + { + hr = E_OUTOFMEMORY; + goto end; + } offset.QuadPart = sizeof(BITMAPFILEHEADER) + This->bih.bV5Size; hr = IStream_Seek(This->stream, offset, STREAM_SEEK_SET, NULL); @@ -275,13 +276,18 @@ static HRESULT WINAPI BmpFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, } else { - return WINCODEC_ERR_PALETTEUNAVAILABLE; + hr = WINCODEC_ERR_PALETTEUNAVAILABLE; + goto end; } } - hr = IWICPalette_InitializeCustom(pIPalette, wiccolors, count); - end: + + LeaveCriticalSection(&This->lock); + + if (SUCCEEDED(hr)) + hr = IWICPalette_InitializeCustom(pIPalette, wiccolors, count); + HeapFree(GetProcessHeap(), 0, wiccolors); HeapFree(GetProcessHeap(), 0, bgrcolors); return hr; @@ -290,16 +296,18 @@ end: static HRESULT WINAPI BmpFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - BmpFrameDecode *This = (BmpFrameDecode*)iface; - HRESULT hr; + BmpDecoder *This = impl_from_frame(iface); + HRESULT hr=S_OK; UINT width, height; TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + EnterCriticalSection(&This->lock); if (!This->imagedata) { hr = This->read_data_func(This); - if (FAILED(hr)) return hr; } + LeaveCriticalSection(&This->lock); + if (FAILED(hr)) return hr; hr = BmpFrameDecode_GetSize(iface, &width, &height); if (FAILED(hr)) return hr; @@ -330,7 +338,7 @@ static HRESULT WINAPI BmpFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, return WINCODEC_ERR_CODECNOTHUMBNAIL; } -static HRESULT BmpFrameDecode_ReadUncompressed(BmpFrameDecode* This) +static HRESULT BmpFrameDecode_ReadUncompressed(BmpDecoder* This) { UINT bytesperrow; UINT width, height; @@ -387,7 +395,7 @@ fail: return hr; } -static HRESULT BmpFrameDecode_ReadRLE8(BmpFrameDecode* This) +static HRESULT BmpFrameDecode_ReadRLE8(BmpDecoder* This) { UINT bytesperrow; UINT width, height; @@ -493,7 +501,7 @@ fail: return hr; } -static HRESULT BmpFrameDecode_ReadRLE4(BmpFrameDecode* This) +static HRESULT BmpFrameDecode_ReadRLE4(BmpDecoder* This) { UINT bytesperrow; UINT width, height; @@ -614,7 +622,7 @@ fail: return hr; } -static HRESULT BmpFrameDecode_ReadUnsupported(BmpFrameDecode* This) +static HRESULT BmpFrameDecode_ReadUnsupported(BmpDecoder* This) { return E_FAIL; } @@ -637,7 +645,7 @@ static const struct bitfields_format bitfields_formats[] = { {0} }; -static const IWICBitmapFrameDecodeVtbl BmpFrameDecode_Vtbl = { +static const IWICBitmapFrameDecodeVtbl BmpDecoder_FrameVtbl = { BmpFrameDecode_QueryInterface, BmpFrameDecode_AddRef, BmpFrameDecode_Release, @@ -651,19 +659,6 @@ static const IWICBitmapFrameDecodeVtbl BmpFrameDecode_Vtbl = { BmpFrameDecode_GetThumbnail }; -typedef struct { - const IWICBitmapDecoderVtbl *lpVtbl; - LONG ref; - BOOL initialized; - IStream *stream; - BITMAPFILEHEADER bfh; - BITMAPV5HEADER bih; - BmpFrameDecode *framedecode; - const WICPixelFormatGUID *pixelformat; - int bitsperpixel; - ReadDataFunc read_data_func; -} BmpDecoder; - static HRESULT BmpDecoder_ReadHeaders(BmpDecoder* This, IStream *stream) { HRESULT hr; @@ -873,7 +868,9 @@ static ULONG WINAPI BmpDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { if (This->stream) IStream_Release(This->stream); - if (This->framedecode) IUnknown_Release((IUnknown*)This->framedecode); + HeapFree(GetProcessHeap(), 0, This->imagedata); + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This); } @@ -886,7 +883,9 @@ static HRESULT WINAPI BmpDecoder_QueryCapability(IWICBitmapDecoder *iface, IStre HRESULT hr; BmpDecoder *This = (BmpDecoder*)iface; + EnterCriticalSection(&This->lock); hr = BmpDecoder_ReadHeaders(This, pIStream); + LeaveCriticalSection(&This->lock); if (FAILED(hr)) return hr; if (This->read_data_func == BmpFrameDecode_ReadUnsupported) @@ -903,6 +902,7 @@ static HRESULT WINAPI BmpDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p HRESULT hr; BmpDecoder *This = (BmpDecoder*)iface; + EnterCriticalSection(&This->lock); hr = BmpDecoder_ReadHeaders(This, pIStream); if (SUCCEEDED(hr)) @@ -910,6 +910,7 @@ static HRESULT WINAPI BmpDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p This->stream = pIStream; IStream_AddRef(pIStream); } + LeaveCriticalSection(&This->lock); return hr; } @@ -992,25 +993,8 @@ static HRESULT WINAPI BmpDecoder_GetFrame(IWICBitmapDecoder *iface, if (!This->stream) return WINCODEC_ERR_WRONGSTATE; - if (!This->framedecode) - { - This->framedecode = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpFrameDecode)); - if (!This->framedecode) return E_OUTOFMEMORY; - - This->framedecode->lpVtbl = &BmpFrameDecode_Vtbl; - This->framedecode->ref = 1; - This->framedecode->stream = This->stream; - IStream_AddRef(This->stream); - This->framedecode->bfh = This->bfh; - This->framedecode->bih = This->bih; - This->framedecode->pixelformat = This->pixelformat; - This->framedecode->bitsperpixel = This->bitsperpixel; - This->framedecode->read_data_func = This->read_data_func; - This->framedecode->imagedata = NULL; - } - - *ppIBitmapFrame = (IWICBitmapFrameDecode*)This->framedecode; - IWICBitmapFrameDecode_AddRef((IWICBitmapFrameDecode*)This->framedecode); + *ppIBitmapFrame = (IWICBitmapFrameDecode*)&This->lpFrameVtbl; + IWICBitmapDecoder_AddRef(iface); return S_OK; } @@ -1047,10 +1031,13 @@ HRESULT BmpDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) if (!This) return E_OUTOFMEMORY; This->lpVtbl = &BmpDecoder_Vtbl; + This->lpFrameVtbl = &BmpDecoder_FrameVtbl; This->ref = 1; This->initialized = FALSE; This->stream = NULL; - This->framedecode = NULL; + This->imagedata = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": BmpDecoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/clsfactory.c b/dll/win32/windowscodecs/clsfactory.c index d8d21052d5e..68e0530fbdc 100644 --- a/dll/win32/windowscodecs/clsfactory.c +++ b/dll/win32/windowscodecs/clsfactory.c @@ -50,6 +50,7 @@ static classinfo wic_classes[] = { {&CLSID_WICGifDecoder, GifDecoder_CreateInstance}, {&CLSID_WICIcoDecoder, IcoDecoder_CreateInstance}, {&CLSID_WICJpegDecoder, JpegDecoder_CreateInstance}, + {&CLSID_WICTiffDecoder, TiffDecoder_CreateInstance}, {&CLSID_WICDefaultFormatConverter, FormatConverter_CreateInstance}, {0}}; diff --git a/dll/win32/windowscodecs/converter.c b/dll/win32/windowscodecs/converter.c index 15c7b0f380a..b1c0952b9a2 100644 --- a/dll/win32/windowscodecs/converter.c +++ b/dll/win32/windowscodecs/converter.c @@ -71,6 +71,7 @@ typedef struct FormatConverter { WICBitmapDitherType dither; double alpha_threshold; WICBitmapPaletteType palette_type; + CRITICAL_SECTION lock; /* must be held when initialized */ } FormatConverter; static void make_grayscale_palette(WICColor *colors, UINT num_colors) @@ -765,6 +766,8 @@ static ULONG WINAPI FormatConverter_Release(IWICFormatConverter *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); if (This->source) IWICBitmapSource_Release(This->source); HeapFree(GetProcessHeap(), 0, This); } @@ -841,38 +844,56 @@ static HRESULT WINAPI FormatConverter_Initialize(IWICFormatConverter *iface, const struct pixelformatinfo *srcinfo, *dstinfo; static INT fixme=0; GUID srcFormat; - HRESULT res; + HRESULT res=S_OK; TRACE("(%p,%p,%s,%u,%p,%0.1f,%u)\n", iface, pISource, debugstr_guid(dstFormat), dither, pIPalette, alphaThresholdPercent, paletteTranslate); if (pIPalette && !fixme++) FIXME("ignoring palette\n"); - if (This->source) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (This->source) + { + res = WINCODEC_ERR_WRONGSTATE; + goto end; + } res = IWICBitmapSource_GetPixelFormat(pISource, &srcFormat); - if (FAILED(res)) return res; + if (FAILED(res)) goto end; srcinfo = get_formatinfo(&srcFormat); - if (!srcinfo) return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT; + if (!srcinfo) + { + res = WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT; + goto end; + } dstinfo = get_formatinfo(dstFormat); - if (!dstinfo) return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT; + if (!dstinfo) + { + res = WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT; + goto end; + } if (dstinfo->copy_function) { IWICBitmapSource_AddRef(pISource); - This->source = pISource; This->src_format = srcinfo; This->dst_format = dstinfo; This->dither = dither; This->alpha_threshold = alphaThresholdPercent; This->palette_type = paletteTranslate; + This->source = pISource; } else - return WINCODEC_ERR_UNSUPPORTEDOPERATION; + res = WINCODEC_ERR_UNSUPPORTEDOPERATION; - return S_OK; +end: + + LeaveCriticalSection(&This->lock); + + return res; } static HRESULT WINAPI FormatConverter_CanConvert(IWICFormatConverter *iface, @@ -930,6 +951,8 @@ HRESULT FormatConverter_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** p This->lpVtbl = &FormatConverter_Vtbl; This->ref = 1; This->source = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": FormatConverter.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/gifformat.c b/dll/win32/windowscodecs/gifformat.c index 0597b1afbe3..3443b2c1ae1 100644 --- a/dll/win32/windowscodecs/gifformat.c +++ b/dll/win32/windowscodecs/gifformat.c @@ -40,6 +40,7 @@ typedef struct { LONG ref; BOOL initialized; GifFileType *gif; + CRITICAL_SECTION lock; } GifDecoder; typedef struct { @@ -302,6 +303,8 @@ static ULONG WINAPI GifDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); DGifCloseFile(This->gif); HeapFree(GetProcessHeap(), 0, This); } @@ -341,9 +344,12 @@ static HRESULT WINAPI GifDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions); + EnterCriticalSection(&This->lock); + if (This->initialized || This->gif) { WARN("already initialized\n"); + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_WRONGSTATE; } @@ -353,16 +359,26 @@ static HRESULT WINAPI GifDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p /* read all data from the stream */ This->gif = DGifOpen((void*)pIStream, _gif_inputfunc); - if (!This->gif) return E_FAIL; + if (!This->gif) + { + LeaveCriticalSection(&This->lock); + return E_FAIL; + } ret = DGifSlurp(This->gif); - if (ret == GIF_ERROR) return E_FAIL; + if (ret == GIF_ERROR) + { + LeaveCriticalSection(&This->lock); + return E_FAIL; + } /* make sure we don't use the stream after this method returns */ This->gif->UserData = NULL; This->initialized = TRUE; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -502,6 +518,8 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->ref = 1; This->initialized = FALSE; This->gif = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifDecoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/icoformat.c b/dll/win32/windowscodecs/icoformat.c index ab30ab0a8af..e1ea7c6c8d6 100644 --- a/dll/win32/windowscodecs/icoformat.c +++ b/dll/win32/windowscodecs/icoformat.c @@ -62,6 +62,7 @@ typedef struct { BOOL initialized; IStream *stream; ICONHEADER header; + CRITICAL_SECTION lock; /* must be held when accessing stream */ } IcoDecoder; typedef struct { @@ -512,15 +513,17 @@ static HRESULT WINAPI IcoFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { IcoFrameDecode *This = (IcoFrameDecode*)iface; - HRESULT hr; + HRESULT hr=S_OK; UINT width, height, stride; TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + EnterCriticalSection(&This->parent->lock); if (!This->bits) { hr = IcoFrameDecode_ReadPixels(This); - if (FAILED(hr)) return hr; } + LeaveCriticalSection(&This->parent->lock); + if (FAILED(hr)) return hr; width = This->entry.bWidth ? This->entry.bWidth : 256; height = This->entry.bHeight ? This->entry.bHeight : 256; @@ -606,6 +609,8 @@ static ULONG WINAPI IcoDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); if (This->stream) IStream_Release(This->stream); HeapFree(GetProcessHeap(), 0, This); } @@ -629,23 +634,37 @@ static HRESULT WINAPI IcoDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p ULONG bytesread; TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions); - if (This->initialized) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (This->initialized) + { + hr = WINCODEC_ERR_WRONGSTATE; + goto end; + } seek.QuadPart = 0; hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) return hr; + if (FAILED(hr)) goto end; hr = IStream_Read(pIStream, &This->header, sizeof(ICONHEADER), &bytesread); - if (FAILED(hr)) return hr; + if (FAILED(hr)) goto end; if (bytesread != sizeof(ICONHEADER) || This->header.idReserved != 0 || - This->header.idType != 1) return E_FAIL; + This->header.idType != 1) + { + hr = E_FAIL; + goto end; + } This->initialized = TRUE; This->stream = pIStream; IStream_AddRef(pIStream); - return S_OK; +end: + + LeaveCriticalSection(&This->lock); + + return hr; } static HRESULT WINAPI IcoDecoder_GetContainerFormat(IWICBitmapDecoder *iface, @@ -715,18 +734,32 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { IcoDecoder *This = (IcoDecoder*)iface; - IcoFrameDecode *result; + IcoFrameDecode *result=NULL; LARGE_INTEGER seek; HRESULT hr; ULONG bytesread; TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); - if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + EnterCriticalSection(&This->lock); - if (This->header.idCount < index) return E_INVALIDARG; + if (!This->initialized) + { + hr = WINCODEC_ERR_NOTINITIALIZED; + goto fail; + } + + if (This->header.idCount < index) + { + hr = E_INVALIDARG; + goto fail; + } result = HeapAlloc(GetProcessHeap(), 0, sizeof(IcoFrameDecode)); - if (!result) return E_OUTOFMEMORY; + if (!result) + { + hr = E_OUTOFMEMORY; + goto fail; + } result->lpVtbl = &IcoFrameDecode_Vtbl; result->ref = 1; @@ -745,9 +778,12 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + LeaveCriticalSection(&This->lock); + return S_OK; fail: + LeaveCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, result); if (SUCCEEDED(hr)) hr = E_FAIL; TRACE("<-- %x\n", hr); @@ -789,6 +825,8 @@ HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->ref = 1; This->stream = NULL; This->initialized = FALSE; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IcoDecoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/jpegformat.c b/dll/win32/windowscodecs/jpegformat.c index 017e6045790..b5676eaacc8 100644 --- a/dll/win32/windowscodecs/jpegformat.c +++ b/dll/win32/windowscodecs/jpegformat.c @@ -103,6 +103,7 @@ typedef struct { struct jpeg_source_mgr source_mgr; BYTE source_buffer[1024]; BYTE *image_data; + CRITICAL_SECTION lock; } JpegDecoder; static inline JpegDecoder *decoder_from_decompress(j_decompress_ptr decompress) @@ -156,6 +157,8 @@ static ULONG WINAPI JpegDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); if (This->cinfo_initialized) pjpeg_destroy_decompress(&This->cinfo); if (This->stream) IStream_Release(This->stream); HeapFree(GetProcessHeap(), 0, This->image_data); @@ -225,7 +228,13 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream * int ret; TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOptions); - if (This->cinfo_initialized) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (This->cinfo_initialized) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } This->cinfo.err = pjpeg_std_error(&This->jerr); @@ -249,6 +258,7 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream * if (ret != JPEG_HEADER_OK) { WARN("Jpeg image in stream has bad format, read header returned %d.\n",ret); + LeaveCriticalSection(&This->lock); return E_FAIL; } @@ -260,11 +270,14 @@ static HRESULT WINAPI JpegDecoder_Initialize(IWICBitmapDecoder *iface, IStream * if (!pjpeg_start_decompress(&This->cinfo)) { ERR("jpeg_start_decompress failed\n"); + LeaveCriticalSection(&This->lock); return E_FAIL; } This->initialized = TRUE; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -448,10 +461,16 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, max_row_needed = prc->Y + prc->Height; if (max_row_needed > This->cinfo.output_height) return E_INVALIDARG; + EnterCriticalSection(&This->lock); + if (!This->image_data) { This->image_data = HeapAlloc(GetProcessHeap(), 0, data_size); - if (!This->image_data) return E_OUTOFMEMORY; + if (!This->image_data) + { + LeaveCriticalSection(&This->lock); + return E_OUTOFMEMORY; + } } while (max_row_needed > This->cinfo.output_scanline) @@ -471,6 +490,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, if (ret == 0) { ERR("read_scanlines failed\n"); + LeaveCriticalSection(&This->lock); return E_FAIL; } @@ -492,6 +512,8 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, } } + LeaveCriticalSection(&This->lock); + return copy_pixels(bpp, This->image_data, This->cinfo.output_width, This->cinfo.output_height, stride, prc, cbStride, cbBufferSize, pbBuffer); @@ -559,6 +581,8 @@ HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->cinfo_initialized = FALSE; This->stream = NULL; This->image_data = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JpegDecoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/palette.c b/dll/win32/windowscodecs/palette.c index 842d3b51c30..40ab190958e 100644 --- a/dll/win32/windowscodecs/palette.c +++ b/dll/win32/windowscodecs/palette.c @@ -40,6 +40,7 @@ typedef struct { UINT count; WICColor *colors; WICBitmapPaletteType type; + CRITICAL_SECTION lock; /* must be held when count, colors, or type is accessed */ } PaletteImpl; static HRESULT WINAPI PaletteImpl_QueryInterface(IWICPalette *iface, REFIID iid, @@ -83,6 +84,8 @@ static ULONG WINAPI PaletteImpl_Release(IWICPalette *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This->colors); HeapFree(GetProcessHeap(), 0, This); } @@ -117,10 +120,12 @@ static HRESULT WINAPI PaletteImpl_InitializeCustom(IWICPalette *iface, memcpy(new_colors, pColors, sizeof(WICColor) * colorCount); } + EnterCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This->colors); This->colors = new_colors; This->count = colorCount; This->type = WICBitmapPaletteTypeCustom; + LeaveCriticalSection(&This->lock); return S_OK; } @@ -148,7 +153,9 @@ static HRESULT WINAPI PaletteImpl_GetType(IWICPalette *iface, if (!pePaletteType) return E_INVALIDARG; + EnterCriticalSection(&This->lock); *pePaletteType = This->type; + LeaveCriticalSection(&This->lock); return S_OK; } @@ -161,7 +168,9 @@ static HRESULT WINAPI PaletteImpl_GetColorCount(IWICPalette *iface, UINT *pcCoun if (!pcCount) return E_INVALIDARG; + EnterCriticalSection(&This->lock); *pcCount = This->count; + LeaveCriticalSection(&This->lock); return S_OK; } @@ -175,12 +184,16 @@ static HRESULT WINAPI PaletteImpl_GetColors(IWICPalette *iface, UINT colorCount, if (!pColors || !pcActualColors) return E_INVALIDARG; + EnterCriticalSection(&This->lock); + if (This->count < colorCount) colorCount = This->count; memcpy(pColors, This->colors, sizeof(WICColor) * colorCount); *pcActualColors = colorCount; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -192,10 +205,12 @@ static HRESULT WINAPI PaletteImpl_IsBlackWhite(IWICPalette *iface, BOOL *pfIsBla if (!pfIsBlackWhite) return E_INVALIDARG; + EnterCriticalSection(&This->lock); if (This->type == WICBitmapPaletteTypeFixedBW) *pfIsBlackWhite = TRUE; else *pfIsBlackWhite = FALSE; + LeaveCriticalSection(&This->lock); return S_OK; } @@ -208,6 +223,7 @@ static HRESULT WINAPI PaletteImpl_IsGrayscale(IWICPalette *iface, BOOL *pfIsGray if (!pfIsGrayscale) return E_INVALIDARG; + EnterCriticalSection(&This->lock); switch(This->type) { case WICBitmapPaletteTypeFixedBW: @@ -219,6 +235,7 @@ static HRESULT WINAPI PaletteImpl_IsGrayscale(IWICPalette *iface, BOOL *pfIsGray default: *pfIsGrayscale = FALSE; } + LeaveCriticalSection(&This->lock); return S_OK; } @@ -234,12 +251,14 @@ static HRESULT WINAPI PaletteImpl_HasAlpha(IWICPalette *iface, BOOL *pfHasAlpha) *pfHasAlpha = FALSE; + EnterCriticalSection(&This->lock); for (i=0; icount; i++) if ((This->colors[i]&0xff000000) != 0xff000000) { *pfHasAlpha = TRUE; break; } + LeaveCriticalSection(&This->lock); return S_OK; } @@ -272,6 +291,8 @@ HRESULT PaletteImpl_Create(IWICPalette **palette) This->count = 0; This->colors = NULL; This->type = WICBitmapPaletteTypeCustom; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PaletteImpl.lock"); *palette = (IWICPalette*)This; diff --git a/dll/win32/windowscodecs/pngformat.c b/dll/win32/windowscodecs/pngformat.c index 5af680e876c..3dcbd9aeb44 100644 --- a/dll/win32/windowscodecs/pngformat.c +++ b/dll/win32/windowscodecs/pngformat.c @@ -162,6 +162,7 @@ typedef struct { UINT stride; const WICPixelFormatGUID *format; BYTE *image_bits; + CRITICAL_SECTION lock; /* must be held when png structures are accessed or initialized is set */ } PngDecoder; static inline PngDecoder *impl_from_frame(IWICBitmapFrameDecode *iface) @@ -214,6 +215,8 @@ static ULONG WINAPI PngDecoder_Release(IWICBitmapDecoder *iface) { if (This->png_ptr) ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info); + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This->image_bits); HeapFree(GetProcessHeap(), 0, This); } @@ -246,7 +249,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p { PngDecoder *This = (PngDecoder*)iface; LARGE_INTEGER seek; - HRESULT hr; + HRESULT hr=S_OK; png_bytep *row_pointers=NULL; UINT image_size; UINT i; @@ -259,16 +262,23 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions); + EnterCriticalSection(&This->lock); + /* initialize libpng */ This->png_ptr = ppng_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - if (!This->png_ptr) return E_FAIL; + if (!This->png_ptr) + { + hr = E_FAIL; + goto end; + } This->info_ptr = ppng_create_info_struct(This->png_ptr); if (!This->info_ptr) { ppng_destroy_read_struct(&This->png_ptr, NULL, NULL); This->png_ptr = NULL; - return E_FAIL; + hr = E_FAIL; + goto end; } This->end_info = ppng_create_info_struct(This->png_ptr); @@ -276,7 +286,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p { ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, NULL); This->png_ptr = NULL; - return E_FAIL; + hr = E_FAIL; + goto end; } /* set up setjmp/longjmp error handling */ @@ -285,14 +296,15 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p ppng_destroy_read_struct(&This->png_ptr, &This->info_ptr, &This->end_info); HeapFree(GetProcessHeap(), 0, row_pointers); This->png_ptr = NULL; - return E_FAIL; + hr = E_FAIL; + goto end; } ppng_set_error_fn(This->png_ptr, &jmpbuf, user_error_fn, user_warning_fn); /* seek to the start of the stream */ seek.QuadPart = 0; hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) return hr; + if (FAILED(hr)) goto end; /* set up custom i/o handling */ ppng_set_read_fn(This->png_ptr, pIStream, user_read_data); @@ -340,7 +352,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p case 16: This->format = &GUID_WICPixelFormat16bppGray; break; default: ERR("invalid grayscale bit depth: %i\n", bit_depth); - return E_FAIL; + hr = E_FAIL; + goto end; } break; case PNG_COLOR_TYPE_GRAY_ALPHA: @@ -357,7 +370,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p case 16: This->format = &GUID_WICPixelFormat64bppRGBA; break; default: ERR("invalid RGBA bit depth: %i\n", bit_depth); - return E_FAIL; + hr = E_FAIL; + goto end; } break; case PNG_COLOR_TYPE_PALETTE: @@ -370,7 +384,8 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p case 8: This->format = &GUID_WICPixelFormat8bppIndexed; break; default: ERR("invalid indexed color bit depth: %i\n", bit_depth); - return E_FAIL; + hr = E_FAIL; + goto end; } break; case PNG_COLOR_TYPE_RGB: @@ -384,12 +399,14 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p case 16: This->format = &GUID_WICPixelFormat48bppRGB; break; default: ERR("invalid RGB color bit depth: %i\n", bit_depth); - return E_FAIL; + hr = E_FAIL; + goto end; } break; default: ERR("invalid color type %i\n", color_type); - return E_FAIL; + hr = E_FAIL; + goto end; } /* read the image data */ @@ -399,10 +416,18 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p image_size = This->stride * This->height; This->image_bits = HeapAlloc(GetProcessHeap(), 0, image_size); - if (!This->image_bits) return E_OUTOFMEMORY; + if (!This->image_bits) + { + hr = E_OUTOFMEMORY; + goto end; + } row_pointers = HeapAlloc(GetProcessHeap(), 0, sizeof(png_bytep)*This->height); - if (!row_pointers) return E_OUTOFMEMORY; + if (!row_pointers) + { + hr = E_OUTOFMEMORY; + goto end; + } for (i=0; iheight; i++) row_pointers[i] = This->image_bits + i * This->stride; @@ -416,7 +441,11 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p This->initialized = TRUE; - return S_OK; +end: + + LeaveCriticalSection(&This->lock); + + return hr; } static HRESULT WINAPI PngDecoder_GetContainerFormat(IWICBitmapDecoder *iface, @@ -570,6 +599,8 @@ static HRESULT WINAPI PngDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifac png_uint_32 ret, xres, yres; int unit_type; + EnterCriticalSection(&This->lock); + ret = ppng_get_pHYs(This->png_ptr, This->info_ptr, &xres, &yres, &unit_type); if (ret && unit_type == PNG_RESOLUTION_METER) @@ -583,6 +614,8 @@ static HRESULT WINAPI PngDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifac *pDpiX = *pDpiY = 96.0; } + LeaveCriticalSection(&This->lock); + TRACE("(%p)->(%0.2f,%0.2f)\n", iface, *pDpiX, *pDpiY); return S_OK; @@ -600,16 +633,24 @@ static HRESULT WINAPI PngDecoder_Frame_CopyPalette(IWICBitmapFrameDecode *iface, int num_trans; png_color_16p trans_values; int i; + HRESULT hr=S_OK; TRACE("(%p,%p)\n", iface, pIPalette); + EnterCriticalSection(&This->lock); + ret = ppng_get_PLTE(This->png_ptr, This->info_ptr, &png_palette, &num_palette); - if (!ret) return WINCODEC_ERR_PALETTEUNAVAILABLE; + if (!ret) + { + hr = WINCODEC_ERR_PALETTEUNAVAILABLE; + goto end; + } if (num_palette > 256) { ERR("palette has %i colors?!\n", num_palette); - return E_FAIL; + hr = E_FAIL; + goto end; } for (i=0; ilock); + + if (SUCCEEDED(hr)) + hr = IWICPalette_InitializeCustom(pIPalette, palette, num_palette); + + return hr; } static HRESULT WINAPI PngDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, @@ -706,6 +754,8 @@ HRESULT PngDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->end_info = NULL; This->initialized = FALSE; This->image_bits = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PngDecoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); @@ -752,6 +802,7 @@ typedef struct PngEncoder { UINT lines_written; BOOL frame_committed; BOOL committed; + CRITICAL_SECTION lock; } PngEncoder; static inline PngEncoder *encoder_from_frame(IWICBitmapFrameEncode *iface) @@ -800,10 +851,18 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface, PngEncoder *This = encoder_from_frame(iface); TRACE("(%p,%p)\n", iface, pIEncoderOptions); - if (This->frame_initialized) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (This->frame_initialized) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } This->frame_initialized = TRUE; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -813,11 +872,19 @@ static HRESULT WINAPI PngFrameEncode_SetSize(IWICBitmapFrameEncode *iface, PngEncoder *This = encoder_from_frame(iface); TRACE("(%p,%u,%u)\n", iface, uiWidth, uiHeight); - if (!This->frame_initialized || This->info_written) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (!This->frame_initialized || This->info_written) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } This->width = uiWidth; This->height = uiHeight; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -827,11 +894,19 @@ static HRESULT WINAPI PngFrameEncode_SetResolution(IWICBitmapFrameEncode *iface, PngEncoder *This = encoder_from_frame(iface); TRACE("(%p,%0.2f,%0.2f)\n", iface, dpiX, dpiY); - if (!This->frame_initialized || This->info_written) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (!This->frame_initialized || This->info_written) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } This->xres = dpiX; This->yres = dpiY; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -842,7 +917,13 @@ static HRESULT WINAPI PngFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface int i; TRACE("(%p,%s)\n", iface, debugstr_guid(pPixelFormat)); - if (!This->frame_initialized || This->info_written) return WINCODEC_ERR_WRONGSTATE; + EnterCriticalSection(&This->lock); + + if (!This->frame_initialized || This->info_written) + { + LeaveCriticalSection(&This->lock); + return WINCODEC_ERR_WRONGSTATE; + } for (i=0; formats[i].guid; i++) { @@ -855,6 +936,8 @@ static HRESULT WINAPI PngFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface This->format = &formats[i]; memcpy(pPixelFormat, This->format->guid, sizeof(GUID)); + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -888,15 +971,24 @@ static HRESULT WINAPI PngFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, jmp_buf jmpbuf; TRACE("(%p,%u,%u,%u,%p)\n", iface, lineCount, cbStride, cbBufferSize, pbPixels); + EnterCriticalSection(&This->lock); + if (!This->frame_initialized || !This->width || !This->height || !This->format) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_WRONGSTATE; + } if (lineCount == 0 || lineCount + This->lines_written > This->height) + { + LeaveCriticalSection(&This->lock); return E_INVALIDARG; + } /* set up setjmp/longjmp error handling */ if (setjmp(jmpbuf)) { + LeaveCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, row_pointers); return E_FAIL; } @@ -927,7 +1019,10 @@ static HRESULT WINAPI PngFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, row_pointers = HeapAlloc(GetProcessHeap(), 0, lineCount * sizeof(png_byte*)); if (!row_pointers) + { + LeaveCriticalSection(&This->lock); return E_OUTOFMEMORY; + } for (i=0; ipng_ptr, row_pointers, lineCount); This->lines_written += lineCount; + LeaveCriticalSection(&This->lock); + HeapFree(GetProcessHeap(), 0, row_pointers); return S_OK; @@ -1019,12 +1116,18 @@ static HRESULT WINAPI PngFrameEncode_Commit(IWICBitmapFrameEncode *iface) jmp_buf jmpbuf; TRACE("(%p)\n", iface); + EnterCriticalSection(&This->lock); + if (!This->info_written || This->lines_written != This->height || This->frame_committed) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_WRONGSTATE; + } /* set up setjmp/longjmp error handling */ if (setjmp(jmpbuf)) { + LeaveCriticalSection(&This->lock); return E_FAIL; } ppng_set_error_fn(This->png_ptr, &jmpbuf, user_error_fn, user_warning_fn); @@ -1033,6 +1136,8 @@ static HRESULT WINAPI PngFrameEncode_Commit(IWICBitmapFrameEncode *iface) This->frame_committed = TRUE; + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -1102,6 +1207,8 @@ static ULONG WINAPI PngEncoder_Release(IWICBitmapEncoder *iface) if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); if (This->png_ptr) ppng_destroy_write_struct(&This->png_ptr, &This->info_ptr); if (This->stream) @@ -1137,19 +1244,28 @@ static HRESULT WINAPI PngEncoder_Initialize(IWICBitmapEncoder *iface, TRACE("(%p,%p,%u)\n", iface, pIStream, cacheOption); + EnterCriticalSection(&This->lock); + if (This->png_ptr) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_WRONGSTATE; + } /* initialize libpng */ This->png_ptr = ppng_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!This->png_ptr) + { + LeaveCriticalSection(&This->lock); return E_FAIL; + } This->info_ptr = ppng_create_info_struct(This->png_ptr); if (!This->info_ptr) { ppng_destroy_write_struct(&This->png_ptr, NULL); This->png_ptr = NULL; + LeaveCriticalSection(&This->lock); return E_FAIL; } @@ -1163,6 +1279,7 @@ static HRESULT WINAPI PngEncoder_Initialize(IWICBitmapEncoder *iface, This->png_ptr = NULL; IStream_Release(This->stream); This->stream = NULL; + LeaveCriticalSection(&This->lock); return E_FAIL; } ppng_set_error_fn(This->png_ptr, &jmpbuf, user_error_fn, user_warning_fn); @@ -1170,6 +1287,8 @@ static HRESULT WINAPI PngEncoder_Initialize(IWICBitmapEncoder *iface, /* set up custom i/o handling */ ppng_set_write_fn(This->png_ptr, This, user_write_data, user_flush); + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -1219,17 +1338,31 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface, HRESULT hr; TRACE("(%p,%p,%p)\n", iface, ppIFrameEncode, ppIEncoderOptions); + EnterCriticalSection(&This->lock); + if (This->frame_count != 0) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_UNSUPPORTEDOPERATION; + } if (!This->stream) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_NOTINITIALIZED; + } hr = CreatePropertyBag2(ppIEncoderOptions); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + LeaveCriticalSection(&This->lock); + return hr; + } This->frame_count = 1; + LeaveCriticalSection(&This->lock); + IWICBitmapEncoder_AddRef(iface); *ppIFrameEncode = (IWICBitmapFrameEncode*)&This->lpFrameVtbl; @@ -1241,11 +1374,18 @@ static HRESULT WINAPI PngEncoder_Commit(IWICBitmapEncoder *iface) PngEncoder *This = (PngEncoder*)iface; TRACE("(%p)\n", iface); + EnterCriticalSection(&This->lock); + if (!This->frame_committed || This->committed) + { + LeaveCriticalSection(&This->lock); return WINCODEC_ERR_WRONGSTATE; + } This->committed = TRUE; + EnterCriticalSection(&This->lock); + return S_OK; } @@ -1309,6 +1449,8 @@ HRESULT PngEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->lines_written = 0; This->frame_committed = FALSE; This->committed = FALSE; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PngEncoder.lock"); ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); diff --git a/dll/win32/windowscodecs/regsvr.c b/dll/win32/windowscodecs/regsvr.c index c87aa4b2458..c5828a6b8b9 100644 --- a/dll/win32/windowscodecs/regsvr.c +++ b/dll/win32/windowscodecs/regsvr.c @@ -727,25 +727,25 @@ static struct regsvr_coclass const coclass_list[] = { "WIC Imaging Factory", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICBmpDecoder, "WIC BMP Decoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICPngDecoder, "WIC PNG Decoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICPngEncoder, "WIC PNG Encoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICBmpEncoder, "WIC BMP Encoder", @@ -757,25 +757,31 @@ static struct regsvr_coclass const coclass_list[] = { "WIC GIF Decoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICIcoDecoder, "WIC ICO Decoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { &CLSID_WICJpegDecoder, "WIC JPEG Decoder", NULL, "windowscodecs.dll", - "Apartment" + "Both" + }, + { &CLSID_WICTiffDecoder, + "WIC TIFF Decoder", + NULL, + "windowscodecs.dll", + "Both" }, { &CLSID_WICDefaultFormatConverter, "WIC Default Format Converter", NULL, "windowscodecs.dll", - "Apartment" + "Both" }, { NULL } /* list terminator */ }; @@ -868,6 +874,27 @@ static struct decoder_pattern const png_patterns[] = { {0} }; +static const BYTE tiff_magic_le[] = {0x49,0x49,42,0}; +static const BYTE tiff_magic_be[] = {0x4d,0x4d,0,42}; + +static GUID const * const tiff_formats[] = { + &GUID_WICPixelFormatBlackWhite, + &GUID_WICPixelFormat4bppGray, + &GUID_WICPixelFormat8bppGray, + &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, + &GUID_WICPixelFormat32bppBGR, + &GUID_WICPixelFormat32bppBGRA, + &GUID_WICPixelFormat32bppPBGRA, + NULL +}; + +static struct decoder_pattern const tiff_patterns[] = { + {4,0,tiff_magic_le,mask_all,0}, + {4,0,tiff_magic_be,mask_all,0}, + {0} +}; + static struct regsvr_decoder const decoder_list[] = { { &CLSID_WICBmpDecoder, "The Wine Project", @@ -919,6 +946,16 @@ static struct regsvr_decoder const decoder_list[] = { png_formats, png_patterns }, + { &CLSID_WICTiffDecoder, + "The Wine Project", + "TIFF Decoder", + "1.0.0.0", + &GUID_VendorMicrosoft, + "image/tiff", + ".tif;.tiff", + tiff_formats, + tiff_patterns + }, { NULL } /* list terminator */ }; diff --git a/dll/win32/windowscodecs/stream.c b/dll/win32/windowscodecs/stream.c index c59a9d27861..bd5592b9f30 100644 --- a/dll/win32/windowscodecs/stream.c +++ b/dll/win32/windowscodecs/stream.c @@ -41,6 +41,8 @@ typedef struct StreamOnMemory { BYTE *pbMemory; DWORD dwMemsize; DWORD dwCurPos; + + CRITICAL_SECTION lock; /* must be held when pbMemory or dwCurPos is accessed */ } StreamOnMemory; static HRESULT WINAPI StreamOnMemory_QueryInterface(IStream *iface, @@ -82,6 +84,8 @@ static ULONG WINAPI StreamOnMemory_Release(IStream *iface) TRACE("(%p) refcount=%u\n", iface, ref); if (ref == 0) { + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This); } return ref; @@ -96,9 +100,12 @@ static HRESULT WINAPI StreamOnMemory_Read(IStream *iface, if (!pv) return E_INVALIDARG; + EnterCriticalSection(&This->lock); uBytesRead = min(cb, This->dwMemsize - This->dwCurPos); memcpy(pv, This->pbMemory + This->dwCurPos, uBytesRead); This->dwCurPos += uBytesRead; + LeaveCriticalSection(&This->lock); + if (pcbRead) *pcbRead = uBytesRead; return S_OK; @@ -108,18 +115,24 @@ static HRESULT WINAPI StreamOnMemory_Write(IStream *iface, void const *pv, ULONG cb, ULONG *pcbWritten) { StreamOnMemory *This = (StreamOnMemory*)iface; + HRESULT hr; TRACE("(%p)\n", This); if (!pv) return E_INVALIDARG; - if (cb > This->dwMemsize - This->dwCurPos) return STG_E_MEDIUMFULL; - if (cb) { + EnterCriticalSection(&This->lock); + if (cb > This->dwMemsize - This->dwCurPos) { + hr = STG_E_MEDIUMFULL; + } + else { memcpy(This->pbMemory + This->dwCurPos, pv, cb); This->dwCurPos += cb; + hr = S_OK; + if (pcbWritten) *pcbWritten = cb; } - if (pcbWritten) *pcbWritten = cb; + LeaveCriticalSection(&This->lock); - return S_OK; + return hr; } static HRESULT WINAPI StreamOnMemory_Seek(IStream *iface, @@ -127,20 +140,29 @@ static HRESULT WINAPI StreamOnMemory_Seek(IStream *iface, { StreamOnMemory *This = (StreamOnMemory*)iface; LARGE_INTEGER NewPosition; + HRESULT hr=S_OK; TRACE("(%p)\n", This); + EnterCriticalSection(&This->lock); if (dwOrigin == STREAM_SEEK_SET) NewPosition.QuadPart = dlibMove.QuadPart; else if (dwOrigin == STREAM_SEEK_CUR) NewPosition.QuadPart = This->dwCurPos + dlibMove.QuadPart; else if (dwOrigin == STREAM_SEEK_END) NewPosition.QuadPart = This->dwMemsize + dlibMove.QuadPart; - else return E_INVALIDARG; + else hr = E_INVALIDARG; - if (NewPosition.u.HighPart) return HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); - if (NewPosition.QuadPart > This->dwMemsize) return E_INVALIDARG; - if (NewPosition.QuadPart < 0) return E_INVALIDARG; - This->dwCurPos = NewPosition.u.LowPart; + if (SUCCEEDED(hr)) { + if (NewPosition.u.HighPart) hr = HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW); + else if (NewPosition.QuadPart > This->dwMemsize) hr = E_INVALIDARG; + else if (NewPosition.QuadPart < 0) hr = E_INVALIDARG; + } - if(plibNewPosition) plibNewPosition->QuadPart = This->dwCurPos; - return S_OK; + if (SUCCEEDED(hr)) { + This->dwCurPos = NewPosition.u.LowPart; + + if(plibNewPosition) plibNewPosition->QuadPart = This->dwCurPos; + } + LeaveCriticalSection(&This->lock); + + return hr; } /* SetSize isn't implemented in the native windowscodecs DLL either */ @@ -450,8 +472,16 @@ static HRESULT WINAPI IWICStreamImpl_InitializeFromMemory(IWICStream *iface, pObject->pbMemory = pbBuffer; pObject->dwMemsize = cbBufferSize; pObject->dwCurPos = 0; + InitializeCriticalSection(&pObject->lock); + pObject->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": StreamOnMemory.lock"); + + if (InterlockedCompareExchangePointer((void**)&This->pStream, pObject, NULL)) + { + /* Some other thread set the stream first. */ + IStream_Release((IStream*)pObject); + return WINCODEC_ERR_WRONGSTATE; + } - This->pStream = (IStream*)pObject; return S_OK; } diff --git a/dll/win32/windowscodecs/tiffformat.c b/dll/win32/windowscodecs/tiffformat.c new file mode 100644 index 00000000000..fe87ddd6ba5 --- /dev/null +++ b/dll/win32/windowscodecs/tiffformat.c @@ -0,0 +1,866 @@ +/* + * Copyright 2010 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TIFFIO_H +#include +#endif + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "wincodec.h" + +#include "wincodecs_private.h" + +#include "wine/debug.h" +#include "wine/library.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); + +#ifdef SONAME_LIBTIFF + +static CRITICAL_SECTION init_tiff_cs; +static CRITICAL_SECTION_DEBUG init_tiff_cs_debug = +{ + 0, 0, &init_tiff_cs, + { &init_tiff_cs_debug.ProcessLocksList, + &init_tiff_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": init_tiff_cs") } +}; +static CRITICAL_SECTION init_tiff_cs = { &init_tiff_cs_debug, -1, 0, 0, 0, 0 }; + +static void *libtiff_handle; +#define MAKE_FUNCPTR(f) static typeof(f) * p##f +MAKE_FUNCPTR(TIFFClientOpen); +MAKE_FUNCPTR(TIFFClose); +MAKE_FUNCPTR(TIFFCurrentDirectory); +MAKE_FUNCPTR(TIFFGetField); +MAKE_FUNCPTR(TIFFReadDirectory); +MAKE_FUNCPTR(TIFFReadEncodedStrip); +MAKE_FUNCPTR(TIFFSetDirectory); +#undef MAKE_FUNCPTR + +static void *load_libtiff(void) +{ + void *result; + + EnterCriticalSection(&init_tiff_cs); + + if (!libtiff_handle && + (libtiff_handle = wine_dlopen(SONAME_LIBTIFF, RTLD_NOW, NULL, 0)) != NULL) + { + +#define LOAD_FUNCPTR(f) \ + if((p##f = wine_dlsym(libtiff_handle, #f, NULL, 0)) == NULL) { \ + ERR("failed to load symbol %s\n", #f); \ + libtiff_handle = NULL; \ + LeaveCriticalSection(&init_tiff_cs); \ + return NULL; \ + } + LOAD_FUNCPTR(TIFFClientOpen); + LOAD_FUNCPTR(TIFFClose); + LOAD_FUNCPTR(TIFFCurrentDirectory); + LOAD_FUNCPTR(TIFFGetField); + LOAD_FUNCPTR(TIFFReadDirectory); + LOAD_FUNCPTR(TIFFReadEncodedStrip); + LOAD_FUNCPTR(TIFFSetDirectory); +#undef LOAD_FUNCPTR + + } + + result = libtiff_handle; + + LeaveCriticalSection(&init_tiff_cs); + return result; +} + +static tsize_t tiff_stream_read(thandle_t client_data, tdata_t data, tsize_t size) +{ + IStream *stream = (IStream*)client_data; + ULONG bytes_read; + HRESULT hr; + + hr = IStream_Read(stream, data, size, &bytes_read); + if (FAILED(hr)) bytes_read = 0; + return bytes_read; +} + +static tsize_t tiff_stream_write(thandle_t client_data, tdata_t data, tsize_t size) +{ + IStream *stream = (IStream*)client_data; + ULONG bytes_written; + HRESULT hr; + + hr = IStream_Write(stream, data, size, &bytes_written); + if (FAILED(hr)) bytes_written = 0; + return bytes_written; +} + +static toff_t tiff_stream_seek(thandle_t client_data, toff_t offset, int whence) +{ + IStream *stream = (IStream*)client_data; + LARGE_INTEGER move; + DWORD origin; + ULARGE_INTEGER new_position; + HRESULT hr; + + move.QuadPart = offset; + switch (whence) + { + case SEEK_SET: + origin = STREAM_SEEK_SET; + break; + case SEEK_CUR: + origin = STREAM_SEEK_CUR; + break; + case SEEK_END: + origin = STREAM_SEEK_END; + break; + default: + ERR("unknown whence value %i\n", whence); + return -1; + } + + hr = IStream_Seek(stream, move, origin, &new_position); + if (SUCCEEDED(hr)) return new_position.QuadPart; + else return -1; +} + +static int tiff_stream_close(thandle_t client_data) +{ + /* Caller is responsible for releasing the stream object. */ + return 0; +} + +static toff_t tiff_stream_size(thandle_t client_data) +{ + IStream *stream = (IStream*)client_data; + STATSTG statstg; + HRESULT hr; + + hr = IStream_Stat(stream, &statstg, STATFLAG_NONAME); + + if (SUCCEEDED(hr)) return statstg.cbSize.QuadPart; + else return -1; +} + +static int tiff_stream_map(thandle_t client_data, tdata_t *addr, toff_t *size) +{ + /* Cannot mmap streams */ + return 0; +} + +static void tiff_stream_unmap(thandle_t client_data, tdata_t addr, toff_t size) +{ + /* No need to ever do this, since we can't map things. */ +} + +static TIFF* tiff_open_stream(IStream *stream, const char *mode) +{ + return pTIFFClientOpen("", mode, stream, tiff_stream_read, + tiff_stream_write, tiff_stream_seek, tiff_stream_close, + tiff_stream_size, tiff_stream_map, tiff_stream_unmap); +} + +typedef struct { + const IWICBitmapDecoderVtbl *lpVtbl; + LONG ref; + IStream *stream; + CRITICAL_SECTION lock; /* Must be held when tiff is used or initiailzed is set */ + TIFF *tiff; + BOOL initialized; +} TiffDecoder; + +typedef struct { + const WICPixelFormatGUID *format; + int bpp; + int indexed; + int reverse_bgr; + UINT width, height; + UINT tile_width, tile_height; + UINT tile_stride; + UINT tile_size; +} tiff_decode_info; + +typedef struct { + const IWICBitmapFrameDecodeVtbl *lpVtbl; + LONG ref; + TiffDecoder *parent; + UINT index; + tiff_decode_info decode_info; + INT cached_tile_x, cached_tile_y; + BYTE *cached_tile; +} TiffFrameDecode; + +static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl; + +static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) +{ + uint16 photometric, bps, samples, planar; + int ret; + + decode_info->indexed = 0; + decode_info->reverse_bgr = 0; + + ret = pTIFFGetField(tiff, TIFFTAG_PHOTOMETRIC, &photometric); + if (!ret) + { + WARN("missing PhotometricInterpretation tag\n"); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_BITSPERSAMPLE, &bps); + if (!ret) bps = 1; + + switch(photometric) + { + case 1: /* BlackIsZero */ + decode_info->bpp = bps; + switch (bps) + { + case 1: + decode_info->format = &GUID_WICPixelFormatBlackWhite; + break; + case 4: + decode_info->format = &GUID_WICPixelFormat4bppGray; + break; + case 8: + decode_info->format = &GUID_WICPixelFormat8bppGray; + break; + default: + FIXME("unhandled greyscale bit count %u\n", bps); + return E_FAIL; + } + break; + case 2: /* RGB */ + if (bps != 8) + { + FIXME("unhandled RGB bit count %u\n", bps); + return E_FAIL; + } + ret = pTIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, &samples); + if (samples != 3) + { + FIXME("unhandled RGB sample count %u\n", samples); + return E_FAIL; + } + ret = pTIFFGetField(tiff, TIFFTAG_PLANARCONFIG, &planar); + if (!ret) planar = 1; + if (planar != 1) + { + FIXME("unhandled planar configuration %u\n", planar); + return E_FAIL; + } + decode_info->bpp = bps * samples; + decode_info->reverse_bgr = 1; + decode_info->format = &GUID_WICPixelFormat24bppBGR; + break; + case 3: /* RGB Palette */ + decode_info->indexed = 1; + decode_info->bpp = bps; + switch (bps) + { + case 4: + decode_info->format = &GUID_WICPixelFormat4bppIndexed; + break; + case 8: + decode_info->format = &GUID_WICPixelFormat8bppIndexed; + break; + default: + FIXME("unhandled indexed bit count %u\n", bps); + return E_FAIL; + } + break; + case 0: /* WhiteIsZero */ + case 4: /* Transparency mask */ + case 5: /* CMYK */ + case 6: /* YCbCr */ + case 8: /* CIELab */ + default: + FIXME("unhandled PhotometricInterpretation %u\n", photometric); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &decode_info->width); + if (!ret) + { + WARN("missing image width\n"); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &decode_info->height); + if (!ret) + { + WARN("missing image length\n"); + return E_FAIL; + } + + ret = pTIFFGetField(tiff, TIFFTAG_ROWSPERSTRIP, &decode_info->tile_height); + if (ret) + { + decode_info->tile_width = decode_info->width; + decode_info->tile_stride = ((decode_info->bpp * decode_info->tile_width + 7)/8); + decode_info->tile_size = decode_info->tile_height * decode_info->tile_stride; + } + else + { + /* Probably a tiled image */ + FIXME("missing RowsPerStrip value\n"); + return E_FAIL; + } + + return S_OK; +} + +static HRESULT WINAPI TiffDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, + void **ppv) +{ + TiffDecoder *This = (TiffDecoder*)iface; + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapDecoder, iid)) + { + *ppv = This; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI TiffDecoder_AddRef(IWICBitmapDecoder *iface) +{ + TiffDecoder *This = (TiffDecoder*)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI TiffDecoder_Release(IWICBitmapDecoder *iface) +{ + TiffDecoder *This = (TiffDecoder*)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + if (This->tiff) pTIFFClose(This->tiff); + if (This->stream) IStream_Release(This->stream); + This->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&This->lock); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI TiffDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *pIStream, + DWORD *pdwCapability) +{ + FIXME("(%p,%p,%p): stub\n", iface, pIStream, pdwCapability); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, + WICDecodeOptions cacheOptions) +{ + TiffDecoder *This = (TiffDecoder*)iface; + TIFF *tiff; + HRESULT hr=S_OK; + + TRACE("(%p,%p,%x): stub\n", iface, pIStream, cacheOptions); + + EnterCriticalSection(&This->lock); + + if (This->initialized) + { + hr = WINCODEC_ERR_WRONGSTATE; + goto exit; + } + + tiff = tiff_open_stream(pIStream, "r"); + + if (!tiff) + { + hr = E_FAIL; + goto exit; + } + + This->tiff = tiff; + This->stream = pIStream; + IStream_AddRef(pIStream); + This->initialized = TRUE; + +exit: + LeaveCriticalSection(&This->lock); + return hr; +} + +static HRESULT WINAPI TiffDecoder_GetContainerFormat(IWICBitmapDecoder *iface, + GUID *pguidContainerFormat) +{ + memcpy(pguidContainerFormat, &GUID_ContainerFormatTiff, sizeof(GUID)); + return S_OK; +} + +static HRESULT WINAPI TiffDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, + IWICBitmapDecoderInfo **ppIDecoderInfo) +{ + FIXME("(%p,%p): stub\n", iface, ppIDecoderInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_CopyPalette(IWICBitmapDecoder *iface, + IWICPalette *pIPalette) +{ + FIXME("(%p,%p): stub\n", iface, pIPalette); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_GetPreview(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIBitmapSource) +{ + FIXME("(%p,%p): stub\n", iface, ppIBitmapSource); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_GetColorContexts(IWICBitmapDecoder *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + FIXME("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffDecoder_GetThumbnail(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIThumbnail) +{ + TRACE("(%p,%p)\n", iface, ppIThumbnail); + return WINCODEC_ERR_CODECNOTHUMBNAIL; +} + +static HRESULT WINAPI TiffDecoder_GetFrameCount(IWICBitmapDecoder *iface, + UINT *pCount) +{ + TiffDecoder *This = (TiffDecoder*)iface; + + if (!This->tiff) + { + WARN("(%p) <-- WINCODEC_ERR_WRONGSTATE\n", iface); + return WINCODEC_ERR_WRONGSTATE; + } + + EnterCriticalSection(&This->lock); + while (pTIFFReadDirectory(This->tiff)) { } + *pCount = pTIFFCurrentDirectory(This->tiff)+1; + LeaveCriticalSection(&This->lock); + + TRACE("(%p) <-- %i\n", iface, *pCount); + + return S_OK; +} + +static HRESULT WINAPI TiffDecoder_GetFrame(IWICBitmapDecoder *iface, + UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) +{ + TiffDecoder *This = (TiffDecoder*)iface; + TiffFrameDecode *result; + int res; + tiff_decode_info decode_info; + HRESULT hr; + + TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); + + if (!This->tiff) + return WINCODEC_ERR_WRONGSTATE; + + EnterCriticalSection(&This->lock); + res = pTIFFSetDirectory(This->tiff, index); + if (!res) hr = E_INVALIDARG; + else hr = tiff_get_decode_info(This->tiff, &decode_info); + LeaveCriticalSection(&This->lock); + + if (SUCCEEDED(hr)) + { + result = HeapAlloc(GetProcessHeap(), 0, sizeof(TiffFrameDecode)); + + if (result) + { + result->lpVtbl = &TiffFrameDecode_Vtbl; + result->ref = 1; + result->parent = This; + result->index = index; + result->decode_info = decode_info; + result->cached_tile_x = -1; + result->cached_tile = HeapAlloc(GetProcessHeap(), 0, decode_info.tile_size); + + if (result->cached_tile) + *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + else + { + hr = E_OUTOFMEMORY; + HeapFree(GetProcessHeap(), 0, result); + } + } + else hr = E_OUTOFMEMORY; + } + + if (FAILED(hr)) *ppIBitmapFrame = NULL; + + return hr; +} + +static const IWICBitmapDecoderVtbl TiffDecoder_Vtbl = { + TiffDecoder_QueryInterface, + TiffDecoder_AddRef, + TiffDecoder_Release, + TiffDecoder_QueryCapability, + TiffDecoder_Initialize, + TiffDecoder_GetContainerFormat, + TiffDecoder_GetDecoderInfo, + TiffDecoder_CopyPalette, + TiffDecoder_GetMetadataQueryReader, + TiffDecoder_GetPreview, + TiffDecoder_GetColorContexts, + TiffDecoder_GetThumbnail, + TiffDecoder_GetFrameCount, + TiffDecoder_GetFrame +}; + +static HRESULT WINAPI TiffFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, + void **ppv) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || + IsEqualIID(&IID_IWICBitmapSource, iid) || + IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) + { + *ppv = This; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI TiffFrameDecode_AddRef(IWICBitmapFrameDecode *iface) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + HeapFree(GetProcessHeap(), 0, This->cached_tile); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface, + UINT *puiWidth, UINT *puiHeight) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + + *puiWidth = This->decode_info.width; + *puiHeight = This->decode_info.height; + + TRACE("(%p) <-- %ux%u\n", iface, *puiWidth, *puiHeight); + + return S_OK; +} + +static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, + WICPixelFormatGUID *pPixelFormat) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + + memcpy(pPixelFormat, This->decode_info.format, sizeof(GUID)); + + TRACE("(%p) <-- %s\n", This, debugstr_guid(This->decode_info.format)); + + return S_OK; +} + +static HRESULT WINAPI TiffFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, + double *pDpiX, double *pDpiY) +{ + FIXME("(%p,%p,%p)\n", iface, pDpiX, pDpiY); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, + IWICPalette *pIPalette) +{ + FIXME("(%p,%p)\n", iface, pIPalette); + return E_NOTIMPL; +} + +static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT tile_y) +{ + HRESULT hr=S_OK; + tsize_t ret; + + ret = pTIFFSetDirectory(This->parent->tiff, This->index); + + if (ret == -1) + hr = E_FAIL; + + if (hr == S_OK) + { + ret = pTIFFReadEncodedStrip(This->parent->tiff, tile_y, This->cached_tile, This->decode_info.tile_size); + + if (ret == -1) + hr = E_FAIL; + } + + if (hr == S_OK && This->decode_info.reverse_bgr) + { + if (This->decode_info.format == &GUID_WICPixelFormat24bppBGR) + { + UINT i, total_pixels; + BYTE *pixel, temp; + + total_pixels = This->decode_info.tile_width * This->decode_info.tile_height; + pixel = This->cached_tile; + for (i=0; icached_tile_x = tile_x; + This->cached_tile_y = tile_y; + } + + return hr; +} + +static HRESULT WINAPI TiffFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, + const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) +{ + TiffFrameDecode *This = (TiffFrameDecode*)iface; + UINT min_tile_x, max_tile_x, min_tile_y, max_tile_y; + UINT tile_x, tile_y; + WICRect rc; + HRESULT hr=S_OK; + BYTE *dst_tilepos; + UINT bytesperrow; + + TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + + if (prc->X < 0 || prc->Y < 0 || prc->X+prc->Width > This->decode_info.width || + prc->Y+prc->Height > This->decode_info.height) + return E_INVALIDARG; + + bytesperrow = ((This->decode_info.bpp * prc->Width)+7)/8; + + if (cbStride < bytesperrow) + return E_INVALIDARG; + + if ((cbStride * prc->Height) > cbBufferSize) + return E_INVALIDARG; + + min_tile_x = prc->X / This->decode_info.tile_width; + min_tile_y = prc->Y / This->decode_info.tile_height; + max_tile_x = (prc->X+prc->Width-1) / This->decode_info.tile_width; + max_tile_y = (prc->Y+prc->Height-1) / This->decode_info.tile_height; + + EnterCriticalSection(&This->parent->lock); + + for (tile_x=min_tile_x; tile_x <= max_tile_x; tile_x++) + { + for (tile_y=min_tile_y; tile_y <= max_tile_y; tile_y++) + { + if (tile_x != This->cached_tile_x || tile_y != This->cached_tile_y) + { + hr = TiffFrameDecode_ReadTile(This, tile_x, tile_y); + } + + if (SUCCEEDED(hr)) + { + if (prc->X < tile_x * This->decode_info.tile_width) + rc.X = 0; + else + rc.X = prc->X - tile_x * This->decode_info.tile_width; + + if (prc->Y < tile_y * This->decode_info.tile_height) + rc.Y = 0; + else + rc.Y = prc->Y - tile_y * This->decode_info.tile_height; + + if (prc->X+prc->Width > (tile_x+1) * This->decode_info.tile_width) + rc.Width = This->decode_info.tile_width - rc.X; + else + rc.Width = prc->Width + rc.X - prc->X; + + if (prc->Y+prc->Height > (tile_y+1) * This->decode_info.tile_height) + rc.Height = This->decode_info.tile_height - rc.Y; + else + rc.Height = prc->Height + rc.Y - prc->Y; + + dst_tilepos = pbBuffer + (cbStride * (rc.Y - prc->Y)) + + ((This->decode_info.bpp * (rc.X - prc->X) + 7) / 8); + + hr = copy_pixels(This->decode_info.bpp, This->cached_tile, + This->decode_info.tile_width, This->decode_info.tile_height, This->decode_info.tile_stride, + &rc, cbStride, cbBufferSize, dst_tilepos); + } + + if (FAILED(hr)) + { + LeaveCriticalSection(&This->parent->lock); + TRACE("<-- 0x%x\n", hr); + return hr; + } + } + } + + LeaveCriticalSection(&This->parent->lock); + + return S_OK; +} + +static HRESULT WINAPI TiffFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + FIXME("(%p,%p): stub\n", iface, ppIMetadataQueryReader); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + FIXME("(%p,%u,%p,%p): stub\n", iface, cCount, ppIColorContexts, pcActualCount); + return E_NOTIMPL; +} + +static HRESULT WINAPI TiffFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, + IWICBitmapSource **ppIThumbnail) +{ + FIXME("(%p,%p): stub\n", iface, ppIThumbnail); + return E_NOTIMPL; +} + +static const IWICBitmapFrameDecodeVtbl TiffFrameDecode_Vtbl = { + TiffFrameDecode_QueryInterface, + TiffFrameDecode_AddRef, + TiffFrameDecode_Release, + TiffFrameDecode_GetSize, + TiffFrameDecode_GetPixelFormat, + TiffFrameDecode_GetResolution, + TiffFrameDecode_CopyPalette, + TiffFrameDecode_CopyPixels, + TiffFrameDecode_GetMetadataQueryReader, + TiffFrameDecode_GetColorContexts, + TiffFrameDecode_GetThumbnail +}; + +HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) +{ + HRESULT ret; + TiffDecoder *This; + + TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv); + + *ppv = NULL; + + if (pUnkOuter) return CLASS_E_NOAGGREGATION; + + if (!load_libtiff()) + { + ERR("Failed reading TIFF because unable to load %s\n",SONAME_LIBTIFF); + return E_FAIL; + } + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(TiffDecoder)); + if (!This) return E_OUTOFMEMORY; + + This->lpVtbl = &TiffDecoder_Vtbl; + This->ref = 1; + This->stream = NULL; + InitializeCriticalSection(&This->lock); + This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TiffDecoder.lock"); + This->tiff = NULL; + This->initialized = FALSE; + + ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); + IUnknown_Release((IUnknown*)This); + + return ret; +} + +#else /* !SONAME_LIBTIFF */ + +HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) +{ + ERR("Trying to load TIFF picture, but Wine was compiled without TIFF support.\n"); + return E_FAIL; +} + +#endif diff --git a/dll/win32/windowscodecs/wincodecs_private.h b/dll/win32/windowscodecs/wincodecs_private.h index 632f82206da..0e72793dafc 100644 --- a/dll/win32/windowscodecs/wincodecs_private.h +++ b/dll/win32/windowscodecs/wincodecs_private.h @@ -28,6 +28,7 @@ extern HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** extern HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID riid, void** ppv); extern HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); +extern HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT PaletteImpl_Create(IWICPalette **palette); extern HRESULT StreamImpl_Create(IWICStream **stream); diff --git a/dll/win32/windowscodecs/windowscodecs.rbuild b/dll/win32/windowscodecs/windowscodecs.rbuild index 563a7a99352..da8e3e46618 100644 --- a/dll/win32/windowscodecs/windowscodecs.rbuild +++ b/dll/win32/windowscodecs/windowscodecs.rbuild @@ -28,6 +28,7 @@ propertybag.c regsvr.c stream.c + tiffformat.c ungif.c version.rc diff --git a/dll/win32/wininet/internet.c b/dll/win32/wininet/internet.c index f4b8a0a3abd..6fc8a212c89 100644 --- a/dll/win32/wininet/internet.c +++ b/dll/win32/wininet/internet.c @@ -102,8 +102,8 @@ static CRITICAL_SECTION_DEBUG WININET_cs_debug = static CRITICAL_SECTION WININET_cs = { &WININET_cs_debug, -1, 0, 0, 0, 0 }; static object_header_t **WININET_Handles; -static UINT WININET_dwNextHandle; -static UINT WININET_dwMaxHandles; +static UINT_PTR WININET_dwNextHandle; +static UINT_PTR WININET_dwMaxHandles; typedef struct { @@ -122,7 +122,7 @@ static const WCHAR szProxyEnable[] = { 'P','r','o','x','y','E','n','a','b','l',' HINTERNET WININET_AllocHandle( object_header_t *info ) { object_header_t **p; - UINT handle = 0, num; + UINT_PTR handle = 0, num; list_init( &info->children ); @@ -173,7 +173,7 @@ object_header_t *WININET_AddRef( object_header_t *info ) object_header_t *WININET_GetObject( HINTERNET hinternet ) { object_header_t *info = NULL; - UINT handle = (UINT) hinternet; + UINT_PTR handle = (UINT_PTR) hinternet; EnterCriticalSection( &WININET_cs ); @@ -183,7 +183,7 @@ object_header_t *WININET_GetObject( HINTERNET hinternet ) LeaveCriticalSection( &WININET_cs ); - TRACE("handle %d -> %p\n", handle, info); + TRACE("handle %ld -> %p\n", handle, info); return info; } @@ -218,7 +218,7 @@ BOOL WININET_Release( object_header_t *info ) BOOL WININET_FreeHandle( HINTERNET hinternet ) { BOOL ret = FALSE; - UINT handle = (UINT) hinternet; + UINT_PTR handle = (UINT_PTR) hinternet; object_header_t *info = NULL, *child, *next; EnterCriticalSection( &WININET_cs ); @@ -229,7 +229,7 @@ BOOL WININET_FreeHandle( HINTERNET hinternet ) if( WININET_Handles[handle] ) { info = WININET_Handles[handle]; - TRACE( "destroying handle %d for object %p\n", handle+1, info); + TRACE( "destroying handle %ld for object %p\n", handle+1, info); WININET_Handles[handle] = NULL; ret = TRUE; } @@ -245,8 +245,8 @@ BOOL WININET_FreeHandle( HINTERNET hinternet ) /* Free all children as native does */ LIST_FOR_EACH_ENTRY_SAFE( child, next, &info->children, object_header_t, entry ) { - TRACE( "freeing child handle %d for parent handle %d\n", - (UINT)child->hInternet, handle+1); + TRACE( "freeing child handle %ld for parent handle %ld\n", + (UINT_PTR)child->hInternet, handle+1); WININET_FreeHandle( child->hInternet ); } WININET_Release( info ); diff --git a/dll/win32/wininet/urlcache.c b/dll/win32/wininet/urlcache.c index 29d26ab0b6b..6a39c691475 100644 --- a/dll/win32/wininet/urlcache.c +++ b/dll/win32/wininet/urlcache.c @@ -986,9 +986,9 @@ static DWORD URLCache_CopyEntry( ZeroMemory((LPBYTE)lpCacheEntryInfo + dwRequiredSize, 4 - (dwRequiredSize % 4)); dwRequiredSize = DWORD_ALIGN(dwRequiredSize); if (bUnicode) - lenUrl = MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, NULL, 0); + lenUrl = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, NULL, 0); else - lenUrl = strlen((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); + lenUrl = strlen((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); dwRequiredSize += (lenUrl + 1) * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); /* FIXME: is source url optional? */ @@ -998,9 +998,9 @@ static DWORD URLCache_CopyEntry( lpCacheEntryInfo->lpszSourceUrlName = (LPSTR)lpCacheEntryInfo + dwRequiredSize - lenUrlBytes; if (bUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenUrl + 1); + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenUrl + 1); else - memcpy(lpCacheEntryInfo->lpszSourceUrlName, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, lenUrlBytes); + memcpy(lpCacheEntryInfo->lpszSourceUrlName, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, lenUrlBytes); } if ((dwRequiredSize % 4) && (dwRequiredSize < *lpdwBufferSize)) @@ -1029,7 +1029,7 @@ static DWORD URLCache_CopyEntry( if (*lpdwBufferSize >= dwRequiredSize) { lpCacheEntryInfo->lpHeaderInfo = (LPBYTE)lpCacheEntryInfo + dwRequiredSize - pUrlEntry->dwHeaderInfoSize - 1; - memcpy(lpCacheEntryInfo->lpHeaderInfo, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo, pUrlEntry->dwHeaderInfoSize); + memcpy(lpCacheEntryInfo->lpHeaderInfo, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo, pUrlEntry->dwHeaderInfoSize); ((LPBYTE)lpCacheEntryInfo)[dwRequiredSize - 1] = '\0'; } if ((dwRequiredSize % 4) && (dwRequiredSize < *lpdwBufferSize)) @@ -1041,18 +1041,18 @@ static DWORD URLCache_CopyEntry( int lenExtension; if (bUnicode) - lenExtension = MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, NULL, 0); + lenExtension = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, NULL, 0); else - lenExtension = strlen((LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension) + 1; + lenExtension = strlen((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension) + 1; dwRequiredSize += lenExtension * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); if (*lpdwBufferSize >= dwRequiredSize) { lpCacheEntryInfo->lpszFileExtension = (LPSTR)lpCacheEntryInfo + dwRequiredSize - lenExtension; if (bUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenExtension); + MultiByteToWideChar(CP_ACP, 0, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenExtension); else - memcpy(lpCacheEntryInfo->lpszFileExtension, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, lenExtension * sizeof(CHAR)); + memcpy(lpCacheEntryInfo->lpszFileExtension, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetFileExtension, lenExtension * sizeof(CHAR)); } if ((dwRequiredSize % 4) && (dwRequiredSize < *lpdwBufferSize)) @@ -1175,8 +1175,8 @@ static inline HASH_CACHEFILE_ENTRY * URLCache_HashEntryFromOffset(LPCURLCACHE_HE static inline BOOL URLCache_IsHashEntryValid(LPCURLCACHE_HEADER pHeader, const HASH_CACHEFILE_ENTRY *pHashEntry) { /* check pHashEntry located within acceptable bounds in the URL cache mapping */ - return ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && - ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize); + return ((DWORD)((const BYTE*)pHashEntry - (const BYTE*)pHeader) >= ENTRY_START_OFFSET) && + ((DWORD)((const BYTE*)pHashEntry - (const BYTE*)pHeader) < pHeader->dwFileSize); } static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct _HASH_ENTRY ** ppHashEntry) @@ -1557,15 +1557,15 @@ BOOL WINAPI GetUrlCacheEntryInfoA( if (pEntry->dwSignature != URL_SIGNATURE) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPSTR)&pEntry->dwSignature, sizeof(DWORD))); + FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD))); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry; - TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl)); + TRACE("Found URL: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl)); if (pUrlEntry->dwOffsetHeaderInfo) - TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); + TRACE("Header info: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); if (lpdwCacheEntryInfoBufferSize) { @@ -1639,14 +1639,14 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, if (pEntry->dwSignature != URL_SIGNATURE) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPSTR)&pEntry->dwSignature, sizeof(DWORD))); + FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD))); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry; - TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl)); - TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); + TRACE("Found URL: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl)); + TRACE("Header info: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); if (lpdwCacheEntryInfoBufferSize) { @@ -3265,9 +3265,9 @@ BOOL WINAPI FindNextUrlCacheEntryA( if (pEntry->dwSignature != URL_SIGNATURE) continue; - pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry; - TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); - TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); + pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry; + TRACE("Found URL: %s\n", (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); + TRACE("Header info: %s\n", (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); error = URLCache_CopyEntry( pContainer, @@ -3563,7 +3563,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas if (pEntry->dwSignature != URL_SIGNATURE) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPSTR)&pEntry->dwSignature, sizeof(DWORD))); + FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD))); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } @@ -3625,7 +3625,7 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa if (pEntry->dwSignature != URL_SIGNATURE) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPSTR)&pEntry->dwSignature, sizeof(DWORD))); + FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD))); SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } diff --git a/dll/win32/wintrust/asn.c b/dll/win32/wintrust/asn.c index 69c9dd3d604..865926640a3 100644 --- a/dll/win32/wintrust/asn.c +++ b/dll/win32/wintrust/asn.c @@ -1348,7 +1348,7 @@ static BOOL CRYPT_AsnDecodeSPCLinkInternal(DWORD dwCertEncodingType, link->dwLinkChoice = SPC_FILE_LINK_CHOICE; for (i = 0; i < dataLen / sizeof(WCHAR); i++) link->u.pwszFile[i] = - hton16(*(WORD *)(ptr + i * sizeof(WCHAR))); + hton16(*(const WORD *)(ptr + i * sizeof(WCHAR))); link->u.pwszFile[realDataLen / sizeof(WCHAR)] = '\0'; TRACE("returning file %s\n", debugstr_w(link->u.pwszFile)); } diff --git a/dll/win32/ws2_32/misc/ns.c b/dll/win32/ws2_32/misc/ns.c index bb89eadfb0d..fee4f032868 100644 --- a/dll/win32/ws2_32/misc/ns.c +++ b/dll/win32/ws2_32/misc/ns.c @@ -640,7 +640,199 @@ void free_servent(struct servent* s) HFREE(s); } +/* This function is far from perfect but it works enough */ +static +LPHOSTENT +FindEntryInHosts(IN CONST CHAR FAR* name) +{ + BOOL Found = FALSE; + HANDLE HostsFile; + CHAR HostsDBData[BUFSIZ] = { 0 }; + PCHAR SystemDirectory = HostsDBData; + PCHAR HostsLocation = "\\drivers\\etc\\hosts"; + PCHAR AddressStr, DnsName = NULL, AddrTerm, NameSt, NextLine, ThisLine, Comment; + UINT SystemDirSize = sizeof(HostsDBData) - 1, ValidData = 0; + DWORD ReadSize; + ULONG Address; + PWINSOCK_THREAD_BLOCK p = NtCurrentTeb()->WinSockData; + /* We assume that the parameters are valid */ + + if (!GetSystemDirectoryA(SystemDirectory, SystemDirSize)) + { + WSASetLastError(WSANO_RECOVERY); + WS_DbgPrint(MIN_TRACE, ("Could not get windows system directory.\n")); + return NULL; /* Can't get system directory */ + } + + strncat(SystemDirectory, + HostsLocation, + SystemDirSize ); + + HostsFile = CreateFileA(SystemDirectory, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, + NULL); + if (HostsFile == INVALID_HANDLE_VALUE) + { + WSASetLastError(WSANO_RECOVERY); + return NULL; + } + + while(!Found && + ReadFile(HostsFile, + HostsDBData + ValidData, + sizeof(HostsDBData) - ValidData, + &ReadSize, + NULL)) + { + ValidData += ReadSize; + ReadSize = 0; + NextLine = ThisLine = HostsDBData; + + /* Find the beginning of the next line */ + while(NextLine < HostsDBData + ValidData && + *NextLine != '\r' && *NextLine != '\n' ) + { + NextLine++; + } + + /* Zero and skip, so we can treat what we have as a string */ + if( NextLine > HostsDBData + ValidData ) + break; + + *NextLine = 0; NextLine++; + + Comment = strchr( ThisLine, '#' ); + if( Comment ) *Comment = 0; /* Terminate at comment start */ + + AddressStr = ThisLine; + /* Find the first space separating the IP address from the DNS name */ + AddrTerm = strchr(ThisLine, ' '); + if (AddrTerm) + { + /* Terminate the address string */ + *AddrTerm = 0; + + /* Find the last space before the DNS name */ + NameSt = strrchr(ThisLine, ' '); + + /* If there is only one space (the one we removed above), then just use the address terminator */ + if (!NameSt) + NameSt = AddrTerm; + + /* Move from the space to the first character of the DNS name */ + NameSt++; + + DnsName = NameSt; + + if (!strcmp(name, DnsName)) + { + Found = TRUE; + break; + } + } + + /* Get rid of everything we read so far */ + while( NextLine <= HostsDBData + ValidData && + isspace (*NextLine)) + { + NextLine++; + } + + if (HostsDBData + ValidData - NextLine <= 0) + break; + + WS_DbgPrint(MAX_TRACE,("About to move %d chars\n", + HostsDBData + ValidData - NextLine)); + + memmove(HostsDBData, + NextLine, + HostsDBData + ValidData - NextLine ); + ValidData -= NextLine - HostsDBData; + WS_DbgPrint(MAX_TRACE,("Valid bytes: %d\n", ValidData)); + } + + CloseHandle(HostsFile); + + if (!Found) + { + WS_DbgPrint(MAX_TRACE,("Not found\n")); + WSASetLastError(WSANO_DATA); + return NULL; + } + + if( !p->Hostent ) + { + p->Hostent = HeapAlloc(GlobalHeap, 0, sizeof(*p->Hostent)); + if( !p->Hostent ) + { + WSASetLastError( WSATRY_AGAIN ); + return NULL; + } + } + + p->Hostent->h_name = HeapAlloc(GlobalHeap, 0, strlen(DnsName)); + if( !p->Hostent->h_name ) + { + WSASetLastError( WSATRY_AGAIN ); + return NULL; + } + + RtlCopyMemory(p->Hostent->h_name, + DnsName, + strlen(DnsName)); + + p->Hostent->h_aliases = HeapAlloc(GlobalHeap, 0, sizeof(char *)); + if( !p->Hostent->h_aliases ) + { + WSASetLastError( WSATRY_AGAIN ); + return NULL; + } + + p->Hostent->h_aliases[0] = 0; + + if (strstr(AddressStr, ":")) + { + DbgPrint("AF_INET6 NOT SUPPORTED!\n"); + WSASetLastError(WSAEINVAL); + return NULL; + } + else + p->Hostent->h_addrtype = AF_INET; + + p->Hostent->h_addr_list = HeapAlloc(GlobalHeap, 0, sizeof(char *)); + if( !p->Hostent->h_addr_list ) + { + WSASetLastError( WSATRY_AGAIN ); + return NULL; + } + + Address = inet_addr(AddressStr); + if (Address == INADDR_NONE) + { + WSASetLastError(WSAEINVAL); + return NULL; + } + + p->Hostent->h_addr_list[0] = HeapAlloc(GlobalHeap, 0, sizeof(Address)); + if( !p->Hostent->h_addr_list[0] ) + { + WSASetLastError( WSATRY_AGAIN ); + return NULL; + } + + RtlCopyMemory(p->Hostent->h_addr_list[0], + &Address, + sizeof(Address)); + + p->Hostent->h_length = sizeof(Address); + + return p->Hostent; +} LPHOSTENT EXPORT @@ -661,6 +853,7 @@ gethostbyname(IN CONST CHAR FAR* name) /* include/WinDNS.h -- look up DNS_RECORD on MSDN */ PDNS_RECORD dp = 0; PWINSOCK_THREAD_BLOCK p; + LPHOSTENT Hostent; addr = GH_INVALID; @@ -726,6 +919,12 @@ gethostbyname(IN CONST CHAR FAR* name) case GH_RFC1123_DNS: /* DNS_TYPE_A: include/WinDNS.h */ /* DnsQuery -- lib/dnsapi/dnsapi/query.c */ + + /* Look for the DNS name in the hosts file */ + Hostent = FindEntryInHosts(name); + if (Hostent) + return Hostent; + dns_status = DnsQuery_A(name, DNS_TYPE_A, DNS_QUERY_STANDARD, @@ -993,7 +1192,7 @@ getservbyname(IN CONST CHAR FAR* name, } /* Zero and skip, so we can treat what we have as a string */ - if( NextLine >= ServiceDBData + ValidData ) + if( NextLine > ServiceDBData + ValidData ) break; *NextLine = 0; NextLine++; @@ -1174,7 +1373,7 @@ getservbyport(IN INT port, *NextLine != '\r' && *NextLine != '\n' ) NextLine++; /* Zero and skip, so we can treat what we have as a string */ - if( NextLine >= ServiceDBData + ValidData ) + if( NextLine > ServiceDBData + ValidData ) break; *NextLine = 0; NextLine++; diff --git a/drivers/bus/pci/fdo.c b/drivers/bus/pci/fdo.c index 35fd12536c7..b6753e10a5e 100644 --- a/drivers/bus/pci/fdo.c +++ b/drivers/bus/pci/fdo.c @@ -16,6 +16,46 @@ /*** PRIVATE *****************************************************************/ +static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion; + +static NTSTATUS NTAPI +ForwardIrpAndWaitCompletion( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + UNREFERENCED_PARAMETER(DeviceObject); + if (Irp->PendingReturned) + KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +NTSTATUS NTAPI +ForwardIrpAndWait( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + KEVENT Event; + NTSTATUS Status; + PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Ldo; + ASSERT(LowerDevice); + + KeInitializeEvent(&Event, NotificationEvent, FALSE); + IoCopyCurrentIrpStackLocationToNext(Irp); + + IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE); + + Status = IoCallDriver(LowerDevice, Irp); + if (Status == STATUS_PENDING) + { + Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = Irp->IoStatus.Status; + } + + return Status; +} + static NTSTATUS FdoLocateChildDevice( PPCI_DEVICE *Device, @@ -239,8 +279,6 @@ FdoQueryBusRelations( break; } - Device->Pdo->Flags |= DO_BUS_ENUMERATED_DEVICE; - Device->Pdo->Flags &= ~DO_DEVICE_INITIALIZING; //Device->Pdo->Flags |= DO_POWER_PAGABLE; @@ -468,7 +506,7 @@ FdoPnpControl( { PFDO_DEVICE_EXTENSION DeviceExtension; PIO_STACK_LOCATION IrpSp; - NTSTATUS Status; + NTSTATUS Status = Irp->IoStatus.Status; DPRINT("Called\n"); @@ -494,8 +532,13 @@ FdoPnpControl( break; #endif case IRP_MN_QUERY_DEVICE_RELATIONS: + if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations) + break; + Status = FdoQueryBusRelations(DeviceObject, Irp, IrpSp); - break; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; #if 0 case IRP_MN_QUERY_PNP_DEVICE_STATE: Status = STATUS_NOT_IMPLEMENTED; @@ -515,38 +558,37 @@ FdoPnpControl( #endif case IRP_MN_START_DEVICE: DPRINT("IRP_MN_START_DEVICE received\n"); - Status = FdoStartDevice(DeviceObject, Irp); - break; + Status = ForwardIrpAndWait(DeviceObject, Irp); + if (NT_SUCCESS(Status)) + Status = FdoStartDevice(DeviceObject, Irp); + + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; case IRP_MN_STOP_DEVICE: /* Currently not supported */ Status = STATUS_UNSUCCESSFUL; - break; + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; #if 0 case IRP_MN_SURPRISE_REMOVAL: Status = STATUS_NOT_IMPLEMENTED; break; #endif + case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: + break; + case IRP_MN_REMOVE_DEVICE: + DPRINT1("IRP_MN_REMOVE_DEVICE is UNIMPLEMENTED!\n"); + break; default: DPRINT1("Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction); - /* fall through */ - - case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: - /* - * Do NOT complete the IRP as it will be processed by the lower - * device object, which will complete the IRP - */ - IoSkipCurrentIrpStackLocation(Irp); - Status = IoCallDriver(DeviceExtension->Ldo, Irp); - return Status; break; } - - if (Status != STATUS_PENDING) { - if (Status != STATUS_NOT_IMPLEMENTED) - Irp->IoStatus.Status = Status; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } + Irp->IoStatus.Status = Status; + IoSkipCurrentIrpStackLocation(Irp); + Status = IoCallDriver(DeviceExtension->Ldo, Irp); DPRINT("Leaving. Status 0x%X\n", Status); diff --git a/drivers/bus/pci/pdo.c b/drivers/bus/pci/pdo.c index 266b95d6a97..e5961fbf3a2 100644 --- a/drivers/bus/pci/pdo.c +++ b/drivers/bus/pci/pdo.c @@ -413,8 +413,8 @@ PdoQueryResourceRequirements( RtlZeroMemory(ResourceList, ListSize); ResourceList->ListSize = ListSize; ResourceList->InterfaceType = PCIBus; - ResourceList->BusNumber = 0; - ResourceList->SlotNumber = 0; + ResourceList->BusNumber = DeviceExtension->PciDevice->BusNumber; + ResourceList->SlotNumber = DeviceExtension->PciDevice->SlotNumber.u.AsULONG; ResourceList->AlternativeLists = 1; ResourceList->List[0].Version = 1; @@ -717,7 +717,7 @@ PdoQueryResources( RtlZeroMemory(ResourceList, ListSize); ResourceList->Count = 1; ResourceList->List[0].InterfaceType = PCIBus; - ResourceList->List[0].BusNumber = 0; + ResourceList->List[0].BusNumber = DeviceExtension->PciDevice->BusNumber; PartialList = &ResourceList->List[0].PartialResourceList; PartialList->Version = 1; diff --git a/drivers/network/afd/afd/lock.c b/drivers/network/afd/afd/lock.c index 7605f8d0774..dcc4f24089a 100644 --- a/drivers/network/afd/afd/lock.c +++ b/drivers/network/afd/afd/lock.c @@ -17,6 +17,10 @@ PVOID LockRequest( PIRP Irp, PIO_STACK_LOCATION IrpSp ) { BOOLEAN LockFailed = FALSE; + ASSERT(IrpSp->Parameters.DeviceIoControl.Type3InputBuffer); + ASSERT(IrpSp->Parameters.DeviceIoControl.InputBufferLength); + ASSERT(!Irp->MdlAddress); + Irp->MdlAddress = IoAllocateMdl( IrpSp->Parameters.DeviceIoControl.Type3InputBuffer, IrpSp->Parameters.DeviceIoControl.InputBufferLength, diff --git a/drivers/network/afd/afd/read.c b/drivers/network/afd/afd/read.c index e7e9a6e67db..dccfa559ba8 100644 --- a/drivers/network/afd/afd/read.c +++ b/drivers/network/afd/afd/read.c @@ -26,10 +26,38 @@ #include "tdiconn.h" #include "debug.h" -static BOOLEAN CantReadMore( PAFD_FCB FCB ) { - UINT BytesAvailable = FCB->Recv.Content - FCB->Recv.BytesUsed; +static NTSTATUS RefillSocketBuffer( PAFD_FCB FCB ) { + NTSTATUS Status = STATUS_PENDING; - return !BytesAvailable; + if( !FCB->ReceiveIrp.InFlightRequest ) { + AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n")); + + Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest, + FCB->Connection.Object, + TDI_RECEIVE_NORMAL, + FCB->Recv.Window, + FCB->Recv.Size, + &FCB->ReceiveIrp.Iosb, + ReceiveComplete, + FCB ); + + if( ( Status == STATUS_SUCCESS && !FCB->ReceiveIrp.Iosb.Information ) || + ( !NT_SUCCESS( Status ) ) ) + { + /* The socket has been closed */ + FCB->PollState |= AFD_EVENT_DISCONNECT; + FCB->Overread = TRUE; + Status = STATUS_FILE_CLOSED; + } + else if( Status == STATUS_SUCCESS ) + { + FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information; + FCB->PollState |= AFD_EVENT_RECEIVE; + } + PollReeval( FCB->DeviceExt, FCB->FileObject ); + } + + return Status; } static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB, @@ -46,7 +74,22 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB, AFD_DbgPrint(MID_TRACE,("Called, BytesAvailable = %d\n", BytesAvailable)); - if( CantReadMore(FCB) ) return STATUS_PENDING; + if( FCB->Overread ) return STATUS_FILE_CLOSED; + if( !BytesAvailable ) { + FCB->Recv.Content = FCB->Recv.BytesUsed = 0; + Status = RefillSocketBuffer( FCB ); + if ( Status != STATUS_SUCCESS ) + return Status; + + /* If RefillSocketBuffer returns STATUS_SUCCESS, we're good to go + * If RefillSocketBuffer returns STATUS_PENDING, then it's waiting on the transport for data + * If RefillSocketBuffer returns STATUS_FILE_CLOSED, then the connection was terminated + */ + + /* Recalculate BytesAvailable based on new data */ + BytesAvailable = FCB->Recv.Content - FCB->Recv.BytesUsed; + ASSERT(BytesAvailable); + } Map = (PAFD_MAPBUF)(RecvReq->BufferArray + RecvReq->BufferCount); @@ -88,23 +131,8 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB, if( FCB->Recv.BytesUsed == FCB->Recv.Content ) { FCB->Recv.BytesUsed = FCB->Recv.Content = 0; FCB->PollState &= ~AFD_EVENT_RECEIVE; - PollReeval( FCB->DeviceExt, FCB->FileObject ); - if( !FCB->ReceiveIrp.InFlightRequest ) { - AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n")); - - Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest, - FCB->Connection.Object, - TDI_RECEIVE_NORMAL, - FCB->Recv.Window, - FCB->Recv.Size, - &FCB->ReceiveIrp.Iosb, - ReceiveComplete, - FCB ); - - if( Status == STATUS_SUCCESS ) - FCB->Recv.Content = FCB->ReceiveIrp.Iosb.Information; - } + RefillSocketBuffer( FCB ); } return STATUS_SUCCESS; @@ -159,7 +187,7 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) { } } - if( !CantReadMore(FCB) ) { + if( FCB->Recv.Content ) { FCB->PollState |= AFD_EVENT_RECEIVE; } else FCB->PollState &= ~AFD_EVENT_RECEIVE; diff --git a/drivers/network/ndis/ndis/miniport.c b/drivers/network/ndis/ndis/miniport.c index 2a9934c355e..daaf7cac1b1 100644 --- a/drivers/network/ndis/ndis/miniport.c +++ b/drivers/network/ndis/ndis/miniport.c @@ -1722,6 +1722,20 @@ NdisIForwardIrpAndWait(PLOGICAL_ADAPTER Adapter, PIRP Irp) return Status; } +NTSTATUS +NTAPI +NdisICreateClose( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return STATUS_SUCCESS; +} + NTSTATUS NTAPI @@ -2499,6 +2513,8 @@ NdisMRegisterMiniport( *MiniportPtr = Miniport; + Miniport->DriverObject->MajorFunction[IRP_MJ_CREATE] = NdisICreateClose; + Miniport->DriverObject->MajorFunction[IRP_MJ_CLOSE] = NdisICreateClose; Miniport->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp; Miniport->DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = NdisIShutdown; Miniport->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = NdisIDeviceIoControl; @@ -2960,6 +2976,12 @@ NdisMRegisterDevice( DriverBlock->DriverObject->MajorFunction[IRP_MJ_PNP] = NdisIDispatchPnp; + if (!DriverBlock->DriverObject->MajorFunction[IRP_MJ_CREATE]) + DriverBlock->DriverObject->MajorFunction[IRP_MJ_CREATE] = NdisICreateClose; + + if (!DriverBlock->DriverObject->MajorFunction[IRP_MJ_CLOSE]) + DriverBlock->DriverObject->MajorFunction[IRP_MJ_CLOSE] = NdisICreateClose; + DeviceBlock->DeviceObject = DeviceObject; DeviceBlock->SymbolicName = SymbolicName; diff --git a/drivers/usb/nt4compat/usbdriver/devmgr.c b/drivers/usb/nt4compat/usbdriver/devmgr.c index 46c12a07fc1..a1357f26f6d 100644 --- a/drivers/usb/nt4compat/usbdriver/devmgr.c +++ b/drivers/usb/nt4compat/usbdriver/devmgr.c @@ -1457,6 +1457,20 @@ dev_mgr_register_hcd(PUSB_DEV_MANAGER dev_mgr, PHCD hcd) return dev_mgr->hcd_count - 1; } +VOID +dev_mgr_deregister_hcd(PUSB_DEV_MANAGER dev_mgr, UCHAR hcd_id) +{ + UCHAR i; + + if (dev_mgr == NULL || hcd_id >= MAX_HCDS - 1) + return; + + for (i = hcd_id; i < dev_mgr->hcd_count - 1; i++) + dev_mgr->hcd_array[i] = dev_mgr->hcd_array[i + 1]; + + dev_mgr->hcd_count--; +} + BOOLEAN dev_mgr_register_irp(PUSB_DEV_MANAGER dev_mgr, PIRP pirp, PURB purb) { diff --git a/drivers/usb/nt4compat/usbdriver/devmgr.h b/drivers/usb/nt4compat/usbdriver/devmgr.h index c6d22522935..50d3b6fe6d6 100644 --- a/drivers/usb/nt4compat/usbdriver/devmgr.h +++ b/drivers/usb/nt4compat/usbdriver/devmgr.h @@ -208,6 +208,12 @@ PUSB_DEV_MANAGER dev_mgr, PHCD hcd ); +VOID +dev_mgr_deregister_hcd( +PUSB_DEV_MANAGER dev_mgr, +UCHAR hcd_id +); + NTSTATUS dev_mgr_dispatch( IN PUSB_DEV_MANAGER dev_mgr, diff --git a/drivers/usb/nt4compat/usbdriver/ehci.c b/drivers/usb/nt4compat/usbdriver/ehci.c index 02257052378..0453fb9727a 100644 --- a/drivers/usb/nt4compat/usbdriver/ehci.c +++ b/drivers/usb/nt4compat/usbdriver/ehci.c @@ -58,15 +58,7 @@ #define endp_mult_count( endp ) ( ( ( endp->pusb_endp_desc->wMaxPacketSize & 0x1800 ) >> 11 ) + 1 ) -#if 0 -/* WTF?! */ -#define release_adapter( padapTER ) \ -{\ - ( ( padapTER ) ); \ -} -#else -#define release_adapter( padapTER ) (void)(padapTER) -#endif +#define release_adapter( padapTER ) HalPutDmaAdapter(padapTER) #define get_int_idx( _urb, _idx ) \ {\ @@ -279,7 +271,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU BOOLEAN ehci_init_schedule(PEHCI_DEV ehci, PADAPTER_OBJECT padapter); -BOOLEAN ehci_release(PDEVICE_OBJECT pdev); +BOOLEAN ehci_release(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr); static VOID ehci_stop(PEHCI_DEV ehci); @@ -321,7 +313,7 @@ PDEVICE_OBJECT ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUS PDEVICE_OBJECT ehci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr); -BOOLEAN ehci_delete_device(PDEVICE_OBJECT pdev); +BOOLEAN ehci_delete_device(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr); VOID ehci_get_capabilities(PEHCI_DEV ehci, PBYTE base); @@ -3374,7 +3366,7 @@ ehci_hcd_release(PHCD hcd) ehci = ehci_from_hcd(hcd); pdev_ext = ehci->pdev_ext; - return ehci_release(pdev_ext->pdev_obj); + return ehci_release(pdev_ext->pdev_obj, hcd->dev_mgr); } NTSTATUS @@ -3461,18 +3453,19 @@ ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d PDEVICE_OBJECT pdev; BYTE buffer[sizeof(PCI_COMMON_CONFIG)]; PEHCI_DEVICE_EXTENSION pdev_ext; + LONG count = 0; slot_num.u.AsULONG = 0; pci_config = (PPCI_COMMON_CONFIG) buffer; pdev = NULL; - //scan the bus to find ehci controller - for(bus = 0; bus < 3; bus++) /* enum bus0-bus2 */ + //scan the PCI buses to find ehci controller + for (bus = 0; bus <= PCI_MAX_BRIDGE_NUMBER; bus++) //Yes, it should be <= { - for(i = 0; i < PCI_MAX_DEVICES; i++) + for(i = 0; i <= PCI_MAX_DEVICES; i++) { slot_num.u.bits.DeviceNumber = i; - for(j = 0; j < PCI_MAX_FUNCTIONS; j++) + for(j = 0; j <= PCI_MAX_FUNCTION; j++) { slot_num.u.bits.FunctionNumber = j; @@ -3490,9 +3483,12 @@ ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d { //well, we find our usb host controller( EHCI ), create device pdev = ehci_alloc(drvr_obj, reg_path, ((bus << 8) | (i << 3) | j), dev_mgr); - - if (!pdev) - continue; + if (pdev) +#ifdef _MULTI_EHCI + count++; +#else + goto LBL_LOOPOUT; +#endif } } @@ -3501,6 +3497,11 @@ ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d } } +#ifndef _MULTI_EHCI +LBL_LOOPOUT: +#endif + DbgPrint("Found %d EHCI controllers\n", count); + if (pdev) { pdev_ext = pdev->DeviceExtension; @@ -3564,7 +3565,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU if (pdev_ext->padapter == NULL) { //fatal error - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return NULL; } @@ -3583,7 +3584,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU DbgPrint("ehci_alloc(): error assign slot res, 0x%x\n", status); release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return NULL; } @@ -3618,7 +3619,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU DbgPrint("ehci_alloc(): error, can not translate bus address\n"); release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return NULL; } @@ -3637,7 +3638,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU { release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return NULL; } } @@ -3662,7 +3663,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU { release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return NULL; } @@ -3691,7 +3692,7 @@ ehci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU affinity, FALSE) //No float save != STATUS_SUCCESS) { - ehci_release(pdev); + ehci_release(pdev, dev_mgr); return NULL; } @@ -4016,7 +4017,7 @@ ehci_get_capabilities(PEHCI_DEV ehci, PBYTE base) } BOOLEAN -ehci_delete_device(PDEVICE_OBJECT pdev) +ehci_delete_device(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr) { STRING string; UNICODE_STRING symb_name; @@ -4036,6 +4037,8 @@ ehci_delete_device(PDEVICE_OBJECT pdev) IoDeleteSymbolicLink(&symb_name); RtlFreeUnicodeString(&symb_name); + dev_mgr_deregister_hcd(dev_mgr, pdev_ext->ehci->hcd_interf.hcd_get_id(&pdev_ext->ehci->hcd_interf)); + if (pdev_ext->res_list) ExFreePool(pdev_ext->res_list); // not allocated by usb_alloc_mem @@ -4061,7 +4064,7 @@ ehci_stop(PEHCI_DEV ehci) } BOOLEAN -ehci_release(PDEVICE_OBJECT pdev) +ehci_release(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr) { PEHCI_DEVICE_EXTENSION pdev_ext; PEHCI_DEV ehci; @@ -4094,7 +4097,7 @@ ehci_release(PDEVICE_OBJECT pdev) release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - ehci_delete_device(pdev); + ehci_delete_device(pdev, dev_mgr); return FALSE; diff --git a/drivers/usb/nt4compat/usbdriver/uhci.c b/drivers/usb/nt4compat/usbdriver/uhci.c index c113ada6610..857498c4e00 100644 --- a/drivers/usb/nt4compat/usbdriver/uhci.c +++ b/drivers/usb/nt4compat/usbdriver/uhci.c @@ -65,15 +65,7 @@ extern PDEVICE_OBJECT ehci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_pa : enDP->pusb_endp_desc->wMaxPacketSize ) -#if 0 -/* WTF?! */ -#define release_adapter( padapTER ) \ -{\ - ( ( padapTER ) ); \ -} -#else -#define release_adapter( padapTER ) (void)(padapTER) -#endif +#define release_adapter( padapTER ) HalPutDmaAdapter(padapTER) #define get_int_idx( _urb, _idx ) \ {\ @@ -110,7 +102,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU BOOLEAN uhci_init_schedule(PUHCI_DEV uhci, PADAPTER_OBJECT padapter); -BOOLEAN uhci_release(PDEVICE_OBJECT pdev); +BOOLEAN uhci_release(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr); static VOID uhci_stop(PUHCI_DEV uhci); @@ -473,7 +465,7 @@ uhci_create_device(PDRIVER_OBJECT drvr_obj, PUSB_DEV_MANAGER dev_mgr) } BOOLEAN -uhci_delete_device(PDEVICE_OBJECT pdev) +uhci_delete_device(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr) { STRING string; UNICODE_STRING symb_name; @@ -493,6 +485,8 @@ uhci_delete_device(PDEVICE_OBJECT pdev) IoDeleteSymbolicLink(&symb_name); RtlFreeUnicodeString(&symb_name); + dev_mgr_deregister_hcd(dev_mgr, pdev_ext->uhci->hcd_interf.hcd_get_id(&pdev_ext->uhci->hcd_interf)); + if (pdev_ext->res_list) ExFreePool(pdev_ext->res_list); // not allocated by usb_alloc_mem @@ -626,13 +620,13 @@ uhci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d count = 0; pdev = NULL; - //scan the bus to find uhci controller - for(bus = 0; bus < 3; bus++) /* enum bus0-bus2 */ + //scan the PCI buses to find uhci controller + for (bus = 0; bus <= PCI_MAX_BRIDGE_NUMBER; bus++) { - for(i = 0; i < PCI_MAX_DEVICES; i++) + for(i = 0; i <= PCI_MAX_DEVICES; i++) { slot_num.u.bits.DeviceNumber = i; - for(j = 0; j < PCI_MAX_FUNCTIONS; j++) + for(j = 0; j <= PCI_MAX_FUNCTION; j++) { slot_num.u.bits.FunctionNumber = j; @@ -645,18 +639,15 @@ uhci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d if (ret == 2) /*no device on the slot */ break; - if (pci_config->BaseClass == 0x0c && pci_config->SubClass == 0x03) + if (pci_config->BaseClass == 0x0c && pci_config->SubClass == 0x03 && + pci_config->ProgIf == 0x00) { // well, we find our usb host controller, create device -#ifdef _MULTI_UHCI - { - pdev = uhci_alloc(drvr_obj, reg_path, ((bus << 8) | (i << 3) | j), dev_mgr); - if (pdev) - count++; - } -#else pdev = uhci_alloc(drvr_obj, reg_path, ((bus << 8) | (i << 3) | j), dev_mgr); if (pdev) +#ifdef _MULTI_UHCI + count++; +#else goto LBL_LOOPOUT; #endif } @@ -669,6 +660,8 @@ uhci_probe(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, PUSB_DEV_MANAGER d #ifndef _MULTI_UHCI LBL_LOOPOUT: #endif + DbgPrint("Found %d UHCI controllers\n", count); + if (pdev) { pdev_ext = pdev->DeviceExtension; @@ -732,7 +725,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU if (pdev_ext->padapter == NULL) { //fatal error - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return NULL; } @@ -751,7 +744,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU DbgPrint("uhci_alloc(): error assign slot res, 0x%x\n", status); release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return NULL; } @@ -781,7 +774,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU DbgPrint("uhci_alloc(): error, can not translate bus address\n"); release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return NULL; } @@ -800,7 +793,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU { release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return NULL; } } @@ -819,7 +812,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU { release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return NULL; } @@ -857,7 +850,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU FALSE) //No float save != STATUS_SUCCESS) { - uhci_release(pdev); + uhci_release(pdev, dev_mgr); return NULL; } @@ -865,7 +858,7 @@ uhci_alloc(PDRIVER_OBJECT drvr_obj, PUNICODE_STRING reg_path, ULONG bus_addr, PU } BOOLEAN -uhci_release(PDEVICE_OBJECT pdev) +uhci_release(PDEVICE_OBJECT pdev, PUSB_DEV_MANAGER dev_mgr) { PDEVICE_EXTENSION pdev_ext; PUHCI_DEV uhci; @@ -901,7 +894,7 @@ uhci_release(PDEVICE_OBJECT pdev) release_adapter(pdev_ext->padapter); pdev_ext->padapter = NULL; - uhci_delete_device(pdev); + uhci_delete_device(pdev, dev_mgr); return FALSE; @@ -3680,7 +3673,7 @@ uhci_hcd_release(struct _HCD * hcd) uhci = uhci_from_hcd(hcd); pdev_ext = uhci->pdev_ext; - return uhci_release(pdev_ext->pdev_obj); + return uhci_release(pdev_ext->pdev_obj, hcd->dev_mgr); } NTSTATUS diff --git a/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild b/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild index f4f3c844e4c..770e77e5434 100644 --- a/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild +++ b/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild @@ -2,6 +2,8 @@ + + . ntoskrnl diff --git a/drivers/video/displays/vga/objects/pointer.c b/drivers/video/displays/vga/objects/pointer.c index 698f8790fe0..c0d365bb9a4 100644 --- a/drivers/video/displays/vga/objects/pointer.c +++ b/drivers/video/displays/vga/objects/pointer.c @@ -272,7 +272,7 @@ DrvSetPointerShape( VGADDI_ShowCursor(ppdev, prcl); } - return SPS_ACCEPT_EXCLUDE; + return SPS_ACCEPT_NOEXCLUDE; } static VOID FASTCALL diff --git a/drivers/video/videoprt/videoprt.c b/drivers/video/videoprt/videoprt.c index 8bf88f2a67b..4c339b67677 100644 --- a/drivers/video/videoprt/videoprt.c +++ b/drivers/video/videoprt/videoprt.c @@ -1523,8 +1523,9 @@ VideoPortIsNoVesa(VOID) return FALSE; } - /* Check if NOVESA is present in the start options */ - if (wcsstr((PWCHAR)KeyInfo->Data, L"NOVESA")) + /* Check if NOVESA or BASEVIDEO is present in the start options */ + if (wcsstr((PWCHAR)KeyInfo->Data, L"NOVESA") || + wcsstr((PWCHAR)KeyInfo->Data, L"BASEVIDEO")) { VideoPortDebugPrint(Info, "VESA mode disabled\n"); ExFreePool(KeyInfo); diff --git a/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp b/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp index da6e98d9d51..991e0e11426 100644 --- a/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp +++ b/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp @@ -602,7 +602,6 @@ CPortPinDMus::Init( DPRINT("Failed to add pin to service group\n"); return Status; } - m_ServiceGroup->SupportDelayedService(); } Status = m_IrpQueue->Init(ConnectDetails, 0, 0, NULL); diff --git a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp index ff02905e386..0520480ae92 100644 --- a/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp +++ b/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp @@ -1213,7 +1213,6 @@ CPortPinWaveCyclic::Init( return Status; } - m_ServiceGroup->SupportDelayedService(); m_Stream->SetState(KSSTATE_STOP); m_State = KSSTATE_STOP; m_CommonBufferOffset = 0; @@ -1224,6 +1223,8 @@ CPortPinWaveCyclic::Init( m_Delay = Int32x32To64(10, -10000); Status = m_Stream->SetNotificationFreq(10, &m_FrameSize); + PC_ASSERT(NT_SUCCESS(Status)); + PC_ASSERT(m_FrameSize); SilenceBuffer = AllocateItem(NonPagedPool, m_FrameSize, TAG_PORTCLASS); if (!SilenceBuffer) diff --git a/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp b/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp index 935ece83ec7..1b44fe1794f 100644 --- a/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp +++ b/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp @@ -815,7 +815,6 @@ CPortPinWavePci::Init( DPRINT("Failed to add pin to service group\n"); return Status; } - m_ServiceGroup->SupportDelayedService(); } // delay of 10 milisec diff --git a/drivers/wdm/audio/backpln/portcls/port_dmus.cpp b/drivers/wdm/audio/backpln/portcls/port_dmus.cpp index 8c08b1f9c3d..3f4fb918259 100644 --- a/drivers/wdm/audio/backpln/portcls/port_dmus.cpp +++ b/drivers/wdm/audio/backpln/portcls/port_dmus.cpp @@ -340,7 +340,7 @@ CPortDMus::NewRegistryKey( RegistryKeyType, DesiredAccess, m_pDeviceObject, - NULL,//FIXME + (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition); diff --git a/drivers/wdm/audio/backpln/portcls/port_topology.cpp b/drivers/wdm/audio/backpln/portcls/port_topology.cpp index 2c80a430f22..ab4322aa943 100644 --- a/drivers/wdm/audio/backpln/portcls/port_topology.cpp +++ b/drivers/wdm/audio/backpln/portcls/port_topology.cpp @@ -299,7 +299,7 @@ CPortTopology::NewRegistryKey( RegistryKeyType, DesiredAccess, m_pDeviceObject, - NULL,//FIXME + (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition); diff --git a/drivers/wdm/audio/backpln/portcls/port_wavecyclic.cpp b/drivers/wdm/audio/backpln/portcls/port_wavecyclic.cpp index 23bfba91681..6566fe67299 100644 --- a/drivers/wdm/audio/backpln/portcls/port_wavecyclic.cpp +++ b/drivers/wdm/audio/backpln/portcls/port_wavecyclic.cpp @@ -340,7 +340,7 @@ CPortWaveCyclic::NewRegistryKey( DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n"); return STATUS_UNSUCCESSFUL; } - return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, NULL /*FIXME*/, ObjectAttributes, CreateOptions, Disposition); + return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition); } diff --git a/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp b/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp index 81d6ed9bfbf..986ffcf9d40 100644 --- a/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp +++ b/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp @@ -359,7 +359,7 @@ CPortWavePci::NewRegistryKey( RegistryKeyType, DesiredAccess, m_pDeviceObject, - NULL,//FIXME + (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition); diff --git a/drivers/wdm/audio/backpln/portcls/port_wavert.cpp b/drivers/wdm/audio/backpln/portcls/port_wavert.cpp index 8910dc1cb19..305d097276c 100644 --- a/drivers/wdm/audio/backpln/portcls/port_wavert.cpp +++ b/drivers/wdm/audio/backpln/portcls/port_wavert.cpp @@ -329,7 +329,7 @@ CPortWaveRT::NewRegistryKey( DPRINT("IPortWaveRT_fnNewRegistryKey called w/o initialized\n"); return STATUS_UNSUCCESSFUL; } - return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, NULL /*FIXME*/, ObjectAttributes, CreateOptions, Disposition); + return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition); } //--------------------------------------------------------------- // ISubdevice interface diff --git a/drivers/wdm/audio/backpln/portcls/registry.cpp b/drivers/wdm/audio/backpln/portcls/registry.cpp index eadcc89eaf3..86c2d3f8784 100644 --- a/drivers/wdm/audio/backpln/portcls/registry.cpp +++ b/drivers/wdm/audio/backpln/portcls/registry.cpp @@ -270,6 +270,9 @@ PcNewRegistryKey( NTSTATUS Status = STATUS_UNSUCCESSFUL; CRegistryKey * RegistryKey; PPCLASS_DEVICE_EXTENSION DeviceExt; + PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor; + ISubdevice * Device; + PSYMBOLICLINK_ENTRY SymEntry; DPRINT("PcNewRegistryKey entered\n"); @@ -294,8 +297,8 @@ PcNewRegistryKey( // object attributes is mandatory return STATUS_INVALID_PARAMETER; } - // try to open the key - Status = ZwOpenKey(&hHandle, DesiredAccess, ObjectAttributes); + // try to create the key + Status = ZwCreateKey(&hHandle, DesiredAccess, ObjectAttributes, 0, NULL, CreateOptions, Disposition); } else if (RegistryKeyType == DeviceRegistryKey || RegistryKeyType == DriverRegistryKey || @@ -305,7 +308,7 @@ PcNewRegistryKey( if (RegistryKeyType == HwProfileRegistryKey) { // IoOpenDeviceRegistryKey used different constant - RegistryKeyType = PLUGPLAY_REGKEY_CURRENT_HWPROFILE; + RegistryKeyType = PLUGPLAY_REGKEY_CURRENT_HWPROFILE | PLUGPLAY_REGKEY_DEVICE; } // obtain the new device extension @@ -315,24 +318,71 @@ PcNewRegistryKey( } else if (RegistryKeyType == DeviceInterfaceRegistryKey) { - // FIXME - UNIMPLEMENTED - DbgBreakPoint(); + if (SubDevice == NULL) + { + // invalid parameter + return STATUS_INVALID_PARAMETER; + } + + // look up our undocumented interface + Status = ((PUNKNOWN)SubDevice)->QueryInterface(IID_ISubdevice, (LPVOID*)&Device); + + if (!NT_SUCCESS(Status)) + { + DPRINT("No ISubdevice interface\n"); + // invalid parameter + return STATUS_INVALID_PARAMETER; + } + + // get the subdevice descriptor + Status = Device->GetDescriptor(&SubDeviceDescriptor); + if (!NT_SUCCESS(Status)) + { + DPRINT("Failed to get subdevice descriptor %x\n", Status); + ((PUNKNOWN)SubDevice)->Release(); + return STATUS_UNSUCCESSFUL; + } + + // is there an registered device interface + if (IsListEmpty(&SubDeviceDescriptor->SymbolicLinkList)) + { + DPRINT("No device interface registered\n"); + ((PUNKNOWN)SubDevice)->Release(); + return STATUS_UNSUCCESSFUL; + } + + // get the first symbolic link + SymEntry = (PSYMBOLICLINK_ENTRY)CONTAINING_RECORD(SubDeviceDescriptor->SymbolicLinkList.Flink, SYMBOLICLINK_ENTRY, Entry); + + // open device interface + Status = IoOpenDeviceInterfaceRegistryKey(&SymEntry->SymbolicLink, DesiredAccess, &hHandle); + + // release subdevice interface + ((PUNKNOWN)SubDevice)->Release(); } + // check for success if (!NT_SUCCESS(Status)) { + DPRINT1("PcNewRegistryKey failed with %lx\n", Status); return Status; } + // allocate new registry key object RegistryKey = new(NonPagedPool, TAG_PORTCLASS)CRegistryKey(OuterUnknown, hHandle); if (!RegistryKey) + { + // not enough memory + ZwClose(hHandle); return STATUS_INSUFFICIENT_RESOURCES; + } + // query for interface Status = RegistryKey->QueryInterface(IID_IRegistryKey, (PVOID*)OutRegistryKey); if (!NT_SUCCESS(Status)) { + // out of memory delete RegistryKey; } diff --git a/drivers/wdm/audio/backpln/portcls/service_group.cpp b/drivers/wdm/audio/backpln/portcls/service_group.cpp index 8e2bb943cf8..3a17faeec85 100644 --- a/drivers/wdm/audio/backpln/portcls/service_group.cpp +++ b/drivers/wdm/audio/backpln/portcls/service_group.cpp @@ -54,12 +54,10 @@ protected: LIST_ENTRY m_ServiceSinkHead; - BOOL m_Initialized; - BOOL m_TimerActive; + BOOL m_TimerInitialized; KTIMER m_Timer; KDPC m_Dpc; - KEVENT m_Event; - LONG m_ThreadActive; + KSPIN_LOCK m_Lock; friend VOID NTAPI IServiceGroupDpc(IN struct _KDPC *Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2); @@ -105,9 +103,16 @@ CServiceGroup::QueryInterface( CServiceGroup::CServiceGroup(IUnknown * OuterUnknown) { + // initialize dpc KeInitializeDpc(&m_Dpc, IServiceGroupDpc, (PVOID)this); + + // set highest importance KeSetImportanceDpc(&m_Dpc, HighImportance); - KeInitializeEvent(&m_Event, NotificationEvent, FALSE); + + // initialize service group list lock + KeInitializeSpinLock(&m_Lock); + + // initialize service group list InitializeListHead(&m_ServiceSinkHead); } @@ -119,15 +124,34 @@ CServiceGroup::RequestService() DPRINT("CServiceGroup::RequestService() Dpc at Level %u\n", KeGetCurrentIrql()); - if (KeGetCurrentIrql() > DISPATCH_LEVEL) + if (m_TimerInitialized) { - KeInsertQueueDpc(&m_Dpc, NULL, NULL); - return; - } + LARGE_INTEGER DueTime; - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - KeInsertQueueDpc(&m_Dpc, NULL, NULL); - KeLowerIrql(OldIrql); + // no due time + DueTime.QuadPart = 0LL; + + // delayed service requested + KeSetTimer(&m_Timer, DueTime, &m_Dpc); + } + else + { + // check curent irql + if (KeGetCurrentIrql() > DISPATCH_LEVEL) + { + //insert dpc to queue + KeInsertQueueDpc(&m_Dpc, NULL, NULL); + } + else + { + // raise irql to dispatch level to make dpc fire immediately + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + // insert dpc to queue + KeInsertQueueDpc(&m_Dpc, NULL, NULL); + // lower irql to old level + KeLowerIrql(OldIrql); + } + } } //--------------------------------------------------------------- @@ -140,18 +164,33 @@ CServiceGroup::AddMember( IN PSERVICESINK pServiceSink) { PGROUP_ENTRY Entry; + KIRQL OldLevel; + // sanity check PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL); + // allocate service sink entry Entry = (PGROUP_ENTRY)AllocateItem(NonPagedPool, sizeof(GROUP_ENTRY), TAG_PORTCLASS); if (!Entry) + { + // out of memory return STATUS_INSUFFICIENT_RESOURCES; + } + // initialize service sink entry Entry->pServiceSink = pServiceSink; + // increment reference count pServiceSink->AddRef(); + // acquire service group list lock + KeAcquireSpinLock(&m_Lock, &OldLevel); + + // insert into service sink list InsertTailList(&m_ServiceSinkHead, &Entry->Entry); + // release service group list lock + KeReleaseSpinLock(&m_Lock, OldLevel); + return STATUS_SUCCESS; } @@ -162,23 +201,45 @@ CServiceGroup::RemoveMember( { PLIST_ENTRY CurEntry; PGROUP_ENTRY Entry; + KIRQL OldLevel; + // sanity check PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL); + // acquire service group list lock + KeAcquireSpinLock(&m_Lock, &OldLevel); + + // grab first entry CurEntry = m_ServiceSinkHead.Flink; + + // loop list until the passed entry is found while (CurEntry != &m_ServiceSinkHead) { + // grab entry Entry = CONTAINING_RECORD(CurEntry, GROUP_ENTRY, Entry); + + // check if it matches the passed entry if (Entry->pServiceSink == pServiceSink) { + // remove entry from list RemoveEntryList(&Entry->Entry); + + // release service sink reference pServiceSink->Release(); + + // free service sink entry FreeItem(Entry, TAG_PORTCLASS); - return; + + // leave loop + break; } + // move to next entry CurEntry = CurEntry->Flink; } + // release service group list lock + KeReleaseSpinLock(&m_Lock, OldLevel); + } VOID @@ -194,73 +255,40 @@ IServiceGroupDpc( PGROUP_ENTRY Entry; CServiceGroup * This = (CServiceGroup*)DeferredContext; + // acquire service group list lock + KeAcquireSpinLockAtDpcLevel(&This->m_Lock); + + // grab first entry CurEntry = This->m_ServiceSinkHead.Flink; + + // loop the list and call the attached service sink/group while (CurEntry != &This->m_ServiceSinkHead) { + //grab current entry Entry = (PGROUP_ENTRY)CONTAINING_RECORD(CurEntry, GROUP_ENTRY, Entry); + + // call service sink/group Entry->pServiceSink->RequestService(); + + // move to next entry CurEntry = CurEntry->Flink; } + + // release service group list lock + KeReleaseSpinLockFromDpcLevel(&This->m_Lock); } - -#if 0 -VOID -NTAPI -ServiceGroupThread(IN PVOID StartContext) -{ - NTSTATUS Status; - KWAIT_BLOCK WaitBlockArray[2]; - PVOID WaitObjects[2]; - CServiceGroup * This = (CServiceGroup*)StartContext; - - // Set thread state - InterlockedIncrement(&This->m_ThreadActive); - - // Setup the wait objects - WaitObjects[0] = &m_Timer; - WaitObjects[1] = &m_Event; - - do - { - // Wait on our objects - Status = KeWaitForMultipleObjects(2, WaitObjects, WaitAny, Executive, KernelMode, FALSE, NULL, WaitBlockArray); - - switch(Status) - { - case STATUS_WAIT_0: - IServiceGroupDpc(&This->m_Dpc, (PVOID)This, NULL, NULL); - break; - case STATUS_WAIT_1: - PsTerminateSystemThread(STATUS_SUCCESS); - return; - } - }while(TRUE); -} - -#endif VOID NTAPI CServiceGroup::SupportDelayedService() { - //NTSTATUS Status; - //HANDLE ThreadHandle; - PC_ASSERT_IRQL(DISPATCH_LEVEL); - if (m_Initialized) - return; + // initialize the timer + KeInitializeTimer(&m_Timer); - KeInitializeTimerEx(&m_Timer, NotificationTimer); - -#if 0 - Status = PsCreateSystemThread(&ThreadHandle, THREAD_ALL_ACCESS, NULL, 0, NULL, ServiceGroupThread, (PVOID)This); - if (NT_SUCCESS(Status)) - { - ZwClose(ThreadHandle); - m_Initialized = TRUE; - } -#endif + // use the timer to perform service requests + m_TimerInitialized = TRUE; } VOID @@ -270,17 +298,14 @@ CServiceGroup::RequestDelayedService( { LARGE_INTEGER DueTime; + // sanity check PC_ASSERT_IRQL(DISPATCH_LEVEL); + PC_ASSERT(m_TimerInitialized); DueTime.QuadPart = ullDelay; - if (m_Initialized) - { - if (KeGetCurrentIrql() <= DISPATCH_LEVEL) - KeSetTimer(&m_Timer, DueTime, &m_Dpc); - else - KeInsertQueueDpc(&m_Dpc, NULL, NULL); - } + // set the timer + KeSetTimer(&m_Timer, DueTime, &m_Dpc); } VOID @@ -288,11 +313,10 @@ NTAPI CServiceGroup::CancelDelayedService() { PC_ASSERT_IRQL(DISPATCH_LEVEL); + PC_ASSERT(m_TimerInitialized); - if (m_Initialized) - { - KeCancelTimer(&m_Timer); - } + // cancel the timer + KeCancelTimer(&m_Timer); } NTSTATUS @@ -303,19 +327,31 @@ PcNewServiceGroup( { CServiceGroup * This; NTSTATUS Status; + DPRINT("PcNewServiceGroup entered\n"); - This = new(NonPagedPool, TAG_PORTCLASS)CServiceGroup(OuterUnknown); - if (!This) - return STATUS_INSUFFICIENT_RESOURCES; + //FIXME support aggregation + PC_ASSERT(OuterUnknown == NULL); + // allocate a service group object + This = new(NonPagedPool, TAG_PORTCLASS)CServiceGroup(OuterUnknown); + + if (!This) + { + // out of memory + return STATUS_INSUFFICIENT_RESOURCES; + } + + // request IServiceSink interface Status = This->QueryInterface(IID_IServiceSink, (PVOID*)OutServiceGroup); if (!NT_SUCCESS(Status)) { + // failed to acquire service sink interface delete This; return Status; } + // done return Status; } diff --git a/drivers/wdm/audio/sysaudio/control.c b/drivers/wdm/audio/sysaudio/control.c index b096d4d9dcc..6a2466c46cc 100644 --- a/drivers/wdm/audio/sysaudio/control.c +++ b/drivers/wdm/audio/sysaudio/control.c @@ -97,7 +97,6 @@ HandleSysAudioFilterPinProperties( NTSTATUS Status; PKSAUDIO_DEVICE_ENTRY Entry; ULONG BytesReturned; - PKSP_PIN Pin; // in order to access pin properties of a sysaudio device // the caller must provide a KSP_PIN struct, where @@ -110,8 +109,6 @@ HandleSysAudioFilterPinProperties( return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPROPERTY) + sizeof(ULONG)); } - Pin = (PKSP_PIN)Property; - Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, ((KSP_PIN*)Property)->Reserved); if (!Entry) { @@ -119,64 +116,15 @@ HandleSysAudioFilterPinProperties( return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } - if (!Entry->Pins) - { - /* expected pins */ - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); - } - - if (Entry->PinDescriptorsCount <= Pin->PinId) - { - /* invalid pin id */ - return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); - } - - if (Property->Id == KSPROPERTY_PIN_CTYPES) - { - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) - { - /* too small buffer */ - return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(ULONG)); - } - /* store result */ - *((PULONG)Irp->UserBuffer) = Entry->PinDescriptorsCount; - return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(ULONG)); - } - else if (Property->Id == KSPROPERTY_PIN_COMMUNICATION) - { - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSPIN_COMMUNICATION)) - { - /* too small buffer */ - return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPIN_COMMUNICATION)); - } - /* store result */ - *((KSPIN_COMMUNICATION*)Irp->UserBuffer) = Entry->PinDescriptors[Pin->PinId].Communication; - return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(KSPIN_COMMUNICATION)); - - } - else if (Property->Id == KSPROPERTY_PIN_DATAFLOW) - { - if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSPIN_DATAFLOW)) - { - /* too small buffer */ - return SetIrpIoStatus(Irp, STATUS_BUFFER_TOO_SMALL, sizeof(KSPIN_DATAFLOW)); - } - /* store result */ - *((KSPIN_DATAFLOW*)Irp->UserBuffer) = Entry->PinDescriptors[Pin->PinId].DataFlow; - return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(KSPIN_DATAFLOW)); - } - else - { - /* forward request to the filter implementing the property */ - Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, + /* forward request to the filter implementing the property */ + Status = KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)IoStack->Parameters.DeviceIoControl.Type3InputBuffer, IoStack->Parameters.DeviceIoControl.InputBufferLength, Irp->UserBuffer, IoStack->Parameters.DeviceIoControl.OutputBufferLength, &BytesReturned); - return SetIrpIoStatus(Irp, Status, BytesReturned); - } + return SetIrpIoStatus(Irp, Status, BytesReturned); } @@ -328,7 +276,7 @@ GetPinInstanceCount( PinRequest.Property.Set = KSPROPSETID_Pin; PinRequest.Property.Flags = KSPROPERTY_TYPE_GET; PinRequest.Property.Id = KSPROPERTY_PIN_CINSTANCES; - + ASSERT(Entry->FileObject); return KsSynchronousIoControlDevice(Entry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned); } diff --git a/drivers/wdm/audio/sysaudio/deviface.c b/drivers/wdm/audio/sysaudio/deviface.c index 48710319044..e1a0cfeaf04 100644 --- a/drivers/wdm/audio/sysaudio/deviface.c +++ b/drivers/wdm/audio/sysaudio/deviface.c @@ -14,139 +14,6 @@ const GUID KS_CATEGORY_AUDIO = {0x6994AD04L, 0x93EF, 0x11D0, { const GUID KS_CATEGORY_TOPOLOGY = {0xDDA54A40, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}}; const GUID DMOCATEGORY_ACOUSTIC_ECHO_CANCEL = {0xBF963D80L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}}; -NTSTATUS -BuildPinDescriptor( - IN PKSAUDIO_DEVICE_ENTRY DeviceEntry, - IN ULONG Count) -{ - ULONG Index; - KSP_PIN PinRequest; - KSPIN_DATAFLOW DataFlow; - KSPIN_COMMUNICATION Communication; - ULONG NumWaveOutPin, NumWaveInPin; - NTSTATUS Status; - ULONG BytesReturned; - - NumWaveInPin = 0; - NumWaveOutPin = 0; - for(Index = 0; Index < Count; Index++) - { - /* retrieve data flow */ - PinRequest.PinId = Index; - PinRequest.Property.Set = KSPROPSETID_Pin; - PinRequest.Property.Flags = KSPROPERTY_TYPE_GET; - - /* get dataflow direction */ - PinRequest.Property.Id = KSPROPERTY_PIN_DATAFLOW; - Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&DataFlow, sizeof(KSPIN_DATAFLOW), &BytesReturned); - if (NT_SUCCESS(Status)) - { - DeviceEntry->PinDescriptors[Index].DataFlow = DataFlow; - } - - /* get irp flow direction */ - PinRequest.Property.Id = KSPROPERTY_PIN_COMMUNICATION; - Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&Communication, sizeof(KSPIN_COMMUNICATION), &BytesReturned); - if (NT_SUCCESS(Status)) - { - DeviceEntry->PinDescriptors[Index].Communication = Communication; - } - - if (Communication == KSPIN_COMMUNICATION_SINK && DataFlow == KSPIN_DATAFLOW_IN) - NumWaveOutPin++; - - if (Communication == KSPIN_COMMUNICATION_SINK && DataFlow == KSPIN_DATAFLOW_OUT) - NumWaveInPin++; - - /* FIXME query for interface, dataformat etc */ - } - - DPRINT("Num Pins %u Num WaveIn Pins %u Name WaveOut Pins %u\n", DeviceEntry->PinDescriptorsCount, NumWaveInPin, NumWaveOutPin); - return STATUS_SUCCESS; -} - -VOID -QueryFilterRoutine( - IN PKSAUDIO_DEVICE_ENTRY DeviceEntry) -{ - KSPROPERTY PropertyRequest; - ULONG Count; - NTSTATUS Status; - ULONG BytesReturned; - - DPRINT("Querying filter...\n"); - - PropertyRequest.Set = KSPROPSETID_Pin; - PropertyRequest.Flags = KSPROPERTY_TYPE_GET; - PropertyRequest.Id = KSPROPERTY_PIN_CTYPES; - - /* query for num of pins */ - Status = KsSynchronousIoControlDevice(DeviceEntry->FileObject, KernelMode, IOCTL_KS_PROPERTY, (PVOID)&PropertyRequest, sizeof(KSPROPERTY), (PVOID)&Count, sizeof(ULONG), &BytesReturned); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to query number of pins Status %x\n", Status); - return; - } - - if (!Count) - { - DPRINT1("Filter has no pins!\n"); - return; - } - - /* allocate pin descriptor array */ - DeviceEntry->PinDescriptors = ExAllocatePool(NonPagedPool, Count * sizeof(KSPIN_DESCRIPTOR)); - if (!DeviceEntry->PinDescriptors) - { - /* no memory */ - return; - } - - /* zero array pin descriptor array */ - RtlZeroMemory(DeviceEntry->PinDescriptors, Count * sizeof(KSPIN_DESCRIPTOR)); - - /* build the device descriptor */ - Status = BuildPinDescriptor(DeviceEntry, Count); - if (!NT_SUCCESS(Status)) - return; - - - /* allocate pin array */ - DeviceEntry->Pins = ExAllocatePool(NonPagedPool, Count * sizeof(PIN_INFO)); - if (!DeviceEntry->Pins) - { - /* no memory */ - DPRINT1("Failed to allocate memory Pins %u Block %x\n", Count, Count * sizeof(PIN_INFO)); - return; - } - - /* clear array */ - RtlZeroMemory(DeviceEntry->Pins, sizeof(PIN_INFO) * Count); - DeviceEntry->PinDescriptorsCount = Count; - -} - -VOID -NTAPI -FilterPinWorkerRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - PKSAUDIO_DEVICE_ENTRY DeviceEntry; - PFILTER_WORKER_CONTEXT Ctx = (PFILTER_WORKER_CONTEXT)Context; - - DeviceEntry = Ctx->DeviceEntry; - - QueryFilterRoutine(DeviceEntry); - - /* free work item */ - IoFreeWorkItem(Ctx->WorkItem); - /* free work item context */ - ExFreePool(Ctx); - return; - -} - NTSTATUS OpenDevice( IN PUNICODE_STRING DeviceName, @@ -199,8 +66,6 @@ InsertAudioDevice( IN PUNICODE_STRING DeviceName) { NTSTATUS Status = STATUS_SUCCESS; - PFILTER_WORKER_CONTEXT Ctx = NULL; - PIO_WORKITEM WorkItem = NULL; PSYSAUDIODEVEXT DeviceExtension; PKSAUDIO_DEVICE_ENTRY DeviceEntry = NULL; @@ -215,24 +80,6 @@ InsertAudioDevice( /* initialize audio device entry */ RtlZeroMemory(DeviceEntry, sizeof(KSAUDIO_DEVICE_ENTRY)); - /* allocate filter ctx */ - Ctx = ExAllocatePool(NonPagedPool, sizeof(FILTER_WORKER_CONTEXT)); - if (!Ctx) - { - /* no memory */ - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - - /* allocate work item */ - WorkItem = IoAllocateWorkItem(DeviceObject); - if (!WorkItem) - { - /* no memory */ - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - /* set device name */ DeviceEntry->DeviceName.Length = 0; DeviceEntry->DeviceName.MaximumLength = DeviceName->MaximumLength + 10 * sizeof(WCHAR); @@ -255,9 +102,6 @@ InsertAudioDevice( goto cleanup; } - Ctx->DeviceEntry = DeviceEntry; - Ctx->WorkItem = WorkItem; - /* fetch device extension */ DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension; /* insert new audio device */ @@ -265,16 +109,9 @@ InsertAudioDevice( InterlockedIncrement((PLONG)&DeviceExtension->NumberOfKsAudioDevices); DPRINT("Successfully opened audio device %u Device %S\n", DeviceExtension->NumberOfKsAudioDevices, DeviceEntry->DeviceName.Buffer); - IoQueueWorkItem(WorkItem, FilterPinWorkerRoutine, DelayedWorkQueue, (PVOID)Ctx); return Status; cleanup: - if (Ctx) - ExFreePool(Ctx); - - if (WorkItem) - IoFreeWorkItem(WorkItem); - if (DeviceEntry) { if (DeviceEntry->DeviceName.Buffer) diff --git a/drivers/wdm/audio/sysaudio/main.c b/drivers/wdm/audio/sysaudio/main.c index 6e0fceeb16b..de1e06e3ce4 100644 --- a/drivers/wdm/audio/sysaudio/main.c +++ b/drivers/wdm/audio/sysaudio/main.c @@ -53,10 +53,10 @@ SysAudio_Shutdown( /* close audio device handle */ ZwClose(DeviceEntry->Handle); + /* free device string */ RtlFreeUnicodeString(&DeviceEntry->DeviceName); - /* free pins */ - ExFreePool(DeviceEntry->Pins); + /* free audio device entry */ ExFreePool(DeviceEntry); } diff --git a/drivers/wdm/audio/sysaudio/pin.c b/drivers/wdm/audio/sysaudio/pin.c index a2271a98c12..36ce635708d 100644 --- a/drivers/wdm/audio/sysaudio/pin.c +++ b/drivers/wdm/audio/sysaudio/pin.c @@ -354,7 +354,7 @@ InstantiatePins( } #endif - DeviceEntry->Pins[Connect->PinId].References = 0; + //DeviceEntry->Pins[Connect->PinId].References = 0; /* initialize dispatch context */ DispatchContext->Handle = RealPinHandle; @@ -385,6 +385,44 @@ InstantiatePins( return Status; } +NTSTATUS +GetConnectRequest( + IN PIRP Irp, + OUT PKSPIN_CONNECT * Result) +{ + PIO_STACK_LOCATION IoStack; + ULONG ObjectLength, ParametersLength; + PVOID Buffer; + + /* get current irp stack */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* get object class length */ + ObjectLength = (wcslen(KSSTRING_Pin) + 2) * sizeof(WCHAR); + + /* check for minium length requirement */ + if (ObjectLength + sizeof(KSPIN_CONNECT) > IoStack->FileObject->FileName.MaximumLength) + return STATUS_UNSUCCESSFUL; + + /* extract parameters length */ + ParametersLength = IoStack->FileObject->FileName.MaximumLength - ObjectLength; + + /* allocate buffer */ + Buffer = ExAllocatePool(NonPagedPool, ParametersLength); + if (!Buffer) + return STATUS_INSUFFICIENT_RESOURCES; + + /* copy parameters */ + RtlMoveMemory(Buffer, &IoStack->FileObject->FileName.Buffer[ObjectLength / sizeof(WCHAR)], ParametersLength); + + /* store result */ + *Result = (PKSPIN_CONNECT)Buffer; + + return STATUS_SUCCESS; +} + + + NTSTATUS NTAPI DispatchCreateSysAudioPin( @@ -394,7 +432,7 @@ DispatchCreateSysAudioPin( NTSTATUS Status = STATUS_SUCCESS; PIO_STACK_LOCATION IoStack; PKSAUDIO_DEVICE_ENTRY DeviceEntry; - PKSPIN_CONNECT Connect = NULL; + PKSPIN_CONNECT Connect; PDISPATCH_CONTEXT DispatchContext; DPRINT("DispatchCreateSysAudioPin entered\n"); @@ -410,9 +448,6 @@ DispatchCreateSysAudioPin( /* get current attached virtual device */ DeviceEntry = (PKSAUDIO_DEVICE_ENTRY)IoStack->FileObject->RelatedFileObject->FsContext; - /* now validate pin connect request */ - Status = KsValidateConnectRequest(Irp, DeviceEntry->PinDescriptorsCount, DeviceEntry->PinDescriptors, &Connect); - /* check for success */ if (!NT_SUCCESS(Status)) { @@ -422,6 +457,19 @@ DispatchCreateSysAudioPin( return Status; } + /* get connect details */ + Status = GetConnectRequest(Irp, &Connect); + + /* check for success */ + if (!NT_SUCCESS(Status)) + { + /* failed to obtain connect details */ + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } + + /* allocate dispatch context */ DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT)); if (!DispatchContext) diff --git a/drivers/wdm/audio/sysaudio/sysaudio.h b/drivers/wdm/audio/sysaudio/sysaudio.h index 01537b0a298..e5c11208dbf 100644 --- a/drivers/wdm/audio/sysaudio/sysaudio.h +++ b/drivers/wdm/audio/sysaudio/sysaudio.h @@ -24,9 +24,7 @@ typedef struct HANDLE Handle; // handle to audio device PFILE_OBJECT FileObject; // file objecto to audio device - PIN_INFO * Pins; // array of PIN_INFO - ULONG PinDescriptorsCount; // number of pin descriptors - KSPIN_DESCRIPTOR *PinDescriptors; // pin descriptors array + //PIN_INFO * Pins; // array of PIN_INFO }KSAUDIO_DEVICE_ENTRY, *PKSAUDIO_DEVICE_ENTRY; typedef struct @@ -62,20 +60,6 @@ typedef struct HANDLE hMixerPin; // handle to mixer pin }DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; -typedef struct -{ - PIO_WORKITEM WorkItem; - PKSAUDIO_DEVICE_ENTRY DeviceEntry; -}FILTER_WORKER_CONTEXT, *PFILTER_WORKER_CONTEXT; - -typedef struct -{ - PIRP Irp; - IO_STATUS_BLOCK StatusBlock; -}COMPLETION_CONTEXT, *PCOMPLETION_CONTEXT; - - - NTSTATUS SysAudioAllocateDeviceHeader( IN SYSAUDIODEVEXT *DeviceExtension); diff --git a/hal/hal.pspec b/hal/hal.pspec index 3fff8370170..3edf88ca595 100644 --- a/hal/hal.pspec +++ b/hal/hal.pspec @@ -52,6 +52,7 @@ @ stdcall HalInitializeProcessor(long ptr) @ stdcall HalMakeBeep(long) @ stdcall HalProcessorIdle() +@ stdcall HalPutDmaAdapter(ptr) @ stdcall HalQueryDisplayParameters(ptr ptr ptr ptr) @ stdcall HalQueryRealTimeClock(ptr) @ stdcall HalReadDmaCounter(ptr) diff --git a/hal/halx86/generic/bus/pcibus.c b/hal/halx86/generic/bus/pcibus.c index 2440cd4182b..3c46e805122 100644 --- a/hal/halx86/generic/bus/pcibus.c +++ b/hal/halx86/generic/bus/pcibus.c @@ -360,10 +360,10 @@ HalpGetPCIData(IN PBUS_HANDLER BusHandler, (1 == BusHandler->BusNumber && 0 != Slot.u.bits.DeviceNumber)) { DPRINT("Blacklisted PCI slot\n"); - if (0 == Offset && 2 <= Length) + if (0 == Offset && sizeof(USHORT) <= Length) { *(PUSHORT)Buffer = PCI_INVALID_VENDORID; - return 2; + return sizeof(USHORT); } return 0; } @@ -700,7 +700,6 @@ HaliPciInterfaceReadConfig(IN PBUS_HANDLER RootBusHandler, IN ULONG Length) { BUS_HANDLER BusHandler; - PPCI_COMMON_CONFIG PciData = (PPCI_COMMON_CONFIG)Buffer; /* Setup fake PCI Bus handler */ RtlCopyMemory(&BusHandler, &HalpFakePciBusHandler, sizeof(BUS_HANDLER)); @@ -709,21 +708,6 @@ HaliPciInterfaceReadConfig(IN PBUS_HANDLER RootBusHandler, /* Read configuration data */ HalpReadPCIConfig(&BusHandler, SlotNumber, Buffer, Offset, Length); - /* Check if caller only wanted at least Vendor ID */ - if (Length >= 2) - { - /* Validate it */ - if (PciData->VendorID != PCI_INVALID_VENDORID) - { - /* Check if this is the new maximum bus number */ - if (HalpMaxPciBus < BusHandler.BusNumber) - { - /* Set it */ - HalpMaxPciBus = BusHandler.BusNumber; - } - } - } - /* Return length */ return Length; } @@ -970,6 +954,7 @@ HalpInitializePciStubs(VOID) ULONG i; PCI_SLOT_NUMBER j; ULONG VendorId = 0; + ULONG MaxPciBusNumber; /* Query registry information */ PciRegistryInfo = HalpQueryPciRegistryInfo(); @@ -977,11 +962,19 @@ HalpInitializePciStubs(VOID) { /* Assume type 1 */ PciType = 1; + + /* Force a manual bus scan later */ + MaxPciBusNumber = MAXULONG; } else { - /* Get the type and free the info structure */ + /* Get the PCI type */ PciType = PciRegistryInfo->HardwareMechanism & 0xF; + + /* Get MaxPciBusNumber and make it 0-based */ + MaxPciBusNumber = PciRegistryInfo->NoBuses - 1; + + /* Free the info structure */ ExFreePool(PciRegistryInfo); } @@ -1007,7 +1000,7 @@ HalpInitializePciStubs(VOID) /* Type 2 PCI Bus */ case 2: - /* Copy the Type 1 handler data */ + /* Copy the Type 2 handler data */ RtlCopyMemory(&PCIConfigHandler, &PCIConfigHandlerType2, sizeof (PCIConfigHandler)); @@ -1027,31 +1020,44 @@ HalpInitializePciStubs(VOID) DbgPrint("HAL: Unknown PCI type\n"); } - /* Loop all possible buses */ - for (i = 0; i < 256; i++) + /* Run a forced bus scan if needed */ + if (MaxPciBusNumber == MAXULONG) { - /* Loop all devices */ - for (j.u.AsULONG = 0; j.u.AsULONG < 32; j.u.AsULONG++) + /* Initialize the max bus number to 0xFF */ + HalpMaxPciBus = 0xFF; + + /* Initialize the counter */ + MaxPciBusNumber = 0; + + /* Loop all possible buses */ + for (i = 0; i < HalpMaxPciBus; i++) { - /* Query the interface */ - if (HaliPciInterfaceReadConfig(NULL, - i, - j, - &VendorId, - 0, - sizeof(ULONG))) + /* Loop all devices */ + for (j.u.AsULONG = 0; j.u.AsULONG < BusData->MaxDevice; j.u.AsULONG++) { - /* Validate the vendor ID */ - if ((USHORT)VendorId != PCI_INVALID_VENDORID) + /* Query the interface */ + if (HaliPciInterfaceReadConfig(NULL, + i, + j, + &VendorId, + 0, + sizeof(ULONG))) { - /* Set this as the maximum ID */ - HalpMaxPciBus = i; - break; + /* Validate the vendor ID */ + if ((USHORT)VendorId != PCI_INVALID_VENDORID) + { + /* Set this as the maximum ID */ + MaxPciBusNumber = i; + break; + } } } } } + /* Set the real max bus number */ + HalpMaxPciBus = MaxPciBusNumber; + /* We're done */ HalpPCIConfigInitialized = TRUE; } diff --git a/hal/halx86/hal_generic.rbuild b/hal/halx86/hal_generic.rbuild index 8dd5f7bc57d..3532d001d18 100644 --- a/hal/halx86/hal_generic.rbuild +++ b/hal/halx86/hal_generic.rbuild @@ -37,15 +37,15 @@ - . + x86bios.c - halinit.c - irq.S - misc.c - apic.c + + + + systimer.S - usage.c + diff --git a/hal/halx86/halamd64.rbuild b/hal/halx86/halamd64.rbuild index ad96c0f1cf9..92c4f29983d 100644 --- a/hal/halx86/halamd64.rbuild +++ b/hal/halx86/halamd64.rbuild @@ -13,7 +13,7 @@ hal_generic hal_generic_acpi ntoskrnl - x86emu + spinlock.c diff --git a/include/host/typedefs.h b/include/host/typedefs.h index 42f30ed2294..07146c48220 100644 --- a/include/host/typedefs.h +++ b/include/host/typedefs.h @@ -65,6 +65,7 @@ typedef PVOID HANDLE, HKEY, *PHKEY; typedef INT NTSTATUS, POOL_TYPE; typedef LONG HRESULT; typedef ULONG_PTR SIZE_T, *PSIZE_T; +typedef WORD LANGID; #define MAXUSHORT USHRT_MAX @@ -232,6 +233,11 @@ typedef const UNICODE_STRING *PCUNICODE_STRING; #define RtlCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length) #define RtlMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length) +#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p)) +#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff) +#define SUBLANGID(l) ((WORD)(l)>>10) +#define SUBLANG_NEUTRAL 0x00 + /* Prevent inclusion of some other headers */ #define __INTERNAL_DEBUG #define RTL_H diff --git a/include/host/wcsfuncs.h b/include/host/wcsfuncs.h index bf2c12771f2..c07679aa34a 100644 --- a/include/host/wcsfuncs.h +++ b/include/host/wcsfuncs.h @@ -11,14 +11,19 @@ #ifdef USE_HOST_WCSFUNCS /* Function prototypes */ - SIZE_T utf16_wcslen(PCWSTR str); - PWSTR utf16_wcschr(PWSTR str, WCHAR c); - INT utf16_wcsncmp(PCWSTR string1, PCWSTR string2, size_t count); + #else - /* Define the utf16_ functions to the CRT functions */ - #define utf16_wcslen wcslen - #define utf16_wcschr wcschr - #define utf16_wcsncmp wcsncmp + /* Map str*W functions to wcs* function */ + + #define isspaceW iswspace + #define strchrW wcschr + #define strcmpiW _wcsicmp + #define strcpyW wcscpy + #define strlenW wcslen + #define strncmpW wcsncmp + #define strtolW wcstol + #define strtoulW wcstoul + #endif #endif diff --git a/include/ndk/i386/asm.h b/include/ndk/i386/asm.h index eaaf2ae1bc4..f54529442e1 100644 --- a/include/ndk/i386/asm.h +++ b/include/ndk/i386/asm.h @@ -478,6 +478,7 @@ Author: #define FIBER_CONTEXT_ESI FIBER_CONTEXT + CONTEXT_ESI #define FIBER_CONTEXT_EDI FIBER_CONTEXT + CONTEXT_EDI #define FIBER_CONTEXT_EBP FIBER_CONTEXT + CONTEXT_EBP +#define FIBER_CONTEXT_EIP FIBER_CONTEXT + CONTEXT_EIP #define FIBER_CONTEXT_ESP FIBER_CONTEXT + CONTEXT_ESP #define FIBER_CONTEXT_DR6 FIBER_CONTEXT + CONTEXT_DR6 #define FIBER_CONTEXT_FLOAT_SAVE_STATUS_WORD FIBER_CONTEXT + CONTEXT_FLOAT_SAVE_STATUS_WORD diff --git a/include/ndk/i386/ketypes.h b/include/ndk/i386/ketypes.h index f90a39e0a12..0f5557ee1f6 100644 --- a/include/ndk/i386/ketypes.h +++ b/include/ndk/i386/ketypes.h @@ -151,6 +151,10 @@ Author: (USHORT)(sizeof(KTSS)) : \ (USHORT)(FIELD_OFFSET(KTSS, IoMaps[MapNumber-1].IoMap)) +typedef UCHAR KIO_ACCESS_MAP[IOPM_SIZE]; + +typedef KIO_ACCESS_MAP *PKIO_ACCESS_MAP; + // // Size of the XMM register save area in the FXSAVE format // diff --git a/include/psdk/commctrl.h b/include/psdk/commctrl.h index 24b04fdb2e7..9f3366e3474 100644 --- a/include/psdk/commctrl.h +++ b/include/psdk/commctrl.h @@ -1,1254 +1,852 @@ -/* - * Common controls definitions - * - * Copyright (C) the Wine project - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ +#ifndef _INC_COMMCTRL +#define _INC_COMMCTRL -#ifndef __WINE_COMMCTRL_H -#define __WINE_COMMCTRL_H +#ifndef _WINRESRC_ +#ifndef _WIN32_IE +#define _WIN32_IE 0x0501 +#else +/* FIXME: This really must be 0x0501 !!! */ +#if (_WIN32_IE < 0x0500) +#error _WIN32_IE setting conflicts +#endif +#endif +#endif -#include +#ifndef _HRESULT_DEFINED +#define _HRESULT_DEFINED +typedef LONG HRESULT; +#endif + +#ifndef NOUSER +#ifndef WINCOMMCTRLAPI +#ifndef _COMCTL32_ +#define WINCOMMCTRLAPI DECLSPEC_IMPORT +#else +#define WINCOMMCTRLAPI +#endif +#endif #ifdef __cplusplus extern "C" { #endif -BOOL WINAPI ShowHideMenuCtl (HWND, UINT_PTR, LPINT); -VOID WINAPI GetEffectiveClientRect (HWND, LPRECT, const INT*); -VOID WINAPI InitCommonControls (VOID); +#include -typedef struct tagINITCOMMONCONTROLSEX { - DWORD dwSize; - DWORD dwICC; -} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX; - -BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX*); - -LANGID WINAPI GetMUILanguage (VOID); -VOID WINAPI InitMUILanguage (LANGID uiLang); - - -#define COMCTL32_VERSION 5 /* dll version */ - -#ifndef _WIN32_IE -#define _WIN32_IE 0x0400 +#ifndef SNDMSG +#ifdef __cplusplus +#define SNDMSG ::SendMessage +#else +#define SNDMSG SendMessage +#endif #endif -#define ICC_LISTVIEW_CLASSES 0x00000001 /* listview, header */ -#define ICC_TREEVIEW_CLASSES 0x00000002 /* treeview, tooltips */ -#define ICC_BAR_CLASSES 0x00000004 /* toolbar, statusbar, trackbar, tooltips */ -#define ICC_TAB_CLASSES 0x00000008 /* tab, tooltips */ -#define ICC_UPDOWN_CLASS 0x00000010 /* updown */ -#define ICC_PROGRESS_CLASS 0x00000020 /* progress */ -#define ICC_HOTKEY_CLASS 0x00000040 /* hotkey */ -#define ICC_ANIMATE_CLASS 0x00000080 /* animate */ -#define ICC_WIN95_CLASSES 0x000000FF -#define ICC_DATE_CLASSES 0x00000100 /* month picker, date picker, time picker, updown */ -#define ICC_USEREX_CLASSES 0x00000200 /* comboex */ -#define ICC_COOL_CLASSES 0x00000400 /* rebar (coolbar) */ -#define ICC_INTERNET_CLASSES 0x00000800 /* IP address, ... */ -#define ICC_PAGESCROLLER_CLASS 0x00001000 /* page scroller */ -#define ICC_NATIVEFNTCTL_CLASS 0x00002000 /* native font control ???*/ -#define ICC_STANDARD_CLASSES 0x00004000 -#define ICC_LINK_CLASS 0x00008000 + WINCOMMCTRLAPI void WINAPI InitCommonControls(void); + typedef struct tagINITCOMMONCONTROLSEX { + DWORD dwSize; + DWORD dwICC; + } INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX; +#define ICC_LISTVIEW_CLASSES 0x1 +#define ICC_TREEVIEW_CLASSES 0x2 +#define ICC_BAR_CLASSES 0x4 +#define ICC_TAB_CLASSES 0x8 +#define ICC_UPDOWN_CLASS 0x10 +#define ICC_PROGRESS_CLASS 0x20 +#define ICC_HOTKEY_CLASS 0x40 +#define ICC_ANIMATE_CLASS 0x80 +#define ICC_WIN95_CLASSES 0xff +#define ICC_DATE_CLASSES 0x100 +#define ICC_USEREX_CLASSES 0x200 +#define ICC_COOL_CLASSES 0x400 +#define ICC_INTERNET_CLASSES 0x800 +#define ICC_PAGESCROLLER_CLASS 0x1000 +#define ICC_NATIVEFNTCTL_CLASS 0x2000 +#define ICC_STANDARD_CLASSES 0x4000 +#define ICC_LINK_CLASS 0x8000 + WINCOMMCTRLAPI WINBOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *); -/* common control styles */ -#define CCS_TOP 0x00000001L -#define CCS_NOMOVEY 0x00000002L -#define CCS_BOTTOM 0x00000003L -#define CCS_NORESIZE 0x00000004L -#define CCS_NOPARENTALIGN 0x00000008L -#define CCS_ADJUSTABLE 0x00000020L -#define CCS_NODIVIDER 0x00000040L -#define CCS_VERT 0x00000080L -#define CCS_LEFT (CCS_VERT|CCS_TOP) -#define CCS_RIGHT (CCS_VERT|CCS_BOTTOM) -#define CCS_NOMOVEX (CCS_VERT|CCS_NOMOVEY) +#define ODT_HEADER 100 +#define ODT_TAB 101 +#define ODT_LISTVIEW 102 +#define LVM_FIRST 0x1000 +#define TV_FIRST 0x1100 +#define HDM_FIRST 0x1200 +#define TCM_FIRST 0x1300 -/* common control shared messages */ -#define CCM_FIRST 0x2000 +#define PGM_FIRST 0x1400 +#define ECM_FIRST 0x1500 +#define BCM_FIRST 0x1600 +#define CBM_FIRST 0x1700 +#define CCM_FIRST 0x2000 +#define CCM_LAST (CCM_FIRST+0x200) +#define CCM_SETBKCOLOR (CCM_FIRST+1) +#define CCM_SETCOLORSCHEME (CCM_FIRST+2) +#define CCM_GETCOLORSCHEME (CCM_FIRST+3) +#define CCM_GETDROPTARGET (CCM_FIRST+4) +#define CCM_SETUNICODEFORMAT (CCM_FIRST+5) +#define CCM_GETUNICODEFORMAT (CCM_FIRST+6) -#define CCM_SETBKCOLOR (CCM_FIRST+0x1) /* lParam = bkColor */ -#define CCM_SETCOLORSCHEME (CCM_FIRST+0x2) /* lParam = COLORSCHEME struct ptr */ -#define CCM_GETCOLORSCHEME (CCM_FIRST+0x3) /* lParam = COLORSCHEME struct ptr */ -#define CCM_GETDROPTARGET (CCM_FIRST+0x4) -#define CCM_SETUNICODEFORMAT (CCM_FIRST+0x5) -#define CCM_GETUNICODEFORMAT (CCM_FIRST+0x6) -#define CCM_SETVERSION (CCM_FIRST+0x7) -#define CCM_GETVERSION (CCM_FIRST+0x8) -#define CCM_SETNOTIFYWINDOW (CCM_FIRST+0x9) /* wParam = hwndParent */ -#define CCM_SETWINDOWTHEME (CCM_FIRST+0xb) -#define CCM_DPISCALE (CCM_FIRST+0xc) + typedef struct tagCOLORSCHEME { + DWORD dwSize; + COLORREF clrBtnHighlight; + COLORREF clrBtnShadow; + } COLORSCHEME,*LPCOLORSCHEME; +#define COMCTL32_VERSION 6 -/* common notification codes (WM_NOTIFY)*/ -#define NM_FIRST (0U- 0U) -#define NM_LAST (0U- 99U) -#define NM_OUTOFMEMORY (NM_FIRST-1) -#define NM_CLICK (NM_FIRST-2) -#define NM_DBLCLK (NM_FIRST-3) -#define NM_RETURN (NM_FIRST-4) -#define NM_RCLICK (NM_FIRST-5) -#define NM_RDBLCLK (NM_FIRST-6) -#define NM_SETFOCUS (NM_FIRST-7) -#define NM_KILLFOCUS (NM_FIRST-8) -#define NM_CUSTOMDRAW (NM_FIRST-12) -#define NM_HOVER (NM_FIRST-13) -#define NM_NCHITTEST (NM_FIRST-14) -#define NM_KEYDOWN (NM_FIRST-15) -#define NM_RELEASEDCAPTURE (NM_FIRST-16) -#define NM_SETCURSOR (NM_FIRST-17) -#define NM_CHAR (NM_FIRST-18) -#define NM_TOOLTIPSCREATED (NM_FIRST-19) -#define NM_LDOWN (NM_FIRST-20) -#define NM_RDOWN (NM_FIRST-21) -#define NM_THEMECHANGED (NM_FIRST-22) -#define NM_FONTCHANGED (NM_FIRST-23) -#define NM_CUSTOMTEXT (NM_FIRST-24) -#define NM_TVSTATEIMAGECHANGING (NM_FIRST-24) +#define CCM_SETVERSION (CCM_FIRST+0x7) +#define CCM_GETVERSION (CCM_FIRST+0x8) +#define CCM_SETNOTIFYWINDOW (CCM_FIRST+0x9) +#define CCM_SETWINDOWTHEME (CCM_FIRST+0xb) +#define CCM_DPISCALE (CCM_FIRST+0xc) -#define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \ - (fn)((hwnd), (int)(wParam), (NMHDR*)(lParam)) -#define FORWARD_WM_NOTIFY(hwnd, idFrom, pnmhdr, fn) \ - (LRESULT)(fn)((hwnd), WM_NOTIFY, (WPARAM)(int)(idFrom), (LPARAM)(NMHDR*)(pnmhdr)) +#define INFOTIPSIZE 1024 +#define HANDLE_WM_NOTIFY(hwnd,wParam,lParam,fn) (fn)((hwnd),(int)(wParam),(NMHDR *)(lParam)) +#define FORWARD_WM_NOTIFY(hwnd,idFrom,pnmhdr,fn) (LRESULT)(fn)((hwnd),WM_NOTIFY,(WPARAM)(int)(idFrom),(LPARAM)(NMHDR *)(pnmhdr)) -/* callback constants */ -#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) -#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) -#define LPSTR_TEXTCALLBACK WINELIB_NAME_AW(LPSTR_TEXTCALLBACK) +#define NM_OUTOFMEMORY (NM_FIRST-1) +#define NM_CLICK (NM_FIRST-2) +#define NM_DBLCLK (NM_FIRST-3) +#define NM_RETURN (NM_FIRST-4) +#define NM_RCLICK (NM_FIRST-5) +#define NM_RDBLCLK (NM_FIRST-6) +#define NM_SETFOCUS (NM_FIRST-7) +#define NM_KILLFOCUS (NM_FIRST-8) +#define NM_CUSTOMDRAW (NM_FIRST-12) +#define NM_HOVER (NM_FIRST-13) +#define NM_NCHITTEST (NM_FIRST-14) +#define NM_KEYDOWN (NM_FIRST-15) +#define NM_RELEASEDCAPTURE (NM_FIRST-16) +#define NM_SETCURSOR (NM_FIRST-17) +#define NM_CHAR (NM_FIRST-18) +#define NM_TOOLTIPSCREATED (NM_FIRST-19) +#define NM_LDOWN (NM_FIRST-20) +#define NM_RDOWN (NM_FIRST-21) +#define NM_THEMECHANGED (NM_FIRST-22) -#define I_IMAGECALLBACK (-1) -#define I_IMAGENONE (-2) -#define I_INDENTCALLBACK (-1) -#define I_CHILDRENCALLBACK (-1) -#define I_GROUPIDCALLBACK (-1) -#define I_GROUPIDNONE (-2) -#define I_COLUMNSCALLBACK ((UINT)-1) +#ifndef CCSIZEOF_STRUCT +#define CCSIZEOF_STRUCT(structname,member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0))))+sizeof(((structname*)0)->member)) +#endif -/* owner drawn types */ -#define ODT_HEADER 100 -#define ODT_TAB 101 -#define ODT_LISTVIEW 102 - -/* common notification structures */ -typedef struct tagNMTOOLTIPSCREATED -{ - NMHDR hdr; + typedef struct tagNMTOOLTIPSCREATED { + NMHDR hdr; HWND hwndToolTips; -} NMTOOLTIPSCREATED, *LPNMTOOLTIPSCREATED; + } NMTOOLTIPSCREATED,*LPNMTOOLTIPSCREATED; -typedef struct tagNMMOUSE -{ - NMHDR hdr; - DWORD_PTR dwItemSpec; - DWORD_PTR dwItemData; - POINT pt; - DWORD dwHitInfo; /* info where on item or control the mouse is */ -} NMMOUSE, *LPNMMOUSE; + typedef struct tagNMMOUSE { + NMHDR hdr; + DWORD_PTR dwItemSpec; + DWORD_PTR dwItemData; + POINT pt; + LPARAM dwHitInfo; + } NMMOUSE,*LPNMMOUSE; -typedef struct tagNMOBJECTNOTIFY -{ - NMHDR hdr; - int iItem; + typedef NMMOUSE NMCLICK; + typedef LPNMMOUSE LPNMCLICK; + + typedef struct tagNMOBJECTNOTIFY { + NMHDR hdr; + int iItem; #ifdef __IID_DEFINED__ const IID *piid; #else const void *piid; #endif - void *pObject; + void *pObject; HRESULT hResult; - DWORD dwFlags; -} NMOBJECTNOTIFY, *LPNMOBJECTNOTIFY; + DWORD dwFlags; + } NMOBJECTNOTIFY,*LPNMOBJECTNOTIFY; -typedef struct tagNMKEY -{ - NMHDR hdr; - UINT nVKey; - UINT uFlags; -} NMKEY, *LPNMKEY; + typedef struct tagNMKEY { + NMHDR hdr; + UINT nVKey; + UINT uFlags; + } NMKEY,*LPNMKEY; -typedef struct tagNMCHAR -{ - NMHDR hdr; - UINT ch; - DWORD dwItemPrev; /* Item previously selected */ - DWORD dwItemNext; /* Item to be selected */ -} NMCHAR, *LPNMCHAR; + typedef struct tagNMCHAR { + NMHDR hdr; + UINT ch; + DWORD dwItemPrev; + DWORD dwItemNext; + } NMCHAR,*LPNMCHAR; -#ifndef CCSIZEOF_STRUCT -#define CCSIZEOF_STRUCT(name, member) \ - (((INT)((LPBYTE)(&((name*)0)->member)-((LPBYTE)((name*)0))))+ \ - sizeof(((name*)0)->member)) +#define NM_FIRST (0U- 0U) +#define NM_LAST (0U- 99U) + +#define LVN_FIRST (0U-100U) +#define LVN_LAST (0U-199U) + +#define HDN_FIRST (0U-300U) +#define HDN_LAST (0U-399U) + +#define TVN_FIRST (0U-400U) +#define TVN_LAST (0U-499U) + +#define TTN_FIRST (0U-520U) +#define TTN_LAST (0U-549U) + +#define TCN_FIRST (0U-550U) +#define TCN_LAST (0U-580U) + +#ifndef CDN_FIRST +#define CDN_FIRST (0U-601U) +#define CDN_LAST (0U-699U) #endif +#define TBN_FIRST (0U-700U) +#define TBN_LAST (0U-720U) -/* This is only for Winelib applications. DON't use it wine itself!!! */ -#ifndef SNDMSG -#ifdef __cplusplus -#define SNDMSG ::SendMessage -#else /* __cplusplus */ -#define SNDMSG SendMessage -#endif /* __cplusplus */ -#endif /* SNDMSG */ +#define UDN_FIRST (0U-721) +#define UDN_LAST (0U-740) +#define MCN_FIRST (0U-750U) +#define MCN_LAST (0U-759U) +#define DTN_FIRST (0U-760U) +#define DTN_LAST (0U-799U) +#define CBEN_FIRST (0U-800U) +#define CBEN_LAST (0U-830U) +#define RBN_FIRST (0U-831U) +#define RBN_LAST (0U-859U) -#ifdef __cplusplus -#define SNDMSGA ::SendMessageA -#define SNDMSGW ::SendMessageW -#else -#define SNDMSGA SendMessageA -#define SNDMSGW SendMessageW +#define IPN_FIRST (0U-860U) +#define IPN_LAST (0U-879U) +#define SBN_FIRST (0U-880U) +#define SBN_LAST (0U-899U) +#define PGN_FIRST (0U-900U) +#define PGN_LAST (0U-950U) + +#ifndef WMN_FIRST +#define WMN_FIRST (0U-1000U) +#define WMN_LAST (0U-1200U) #endif -/* Custom Draw messages */ +#define BCN_FIRST (0U-1250U) +#define BCN_LAST (0U-1350U) -#define CDRF_DODEFAULT 0x0 -#define CDRF_NEWFONT 0x00000002 -#define CDRF_SKIPDEFAULT 0x00000004 -#define CDRF_NOTIFYPOSTPAINT 0x00000010 -#define CDRF_NOTIFYITEMDRAW 0x00000020 -#define CDRF_NOTIFYSUBITEMDRAW 0x00000020 -#define CDRF_NOTIFYPOSTERASE 0x00000040 -#define CDRF_NOTIFYITEMERASE 0x00000080 /* obsolete ??? */ +#define MSGF_COMMCTRL_BEGINDRAG 0x4200 +#define MSGF_COMMCTRL_SIZEHEADER 0x4201 +#define MSGF_COMMCTRL_DRAGSELECT 0x4202 +#define MSGF_COMMCTRL_TOOLBARCUST 0x4203 +#define CDRF_DODEFAULT 0x0 +#define CDRF_NEWFONT 0x2 +#define CDRF_SKIPDEFAULT 0x4 -/* drawstage flags */ +#define CDRF_NOTIFYPOSTPAINT 0x10 +#define CDRF_NOTIFYITEMDRAW 0x20 +#define CDRF_NOTIFYSUBITEMDRAW 0x20 +#define CDRF_NOTIFYPOSTERASE 0x40 -#define CDDS_PREPAINT 1 -#define CDDS_POSTPAINT 2 -#define CDDS_PREERASE 3 -#define CDDS_POSTERASE 4 +#define CDDS_PREPAINT 0x1 +#define CDDS_POSTPAINT 0x2 +#define CDDS_PREERASE 0x3 +#define CDDS_POSTERASE 0x4 +#define CDDS_ITEM 0x10000 +#define CDDS_ITEMPREPAINT (CDDS_ITEM | CDDS_PREPAINT) +#define CDDS_ITEMPOSTPAINT (CDDS_ITEM | CDDS_POSTPAINT) +#define CDDS_ITEMPREERASE (CDDS_ITEM | CDDS_PREERASE) +#define CDDS_ITEMPOSTERASE (CDDS_ITEM | CDDS_POSTERASE) +#define CDDS_SUBITEM 0x20000 -#define CDDS_ITEM 0x00010000 -#define CDDS_ITEMPREPAINT (CDDS_ITEM | CDDS_PREPAINT) -#define CDDS_ITEMPOSTPAINT (CDDS_ITEM | CDDS_POSTPAINT) -#define CDDS_ITEMPREERASE (CDDS_ITEM | CDDS_PREERASE) -#define CDDS_ITEMPOSTERASE (CDDS_ITEM | CDDS_POSTERASE) -#define CDDS_SUBITEM 0x00020000 +#define CDIS_SELECTED 0x1 +#define CDIS_GRAYED 0x2 +#define CDIS_DISABLED 0x4 +#define CDIS_CHECKED 0x8 +#define CDIS_FOCUS 0x10 +#define CDIS_DEFAULT 0x20 +#define CDIS_HOT 0x40 +#define CDIS_MARKED 0x80 +#define CDIS_INDETERMINATE 0x100 +#define CDIS_SHOWKEYBOARDCUES 0x200 -/* itemState flags */ + typedef struct tagNMCUSTOMDRAWINFO { + NMHDR hdr; + DWORD dwDrawStage; + HDC hdc; + RECT rc; + DWORD_PTR dwItemSpec; + UINT uItemState; + LPARAM lItemlParam; + } NMCUSTOMDRAW,*LPNMCUSTOMDRAW; -#define CDIS_SELECTED 0x0001 -#define CDIS_GRAYED 0x0002 -#define CDIS_DISABLED 0x0004 -#define CDIS_CHECKED 0x0008 -#define CDIS_FOCUS 0x0010 -#define CDIS_DEFAULT 0x0020 -#define CDIS_HOT 0x0040 -#define CDIS_MARKED 0x0080 -#define CDIS_INDETERMINATE 0x0100 -#define CDIS_SHOWKEYBOARDCUES 0x0200 -#define CDIS_NEARHOT 0x0400 -#define CDIS_OTHERSIDEHOT 0x0800 -#define CDIS_DROPHILITED 0x1000 - - -typedef struct tagNMCUSTOMDRAWINFO -{ - NMHDR hdr; - DWORD dwDrawStage; - HDC hdc; - RECT rc; - DWORD_PTR dwItemSpec; - UINT uItemState; - LPARAM lItemlParam; -} NMCUSTOMDRAW, *LPNMCUSTOMDRAW; - -typedef struct tagNMTTCUSTOMDRAW -{ + typedef struct tagNMTTCUSTOMDRAW { NMCUSTOMDRAW nmcd; - UINT uDrawFlags; -} NMTTCUSTOMDRAW, *LPNMTTCUSTOMDRAW; + UINT uDrawFlags; + } NMTTCUSTOMDRAW,*LPNMTTCUSTOMDRAW; +#ifndef NOIMAGEAPIS +#define CLR_NONE 0xffffffffL +#define CLR_DEFAULT 0xFF000000L - -/* StatusWindow */ - -#define STATUSCLASSNAMEA "msctls_statusbar32" -#if defined(__GNUC__) -# define STATUSCLASSNAMEW (const WCHAR []){ 'm','s','c','t','l','s','_', \ - 's','t','a','t','u','s','b','a','r','3','2',0 } -#elif defined(_MSC_VER) -# define STATUSCLASSNAMEW L"msctls_statusbar32" -#else -static const WCHAR STATUSCLASSNAMEW[] = { 'm','s','c','t','l','s','_', - 's','t','a','t','u','s','b','a','r','3','2',0 }; +#ifndef HIMAGELIST + struct _IMAGELIST; + typedef struct _IMAGELIST *HIMAGELIST; #endif -#define STATUSCLASSNAME WINELIB_NAME_AW(STATUSCLASSNAME) -#define SBT_NOBORDERS 0x0100 -#define SBT_POPOUT 0x0200 -#define SBT_RTLREADING 0x0400 /* not supported */ -#define SBT_TOOLTIPS 0x0800 -#define SBT_OWNERDRAW 0x1000 +#ifndef IMAGELISTDRAWPARAMS + typedef struct _IMAGELISTDRAWPARAMS { + DWORD cbSize; + HIMAGELIST himl; + int i; + HDC hdcDst; + int x; + int y; + int cx; + int cy; + int xBitmap; + int yBitmap; + COLORREF rgbBk; + COLORREF rgbFg; + UINT fStyle; + DWORD dwRop; + DWORD fState; + DWORD Frame; + COLORREF crEffect; + } IMAGELISTDRAWPARAMS,*LPIMAGELISTDRAWPARAMS; -#define SBARS_SIZEGRIP 0x0100 - -#define SB_SIMPLEID 0x00ff - -#define SB_SETTEXTA (WM_USER+1) -#define SB_SETTEXTW (WM_USER+11) -#define SB_SETTEXT WINELIB_NAME_AW(SB_SETTEXT) -#define SB_GETTEXTA (WM_USER+2) -#define SB_GETTEXTW (WM_USER+13) -#define SB_GETTEXT WINELIB_NAME_AW(SB_GETTEXT) -#define SB_GETTEXTLENGTHA (WM_USER+3) -#define SB_GETTEXTLENGTHW (WM_USER+12) -#define SB_GETTEXTLENGTH WINELIB_NAME_AW(SB_GETTEXTLENGTH) -#define SB_SETPARTS (WM_USER+4) -#define SB_SETBORDERS (WM_USER+5) -#define SB_GETPARTS (WM_USER+6) -#define SB_GETBORDERS (WM_USER+7) -#define SB_SETMINHEIGHT (WM_USER+8) -#define SB_SIMPLE (WM_USER+9) -#define SB_GETRECT (WM_USER+10) -#define SB_ISSIMPLE (WM_USER+14) -#define SB_SETICON (WM_USER+15) -#define SB_SETTIPTEXTA (WM_USER+16) -#define SB_SETTIPTEXTW (WM_USER+17) -#define SB_SETTIPTEXT WINELIB_NAME_AW(SB_SETTIPTEXT) -#define SB_GETTIPTEXTA (WM_USER+18) -#define SB_GETTIPTEXTW (WM_USER+19) -#define SB_GETTIPTEXT WINELIB_NAME_AW(SB_GETTIPTEXT) -#define SB_GETICON (WM_USER+20) -#define SB_SETBKCOLOR CCM_SETBKCOLOR /* lParam = bkColor */ -#define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - -#define SBN_FIRST (0U-880U) -#define SBN_LAST (0U-899U) -#define SBN_SIMPLEMODECHANGE (SBN_FIRST-0) - -HWND WINAPI CreateStatusWindowA (LONG, LPCSTR, HWND, UINT); -HWND WINAPI CreateStatusWindowW (LONG, LPCWSTR, HWND, UINT); -#define CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow) -VOID WINAPI DrawStatusTextA (HDC, LPCRECT, LPCSTR, UINT); -VOID WINAPI DrawStatusTextW (HDC, LPCRECT, LPCWSTR, UINT); -#define DrawStatusText WINELIB_NAME_AW(DrawStatusText) -VOID WINAPI MenuHelp (UINT, WPARAM, LPARAM, HMENU, - HINSTANCE, HWND, UINT*); - -typedef struct tagCOLORSCHEME -{ - DWORD dwSize; - COLORREF clrBtnHighlight; /* highlight color */ - COLORREF clrBtnShadow; /* shadow color */ -} COLORSCHEME, *LPCOLORSCHEME; - -/************************************************************************** - * Drag List control - */ - -typedef struct tagDRAGLISTINFO -{ - UINT uNotification; - HWND hWnd; - POINT ptCursor; -} DRAGLISTINFO, *LPDRAGLISTINFO; - -#define DL_BEGINDRAG (WM_USER+133) -#define DL_DRAGGING (WM_USER+134) -#define DL_DROPPED (WM_USER+135) -#define DL_CANCELDRAG (WM_USER+136) - -#define DL_CURSORSET 0 -#define DL_STOPCURSOR 1 -#define DL_COPYCURSOR 2 -#define DL_MOVECURSOR 3 - -#define DRAGLISTMSGSTRINGA "commctrl_DragListMsg" -#if defined(__GNUC__) -# define DRAGLISTMSGSTRINGW (const WCHAR []){ 'c','o','m','m','c','t','r','l', \ - '_','D','r','a','g','L','i','s','t','M','s','g',0 } -#elif defined(_MSC_VER) -# define DRAGLISTMSGSTRINGW L"commctrl_DragListMsg" -#else -static const WCHAR DRAGLISTMSGSTRINGW[] = { 'c','o','m','m','c','t','r','l', - '_','D','r','a','g','L','i','s','t','M','s','g',0 }; +#define IMAGELISTDRAWPARAMS_V3_SIZE CCSIZEOF_STRUCT(IMAGELISTDRAWPARAMS,dwRop) #endif -#define DRAGLISTMSGSTRING WINELIB_NAME_AW(DRAGLISTMSGSTRING) -BOOL WINAPI MakeDragList (HWND); -VOID WINAPI DrawInsert (HWND, HWND, INT); -INT WINAPI LBItemFromPt (HWND, POINT, BOOL); - - -/* UpDown */ - -#define UPDOWN_CLASSA "msctls_updown32" -# define UPDOWN_CLASSW L"msctls_updown32" -#define UPDOWN_CLASS WINELIB_NAME_AW(UPDOWN_CLASS) - -typedef struct _UDACCEL -{ - UINT nSec; - UINT nInc; -} UDACCEL, *LPUDACCEL; - -#define UD_MAXVAL 0x7fff -#define UD_MINVAL 0x8001 - -#define UDS_WRAP 0x0001 -#define UDS_SETBUDDYINT 0x0002 -#define UDS_ALIGNRIGHT 0x0004 -#define UDS_ALIGNLEFT 0x0008 -#define UDS_AUTOBUDDY 0x0010 -#define UDS_ARROWKEYS 0x0020 -#define UDS_HORZ 0x0040 -#define UDS_NOTHOUSANDS 0x0080 -#define UDS_HOTTRACK 0x0100 - -#define UDN_FIRST (0U-721) -#define UDN_LAST (0U-740) -#define UDN_DELTAPOS (UDN_FIRST-1) - -#define UDM_SETRANGE (WM_USER+101) -#define UDM_GETRANGE (WM_USER+102) -#define UDM_SETPOS (WM_USER+103) -#define UDM_GETPOS (WM_USER+104) -#define UDM_SETBUDDY (WM_USER+105) -#define UDM_GETBUDDY (WM_USER+106) -#define UDM_SETACCEL (WM_USER+107) -#define UDM_GETACCEL (WM_USER+108) -#define UDM_SETBASE (WM_USER+109) -#define UDM_GETBASE (WM_USER+110) -#define UDM_SETRANGE32 (WM_USER+111) -#define UDM_GETRANGE32 (WM_USER+112) -#define UDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define UDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define UDM_SETPOS32 (WM_USER+113) -#define UDM_GETPOS32 (WM_USER+114) - - -#define NMUPDOWN NM_UPDOWN -#define LPNMUPDOWN LPNM_UPDOWN - -typedef struct tagNM_UPDOWN -{ - NMHDR hdr; - int iPos; - int iDelta; -} NM_UPDOWN, *LPNM_UPDOWN; - -HWND WINAPI CreateUpDownControl (DWORD, INT, INT, INT, INT, - HWND, INT, HINSTANCE, HWND, - INT, INT, INT); - -/* Progress Bar */ - -#define PROGRESS_CLASSA "msctls_progress32" -# define PROGRESS_CLASSW L"msctls_progress32" -#define PROGRESS_CLASS WINELIB_NAME_AW(PROGRESS_CLASS) - -#define PBM_SETRANGE (WM_USER+1) -#define PBM_SETPOS (WM_USER+2) -#define PBM_DELTAPOS (WM_USER+3) -#define PBM_SETSTEP (WM_USER+4) -#define PBM_STEPIT (WM_USER+5) -#define PBM_SETRANGE32 (WM_USER+6) -#define PBM_GETRANGE (WM_USER+7) -#define PBM_GETPOS (WM_USER+8) -#define PBM_SETBARCOLOR (WM_USER+9) -#define PBM_SETMARQUEE (WM_USER+10) -#define PBM_GETBKCOLOR (WM_USER+14) -#define PBM_GETBARCOLOR (WM_USER+15) -#define PBM_SETBKCOLOR CCM_SETBKCOLOR - -#define PBS_SMOOTH 0x01 -#define PBS_VERTICAL 0x04 -#define PBS_MARQUEE 0x08 - -typedef struct -{ - INT iLow; - INT iHigh; -} PBRANGE, *PPBRANGE; - - -/* ImageList */ - -struct _IMAGELIST; -typedef struct _IMAGELIST *HIMAGELIST; - -#define CLR_NONE 0xFFFFFFFF -#define CLR_DEFAULT 0xFF000000 -#define CLR_HILIGHT CLR_DEFAULT - -#define ILC_MASK 0x0001 -#define ILC_COLOR 0x0000 -#define ILC_COLORDDB 0x00FE -#define ILC_COLOR4 0x0004 -#define ILC_COLOR8 0x0008 -#define ILC_COLOR16 0x0010 -#define ILC_COLOR24 0x0018 -#define ILC_COLOR32 0x0020 -#define ILC_PALETTE 0x0800 /* no longer supported by M$ */ -#define ILC_MIRROR 0x2000 +#define ILC_MASK 0x1 +#define ILC_COLOR 0x0 +#define ILC_COLORDDB 0xfe +#define ILC_COLOR4 0x4 +#define ILC_COLOR8 0x8 +#define ILC_COLOR16 0x10 +#define ILC_COLOR24 0x18 +#define ILC_COLOR32 0x20 +#define ILC_PALETTE 0x800 +#define ILC_MIRROR 0x2000 #define ILC_PERITEMMIRROR 0x8000 -#define ILD_NORMAL 0x0000 -#define ILD_TRANSPARENT 0x0001 -#define ILD_BLEND25 0x0002 -#define ILD_BLEND50 0x0004 -#define ILD_MASK 0x0010 -#define ILD_IMAGE 0x0020 -#define ILD_ROP 0x0040 -#define ILD_OVERLAYMASK 0x0F00 + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Create(int cx,int cy,UINT flags,int cInitial,int cGrow); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Destroy(HIMAGELIST himl); + WINCOMMCTRLAPI int WINAPI ImageList_GetImageCount(HIMAGELIST himl); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetImageCount(HIMAGELIST himl,UINT uNewCount); + WINCOMMCTRLAPI int WINAPI ImageList_Add(HIMAGELIST himl,HBITMAP hbmImage,HBITMAP hbmMask); + WINCOMMCTRLAPI int WINAPI ImageList_ReplaceIcon(HIMAGELIST himl,int i,HICON hicon); + WINCOMMCTRLAPI COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST himl,COLORREF clrBk); + WINCOMMCTRLAPI COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST himl); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST himl,int iImage,int iOverlay); +#define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon) + +#define ILD_NORMAL 0x0 +#define ILD_TRANSPARENT 0x1 +#define ILD_MASK 0x10 +#define ILD_IMAGE 0x20 +#define ILD_ROP 0x40 +#define ILD_BLEND25 0x2 +#define ILD_BLEND50 0x4 +#define ILD_OVERLAYMASK 0xf00 +#define INDEXTOOVERLAYMASK(i) ((i) << 8) #define ILD_PRESERVEALPHA 0x1000 -#define ILD_SCALE 0x2000 -#define ILD_DPISCALE 0x4000 -#define ILD_ASYNC 0x8000 +#define ILD_SCALE 0x2000 +#define ILD_DPISCALE 0x4000 -#define ILD_SELECTED ILD_BLEND50 -#define ILD_FOCUS ILD_BLEND25 -#define ILD_BLEND ILD_BLEND50 +#define ILD_SELECTED ILD_BLEND50 +#define ILD_FOCUS ILD_BLEND25 +#define ILD_BLEND ILD_BLEND50 +#define CLR_HILIGHT CLR_DEFAULT -#define INDEXTOOVERLAYMASK(i) ((i)<<8) -#define INDEXTOSTATEIMAGEMASK(i) ((i)<<12) +#define ILS_NORMAL 0x0 +#define ILS_GLOW 0x1 +#define ILS_SHADOW 0x2 +#define ILS_SATURATE 0x4 +#define ILS_ALPHA 0x8 -#define ILCF_MOVE (0x00000000) -#define ILCF_SWAP (0x00000001) + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Draw(HIMAGELIST himl,int i,HDC hdcDst,int x,int y,UINT fStyle); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Replace(HIMAGELIST himl,int i,HBITMAP hbmImage,HBITMAP hbmMask); + WINCOMMCTRLAPI int WINAPI ImageList_AddMasked(HIMAGELIST himl,HBITMAP hbmImage,COLORREF crMask); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DrawEx(HIMAGELIST himl,int i,HDC hdcDst,int x,int y,int dx,int dy,COLORREF rgbBk,COLORREF rgbFg,UINT fStyle); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS *pimldp); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Remove(HIMAGELIST himl,int i); + WINCOMMCTRLAPI HICON WINAPI ImageList_GetIcon(HIMAGELIST himl,int i,UINT flags); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE hi,LPCSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi,LPCWSTR lpbmp,int cx,int cGrow,COLORREF crMask,UINT uType,UINT uFlags); -#define ILGT_NORMAL 0x0000 -#define ILGT_ASYNC 0x0001 +#ifdef UNICODE +#define ImageList_LoadImage ImageList_LoadImageW +#else +#define ImageList_LoadImage ImageList_LoadImageA +#endif -#define ILS_NORMAL 0x0000 -#define ILS_GLOW 0x0001 -#define ILS_SHADOW 0x0002 -#define ILS_SATURATE 0x0004 -#define ILS_ALPHA 0x0008 - -typedef struct _IMAGEINFO -{ - HBITMAP hbmImage; - HBITMAP hbmMask; - INT Unused1; - INT Unused2; - RECT rcImage; -} IMAGEINFO, *LPIMAGEINFO; - - -typedef struct _IMAGELISTDRAWPARAMS -{ - DWORD cbSize; - HIMAGELIST himl; - INT i; - HDC hdcDst; - INT x; - INT y; - INT cx; - INT cy; - INT xBitmap; /* x offest from the upperleft of bitmap */ - INT yBitmap; /* y offset from the upperleft of bitmap */ - COLORREF rgbBk; - COLORREF rgbFg; - UINT fStyle; - DWORD dwRop; - DWORD fState; - DWORD Frame; - DWORD crEffect; -} IMAGELISTDRAWPARAMS, *LPIMAGELISTDRAWPARAMS; - - -HRESULT WINAPI HIMAGELIST_QueryInterface(HIMAGELIST,REFIID,void **); -INT WINAPI ImageList_Add(HIMAGELIST,HBITMAP,HBITMAP); -INT WINAPI ImageList_AddMasked(HIMAGELIST,HBITMAP,COLORREF); -BOOL WINAPI ImageList_BeginDrag(HIMAGELIST,INT,INT,INT); -BOOL WINAPI ImageList_Copy(HIMAGELIST,INT,HIMAGELIST,INT,UINT); -HIMAGELIST WINAPI ImageList_Create(INT,INT,UINT,INT,INT); -BOOL WINAPI ImageList_Destroy(HIMAGELIST); -BOOL WINAPI ImageList_DragEnter(HWND,INT,INT); -BOOL WINAPI ImageList_DragLeave(HWND); -BOOL WINAPI ImageList_DragMove(INT,INT); -BOOL WINAPI ImageList_DragShowNolock (BOOL); -BOOL WINAPI ImageList_Draw(HIMAGELIST,INT,HDC,INT,INT,UINT); -BOOL WINAPI ImageList_DrawEx(HIMAGELIST,INT,HDC,INT,INT,INT, - INT,COLORREF,COLORREF,UINT); -BOOL WINAPI ImageList_DrawIndirect(IMAGELISTDRAWPARAMS*); -HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST); -VOID WINAPI ImageList_EndDrag(VOID); -COLORREF WINAPI ImageList_GetBkColor(HIMAGELIST); -HIMAGELIST WINAPI ImageList_GetDragImage(POINT*,POINT*); -HICON WINAPI ImageList_GetIcon(HIMAGELIST,INT,UINT); -BOOL WINAPI ImageList_GetIconSize(HIMAGELIST,INT*,INT*); -INT WINAPI ImageList_GetImageCount(HIMAGELIST); -BOOL WINAPI ImageList_GetImageInfo(HIMAGELIST,INT,IMAGEINFO*); -BOOL WINAPI ImageList_GetImageRect(HIMAGELIST,INT,LPRECT); -HIMAGELIST WINAPI ImageList_LoadImageA(HINSTANCE,LPCSTR,INT,INT, - COLORREF,UINT,UINT); -HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE,LPCWSTR,INT,INT, - COLORREF,UINT,UINT); -#define ImageList_LoadImage WINELIB_NAME_AW(ImageList_LoadImage) -HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST,INT,HIMAGELIST,INT,INT,INT); -BOOL WINAPI ImageList_Remove(HIMAGELIST,INT); -BOOL WINAPI ImageList_Replace(HIMAGELIST,INT,HBITMAP,HBITMAP); -INT WINAPI ImageList_ReplaceIcon(HIMAGELIST,INT,HICON); -COLORREF WINAPI ImageList_SetBkColor(HIMAGELIST,COLORREF); -BOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST,INT,INT,INT); - -BOOL WINAPI ImageList_SetIconSize(HIMAGELIST,INT,INT); -BOOL WINAPI ImageList_SetImageCount(HIMAGELIST,UINT); -BOOL WINAPI ImageList_SetOverlayImage(HIMAGELIST,INT,INT); +#define ILCF_MOVE 0x0 +#define ILCF_SWAP 0x1 + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Copy(HIMAGELIST himlDst,int iDst,HIMAGELIST himlSrc,int iSrc,UINT uFlags); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_BeginDrag(HIMAGELIST himlTrack,int iTrack,int dxHotspot,int dyHotspot); + WINCOMMCTRLAPI void WINAPI ImageList_EndDrag(); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragEnter(HWND hwndLock,int x,int y); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragLeave(HWND hwndLock); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragMove(int x,int y); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetDragCursorImage(HIMAGELIST himlDrag,int iDrag,int dxHotspot,int dyHotspot); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_DragShowNolock(WINBOOL fShow); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_GetDragImage(POINT *ppt,POINT *pptHotspot); +#define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1) +#define ImageList_ExtractIcon(hi,himl,i) ImageList_GetIcon(himl,i,0) +#define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0) #ifdef __IStream_INTERFACE_DEFINED__ -HIMAGELIST WINAPI ImageList_Read(LPSTREAM); -BOOL WINAPI ImageList_Write(HIMAGELIST, LPSTREAM); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Read(LPSTREAM pstm); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_Write(HIMAGELIST himl,LPSTREAM pstm); +#define ILP_NORMAL 0 +#define ILP_DOWNLEVEL 1 + WINCOMMCTRLAPI HRESULT WINAPI ImageList_ReadEx(DWORD dwFlags,LPSTREAM pstm,REFIID riid,PVOID *ppv); + WINCOMMCTRLAPI HRESULT WINAPI ImageList_WriteEx(HIMAGELIST himl,DWORD dwFlags,LPSTREAM pstm); #endif -#define ImageList_AddIcon(himl,hicon) ImageList_ReplaceIcon(himl,-1,hicon) -#define ImageList_ExtractIcon(hi,himl,i) ImageList_GetIcon(himl,i,0) -#define ImageList_LoadBitmap(hi,lpbmp,cx,cGrow,crMask) \ - ImageList_LoadImage(hi,lpbmp,cx,cGrow,crMask,IMAGE_BITMAP,0) -#define ImageList_RemoveAll(himl) ImageList_Remove(himl,-1) - - -#ifndef WM_MOUSEHOVER -#define WM_MOUSEHOVER 0x02A1 -#define WM_MOUSELEAVE 0x02A3 +#ifndef IMAGEINFO + typedef struct _IMAGEINFO { + HBITMAP hbmImage; + HBITMAP hbmMask; + int Unused1; + int Unused2; + RECT rcImage; + } IMAGEINFO,*LPIMAGEINFO; #endif -#ifndef TME_HOVER - -#define TME_HOVER 0x00000001 -#define TME_LEAVE 0x00000002 -#define TME_NONCLIENT 0x00000010 -#define TME_QUERY 0x40000000 -#define TME_CANCEL 0x80000000 - - -#define HOVER_DEFAULT 0xFFFFFFFF - -typedef struct tagTRACKMOUSEEVENT { - DWORD cbSize; - DWORD dwFlags; - HWND hwndTrack; - DWORD dwHoverTime; -} TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT; - + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl,int *cx,int *cy); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl,int cx,int cy); + WINCOMMCTRLAPI WINBOOL WINAPI ImageList_GetImageInfo(HIMAGELIST himl,int i,IMAGEINFO *pImageInfo); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Merge(HIMAGELIST himl1,int i1,HIMAGELIST himl2,int i2,int dx,int dy); + WINCOMMCTRLAPI HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himl); #endif -BOOL WINAPI _TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack); +#ifndef NOHEADER -/* Flat Scrollbar control */ +#define WC_HEADERA "SysHeader32" +#define WC_HEADERW L"SysHeader32" -#define FLATSB_CLASSA "flatsb_class32" -#if defined(__GNUC__) -# define FLATSB_CLASSW (const WCHAR []){ 'f','l','a','t','s','b','_', \ - 'c','l','a','s','s','3','2',0 } -#elif defined(_MSC_VER) -# define FLATSB_CLASSW L"flatsb_class32" +#ifdef UNICODE +#define WC_HEADER WC_HEADERW #else -static const WCHAR FLATSB_CLASSW[] = { 'f','l','a','t','s','b','_', - 'c','l','a','s','s','3','2',0 }; +#define WC_HEADER WC_HEADERA #endif -#define FLATSB_CLASS WINELIB_NAME_AW(FLATSB_CLASS) -#define WSB_PROP_CYVSCROLL 0x00000001L -#define WSB_PROP_CXHSCROLL 0x00000002L -#define WSB_PROP_CYHSCROLL 0x00000004L -#define WSB_PROP_CXVSCROLL 0x00000008L -#define WSB_PROP_CXHTHUMB 0x00000010L -#define WSB_PROP_CYVTHUMB 0x00000020L -#define WSB_PROP_VBKGCOLOR 0x00000040L -#define WSB_PROP_HBKGCOLOR 0x00000080L -#define WSB_PROP_VSTYLE 0x00000100L -#define WSB_PROP_HSTYLE 0x00000200L -#define WSB_PROP_WINSTYLE 0x00000400L -#define WSB_PROP_PALETTE 0x00000800L -#define WSB_PROP_MASK 0x00000FFFL +#define HDS_HORZ 0x0 +#define HDS_BUTTONS 0x2 +#define HDS_HOTTRACK 0x4 +#define HDS_HIDDEN 0x8 +#define HDS_DRAGDROP 0x40 +#define HDS_FULLDRAG 0x80 +#define HDS_FILTERBAR 0x100 +#define HDS_FLAT 0x200 +#if (_WIN32_WINNT >= 0x0600) +#define HDS_CHECKBOXES 0x400 +#define HDS_NOSIZING 0x800 +#define HDS_OVERFLOW 0x1000 +#endif -#define FSB_REGULAR_MODE 0 -#define FSB_ENCARTA_MODE 1 -#define FSB_FLAT_MODE 2 +#define HDFT_ISSTRING 0x0 +#define HDFT_ISNUMBER 0x1 +#define HDFT_HASNOVALUE 0x8000 -BOOL WINAPI FlatSB_EnableScrollBar(HWND, INT, UINT); -BOOL WINAPI FlatSB_ShowScrollBar(HWND, INT, BOOL); -BOOL WINAPI FlatSB_GetScrollRange(HWND, INT, LPINT, LPINT); -BOOL WINAPI FlatSB_GetScrollInfo(HWND, INT, LPSCROLLINFO); -INT WINAPI FlatSB_GetScrollPos(HWND, INT); -BOOL WINAPI FlatSB_GetScrollProp(HWND, INT, LPINT); -INT WINAPI FlatSB_SetScrollPos(HWND, INT, INT, BOOL); -INT WINAPI FlatSB_SetScrollInfo(HWND, INT, LPSCROLLINFO, BOOL); -INT WINAPI FlatSB_SetScrollRange(HWND, INT, INT, INT, BOOL); -BOOL WINAPI FlatSB_SetScrollProp(HWND, UINT, INT, BOOL); -BOOL WINAPI InitializeFlatSB(HWND); -HRESULT WINAPI UninitializeFlatSB(HWND); +#ifdef UNICODE +#define HD_TEXTFILTER HD_TEXTFILTERW +#define HDTEXTFILTER HD_TEXTFILTERW +#define LPHD_TEXTFILTER LPHD_TEXTFILTERW +#define LPHDTEXTFILTER LPHD_TEXTFILTERW +#else +#define HD_TEXTFILTER HD_TEXTFILTERA +#define HDTEXTFILTER HD_TEXTFILTERA +#define LPHD_TEXTFILTER LPHD_TEXTFILTERA +#define LPHDTEXTFILTER LPHD_TEXTFILTERA +#endif -/* Subclassing stuff */ -typedef LRESULT (CALLBACK *SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM, UINT_PTR, DWORD_PTR); -BOOL WINAPI SetWindowSubclass(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); -BOOL WINAPI GetWindowSubclass(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR*); -BOOL WINAPI RemoveWindowSubclass(HWND, SUBCLASSPROC, UINT_PTR); -LRESULT WINAPI DefSubclassProc(HWND, UINT, WPARAM, LPARAM); - -int WINAPI DrawShadowText(HDC, LPCWSTR, UINT, RECT*, DWORD, COLORREF, COLORREF, int, int); - -/* Header control */ - -#define WC_HEADERA "SysHeader32" -# define WC_HEADERW L"SysHeader32" -#define WC_HEADER WINELIB_NAME_AW(WC_HEADER) - -#define HDS_HORZ 0x0000 -#define HDS_BUTTONS 0x0002 -#define HDS_HOTTRACK 0x0004 -#define HDS_HIDDEN 0x0008 -#define HDS_DRAGDROP 0x0040 -#define HDS_FULLDRAG 0x0080 -#define HDS_FILTERBAR 0x0100 -#define HDS_FLAT 0x0200 -#define HDS_CHECKBOXES 0x0400 -#define HDS_NOSIZING 0x0800 -#define HDS_OVERFLOW 0x1000 - -#define HDI_WIDTH 0x0001 -#define HDI_HEIGHT HDI_WIDTH -#define HDI_TEXT 0x0002 -#define HDI_FORMAT 0x0004 -#define HDI_LPARAM 0x0008 -#define HDI_BITMAP 0x0010 -#define HDI_IMAGE 0x0020 -#define HDI_DI_SETITEM 0x0040 -#define HDI_ORDER 0x0080 -#define HDI_FILTER 0x0100 -#define HDI_STATE 0x0200 - -#define HDIS_FOCUSED 0x00000001 - -#define HDF_LEFT 0x0000 -#define HDF_RIGHT 0x0001 -#define HDF_CENTER 0x0002 -#define HDF_JUSTIFYMASK 0x0003 -#define HDF_RTLREADING 0x0004 -#define HDF_CHECKBOX 0x0040 -#define HDF_CHECKED 0x0080 -#define HDF_FIXEDWIDTH 0x0100 -#define HDF_SORTDOWN 0x0200 -#define HDF_SORTUP 0x0400 -#define HDF_IMAGE 0x0800 -#define HDF_BITMAP_ON_RIGHT 0x1000 -#define HDF_BITMAP 0x2000 -#define HDF_STRING 0x4000 -#define HDF_OWNERDRAW 0x8000 -#define HDF_SPLITBUTTON 0x1000000 - -#define HHT_NOWHERE 0x0001 -#define HHT_ONHEADER 0x0002 -#define HHT_ONDIVIDER 0x0004 -#define HHT_ONDIVOPEN 0x0008 -#define HHT_ONFILTER 0x0010 -#define HHT_ONFILTERBUTTON 0x0020 -#define HHT_ABOVE 0x0100 -#define HHT_BELOW 0x0200 -#define HHT_TORIGHT 0x0400 -#define HHT_TOLEFT 0x0800 -#define HHT_ONITEMSTATEICON 0x1000 -#define HHT_ONDROPDOWN 0x2000 -#define HHT_ONOVERFLOW 0x4000 - -#define HDM_FIRST 0x1200 -#define HDM_GETITEMCOUNT (HDM_FIRST+0) -#define HDM_INSERTITEMA (HDM_FIRST+1) -#define HDM_INSERTITEMW (HDM_FIRST+10) -#define HDM_INSERTITEM WINELIB_NAME_AW(HDM_INSERTITEM) -#define HDM_DELETEITEM (HDM_FIRST+2) -#define HDM_GETITEMA (HDM_FIRST+3) -#define HDM_GETITEMW (HDM_FIRST+11) -#define HDM_GETITEM WINELIB_NAME_AW(HDM_GETITEM) -#define HDM_SETITEMA (HDM_FIRST+4) -#define HDM_SETITEMW (HDM_FIRST+12) -#define HDM_SETITEM WINELIB_NAME_AW(HDM_SETITEM) -#define HDM_LAYOUT (HDM_FIRST+5) -#define HDM_HITTEST (HDM_FIRST+6) -#define HDM_GETITEMRECT (HDM_FIRST+7) -#define HDM_SETIMAGELIST (HDM_FIRST+8) -#define HDM_GETIMAGELIST (HDM_FIRST+9) - -#define HDM_ORDERTOINDEX (HDM_FIRST+15) -#define HDM_CREATEDRAGIMAGE (HDM_FIRST+16) -#define HDM_GETORDERARRAY (HDM_FIRST+17) -#define HDM_SETORDERARRAY (HDM_FIRST+18) -#define HDM_SETHOTDIVIDER (HDM_FIRST+19) -#define HDM_SETBITMAPMARGIN (HDM_FIRST+20) -#define HDM_GETBITMAPMARGIN (HDM_FIRST+21) -#define HDM_SETFILTERCHANGETIMEOUT (HDM_FIRST+22) -#define HDM_EDITFILTER (HDM_FIRST+23) -#define HDM_CLEARFILTER (HDM_FIRST+24) -#define HDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define HDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT - -#define HDN_FIRST (0U-300U) -#define HDN_LAST (0U-399U) -#define HDN_ITEMCHANGINGA (HDN_FIRST-0) -#define HDN_ITEMCHANGINGW (HDN_FIRST-20) -#define HDN_ITEMCHANGING WINELIB_NAME_AW(HDN_ITEMCHANGING) -#define HDN_ITEMCHANGEDA (HDN_FIRST-1) -#define HDN_ITEMCHANGEDW (HDN_FIRST-21) -#define HDN_ITEMCHANGED WINELIB_NAME_AW(HDN_ITEMCHANGED) -#define HDN_ITEMCLICKA (HDN_FIRST-2) -#define HDN_ITEMCLICKW (HDN_FIRST-22) -#define HDN_ITEMCLICK WINELIB_NAME_AW(HDN_ITEMCLICK) -#define HDN_ITEMDBLCLICKA (HDN_FIRST-3) -#define HDN_ITEMDBLCLICKW (HDN_FIRST-23) -#define HDN_ITEMDBLCLICK WINELIB_NAME_AW(HDN_ITEMDBLCLICK) -#define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5) -#define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25) -#define HDN_DIVIDERDBLCLICK WINELIB_NAME_AW(HDN_DIVIDERDBLCLICK) -#define HDN_BEGINTRACKA (HDN_FIRST-6) -#define HDN_BEGINTRACKW (HDN_FIRST-26) -#define HDN_BEGINTRACK WINELIB_NAME_AW(HDN_BEGINTRACK) -#define HDN_ENDTRACKA (HDN_FIRST-7) -#define HDN_ENDTRACKW (HDN_FIRST-27) -#define HDN_ENDTRACK WINELIB_NAME_AW(HDN_ENDTRACK) -#define HDN_TRACKA (HDN_FIRST-8) -#define HDN_TRACKW (HDN_FIRST-28) -#define HDN_TRACK WINELIB_NAME_AW(HDN_TRACK) -#define HDN_GETDISPINFOA (HDN_FIRST-9) -#define HDN_GETDISPINFOW (HDN_FIRST-29) -#define HDN_GETDISPINFO WINELIB_NAME_AW(HDN_GETDISPINFO) -#define HDN_BEGINDRAG (HDN_FIRST-10) -#define HDN_ENDDRAG (HDN_FIRST-11) -#define HDN_FILTERCHANGE (HDN_FIRST-12) -#define HDN_FILTERBTNCLICK (HDN_FIRST-13) -#define HDN_BEGINFILTEREDIT (HDN_FIRST-14) -#define HDN_ENDFILTEREDIT (HDN_FIRST-15) -#define HDN_ITEMSTATEICONCLICK (HDN_FIRST-16) -#define HDN_ITEMKEYDOWN (HDN_FIRST-17) - -typedef struct _HD_LAYOUT -{ - RECT *prc; - WINDOWPOS *pwpos; -} HDLAYOUT, *LPHDLAYOUT; - -#define HD_LAYOUT HDLAYOUT - -typedef struct _HD_ITEMA -{ - UINT mask; - INT cxy; - LPSTR pszText; - HBITMAP hbm; - INT cchTextMax; - INT fmt; - LPARAM lParam; - /* (_WIN32_IE >= 0x0300) */ - INT iImage; - INT iOrder; - /* (_WIN32_IE >= 0x0500) */ - UINT type; - LPVOID pvFilter; - /* (_WIN32_WINNT >= 0x0600) */ - UINT state; -} HDITEMA, *LPHDITEMA; - -typedef struct _HD_ITEMW -{ - UINT mask; - INT cxy; - LPWSTR pszText; - HBITMAP hbm; - INT cchTextMax; - INT fmt; - LPARAM lParam; - /* (_WIN32_IE >= 0x0300) */ - INT iImage; - INT iOrder; - /* (_WIN32_IE >= 0x0500) */ - UINT type; - LPVOID pvFilter; - /* (_WIN32_WINNT >= 0x0600) */ - UINT state; -} HDITEMW, *LPHDITEMW; - -#define HDITEM WINELIB_NAME_AW(HDITEM) -#define LPHDITEM WINELIB_NAME_AW(LPHDITEM) -#define HD_ITEM HDITEM - -#define HDITEM_V1_SIZEA CCSIZEOF_STRUCT(HDITEMA, lParam) -#define HDITEM_V1_SIZEW CCSIZEOF_STRUCT(HDITEMW, lParam) -#define HDITEM_V1_SIZE WINELIB_NAME_AW(HDITEM_V1_SIZE) - -#define HDFT_ISSTRING 0x0000 -#define HDFT_ISNUMBER 0x0001 -#define HDFT_HASNOVALUE 0x8000 - -typedef struct _HD_TEXTFILTERA -{ + typedef struct _HD_TEXTFILTERA { LPSTR pszText; INT cchTextMax; -} HD_TEXTFILTERA, *LPHD_TEXTFILTERA; + } HD_TEXTFILTERA,*LPHD_TEXTFILTERA; -typedef struct _HD_TEXTFILTERW -{ + typedef struct _HD_TEXTFILTERW { LPWSTR pszText; INT cchTextMax; -} HD_TEXTFILTERW, *LPHD_TEXTFILTERW; + } HD_TEXTFILTERW,*LPHD_TEXTFILTERW; -#define HD_TEXTFILTER WINELIB_NAME_AW(HD_TEXTFILTER) -#define HDTEXTFILTER WINELIB_NAME_AW(HD_TEXTFILTER) -#define LPHD_TEXTFILTER WINELIB_NAME_AW(LPHD_TEXTFILTER) -#define LPHDTEXTFILTER WINELIB_NAME_AW(LPHD_TEXTFILTER) +#define HD_ITEMA HDITEMA +#define HD_ITEMW HDITEMW +#define HD_ITEM HDITEM -typedef struct _HD_HITTESTINFO -{ + typedef struct _HD_ITEMA { + UINT mask; + int cxy; + LPSTR pszText; + HBITMAP hbm; + int cchTextMax; + int fmt; + LPARAM lParam; + int iImage; + int iOrder; + UINT type; + void *pvFilter; + } HDITEMA,*LPHDITEMA; + +#define HDITEMA_V1_SIZE CCSIZEOF_STRUCT(HDITEMA,lParam) +#define HDITEMW_V1_SIZE CCSIZEOF_STRUCT(HDITEMW,lParam) + + typedef struct _HD_ITEMW { + UINT mask; + int cxy; + LPWSTR pszText; + HBITMAP hbm; + int cchTextMax; + int fmt; + LPARAM lParam; + int iImage; + int iOrder; + UINT type; + void *pvFilter; + } HDITEMW,*LPHDITEMW; + +#ifdef UNICODE +#define HDITEM HDITEMW +#define LPHDITEM LPHDITEMW +#define HDITEM_V1_SIZE HDITEMW_V1_SIZE +#else +#define HDITEM HDITEMA +#define LPHDITEM LPHDITEMA +#define HDITEM_V1_SIZE HDITEMA_V1_SIZE +#endif + +#define HDI_WIDTH 0x1 +#define HDI_HEIGHT HDI_WIDTH +#define HDI_TEXT 0x2 +#define HDI_FORMAT 0x4 +#define HDI_LPARAM 0x8 +#define HDI_BITMAP 0x10 +#define HDI_IMAGE 0x20 +#define HDI_DI_SETITEM 0x40 +#define HDI_ORDER 0x80 +#define HDI_FILTER 0x100 + +#define HDF_LEFT 0x0 +#define HDF_RIGHT 0x1 +#define HDF_CENTER 0x2 +#define HDF_JUSTIFYMASK 0x3 +#define HDF_RTLREADING 0x4 + +#define HDF_OWNERDRAW 0x8000 +#define HDF_STRING 0x4000 +#define HDF_BITMAP 0x2000 +#define HDF_BITMAP_ON_RIGHT 0x1000 +#define HDF_IMAGE 0x800 +#define HDF_SORTUP 0x400 +#define HDF_SORTDOWN 0x200 +#if (_WIN32_WINNT >= 0x0600) +#define HDF_CHECKBOX 0x40 +#define HDF_CHECKED 0x80 +#define HDF_FIXEDWIDTH 0x100 +#define HDF_SPLITBUTTON 0x1000000 +#endif + +#define HDM_GETITEMCOUNT (HDM_FIRST+0) +#define Header_GetItemCount(hwndHD) (int)SNDMSG((hwndHD),HDM_GETITEMCOUNT,0,0L) + +#define HDM_INSERTITEMA (HDM_FIRST+1) +#define HDM_INSERTITEMW (HDM_FIRST+10) + +#ifdef UNICODE +#define HDM_INSERTITEM HDM_INSERTITEMW +#else +#define HDM_INSERTITEM HDM_INSERTITEMA +#endif + +#define Header_InsertItem(hwndHD,i,phdi) (int)SNDMSG((hwndHD),HDM_INSERTITEM,(WPARAM)(int)(i),(LPARAM)(const HD_ITEM *)(phdi)) + +#define HDM_DELETEITEM (HDM_FIRST+2) +#define Header_DeleteItem(hwndHD,i) (WINBOOL)SNDMSG((hwndHD),HDM_DELETEITEM,(WPARAM)(int)(i),0L) + +#define HDM_GETITEMA (HDM_FIRST+3) +#define HDM_GETITEMW (HDM_FIRST+11) + +#ifdef UNICODE +#define HDM_GETITEM HDM_GETITEMW +#else +#define HDM_GETITEM HDM_GETITEMA +#endif + +#define Header_GetItem(hwndHD,i,phdi) (WINBOOL)SNDMSG((hwndHD),HDM_GETITEM,(WPARAM)(int)(i),(LPARAM)(HD_ITEM *)(phdi)) + +#define HDM_SETITEMA (HDM_FIRST+4) +#define HDM_SETITEMW (HDM_FIRST+12) + +#ifdef UNICODE +#define HDM_SETITEM HDM_SETITEMW +#else +#define HDM_SETITEM HDM_SETITEMA +#endif + +#define Header_SetItem(hwndHD,i,phdi) (WINBOOL)SNDMSG((hwndHD),HDM_SETITEM,(WPARAM)(int)(i),(LPARAM)(const HD_ITEM *)(phdi)) + +#define HD_LAYOUT HDLAYOUT + + typedef struct _HD_LAYOUT { + RECT *prc; + WINDOWPOS *pwpos; + } HDLAYOUT,*LPHDLAYOUT; + +#define HDM_LAYOUT (HDM_FIRST+5) +#define Header_Layout(hwndHD,playout) (WINBOOL)SNDMSG((hwndHD),HDM_LAYOUT,0,(LPARAM)(HD_LAYOUT *)(playout)) + +#define HHT_NOWHERE 0x1 +#define HHT_ONHEADER 0x2 +#define HHT_ONDIVIDER 0x4 +#define HHT_ONDIVOPEN 0x8 +#define HHT_ONFILTER 0x10 +#define HHT_ONFILTERBUTTON 0x20 +#define HHT_ABOVE 0x100 +#define HHT_BELOW 0x200 +#define HHT_TORIGHT 0x400 +#define HHT_TOLEFT 0x800 + +#define HD_HITTESTINFO HDHITTESTINFO + + typedef struct _HD_HITTESTINFO { POINT pt; - UINT flags; - INT iItem; -} HDHITTESTINFO, *LPHDHITTESTINFO; + UINT flags; + int iItem; + } HDHITTESTINFO,*LPHDHITTESTINFO; -#define HD_HITTESTINFO HDHITTESTINFO +#define HDM_HITTEST (HDM_FIRST+6) -typedef struct tagNMHEADERA -{ - NMHDR hdr; - INT iItem; - INT iButton; +#define HDM_GETITEMRECT (HDM_FIRST+7) +#define Header_GetItemRect(hwnd,iItem,lprc) (WINBOOL)SNDMSG((hwnd),HDM_GETITEMRECT,(WPARAM)(iItem),(LPARAM)(lprc)) + +#define HDM_SETIMAGELIST (HDM_FIRST+8) +#define Header_SetImageList(hwnd,himl) (HIMAGELIST)SNDMSG((hwnd),HDM_SETIMAGELIST,0,(LPARAM)(himl)) + +#define HDM_GETIMAGELIST (HDM_FIRST+9) +#define Header_GetImageList(hwnd) (HIMAGELIST)SNDMSG((hwnd),HDM_GETIMAGELIST,0,0) + +#define HDM_ORDERTOINDEX (HDM_FIRST+15) +#define Header_OrderToIndex(hwnd,i) (int)SNDMSG((hwnd),HDM_ORDERTOINDEX,(WPARAM)(i),0) + +#define HDM_CREATEDRAGIMAGE (HDM_FIRST+16) +#define Header_CreateDragImage(hwnd,i) (HIMAGELIST)SNDMSG((hwnd),HDM_CREATEDRAGIMAGE,(WPARAM)(i),0) + +#define HDM_GETORDERARRAY (HDM_FIRST+17) +#define Header_GetOrderArray(hwnd,iCount,lpi) (WINBOOL)SNDMSG((hwnd),HDM_GETORDERARRAY,(WPARAM)(iCount),(LPARAM)(lpi)) + +#define HDM_SETORDERARRAY (HDM_FIRST+18) +#define Header_SetOrderArray(hwnd,iCount,lpi) (WINBOOL)SNDMSG((hwnd),HDM_SETORDERARRAY,(WPARAM)(iCount),(LPARAM)(lpi)) + +#define HDM_SETHOTDIVIDER (HDM_FIRST+19) +#define Header_SetHotDivider(hwnd,fPos,dw) (int)SNDMSG((hwnd),HDM_SETHOTDIVIDER,(WPARAM)(fPos),(LPARAM)(dw)) + +#define HDM_SETBITMAPMARGIN (HDM_FIRST+20) +#define Header_SetBitmapMargin(hwnd,iWidth) (int)SNDMSG((hwnd),HDM_SETBITMAPMARGIN,(WPARAM)(iWidth),0) + +#define HDM_GETBITMAPMARGIN (HDM_FIRST+21) +#define Header_GetBitmapMargin(hwnd) (int)SNDMSG((hwnd),HDM_GETBITMAPMARGIN,0,0) + +#define HDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define Header_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),HDM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) + +#define HDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define Header_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),HDM_GETUNICODEFORMAT,0,0) + +#define HDM_SETFILTERCHANGETIMEOUT (HDM_FIRST+22) +#define Header_SetFilterChangeTimeout(hwnd,i) (int)SNDMSG((hwnd),HDM_SETFILTERCHANGETIMEOUT,0,(LPARAM)(i)) + +#define HDM_EDITFILTER (HDM_FIRST+23) +#define Header_EditFilter(hwnd,i,fDiscardChanges) (int)SNDMSG((hwnd),HDM_EDITFILTER,(WPARAM)(i),MAKELPARAM(fDiscardChanges,0)) + +#define HDM_CLEARFILTER (HDM_FIRST+24) +#define Header_ClearFilter(hwnd,i) (int)SNDMSG((hwnd),HDM_CLEARFILTER,(WPARAM)(i),0) +#define Header_ClearAllFilters(hwnd) (int)SNDMSG((hwnd),HDM_CLEARFILTER,(WPARAM)-1,0) + +#define HDN_ITEMCHANGINGA (HDN_FIRST-0) +#define HDN_ITEMCHANGINGW (HDN_FIRST-20) +#define HDN_ITEMCHANGEDA (HDN_FIRST-1) +#define HDN_ITEMCHANGEDW (HDN_FIRST-21) +#define HDN_ITEMCLICKA (HDN_FIRST-2) +#define HDN_ITEMCLICKW (HDN_FIRST-22) +#define HDN_ITEMDBLCLICKA (HDN_FIRST-3) +#define HDN_ITEMDBLCLICKW (HDN_FIRST-23) +#define HDN_DIVIDERDBLCLICKA (HDN_FIRST-5) +#define HDN_DIVIDERDBLCLICKW (HDN_FIRST-25) +#define HDN_BEGINTRACKA (HDN_FIRST-6) +#define HDN_BEGINTRACKW (HDN_FIRST-26) +#define HDN_ENDTRACKA (HDN_FIRST-7) +#define HDN_ENDTRACKW (HDN_FIRST-27) +#define HDN_TRACKA (HDN_FIRST-8) +#define HDN_TRACKW (HDN_FIRST-28) +#define HDN_GETDISPINFOA (HDN_FIRST-9) +#define HDN_GETDISPINFOW (HDN_FIRST-29) +#define HDN_BEGINDRAG (HDN_FIRST-10) +#define HDN_ENDDRAG (HDN_FIRST-11) +#define HDN_FILTERCHANGE (HDN_FIRST-12) +#define HDN_FILTERBTNCLICK (HDN_FIRST-13) + +#ifdef UNICODE +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGW +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDW +#define HDN_ITEMCLICK HDN_ITEMCLICKW +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKW +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKW +#define HDN_BEGINTRACK HDN_BEGINTRACKW +#define HDN_ENDTRACK HDN_ENDTRACKW +#define HDN_TRACK HDN_TRACKW +#define HDN_GETDISPINFO HDN_GETDISPINFOW +#else +#define HDN_ITEMCHANGING HDN_ITEMCHANGINGA +#define HDN_ITEMCHANGED HDN_ITEMCHANGEDA +#define HDN_ITEMCLICK HDN_ITEMCLICKA +#define HDN_ITEMDBLCLICK HDN_ITEMDBLCLICKA +#define HDN_DIVIDERDBLCLICK HDN_DIVIDERDBLCLICKA +#define HDN_BEGINTRACK HDN_BEGINTRACKA +#define HDN_ENDTRACK HDN_ENDTRACKA +#define HDN_TRACK HDN_TRACKA +#define HDN_GETDISPINFO HDN_GETDISPINFOA +#endif + +#define HD_NOTIFYA NMHEADERA +#define HD_NOTIFYW NMHEADERW +#define HD_NOTIFY NMHEADER + + typedef struct tagNMHEADERA { + NMHDR hdr; + int iItem; + int iButton; HDITEMA *pitem; -} NMHEADERA, *LPNMHEADERA; + } NMHEADERA,*LPNMHEADERA; -typedef struct tagNMHEADERW -{ - NMHDR hdr; - INT iItem; - INT iButton; + typedef struct tagNMHEADERW { + NMHDR hdr; + int iItem; + int iButton; HDITEMW *pitem; -} NMHEADERW, *LPNMHEADERW; + } NMHEADERW,*LPNMHEADERW; -#define NMHEADER WINELIB_NAME_AW(NMHEADER) -#define LPNMHEADER WINELIB_NAME_AW(LPNMHEADER) -#define HD_NOTIFY NMHEADER +#ifdef UNICODE +#define NMHEADER NMHEADERW +#define LPNMHEADER LPNMHEADERW +#else +#define NMHEADER NMHEADERA +#define LPNMHEADER LPNMHEADERA +#endif -typedef struct tagNMHDDISPINFOA -{ - NMHDR hdr; - INT iItem; - UINT mask; - LPSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; -} NMHDDISPINFOA, *LPNMHDDISPINFOA; + typedef struct tagNMHDDISPINFOW { + NMHDR hdr; + int iItem; + UINT mask; + LPWSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + } NMHDDISPINFOW,*LPNMHDDISPINFOW; -typedef struct tagNMHDDISPINFOW -{ - NMHDR hdr; - INT iItem; - UINT mask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; -} NMHDDISPINFOW, *LPNMHDDISPINFOW; + typedef struct tagNMHDDISPINFOA { + NMHDR hdr; + int iItem; + UINT mask; + LPSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + } NMHDDISPINFOA,*LPNMHDDISPINFOA; -#define NMHDDISPINFO WINELIB_NAME_AW(NMHDDISPINFO) -#define LPNMHDDISPINFO WINELIB_NAME_AW(LPNMHDDISPINFO) +#ifdef UNICODE +#define NMHDDISPINFO NMHDDISPINFOW +#define LPNMHDDISPINFO LPNMHDDISPINFOW +#else +#define NMHDDISPINFO NMHDDISPINFOA +#define LPNMHDDISPINFO LPNMHDDISPINFOA +#endif -typedef struct tagNMHDFILTERBTNCLICK -{ + typedef struct tagNMHDFILTERBTNCLICK { NMHDR hdr; INT iItem; RECT rc; -} NMHDFILTERBTNCLICK, *LPNMHDFILTERBTNCLICK; + } NMHDFILTERBTNCLICK,*LPNMHDFILTERBTNCLICK; +#endif -#define Header_GetItemCount(hwndHD) \ - (INT)SNDMSG((hwndHD),HDM_GETITEMCOUNT,0,0L) -#define Header_InsertItemA(hwndHD,i,phdi) \ - (INT)SNDMSGA((hwndHD),HDM_INSERTITEMA,(WPARAM)(INT)(i),(LPARAM)(const HDITEMA*)(phdi)) -#define Header_InsertItemW(hwndHD,i,phdi) \ - (INT)SNDMSGW((hwndHD),HDM_INSERTITEMW,(WPARAM)(INT)(i),(LPARAM)(const HDITEMW*)(phdi)) -#define Header_InsertItem WINELIB_NAME_AW(Header_InsertItem) -#define Header_DeleteItem(hwndHD,i) \ - (BOOL)SNDMSG((hwndHD),HDM_DELETEITEM,(WPARAM)(INT)(i),0L) -#define Header_GetItemA(hwndHD,i,phdi) \ - (BOOL)SNDMSGA((hwndHD),HDM_GETITEMA,(WPARAM)(INT)(i),(LPARAM)(HDITEMA*)(phdi)) -#define Header_GetItemW(hwndHD,i,phdi) \ - (BOOL)SNDMSGW((hwndHD),HDM_GETITEMW,(WPARAM)(INT)(i),(LPARAM)(HDITEMW*)(phdi)) -#define Header_GetItem WINELIB_NAME_AW(Header_GetItem) -#define Header_SetItemA(hwndHD,i,phdi) \ - (BOOL)SNDMSGA((hwndHD),HDM_SETITEMA,(WPARAM)(INT)(i),(LPARAM)(const HDITEMA*)(phdi)) -#define Header_SetItemW(hwndHD,i,phdi) \ - (BOOL)SNDMSGW((hwndHD),HDM_SETITEMW,(WPARAM)(INT)(i),(LPARAM)(const HDITEMW*)(phdi)) -#define Header_SetItem WINELIB_NAME_AW(Header_SetItem) -#define Header_Layout(hwndHD,playout) \ - (BOOL)SNDMSG((hwndHD),HDM_LAYOUT,0,(LPARAM)(LPHDLAYOUT)(playout)) -#define Header_GetItemRect(hwnd,iItem,lprc) \ - (BOOL)SNDMSG((hwnd),HDM_GETITEMRECT,(WPARAM)iItem,(LPARAM)lprc) -#define Header_SetImageList(hwnd,himl) \ - (HIMAGELIST)SNDMSG((hwnd),HDM_SETIMAGELIST,0,(LPARAM)himl) -#define Header_GetImageList(hwnd) \ - (HIMAGELIST)SNDMSG((hwnd),HDM_GETIMAGELIST,0,0) -#define Header_OrderToIndex(hwnd,i) \ - (INT)SNDMSG((hwnd),HDM_ORDERTOINDEX,(WPARAM)i,0) -#define Header_CreateDragImage(hwnd,i) \ - (HIMAGELIST)SNDMSG((hwnd),HDM_CREATEDRAGIMAGE,(WPARAM)i,0) -#define Header_GetOrderArray(hwnd,iCount,lpi) \ - (BOOL)SNDMSG((hwnd),HDM_GETORDERARRAY,(WPARAM)iCount,(LPARAM)lpi) -#define Header_SetOrderArray(hwnd,iCount,lpi) \ - (BOOL)SNDMSG((hwnd),HDM_SETORDERARRAY,(WPARAM)iCount,(LPARAM)lpi) -#define Header_SetHotDivider(hwnd,fPos,dw) \ - (INT)SNDMSG((hwnd),HDM_SETHOTDIVIDER,(WPARAM)fPos,(LPARAM)dw) -#define Header_SetUnicodeFormat(hwnd,fUnicode) \ - (BOOL)SNDMSG((hwnd),HDM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) -#define Header_GetUnicodeFormat(hwnd) \ - (BOOL)SNDMSG((hwnd),HDM_GETUNICODEFORMAT,0,0) +#ifndef NOTOOLBAR -/* Win32 5.1 Button Theme */ -#define WC_BUTTONA "Button" -# define WC_BUTTONW L"Button" -#define WC_BUTTON WINELIB_NAME_AW(WC_BUTTON) +#define TOOLBARCLASSNAMEW L"ToolbarWindow32" +#define TOOLBARCLASSNAMEA "ToolbarWindow32" -#define BCN_FIRST (0U-1250U) -#define BCN_LAST (0U-1350U) +#ifdef UNICODE +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEW +#else +#define TOOLBARCLASSNAME TOOLBARCLASSNAMEA +#endif -#define BCN_HOTITEMCHANGE (BCN_FIRST + 0x0001) + typedef struct _TBBUTTON { + int iBitmap; + int idCommand; + BYTE fsState; + BYTE fsStyle; +#ifdef _WIN64 + BYTE bReserved[6]; +#else + BYTE bReserved[2]; +#endif + DWORD_PTR dwData; + INT_PTR iString; + } TBBUTTON,NEAR *PTBBUTTON,*LPTBBUTTON; + typedef const TBBUTTON *LPCTBBUTTON; -typedef struct tagNMBCHOTITEM -{ - NMHDR hdr; - DWORD dwFlags; -} NMBCHOTITEM, *LPNMBCHOTITEM; + typedef struct _COLORMAP { + COLORREF from; + COLORREF to; + } COLORMAP,*LPCOLORMAP; -#define BST_HOT 0x0200 + WINCOMMCTRLAPI HWND WINAPI CreateToolbarEx(HWND hwnd,DWORD ws,UINT wID,int nBitmaps,HINSTANCE hBMInst,UINT_PTR wBMID,LPCTBBUTTON lpButtons,int iNumButtons,int dxButton,int dyButton,int dxBitmap,int dyBitmap,UINT uStructSize); + WINCOMMCTRLAPI HBITMAP WINAPI CreateMappedBitmap(HINSTANCE hInstance,INT_PTR idBitmap,UINT wFlags,LPCOLORMAP lpColorMap,int iNumMaps); -/* Toolbar */ +#define CMB_MASKED 0x2 +#define TBSTATE_CHECKED 0x1 +#define TBSTATE_PRESSED 0x2 +#define TBSTATE_ENABLED 0x4 +#define TBSTATE_HIDDEN 0x8 +#define TBSTATE_INDETERMINATE 0x10 +#define TBSTATE_WRAP 0x20 +#define TBSTATE_ELLIPSES 0x40 +#define TBSTATE_MARKED 0x80 -#define TOOLBARCLASSNAMEA "ToolbarWindow32" -# define TOOLBARCLASSNAMEW L"ToolbarWindow32" +#define TBSTYLE_BUTTON 0x0 +#define TBSTYLE_SEP 0x1 +#define TBSTYLE_CHECK 0x2 +#define TBSTYLE_GROUP 0x4 +#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) +#define TBSTYLE_DROPDOWN 0x8 +#define TBSTYLE_AUTOSIZE 0x10 +#define TBSTYLE_NOPREFIX 0x20 +#define TBSTYLE_TOOLTIPS 0x100 +#define TBSTYLE_WRAPABLE 0x200 +#define TBSTYLE_ALTDRAG 0x400 +#define TBSTYLE_FLAT 0x800 +#define TBSTYLE_LIST 0x1000 +#define TBSTYLE_CUSTOMERASE 0x2000 +#define TBSTYLE_REGISTERDROP 0x4000 +#define TBSTYLE_TRANSPARENT 0x8000 +#define TBSTYLE_EX_DRAWDDARROWS 0x1 -#define TOOLBARCLASSNAME WINELIB_NAME_AW(TOOLBARCLASSNAME) +#define BTNS_BUTTON TBSTYLE_BUTTON +#define BTNS_SEP TBSTYLE_SEP +#define BTNS_CHECK TBSTYLE_CHECK +#define BTNS_GROUP TBSTYLE_GROUP +#define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP +#define BTNS_DROPDOWN TBSTYLE_DROPDOWN +#define BTNS_AUTOSIZE TBSTYLE_AUTOSIZE +#define BTNS_NOPREFIX TBSTYLE_NOPREFIX +#define BTNS_SHOWTEXT 0x40 +#define BTNS_WHOLEDROPDOWN 0x80 -#define CMB_MASKED 0x02 +#define TBSTYLE_EX_MIXEDBUTTONS 0x8 +#define TBSTYLE_EX_HIDECLIPPEDBUTTONS 0x10 +#define TBSTYLE_EX_DOUBLEBUFFER 0x80 -#define TBSTATE_CHECKED 0x01 -#define TBSTATE_PRESSED 0x02 -#define TBSTATE_ENABLED 0x04 -#define TBSTATE_HIDDEN 0x08 -#define TBSTATE_INDETERMINATE 0x10 -#define TBSTATE_WRAP 0x20 -#define TBSTATE_ELLIPSES 0x40 -#define TBSTATE_MARKED 0x80 - - -/* as of _WIN32_IE >= 0x0500 the following symbols are obsolete, - * "everyone" should use the BTNS_... stuff below - */ -#define TBSTYLE_BUTTON 0x00 -#define TBSTYLE_SEP 0x01 -#define TBSTYLE_CHECK 0x02 -#define TBSTYLE_GROUP 0x04 -#define TBSTYLE_CHECKGROUP (TBSTYLE_GROUP | TBSTYLE_CHECK) -#define TBSTYLE_DROPDOWN 0x08 -#define TBSTYLE_AUTOSIZE 0x10 -#define TBSTYLE_NOPREFIX 0x20 -#define BTNS_BUTTON TBSTYLE_BUTTON -#define BTNS_SEP TBSTYLE_SEP -#define BTNS_CHECK TBSTYLE_CHECK -#define BTNS_GROUP TBSTYLE_GROUP -#define BTNS_CHECKGROUP TBSTYLE_CHECKGROUP -#define BTNS_DROPDOWN TBSTYLE_DROPDOWN -#define BTNS_AUTOSIZE TBSTYLE_AUTOSIZE -#define BTNS_NOPREFIX TBSTYLE_NOPREFIX -#define BTNS_SHOWTEXT 0x40 /* ignored unless TBSTYLE_EX_MIXEDB set */ -#define BTNS_WHOLEDROPDOWN 0x80 /* draw dropdown arrow, but without split arrow section */ - -#define TBSTYLE_TOOLTIPS 0x0100 -#define TBSTYLE_WRAPABLE 0x0200 -#define TBSTYLE_ALTDRAG 0x0400 -#define TBSTYLE_FLAT 0x0800 -#define TBSTYLE_LIST 0x1000 -#define TBSTYLE_CUSTOMERASE 0x2000 -#define TBSTYLE_REGISTERDROP 0x4000 -#define TBSTYLE_TRANSPARENT 0x8000 -#define TBSTYLE_EX_DRAWDDARROWS 0x00000001 -#define TBSTYLE_EX_UNDOC1 0x00000004 /* similar to TBSTYLE_WRAPABLE */ -#define TBSTYLE_EX_MIXEDBUTTONS 0x00000008 -#define TBSTYLE_EX_HIDECLIPPEDBUTTONS 0x00000010 /* don't show partially obscured buttons */ -#define TBSTYLE_EX_DOUBLEBUFFER 0x00000080 /* Double Buffer the toolbar */ - -#define TBIF_IMAGE 0x00000001 -#define TBIF_TEXT 0x00000002 -#define TBIF_STATE 0x00000004 -#define TBIF_STYLE 0x00000008 -#define TBIF_LPARAM 0x00000010 -#define TBIF_COMMAND 0x00000020 -#define TBIF_SIZE 0x00000040 -#define TBIF_BYINDEX 0x80000000 - -#define TBBF_LARGE 0x0001 - -#define TB_ENABLEBUTTON (WM_USER+1) -#define TB_CHECKBUTTON (WM_USER+2) -#define TB_PRESSBUTTON (WM_USER+3) -#define TB_HIDEBUTTON (WM_USER+4) -#define TB_INDETERMINATE (WM_USER+5) -#define TB_MARKBUTTON (WM_USER+6) -#define TB_ISBUTTONENABLED (WM_USER+9) -#define TB_ISBUTTONCHECKED (WM_USER+10) -#define TB_ISBUTTONPRESSED (WM_USER+11) -#define TB_ISBUTTONHIDDEN (WM_USER+12) -#define TB_ISBUTTONINDETERMINATE (WM_USER+13) -#define TB_ISBUTTONHIGHLIGHTED (WM_USER+14) -#define TB_SETSTATE (WM_USER+17) -#define TB_GETSTATE (WM_USER+18) -#define TB_ADDBITMAP (WM_USER+19) -#define TB_ADDBUTTONSA (WM_USER+20) -#define TB_ADDBUTTONSW (WM_USER+68) -#define TB_ADDBUTTONS WINELIB_NAME_AW(TB_ADDBUTTONS) -#define TB_HITTEST (WM_USER+69) -#define TB_INSERTBUTTONA (WM_USER+21) -#define TB_INSERTBUTTONW (WM_USER+67) -#define TB_INSERTBUTTON WINELIB_NAME_AW(TB_INSERTBUTTON) -#define TB_DELETEBUTTON (WM_USER+22) -#define TB_GETBUTTON (WM_USER+23) -#define TB_BUTTONCOUNT (WM_USER+24) -#define TB_COMMANDTOINDEX (WM_USER+25) -#define TB_SAVERESTOREA (WM_USER+26) -#define TB_SAVERESTOREW (WM_USER+76) -#define TB_SAVERESTORE WINELIB_NAME_AW(TB_SAVERESTORE) -#define TB_CUSTOMIZE (WM_USER+27) -#define TB_ADDSTRINGA (WM_USER+28) -#define TB_ADDSTRINGW (WM_USER+77) -#define TB_ADDSTRING WINELIB_NAME_AW(TB_ADDSTRING) -#define TB_GETITEMRECT (WM_USER+29) -#define TB_BUTTONSTRUCTSIZE (WM_USER+30) -#define TB_SETBUTTONSIZE (WM_USER+31) -#define TB_SETBITMAPSIZE (WM_USER+32) -#define TB_AUTOSIZE (WM_USER+33) -#define TB_GETTOOLTIPS (WM_USER+35) -#define TB_SETTOOLTIPS (WM_USER+36) -#define TB_SETPARENT (WM_USER+37) -#define TB_SETROWS (WM_USER+39) -#define TB_GETROWS (WM_USER+40) -#define TB_GETBITMAPFLAGS (WM_USER+41) -#define TB_SETCMDID (WM_USER+42) -#define TB_CHANGEBITMAP (WM_USER+43) -#define TB_GETBITMAP (WM_USER+44) -#define TB_GETBUTTONTEXTA (WM_USER+45) -#define TB_GETBUTTONTEXTW (WM_USER+75) -#define TB_GETBUTTONTEXT WINELIB_NAME_AW(TB_GETBUTTONTEXT) -#define TB_REPLACEBITMAP (WM_USER+46) -#define TB_SETINDENT (WM_USER+47) -#define TB_SETIMAGELIST (WM_USER+48) -#define TB_GETIMAGELIST (WM_USER+49) -#define TB_LOADIMAGES (WM_USER+50) -#define TB_GETRECT (WM_USER+51) /* wParam is the Cmd instead of index */ -#define TB_SETHOTIMAGELIST (WM_USER+52) -#define TB_GETHOTIMAGELIST (WM_USER+53) -#define TB_SETDISABLEDIMAGELIST (WM_USER+54) -#define TB_GETDISABLEDIMAGELIST (WM_USER+55) -#define TB_SETSTYLE (WM_USER+56) -#define TB_GETSTYLE (WM_USER+57) -#define TB_GETBUTTONSIZE (WM_USER+58) -#define TB_SETBUTTONWIDTH (WM_USER+59) -#define TB_SETMAXTEXTROWS (WM_USER+60) -#define TB_GETTEXTROWS (WM_USER+61) -#define TB_GETOBJECT (WM_USER+62) -#define TB_GETBUTTONINFOW (WM_USER+63) -#define TB_GETBUTTONINFOA (WM_USER+65) -#define TB_GETBUTTONINFO WINELIB_NAME_AW(TB_GETBUTTONINFO) -#define TB_SETBUTTONINFOW (WM_USER+64) -#define TB_SETBUTTONINFOA (WM_USER+66) -#define TB_SETBUTTONINFO WINELIB_NAME_AW(TB_SETBUTTONINFO) -#define TB_SETDRAWTEXTFLAGS (WM_USER+70) -#define TB_GETHOTITEM (WM_USER+71) -#define TB_SETHOTITEM (WM_USER+72) -#define TB_SETANCHORHIGHLIGHT (WM_USER+73) -#define TB_GETANCHORHIGHLIGHT (WM_USER+74) -#define TB_MAPACCELERATORA (WM_USER+78) -#define TB_MAPACCELERATORW (WM_USER+90) -#define TB_MAPACCELERATOR WINELIB_NAME_AW(TB_MAPACCELERATOR) -#define TB_GETINSERTMARK (WM_USER+79) -#define TB_SETINSERTMARK (WM_USER+80) -#define TB_INSERTMARKHITTEST (WM_USER+81) -#define TB_MOVEBUTTON (WM_USER+82) -#define TB_GETMAXSIZE (WM_USER+83) -#define TB_SETEXTENDEDSTYLE (WM_USER+84) -#define TB_GETEXTENDEDSTYLE (WM_USER+85) -#define TB_GETPADDING (WM_USER+86) -#define TB_SETPADDING (WM_USER+87) -#define TB_SETINSERTMARKCOLOR (WM_USER+88) -#define TB_GETINSERTMARKCOLOR (WM_USER+89) -#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME -#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME -#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define TB_GETSTRINGW (WM_USER+91) -#define TB_GETSTRINGA (WM_USER+92) -#define TB_GETSTRING WINELIB_NAME_AW(TB_GETSTRING) - -/* undocumented messages in Toolbar */ -/* #ifdef __WINESRC__ */ -#define TB_UNKWN45D (WM_USER+93) -#define TB_SETHOTITEM2 (WM_USER+94) -#define TB_SETLISTGAP (WM_USER+96) -#define TB_GETIMAGELISTCOUNT (WM_USER+98) -#define TB_GETIDEALSIZE (WM_USER+99) -#define TB_UNKWN464 (WM_USER+100) -/* #endif */ - -#define TB_GETMETRICS (WM_USER+101) -#define TB_SETMETRICS (WM_USER+102) -#define TB_SETWINDOWTHEME CCM_SETWINDOWTHEME - -#define TBN_FIRST (0U-700U) -#define TBN_LAST (0U-720U) -#define TBN_GETBUTTONINFOA (TBN_FIRST-0) -#define TBN_GETBUTTONINFOW (TBN_FIRST-20) -#define TBN_GETBUTTONINFO WINELIB_NAME_AW(TBN_GETBUTTONINFO) -#define TBN_BEGINDRAG (TBN_FIRST-1) -#define TBN_ENDDRAG (TBN_FIRST-2) -#define TBN_BEGINADJUST (TBN_FIRST-3) -#define TBN_ENDADJUST (TBN_FIRST-4) -#define TBN_RESET (TBN_FIRST-5) -#define TBN_QUERYINSERT (TBN_FIRST-6) -#define TBN_QUERYDELETE (TBN_FIRST-7) -#define TBN_TOOLBARCHANGE (TBN_FIRST-8) -#define TBN_CUSTHELP (TBN_FIRST-9) -#define TBN_DROPDOWN (TBN_FIRST-10) -#define TBN_GETOBJECT (TBN_FIRST-12) -#define TBN_HOTITEMCHANGE (TBN_FIRST-13) -#define TBN_DRAGOUT (TBN_FIRST-14) -#define TBN_DELETINGBUTTON (TBN_FIRST-15) -#define TBN_GETDISPINFOA (TBN_FIRST-16) -#define TBN_GETDISPINFOW (TBN_FIRST-17) -#define TBN_GETDISPINFO WINELIB_NAME_AW(TBN_GETDISPINFO) -#define TBN_GETINFOTIPA (TBN_FIRST-18) -#define TBN_GETINFOTIPW (TBN_FIRST-19) -#define TBN_GETINFOTIP WINELIB_NAME_AW(TBN_GETINFOTIP) -#define TBN_RESTORE (TBN_FIRST-21) -#define TBN_SAVE (TBN_FIRST-22) -#define TBN_INITCUSTOMIZE (TBN_FIRST-23) -#define TBN_WRAPHOTITEM (TBN_FIRST-24) /* this is undocumented and the name is a guess */ -#define TBNRF_HIDEHELP 0x00000001 - - -/* Return values from TBN_DROPDOWN */ -#define TBDDRET_DEFAULT 0 -#define TBDDRET_NODEFAULT 1 -#define TBDDRET_TREATPRESSED 2 - -typedef struct _NMTBCUSTOMDRAW -{ + typedef struct _NMTBCUSTOMDRAW { NMCUSTOMDRAW nmcd; HBRUSH hbrMonoDither; HBRUSH hbrLines; @@ -1263,183 +861,409 @@ typedef struct _NMTBCUSTOMDRAW int nStringBkMode; int nHLStringBkMode; int iListGap; -} NMTBCUSTOMDRAW, *LPNMTBCUSTOMDRAW; + } NMTBCUSTOMDRAW,*LPNMTBCUSTOMDRAW; -/* return flags for Toolbar NM_CUSTOMDRAW notifications */ -#define TBCDRF_NOEDGES 0x00010000 /* Don't draw button edges */ -#define TBCDRF_HILITEHOTTRACK 0x00020000 /* Use color of the button bkgnd */ - /* when hottracked */ -#define TBCDRF_NOOFFSET 0x00040000 /* No offset button if pressed */ -#define TBCDRF_NOMARK 0x00080000 /* Don't draw default highlight */ - /* for TBSTATE_MARKED */ -#define TBCDRF_NOETCHEDEFFECT 0x00100000 /* No etched effect for */ - /* disabled items */ -#define TBCDRF_BLENDICON 0x00200000 /* ILD_BLEND50 on the icon image */ -#define TBCDRF_NOBACKGROUND 0x00400000 /* ILD_BLEND50 on the icon image */ -#define TBCDRF_USECDCOLORS 0x00800000 +#define TBCDRF_NOEDGES 0x10000 +#define TBCDRF_HILITEHOTTRACK 0x20000 +#define TBCDRF_NOOFFSET 0x40000 +#define TBCDRF_NOMARK 0x80000 +#define TBCDRF_NOETCHEDEFFECT 0x100000 +#define TBCDRF_BLENDICON 0x200000 +#define TBCDRF_NOBACKGROUND 0x400000 -/* This is just for old CreateToolbar. */ -/* Don't use it in new programs. */ -typedef struct _OLDTBBUTTON { - INT iBitmap; - INT idCommand; - BYTE fsState; - BYTE fsStyle; - BYTE bReserved[2]; - DWORD dwData; -} OLDTBBUTTON, *POLDTBBUTTON, *LPOLDTBBUTTON; -typedef const OLDTBBUTTON *LPCOLDTBBUTTON; +#define TB_ENABLEBUTTON (WM_USER+1) +#define TB_CHECKBUTTON (WM_USER+2) +#define TB_PRESSBUTTON (WM_USER+3) +#define TB_HIDEBUTTON (WM_USER+4) +#define TB_INDETERMINATE (WM_USER+5) +#define TB_MARKBUTTON (WM_USER+6) +#define TB_ISBUTTONENABLED (WM_USER+9) +#define TB_ISBUTTONCHECKED (WM_USER+10) +#define TB_ISBUTTONPRESSED (WM_USER+11) +#define TB_ISBUTTONHIDDEN (WM_USER+12) +#define TB_ISBUTTONINDETERMINATE (WM_USER+13) +#define TB_ISBUTTONHIGHLIGHTED (WM_USER+14) +#define TB_SETSTATE (WM_USER+17) +#define TB_GETSTATE (WM_USER+18) +#define TB_ADDBITMAP (WM_USER+19) - -typedef struct _TBBUTTON { - INT iBitmap; - INT idCommand; - BYTE fsState; - BYTE fsStyle; -#ifdef _WIN64 - BYTE bReserved[6]; -#else - BYTE bReserved[2]; -#endif - DWORD_PTR dwData; - INT_PTR iString; -} TBBUTTON, *PTBBUTTON, *LPTBBUTTON; -typedef const TBBUTTON *LPCTBBUTTON; - - -typedef struct _COLORMAP { - COLORREF from; - COLORREF to; -} COLORMAP, *LPCOLORMAP; - - -typedef struct tagTBADDBITMAP { + typedef struct tagTBADDBITMAP { HINSTANCE hInst; - UINT_PTR nID; -} TBADDBITMAP, *LPTBADDBITMAP; + UINT_PTR nID; + } TBADDBITMAP,*LPTBADDBITMAP; -#define HINST_COMMCTRL ((HINSTANCE)-1) -#define IDB_STD_SMALL_COLOR 0 -#define IDB_STD_LARGE_COLOR 1 -#define IDB_VIEW_SMALL_COLOR 4 -#define IDB_VIEW_LARGE_COLOR 5 -#define IDB_HIST_SMALL_COLOR 8 -#define IDB_HIST_LARGE_COLOR 9 +#define HINST_COMMCTRL ((HINSTANCE)-1) +#define IDB_STD_SMALL_COLOR 0 +#define IDB_STD_LARGE_COLOR 1 +#define IDB_VIEW_SMALL_COLOR 4 +#define IDB_VIEW_LARGE_COLOR 5 +#define IDB_HIST_SMALL_COLOR 8 +#define IDB_HIST_LARGE_COLOR 9 -#define STD_CUT 0 -#define STD_COPY 1 -#define STD_PASTE 2 -#define STD_UNDO 3 -#define STD_REDOW 4 -#define STD_DELETE 5 -#define STD_FILENEW 6 -#define STD_FILEOPEN 7 -#define STD_FILESAVE 8 -#define STD_PRINTPRE 9 -#define STD_PROPERTIES 10 -#define STD_HELP 11 -#define STD_FIND 12 -#define STD_REPLACE 13 -#define STD_PRINT 14 +#define STD_CUT 0 +#define STD_COPY 1 +#define STD_PASTE 2 +#define STD_UNDO 3 +#define STD_REDOW 4 +#define STD_DELETE 5 +#define STD_FILENEW 6 +#define STD_FILEOPEN 7 +#define STD_FILESAVE 8 +#define STD_PRINTPRE 9 +#define STD_PROPERTIES 10 +#define STD_HELP 11 +#define STD_FIND 12 +#define STD_REPLACE 13 +#define STD_PRINT 14 -#define VIEW_LARGEICONS 0 -#define VIEW_SMALLICONS 1 -#define VIEW_LIST 2 -#define VIEW_DETAILS 3 -#define VIEW_SORTNAME 4 -#define VIEW_SORTSIZE 5 -#define VIEW_SORTDATE 6 -#define VIEW_SORTTYPE 7 -#define VIEW_PARENTFOLDER 8 -#define VIEW_NETCONNECT 9 -#define VIEW_NETDISCONNECT 10 -#define VIEW_NEWFOLDER 11 -#define VIEW_VIEWMENU 12 +#define VIEW_LARGEICONS 0 +#define VIEW_SMALLICONS 1 +#define VIEW_LIST 2 +#define VIEW_DETAILS 3 +#define VIEW_SORTNAME 4 +#define VIEW_SORTSIZE 5 +#define VIEW_SORTDATE 6 +#define VIEW_SORTTYPE 7 +#define VIEW_PARENTFOLDER 8 +#define VIEW_NETCONNECT 9 +#define VIEW_NETDISCONNECT 10 +#define VIEW_NEWFOLDER 11 +#define VIEW_VIEWMENU 12 +#define HIST_BACK 0 +#define HIST_FORWARD 1 +#define HIST_FAVORITES 2 +#define HIST_ADDTOFAVORITES 3 +#define HIST_VIEWTREE 4 -#define HIST_BACK 0 -#define HIST_FORWARD 1 -#define HIST_FAVORITES 2 -#define HIST_ADDTOFAVORITES 3 -#define HIST_VIEWTREE 4 +#define TB_ADDBUTTONSA (WM_USER+20) +#define TB_INSERTBUTTONA (WM_USER+21) +#define TB_DELETEBUTTON (WM_USER+22) +#define TB_GETBUTTON (WM_USER+23) +#define TB_BUTTONCOUNT (WM_USER+24) +#define TB_COMMANDTOINDEX (WM_USER+25) -typedef struct tagTBSAVEPARAMSA { - HKEY hkr; + typedef struct tagTBSAVEPARAMSA { + HKEY hkr; LPCSTR pszSubKey; LPCSTR pszValueName; -} TBSAVEPARAMSA, *LPTBSAVEPARAMSA; + } TBSAVEPARAMSA,*LPTBSAVEPARAMSA; -typedef struct tagTBSAVEPARAMSW { - HKEY hkr; + typedef struct tagTBSAVEPARAMSW { + HKEY hkr; LPCWSTR pszSubKey; LPCWSTR pszValueName; -} TBSAVEPARAMSW, *LPTBSAVEPARAMSW; + } TBSAVEPARAMSW,*LPTBSAVEPARAMW; -#define TBSAVEPARAMS WINELIB_NAME_AW(TBSAVEPARAMS) -#define LPTBSAVEPARAMS WINELIB_NAME_AW(LPTBSAVEPARAMS) +#ifdef UNICODE +#define TBSAVEPARAMS TBSAVEPARAMSW +#define LPTBSAVEPARAMS LPTBSAVEPARAMSW +#else +#define TBSAVEPARAMS TBSAVEPARAMSA +#define LPTBSAVEPARAMS LPTBSAVEPARAMSA +#endif -typedef struct -{ +#define TB_SAVERESTOREA (WM_USER+26) +#define TB_SAVERESTOREW (WM_USER+76) +#define TB_CUSTOMIZE (WM_USER+27) +#define TB_ADDSTRINGA (WM_USER+28) +#define TB_ADDSTRINGW (WM_USER+77) +#define TB_GETITEMRECT (WM_USER+29) +#define TB_BUTTONSTRUCTSIZE (WM_USER+30) +#define TB_SETBUTTONSIZE (WM_USER+31) +#define TB_SETBITMAPSIZE (WM_USER+32) +#define TB_AUTOSIZE (WM_USER+33) +#define TB_GETTOOLTIPS (WM_USER+35) +#define TB_SETTOOLTIPS (WM_USER+36) +#define TB_SETPARENT (WM_USER+37) +#define TB_SETROWS (WM_USER+39) +#define TB_GETROWS (WM_USER+40) +#define TB_SETCMDID (WM_USER+42) +#define TB_CHANGEBITMAP (WM_USER+43) +#define TB_GETBITMAP (WM_USER+44) +#define TB_GETBUTTONTEXTA (WM_USER+45) +#define TB_GETBUTTONTEXTW (WM_USER+75) +#define TB_REPLACEBITMAP (WM_USER+46) +#define TB_SETINDENT (WM_USER+47) +#define TB_SETIMAGELIST (WM_USER+48) +#define TB_GETIMAGELIST (WM_USER+49) +#define TB_LOADIMAGES (WM_USER+50) +#define TB_GETRECT (WM_USER+51) +#define TB_SETHOTIMAGELIST (WM_USER+52) +#define TB_GETHOTIMAGELIST (WM_USER+53) +#define TB_SETDISABLEDIMAGELIST (WM_USER+54) +#define TB_GETDISABLEDIMAGELIST (WM_USER+55) +#define TB_SETSTYLE (WM_USER+56) +#define TB_GETSTYLE (WM_USER+57) +#define TB_GETBUTTONSIZE (WM_USER+58) +#define TB_SETBUTTONWIDTH (WM_USER+59) +#define TB_SETMAXTEXTROWS (WM_USER+60) +#define TB_GETTEXTROWS (WM_USER+61) + +#ifdef UNICODE +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTW +#define TB_SAVERESTORE TB_SAVERESTOREW +#define TB_ADDSTRING TB_ADDSTRINGW +#else +#define TB_GETBUTTONTEXT TB_GETBUTTONTEXTA +#define TB_SAVERESTORE TB_SAVERESTOREA +#define TB_ADDSTRING TB_ADDSTRINGA +#endif +#define TB_GETOBJECT (WM_USER+62) +#define TB_GETHOTITEM (WM_USER+71) +#define TB_SETHOTITEM (WM_USER+72) +#define TB_SETANCHORHIGHLIGHT (WM_USER+73) +#define TB_GETANCHORHIGHLIGHT (WM_USER+74) +#define TB_MAPACCELERATORA (WM_USER+78) + + typedef struct { + int iButton; + DWORD dwFlags; + } TBINSERTMARK,*LPTBINSERTMARK; +#define TBIMHT_AFTER 0x1 +#define TBIMHT_BACKGROUND 0x2 + +#define TB_GETINSERTMARK (WM_USER+79) +#define TB_SETINSERTMARK (WM_USER+80) +#define TB_INSERTMARKHITTEST (WM_USER+81) +#define TB_MOVEBUTTON (WM_USER+82) +#define TB_GETMAXSIZE (WM_USER+83) +#define TB_SETEXTENDEDSTYLE (WM_USER+84) +#define TB_GETEXTENDEDSTYLE (WM_USER+85) +#define TB_GETPADDING (WM_USER+86) +#define TB_SETPADDING (WM_USER+87) +#define TB_SETINSERTMARKCOLOR (WM_USER+88) +#define TB_GETINSERTMARKCOLOR (WM_USER+89) + +#define TB_SETCOLORSCHEME CCM_SETCOLORSCHEME +#define TB_GETCOLORSCHEME CCM_GETCOLORSCHEME + +#define TB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT + +#define TB_MAPACCELERATORW (WM_USER+90) +#ifdef UNICODE +#define TB_MAPACCELERATOR TB_MAPACCELERATORW +#else +#define TB_MAPACCELERATOR TB_MAPACCELERATORA +#endif + + typedef struct { + HINSTANCE hInstOld; + UINT_PTR nIDOld; + HINSTANCE hInstNew; + UINT_PTR nIDNew; + int nButtons; + } TBREPLACEBITMAP,*LPTBREPLACEBITMAP; + +#define TBBF_LARGE 0x1 + +#define TB_GETBITMAPFLAGS (WM_USER+41) + +#define TBIF_IMAGE 0x1 +#define TBIF_TEXT 0x2 +#define TBIF_STATE 0x4 +#define TBIF_STYLE 0x8 +#define TBIF_LPARAM 0x10 +#define TBIF_COMMAND 0x20 +#define TBIF_SIZE 0x40 +#define TBIF_BYINDEX 0x80000000 + + typedef struct { UINT cbSize; - DWORD dwMask; - INT idCommand; - INT iImage; - BYTE fsState; - BYTE fsStyle; - WORD cx; + DWORD dwMask; + int idCommand; + int iImage; + BYTE fsState; + BYTE fsStyle; + WORD cx; DWORD_PTR lParam; - LPSTR pszText; - INT cchText; -} TBBUTTONINFOA, *LPTBBUTTONINFOA; + LPSTR pszText; + int cchText; + } TBBUTTONINFOA,*LPTBBUTTONINFOA; -typedef struct -{ + typedef struct { UINT cbSize; - DWORD dwMask; - INT idCommand; - INT iImage; - BYTE fsState; - BYTE fsStyle; - WORD cx; + DWORD dwMask; + int idCommand; + int iImage; + BYTE fsState; + BYTE fsStyle; + WORD cx; DWORD_PTR lParam; LPWSTR pszText; - INT cchText; -} TBBUTTONINFOW, *LPTBBUTTONINFOW; + int cchText; + } TBBUTTONINFOW,*LPTBBUTTONINFOW; -#define TBBUTTONINFO WINELIB_NAME_AW(TBBUTTONINFO) -#define LPTBBUTTONINFO WINELIB_NAME_AW(LPTBBUTTONINFO) +#ifdef UNICODE +#define TBBUTTONINFO TBBUTTONINFOW +#define LPTBBUTTONINFO LPTBBUTTONINFOW +#else +#define TBBUTTONINFO TBBUTTONINFOA +#define LPTBBUTTONINFO LPTBBUTTONINFOA +#endif -typedef struct tagNMTBHOTITEM -{ +#define TB_GETBUTTONINFOW (WM_USER+63) +#define TB_SETBUTTONINFOW (WM_USER+64) +#define TB_GETBUTTONINFOA (WM_USER+65) +#define TB_SETBUTTONINFOA (WM_USER+66) +#ifdef UNICODE +#define TB_GETBUTTONINFO TB_GETBUTTONINFOW +#define TB_SETBUTTONINFO TB_SETBUTTONINFOW +#else +#define TB_GETBUTTONINFO TB_GETBUTTONINFOA +#define TB_SETBUTTONINFO TB_SETBUTTONINFOA +#endif + +#define TB_INSERTBUTTONW (WM_USER+67) +#define TB_ADDBUTTONSW (WM_USER+68) + +#define TB_HITTEST (WM_USER+69) + +#ifdef UNICODE +#define TB_INSERTBUTTON TB_INSERTBUTTONW +#define TB_ADDBUTTONS TB_ADDBUTTONSW +#else +#define TB_INSERTBUTTON TB_INSERTBUTTONA +#define TB_ADDBUTTONS TB_ADDBUTTONSA +#endif + +#define TB_SETDRAWTEXTFLAGS (WM_USER+70) + +#define TB_GETSTRINGW (WM_USER+91) +#define TB_GETSTRINGA (WM_USER+92) +#ifdef UNICODE +#define TB_GETSTRING TB_GETSTRINGW +#else +#define TB_GETSTRING TB_GETSTRINGA +#endif + +#define TB_SETHOTITEM2 (WM_USER+94) +#define TB_SETLISTGAP (WM_USER+96) +#define TB_GETIMAGELISTCOUNT (WM_USER+98) +#define TB_GETIDEALSIZE (WM_USER+99) +#define TB_TRANSLATEACCELERATOR CCM_TRANSLATEACCELERATOR + +#define TBMF_PAD 0x1 +#define TBMF_BARPAD 0x2 +#define TBMF_BUTTONSPACING 0x4 + + typedef struct { + UINT cbSize; + DWORD dwMask; + int cxPad; + int cyPad; + int cxBarPad; + int cyBarPad; + int cxButtonSpacing; + int cyButtonSpacing; + } TBMETRICS,*LPTBMETRICS; + +#define TB_GETMETRICS (WM_USER+101) +#define TB_SETMETRICS (WM_USER+102) +#define TB_SETWINDOWTHEME CCM_SETWINDOWTHEME + +#define TBN_GETBUTTONINFOA (TBN_FIRST-0) +#define TBN_BEGINDRAG (TBN_FIRST-1) +#define TBN_ENDDRAG (TBN_FIRST-2) +#define TBN_BEGINADJUST (TBN_FIRST-3) +#define TBN_ENDADJUST (TBN_FIRST-4) +#define TBN_RESET (TBN_FIRST-5) +#define TBN_QUERYINSERT (TBN_FIRST-6) +#define TBN_QUERYDELETE (TBN_FIRST-7) +#define TBN_TOOLBARCHANGE (TBN_FIRST-8) +#define TBN_CUSTHELP (TBN_FIRST-9) +#define TBN_DROPDOWN (TBN_FIRST - 10) +#define TBN_GETOBJECT (TBN_FIRST - 12) + typedef struct tagNMTBHOTITEM { NMHDR hdr; int idOld; int idNew; DWORD dwFlags; -} NMTBHOTITEM, *LPNMTBHOTITEM; + } NMTBHOTITEM,*LPNMTBHOTITEM; -typedef struct tagNMTBGETINFOTIPA -{ - NMHDR hdr; - LPSTR pszText; - INT cchTextMax; - INT iItem; +#define HICF_OTHER 0x0 +#define HICF_MOUSE 0x1 +#define HICF_ARROWKEYS 0x2 +#define HICF_ACCELERATOR 0x4 +#define HICF_DUPACCEL 0x8 +#define HICF_ENTERING 0x10 +#define HICF_LEAVING 0x20 +#define HICF_RESELECT 0x40 +#define HICF_LMOUSE 0x80 +#define HICF_TOGGLEDROPDOWN 0x100 + +#define TBN_HOTITEMCHANGE (TBN_FIRST - 13) +#define TBN_DRAGOUT (TBN_FIRST - 14) +#define TBN_DELETINGBUTTON (TBN_FIRST - 15) +#define TBN_GETDISPINFOA (TBN_FIRST - 16) +#define TBN_GETDISPINFOW (TBN_FIRST - 17) +#define TBN_GETINFOTIPA (TBN_FIRST - 18) +#define TBN_GETINFOTIPW (TBN_FIRST - 19) +#define TBN_GETBUTTONINFOW (TBN_FIRST - 20) +#define TBN_RESTORE (TBN_FIRST - 21) +#define TBN_SAVE (TBN_FIRST - 22) +#define TBN_INITCUSTOMIZE (TBN_FIRST - 23) +#define TBN_WRAPHOTITEM (TBN_FIRST - 24) +#define TBN_DUPACCELERATOR (TBN_FIRST - 25) +#define TBN_WRAPACCELERATOR (TBN_FIRST - 26) +#define TBN_DRAGOVER (TBN_FIRST - 27) +#define TBN_MAPACCELERATOR (TBN_FIRST - 28) +#define TBNRF_HIDEHELP 0x1 +#define TBNRF_ENDCUSTOMIZE 0x2 + + typedef struct tagNMTBSAVE { + NMHDR hdr; + DWORD *pData; + DWORD *pCurrent; + UINT cbData; + int iItem; + int cButtons; + TBBUTTON tbButton; + } NMTBSAVE,*LPNMTBSAVE; + + typedef struct tagNMTBRESTORE { + NMHDR hdr; + DWORD *pData; + DWORD *pCurrent; + UINT cbData; + int iItem; + int cButtons; + int cbBytesPerRecord; + TBBUTTON tbButton; + } NMTBRESTORE,*LPNMTBRESTORE; + + typedef struct tagNMTBGETINFOTIPA { + NMHDR hdr; + LPSTR pszText; + int cchTextMax; + int iItem; LPARAM lParam; -} NMTBGETINFOTIPA, *LPNMTBGETINFOTIPA; + } NMTBGETINFOTIPA,*LPNMTBGETINFOTIPA; -typedef struct tagNMTBGETINFOTIPW -{ - NMHDR hdr; + typedef struct tagNMTBGETINFOTIPW { + NMHDR hdr; LPWSTR pszText; - INT cchTextMax; - INT iItem; + int cchTextMax; + int iItem; LPARAM lParam; -} NMTBGETINFOTIPW, *LPNMTBGETINFOTIPW; + } NMTBGETINFOTIPW,*LPNMTBGETINFOTIPW; -#define NMTBGETINFOTIP WINELIB_NAME_AW(NMTBGETINFOTIP) -#define LPNMTBGETINFOTIP WINELIB_NAME_AW(LPNMTBGETINFOTIP) +#ifdef UNICODE +#define TBN_GETINFOTIP TBN_GETINFOTIPW +#define NMTBGETINFOTIP NMTBGETINFOTIPW +#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPW +#else +#define TBN_GETINFOTIP TBN_GETINFOTIPA +#define NMTBGETINFOTIP NMTBGETINFOTIPA +#define LPNMTBGETINFOTIP LPNMTBGETINFOTIPA +#endif -typedef struct -{ +#define TBNF_IMAGE 0x1 +#define TBNF_TEXT 0x2 +#define TBNF_DI_SETITEM 0x10000000 + + typedef struct { NMHDR hdr; DWORD dwMask; int idCommand; @@ -1447,10 +1271,9 @@ typedef struct int iImage; LPSTR pszText; int cchText; -} NMTBDISPINFOA, *LPNMTBDISPINFOA; + } NMTBDISPINFOA,*LPNMTBDISPINFOA; -typedef struct -{ + typedef struct { NMHDR hdr; DWORD dwMask; int idCommand; @@ -1458,266 +1281,350 @@ typedef struct int iImage; LPWSTR pszText; int cchText; -} NMTBDISPINFOW, *LPNMTBDISPINFOW; + } NMTBDISPINFOW,*LPNMTBDISPINFOW; -#define NMTBDISPINFO WINELIB_NAME_AW(NMTBDISPINFO) -#define LPNMTBDISPINFO WINELIB_NAME_AW(LPNMTBDISPINFO) +#ifdef UNICODE +#define TBN_GETDISPINFO TBN_GETDISPINFOW +#define NMTBDISPINFO NMTBDISPINFOW +#define LPNMTBDISPINFO LPNMTBDISPINFOW +#else +#define TBN_GETDISPINFO TBN_GETDISPINFOA +#define NMTBDISPINFO NMTBDISPINFOA +#define LPNMTBDISPINFO LPNMTBDISPINFOA +#endif -/* contents of dwMask in the NMTBDISPINFO structure */ -#define TBNF_IMAGE 0x00000001 -#define TBNF_TEXT 0x00000002 -#define TBNF_DI_SETITEM 0x10000000 +#define TBDDRET_DEFAULT 0 +#define TBDDRET_NODEFAULT 1 +#define TBDDRET_TREATPRESSED 2 +#ifdef UNICODE +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOW +#else +#define TBN_GETBUTTONINFO TBN_GETBUTTONINFOA +#endif -typedef struct tagNMTOOLBARA -{ - NMHDR hdr; - INT iItem; - TBBUTTON tbButton; - INT cchText; - LPSTR pszText; - RECT rcButton; /* Version 5.80 */ -} NMTOOLBARA, *LPNMTOOLBARA, TBNOTIFYA, *LPTBNOTIFYA; +#define TBNOTIFYA NMTOOLBARA +#define TBNOTIFYW NMTOOLBARW +#define LPTBNOTIFYA LPNMTOOLBARA +#define LPTBNOTIFYW LPNMTOOLBARW -typedef struct tagNMTOOLBARW -{ - NMHDR hdr; - INT iItem; - TBBUTTON tbButton; - INT cchText; - LPWSTR pszText; - RECT rcButton; /* Version 5.80 */ -} NMTOOLBARW, *LPNMTOOLBARW, TBNOTIFYW, *LPTBNOTIFYW; +#define TBNOTIFY NMTOOLBAR +#define LPTBNOTIFY LPNMTOOLBAR -#define NMTOOLBAR WINELIB_NAME_AW(NMTOOLBAR) -#define LPNMTOOLBAR WINELIB_NAME_AW(LPNMTOOLBAR) -#define TBNOTIFY WINELIB_NAME_AW(TBNOTIFY) -#define LPTBNOTIFY WINELIB_NAME_AW(LPTBNOTIFY) - -typedef struct -{ - HINSTANCE hInstOld; - UINT_PTR nIDOld; - HINSTANCE hInstNew; - UINT_PTR nIDNew; - INT nButtons; -} TBREPLACEBITMAP, *LPTBREPLACEBITMAP; - -#define HICF_OTHER 0x00000000 -#define HICF_MOUSE 0x00000001 /* Triggered by mouse */ -#define HICF_ARROWKEYS 0x00000002 /* Triggered by arrow keys */ -#define HICF_ACCELERATOR 0x00000004 /* Triggered by accelerator */ -#define HICF_DUPACCEL 0x00000008 /* This accelerator is not unique */ -#define HICF_ENTERING 0x00000010 /* idOld is invalid */ -#define HICF_LEAVING 0x00000020 /* idNew is invalid */ -#define HICF_RESELECT 0x00000040 /* hot item reselected */ -#define HICF_LMOUSE 0x00000080 /* left mouse button selected */ -#define HICF_TOGGLEDROPDOWN 0x00000100 /* Toggle button's dropdown state */ - -typedef struct -{ - int iButton; - DWORD dwFlags; -} TBINSERTMARK, *LPTBINSERTMARK; -#define TBIMHT_AFTER 0x00000001 /* TRUE = insert After iButton, otherwise before */ -#define TBIMHT_BACKGROUND 0x00000002 /* TRUE if and only if missed buttons completely */ - -typedef struct tagNMTBSAVE -{ + typedef struct tagNMTOOLBARA { NMHDR hdr; - DWORD* pData; - DWORD* pCurrent; - UINT cbData; int iItem; - int cButtons; TBBUTTON tbButton; -} NMTBSAVE, *LPNMTBSAVE; + int cchText; + LPSTR pszText; + RECT rcButton; + } NMTOOLBARA,*LPNMTOOLBARA; -typedef struct tagNMTBRESTORE -{ + typedef struct tagNMTOOLBARW { NMHDR hdr; - DWORD* pData; - DWORD* pCurrent; - UINT cbData; int iItem; - int cButtons; - int cbBytesPerRecord; TBBUTTON tbButton; -} NMTBRESTORE, *LPNMTBRESTORE; + int cchText; + LPWSTR pszText; + RECT rcButton; + } NMTOOLBARW,*LPNMTOOLBARW; -#define TBMF_PAD 0x00000001 -#define TBMF_BARPAD 0x00000002 -#define TBMF_BUTTONSPACING 0x00000004 +#ifdef UNICODE +#define NMTOOLBAR NMTOOLBARW +#define LPNMTOOLBAR LPNMTOOLBARW +#else +#define NMTOOLBAR NMTOOLBARA +#define LPNMTOOLBAR LPNMTOOLBARA +#endif +#endif -typedef struct -{ +#ifndef NOREBAR + +#define REBARCLASSNAMEW L"ReBarWindow32" +#define REBARCLASSNAMEA "ReBarWindow32" + +#ifdef UNICODE +#define REBARCLASSNAME REBARCLASSNAMEW +#else +#define REBARCLASSNAME REBARCLASSNAMEA +#endif + +#define RBIM_IMAGELIST 0x1 + +#define RBS_TOOLTIPS 0x100 +#define RBS_VARHEIGHT 0x200 +#define RBS_BANDBORDERS 0x400 +#define RBS_FIXEDORDER 0x800 +#define RBS_REGISTERDROP 0x1000 +#define RBS_AUTOSIZE 0x2000 +#define RBS_VERTICALGRIPPER 0x4000 +#define RBS_DBLCLKTOGGLE 0x8000 + + typedef struct tagREBARINFO { UINT cbSize; - DWORD dwMask; - INT cxPad; - INT cyPad; - INT cxBarPad; - INT cyBarPad; - INT cxButtonSpacing; - INT cyButtonSpacing; -} TBMETRICS, *LPTBMETRICS; - -/* these are undocumented and the names are guesses */ -typedef struct -{ - NMHDR hdr; - HWND hwndDialog; -} NMTBINITCUSTOMIZE; - -typedef struct -{ - NMHDR hdr; - INT idNew; - INT iDirection; /* left is -1, right is 1 */ - DWORD dwReason; /* HICF_* */ -} NMTBWRAPHOTITEM; - - -HWND WINAPI -CreateToolbar(HWND, DWORD, UINT, INT, HINSTANCE, - UINT, LPCTBBUTTON, INT); - -HWND WINAPI -CreateToolbarEx(HWND, DWORD, UINT, INT, - HINSTANCE, UINT_PTR, LPCTBBUTTON, - INT, INT, INT, INT, INT, UINT); - -HBITMAP WINAPI -CreateMappedBitmap (HINSTANCE, INT_PTR, UINT, LPCOLORMAP, INT); - - -/* Tool tips */ - -#define TOOLTIPS_CLASSA "tooltips_class32" -# define TOOLTIPS_CLASSW L"tooltips_class32" -#define TOOLTIPS_CLASS WINELIB_NAME_AW(TOOLTIPS_CLASS) - -#if (_WIN32_WINNT >= 0x501) -#define BUTTON_IMAGELIST_ALIGN_LEFT 0 -#define BUTTON_IMAGELIST_ALIGN_RIGHT 1 -#define BUTTON_IMAGELIST_ALIGN_TOP 2 -#define BUTTON_IMAGELIST_ALIGN_BOTTOM 3 -#define BUTTON_IMAGELIST_ALIGN_CENTER 4 - -typedef struct -{ + UINT fMask; +#ifndef NOIMAGEAPIS HIMAGELIST himl; - RECT margin; - UINT uAlign; -} BUTTON_IMAGELIST, *PBUTTON_IMAGELIST; +#else + HANDLE himl; +#endif + } REBARINFO,*LPREBARINFO; -#define BCM_FIRST 0x1600 -#define BCM_GETIDEALSIZE (BCM_FIRST + 1) -#define BCM_SETIMAGELIST (BCM_FIRST + 2) -#endif /* _WIN32_WINNT */ +#define RBBS_BREAK 0x1 +#define RBBS_FIXEDSIZE 0x2 +#define RBBS_CHILDEDGE 0x4 +#define RBBS_HIDDEN 0x8 +#define RBBS_NOVERT 0x10 +#define RBBS_FIXEDBMP 0x20 +#define RBBS_VARIABLEHEIGHT 0x40 +#define RBBS_GRIPPERALWAYS 0x80 +#define RBBS_NOGRIPPER 0x100 +#define RBBS_USECHEVRON 0x200 +#define RBBS_HIDETITLE 0x400 +#define RBBS_TOPALIGN 0x800 -#define INFOTIPSIZE 1024 +#define RBBIM_STYLE 0x1 +#define RBBIM_COLORS 0x2 +#define RBBIM_TEXT 0x4 +#define RBBIM_IMAGE 0x8 +#define RBBIM_CHILD 0x10 +#define RBBIM_CHILDSIZE 0x20 +#define RBBIM_SIZE 0x40 +#define RBBIM_BACKGROUND 0x80 +#define RBBIM_ID 0x100 +#define RBBIM_IDEALSIZE 0x200 +#define RBBIM_LPARAM 0x400 +#define RBBIM_HEADERSIZE 0x800 -#define TTS_ALWAYSTIP 0x01 -#define TTS_NOPREFIX 0x02 -#define TTS_NOANIMATE 0x10 -#define TTS_NOFADE 0x20 -#define TTS_BALLOON 0x40 -#define TTS_CLOSE 0x80 -#define TTS_USEVISUALSTYLE 0x100 + typedef struct tagREBARBANDINFOA { + UINT cbSize; + UINT fMask; + UINT fStyle; + COLORREF clrFore; + COLORREF clrBack; + LPSTR lpText; + UINT cch; + int iImage; + HWND hwndChild; + UINT cxMinChild; + UINT cyMinChild; + UINT cx; + HBITMAP hbmBack; + UINT wID; + UINT cyChild; + UINT cyMaxChild; + UINT cyIntegral; + UINT cxIdeal; + LPARAM lParam; + UINT cxHeader; + } REBARBANDINFOA,*LPREBARBANDINFOA; + typedef REBARBANDINFOA CONST *LPCREBARBANDINFOA; -#define TTF_IDISHWND 0x0001 -#define TTF_CENTERTIP 0x0002 -#define TTF_RTLREADING 0x0004 -#define TTF_SUBCLASS 0x0010 -#define TTF_TRACK 0x0020 -#define TTF_ABSOLUTE 0x0080 -#define TTF_TRANSPARENT 0x0100 -#define TTF_DI_SETITEM 0x8000 /* valid only on the TTN_NEEDTEXT callback */ +#define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA,wID) +#define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW,wID) +#define REBARBANDINFOA_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA,cxHeader) +#define REBARBANDINFOW_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW,cxHeader) + typedef struct tagREBARBANDINFOW { + UINT cbSize; + UINT fMask; + UINT fStyle; + COLORREF clrFore; + COLORREF clrBack; + LPWSTR lpText; + UINT cch; + int iImage; + HWND hwndChild; + UINT cxMinChild; + UINT cyMinChild; + UINT cx; + HBITMAP hbmBack; + UINT wID; + UINT cyChild; + UINT cyMaxChild; + UINT cyIntegral; + UINT cxIdeal; + LPARAM lParam; + UINT cxHeader; + } REBARBANDINFOW,*LPREBARBANDINFOW; + typedef REBARBANDINFOW CONST *LPCREBARBANDINFOW; -#define TTDT_AUTOMATIC 0 -#define TTDT_RESHOW 1 -#define TTDT_AUTOPOP 2 -#define TTDT_INITIAL 3 +#ifdef UNICODE +#define REBARBANDINFO REBARBANDINFOW +#define LPREBARBANDINFO LPREBARBANDINFOW +#define LPCREBARBANDINFO LPCREBARBANDINFOW +#define REBARBANDINFO_V3_SIZE REBARBANDINFOW_V3_SIZE +#else +#define REBARBANDINFO REBARBANDINFOA +#define LPREBARBANDINFO LPREBARBANDINFOA +#define LPCREBARBANDINFO LPCREBARBANDINFOA +#define REBARBANDINFO_V3_SIZE REBARBANDINFOA_V3_SIZE +#endif +#define RB_INSERTBANDA (WM_USER+1) +#define RB_DELETEBAND (WM_USER+2) +#define RB_GETBARINFO (WM_USER+3) +#define RB_SETBARINFO (WM_USER+4) +#define RB_SETBANDINFOA (WM_USER+6) +#define RB_SETPARENT (WM_USER+7) +#define RB_HITTEST (WM_USER+8) +#define RB_GETRECT (WM_USER+9) +#define RB_INSERTBANDW (WM_USER+10) +#define RB_SETBANDINFOW (WM_USER+11) +#define RB_GETBANDCOUNT (WM_USER+12) +#define RB_GETROWCOUNT (WM_USER+13) +#define RB_GETROWHEIGHT (WM_USER+14) +#define RB_IDTOINDEX (WM_USER+16) +#define RB_GETTOOLTIPS (WM_USER+17) +#define RB_SETTOOLTIPS (WM_USER+18) +#define RB_SETBKCOLOR (WM_USER+19) +#define RB_GETBKCOLOR (WM_USER+20) +#define RB_SETTEXTCOLOR (WM_USER+21) +#define RB_GETTEXTCOLOR (WM_USER+22) -#define TTI_NONE 0 -#define TTI_INFO 1 -#define TTI_WARNING 2 -#define TTI_ERROR 3 +#define RBSTR_CHANGERECT 0x1 +#define RB_SIZETORECT (WM_USER+23) +#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME +#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME -#define TTM_ACTIVATE (WM_USER+1) -#define TTM_SETDELAYTIME (WM_USER+3) -#define TTM_ADDTOOLA (WM_USER+4) -#define TTM_ADDTOOLW (WM_USER+50) -#define TTM_ADDTOOL WINELIB_NAME_AW(TTM_ADDTOOL) -#define TTM_DELTOOLA (WM_USER+5) -#define TTM_DELTOOLW (WM_USER+51) -#define TTM_DELTOOL WINELIB_NAME_AW(TTM_DELTOOL) -#define TTM_NEWTOOLRECTA (WM_USER+6) -#define TTM_NEWTOOLRECTW (WM_USER+52) -#define TTM_NEWTOOLRECT WINELIB_NAME_AW(TTM_NEWTOOLRECT) -#define TTM_RELAYEVENT (WM_USER+7) -#define TTM_GETTOOLINFOA (WM_USER+8) -#define TTM_GETTOOLINFOW (WM_USER+53) -#define TTM_GETTOOLINFO WINELIB_NAME_AW(TTM_GETTOOLINFO) -#define TTM_SETTOOLINFOA (WM_USER+9) -#define TTM_SETTOOLINFOW (WM_USER+54) -#define TTM_SETTOOLINFO WINELIB_NAME_AW(TTM_SETTOOLINFO) -#define TTM_HITTESTA (WM_USER+10) -#define TTM_HITTESTW (WM_USER+55) -#define TTM_HITTEST WINELIB_NAME_AW(TTM_HITTEST) -#define TTM_GETTEXTA (WM_USER+11) -#define TTM_GETTEXTW (WM_USER+56) -#define TTM_GETTEXT WINELIB_NAME_AW(TTM_GETTEXT) -#define TTM_UPDATETIPTEXTA (WM_USER+12) -#define TTM_UPDATETIPTEXTW (WM_USER+57) -#define TTM_UPDATETIPTEXT WINELIB_NAME_AW(TTM_UPDATETIPTEXT) -#define TTM_GETTOOLCOUNT (WM_USER+13) -#define TTM_ENUMTOOLSA (WM_USER+14) -#define TTM_ENUMTOOLSW (WM_USER+58) -#define TTM_ENUMTOOLS WINELIB_NAME_AW(TTM_ENUMTOOLS) -#define TTM_GETCURRENTTOOLA (WM_USER+15) -#define TTM_GETCURRENTTOOLW (WM_USER+59) -#define TTM_GETCURRENTTOOL WINELIB_NAME_AW(TTM_GETCURRENTTOOL) -#define TTM_WINDOWFROMPOINT (WM_USER+16) -#define TTM_TRACKACTIVATE (WM_USER+17) -#define TTM_TRACKPOSITION (WM_USER+18) -#define TTM_SETTIPBKCOLOR (WM_USER+19) -#define TTM_SETTIPTEXTCOLOR (WM_USER+20) -#define TTM_GETDELAYTIME (WM_USER+21) -#define TTM_GETTIPBKCOLOR (WM_USER+22) -#define TTM_GETTIPTEXTCOLOR (WM_USER+23) -#define TTM_SETMAXTIPWIDTH (WM_USER+24) -#define TTM_GETMAXTIPWIDTH (WM_USER+25) -#define TTM_SETMARGIN (WM_USER+26) -#define TTM_GETMARGIN (WM_USER+27) -#define TTM_POP (WM_USER+28) -#define TTM_UPDATE (WM_USER+29) -#define TTM_GETBUBBLESIZE (WM_USER+30) -#define TTM_ADJUSTRECT (WM_USER+31) -#define TTM_SETTITLEA (WM_USER+32) -#define TTM_SETTITLEW (WM_USER+33) -#define TTM_SETTITLE WINELIB_NAME_AW(TTM_SETTITLE) -#define TTM_POPUP (WM_USER+34) -#define TTM_GETTITLE (WM_USER+35) -#define TTM_SETWINDOWTHEME CCM_SETWINDOWTHEME +#ifdef UNICODE +#define RB_INSERTBAND RB_INSERTBANDW +#define RB_SETBANDINFO RB_SETBANDINFOW +#else +#define RB_INSERTBAND RB_INSERTBANDA +#define RB_SETBANDINFO RB_SETBANDINFOA +#endif +#define RB_BEGINDRAG (WM_USER+24) +#define RB_ENDDRAG (WM_USER+25) +#define RB_DRAGMOVE (WM_USER+26) +#define RB_GETBARHEIGHT (WM_USER+27) +#define RB_GETBANDINFOW (WM_USER+28) +#define RB_GETBANDINFOA (WM_USER+29) -#define TTN_FIRST (0U-520U) -#define TTN_LAST (0U-549U) -#define TTN_GETDISPINFOA (TTN_FIRST-0) -#define TTN_GETDISPINFOW (TTN_FIRST-10) -#define TTN_GETDISPINFO WINELIB_NAME_AW(TTN_GETDISPINFO) -#define TTN_SHOW (TTN_FIRST-1) -#define TTN_POP (TTN_FIRST-2) +#ifdef UNICODE +#define RB_GETBANDINFO RB_GETBANDINFOW +#else +#define RB_GETBANDINFO RB_GETBANDINFOA +#endif -#define TTN_NEEDTEXT TTN_GETDISPINFO -#define TTN_NEEDTEXTA TTN_GETDISPINFOA -#define TTN_NEEDTEXTW TTN_GETDISPINFOW +#define RB_MINIMIZEBAND (WM_USER+30) +#define RB_MAXIMIZEBAND (WM_USER+31) +#define RB_GETDROPTARGET (CCM_GETDROPTARGET) +#define RB_GETBANDBORDERS (WM_USER+34) +#define RB_SHOWBAND (WM_USER+35) +#define RB_SETPALETTE (WM_USER+37) +#define RB_GETPALETTE (WM_USER+38) +#define RB_MOVEBAND (WM_USER+39) +#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define RB_GETBANDMARGINS (WM_USER+40) +#define RB_SETWINDOWTHEME CCM_SETWINDOWTHEME +#define RB_PUSHCHEVRON (WM_USER+43) -typedef struct tagTOOLINFOA { +#define RBN_HEIGHTCHANGE (RBN_FIRST - 0) +#define RBN_GETOBJECT (RBN_FIRST - 1) +#define RBN_LAYOUTCHANGED (RBN_FIRST - 2) +#define RBN_AUTOSIZE (RBN_FIRST - 3) +#define RBN_BEGINDRAG (RBN_FIRST - 4) +#define RBN_ENDDRAG (RBN_FIRST - 5) +#define RBN_DELETINGBAND (RBN_FIRST - 6) +#define RBN_DELETEDBAND (RBN_FIRST - 7) +#define RBN_CHILDSIZE (RBN_FIRST - 8) +#define RBN_CHEVRONPUSHED (RBN_FIRST - 10) +#define RBN_MINMAX (RBN_FIRST - 21) +#define RBN_AUTOBREAK (RBN_FIRST - 22) + + typedef struct tagNMREBARCHILDSIZE { + NMHDR hdr; + UINT uBand; + UINT wID; + RECT rcChild; + RECT rcBand; + } NMREBARCHILDSIZE,*LPNMREBARCHILDSIZE; + + typedef struct tagNMREBAR { + NMHDR hdr; + DWORD dwMask; + UINT uBand; + UINT fStyle; + UINT wID; + LPARAM lParam; + } NMREBAR,*LPNMREBAR; + +#define RBNM_ID 0x1 +#define RBNM_STYLE 0x2 +#define RBNM_LPARAM 0x4 + + typedef struct tagNMRBAUTOSIZE { + NMHDR hdr; + WINBOOL fChanged; + RECT rcTarget; + RECT rcActual; + } NMRBAUTOSIZE,*LPNMRBAUTOSIZE; + + typedef struct tagNMREBARCHEVRON { + NMHDR hdr; + UINT uBand; + UINT wID; + LPARAM lParam; + RECT rc; + LPARAM lParamNM; + } NMREBARCHEVRON,*LPNMREBARCHEVRON; + +#define RBAB_AUTOSIZE 0x1 +#define RBAB_ADDBAND 0x2 + + typedef struct tagNMREBARAUTOBREAK { + NMHDR hdr; + UINT uBand; + UINT wID; + LPARAM lParam; + UINT uMsg; + UINT fStyleCurrent; + WINBOOL fAutoBreak; + } NMREBARAUTOBREAK,*LPNMREBARAUTOBREAK; + +#define RBHT_NOWHERE 0x1 +#define RBHT_CAPTION 0x2 +#define RBHT_CLIENT 0x3 +#define RBHT_GRABBER 0x4 +#define RBHT_CHEVRON 0x8 + + typedef struct _RB_HITTESTINFO { + POINT pt; + UINT flags; + int iBand; + } RBHITTESTINFO,*LPRBHITTESTINFO; +#endif + +#ifndef NOTOOLTIPS + +#define TOOLTIPS_CLASSW L"tooltips_class32" +#define TOOLTIPS_CLASSA "tooltips_class32" +#ifdef UNICODE +#define TOOLTIPS_CLASS TOOLTIPS_CLASSW +#else +#define TOOLTIPS_CLASS TOOLTIPS_CLASSA +#endif + +#define LPTOOLINFOA LPTTTOOLINFOA +#define LPTOOLINFOW LPTTTOOLINFOW +#define TOOLINFOA TTTOOLINFOA +#define TOOLINFOW TTTOOLINFOW + +#define LPTOOLINFO LPTTTOOLINFO +#define TOOLINFO TTTOOLINFO + +#define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA,lpszText) +#define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW,lpszText) +#define TTTOOLINFOA_V2_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA,lParam) +#define TTTOOLINFOW_V2_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW,lParam) +#define TTTOOLINFOA_V3_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA,lpReserved) +#define TTTOOLINFOW_V3_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW,lpReserved) + + typedef struct tagTOOLINFOA { UINT cbSize; UINT uFlags; HWND hwnd; @@ -1727,9 +1634,9 @@ typedef struct tagTOOLINFOA { LPSTR lpszText; LPARAM lParam; void *lpReserved; -} TTTOOLINFOA, *LPTOOLINFOA, *PTOOLINFOA, *LPTTTOOLINFOA; + } TTTOOLINFOA,NEAR *PTOOLINFOA,*LPTTTOOLINFOA; -typedef struct tagTOOLINFOW { + typedef struct tagTOOLINFOW { UINT cbSize; UINT uFlags; HWND hwnd; @@ -1739,1742 +1646,1403 @@ typedef struct tagTOOLINFOW { LPWSTR lpszText; LPARAM lParam; void *lpReserved; -} TTTOOLINFOW, *LPTOOLINFOW, *PTOOLINFOW, *LPTTTOOLINFOW; + } TTTOOLINFOW,NEAR *PTOOLINFOW,*LPTTTOOLINFOW; -#define TTTOOLINFO WINELIB_NAME_AW(TTTOOLINFO) -#define TOOLINFO WINELIB_NAME_AW(TTTOOLINFO) -#define PTOOLINFO WINELIB_NAME_AW(PTOOLINFO) -#define LPTTTOOLINFO WINELIB_NAME_AW(LPTTTOOLINFO) -#define LPTOOLINFO WINELIB_NAME_AW(LPTOOLINFO) +#ifdef UNICODE +#define TTTOOLINFO TTTOOLINFOW +#define PTOOLINFO PTOOLINFOW +#define LPTTTOOLINFO LPTTTOOLINFOW +#define TTTOOLINFO_V1_SIZE TTTOOLINFOW_V1_SIZE +#else +#define PTOOLINFO PTOOLINFOA +#define TTTOOLINFO TTTOOLINFOA +#define LPTTTOOLINFO LPTTTOOLINFOA +#define TTTOOLINFO_V1_SIZE TTTOOLINFOA_V1_SIZE +#endif -#define TTTOOLINFOA_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpszText) -#define TTTOOLINFOW_V1_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpszText) -#define TTTOOLINFO_V1_SIZE CCSIZEOF_STRUCT(WINELIB_NAME_AW(TTTOOLINFO), lpszText) -#define TTTOOLINFOA_V2_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lParam) -#define TTTOOLINFOW_V2_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lParam) -#define TTTOOLINFOA_V3_SIZE CCSIZEOF_STRUCT(TTTOOLINFOA, lpReserved) -#define TTTOOLINFOW_V3_SIZE CCSIZEOF_STRUCT(TTTOOLINFOW, lpReserved) +#define TTS_ALWAYSTIP 0x1 +#define TTS_NOPREFIX 0x2 +#define TTS_NOANIMATE 0x10 +#define TTS_NOFADE 0x20 +#define TTS_BALLOON 0x40 +#define TTS_CLOSE 0x80 -typedef struct _TT_HITTESTINFOA -{ - HWND hwnd; - POINT pt; - TTTOOLINFOA ti; -} TTHITTESTINFOA, *LPTTHITTESTINFOA; -#define LPHITTESTINFOA LPTTHITTESTINFOA +#define TTF_IDISHWND 0x1 +#define TTF_CENTERTIP 0x2 +#define TTF_RTLREADING 0x4 +#define TTF_SUBCLASS 0x10 +#define TTF_TRACK 0x20 +#define TTF_ABSOLUTE 0x80 +#define TTF_TRANSPARENT 0x100 +#define TTF_PARSELINKS 0x1000 +#define TTF_DI_SETITEM 0x8000 -typedef struct _TT_HITTESTINFOW -{ - HWND hwnd; - POINT pt; - TTTOOLINFOW ti; -} TTHITTESTINFOW, *LPTTHITTESTINFOW; -#define LPHITTESTINFOW LPTTHITTESTINFOW +#define TTDT_AUTOMATIC 0 +#define TTDT_RESHOW 1 +#define TTDT_AUTOPOP 2 +#define TTDT_INITIAL 3 -#define TTHITTESTINFO WINELIB_NAME_AW(TTHITTESTINFO) -#define LPTTHITTESTINFO WINELIB_NAME_AW(LPTTHITTESTINFO) -#define LPHITTESTINFO WINELIB_NAME_AW(LPHITTESTINFO) +#define TTI_NONE 0 +#define TTI_INFO 1 +#define TTI_WARNING 2 +#define TTI_ERROR 3 -typedef struct tagNMTTDISPINFOA -{ - NMHDR hdr; - LPSTR lpszText; - CHAR szText[80]; - HINSTANCE hinst; - UINT uFlags; - LPARAM lParam; -} NMTTDISPINFOA, *LPNMTTDISPINFOA; +#define TTM_ACTIVATE (WM_USER+1) +#define TTM_SETDELAYTIME (WM_USER+3) +#define TTM_ADDTOOLA (WM_USER+4) +#define TTM_ADDTOOLW (WM_USER+50) +#define TTM_DELTOOLA (WM_USER+5) +#define TTM_DELTOOLW (WM_USER+51) +#define TTM_NEWTOOLRECTA (WM_USER+6) +#define TTM_NEWTOOLRECTW (WM_USER+52) +#define TTM_RELAYEVENT (WM_USER+7) -typedef struct tagNMTTDISPINFOW -{ - NMHDR hdr; - LPWSTR lpszText; - WCHAR szText[80]; - HINSTANCE hinst; - UINT uFlags; - LPARAM lParam; -} NMTTDISPINFOW, *LPNMTTDISPINFOW; +#define TTM_GETTOOLINFOA (WM_USER+8) +#define TTM_GETTOOLINFOW (WM_USER+53) -#define NMTTDISPINFO WINELIB_NAME_AW(NMTTDISPINFO) -#define LPNMTTDISPINFO WINELIB_NAME_AW(LPNMTTDISPINFO) +#define TTM_SETTOOLINFOA (WM_USER+9) +#define TTM_SETTOOLINFOW (WM_USER+54) -#define NMTTDISPINFO_V1_SIZEA CCSIZEOF_STRUCT(NMTTDISPINFOA, uFlags) -#define NMTTDISPINFO_V1_SIZEW CCSIZEOF_STRUCT(NMTTDISPINFOW, uFlags) -#define NMTTDISPINFO_V1_SIZE WINELIB_NAME_AW(NMTTDISPINFO_V1_SIZE) +#define TTM_HITTESTA (WM_USER +10) +#define TTM_HITTESTW (WM_USER +55) +#define TTM_GETTEXTA (WM_USER +11) +#define TTM_GETTEXTW (WM_USER +56) +#define TTM_UPDATETIPTEXTA (WM_USER +12) +#define TTM_UPDATETIPTEXTW (WM_USER +57) +#define TTM_GETTOOLCOUNT (WM_USER +13) +#define TTM_ENUMTOOLSA (WM_USER +14) +#define TTM_ENUMTOOLSW (WM_USER +58) +#define TTM_GETCURRENTTOOLA (WM_USER+15) +#define TTM_GETCURRENTTOOLW (WM_USER+59) +#define TTM_WINDOWFROMPOINT (WM_USER+16) +#define TTM_TRACKACTIVATE (WM_USER+17) +#define TTM_TRACKPOSITION (WM_USER+18) +#define TTM_SETTIPBKCOLOR (WM_USER+19) +#define TTM_SETTIPTEXTCOLOR (WM_USER+20) +#define TTM_GETDELAYTIME (WM_USER+21) +#define TTM_GETTIPBKCOLOR (WM_USER+22) +#define TTM_GETTIPTEXTCOLOR (WM_USER+23) +#define TTM_SETMAXTIPWIDTH (WM_USER+24) +#define TTM_GETMAXTIPWIDTH (WM_USER+25) +#define TTM_SETMARGIN (WM_USER+26) +#define TTM_GETMARGIN (WM_USER+27) +#define TTM_POP (WM_USER+28) +#define TTM_UPDATE (WM_USER+29) +#define TTM_GETBUBBLESIZE (WM_USER+30) +#define TTM_ADJUSTRECT (WM_USER+31) +#define TTM_SETTITLEA (WM_USER+32) +#define TTM_SETTITLEW (WM_USER+33) -typedef struct _TTGETTITLE -{ +#define TTM_POPUP (WM_USER+34) +#define TTM_GETTITLE (WM_USER+35) + typedef struct _TTGETTITLE { DWORD dwSize; UINT uTitleBitmap; UINT cch; - WCHAR* pszTitle; -} TTGETTITLE, *PTTGETTITLE; + WCHAR *pszTitle; + } TTGETTITLE,*PTTGETTITLE; -#define TOOLTIPTEXTW NMTTDISPINFOW -#define TOOLTIPTEXTA NMTTDISPINFOA -#define TOOLTIPTEXT NMTTDISPINFO -#define LPTOOLTIPTEXTW LPNMTTDISPINFOW -#define LPTOOLTIPTEXTA LPNMTTDISPINFOA -#define LPTOOLTIPTEXT LPNMTTDISPINFO - - -/* Rebar control */ - -#define REBARCLASSNAMEA "ReBarWindow32" -#if defined(__GNUC__) -# define REBARCLASSNAMEW (const WCHAR []){ 'R','e','B','a','r', \ - 'W','i','n','d','o','w','3','2',0 } -#elif defined(_MSC_VER) -# define REBARCLASSNAMEW L"ReBarWindow32" +#ifdef UNICODE +#define TTM_ADDTOOL TTM_ADDTOOLW +#define TTM_DELTOOL TTM_DELTOOLW +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTW +#define TTM_GETTOOLINFO TTM_GETTOOLINFOW +#define TTM_SETTOOLINFO TTM_SETTOOLINFOW +#define TTM_HITTEST TTM_HITTESTW +#define TTM_GETTEXT TTM_GETTEXTW +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTW +#define TTM_ENUMTOOLS TTM_ENUMTOOLSW +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLW +#define TTM_SETTITLE TTM_SETTITLEW #else -static const WCHAR REBARCLASSNAMEW[] = { 'R','e','B','a','r', - 'W','i','n','d','o','w','3','2',0 }; +#define TTM_ADDTOOL TTM_ADDTOOLA +#define TTM_DELTOOL TTM_DELTOOLA +#define TTM_NEWTOOLRECT TTM_NEWTOOLRECTA +#define TTM_GETTOOLINFO TTM_GETTOOLINFOA +#define TTM_SETTOOLINFO TTM_SETTOOLINFOA +#define TTM_HITTEST TTM_HITTESTA +#define TTM_GETTEXT TTM_GETTEXTA +#define TTM_UPDATETIPTEXT TTM_UPDATETIPTEXTA +#define TTM_ENUMTOOLS TTM_ENUMTOOLSA +#define TTM_GETCURRENTTOOL TTM_GETCURRENTTOOLA +#define TTM_SETTITLE TTM_SETTITLEA #endif -#define REBARCLASSNAME WINELIB_NAME_AW(REBARCLASSNAME) +#define TTM_SETWINDOWTHEME CCM_SETWINDOWTHEME -#define RBS_TOOLTIPS 0x0100 -#define RBS_VARHEIGHT 0x0200 -#define RBS_BANDBORDERS 0x0400 -#define RBS_FIXEDORDER 0x0800 -#define RBS_REGISTERDROP 0x1000 -#define RBS_AUTOSIZE 0x2000 -#define RBS_VERTICALGRIPPER 0x4000 -#define RBS_DBLCLKTOGGLE 0x8000 +#define LPHITTESTINFOW LPTTHITTESTINFOW +#define LPHITTESTINFOA LPTTHITTESTINFOA +#define LPHITTESTINFO LPTTHITTESTINFO -#define RBIM_IMAGELIST 0x00000001 - -#define RBBIM_STYLE 0x00000001 -#define RBBIM_COLORS 0x00000002 -#define RBBIM_TEXT 0x00000004 -#define RBBIM_IMAGE 0x00000008 -#define RBBIM_CHILD 0x00000010 -#define RBBIM_CHILDSIZE 0x00000020 -#define RBBIM_SIZE 0x00000040 -#define RBBIM_BACKGROUND 0x00000080 -#define RBBIM_ID 0x00000100 -#define RBBIM_IDEALSIZE 0x00000200 -#define RBBIM_LPARAM 0x00000400 -#define RBBIM_HEADERSIZE 0x00000800 - -#define RBBS_BREAK 0x00000001 -#define RBBS_FIXEDSIZE 0x00000002 -#define RBBS_CHILDEDGE 0x00000004 -#define RBBS_HIDDEN 0x00000008 -#define RBBS_NOVERT 0x00000010 -#define RBBS_FIXEDBMP 0x00000020 -#define RBBS_VARIABLEHEIGHT 0x00000040 -#define RBBS_GRIPPERALWAYS 0x00000080 -#define RBBS_NOGRIPPER 0x00000100 -#define RBBS_USECHEVRON 0x00000200 -#define RBBS_HIDETITLE 0x00000400 -#define RBBS_TOPALIGN 0x00000800 - -#define RBNM_ID 0x00000001 -#define RBNM_STYLE 0x00000002 -#define RBNM_LPARAM 0x00000004 - -#define RBHT_NOWHERE 0x0001 -#define RBHT_CAPTION 0x0002 -#define RBHT_CLIENT 0x0003 -#define RBHT_GRABBER 0x0004 -#define RBHT_CHEVRON 0x0008 - -#define RB_INSERTBANDA (WM_USER+1) -#define RB_INSERTBANDW (WM_USER+10) -#define RB_INSERTBAND WINELIB_NAME_AW(RB_INSERTBAND) -#define RB_DELETEBAND (WM_USER+2) -#define RB_GETBARINFO (WM_USER+3) -#define RB_SETBARINFO (WM_USER+4) -#define RB_SETBANDINFOA (WM_USER+6) -#define RB_SETBANDINFOW (WM_USER+11) -#define RB_SETBANDINFO WINELIB_NAME_AW(RB_SETBANDINFO) -#define RB_SETPARENT (WM_USER+7) -#define RB_HITTEST (WM_USER+8) -#define RB_GETRECT (WM_USER+9) -#define RB_GETBANDCOUNT (WM_USER+12) -#define RB_GETROWCOUNT (WM_USER+13) -#define RB_GETROWHEIGHT (WM_USER+14) -#define RB_IDTOINDEX (WM_USER+16) -#define RB_GETTOOLTIPS (WM_USER+17) -#define RB_SETTOOLTIPS (WM_USER+18) -#define RB_SETBKCOLOR (WM_USER+19) -#define RB_GETBKCOLOR (WM_USER+20) -#define RB_SETTEXTCOLOR (WM_USER+21) -#define RB_GETTEXTCOLOR (WM_USER+22) -#define RB_SIZETORECT (WM_USER+23) -#define RB_BEGINDRAG (WM_USER+24) -#define RB_ENDDRAG (WM_USER+25) -#define RB_DRAGMOVE (WM_USER+26) -#define RB_GETBARHEIGHT (WM_USER+27) -#define RB_GETBANDINFOW (WM_USER+28) -#define RB_GETBANDINFOA (WM_USER+29) -#define RB_GETBANDINFO WINELIB_NAME_AW(RB_GETBANDINFO) -#define RB_MINIMIZEBAND (WM_USER+30) -#define RB_MAXIMIZEBAND (WM_USER+31) -#define RB_GETBANDBORDERS (WM_USER+34) -#define RB_SHOWBAND (WM_USER+35) -#define RB_SETPALETTE (WM_USER+37) -#define RB_GETPALETTE (WM_USER+38) -#define RB_MOVEBAND (WM_USER+39) -#define RB_GETBANDMARGINS (WM_USER+40) -#define RB_PUSHCHEVRON (WM_USER+43) -#define RB_GETDROPTARGET CCM_GETDROPTARGET -#define RB_SETCOLORSCHEME CCM_SETCOLORSCHEME -#define RB_GETCOLORSCHEME CCM_GETCOLORSCHEME -#define RB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define RB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define RB_SETWINDOWTHEME CCM_SETWINDOWTHEME - -#define RBN_FIRST (0U-831U) -#define RBN_LAST (0U-859U) -#define RBN_HEIGHTCHANGE (RBN_FIRST-0) -#define RBN_GETOBJECT (RBN_FIRST-1) -#define RBN_LAYOUTCHANGED (RBN_FIRST-2) -#define RBN_AUTOSIZE (RBN_FIRST-3) -#define RBN_BEGINDRAG (RBN_FIRST-4) -#define RBN_ENDDRAG (RBN_FIRST-5) -#define RBN_DELETINGBAND (RBN_FIRST-6) -#define RBN_DELETEDBAND (RBN_FIRST-7) -#define RBN_CHILDSIZE (RBN_FIRST-8) -#define RBN_CHEVRONPUSHED (RBN_FIRST-10) -#define RBN_MINMAX (RBN_FIRST-21) -#define RBN_AUTOBREAK (RBN_FIRST-22) - -#define RBSTR_CHANGERECT 0x0001 - -typedef struct tagREBARINFO -{ - UINT cbSize; - UINT fMask; - HIMAGELIST himl; -} REBARINFO, *LPREBARINFO; - -typedef struct tagREBARBANDINFOA -{ - UINT cbSize; - UINT fMask; - UINT fStyle; - COLORREF clrFore; - COLORREF clrBack; - LPSTR lpText; - UINT cch; - INT iImage; - HWND hwndChild; - UINT cxMinChild; - UINT cyMinChild; - UINT cx; - HBITMAP hbmBack; - UINT wID; - UINT cyChild; - UINT cyMaxChild; - UINT cyIntegral; - UINT cxIdeal; - LPARAM lParam; - UINT cxHeader; - /* _WIN32_WINNT >= 0x0600 */ - RECT rcChevronLocation; - UINT uChevronState; -} REBARBANDINFOA, *LPREBARBANDINFOA; - -typedef REBARBANDINFOA const *LPCREBARBANDINFOA; - -typedef struct tagREBARBANDINFOW -{ - UINT cbSize; - UINT fMask; - UINT fStyle; - COLORREF clrFore; - COLORREF clrBack; - LPWSTR lpText; - UINT cch; - INT iImage; - HWND hwndChild; - UINT cxMinChild; - UINT cyMinChild; - UINT cx; - HBITMAP hbmBack; - UINT wID; - UINT cyChild; - UINT cyMaxChild; - UINT cyIntegral; - UINT cxIdeal; - LPARAM lParam; - UINT cxHeader; - /* _WIN32_WINNT >= 0x0600 */ - RECT rcChevronLocation; - UINT uChevronState; -} REBARBANDINFOW, *LPREBARBANDINFOW; - -typedef REBARBANDINFOW const *LPCREBARBANDINFOW; - -#define REBARBANDINFO WINELIB_NAME_AW(REBARBANDINFO) -#define LPREBARBANDINFO WINELIB_NAME_AW(LPREBARBANDINFO) -#define LPCREBARBANDINFO WINELIB_NAME_AW(LPCREBARBANDINFO) - -#define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID) -#define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID) -#define REBARBANDINFO_V3_SIZE CCSIZEOF_STRUCT(WINELIB_NAME_AW(REBARBANDINFO), wID) -#define REBARBANDINFOA_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, cxHeader) -#define REBARBANDINFOW_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, cxHeader) -#define REBARBANDINFO_V6_SIZE CCSIZEOF_STRUCT(WINELIB_NAME_AW(REBARBANDINFO), cxHeader) - -typedef struct tagNMREBARCHILDSIZE -{ - NMHDR hdr; - UINT uBand; - UINT wID; - RECT rcChild; - RECT rcBand; -} NMREBARCHILDSIZE, *LPNMREBARCHILDSIZE; - -typedef struct tagNMREBAR -{ - NMHDR hdr; - DWORD dwMask; - UINT uBand; - UINT fStyle; - UINT wID; - LPARAM lParam; -} NMREBAR, *LPNMREBAR; - -typedef struct tagNMRBAUTOSIZE -{ - NMHDR hdr; - BOOL fChanged; - RECT rcTarget; - RECT rcActual; -} NMRBAUTOSIZE, *LPNMRBAUTOSIZE; - -typedef struct tagNMREBARCHEVRON -{ - NMHDR hdr; - UINT uBand; - UINT wID; - LPARAM lParam; - RECT rc; - LPARAM lParamNM; -} NMREBARCHEVRON, *LPNMREBARCHEVRON; - -typedef struct _RB_HITTESTINFO -{ + typedef struct _TT_HITTESTINFOA { + HWND hwnd; POINT pt; - UINT flags; - INT iBand; -} RBHITTESTINFO, *LPRBHITTESTINFO; + TTTOOLINFOA ti; + } TTHITTESTINFOA,*LPTTHITTESTINFOA; -#define RBAB_AUTOSIZE 0x0001 -#define RBAB_ADDBAND 0x0002 + typedef struct _TT_HITTESTINFOW { + HWND hwnd; + POINT pt; + TTTOOLINFOW ti; + } TTHITTESTINFOW,*LPTTHITTESTINFOW; -typedef struct tagNMREBARAUTOBREAK -{ - NMHDR hdr; - UINT uBand; - UINT wID; - LPARAM lParam; - UINT uMsg; - UINT fStyleCurrent; - BOOL fAutoBreak; -} NMREBARAUTOBREAK, *LPNMREBARAUTOBREAK; - - -/* Trackbar control */ - -#define TRACKBAR_CLASSA "msctls_trackbar32" -#if defined(__GNUC__) -# define TRACKBAR_CLASSW (const WCHAR []){ 'm','s','c','t','l','s','_', \ - 't','r','a','c','k','b','a','r','3','2',0 } -#elif defined(_MSC_VER) -# define TRACKBAR_CLASSW L"msctls_trackbar32" +#ifdef UNICODE +#define TTHITTESTINFO TTHITTESTINFOW +#define LPTTHITTESTINFO LPTTHITTESTINFOW #else -static const WCHAR TRACKBAR_CLASSW[] = { 'm','s','c','t','l','s','_', - 't','r','a','c','k','b','a','r','3','2',0 }; +#define TTHITTESTINFO TTHITTESTINFOA +#define LPTTHITTESTINFO LPTTHITTESTINFOA #endif -#define TRACKBAR_CLASS WINELIB_NAME_AW(TRACKBAR_CLASS) -#define TBS_AUTOTICKS 0x0001 -#define TBS_VERT 0x0002 -#define TBS_HORZ 0x0000 -#define TBS_TOP 0x0004 -#define TBS_BOTTOM 0x0000 -#define TBS_LEFT 0x0004 -#define TBS_RIGHT 0x0000 -#define TBS_BOTH 0x0008 -#define TBS_NOTICKS 0x0010 -#define TBS_ENABLESELRANGE 0x0020 -#define TBS_FIXEDLENGTH 0x0040 -#define TBS_NOTHUMB 0x0080 -#define TBS_TOOLTIPS 0x0100 -#define TBS_REVERSED 0x0200 -#define TBS_DOWNISLEFT 0x0400 +#define TTN_GETDISPINFOA (TTN_FIRST - 0) +#define TTN_GETDISPINFOW (TTN_FIRST - 10) +#define TTN_SHOW (TTN_FIRST - 1) +#define TTN_POP (TTN_FIRST - 2) +#define TTN_LINKCLICK (TTN_FIRST - 3) -#define TBTS_TOP 0 -#define TBTS_LEFT 1 -#define TBTS_BOTTOM 2 -#define TBTS_RIGHT 3 - -#define TB_LINEUP 0 -#define TB_LINEDOWN 1 -#define TB_PAGEUP 2 -#define TB_PAGEDOWN 3 -#define TB_THUMBPOSITION 4 -#define TB_THUMBTRACK 5 -#define TB_TOP 6 -#define TB_BOTTOM 7 -#define TB_ENDTRACK 8 - -#define TBCD_TICS 0x0001 -#define TBCD_THUMB 0x0002 -#define TBCD_CHANNEL 0x0003 - -#define TBM_GETPOS (WM_USER) -#define TBM_GETRANGEMIN (WM_USER+1) -#define TBM_GETRANGEMAX (WM_USER+2) -#define TBM_GETTIC (WM_USER+3) -#define TBM_SETTIC (WM_USER+4) -#define TBM_SETPOS (WM_USER+5) -#define TBM_SETRANGE (WM_USER+6) -#define TBM_SETRANGEMIN (WM_USER+7) -#define TBM_SETRANGEMAX (WM_USER+8) -#define TBM_CLEARTICS (WM_USER+9) -#define TBM_SETSEL (WM_USER+10) -#define TBM_SETSELSTART (WM_USER+11) -#define TBM_SETSELEND (WM_USER+12) -#define TBM_GETPTICS (WM_USER+14) -#define TBM_GETTICPOS (WM_USER+15) -#define TBM_GETNUMTICS (WM_USER+16) -#define TBM_GETSELSTART (WM_USER+17) -#define TBM_GETSELEND (WM_USER+18) -#define TBM_CLEARSEL (WM_USER+19) -#define TBM_SETTICFREQ (WM_USER+20) -#define TBM_SETPAGESIZE (WM_USER+21) -#define TBM_GETPAGESIZE (WM_USER+22) -#define TBM_SETLINESIZE (WM_USER+23) -#define TBM_GETLINESIZE (WM_USER+24) -#define TBM_GETTHUMBRECT (WM_USER+25) -#define TBM_GETCHANNELRECT (WM_USER+26) -#define TBM_SETTHUMBLENGTH (WM_USER+27) -#define TBM_GETTHUMBLENGTH (WM_USER+28) -#define TBM_SETTOOLTIPS (WM_USER+29) -#define TBM_GETTOOLTIPS (WM_USER+30) -#define TBM_SETTIPSIDE (WM_USER+31) -#define TBM_SETBUDDY (WM_USER+32) -#define TBM_GETBUDDY (WM_USER+33) -#define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT - - -/* Pager control */ - -#define WC_PAGESCROLLERA "SysPager" -#if defined(__GNUC__) -# define WC_PAGESCROLLERW (const WCHAR []){ 'S','y','s','P','a','g','e','r',0 } -#elif defined(_MSC_VER) -# define WC_PAGESCROLLERW L"SysPager" +#ifdef UNICODE +#define TTN_GETDISPINFO TTN_GETDISPINFOW #else -static const WCHAR WC_PAGESCROLLERW[] = { 'S','y','s','P','a','g','e','r',0 }; +#define TTN_GETDISPINFO TTN_GETDISPINFOA #endif -#define WC_PAGESCROLLER WINELIB_NAME_AW(WC_PAGESCROLLER) -#define PGS_VERT 0x00000000 -#define PGS_HORZ 0x00000001 -#define PGS_AUTOSCROLL 0x00000002 -#define PGS_DRAGNDROP 0x00000004 +#define TTN_NEEDTEXT TTN_GETDISPINFO +#define TTN_NEEDTEXTA TTN_GETDISPINFOA +#define TTN_NEEDTEXTW TTN_GETDISPINFOW -#define PGF_INVISIBLE 0 -#define PGF_NORMAL 1 -#define PGF_GRAYED 2 -#define PGF_DEPRESSED 4 -#define PGF_HOT 8 +#define TOOLTIPTEXTW NMTTDISPINFOW +#define TOOLTIPTEXTA NMTTDISPINFOA +#define LPTOOLTIPTEXTA LPNMTTDISPINFOA +#define LPTOOLTIPTEXTW LPNMTTDISPINFOW -#define PGB_TOPORLEFT 0 -#define PGB_BOTTOMORRIGHT 1 +#define TOOLTIPTEXT NMTTDISPINFO +#define LPTOOLTIPTEXT LPNMTTDISPINFO -/* only used with PGN_SCROLL */ -#define PGF_SCROLLUP 1 -#define PGF_SCROLLDOWN 2 -#define PGF_SCROLLLEFT 4 -#define PGF_SCROLLRIGHT 8 +#define NMTTDISPINFOA_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOA,uFlags) +#define NMTTDISPINFOW_V1_SIZE CCSIZEOF_STRUCT(NMTTDISPINFOW,uFlags) -#define PGK_SHIFT 1 -#define PGK_CONTROL 2 -#define PGK_MENU 4 - -/* only used with PGN_CALCSIZE */ -#define PGF_CALCWIDTH 1 -#define PGF_CALCHEIGHT 2 - -#define PGM_FIRST 0x1400 -#define PGM_SETCHILD (PGM_FIRST+1) -#define PGM_RECALCSIZE (PGM_FIRST+2) -#define PGM_FORWARDMOUSE (PGM_FIRST+3) -#define PGM_SETBKCOLOR (PGM_FIRST+4) -#define PGM_GETBKCOLOR (PGM_FIRST+5) -#define PGM_SETBORDER (PGM_FIRST+6) -#define PGM_GETBORDER (PGM_FIRST+7) -#define PGM_SETPOS (PGM_FIRST+8) -#define PGM_GETPOS (PGM_FIRST+9) -#define PGM_SETBUTTONSIZE (PGM_FIRST+10) -#define PGM_GETBUTTONSIZE (PGM_FIRST+11) -#define PGM_GETBUTTONSTATE (PGM_FIRST+12) -#define PGM_GETDROPTARGET CCM_GETDROPTARGET - -#define PGN_FIRST (0U-900U) -#define PGN_LAST (0U-950U) -#define PGN_SCROLL (PGN_FIRST-1) -#define PGN_CALCSIZE (PGN_FIRST-2) - -#include - -typedef struct -{ + typedef struct tagNMTTDISPINFOA { NMHDR hdr; - WORD fwKeys; - RECT rcParent; - INT iDir; - INT iXpos; - INT iYpos; - INT iScroll; -} NMPGSCROLL, *LPNMPGSCROLL; + LPSTR lpszText; + char szText[80]; + HINSTANCE hinst; + UINT uFlags; + LPARAM lParam; + } NMTTDISPINFOA,*LPNMTTDISPINFOA; -#include - -typedef struct -{ + typedef struct tagNMTTDISPINFOW { NMHDR hdr; - DWORD dwFlag; - INT iWidth; - INT iHeight; -} NMPGCALCSIZE, *LPNMPGCALCSIZE; + LPWSTR lpszText; + WCHAR szText[80]; + HINSTANCE hinst; + UINT uFlags; + LPARAM lParam; + } NMTTDISPINFOW,*LPNMTTDISPINFOW; - -/* Treeview control */ - -#define WC_TREEVIEWA "SysTreeView32" -#if defined(__GNUC__) -# define WC_TREEVIEWW (const WCHAR []){ 'S','y','s', \ - 'T','r','e','e','V','i','e','w','3','2',0 } -#elif defined(_MSC_VER) -# define WC_TREEVIEWW L"SysTreeView32" +#ifdef UNICODE +#define NMTTDISPINFO NMTTDISPINFOW +#define LPNMTTDISPINFO LPNMTTDISPINFOW +#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOW_V1_SIZE #else -static const WCHAR WC_TREEVIEWW[] = { 'S','y','s', - 'T','r','e','e','V','i','e','w','3','2',0 }; +#define NMTTDISPINFO NMTTDISPINFOA +#define LPNMTTDISPINFO LPNMTTDISPINFOA +#define NMTTDISPINFO_V1_SIZE NMTTDISPINFOA_V1_SIZE +#endif #endif -#define WC_TREEVIEW WINELIB_NAME_AW(WC_TREEVIEW) -#define TVSIL_NORMAL 0 -#define TVSIL_STATE 2 +#ifndef NOSTATUSBAR -#define TV_FIRST 0x1100 -#define TVM_INSERTITEMA (TV_FIRST+0) -#define TVM_INSERTITEMW (TV_FIRST+50) -#define TVM_INSERTITEM WINELIB_NAME_AW(TVM_INSERTITEM) -#define TVM_DELETEITEM (TV_FIRST+1) -#define TVM_EXPAND (TV_FIRST+2) -#define TVM_GETITEMRECT (TV_FIRST+4) -#define TVM_GETCOUNT (TV_FIRST+5) -#define TVM_GETINDENT (TV_FIRST+6) -#define TVM_SETINDENT (TV_FIRST+7) -#define TVM_GETIMAGELIST (TV_FIRST+8) -#define TVM_SETIMAGELIST (TV_FIRST+9) -#define TVM_GETNEXTITEM (TV_FIRST+10) -#define TVM_SELECTITEM (TV_FIRST+11) -#define TVM_GETITEMA (TV_FIRST+12) -#define TVM_GETITEMW (TV_FIRST+62) -#define TVM_GETITEM WINELIB_NAME_AW(TVM_GETITEM) -#define TVM_SETITEMA (TV_FIRST+13) -#define TVM_SETITEMW (TV_FIRST+63) -#define TVM_SETITEM WINELIB_NAME_AW(TVM_SETITEM) -#define TVM_EDITLABELA (TV_FIRST+14) -#define TVM_EDITLABELW (TV_FIRST+65) -#define TVM_EDITLABEL WINELIB_NAME_AW(TVM_EDITLABEL) -#define TVM_GETEDITCONTROL (TV_FIRST+15) -#define TVM_GETVISIBLECOUNT (TV_FIRST+16) -#define TVM_HITTEST (TV_FIRST+17) -#define TVM_CREATEDRAGIMAGE (TV_FIRST+18) -#define TVM_SORTCHILDREN (TV_FIRST+19) -#define TVM_ENSUREVISIBLE (TV_FIRST+20) -#define TVM_SORTCHILDRENCB (TV_FIRST+21) -#define TVM_ENDEDITLABELNOW (TV_FIRST+22) -#define TVM_GETISEARCHSTRINGA (TV_FIRST+23) -#define TVM_GETISEARCHSTRINGW (TV_FIRST+64) -#define TVM_GETISEARCHSTRING WINELIB_NAME_AW(TVM_GETISEARCHSTRING) -#define TVM_SETTOOLTIPS (TV_FIRST+24) -#define TVM_GETTOOLTIPS (TV_FIRST+25) -#define TVM_SETINSERTMARK (TV_FIRST+26) -#define TVM_SETITEMHEIGHT (TV_FIRST+27) -#define TVM_GETITEMHEIGHT (TV_FIRST+28) -#define TVM_SETBKCOLOR (TV_FIRST+29) -#define TVM_SETTEXTCOLOR (TV_FIRST+30) -#define TVM_GETBKCOLOR (TV_FIRST+31) -#define TVM_GETTEXTCOLOR (TV_FIRST+32) -#define TVM_SETSCROLLTIME (TV_FIRST+33) -#define TVM_GETSCROLLTIME (TV_FIRST+34) -#define TVM_UNKNOWN35 (TV_FIRST+35) -#define TVM_UNKNOWN36 (TV_FIRST+36) -#define TVM_SETINSERTMARKCOLOR (TV_FIRST+37) -#define TVM_GETINSERTMARKCOLOR (TV_FIRST+38) -#define TVM_GETITEMSTATE (TV_FIRST+39) -#define TVM_SETLINECOLOR (TV_FIRST+40) -#define TVM_GETLINECOLOR (TV_FIRST+41) -#define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define TVM_MAPACCIDTOHTREEITEM (TV_FIRST + 42) -#define TVM_MAPHTREEITEMTOACCID (TV_FIRST + 43) +#define SBARS_SIZEGRIP 0x100 +#define SBARS_TOOLTIPS 0x800 +#define SBT_TOOLTIPS 0x800 + WINCOMMCTRLAPI void WINAPI DrawStatusTextA(HDC hDC,LPCRECT lprc,LPCSTR pszText,UINT uFlags); + WINCOMMCTRLAPI void WINAPI DrawStatusTextW(HDC hDC,LPCRECT lprc,LPCWSTR pszText,UINT uFlags); -#define TVN_FIRST (0U-400U) -#define TVN_LAST (0U-499U) + WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowA(LONG style,LPCSTR lpszText,HWND hwndParent,UINT wID); + WINCOMMCTRLAPI HWND WINAPI CreateStatusWindowW(LONG style,LPCWSTR lpszText,HWND hwndParent,UINT wID); -#define TVN_SELCHANGINGA (TVN_FIRST-1) -#define TVN_SELCHANGINGW (TVN_FIRST-50) -#define TVN_SELCHANGING WINELIB_NAME_AW(TVN_SELCHANGING) - -#define TVN_SELCHANGEDA (TVN_FIRST-2) -#define TVN_SELCHANGEDW (TVN_FIRST-51) -#define TVN_SELCHANGED WINELIB_NAME_AW(TVN_SELCHANGED) - -#define TVN_GETDISPINFOA (TVN_FIRST-3) -#define TVN_GETDISPINFOW (TVN_FIRST-52) -#define TVN_GETDISPINFO WINELIB_NAME_AW(TVN_GETDISPINFO) - -#define TVN_SETDISPINFOA (TVN_FIRST-4) -#define TVN_SETDISPINFOW (TVN_FIRST-53) -#define TVN_SETDISPINFO WINELIB_NAME_AW(TVN_SETDISPINFO) - -#define TVN_ITEMEXPANDINGA (TVN_FIRST-5) -#define TVN_ITEMEXPANDINGW (TVN_FIRST-54) -#define TVN_ITEMEXPANDING WINELIB_NAME_AW(TVN_ITEMEXPANDING) - -#define TVN_ITEMEXPANDEDA (TVN_FIRST-6) -#define TVN_ITEMEXPANDEDW (TVN_FIRST-55) -#define TVN_ITEMEXPANDED WINELIB_NAME_AW(TVN_ITEMEXPANDED) - -#define TVN_BEGINDRAGA (TVN_FIRST-7) -#define TVN_BEGINDRAGW (TVN_FIRST-56) -#define TVN_BEGINDRAG WINELIB_NAME_AW(TVN_BEGINDRAG) - -#define TVN_BEGINRDRAGA (TVN_FIRST-8) -#define TVN_BEGINRDRAGW (TVN_FIRST-57) -#define TVN_BEGINRDRAG WINELIB_NAME_AW(TVN_BEGINRDRAG) - -#define TVN_DELETEITEMA (TVN_FIRST-9) -#define TVN_DELETEITEMW (TVN_FIRST-58) -#define TVN_DELETEITEM WINELIB_NAME_AW(TVN_DELETEITEM) - -#define TVN_BEGINLABELEDITA (TVN_FIRST-10) -#define TVN_BEGINLABELEDITW (TVN_FIRST-59) -#define TVN_BEGINLABELEDIT WINELIB_NAME_AW(TVN_BEGINLABELEDIT) - -#define TVN_ENDLABELEDITA (TVN_FIRST-11) -#define TVN_ENDLABELEDITW (TVN_FIRST-60) -#define TVN_ENDLABELEDIT WINELIB_NAME_AW(TVN_ENDLABELEDIT) - -#define TVN_KEYDOWN (TVN_FIRST-12) - -#define TVN_GETINFOTIPA (TVN_FIRST-13) -#define TVN_GETINFOTIPW (TVN_FIRST-14) -#define TVN_GETINFOTIP WINELIB_NAME_AW(TVN_GETINFOTIP) - -#define TVN_SINGLEEXPAND (TVN_FIRST-15) - - - - - -#define TVIF_TEXT 0x0001 -#define TVIF_IMAGE 0x0002 -#define TVIF_PARAM 0x0004 -#define TVIF_STATE 0x0008 -#define TVIF_HANDLE 0x0010 -#define TVIF_SELECTEDIMAGE 0x0020 -#define TVIF_CHILDREN 0x0040 -#define TVIF_INTEGRAL 0x0080 -#define TVIF_DI_SETITEM 0x1000 - -#define TVI_ROOT ((HTREEITEM)-65536) -#define TVI_FIRST ((HTREEITEM)-65535) -#define TVI_LAST ((HTREEITEM)-65534) -#define TVI_SORT ((HTREEITEM)-65533) - -#define TVIS_FOCUSED 0x0001 -#define TVIS_SELECTED 0x0002 -#define TVIS_CUT 0x0004 -#define TVIS_DROPHILITED 0x0008 -#define TVIS_BOLD 0x0010 -#define TVIS_EXPANDED 0x0020 -#define TVIS_EXPANDEDONCE 0x0040 -#define TVIS_EXPANDPARTIAL 0x0080 -#define TVIS_OVERLAYMASK 0x0f00 -#define TVIS_STATEIMAGEMASK 0xf000 -#define TVIS_USERMASK 0xf000 - -#define TVHT_NOWHERE 0x0001 -#define TVHT_ONITEMICON 0x0002 -#define TVHT_ONITEMLABEL 0x0004 -#define TVHT_ONITEMINDENT 0x0008 -#define TVHT_ONITEMBUTTON 0x0010 -#define TVHT_ONITEMRIGHT 0x0020 -#define TVHT_ONITEMSTATEICON 0x0040 -#define TVHT_ONITEM 0x0046 -#define TVHT_ABOVE 0x0100 -#define TVHT_BELOW 0x0200 -#define TVHT_TORIGHT 0x0400 -#define TVHT_TOLEFT 0x0800 - -#define TVS_HASBUTTONS 0x0001 -#define TVS_HASLINES 0x0002 -#define TVS_LINESATROOT 0x0004 -#define TVS_EDITLABELS 0x0008 -#define TVS_DISABLEDRAGDROP 0x0010 -#define TVS_SHOWSELALWAYS 0x0020 -#define TVS_RTLREADING 0x0040 -#define TVS_NOTOOLTIPS 0x0080 -#define TVS_CHECKBOXES 0x0100 -#define TVS_TRACKSELECT 0x0200 -#define TVS_SINGLEEXPAND 0x0400 -#define TVS_INFOTIP 0x0800 -#define TVS_FULLROWSELECT 0x1000 -#define TVS_NOSCROLL 0x2000 -#define TVS_NONEVENHEIGHT 0x4000 -#define TVS_NOHSCROLL 0x8000 - -#define TVS_SHAREDIMAGELISTS 0x0000 -#define TVS_PRIVATEIMAGELISTS 0x0400 - - -#define TVE_COLLAPSE 0x0001 -#define TVE_EXPAND 0x0002 -#define TVE_TOGGLE 0x0003 -#define TVE_EXPANDPARTIAL 0x4000 -#define TVE_COLLAPSERESET 0x8000 - -#define TVGN_ROOT 0 -#define TVGN_NEXT 1 -#define TVGN_PREVIOUS 2 -#define TVGN_PARENT 3 -#define TVGN_CHILD 4 -#define TVGN_FIRSTVISIBLE 5 -#define TVGN_NEXTVISIBLE 6 -#define TVGN_PREVIOUSVISIBLE 7 -#define TVGN_DROPHILITE 8 -#define TVGN_CARET 9 -#define TVGN_LASTVISIBLE 10 -#define TVSI_NOSINGLEEXPAND 0x8000 - -#define TVC_UNKNOWN 0x00 -#define TVC_BYMOUSE 0x01 -#define TVC_BYKEYBOARD 0x02 - - -typedef struct _TREEITEM *HTREEITEM; - -typedef struct { - UINT mask; - HTREEITEM hItem; - UINT state; - UINT stateMask; - LPSTR pszText; - INT cchTextMax; - INT iImage; - INT iSelectedImage; - INT cChildren; - LPARAM lParam; -} TVITEMA, *LPTVITEMA; - -typedef struct { - UINT mask; - HTREEITEM hItem; - UINT state; - UINT stateMask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - INT iSelectedImage; - INT cChildren; - LPARAM lParam; -} TVITEMW, *LPTVITEMW; - -#define TV_ITEMA TVITEMA -#define TV_ITEMW TVITEMW -#define LPTV_ITEMA LPTVITEMA -#define LPTV_ITEMW LPTVITEMW - -#define TVITEM WINELIB_NAME_AW(TVITEM) -#define LPTVITEM WINELIB_NAME_AW(LPTVITEM) -#define TV_ITEM WINELIB_NAME_AW(TV_ITEM) -#define LPTV_ITEM WINELIB_NAME_AW(LPTV_ITEM) - -typedef struct { - UINT mask; - HTREEITEM hItem; - UINT state; - UINT stateMask; - LPSTR pszText; - INT cchTextMax; - INT iImage; - INT iSelectedImage; - INT cChildren; - LPARAM lParam; - INT iIntegral; - UINT uStateEx; /* _WIN32_IE >= 0x600 */ - HWND hwnd; /* _WIN32_IE >= 0x600 */ - INT iExpandedImage; /* _WIN32_IE >= 0x600 */ -} TVITEMEXA, *LPTVITEMEXA; - -typedef struct { - UINT mask; - HTREEITEM hItem; - UINT state; - UINT stateMask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - INT iSelectedImage; - INT cChildren; - LPARAM lParam; - INT iIntegral; - UINT uStateEx; /* _WIN32_IE >= 0x600 */ - HWND hwnd; /* _WIN32_IE >= 0x600 */ - INT iExpandedImage; /* _WIN32_IE >= 0x600 */ -} TVITEMEXW, *LPTVITEMEXW; - -#define TVITEMEX WINELIB_NAME_AW(TVITEMEX) -#define LPTVITEMEX WINELIB_NAME_AW(LPTVITEMEX) - -typedef struct tagTVINSERTSTRUCTA { - HTREEITEM hParent; - HTREEITEM hInsertAfter; - union { - TVITEMEXA itemex; - TVITEMA item; - } DUMMYUNIONNAME; -} TVINSERTSTRUCTA, *LPTVINSERTSTRUCTA; - -typedef struct tagTVINSERTSTRUCTW { - HTREEITEM hParent; - HTREEITEM hInsertAfter; - union { - TVITEMEXW itemex; - TVITEMW item; - } DUMMYUNIONNAME; -} TVINSERTSTRUCTW, *LPTVINSERTSTRUCTW; - -#define TVINSERTSTRUCT WINELIB_NAME_AW(TVINSERTSTRUCT) -#define LPTVINSERTSTRUCT WINELIB_NAME_AW(LPTVINSERTSTRUCT) - -#define TVINSERTSTRUCT_V1_SIZEA CCSIZEOF_STRUCT(TVINSERTSTRUCTA, item) -#define TVINSERTSTRUCT_V1_SIZEW CCSIZEOF_STRUCT(TVINSERTSTRUCTW, item) -#define TVINSERTSTRUCT_V1_SIZE WINELIB_NAME_AW(TVINSERTSTRUCT_V1_SIZE) - -#define TV_INSERTSTRUCT TVINSERTSTRUCT -#define TV_INSERTSTRUCTA TVINSERTSTRUCTA -#define TV_INSERTSTRUCTW TVINSERTSTRUCTW -#define LPTV_INSERTSTRUCT LPTVINSERTSTRUCT -#define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA -#define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW - - - -typedef struct tagNMTREEVIEWA { - NMHDR hdr; - UINT action; - TVITEMA itemOld; - TVITEMA itemNew; - POINT ptDrag; -} NMTREEVIEWA, *LPNMTREEVIEWA; - -typedef struct tagNMTREEVIEWW { - NMHDR hdr; - UINT action; - TVITEMW itemOld; - TVITEMW itemNew; - POINT ptDrag; -} NMTREEVIEWW, *LPNMTREEVIEWW; - -#define NMTREEVIEW WINELIB_NAME_AW(NMTREEVIEW) -#define NM_TREEVIEW WINELIB_NAME_AW(NMTREEVIEW) -#define NM_TREEVIEWA NMTREEVIEWA -#define NM_TREEVIEWW NMTREEVIEWW -#define LPNMTREEVIEW WINELIB_NAME_AW(LPNMTREEVIEW) - -#define LPNM_TREEVIEW LPNMTREEVIEW -#define LPNM_TREEVIEWA LPNMTREEVIEWA -#define LPNM_TREEVIEWW LPNMTREEVIEWW - -typedef struct tagTVDISPINFOA { - NMHDR hdr; - TVITEMA item; -} NMTVDISPINFOA, *LPNMTVDISPINFOA; - -typedef struct tagTVDISPINFOW { - NMHDR hdr; - TVITEMW item; -} NMTVDISPINFOW, *LPNMTVDISPINFOW; - -typedef struct tagTVDISPINFOEXA { - NMHDR hdr; - TVITEMEXA item; -} NMTVDISPINFOEXA, *LPNMTVDISPINFOEXA; - -typedef struct tagTVDISPINFOEXW { - NMHDR hdr; - TVITEMEXW item; -} NMTVDISPINFOEXW, *LPNMTVDISPINFOEXW; - -#define NMTVDISPINFO WINELIB_NAME_AW(NMTVDISPINFO) -#define LPNMTVDISPINFO WINELIB_NAME_AW(LPNMTVDISPINFO) -#define NMTVDISPINFOEX WINELIB_NAME_AW(NMTVDISPINFOEX) -#define LPNMTVDISPINFOEX WINELIB_NAME_AW(LPNMTVDISPINFOEX) -#define TV_DISPINFOA NMTVDISPINFOA -#define TV_DISPINFOW NMTVDISPINFOW -#define TV_DISPINFO NMTVDISPINFO - -typedef INT (CALLBACK *PFNTVCOMPARE)(LPARAM, LPARAM, LPARAM); - -typedef struct tagTVSORTCB -{ - HTREEITEM hParent; - PFNTVCOMPARE lpfnCompare; - LPARAM lParam; -} TVSORTCB, *LPTVSORTCB; - -#define TV_SORTCB TVSORTCB -#define LPTV_SORTCB LPTVSORTCB - -typedef struct tagTVHITTESTINFO { - POINT pt; - UINT flags; - HTREEITEM hItem; -} TVHITTESTINFO, *LPTVHITTESTINFO; - -#define TV_HITTESTINFO TVHITTESTINFO - - -/* Custom Draw Treeview */ - -#define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk) - -#define TVCDRF_NOIMAGES 0x00010000 - -typedef struct tagNMTVCUSTOMDRAW -{ - NMCUSTOMDRAW nmcd; - COLORREF clrText; - COLORREF clrTextBk; - INT iLevel; /* IE>0x0400 */ -} NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW; - -/* Treeview tooltips */ - -typedef struct tagNMTVGETINFOTIPA -{ - NMHDR hdr; - LPSTR pszText; - INT cchTextMax; - HTREEITEM hItem; - LPARAM lParam; -} NMTVGETINFOTIPA, *LPNMTVGETINFOTIPA; - -typedef struct tagNMTVGETINFOTIPW -{ - NMHDR hdr; - LPWSTR pszText; - INT cchTextMax; - HTREEITEM hItem; - LPARAM lParam; -} NMTVGETINFOTIPW, *LPNMTVGETINFOTIPW; - -#define NMTVGETINFOTIP WINELIB_NAME_AW(NMTVGETINFOTIP) -#define LPNMTVGETINFOTIP WINELIB_NAME_AW(LPNMTVGETINFOTIP) - -#include -typedef struct tagTVKEYDOWN -{ - NMHDR hdr; - WORD wVKey; - UINT flags; -} NMTVKEYDOWN, *LPNMTVKEYDOWN; -#include - -#define TV_KEYDOWN NMTVKEYDOWN - -#define TreeView_InsertItemA(hwnd, phdi) \ - (HTREEITEM)SNDMSGA((hwnd), TVM_INSERTITEMA, 0, \ - (LPARAM)(LPTVINSERTSTRUCTA)(phdi)) -#define TreeView_InsertItemW(hwnd,phdi) \ - (HTREEITEM)SNDMSGW((hwnd), TVM_INSERTITEMW, 0, \ - (LPARAM)(LPTVINSERTSTRUCTW)(phdi)) -#define TreeView_InsertItem WINELIB_NAME_AW(TreeView_InsertItem) - -#define TreeView_DeleteItem(hwnd, hItem) \ - (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem)) -#define TreeView_DeleteAllItems(hwnd) \ - (BOOL)SNDMSG((hwnd), TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT) -#define TreeView_Expand(hwnd, hitem, code) \ - (BOOL)SNDMSG((hwnd), TVM_EXPAND, (WPARAM)code, \ - (LPARAM)(HTREEITEM)(hitem)) - -#define TreeView_GetItemRect(hwnd, hitem, prc, code) \ - (*(HTREEITEM *)prc = (hitem), (BOOL)SNDMSG((hwnd), \ - TVM_GETITEMRECT, (WPARAM)(code), (LPARAM)(RECT *)(prc))) - -#define TreeView_GetCount(hwnd) \ - (UINT)SNDMSG((hwnd), TVM_GETCOUNT, 0, 0) -#define TreeView_GetIndent(hwnd) \ - (UINT)SNDMSG((hwnd), TVM_GETINDENT, 0, 0) -#define TreeView_SetIndent(hwnd, indent) \ - (BOOL)SNDMSG((hwnd), TVM_SETINDENT, (WPARAM)indent, 0) - -#define TreeView_GetImageList(hwnd, iImage) \ - (HIMAGELIST)SNDMSG((hwnd), TVM_GETIMAGELIST, iImage, 0) - -#define TreeView_SetImageList(hwnd, himl, iImage) \ - (HIMAGELIST)SNDMSG((hwnd), TVM_SETIMAGELIST, iImage, \ - (LPARAM)(HIMAGELIST)(himl)) - -#define TreeView_GetNextItem(hwnd, hitem, code) \ - (HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)code,\ -(LPARAM)(HTREEITEM) (hitem)) - -#define TreeView_GetChild(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_CHILD) -#define TreeView_GetNextSibling(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_NEXT) -#define TreeView_GetPrevSibling(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUS) -#define TreeView_GetParent(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_PARENT) -#define TreeView_GetFirstVisible(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_FIRSTVISIBLE) -#define TreeView_GetLastVisible(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE) -#define TreeView_GetNextVisible(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_NEXTVISIBLE) -#define TreeView_GetPrevVisible(hwnd, hitem) \ - TreeView_GetNextItem(hwnd, hitem , TVGN_PREVIOUSVISIBLE) -#define TreeView_GetSelection(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_CARET) -#define TreeView_GetDropHilight(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_DROPHILITE) -#define TreeView_GetRoot(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_ROOT) -#define TreeView_GetLastVisible(hwnd) \ - TreeView_GetNextItem(hwnd, NULL, TVGN_LASTVISIBLE) - - -#define TreeView_Select(hwnd, hitem, code) \ - (BOOL)SNDMSG((hwnd), TVM_SELECTITEM, (WPARAM)(code), \ -(LPARAM)(HTREEITEM)(hitem)) - - -#define TreeView_SelectItem(hwnd, hitem) \ - TreeView_Select(hwnd, hitem, TVGN_CARET) -#define TreeView_SelectDropTarget(hwnd, hitem) \ - TreeView_Select(hwnd, hitem, TVGN_DROPHILITE) -#define TreeView_SelectSetFirstVisible(hwnd, hitem) \ - TreeView_Select(hwnd, hitem, TVGN_FIRSTVISIBLE) - - -#define TreeView_GetItemA(hwnd, pitem) \ - (BOOL)SNDMSGA((hwnd), TVM_GETITEMA, 0, (LPARAM) (TVITEMA *)(pitem)) -#define TreeView_GetItemW(hwnd, pitem) \ - (BOOL)SNDMSGW((hwnd), TVM_GETITEMW, 0, (LPARAM) (TVITEMW *)(pitem)) -#define TreeView_GetItem WINELIB_NAME_AW(TreeView_GetItem) - -#define TreeView_SetItemA(hwnd, pitem) \ - (BOOL)SNDMSGA((hwnd), TVM_SETITEMA, 0, (LPARAM)(const TVITEMA *)(pitem)) -#define TreeView_SetItemW(hwnd, pitem) \ - (BOOL)SNDMSGW((hwnd), TVM_SETITEMW, 0, (LPARAM)(const TVITEMW *)(pitem)) -#define TreeView_SetItem WINELIB_NAME_AW(TreeView_SetItem) - -#define TreeView_EditLabel(hwnd, hitem) \ - (HWND)SNDMSG((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem)) - -#define TreeView_GetEditControl(hwnd) \ - (HWND)SNDMSG((hwnd), TVM_GETEDITCONTROL, 0, 0) - -#define TreeView_GetVisibleCount(hwnd) \ - (UINT)SNDMSG((hwnd), TVM_GETVISIBLECOUNT, 0, 0) - -#define TreeView_HitTest(hwnd, lpht) \ - (HTREEITEM)SNDMSG((hwnd), TVM_HITTEST, 0,\ -(LPARAM)(LPTVHITTESTINFO)(lpht)) - -#define TreeView_CreateDragImage(hwnd, hitem) \ - (HIMAGELIST)SNDMSG((hwnd), TVM_CREATEDRAGIMAGE, 0,\ -(LPARAM)(HTREEITEM)(hitem)) - -#define TreeView_SortChildren(hwnd, hitem, recurse) \ - (BOOL)SNDMSG((hwnd), TVM_SORTCHILDREN, (WPARAM)recurse,\ -(LPARAM)(HTREEITEM)(hitem)) - -#define TreeView_EnsureVisible(hwnd, hitem) \ - (BOOL)SNDMSG((hwnd), TVM_ENSUREVISIBLE, 0, (LPARAM)(UINT)(hitem)) - -#define TreeView_SortChildrenCB(hwnd, psort, recurse) \ - (BOOL)SNDMSG((hwnd), TVM_SORTCHILDRENCB, (WPARAM)recurse, \ - (LPARAM)(LPTV_SORTCB)(psort)) - -#define TreeView_EndEditLabelNow(hwnd, fCancel) \ - (BOOL)SNDMSG((hwnd), TVM_ENDEDITLABELNOW, (WPARAM)fCancel, 0) - -#define TreeView_GetISearchString(hwnd, lpsz) \ - (BOOL)SNDMSG((hwnd), TVM_GETISEARCHSTRING, 0, \ - (LPARAM)(LPTSTR)lpsz) - -#define TreeView_SetToolTips(hwnd, hwndTT) \ - (HWND)SNDMSG((hwnd), TVM_SETTOOLTIPS, (WPARAM)(hwndTT), 0) - -#define TreeView_GetToolTips(hwnd) \ - (HWND)SNDMSG((hwnd), TVM_GETTOOLTIPS, 0, 0) - -#define TreeView_SetItemHeight(hwnd, iHeight) \ - (INT)SNDMSG((hwnd), TVM_SETITEMHEIGHT, (WPARAM)iHeight, 0) - -#define TreeView_GetItemHeight(hwnd) \ - (INT)SNDMSG((hwnd), TVM_GETITEMHEIGHT, 0, 0) - -#define TreeView_SetBkColor(hwnd, clr) \ - (COLORREF)SNDMSG((hwnd), TVM_SETBKCOLOR, 0, (LPARAM)clr) - -#define TreeView_SetTextColor(hwnd, clr) \ - (COLORREF)SNDMSG((hwnd), TVM_SETTEXTCOLOR, 0, (LPARAM)clr) - -#define TreeView_GetBkColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), TVM_GETBKCOLOR, 0, 0) - -#define TreeView_GetTextColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), TVM_GETTEXTCOLOR, 0, 0) - -#define TreeView_SetScrollTime(hwnd, uTime) \ - (UINT)SNDMSG((hwnd), TVM_SETSCROLLTIME, uTime, 0) - -#define TreeView_GetScrollTime(hwnd) \ - (UINT)SNDMSG((hwnd), TVM_GETSCROLLTIME, 0, 0) - -#define TreeView_SetInsertMark(hwnd, hItem, fAfter) \ - (BOOL)SNDMSG((hwnd), TVM_SETINSERTMARK, (WPARAM)(fAfter), \ - (LPARAM) (hItem)) - -#define TreeView_SetInsertMarkColor(hwnd, clr) \ - (COLORREF)SNDMSG((hwnd), TVM_SETINSERTMARKCOLOR, 0, (LPARAM)clr) - -#define TreeView_GetInsertMarkColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), TVM_GETINSERTMARKCOLOR, 0, 0) - -#define TreeView_SetItemState(hwndTV, hti, data, _mask) \ -{ TVITEM _TVi; \ - _TVi.mask = TVIF_STATE; \ - _TVi.hItem = hti; \ - _TVi.stateMask = _mask; \ - _TVi.state = data; \ - SNDMSG((hwndTV), TVM_SETITEM, 0, (LPARAM)&_TVi); \ -} - -#define TreeView_GetItemState(hwndTV, hti, mask) \ - (UINT)SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), (LPARAM)(mask)) -#define TreeView_GetCheckState(hwndTV, hti) \ - ((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), \ - TVIS_STATEIMAGEMASK))) >> 12) -1) - -#define TreeView_SetLineColor(hwnd, clr) \ - (COLORREF)SNDMSG((hwnd), TVM_SETLINECOLOR, 0, (LPARAM)(clr)) - -#define TreeView_GetLineColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), TVM_GETLINECOLOR, 0, 0) - -#define TreeView_MapAccIDToHTREEITEM(hwnd, id) \ - (HTREEITEM)SNDMSG((hwnd), TVM_MAPACCIDTOHTREEITEM, id, 0) - -#define TreeView_MapHTREEITEMToAccID(hwnd, htreeitem) \ - (UINT)SNDMSG((hwnd), TVM_MAPHTREEITEMTOACCID, (WPARAM)htreeitem, 0) - -#define TreeView_SetUnicodeFormat(hwnd, fUnicode) \ - (BOOL)SNDMSG((hwnd), TVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0) -#define TreeView_GetUnicodeFormat(hwnd) \ - (BOOL)SNDMSG((hwnd), TVM_GETUNICODEFORMAT, 0, 0) - -/* Listview control */ - -#define WC_LISTVIEWA "SysListView32" -#if defined(__GNUC__) -# define WC_LISTVIEWW (const WCHAR []){ 'S','y','s', \ - 'L','i','s','t','V','i','e','w','3','2',0 } -#elif defined(_MSC_VER) -# define WC_LISTVIEWW L"SysListView32" +#ifdef UNICODE +#define CreateStatusWindow CreateStatusWindowW +#define DrawStatusText DrawStatusTextW #else -static const WCHAR WC_LISTVIEWW[] = { 'S','y','s', - 'L','i','s','t','V','i','e','w','3','2',0 }; +#define CreateStatusWindow CreateStatusWindowA +#define DrawStatusText DrawStatusTextA #endif -#define WC_LISTVIEW WINELIB_NAME_AW(WC_LISTVIEW) -#define LVSCW_AUTOSIZE -1 -#define LVSCW_AUTOSIZE_USEHEADER -2 +#define STATUSCLASSNAMEW L"msctls_statusbar32" +#define STATUSCLASSNAMEA "msctls_statusbar32" +#ifdef UNICODE +#define STATUSCLASSNAME STATUSCLASSNAMEW +#else +#define STATUSCLASSNAME STATUSCLASSNAMEA +#endif -#define LVS_ICON 0x0000 -#define LVS_REPORT 0x0001 -#define LVS_SMALLICON 0x0002 -#define LVS_LIST 0x0003 -#define LVS_TYPEMASK 0x0003 -#define LVS_SINGLESEL 0x0004 -#define LVS_SHOWSELALWAYS 0x0008 -#define LVS_SORTASCENDING 0x0010 -#define LVS_SORTDESCENDING 0x0020 -#define LVS_SHAREIMAGELISTS 0x0040 -#define LVS_NOLABELWRAP 0x0080 -#define LVS_AUTOARRANGE 0x0100 -#define LVS_EDITLABELS 0x0200 -#define LVS_OWNERDATA 0x1000 -#define LVS_NOSCROLL 0x2000 -#define LVS_TYPESTYLEMASK 0xfc00 -#define LVS_ALIGNTOP 0x0000 -#define LVS_ALIGNLEFT 0x0800 -#define LVS_ALIGNMASK 0x0c00 -#define LVS_OWNERDRAWFIXED 0x0400 -#define LVS_NOCOLUMNHEADER 0x4000 -#define LVS_NOSORTHEADER 0x8000 +#define SB_SETTEXTA (WM_USER+1) +#define SB_SETTEXTW (WM_USER+11) +#define SB_GETTEXTA (WM_USER+2) +#define SB_GETTEXTW (WM_USER+13) +#define SB_GETTEXTLENGTHA (WM_USER+3) +#define SB_GETTEXTLENGTHW (WM_USER+12) -#define LVS_EX_GRIDLINES 0x0001 -#define LVS_EX_SUBITEMIMAGES 0x0002 -#define LVS_EX_CHECKBOXES 0x0004 -#define LVS_EX_TRACKSELECT 0x0008 -#define LVS_EX_HEADERDRAGDROP 0x0010 -#define LVS_EX_FULLROWSELECT 0x0020 -#define LVS_EX_ONECLICKACTIVATE 0x0040 -#define LVS_EX_TWOCLICKACTIVATE 0x0080 -#define LVS_EX_FLATSB 0x0100 -#define LVS_EX_REGIONAL 0x0200 -#define LVS_EX_INFOTIP 0x0400 -#define LVS_EX_UNDERLINEHOT 0x0800 -#define LVS_EX_UNDERLINECOLD 0x1000 -#define LVS_EX_MULTIWORKAREAS 0x2000 -#define LVS_EX_LABELTIP 0x4000 -#define LVS_EX_BORDERSELECT 0x8000 -#define LVS_EX_DOUBLEBUFFER 0x00010000 -#define LVS_EX_HIDELABELS 0x00020000 -#define LVS_EX_SINGLEROW 0x00040000 -#define LVS_EX_SNAPTOGRID 0x00080000 -#define LVS_EX_SIMPLESELECT 0x00100000 -#define LVS_EX_JUSTIFYCOLUMNS 0x00200000 -#define LVS_EX_TRANSPARENTBKGND 0x00400000 -#define LVS_EX_TRANSPARENTSHADOWTEXT 0x00800000 -#define LVS_EX_AUTOAUTOARRANGE 0x01000000 -#define LVS_EX_HEADERINALLVIEWS 0x02000000 -#define LVS_EX_AUTOCHECKSELECT 0x08000000 -#define LVS_EX_AUTOSIZECOLUMNS 0x10000000 -#define LVS_EX_COLUMNSNAPPOINTS 0x40000000 -#define LVS_EX_COLUMNOVERFLOW 0x80000000 +#ifdef UNICODE +#define SB_GETTEXT SB_GETTEXTW +#define SB_SETTEXT SB_SETTEXTW +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHW +#define SB_SETTIPTEXT SB_SETTIPTEXTW +#define SB_GETTIPTEXT SB_GETTIPTEXTW +#else +#define SB_GETTEXT SB_GETTEXTA +#define SB_SETTEXT SB_SETTEXTA +#define SB_GETTEXTLENGTH SB_GETTEXTLENGTHA +#define SB_SETTIPTEXT SB_SETTIPTEXTA +#define SB_GETTIPTEXT SB_GETTIPTEXTA +#endif -#define LVCF_FMT 0x0001 -#define LVCF_WIDTH 0x0002 -#define LVCF_TEXT 0x0004 -#define LVCF_SUBITEM 0x0008 -#define LVCF_IMAGE 0x0010 -#define LVCF_ORDER 0x0020 -#define LVCF_MINWIDTH 0x0040 +#define SB_SETPARTS (WM_USER+4) +#define SB_GETPARTS (WM_USER+6) +#define SB_GETBORDERS (WM_USER+7) +#define SB_SETMINHEIGHT (WM_USER+8) +#define SB_SIMPLE (WM_USER+9) +#define SB_GETRECT (WM_USER+10) +#define SB_ISSIMPLE (WM_USER+14) +#define SB_SETICON (WM_USER+15) +#define SB_SETTIPTEXTA (WM_USER+16) +#define SB_SETTIPTEXTW (WM_USER+17) +#define SB_GETTIPTEXTA (WM_USER+18) +#define SB_GETTIPTEXTW (WM_USER+19) +#define SB_GETICON (WM_USER+20) +#define SB_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define SB_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define LVCFMT_LEFT 0x0000 -#define LVCFMT_RIGHT 0x0001 -#define LVCFMT_CENTER 0x0002 -#define LVCFMT_JUSTIFYMASK 0x0003 -#define LVCFMT_FIXED_WIDTH 0x0100 -#define LVCFMT_IMAGE 0x0800 -#define LVCFMT_BITMAP_ON_RIGHT 0x1000 -#define LVCFMT_COL_HAS_IMAGES 0x8000 -#define LVCFMT_NO_DPI_SCALE 0x00040000 -#define LVCFMT_FIXED_RATIO 0x00080000 -#define LVCFMT_LINE_BREAK 0x00100000 -#define LVCFMT_FILL 0x00200000 -#define LVCFMT_WRAP 0x00400000 -#define LVCFMT_NO_TITLE 0x00800000 -#define LVCFMT_SPLIT_BUTTON 0x01000000 -#define LVCFMT_TILE_PLACEMENTMASK (LVCFMT_LINE_BREAK | LVCFMT_FILL) +#define SBT_OWNERDRAW 0x1000 +#define SBT_NOBORDERS 0x100 +#define SBT_POPOUT 0x200 +#define SBT_RTLREADING 0x400 +#define SBT_NOTABPARSING 0x800 -#define LVSIL_NORMAL 0 -#define LVSIL_SMALL 1 -#define LVSIL_STATE 2 -#define LVSIL_GROUPHEADER 3 +#define SB_SETBKCOLOR CCM_SETBKCOLOR -/* following 2 flags only for LVS_OWNERDATA listviews */ -/* and only in report or list mode */ -#define LVSICF_NOINVALIDATEALL 0x0001 -#define LVSICF_NOSCROLL 0x0002 +#define SBN_SIMPLEMODECHANGE (SBN_FIRST - 0) + +#define SB_SIMPLEID 0xff +#endif + +#ifndef NOMENUHELP + + WINCOMMCTRLAPI void WINAPI MenuHelp(UINT uMsg,WPARAM wParam,LPARAM lParam,HMENU hMainMenu,HINSTANCE hInst,HWND hwndStatus,UINT *lpwIDs); + WINCOMMCTRLAPI WINBOOL WINAPI ShowHideMenuCtl(HWND hWnd,UINT_PTR uFlags,LPINT lpInfo); + WINCOMMCTRLAPI void WINAPI GetEffectiveClientRect(HWND hWnd,LPRECT lprc,const INT *lpInfo); + +#define MINSYSCOMMAND SC_SIZE +#endif + +#ifndef NOTRACKBAR + +#define TRACKBAR_CLASSA "msctls_trackbar32" +#define TRACKBAR_CLASSW L"msctls_trackbar32" +#ifdef UNICODE +#define TRACKBAR_CLASS TRACKBAR_CLASSW +#else +#define TRACKBAR_CLASS TRACKBAR_CLASSA +#endif + +#define TBS_AUTOTICKS 0x1 +#define TBS_VERT 0x2 +#define TBS_HORZ 0x0 +#define TBS_TOP 0x4 +#define TBS_BOTTOM 0x0 +#define TBS_LEFT 0x4 +#define TBS_RIGHT 0x0 +#define TBS_BOTH 0x8 +#define TBS_NOTICKS 0x10 +#define TBS_ENABLESELRANGE 0x20 +#define TBS_FIXEDLENGTH 0x40 +#define TBS_NOTHUMB 0x80 +#define TBS_TOOLTIPS 0x100 +#define TBS_REVERSED 0x200 +#define TBS_DOWNISLEFT 0x400 + +#define TBM_GETPOS (WM_USER) +#define TBM_GETRANGEMIN (WM_USER+1) +#define TBM_GETRANGEMAX (WM_USER+2) +#define TBM_GETTIC (WM_USER+3) +#define TBM_SETTIC (WM_USER+4) +#define TBM_SETPOS (WM_USER+5) +#define TBM_SETRANGE (WM_USER+6) +#define TBM_SETRANGEMIN (WM_USER+7) +#define TBM_SETRANGEMAX (WM_USER+8) +#define TBM_CLEARTICS (WM_USER+9) +#define TBM_SETSEL (WM_USER+10) +#define TBM_SETSELSTART (WM_USER+11) +#define TBM_SETSELEND (WM_USER+12) +#define TBM_GETPTICS (WM_USER+14) +#define TBM_GETTICPOS (WM_USER+15) +#define TBM_GETNUMTICS (WM_USER+16) +#define TBM_GETSELSTART (WM_USER+17) +#define TBM_GETSELEND (WM_USER+18) +#define TBM_CLEARSEL (WM_USER+19) +#define TBM_SETTICFREQ (WM_USER+20) +#define TBM_SETPAGESIZE (WM_USER+21) +#define TBM_GETPAGESIZE (WM_USER+22) +#define TBM_SETLINESIZE (WM_USER+23) +#define TBM_GETLINESIZE (WM_USER+24) +#define TBM_GETTHUMBRECT (WM_USER+25) +#define TBM_GETCHANNELRECT (WM_USER+26) +#define TBM_SETTHUMBLENGTH (WM_USER+27) +#define TBM_GETTHUMBLENGTH (WM_USER+28) +#define TBM_SETTOOLTIPS (WM_USER+29) +#define TBM_GETTOOLTIPS (WM_USER+30) +#define TBM_SETTIPSIDE (WM_USER+31) + +#define TBTS_TOP 0 +#define TBTS_LEFT 1 +#define TBTS_BOTTOM 2 +#define TBTS_RIGHT 3 + +#define TBM_SETBUDDY (WM_USER+32) +#define TBM_GETBUDDY (WM_USER+33) +#define TBM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TBM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT + +#define TB_LINEUP 0 +#define TB_LINEDOWN 1 +#define TB_PAGEUP 2 +#define TB_PAGEDOWN 3 +#define TB_THUMBPOSITION 4 +#define TB_THUMBTRACK 5 +#define TB_TOP 6 +#define TB_BOTTOM 7 +#define TB_ENDTRACK 8 + +#define TBCD_TICS 0x1 +#define TBCD_THUMB 0x2 +#define TBCD_CHANNEL 0x3 +#endif + +#ifndef NODRAGLIST + + typedef struct tagDRAGLISTINFO { + UINT uNotification; + HWND hWnd; + POINT ptCursor; + } DRAGLISTINFO,*LPDRAGLISTINFO; + +#define DL_BEGINDRAG (WM_USER+133) +#define DL_DRAGGING (WM_USER+134) +#define DL_DROPPED (WM_USER+135) +#define DL_CANCELDRAG (WM_USER+136) + +#define DL_CURSORSET 0 +#define DL_STOPCURSOR 1 +#define DL_COPYCURSOR 2 +#define DL_MOVECURSOR 3 + +#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") + + WINCOMMCTRLAPI WINBOOL WINAPI MakeDragList(HWND hLB); + WINCOMMCTRLAPI void WINAPI DrawInsert(HWND handParent,HWND hLB,int nItem); + + WINCOMMCTRLAPI int WINAPI LBItemFromPt(HWND hLB,POINT pt,WINBOOL bAutoScroll); +#endif + +#ifndef NOUPDOWN + +#define UPDOWN_CLASSA "msctls_updown32" +#define UPDOWN_CLASSW L"msctls_updown32" +#ifdef UNICODE +#define UPDOWN_CLASS UPDOWN_CLASSW +#else +#define UPDOWN_CLASS UPDOWN_CLASSA +#endif + + typedef struct _UDACCEL { + UINT nSec; + UINT nInc; + } UDACCEL,*LPUDACCEL; + +#define UD_MAXVAL 0x7fff +#define UD_MINVAL (-UD_MAXVAL) + +#define UDS_WRAP 0x1 +#define UDS_SETBUDDYINT 0x2 +#define UDS_ALIGNRIGHT 0x4 +#define UDS_ALIGNLEFT 0x8 +#define UDS_AUTOBUDDY 0x10 +#define UDS_ARROWKEYS 0x20 +#define UDS_HORZ 0x40 +#define UDS_NOTHOUSANDS 0x80 +#define UDS_HOTTRACK 0x100 + +#define UDM_SETRANGE (WM_USER+101) +#define UDM_GETRANGE (WM_USER+102) +#define UDM_SETPOS (WM_USER+103) +#define UDM_GETPOS (WM_USER+104) +#define UDM_SETBUDDY (WM_USER+105) +#define UDM_GETBUDDY (WM_USER+106) +#define UDM_SETACCEL (WM_USER+107) +#define UDM_GETACCEL (WM_USER+108) +#define UDM_SETBASE (WM_USER+109) +#define UDM_GETBASE (WM_USER+110) +#define UDM_SETRANGE32 (WM_USER+111) +#define UDM_GETRANGE32 (WM_USER+112) +#define UDM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define UDM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define UDM_SETPOS32 (WM_USER+113) +#define UDM_GETPOS32 (WM_USER+114) + + WINCOMMCTRLAPI HWND WINAPI CreateUpDownControl(DWORD dwStyle,int x,int y,int cx,int cy,HWND hParent,int nID,HINSTANCE hInst,HWND hBuddy,int nUpper,int nLower,int nPos); + +#define NM_UPDOWN NMUPDOWN +#define LPNM_UPDOWN LPNMUPDOWN + + typedef struct _NM_UPDOWN { + NMHDR hdr; + int iPos; + int iDelta; + } NMUPDOWN,*LPNMUPDOWN; + +#define UDN_DELTAPOS (UDN_FIRST - 1) +#endif + +#ifndef NOPROGRESS + +#define PROGRESS_CLASSA "msctls_progress32" +#define PROGRESS_CLASSW L"msctls_progress32" +#ifdef UNICODE +#define PROGRESS_CLASS PROGRESS_CLASSW +#else +#define PROGRESS_CLASS PROGRESS_CLASSA +#endif + +#define PBS_SMOOTH 0x1 +#define PBS_VERTICAL 0x4 + +#define PBM_SETRANGE (WM_USER+1) +#define PBM_SETPOS (WM_USER+2) +#define PBM_DELTAPOS (WM_USER+3) +#define PBM_SETSTEP (WM_USER+4) +#define PBM_STEPIT (WM_USER+5) +#define PBM_SETRANGE32 (WM_USER+6) + typedef struct { + int iLow; + int iHigh; + } PBRANGE,*PPBRANGE; +#define PBM_GETRANGE (WM_USER+7) +#define PBM_GETPOS (WM_USER+8) +#define PBM_SETBARCOLOR (WM_USER+9) +#define PBM_SETBKCOLOR CCM_SETBKCOLOR + +#define PBS_MARQUEE 0x8 +#define PBM_SETMARQUEE (WM_USER+10) + +#if (_WIN32_WINNT >= 0x0600) +#define PBM_GETSTEP (WM_USER+13) +#define PBM_GETBKCOLOR (WM_USER+14) +#define PBM_GETBARCOLOR (WM_USER+15) +#define PBM_SETSTATE (WM_USER+16) +#define PBM_GETSTATE (WM_USER+17) +#define PBS_SMOOTHREVERSE 0x10 +#define PBST_NORMAL 1 +#define PBST_ERROR 2 +#define PBST_PAUSED 3 +#endif /* (_WIN32_WINNT >= 0x0600) */ + +#endif /* !NOPROGRESS */ -#define LVFI_PARAM 0x0001 -#define LVFI_STRING 0x0002 -#define LVFI_SUBSTRING 0x0004 -#define LVFI_PARTIAL 0x0008 -#define LVFI_WRAP 0x0020 -#define LVFI_NEARESTXY 0x0040 +#ifndef NOHOTKEY -#define LVIF_TEXT 0x0001 -#define LVIF_IMAGE 0x0002 -#define LVIF_PARAM 0x0004 -#define LVIF_STATE 0x0008 -#define LVIF_INDENT 0x0010 -#define LVIF_GROUPID 0x0100 -#define LVIF_COLUMNS 0x0200 -#define LVIF_NORECOMPUTE 0x0800 -#define LVIF_DI_SETITEM 0x1000 -#define LVIF_COLFMT 0x00010000 +#define HOTKEYF_SHIFT 0x1 +#define HOTKEYF_CONTROL 0x2 +#define HOTKEYF_ALT 0x4 +#define HOTKEYF_EXT 0x8 +#define HKCOMB_NONE 0x1 +#define HKCOMB_S 0x2 +#define HKCOMB_C 0x4 +#define HKCOMB_A 0x8 +#define HKCOMB_SC 0x10 +#define HKCOMB_SA 0x20 +#define HKCOMB_CA 0x40 +#define HKCOMB_SCA 0x80 -#define LVIR_BOUNDS 0x0000 -#define LVIR_ICON 0x0001 -#define LVIR_LABEL 0x0002 -#define LVIR_SELECTBOUNDS 0x0003 +#define HKM_SETHOTKEY (WM_USER+1) +#define HKM_GETHOTKEY (WM_USER+2) +#define HKM_SETRULES (WM_USER+3) -#define LVIS_FOCUSED 0x0001 -#define LVIS_SELECTED 0x0002 -#define LVIS_CUT 0x0004 -#define LVIS_DROPHILITED 0x0008 -#define LVIS_ACTIVATING 0x0020 +#define HOTKEY_CLASSA "msctls_hotkey32" +#define HOTKEY_CLASSW L"msctls_hotkey32" +#ifdef UNICODE +#define HOTKEY_CLASS HOTKEY_CLASSW +#else +#define HOTKEY_CLASS HOTKEY_CLASSA +#endif +#endif -#define LVIS_OVERLAYMASK 0x0F00 -#define LVIS_STATEIMAGEMASK 0xF000 +#define CCS_TOP 0x1L +#define CCS_NOMOVEY 0x2L +#define CCS_BOTTOM 0x3L +#define CCS_NORESIZE 0x4L +#define CCS_NOPARENTALIGN 0x8L +#define CCS_ADJUSTABLE 0x20L +#define CCS_NODIVIDER 0x40L +#define CCS_VERT 0x80L +#define CCS_LEFT (CCS_VERT | CCS_TOP) +#define CCS_RIGHT (CCS_VERT | CCS_BOTTOM) +#define CCS_NOMOVEX (CCS_VERT | CCS_NOMOVEY) -#define LVNI_ALL 0x0000 -#define LVNI_FOCUSED 0x0001 -#define LVNI_SELECTED 0x0002 -#define LVNI_CUT 0x0004 -#define LVNI_DROPHILITED 0x0008 +#ifndef NOLISTVIEW -#define LVNI_ABOVE 0x0100 -#define LVNI_BELOW 0x0200 -#define LVNI_TOLEFT 0x0400 -#define LVNI_TORIGHT 0x0800 +#define WC_LISTVIEWA "SysListView32" +#define WC_LISTVIEWW L"SysListView32" +#ifdef UNICODE +#define WC_LISTVIEW WC_LISTVIEWW +#else +#define WC_LISTVIEW WC_LISTVIEWA +#endif -#define LVHT_NOWHERE 0x0001 -#define LVHT_ONITEMICON 0x0002 -#define LVHT_ONITEMLABEL 0x0004 -#define LVHT_ONITEMSTATEICON 0x0008 -#define LVHT_ONITEM (LVHT_ONITEMICON|LVHT_ONITEMLABEL|LVHT_ONITEMSTATEICON) +#define LVS_ICON 0x0 +#define LVS_REPORT 0x1 +#define LVS_SMALLICON 0x2 +#define LVS_LIST 0x3 +#define LVS_TYPEMASK 0x3 +#define LVS_SINGLESEL 0x4 +#define LVS_SHOWSELALWAYS 0x8 +#define LVS_SORTASCENDING 0x10 +#define LVS_SORTDESCENDING 0x20 +#define LVS_SHAREIMAGELISTS 0x40 +#define LVS_NOLABELWRAP 0x80 +#define LVS_AUTOARRANGE 0x100 +#define LVS_EDITLABELS 0x200 +#define LVS_OWNERDATA 0x1000 +#define LVS_NOSCROLL 0x2000 -#define LVHT_ABOVE 0x0008 -#define LVHT_BELOW 0x0010 -#define LVHT_TORIGHT 0x0020 -#define LVHT_TOLEFT 0x0040 +#define LVS_TYPESTYLEMASK 0xfc00 -#define LV_VIEW_ICON 0x0000 -#define LV_VIEW_DETAILS 0x0001 -#define LV_VIEW_SMALLICON 0x0002 -#define LV_VIEW_LIST 0x0003 -#define LV_VIEW_TILE 0x0004 -#define LV_VIEW_MAX 0x0004 +#define LVS_ALIGNTOP 0x0 +#define LVS_ALIGNLEFT 0x800 +#define LVS_ALIGNMASK 0xc00 -#define LVGF_NONE 0x00000000 -#define LVGF_HEADER 0x00000001 -#define LVGF_FOOTER 0x00000002 -#define LVGF_STATE 0x00000004 -#define LVGF_ALIGN 0x00000008 -#define LVGF_GROUPID 0x00000010 -#define LVGF_SUBTITLE 0x00000100 -#define LVGF_TASK 0x00000200 -#define LVGF_DESCRIPTIONTOP 0x00000400 -#define LVGF_DESCRIPTIONBOTTOM 0x00000800 -#define LVGF_TITLEIMAGE 0x00001000 -#define LVGF_EXTENDEDIMAGE 0x00002000 -#define LVGF_ITEMS 0x00004000 -#define LVGF_SUBSET 0x00008000 -#define LVGF_SUBSETITEMS 0x00010000 +#define LVS_OWNERDRAWFIXED 0x400 +#define LVS_NOCOLUMNHEADER 0x4000 +#define LVS_NOSORTHEADER 0x8000 -#define LVGS_NORMAL 0x00000000 -#define LVGS_COLLAPSED 0x00000001 -#define LVGS_HIDDEN 0x00000002 +#define LVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define ListView_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),LVM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) +#define LVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define ListView_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),LVM_GETUNICODEFORMAT,0,0) +#define LVM_GETBKCOLOR (LVM_FIRST+0) +#define ListView_GetBkColor(hwnd) (COLORREF)SNDMSG((hwnd),LVM_GETBKCOLOR,0,0L) +#define LVM_SETBKCOLOR (LVM_FIRST+1) +#define ListView_SetBkColor(hwnd,clrBk) (WINBOOL)SNDMSG((hwnd),LVM_SETBKCOLOR,0,(LPARAM)(COLORREF)(clrBk)) +#define LVM_GETIMAGELIST (LVM_FIRST+2) +#define ListView_GetImageList(hwnd,iImageList) (HIMAGELIST)SNDMSG((hwnd),LVM_GETIMAGELIST,(WPARAM)(INT)(iImageList),0L) -#define LVGA_HEADER_LEFT 0x00000001 -#define LVGA_HEADER_CENTER 0x00000002 -#define LVGA_HEADER_RIGHT 0x00000004 -#define LVGA_FOOTER_LEFT 0x00000008 -#define LVGA_FOOTER_CENTER 0x00000010 -#define LVGA_FOOTER_RIGHT 0x00000020 +#define LVSIL_NORMAL 0 +#define LVSIL_SMALL 1 +#define LVSIL_STATE 2 -#define LVGMF_NONE 0x00000000 -#define LVGMF_BORDERSIZE 0x00000001 -#define LVGMF_BORDERCOLOR 0x00000002 -#define LVGMF_TEXTCOLOR 0x00000004 +#define LVM_SETIMAGELIST (LVM_FIRST+3) +#define ListView_SetImageList(hwnd,himl,iImageList) (HIMAGELIST)SNDMSG((hwnd),LVM_SETIMAGELIST,(WPARAM)(iImageList),(LPARAM)(HIMAGELIST)(himl)) -#define LVTVIF_AUTOSIZE 0x00000000 -#define LVTVIF_FIXEDWIDTH 0x00000001 -#define LVTVIF_FIXEDHEIGHT 0x00000002 -#define LVTVIF_FIXEDSIZE 0x00000003 -#define LVTVIF_EXTENDED 0x00000004 +#define LVM_GETITEMCOUNT (LVM_FIRST+4) +#define ListView_GetItemCount(hwnd) (int)SNDMSG((hwnd),LVM_GETITEMCOUNT,0,0L) -#define LVTVIM_TILESIZE 0x00000001 -#define LVTVIM_COLUMNS 0x00000002 -#define LVTVIM_LABELMARGIN 0x00000004 +#define LVIF_TEXT 0x1 +#define LVIF_IMAGE 0x2 +#define LVIF_PARAM 0x4 +#define LVIF_STATE 0x8 +#define LVIF_INDENT 0x10 +#define LVIF_NORECOMPUTE 0x800 +#define LVIF_GROUPID 0x100 +#define LVIF_COLUMNS 0x200 -#define LVIM_AFTER 0x00000001 +#define LVIS_FOCUSED 0x1 +#define LVIS_SELECTED 0x2 +#define LVIS_CUT 0x4 +#define LVIS_DROPHILITED 0x8 +#define LVIS_GLOW 0x10 +#define LVIS_ACTIVATING 0x20 -#define LVM_FIRST 0x1000 -#define LVM_GETBKCOLOR (LVM_FIRST+0) -#define LVM_SETBKCOLOR (LVM_FIRST+1) -#define LVM_GETIMAGELIST (LVM_FIRST+2) -#define LVM_SETIMAGELIST (LVM_FIRST+3) -#define LVM_GETITEMCOUNT (LVM_FIRST+4) -#define LVM_GETITEMA (LVM_FIRST+5) -#define LVM_GETITEMW (LVM_FIRST+75) -#define LVM_GETITEM WINELIB_NAME_AW(LVM_GETITEM) -#define LVM_SETITEMA (LVM_FIRST+6) -#define LVM_SETITEMW (LVM_FIRST+76) -#define LVM_SETITEM WINELIB_NAME_AW(LVM_SETITEM) -#define LVM_INSERTITEMA (LVM_FIRST+7) -#define LVM_INSERTITEMW (LVM_FIRST+77) -#define LVM_INSERTITEM WINELIB_NAME_AW(LVM_INSERTITEM) -#define LVM_DELETEITEM (LVM_FIRST+8) -#define LVM_DELETEALLITEMS (LVM_FIRST+9) -#define LVM_GETCALLBACKMASK (LVM_FIRST+10) -#define LVM_SETCALLBACKMASK (LVM_FIRST+11) -#define LVM_GETNEXTITEM (LVM_FIRST+12) -#define LVM_FINDITEMA (LVM_FIRST+13) -#define LVM_FINDITEMW (LVM_FIRST+83) -#define LVM_FINDITEM WINELIB_NAME_AW(LVM_FINDITEM) -#define LVM_GETITEMRECT (LVM_FIRST+14) -#define LVM_SETITEMPOSITION (LVM_FIRST+15) -#define LVM_GETITEMPOSITION (LVM_FIRST+16) -#define LVM_GETSTRINGWIDTHA (LVM_FIRST+17) -#define LVM_GETSTRINGWIDTHW (LVM_FIRST+87) -#define LVM_GETSTRINGWIDTH WINELIB_NAME_AW(LVM_GETSTRINGWIDTH) -#define LVM_HITTEST (LVM_FIRST+18) -#define LVM_ENSUREVISIBLE (LVM_FIRST+19) -#define LVM_SCROLL (LVM_FIRST+20) -#define LVM_REDRAWITEMS (LVM_FIRST+21) -#define LVM_ARRANGE (LVM_FIRST+22) -#define LVM_EDITLABELA (LVM_FIRST+23) -#define LVM_EDITLABELW (LVM_FIRST+118) -#define LVM_EDITLABEL WINELIB_NAME_AW(LVM_EDITLABEL) -#define LVM_GETEDITCONTROL (LVM_FIRST+24) -#define LVM_GETCOLUMNA (LVM_FIRST+25) -#define LVM_GETCOLUMNW (LVM_FIRST+95) -#define LVM_GETCOLUMN WINELIB_NAME_AW(LVM_GETCOLUMN) -#define LVM_SETCOLUMNA (LVM_FIRST+26) -#define LVM_SETCOLUMNW (LVM_FIRST+96) -#define LVM_SETCOLUMN WINELIB_NAME_AW(LVM_SETCOLUMN) -#define LVM_INSERTCOLUMNA (LVM_FIRST+27) -#define LVM_INSERTCOLUMNW (LVM_FIRST+97) -#define LVM_INSERTCOLUMN WINELIB_NAME_AW(LVM_INSERTCOLUMN) -#define LVM_DELETECOLUMN (LVM_FIRST+28) -#define LVM_GETCOLUMNWIDTH (LVM_FIRST+29) -#define LVM_SETCOLUMNWIDTH (LVM_FIRST+30) -#define LVM_GETHEADER (LVM_FIRST+31) +#define LVIS_OVERLAYMASK 0xf00 +#define LVIS_STATEIMAGEMASK 0xF000 -#define LVM_CREATEDRAGIMAGE (LVM_FIRST+33) -#define LVM_GETVIEWRECT (LVM_FIRST+34) -#define LVM_GETTEXTCOLOR (LVM_FIRST+35) -#define LVM_SETTEXTCOLOR (LVM_FIRST+36) -#define LVM_GETTEXTBKCOLOR (LVM_FIRST+37) -#define LVM_SETTEXTBKCOLOR (LVM_FIRST+38) -#define LVM_GETTOPINDEX (LVM_FIRST+39) -#define LVM_GETCOUNTPERPAGE (LVM_FIRST+40) -#define LVM_GETORIGIN (LVM_FIRST+41) -#define LVM_UPDATE (LVM_FIRST+42) -#define LVM_SETITEMSTATE (LVM_FIRST+43) -#define LVM_GETITEMSTATE (LVM_FIRST+44) -#define LVM_GETITEMTEXTA (LVM_FIRST+45) -#define LVM_GETITEMTEXTW (LVM_FIRST+115) -#define LVM_GETITEMTEXT WINELIB_NAME_AW(LVM_GETITEMTEXT) -#define LVM_SETITEMTEXTA (LVM_FIRST+46) -#define LVM_SETITEMTEXTW (LVM_FIRST+116) -#define LVM_SETITEMTEXT WINELIB_NAME_AW(LVM_SETITEMTEXT) -#define LVM_SETITEMCOUNT (LVM_FIRST+47) -#define LVM_SORTITEMS (LVM_FIRST+48) -#define LVM_SORTITEMSEX (LVM_FIRST+81) -#define LVM_SETITEMPOSITION32 (LVM_FIRST+49) -#define LVM_GETSELECTEDCOUNT (LVM_FIRST+50) -#define LVM_GETITEMSPACING (LVM_FIRST+51) -#define LVM_GETISEARCHSTRINGA (LVM_FIRST+52) -#define LVM_GETISEARCHSTRINGW (LVM_FIRST+117) -#define LVM_GETISEARCHSTRING WINELIB_NAME_AW(LVM_GETISEARCHSTRING) -#define LVM_SETICONSPACING (LVM_FIRST+53) -#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54) -#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55) -#define LVM_GETSUBITEMRECT (LVM_FIRST+56) -#define LVM_SUBITEMHITTEST (LVM_FIRST+57) -#define LVM_SETCOLUMNORDERARRAY (LVM_FIRST+58) -#define LVM_GETCOLUMNORDERARRAY (LVM_FIRST+59) -#define LVM_SETHOTITEM (LVM_FIRST+60) -#define LVM_GETHOTITEM (LVM_FIRST+61) -#define LVM_SETHOTCURSOR (LVM_FIRST+62) -#define LVM_GETHOTCURSOR (LVM_FIRST+63) -#define LVM_APPROXIMATEVIEWRECT (LVM_FIRST+64) -#define LVM_SETWORKAREAS (LVM_FIRST+65) -#define LVM_GETSELECTIONMARK (LVM_FIRST+66) -#define LVM_SETSELECTIONMARK (LVM_FIRST+67) -#define LVM_SETBKIMAGEA (LVM_FIRST+68) -#define LVM_SETBKIMAGEW (LVM_FIRST+138) -#define LVM_SETBKIMAGE WINELIB_NAME_AW(LVM_SETBKIMAGE) -#define LVM_GETBKIMAGEA (LVM_FIRST+69) -#define LVM_GETBKIMAGEW (LVM_FIRST+139) -#define LVM_GETBKIMAGE WINELIB_NAME_AW(LVM_GETBKIMAGE) -#define LVM_GETWORKAREAS (LVM_FIRST+70) -#define LVM_SETHOVERTIME (LVM_FIRST+71) -#define LVM_GETHOVERTIME (LVM_FIRST+72) -#define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST+73) -#define LVM_SETTOOLTIPS (LVM_FIRST+74) -#define LVM_GETTOOLTIPS (LVM_FIRST+78) -#define LVM_GETUNICODEFORMAT (CCM_GETUNICODEFORMAT) -#define LVM_SETUNICODEFORMAT (CCM_SETUNICODEFORMAT) -#define LVM_SETSELECTEDCOLUMN (LVM_FIRST + 140) -#define LVM_SETTILEWIDTH (LVM_FIRST + 141) -#define LVM_SETVIEW (LVM_FIRST + 142) -#define LVM_GETVIEW (LVM_FIRST + 143) -#define LVM_INSERTGROUP (LVM_FIRST + 145) -#define LVM_SETGROUPINFO (LVM_FIRST + 147) -#define LVM_GETGROUPINFO (LVM_FIRST + 149) -#define LVM_REMOVEGROUP (LVM_FIRST + 150) -#define LVM_MOVEGROUP (LVM_FIRST + 151) -#define LVM_MOVEITEMTOGROUP (LVM_FIRST + 154) -#define LVM_SETGROUPMETRICS (LVM_FIRST + 155) -#define LVM_GETGROUPMETRICS (LVM_FIRST + 156) -#define LVM_ENABLEGROUPVIEW (LVM_FIRST + 157) -#define LVM_SORTGROUPS (LVM_FIRST + 158) -#define LVM_INSERTGROUPSORTED (LVM_FIRST + 159) -#define LVM_REMOVEALLGROUPS (LVM_FIRST + 160) -#define LVM_HASGROUP (LVM_FIRST + 161) -#define LVM_SETTILEVIEWINFO (LVM_FIRST + 162) -#define LVM_GETTILEVIEWINFO (LVM_FIRST + 163) -#define LVM_SETTILEINFO (LVM_FIRST + 164) -#define LVM_GETTILEINFO (LVM_FIRST + 165) -#define LVM_SETINSERTMARK (LVM_FIRST + 166) -#define LVM_GETINSERTMARK (LVM_FIRST + 167) -#define LVM_INSERTMARKHITTEST (LVM_FIRST + 168) -#define LVM_GETINSERTMARKRECT (LVM_FIRST + 169) -#define LVM_SETINSERTMARKCOLOR (LVM_FIRST + 170) -#define LVM_GETINSERTMARKCOLOR (LVM_FIRST + 171) -#define LVM_SETINFOTIP (LVM_FIRST + 173) -#define LVM_GETSELECTEDCOLUMN (LVM_FIRST + 174) -#define LVM_ISGROUPVIEWENABLED (LVM_FIRST + 175) -#define LVM_GETOUTLINECOLOR (LVM_FIRST + 176) -#define LVM_SETOUTLINECOLOR (LVM_FIRST + 177) -#define LVM_CANCELEDITLABEL (LVM_FIRST + 179) -#define LVM_MAPINDEXTOID (LVM_FIRST + 180) -#define LVM_MAPIDTOINDEX (LVM_FIRST + 181) -#define LVM_ISITEMVISIBLE (LVM_FIRST + 182) +#define INDEXTOSTATEIMAGEMASK(i) ((i) << 12) -#define LVN_FIRST (0U-100U) -#define LVN_LAST (0U-199U) -#define LVN_ITEMCHANGING (LVN_FIRST-0) -#define LVN_ITEMCHANGED (LVN_FIRST-1) -#define LVN_INSERTITEM (LVN_FIRST-2) -#define LVN_DELETEITEM (LVN_FIRST-3) -#define LVN_DELETEALLITEMS (LVN_FIRST-4) -#define LVN_BEGINLABELEDITA (LVN_FIRST-5) -#define LVN_BEGINLABELEDITW (LVN_FIRST-75) -#define LVN_BEGINLABELEDIT WINELIB_NAME_AW(LVN_BEGINLABELEDIT) -#define LVN_ENDLABELEDITA (LVN_FIRST-6) -#define LVN_ENDLABELEDITW (LVN_FIRST-76) -#define LVN_ENDLABELEDIT WINELIB_NAME_AW(LVN_ENDLABELEDIT) -#define LVN_COLUMNCLICK (LVN_FIRST-8) -#define LVN_BEGINDRAG (LVN_FIRST-9) -#define LVN_BEGINRDRAG (LVN_FIRST-11) -#define LVN_ODCACHEHINT (LVN_FIRST-13) -#define LVN_ITEMACTIVATE (LVN_FIRST-14) -#define LVN_ODSTATECHANGED (LVN_FIRST-15) -#define LVN_HOTTRACK (LVN_FIRST-21) -#define LVN_ODFINDITEMA (LVN_FIRST-52) -#define LVN_ODFINDITEMW (LVN_FIRST-79) -#define LVN_ODFINDITEM WINELIB_NAME_AW(LVN_ODFINDITEM) -#define LVN_GETDISPINFOA (LVN_FIRST-50) -#define LVN_GETDISPINFOW (LVN_FIRST-77) -#define LVN_GETDISPINFO WINELIB_NAME_AW(LVN_GETDISPINFO) -#define LVN_SETDISPINFOA (LVN_FIRST-51) -#define LVN_SETDISPINFOW (LVN_FIRST-78) -#define LVN_SETDISPINFO WINELIB_NAME_AW(LVN_SETDISPINFO) -#define LVN_KEYDOWN (LVN_FIRST-55) -#define LVN_MARQUEEBEGIN (LVN_FIRST-56) -#define LVN_GETINFOTIPA (LVN_FIRST-57) -#define LVN_GETINFOTIPW (LVN_FIRST-58) -#define LVN_GETINFOTIP WINELIB_NAME_AW(LVN_GETINFOTIP) -#define LVN_INCREMENTALSEARCHA (LVN_FIRST-62) -#define LVN_INCREMENTALSEARCHW (LVN_FIRST-63) -#define LVN_INCREMENTALSEARCH WINELIB_NAME_AW(LVN_INCREMENTALSEARCH) -#define LVN_BEGINSCROLL (LVN_FIRST-80) -#define LVN_ENDSCROLL (LVN_FIRST-81) -#define LVN_LINKCLICK (LVN_FIRST-84) -#define LVN_ASYNCDRAWN (LVN_FIRST-86) -#define LVN_GETEMPTYMARKUP (LVN_FIRST-87) - -/* LVN_INCREMENTALSEARCH return codes */ -#define LVNSCH_DEFAULT -1 -#define LVNSCH_ERROR -2 -#define LVNSCH_IGNORE -3 - -#define LVA_DEFAULT 0x0000 -#define LVA_ALIGNLEFT 0x0001 -#define LVA_ALIGNTOP 0x0002 -#define LVA_SNAPTOGRID 0x0005 - -typedef struct tagLVITEMA -{ - UINT mask; - INT iItem; - INT iSubItem; - UINT state; - UINT stateMask; - LPSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; - /* (_WIN32_IE >= 0x0300) */ - INT iIndent; - /* (_WIN32_IE >= 0x0560) */ - INT iGroupId; - UINT cColumns; - PUINT puColumns; - /* (_WIN32_WINNT >= 0x0600) */ - PINT piColFmt; - INT iGroup; -} LVITEMA, *LPLVITEMA; - -typedef struct tagLVITEMW -{ - UINT mask; - INT iItem; - INT iSubItem; - UINT state; - UINT stateMask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; - /* (_WIN32_IE >= 0x0300) */ - INT iIndent; - /* (_WIN32_IE >= 0x0560) */ - INT iGroupId; - UINT cColumns; - PUINT puColumns; - /* (_WIN32_WINNT >= 0x0600) */ - PINT piColFmt; - INT iGroup; -} LVITEMW, *LPLVITEMW; - -#define LVITEM WINELIB_NAME_AW(LVITEM) -#define LPLVITEM WINELIB_NAME_AW(LPLVITEM) - -#define LVITEM_V1_SIZEA CCSIZEOF_STRUCT(LVITEMA, lParam) -#define LVITEM_V1_SIZEW CCSIZEOF_STRUCT(LVITEMW, lParam) -#define LVITEM_V1_SIZE WINELIB_NAME_AW(LVITEM_V1_SIZE) - -#define LVITEMA_V5_SIZE CCSIZEOF_STRUCT(LVITEMA, puColumns) -#define LVITEMW_V5_SIZE CCSIZEOF_STRUCT(LVITEMW, puColumns) -#define LVITEM_V5_SIZE WINELIB_NAME_AW(LVITEM_V5_SIZE) - -#define LV_ITEM LVITEM +#define I_INDENTCALLBACK (-1) #define LV_ITEMA LVITEMA #define LV_ITEMW LVITEMW -typedef struct LVSETINFOTIP -{ - UINT cbSize; - DWORD dwFlags; - LPWSTR pszText; +#define I_GROUPIDCALLBACK (-1) +#define I_GROUPIDNONE (-2) + +#define LV_ITEM LVITEM + +#define LVITEMA_V1_SIZE CCSIZEOF_STRUCT(LVITEMA,lParam) +#define LVITEMW_V1_SIZE CCSIZEOF_STRUCT(LVITEMW,lParam) + + typedef struct tagLVITEMA { + UINT mask; int iItem; int iSubItem; -} LVSETINFOTIP, *PLVSETINFOTIP; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + int iIndent; + int iGroupId; + UINT cColumns; + PUINT puColumns; + } LVITEMA,*LPLVITEMA; -/* ListView background image structs and constants - For _WIN32_IE version 0x400 and later. */ + typedef struct tagLVITEMW + { + UINT mask; + int iItem; + int iSubItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + int iIndent; + int iGroupId; + UINT cColumns; + PUINT puColumns; + } LVITEMW,*LPLVITEMW; -typedef struct tagLVBKIMAGEA -{ +#ifdef UNICODE +#define LVITEM LVITEMW +#define LPLVITEM LPLVITEMW +#define LVITEM_V1_SIZE LVITEMW_V1_SIZE +#else +#define LVITEM LVITEMA +#define LPLVITEM LPLVITEMA +#define LVITEM_V1_SIZE LVITEMA_V1_SIZE +#endif + +#define LPSTR_TEXTCALLBACKW ((LPWSTR)-1L) +#define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) +#ifdef UNICODE +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKW +#else +#define LPSTR_TEXTCALLBACK LPSTR_TEXTCALLBACKA +#endif + +#define I_IMAGECALLBACK (-1) +#define I_IMAGENONE (-2) +#define I_COLUMNSCALLBACK ((UINT)-1) + +#define LVM_GETITEMA (LVM_FIRST+5) +#define LVM_GETITEMW (LVM_FIRST+75) +#ifdef UNICODE +#define LVM_GETITEM LVM_GETITEMW +#else +#define LVM_GETITEM LVM_GETITEMA +#endif + +#define ListView_GetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),LVM_GETITEM,0,(LPARAM)(LV_ITEM *)(pitem)) + +#define LVM_SETITEMA (LVM_FIRST+6) +#define LVM_SETITEMW (LVM_FIRST+76) +#ifdef UNICODE +#define LVM_SETITEM LVM_SETITEMW +#else +#define LVM_SETITEM LVM_SETITEMA +#endif + +#define ListView_SetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),LVM_SETITEM,0,(LPARAM)(const LV_ITEM *)(pitem)) + +#define LVM_INSERTITEMA (LVM_FIRST+7) +#define LVM_INSERTITEMW (LVM_FIRST+77) +#ifdef UNICODE +#define LVM_INSERTITEM LVM_INSERTITEMW +#else +#define LVM_INSERTITEM LVM_INSERTITEMA +#endif +#define ListView_InsertItem(hwnd,pitem) (int)SNDMSG((hwnd),LVM_INSERTITEM,0,(LPARAM)(const LV_ITEM *)(pitem)) + +#define LVM_DELETEITEM (LVM_FIRST+8) +#define ListView_DeleteItem(hwnd,i) (WINBOOL)SNDMSG((hwnd),LVM_DELETEITEM,(WPARAM)(int)(i),0L) + +#define LVM_DELETEALLITEMS (LVM_FIRST+9) +#define ListView_DeleteAllItems(hwnd) (WINBOOL)SNDMSG((hwnd),LVM_DELETEALLITEMS,0,0L) + +#define LVM_GETCALLBACKMASK (LVM_FIRST+10) +#define ListView_GetCallbackMask(hwnd) (WINBOOL)SNDMSG((hwnd),LVM_GETCALLBACKMASK,0,0) + +#define LVM_SETCALLBACKMASK (LVM_FIRST+11) +#define ListView_SetCallbackMask(hwnd,mask) (WINBOOL)SNDMSG((hwnd),LVM_SETCALLBACKMASK,(WPARAM)(UINT)(mask),0) + +#define LVNI_ALL 0x0 +#define LVNI_FOCUSED 0x1 +#define LVNI_SELECTED 0x2 +#define LVNI_CUT 0x4 +#define LVNI_DROPHILITED 0x8 + +#define LVNI_ABOVE 0x100 +#define LVNI_BELOW 0x200 +#define LVNI_TOLEFT 0x400 +#define LVNI_TORIGHT 0x800 + +#define LVM_GETNEXTITEM (LVM_FIRST+12) +#define ListView_GetNextItem(hwnd,i,flags) (int)SNDMSG((hwnd),LVM_GETNEXTITEM,(WPARAM)(int)(i),MAKELPARAM((flags),0)) + +#define LVFI_PARAM 0x1 +#define LVFI_STRING 0x2 +#define LVFI_PARTIAL 0x8 +#define LVFI_WRAP 0x20 +#define LVFI_NEARESTXY 0x40 + +#define LV_FINDINFOA LVFINDINFOA +#define LV_FINDINFOW LVFINDINFOW +#define LV_FINDINFO LVFINDINFO + + typedef struct tagLVFINDINFOA { + UINT flags; + LPCSTR psz; + LPARAM lParam; + POINT pt; + UINT vkDirection; + } LVFINDINFOA,*LPFINDINFOA; + + typedef struct tagLVFINDINFOW { + UINT flags; + LPCWSTR psz; + LPARAM lParam; + POINT pt; + UINT vkDirection; + } LVFINDINFOW,*LPFINDINFOW; + +#ifdef UNICODE +#define LVFINDINFO LVFINDINFOW +#else +#define LVFINDINFO LVFINDINFOA +#endif + +#define LVM_FINDITEMA (LVM_FIRST+13) +#define LVM_FINDITEMW (LVM_FIRST+83) +#ifdef UNICODE +#define LVM_FINDITEM LVM_FINDITEMW +#else +#define LVM_FINDITEM LVM_FINDITEMA +#endif + +#define ListView_FindItem(hwnd,iStart,plvfi) (int)SNDMSG((hwnd),LVM_FINDITEM,(WPARAM)(int)(iStart),(LPARAM)(const LV_FINDINFO *)(plvfi)) + +#define LVIR_BOUNDS 0 +#define LVIR_ICON 1 +#define LVIR_LABEL 2 +#define LVIR_SELECTBOUNDS 3 + +#define LVM_GETITEMRECT (LVM_FIRST+14) +#define ListView_GetItemRect(hwnd,i,prc,code) (WINBOOL)SNDMSG((hwnd),LVM_GETITEMRECT,(WPARAM)(int)(i),((prc) ? (((RECT *)(prc))->left = (code),(LPARAM)(RECT *)(prc)) : (LPARAM)(RECT *)NULL)) + +#define LVM_SETITEMPOSITION (LVM_FIRST+15) +#define ListView_SetItemPosition(hwndLV,i,x,y) (WINBOOL)SNDMSG((hwndLV),LVM_SETITEMPOSITION,(WPARAM)(int)(i),MAKELPARAM((x),(y))) + +#define LVM_GETITEMPOSITION (LVM_FIRST+16) +#define ListView_GetItemPosition(hwndLV,i,ppt) (WINBOOL)SNDMSG((hwndLV),LVM_GETITEMPOSITION,(WPARAM)(int)(i),(LPARAM)(POINT *)(ppt)) + +#define LVM_GETSTRINGWIDTHA (LVM_FIRST+17) +#define LVM_GETSTRINGWIDTHW (LVM_FIRST+87) +#ifdef UNICODE +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHW +#else +#define LVM_GETSTRINGWIDTH LVM_GETSTRINGWIDTHA +#endif + +#define ListView_GetStringWidth(hwndLV,psz) (int)SNDMSG((hwndLV),LVM_GETSTRINGWIDTH,0,(LPARAM)(LPCTSTR)(psz)) + +#define LVHT_NOWHERE 0x1 +#define LVHT_ONITEMICON 0x2 +#define LVHT_ONITEMLABEL 0x4 +#define LVHT_ONITEMSTATEICON 0x8 +#define LVHT_ONITEM (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON) + +#define LVHT_ABOVE 0x8 +#define LVHT_BELOW 0x10 +#define LVHT_TORIGHT 0x20 +#define LVHT_TOLEFT 0x40 + +#define LV_HITTESTINFO LVHITTESTINFO + +#define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO,iItem) + + typedef struct tagLVHITTESTINFO { + POINT pt; + UINT flags; + int iItem; + int iSubItem; + } LVHITTESTINFO,*LPLVHITTESTINFO; + +#define LVM_HITTEST (LVM_FIRST+18) +#define ListView_HitTest(hwndLV,pinfo) (int)SNDMSG((hwndLV),LVM_HITTEST,0,(LPARAM)(LV_HITTESTINFO *)(pinfo)) + +#define LVM_ENSUREVISIBLE (LVM_FIRST+19) +#define ListView_EnsureVisible(hwndLV,i,fPartialOK) (WINBOOL)SNDMSG((hwndLV),LVM_ENSUREVISIBLE,(WPARAM)(int)(i),MAKELPARAM((fPartialOK),0)) + +#define LVM_SCROLL (LVM_FIRST+20) +#define ListView_Scroll(hwndLV,dx,dy) (WINBOOL)SNDMSG((hwndLV),LVM_SCROLL,(WPARAM)(int)(dx),(LPARAM)(int)(dy)) + +#define LVM_REDRAWITEMS (LVM_FIRST+21) +#define ListView_RedrawItems(hwndLV,iFirst,iLast) (WINBOOL)SNDMSG((hwndLV),LVM_REDRAWITEMS,(WPARAM)(int)(iFirst),(LPARAM)(int)(iLast)) + +#define LVA_DEFAULT 0x0 +#define LVA_ALIGNLEFT 0x1 +#define LVA_ALIGNTOP 0x2 +#define LVA_SNAPTOGRID 0x5 + +#define LVM_ARRANGE (LVM_FIRST+22) +#define ListView_Arrange(hwndLV,code) (WINBOOL)SNDMSG((hwndLV),LVM_ARRANGE,(WPARAM)(UINT)(code),0L) + +#define LVM_EDITLABELA (LVM_FIRST+23) +#define LVM_EDITLABELW (LVM_FIRST+118) +#ifdef UNICODE +#define LVM_EDITLABEL LVM_EDITLABELW +#else +#define LVM_EDITLABEL LVM_EDITLABELA +#endif + +#define ListView_EditLabel(hwndLV,i) (HWND)SNDMSG((hwndLV),LVM_EDITLABEL,(WPARAM)(int)(i),0L) + +#define LVM_GETEDITCONTROL (LVM_FIRST+24) +#define ListView_GetEditControl(hwndLV) (HWND)SNDMSG((hwndLV),LVM_GETEDITCONTROL,0,0L) + +#define LV_COLUMNA LVCOLUMNA +#define LV_COLUMNW LVCOLUMNW +#define LV_COLUMN LVCOLUMN + +#define LVCOLUMNA_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNA,iSubItem) +#define LVCOLUMNW_V1_SIZE CCSIZEOF_STRUCT(LVCOLUMNW,iSubItem) + + typedef struct tagLVCOLUMNA { + UINT mask; + int fmt; + int cx; + LPSTR pszText; + int cchTextMax; + int iSubItem; + int iImage; + int iOrder; + } LVCOLUMNA,*LPLVCOLUMNA; + + typedef struct tagLVCOLUMNW { + UINT mask; + int fmt; + int cx; + LPWSTR pszText; + int cchTextMax; + int iSubItem; + #if (_WIN32_IE >= 0x0300) + int iImage; + int iOrder; + #endif + #if (_WIN32_WINNT >= 0x0600) + int cxMin; + int cxDefault; + int cxIdeal; + #endif + } LVCOLUMNW,*LPLVCOLUMNW; + +#ifdef UNICODE +#define LVCOLUMN LVCOLUMNW +#define LPLVCOLUMN LPLVCOLUMNW +#define LVCOLUMN_V1_SIZE LVCOLUMNW_V1_SIZE +#else +#define LVCOLUMN LVCOLUMNA +#define LPLVCOLUMN LPLVCOLUMNA +#define LVCOLUMN_V1_SIZE LVCOLUMNA_V1_SIZE +#endif + +#define LVCF_FMT 0x1 +#define LVCF_WIDTH 0x2 +#define LVCF_TEXT 0x4 +#define LVCF_SUBITEM 0x8 +#define LVCF_IMAGE 0x10 +#define LVCF_ORDER 0x20 +#if (_WIN32_WINNT >= 0x0600) +#define LVCF_MINWIDTH 0x40 +#define LVCF_DEFAULTWIDTH 0x80 +#define LVCF_IDEALWIDTH 0x100 +#endif /* (_WIN32_WINNT >= 0x0600) */ + +#define LVCFMT_LEFT 0x0 +#define LVCFMT_RIGHT 0x1 +#define LVCFMT_CENTER 0x2 +#define LVCFMT_JUSTIFYMASK 0x3 +#define LVCFMT_IMAGE 0x800 +#define LVCFMT_BITMAP_ON_RIGHT 0x1000 +#define LVCFMT_COL_HAS_IMAGES 0x8000 +#if (_WIN32_WINNT >= 0x0600) +#define LVCFMT_FIXED_WIDTH 0x100 +#define LVCFMT_NO_DPI_SCALE 0x40000 +#define LVCFMT_FIXED_RATIO 0x80000 +#define LVCFMT_LINE_BREAK 0x100000 +#define LVCFMT_FILL 0x200000 +#define LVCFMT_WRAP 0x400000 +#define LVCFMT_NO_TITLE 0x800000 +#define LVCFMT_SPLITBUTTON 0x1000000 +#define LVCFMT_TILE_PLACEMENTMASK (LVCFMT_LINE_BREAK|LVCFMT_FILL) +#endif /* (_WIN32_WINNT >= 0x0600) */ + +#define LVM_GETCOLUMNA (LVM_FIRST+25) +#define LVM_GETCOLUMNW (LVM_FIRST+95) +#ifdef UNICODE +#define LVM_GETCOLUMN LVM_GETCOLUMNW +#else +#define LVM_GETCOLUMN LVM_GETCOLUMNA +#endif + +#define ListView_GetColumn(hwnd,iCol,pcol) (WINBOOL)SNDMSG((hwnd),LVM_GETCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(LV_COLUMN *)(pcol)) + +#define LVM_SETCOLUMNA (LVM_FIRST+26) +#define LVM_SETCOLUMNW (LVM_FIRST+96) +#ifdef UNICODE +#define LVM_SETCOLUMN LVM_SETCOLUMNW +#else +#define LVM_SETCOLUMN LVM_SETCOLUMNA +#endif + +#define ListView_SetColumn(hwnd,iCol,pcol) (WINBOOL)SNDMSG((hwnd),LVM_SETCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(const LV_COLUMN *)(pcol)) + +#define LVM_INSERTCOLUMNA (LVM_FIRST+27) +#define LVM_INSERTCOLUMNW (LVM_FIRST+97) +#ifdef UNICODE +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNW +#else +#define LVM_INSERTCOLUMN LVM_INSERTCOLUMNA +#endif + +#define ListView_InsertColumn(hwnd,iCol,pcol) (int)SNDMSG((hwnd),LVM_INSERTCOLUMN,(WPARAM)(int)(iCol),(LPARAM)(const LV_COLUMN *)(pcol)) + +#define LVM_DELETECOLUMN (LVM_FIRST+28) +#define ListView_DeleteColumn(hwnd,iCol) (WINBOOL)SNDMSG((hwnd),LVM_DELETECOLUMN,(WPARAM)(int)(iCol),0) + +#define LVM_GETCOLUMNWIDTH (LVM_FIRST+29) +#define ListView_GetColumnWidth(hwnd,iCol) (int)SNDMSG((hwnd),LVM_GETCOLUMNWIDTH,(WPARAM)(int)(iCol),0) + +#define LVSCW_AUTOSIZE -1 +#define LVSCW_AUTOSIZE_USEHEADER -2 +#define LVM_SETCOLUMNWIDTH (LVM_FIRST+30) + +#define ListView_SetColumnWidth(hwnd,iCol,cx) (WINBOOL)SNDMSG((hwnd),LVM_SETCOLUMNWIDTH,(WPARAM)(int)(iCol),MAKELPARAM((cx),0)) + +#define LVM_GETHEADER (LVM_FIRST+31) +#define ListView_GetHeader(hwnd) (HWND)SNDMSG((hwnd),LVM_GETHEADER,0,0L) +#define LVM_CREATEDRAGIMAGE (LVM_FIRST+33) +#define ListView_CreateDragImage(hwnd,i,lpptUpLeft) (HIMAGELIST)SNDMSG((hwnd),LVM_CREATEDRAGIMAGE,(WPARAM)(int)(i),(LPARAM)(LPPOINT)(lpptUpLeft)) +#define LVM_GETVIEWRECT (LVM_FIRST+34) +#define ListView_GetViewRect(hwnd,prc) (WINBOOL)SNDMSG((hwnd),LVM_GETVIEWRECT,0,(LPARAM)(RECT *)(prc)) +#define LVM_GETTEXTCOLOR (LVM_FIRST+35) +#define ListView_GetTextColor(hwnd) (COLORREF)SNDMSG((hwnd),LVM_GETTEXTCOLOR,0,0L) +#define LVM_SETTEXTCOLOR (LVM_FIRST+36) +#define ListView_SetTextColor(hwnd,clrText) (WINBOOL)SNDMSG((hwnd),LVM_SETTEXTCOLOR,0,(LPARAM)(COLORREF)(clrText)) +#define LVM_GETTEXTBKCOLOR (LVM_FIRST+37) +#define ListView_GetTextBkColor(hwnd) (COLORREF)SNDMSG((hwnd),LVM_GETTEXTBKCOLOR,0,0L) +#define LVM_SETTEXTBKCOLOR (LVM_FIRST+38) +#define ListView_SetTextBkColor(hwnd,clrTextBk) (WINBOOL)SNDMSG((hwnd),LVM_SETTEXTBKCOLOR,0,(LPARAM)(COLORREF)(clrTextBk)) +#define LVM_GETTOPINDEX (LVM_FIRST+39) +#define ListView_GetTopIndex(hwndLV) (int)SNDMSG((hwndLV),LVM_GETTOPINDEX,0,0) +#define LVM_GETCOUNTPERPAGE (LVM_FIRST+40) +#define ListView_GetCountPerPage(hwndLV) (int)SNDMSG((hwndLV),LVM_GETCOUNTPERPAGE,0,0) +#define LVM_GETORIGIN (LVM_FIRST+41) +#define ListView_GetOrigin(hwndLV,ppt) (WINBOOL)SNDMSG((hwndLV),LVM_GETORIGIN,(WPARAM)0,(LPARAM)(POINT *)(ppt)) +#define LVM_UPDATE (LVM_FIRST+42) +#define ListView_Update(hwndLV,i) (WINBOOL)SNDMSG((hwndLV),LVM_UPDATE,(WPARAM)(i),0L) +#define LVM_SETITEMSTATE (LVM_FIRST+43) +#define ListView_SetItemState(hwndLV,i,data,mask) { LV_ITEM _ms_lvi; _ms_lvi.stateMask = mask; _ms_lvi.state = data; SNDMSG((hwndLV),LVM_SETITEMSTATE,(WPARAM)(i),(LPARAM)(LV_ITEM *)&_ms_lvi);} +#define ListView_SetCheckState(hwndLV,i,fCheck) ListView_SetItemState(hwndLV,i,INDEXTOSTATEIMAGEMASK((fCheck)?2:1),LVIS_STATEIMAGEMASK) +#define LVM_GETITEMSTATE (LVM_FIRST+44) +#define ListView_GetItemState(hwndLV,i,mask) (UINT)SNDMSG((hwndLV),LVM_GETITEMSTATE,(WPARAM)(i),(LPARAM)(mask)) +#define ListView_GetCheckState(hwndLV,i) ((((UINT)(SNDMSG((hwndLV),LVM_GETITEMSTATE,(WPARAM)(i),LVIS_STATEIMAGEMASK))) >> 12) -1) + +#define LVM_GETITEMTEXTA (LVM_FIRST+45) +#define LVM_GETITEMTEXTW (LVM_FIRST+115) + +#ifdef UNICODE +#define LVM_GETITEMTEXT LVM_GETITEMTEXTW +#else +#define LVM_GETITEMTEXT LVM_GETITEMTEXTA +#endif + +#define ListView_GetItemText(hwndLV,i,iSubItem_,pszText_,cchTextMax_) { LV_ITEM _ms_lvi; _ms_lvi.iSubItem = iSubItem_; _ms_lvi.cchTextMax = cchTextMax_; _ms_lvi.pszText = pszText_; SNDMSG((hwndLV),LVM_GETITEMTEXT,(WPARAM)(i),(LPARAM)(LV_ITEM *)&_ms_lvi);} + +#define LVM_SETITEMTEXTA (LVM_FIRST+46) +#define LVM_SETITEMTEXTW (LVM_FIRST+116) + +#ifdef UNICODE +#define LVM_SETITEMTEXT LVM_SETITEMTEXTW +#else +#define LVM_SETITEMTEXT LVM_SETITEMTEXTA +#endif + +#define ListView_SetItemText(hwndLV,i,iSubItem_,pszText_) { LV_ITEM _ms_lvi; _ms_lvi.iSubItem = iSubItem_; _ms_lvi.pszText = pszText_; SNDMSG((hwndLV),LVM_SETITEMTEXT,(WPARAM)(i),(LPARAM)(LV_ITEM *)&_ms_lvi);} + +#define LVSICF_NOINVALIDATEALL 0x1 +#define LVSICF_NOSCROLL 0x2 + +#define LVM_SETITEMCOUNT (LVM_FIRST+47) +#define ListView_SetItemCount(hwndLV,cItems) SNDMSG((hwndLV),LVM_SETITEMCOUNT,(WPARAM)(cItems),0) +#define ListView_SetItemCountEx(hwndLV,cItems,dwFlags) SNDMSG((hwndLV),LVM_SETITEMCOUNT,(WPARAM)(cItems),(LPARAM)(dwFlags)) + + typedef int (CALLBACK *PFNLVCOMPARE)(LPARAM,LPARAM,LPARAM); + +#define LVM_SORTITEMS (LVM_FIRST+48) +#define ListView_SortItems(hwndLV,_pfnCompare,_lPrm) (WINBOOL)SNDMSG((hwndLV),LVM_SORTITEMS,(WPARAM)(LPARAM)(_lPrm),(LPARAM)(PFNLVCOMPARE)(_pfnCompare)) + +#define LVM_SETITEMPOSITION32 (LVM_FIRST+49) +#define ListView_SetItemPosition32(hwndLV,i,x0,y0) { POINT ptNewPos; ptNewPos.x = x0; ptNewPos.y = y0; SNDMSG((hwndLV),LVM_SETITEMPOSITION32,(WPARAM)(int)(i),(LPARAM)&ptNewPos); } + +#define LVM_GETSELECTEDCOUNT (LVM_FIRST+50) +#define ListView_GetSelectedCount(hwndLV) (UINT)SNDMSG((hwndLV),LVM_GETSELECTEDCOUNT,0,0L) + +#define LVM_GETITEMSPACING (LVM_FIRST+51) +#define ListView_GetItemSpacing(hwndLV,fSmall) (DWORD)SNDMSG((hwndLV),LVM_GETITEMSPACING,fSmall,0L) + +#define LVM_GETISEARCHSTRINGA (LVM_FIRST+52) +#define LVM_GETISEARCHSTRINGW (LVM_FIRST+117) + +#ifdef UNICODE +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGW +#else +#define LVM_GETISEARCHSTRING LVM_GETISEARCHSTRINGA +#endif + +#define ListView_GetISearchString(hwndLV,lpsz) (WINBOOL)SNDMSG((hwndLV),LVM_GETISEARCHSTRING,0,(LPARAM)(LPTSTR)(lpsz)) + +#define LVM_SETICONSPACING (LVM_FIRST+53) + +#define ListView_SetIconSpacing(hwndLV,cx,cy) (DWORD)SNDMSG((hwndLV),LVM_SETICONSPACING,0,MAKELONG(cx,cy)) +#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54) +#define ListView_SetExtendedListViewStyle(hwndLV,dw) (DWORD)SNDMSG((hwndLV),LVM_SETEXTENDEDLISTVIEWSTYLE,0,dw) +#define ListView_SetExtendedListViewStyleEx(hwndLV,dwMask,dw) (DWORD)SNDMSG((hwndLV),LVM_SETEXTENDEDLISTVIEWSTYLE,dwMask,dw) +#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55) +#define ListView_GetExtendedListViewStyle(hwndLV) (DWORD)SNDMSG((hwndLV),LVM_GETEXTENDEDLISTVIEWSTYLE,0,0) +#define LVS_EX_GRIDLINES 0x1 +#define LVS_EX_SUBITEMIMAGES 0x2 +#define LVS_EX_CHECKBOXES 0x4 +#define LVS_EX_TRACKSELECT 0x8 +#define LVS_EX_HEADERDRAGDROP 0x10 +#define LVS_EX_FULLROWSELECT 0x20 +#define LVS_EX_ONECLICKACTIVATE 0x40 +#define LVS_EX_TWOCLICKACTIVATE 0x80 +#define LVS_EX_FLATSB 0x100 +#define LVS_EX_REGIONAL 0x200 +#define LVS_EX_INFOTIP 0x400 +#define LVS_EX_UNDERLINEHOT 0x800 +#define LVS_EX_UNDERLINECOLD 0x1000 +#define LVS_EX_MULTIWORKAREAS 0x2000 +#define LVS_EX_LABELTIP 0x4000 +#define LVS_EX_BORDERSELECT 0x8000 +#define LVS_EX_DOUBLEBUFFER 0x10000 +#define LVS_EX_HIDELABELS 0x20000 +#define LVS_EX_SINGLEROW 0x40000 +#define LVS_EX_SNAPTOGRID 0x80000 +#define LVS_EX_SIMPLESELECT 0x100000 +#if _WIN32_WINNT >= 0x0600 +#define LVS_EX_JUSTIFYCOLUMNS 0x200000 +#define LVS_EX_TRANSPARENTBKGND 0x400000 +#define LVS_EX_TRANSPARENTSHADOWTEXT 0x800000 +#define LVS_EX_AUTOAUTOARRANGE 0x1000000 +#define LVS_EX_HEADERINALLVIEWS 0x2000000 +#define LVS_EX_AUTOCHECKSELECT 0x8000000 +#define LVS_EX_AUTOSIZECOLUMNS 0x10000000 +#define LVS_EX_COLUMNSNAPPOINTS 0x40000000 +#define LVS_EX_COLUMNOVERFLOW 0x80000000 +#endif + +#define LVM_GETSUBITEMRECT (LVM_FIRST+56) +#define ListView_GetSubItemRect(hwnd,iItem,iSubItem,code,prc) (WINBOOL)SNDMSG((hwnd),LVM_GETSUBITEMRECT,(WPARAM)(int)(iItem),((prc) ? ((((LPRECT)(prc))->top = iSubItem),(((LPRECT)(prc))->left = code),(LPARAM)(prc)) : (LPARAM)(LPRECT)NULL)) +#define LVM_SUBITEMHITTEST (LVM_FIRST+57) +#define ListView_SubItemHitTest(hwnd,plvhti) (int)SNDMSG((hwnd),LVM_SUBITEMHITTEST,0,(LPARAM)(LPLVHITTESTINFO)(plvhti)) +#define LVM_SETCOLUMNORDERARRAY (LVM_FIRST+58) +#define ListView_SetColumnOrderArray(hwnd,iCount,pi) (WINBOOL)SNDMSG((hwnd),LVM_SETCOLUMNORDERARRAY,(WPARAM)(iCount),(LPARAM)(LPINT)(pi)) +#define LVM_GETCOLUMNORDERARRAY (LVM_FIRST+59) +#define ListView_GetColumnOrderArray(hwnd,iCount,pi) (WINBOOL)SNDMSG((hwnd),LVM_GETCOLUMNORDERARRAY,(WPARAM)(iCount),(LPARAM)(LPINT)(pi)) +#define LVM_SETHOTITEM (LVM_FIRST+60) +#define ListView_SetHotItem(hwnd,i) (int)SNDMSG((hwnd),LVM_SETHOTITEM,(WPARAM)(i),0) +#define LVM_GETHOTITEM (LVM_FIRST+61) +#define ListView_GetHotItem(hwnd) (int)SNDMSG((hwnd),LVM_GETHOTITEM,0,0) +#define LVM_SETHOTCURSOR (LVM_FIRST+62) +#define ListView_SetHotCursor(hwnd,hcur) (HCURSOR)SNDMSG((hwnd),LVM_SETHOTCURSOR,0,(LPARAM)(hcur)) +#define LVM_GETHOTCURSOR (LVM_FIRST+63) +#define ListView_GetHotCursor(hwnd) (HCURSOR)SNDMSG((hwnd),LVM_GETHOTCURSOR,0,0) +#define LVM_APPROXIMATEVIEWRECT (LVM_FIRST+64) +#define ListView_ApproximateViewRect(hwnd,iWidth,iHeight,iCount) (DWORD)SNDMSG((hwnd),LVM_APPROXIMATEVIEWRECT,iCount,MAKELPARAM(iWidth,iHeight)) + +#define LV_MAX_WORKAREAS 16 +#define LVM_SETWORKAREAS (LVM_FIRST+65) +#define ListView_SetWorkAreas(hwnd,nWorkAreas,prc) (WINBOOL)SNDMSG((hwnd),LVM_SETWORKAREAS,(WPARAM)(int)(nWorkAreas),(LPARAM)(RECT *)(prc)) +#define LVM_GETWORKAREAS (LVM_FIRST+70) +#define ListView_GetWorkAreas(hwnd,nWorkAreas,prc) (WINBOOL)SNDMSG((hwnd),LVM_GETWORKAREAS,(WPARAM)(int)(nWorkAreas),(LPARAM)(RECT *)(prc)) +#define LVM_GETNUMBEROFWORKAREAS (LVM_FIRST+73) +#define ListView_GetNumberOfWorkAreas(hwnd,pnWorkAreas) (WINBOOL)SNDMSG((hwnd),LVM_GETNUMBEROFWORKAREAS,0,(LPARAM)(UINT *)(pnWorkAreas)) +#define LVM_GETSELECTIONMARK (LVM_FIRST+66) +#define ListView_GetSelectionMark(hwnd) (int)SNDMSG((hwnd),LVM_GETSELECTIONMARK,0,0) +#define LVM_SETSELECTIONMARK (LVM_FIRST+67) +#define ListView_SetSelectionMark(hwnd,i) (int)SNDMSG((hwnd),LVM_SETSELECTIONMARK,0,(LPARAM)(i)) +#define LVM_SETHOVERTIME (LVM_FIRST+71) +#define ListView_SetHoverTime(hwndLV,dwHoverTimeMs) (DWORD)SNDMSG((hwndLV),LVM_SETHOVERTIME,0,(LPARAM)(dwHoverTimeMs)) +#define LVM_GETHOVERTIME (LVM_FIRST+72) +#define ListView_GetHoverTime(hwndLV) (DWORD)SNDMSG((hwndLV),LVM_GETHOVERTIME,0,0) +#define LVM_SETTOOLTIPS (LVM_FIRST+74) +#define ListView_SetToolTips(hwndLV,hwndNewHwnd) (HWND)SNDMSG((hwndLV),LVM_SETTOOLTIPS,(WPARAM)(hwndNewHwnd),0) +#define LVM_GETTOOLTIPS (LVM_FIRST+78) +#define ListView_GetToolTips(hwndLV) (HWND)SNDMSG((hwndLV),LVM_GETTOOLTIPS,0,0) +#define LVM_SORTITEMSEX (LVM_FIRST+81) +#define ListView_SortItemsEx(hwndLV,_pfnCompare,_lPrm) (WINBOOL)SNDMSG((hwndLV),LVM_SORTITEMSEX,(WPARAM)(LPARAM)(_lPrm),(LPARAM)(PFNLVCOMPARE)(_pfnCompare)) + + typedef struct tagLVBKIMAGEA { ULONG ulFlags; HBITMAP hbm; LPSTR pszImage; UINT cchImageMax; int xOffsetPercent; int yOffsetPercent; -} LVBKIMAGEA, *LPLVBKIMAGEA; + } LVBKIMAGEA,*LPLVBKIMAGEA; -typedef struct tagLVBKIMAGEW -{ + typedef struct tagLVBKIMAGEW { ULONG ulFlags; HBITMAP hbm; LPWSTR pszImage; UINT cchImageMax; int xOffsetPercent; int yOffsetPercent; -} LVBKIMAGEW, *LPLVBKIMAGEW; + } LVBKIMAGEW,*LPLVBKIMAGEW; -#define LVBKIMAGE WINELIB_NAME_AW(LVBKIMAGE) -#define LPLVBKIMAGE WINELIB_NAME_AW(LPLVBKIMAGE) +#define LVBKIF_SOURCE_NONE 0x0 +#define LVBKIF_SOURCE_HBITMAP 0x1 +#define LVBKIF_SOURCE_URL 0x2 +#define LVBKIF_SOURCE_MASK 0x3 +#define LVBKIF_STYLE_NORMAL 0x0 +#define LVBKIF_STYLE_TILE 0x10 +#define LVBKIF_STYLE_MASK 0x10 +#define LVBKIF_FLAG_TILEOFFSET 0x100 +#define LVBKIF_TYPE_WATERMARK 0x10000000 -#define LVBKIF_SOURCE_NONE 0x00000000 -#define LVBKIF_SOURCE_HBITMAP 0x00000001 -#define LVBKIF_SOURCE_URL 0x00000002 -#define LVBKIF_SOURCE_MASK 0x00000003 -#define LVBKIF_STYLE_NORMAL 0x00000000 -#define LVBKIF_STYLE_TILE 0x00000010 -#define LVBKIF_STYLE_MASK 0x00000010 -#define LVBKIF_FLAG_TILEOFFSET 0x00000100 -#define LVBKIF_TYPE_WATERMARK 0x10000000 +#define LVM_SETBKIMAGEA (LVM_FIRST+68) +#define LVM_SETBKIMAGEW (LVM_FIRST+138) +#define LVM_GETBKIMAGEA (LVM_FIRST+69) +#define LVM_GETBKIMAGEW (LVM_FIRST+139) -#define ListView_SetBkImage(hwnd, plvbki) \ - (BOOL)SNDMSG((hwnd), LVM_SETBKIMAGE, 0, (LPARAM)plvbki) +#define LVM_SETSELECTEDCOLUMN (LVM_FIRST+140) +#define ListView_SetSelectedColumn(hwnd,iCol) SNDMSG((hwnd),LVM_SETSELECTEDCOLUMN,(WPARAM)iCol,0) +#define LVM_SETTILEWIDTH (LVM_FIRST+141) +#define ListView_SetTileWidth(hwnd,cpWidth) SNDMSG((hwnd),LVM_SETTILEWIDTH,(WPARAM)cpWidth,0) +#define LV_VIEW_ICON 0x0 +#define LV_VIEW_DETAILS 0x1 +#define LV_VIEW_SMALLICON 0x2 +#define LV_VIEW_LIST 0x3 +#define LV_VIEW_TILE 0x4 +#define LV_VIEW_MAX 0x4 +#define LVM_SETVIEW (LVM_FIRST+142) +#define ListView_SetView(hwnd,iView) (DWORD)SNDMSG((hwnd),LVM_SETVIEW,(WPARAM)(DWORD)iView,0) +#define LVM_GETVIEW (LVM_FIRST+143) +#define ListView_GetView(hwnd) (DWORD)SNDMSG((hwnd),LVM_GETVIEW,0,0) +#define LVGF_NONE 0x0 +#define LVGF_HEADER 0x1 +#define LVGF_FOOTER 0x2 +#define LVGF_STATE 0x4 +#define LVGF_ALIGN 0x8 +#define LVGF_GROUPID 0x10 -#define ListView_GetBkImage(hwnd, plvbki) \ - (BOOL)SNDMSG((hwnd), LVM_GETBKIMAGE, 0, (LPARAM)plvbki) +#define LVGS_NORMAL 0x0 +#define LVGS_COLLAPSED 0x1 +#define LVGS_HIDDEN 0x2 -typedef struct tagLVCOLUMNA -{ +#define LVGA_HEADER_LEFT 0x1 +#define LVGA_HEADER_CENTER 0x2 +#define LVGA_HEADER_RIGHT 0x4 +#define LVGA_FOOTER_LEFT 0x8 +#define LVGA_FOOTER_CENTER 0x10 +#define LVGA_FOOTER_RIGHT 0x20 + + typedef struct tagLVGROUP { + UINT cbSize; UINT mask; - INT fmt; - INT cx; - LPSTR pszText; - INT cchTextMax; - INT iSubItem; - /* (_WIN32_IE >= 0x0300) */ - INT iImage; - INT iOrder; - /* (_WIN32_WINNT >= 0x0600) */ - INT cxMin; - INT cxDefault; - INT cxIdeal; -} LVCOLUMNA, *LPLVCOLUMNA; + LPWSTR pszHeader; + int cchHeader; + LPWSTR pszFooter; + int cchFooter; + int iGroupId; + UINT stateMask; + UINT state; + UINT uAlign; + } LVGROUP,*PLVGROUP; -typedef struct tagLVCOLUMNW -{ +#define LVM_INSERTGROUP (LVM_FIRST+145) +#define ListView_InsertGroup(hwnd,index,pgrp) SNDMSG((hwnd),LVM_INSERTGROUP,(WPARAM)index,(LPARAM)pgrp) +#define LVM_SETGROUPINFO (LVM_FIRST+147) +#define ListView_SetGroupInfo(hwnd,iGroupId,pgrp) SNDMSG((hwnd),LVM_SETGROUPINFO,(WPARAM)iGroupId,(LPARAM)pgrp) +#define LVM_GETGROUPINFO (LVM_FIRST+149) +#define ListView_GetGroupInfo(hwnd,iGroupId,pgrp) SNDMSG((hwnd),LVM_GETGROUPINFO,(WPARAM)iGroupId,(LPARAM)pgrp) +#define LVM_REMOVEGROUP (LVM_FIRST+150) +#define ListView_RemoveGroup(hwnd,iGroupId) SNDMSG((hwnd),LVM_REMOVEGROUP,(WPARAM)iGroupId,0) +#define LVM_MOVEGROUP (LVM_FIRST+151) +#define ListView_MoveGroup(hwnd,iGroupId,toIndex) SNDMSG((hwnd),LVM_MOVEGROUP,(WPARAM)iGroupId,(LPARAM)toIndex) +#define LVM_MOVEITEMTOGROUP (LVM_FIRST+154) +#define ListView_MoveItemToGroup(hwnd,idItemFrom,idGroupTo) SNDMSG((hwnd),LVM_MOVEITEMTOGROUP,(WPARAM)idItemFrom,(LPARAM)idGroupTo) +#define LVGMF_NONE 0x0 +#define LVGMF_BORDERSIZE 0x1 +#define LVGMF_BORDERCOLOR 0x2 +#define LVGMF_TEXTCOLOR 0x4 + + typedef struct tagLVGROUPMETRICS { + UINT cbSize; UINT mask; - INT fmt; - INT cx; + UINT Left; + UINT Top; + UINT Right; + UINT Bottom; + COLORREF crLeft; + COLORREF crTop; + COLORREF crRight; + COLORREF crBottom; + COLORREF crHeader; + COLORREF crFooter; + } LVGROUPMETRICS,*PLVGROUPMETRICS; + +#define LVM_SETGROUPMETRICS (LVM_FIRST+155) +#define ListView_SetGroupMetrics(hwnd,pGroupMetrics) SNDMSG((hwnd),LVM_SETGROUPMETRICS,0,(LPARAM)pGroupMetrics) +#define LVM_GETGROUPMETRICS (LVM_FIRST+156) +#define ListView_GetGroupMetrics(hwnd,pGroupMetrics) SNDMSG((hwnd),LVM_GETGROUPMETRICS,0,(LPARAM)pGroupMetrics) +#define LVM_ENABLEGROUPVIEW (LVM_FIRST+157) +#define ListView_EnableGroupView(hwnd,fEnable) SNDMSG((hwnd),LVM_ENABLEGROUPVIEW,(WPARAM)fEnable,0) + + typedef int (CALLBACK *PFNLVGROUPCOMPARE)(int,int,void *); + +#define LVM_SORTGROUPS (LVM_FIRST+158) +#define ListView_SortGroups(hwnd,_pfnGroupCompate,_plv) SNDMSG((hwnd),LVM_SORTGROUPS,(WPARAM)_pfnGroupCompate,(LPARAM)_plv) + + typedef struct tagLVINSERTGROUPSORTED { + PFNLVGROUPCOMPARE pfnGroupCompare; + void *pvData; + LVGROUP lvGroup; + } LVINSERTGROUPSORTED,*PLVINSERTGROUPSORTED; + +#define LVM_INSERTGROUPSORTED (LVM_FIRST+159) +#define ListView_InsertGroupSorted(hwnd,structInsert) SNDMSG((hwnd),LVM_INSERTGROUPSORTED,(WPARAM)structInsert,0) +#define LVM_REMOVEALLGROUPS (LVM_FIRST+160) +#define ListView_RemoveAllGroups(hwnd) SNDMSG((hwnd),LVM_REMOVEALLGROUPS,0,0) +#define LVM_HASGROUP (LVM_FIRST+161) +#define ListView_HasGroup(hwnd,dwGroupId) SNDMSG((hwnd),LVM_HASGROUP,dwGroupId,0) + +#define LVTVIF_AUTOSIZE 0x0 +#define LVTVIF_FIXEDWIDTH 0x1 +#define LVTVIF_FIXEDHEIGHT 0x2 +#define LVTVIF_FIXEDSIZE 0x3 + +#define LVTVIM_TILESIZE 0x1 +#define LVTVIM_COLUMNS 0x2 +#define LVTVIM_LABELMARGIN 0x4 + + typedef struct tagLVTILEVIEWINFO { + UINT cbSize; + DWORD dwMask; + DWORD dwFlags; + SIZE sizeTile; + int cLines; + RECT rcLabelMargin; + } LVTILEVIEWINFO,*PLVTILEVIEWINFO; + + typedef struct tagLVTILEINFO { + UINT cbSize; + int iItem; + UINT cColumns; + PUINT puColumns; + } LVTILEINFO,*PLVTILEINFO; + +#define LVM_SETTILEVIEWINFO (LVM_FIRST+162) +#define ListView_SetTileViewInfo(hwnd,ptvi) SNDMSG((hwnd),LVM_SETTILEVIEWINFO,0,(LPARAM)ptvi) +#define LVM_GETTILEVIEWINFO (LVM_FIRST+163) +#define ListView_GetTileViewInfo(hwnd,ptvi) SNDMSG((hwnd),LVM_GETTILEVIEWINFO,0,(LPARAM)ptvi) +#define LVM_SETTILEINFO (LVM_FIRST+164) +#define ListView_SetTileInfo(hwnd,pti) SNDMSG((hwnd),LVM_SETTILEINFO,0,(LPARAM)pti) +#define LVM_GETTILEINFO (LVM_FIRST+165) +#define ListView_GetTileInfo(hwnd,pti) SNDMSG((hwnd),LVM_GETTILEINFO,0,(LPARAM)pti) + + typedef struct { + UINT cbSize; + DWORD dwFlags; + int iItem; + DWORD dwReserved; + } LVINSERTMARK,*LPLVINSERTMARK; + +#define LVIM_AFTER 0x1 + +#define LVM_SETINSERTMARK (LVM_FIRST+166) +#define ListView_SetInsertMark(hwnd,lvim) (WINBOOL)SNDMSG((hwnd),LVM_SETINSERTMARK,(WPARAM) 0,(LPARAM) (lvim)) +#define LVM_GETINSERTMARK (LVM_FIRST+167) +#define ListView_GetInsertMark(hwnd,lvim) (WINBOOL)SNDMSG((hwnd),LVM_GETINSERTMARK,(WPARAM) 0,(LPARAM) (lvim)) +#define LVM_INSERTMARKHITTEST (LVM_FIRST+168) +#define ListView_InsertMarkHitTest(hwnd,point,lvim) (int)SNDMSG((hwnd),LVM_INSERTMARKHITTEST,(WPARAM)(LPPOINT)(point),(LPARAM)(LPLVINSERTMARK)(lvim)) +#define LVM_GETINSERTMARKRECT (LVM_FIRST+169) +#define ListView_GetInsertMarkRect(hwnd,rc) (int)SNDMSG((hwnd),LVM_GETINSERTMARKRECT,(WPARAM)0,(LPARAM)(LPRECT)(rc)) +#define LVM_SETINSERTMARKCOLOR (LVM_FIRST+170) +#define ListView_SetInsertMarkColor(hwnd,color) (COLORREF)SNDMSG((hwnd),LVM_SETINSERTMARKCOLOR,(WPARAM)0,(LPARAM)(COLORREF)(color)) +#define LVM_GETINSERTMARKCOLOR (LVM_FIRST+171) +#define ListView_GetInsertMarkColor(hwnd) (COLORREF)SNDMSG((hwnd),LVM_GETINSERTMARKCOLOR,(WPARAM)0,(LPARAM)0) + + typedef struct tagLVSETINFOTIP { + UINT cbSize; + DWORD dwFlags; LPWSTR pszText; - INT cchTextMax; - INT iSubItem; - /* (_WIN32_IE >= 0x0300) */ - INT iImage; - INT iOrder; - /* (_WIN32_WINNT >= 0x0600) */ - INT cxMin; - INT cxDefault; - INT cxIdeal; -} LVCOLUMNW, *LPLVCOLUMNW; + int iItem; + int iSubItem; + } LVSETINFOTIP,*PLVSETINFOTIP; -#define LVCOLUMN WINELIB_NAME_AW(LVCOLUMN) -#define LPLVCOLUMN WINELIB_NAME_AW(LPLVCOLUMN) +#define LVM_SETINFOTIP (LVM_FIRST+173) +#define ListView_SetInfoTip(hwndLV,plvInfoTip) (WINBOOL)SNDMSG((hwndLV),LVM_SETINFOTIP,(WPARAM)0,(LPARAM)plvInfoTip) +#define LVM_GETSELECTEDCOLUMN (LVM_FIRST+174) +#define ListView_GetSelectedColumn(hwnd) (UINT)SNDMSG((hwnd),LVM_GETSELECTEDCOLUMN,0,0) +#define LVM_ISGROUPVIEWENABLED (LVM_FIRST+175) +#define ListView_IsGroupViewEnabled(hwnd) (WINBOOL)SNDMSG((hwnd),LVM_ISGROUPVIEWENABLED,0,0) +#define LVM_GETOUTLINECOLOR (LVM_FIRST+176) +#define ListView_GetOutlineColor(hwnd) (COLORREF)SNDMSG((hwnd),LVM_GETOUTLINECOLOR,0,0) +#define LVM_SETOUTLINECOLOR (LVM_FIRST+177) +#define ListView_SetOutlineColor(hwnd,color) (COLORREF)SNDMSG((hwnd),LVM_SETOUTLINECOLOR,(WPARAM)0,(LPARAM)(COLORREF)(color)) +#define LVM_CANCELEDITLABEL (LVM_FIRST+179) +#define ListView_CancelEditLabel(hwnd) (VOID)SNDMSG((hwnd),LVM_CANCELEDITLABEL,(WPARAM)0,(LPARAM)0) +#define LVM_MAPINDEXTOID (LVM_FIRST+180) +#define ListView_MapIndexToID(hwnd,index) (UINT)SNDMSG((hwnd),LVM_MAPINDEXTOID,(WPARAM)index,(LPARAM)0) +#define LVM_MAPIDTOINDEX (LVM_FIRST+181) +#define ListView_MapIDToIndex(hwnd,id) (UINT)SNDMSG((hwnd),LVM_MAPIDTOINDEX,(WPARAM)id,(LPARAM)0) +#define LVM_ISITEMVISIBLE (LVM_FIRST+182) +#define ListView_IsItemVisible(hwnd,index) (UINT)SNDMSG((hwnd),LVM_ISITEMVISIBLE,(WPARAM)(index),(LPARAM)0) -#define LVCOLUMN_V1_SIZEA CCSIZEOF_STRUCT(LVCOLUMNA, iSubItem) -#define LVCOLUMN_V1_SIZEW CCSIZEOF_STRUCT(LVCOLUMNW, iSubItem) -#define LVCOLUMN_V1_SIZE WINELIB_NAME_AW(LVCOLUMN_V1_SIZE) +#ifdef UNICODE +#define LVBKIMAGE LVBKIMAGEW +#define LPLVBKIMAGE LPLVBKIMAGEW +#define LVM_SETBKIMAGE LVM_SETBKIMAGEW +#define LVM_GETBKIMAGE LVM_GETBKIMAGEW +#else +#define LVBKIMAGE LVBKIMAGEA +#define LPLVBKIMAGE LPLVBKIMAGEA +#define LVM_SETBKIMAGE LVM_SETBKIMAGEA +#define LVM_GETBKIMAGE LVM_GETBKIMAGEA +#endif -#define LV_COLUMN LVCOLUMN +#define ListView_SetBkImage(hwnd,plvbki) (WINBOOL)SNDMSG((hwnd),LVM_SETBKIMAGE,0,(LPARAM)(plvbki)) +#define ListView_GetBkImage(hwnd,plvbki) (WINBOOL)SNDMSG((hwnd),LVM_GETBKIMAGE,0,(LPARAM)(plvbki)) +#define LPNM_LISTVIEW LPNMLISTVIEW +#define NM_LISTVIEW NMLISTVIEW -typedef struct tagNMLISTVIEW -{ + typedef struct tagNMLISTVIEW { NMHDR hdr; - INT iItem; - INT iSubItem; + int iItem; + int iSubItem; UINT uNewState; UINT uOldState; UINT uChanged; POINT ptAction; - LPARAM lParam; -} NMLISTVIEW, *LPNMLISTVIEW; + LPARAM lParam; + } NMLISTVIEW,*LPNMLISTVIEW; -#define NM_LISTVIEW NMLISTVIEW -#define LPNM_LISTVIEW LPNMLISTVIEW - -typedef struct tagNMITEMACTIVATE -{ + typedef struct tagNMITEMACTIVATE { NMHDR hdr; int iItem; int iSubItem; @@ -3484,862 +3052,832 @@ typedef struct tagNMITEMACTIVATE POINT ptAction; LPARAM lParam; UINT uKeyFlags; -} NMITEMACTIVATE, *LPNMITEMACTIVATE; + } NMITEMACTIVATE,*LPNMITEMACTIVATE; -#define LVKF_ALT 0x0001 -#define LVKF_CONTROL 0x0002 -#define LVKF_SHIFT 0x0004 +#define LVKF_ALT 0x1 +#define LVKF_CONTROL 0x2 +#define LVKF_SHIFT 0x4 -typedef struct tagLVDISPINFO -{ - NMHDR hdr; - LVITEMA item; -} NMLVDISPINFOA, *LPNMLVDISPINFOA; +#define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLVCUSTOMDRW,clrTextBk) -typedef struct tagLVDISPINFOW -{ - NMHDR hdr; - LVITEMW item; -} NMLVDISPINFOW, *LPNMLVDISPINFOW; - -#define NMLVDISPINFO WINELIB_NAME_AW(NMLVDISPINFO) -#define LPNMLVDISPINFO WINELIB_NAME_AW(LPNMLVDISPINFO) - -#define LV_DISPINFO NMLVDISPINFO -#define LV_DISPINFOA NMLVDISPINFOA -#define LV_DISPINFOW NMLVDISPINFOW - -#include -typedef struct tagLVKEYDOWN -{ - NMHDR hdr; - WORD wVKey; - UINT flags; -} NMLVKEYDOWN, *LPNMLVKEYDOWN; -#include - -#define LV_KEYDOWN NMLVKEYDOWN - -typedef struct tagNMLVGETINFOTIPA -{ - NMHDR hdr; - DWORD dwFlags; - LPSTR pszText; - int cchTextMax; - int iItem; - int iSubItem; - LPARAM lParam; -} NMLVGETINFOTIPA, *LPNMLVGETINFOTIPA; - -typedef struct tagNMLVGETINFOTIPW -{ - NMHDR hdr; - DWORD dwFlags; - LPWSTR pszText; - int cchTextMax; - int iItem; - int iSubItem; - LPARAM lParam; -} NMLVGETINFOTIPW, *LPNMLVGETINFOTIPW; - -#define NMLVGETINFOTIP WINELIB_NAME_AW(NMLVGETINFOTIP) -#define LPNMLVGETINFOTIP WINELIB_NAME_AW(LPNMLVGETINFOTIP) - -typedef struct tagLVHITTESTINFO -{ - POINT pt; - UINT flags; - INT iItem; - INT iSubItem; - /* (_WIN32_WINNT >= 0x0600) */ - INT iGroup; -} LVHITTESTINFO, *LPLVHITTESTINFO; - -#define LV_HITTESTINFO LVHITTESTINFO -#define _LV_HITTESTINFO tagLVHITTESTINFO -#define LVHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(LVHITTESTINFO,iItem) - -typedef struct tagLVFINDINFOA -{ - UINT flags; - LPCSTR psz; - LPARAM lParam; - POINT pt; - UINT vkDirection; -} LVFINDINFOA, *LPLVFINDINFOA; - -typedef struct tagLVFINDINFOW -{ - UINT flags; - LPCWSTR psz; - LPARAM lParam; - POINT pt; - UINT vkDirection; -} LVFINDINFOW, *LPLVFINDINFOW; - -#define LVFINDINFO WINELIB_NAME_AW(LVFINDINFO) -#define LPLVFINDINFO WINELIB_NAME_AW(LPLVFINDINFO) - -#define LV_FINDINFO LVFINDINFO -#define LV_FINDINFOA LVFINDINFOA -#define LV_FINDINFOW LVFINDINFOW - -/* Groups relates structures */ - -typedef struct LVGROUP -{ - UINT cbSize; - UINT mask; - LPWSTR pszHeader; - INT cchHeader; - LPWSTR pszFooter; - INT cchFooter; - INT iGroupId; - UINT stateMask; - UINT state; - UINT uAlign; - /* (_WIN32_WINNT >= 0x0600) */ - LPWSTR pszSubtitle; - UINT cchSubtitle; - LPWSTR pszTask; - UINT cchTask; - LPWSTR pszDescriptionTop; - UINT cchDescriptionTop; - LPWSTR pszDescriptionBottom; - UINT cchDescriptionBottom; - INT iTitleImage; - INT iExtendedImage; - INT iFirstItem; - UINT cItems; - LPWSTR pszSubsetTitle; - UINT cchSubsetTitle; -} LVGROUP, *PLVGROUP; - -#define LVGROUP_V5_SIZE CCSIZEOF_STRUCT(LVGROUP, uAlign) - -typedef struct LVGROUPMETRICS -{ - UINT cbSize; - UINT mask; - UINT Left; - UINT Top; - UINT Right; - UINT Bottom; - COLORREF crLeft; - COLORREF crTop; - COLORREF crRight; - COLORREF crBottom; - COLORREF crRightHeader; - COLORREF crFooter; -} LVGROUPMETRICS, *PLVGROUPMETRICS; - -typedef INT (*PFNLVGROUPCOMPARE)(INT, INT, VOID*); - -typedef struct LVINSERTGROUPSORTED -{ - PFNLVGROUPCOMPARE pfnGroupCompare; - LPVOID *pvData; - LVGROUP lvGroup; -} LVINSERTGROUPSORTED, *PLVINSERTGROUPSORTED; - -/* Tile related structures */ - -typedef struct LVTILEINFO -{ - UINT cbSize; - int iItem; - UINT cColumns; - PUINT puColumns; - /* (_WIN32_WINNT >= 0x0600) */ - int* piColFmt; -} LVTILEINFO, *PLVTILEINFO; - -typedef struct LVTILEVIEWINFO -{ - UINT cbSize; - DWORD dwMask; - DWORD dwFlags; - SIZE sizeTile; - int cLines; - RECT rcLabelMargin; -} LVTILEVIEWINFO, *PLVTILEVIEWINFO; - -typedef struct LVINSERTMARK -{ - UINT cbSize; - DWORD dwFlags; - int iItem; - DWORD dwReserved; -} LVINSERTMARK, *PLVINSERTMARK; - -typedef struct tagTCHITTESTINFO -{ - POINT pt; - UINT flags; -} TCHITTESTINFO, *LPTCHITTESTINFO; - -#define TC_HITTESTINFO TCHITTESTINFO - -typedef INT (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM); - -#define NMLVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMLCUSTOMDRW, clrTextBk) - -typedef struct tagNMLVCUSTOMDRAW -{ + typedef struct tagNMLVCUSTOMDRAW { NMCUSTOMDRAW nmcd; COLORREF clrText; COLORREF clrTextBk; - int iSubItem; /* (_WIN32_IE >= 0x0400) */ - DWORD dwItemType; /* (_WIN32_IE >= 0x560) */ - COLORREF clrFace; /* (_WIN32_IE >= 0x560) */ - int iIconEffect; /* (_WIN32_IE >= 0x560) */ - int iIconPhase; /* (_WIN32_IE >= 0x560) */ - int iPartId; /* (_WIN32_IE >= 0x560) */ - int iStateId; /* (_WIN32_IE >= 0x560) */ - RECT rcText; /* (_WIN32_IE >= 0x560) */ - UINT uAlign; /* (_WIN32_IE >= 0x560) */ -} NMLVCUSTOMDRAW, *LPNMLVCUSTOMDRAW; + int iSubItem; + DWORD dwItemType; + COLORREF clrFace; + int iIconEffect; + int iIconPhase; + int iPartId; + int iStateId; + RECT rcText; + UINT uAlign; + } NMLVCUSTOMDRAW,*LPNMLVCUSTOMDRAW; -typedef struct tagNMLVCACHEHINT -{ - NMHDR hdr; - INT iFrom; - INT iTo; -} NMLVCACHEHINT, *LPNMLVCACHEHINT; +#define LVCDI_ITEM 0x0 +#define LVCDI_GROUP 0x1 + +#define LVCDRF_NOSELECT 0x10000 +#define LVCDRF_NOGROUPFRAME 0x20000 + + typedef struct tagNMLVCACHEHINT { + NMHDR hdr; + int iFrom; + int iTo; + } NMLVCACHEHINT,*LPNMLVCACHEHINT; #define LPNM_CACHEHINT LPNMLVCACHEHINT -#define PNM_CACHEHINT LPNMLVCACHEHINT -#define NM_CACHEHINT NMLVCACHEHINT +#define PNM_CACHEHINT LPNMLVCACHEHINT +#define NM_CACHEHINT NMLVCACHEHINT -typedef struct tagNMLVFINDITEMA -{ + typedef struct tagNMLVFINDITEMA { NMHDR hdr; int iStart; LVFINDINFOA lvfi; -} NMLVFINDITEMA, *LPNMLVFINDITEMA; + } NMLVFINDITEMA,*LPNMLVFINDITEMA; -typedef struct tagNMLVFINDITEMW -{ + typedef struct tagNMLVFINDITEMW { NMHDR hdr; int iStart; LVFINDINFOW lvfi; -} NMLVFINDITEMW, *LPNMLVFINDITEMW; + } NMLVFINDITEMW,*LPNMLVFINDITEMW; -#define NMLVFINDITEM WINELIB_NAME_AW(NMLVFINDITEM) -#define LPNMLVFINDITEM WINELIB_NAME_AW(LPNMLVFINDITEM) -#define NM_FINDITEM NMLVFINDITEM -#define LPNM_FINDITEM LPNMLVFINDITEM -#define PNM_FINDITEM LPNMLVFINDITEM +#define PNM_FINDITEMA LPNMLVFINDITEMA +#define LPNM_FINDITEMA LPNMLVFINDITEMA +#define NM_FINDITEMA NMLVFINDITEMA -typedef struct tagNMLVODSTATECHANGE -{ +#define PNM_FINDITEMW LPNMLVFINDITEMW +#define LPNM_FINDITEMW LPNMLVFINDITEMW +#define NM_FINDITEMW NMLVFINDITEMW + +#ifdef UNICODE +#define PNM_FINDITEM PNM_FINDITEMW +#define LPNM_FINDITEM LPNM_FINDITEMW +#define NM_FINDITEM NM_FINDITEMW +#define NMLVFINDITEM NMLVFINDITEMW +#define LPNMLVFINDITEM LPNMLVFINDITEMW +#else +#define PNM_FINDITEM PNM_FINDITEMA +#define LPNM_FINDITEM LPNM_FINDITEMA +#define NM_FINDITEM NM_FINDITEMA +#define NMLVFINDITEM NMLVFINDITEMA +#define LPNMLVFINDITEM LPNMLVFINDITEMA +#endif + + typedef struct tagNMLVODSTATECHANGE { NMHDR hdr; int iFrom; int iTo; UINT uNewState; UINT uOldState; -} NMLVODSTATECHANGE, *LPNMLVODSTATECHANGE; + } NMLVODSTATECHANGE,*LPNMLVODSTATECHANGE; #define PNM_ODSTATECHANGE LPNMLVODSTATECHANGE #define LPNM_ODSTATECHANGE LPNMLVODSTATECHANGE #define NM_ODSTATECHANGE NMLVODSTATECHANGE -typedef struct NMLVSCROLL -{ - NMHDR hdr; - int dx; - int dy; -} NMLVSCROLL, *LPNMLVSCROLL; +#define LVN_ITEMCHANGING (LVN_FIRST-0) +#define LVN_ITEMCHANGED (LVN_FIRST-1) +#define LVN_INSERTITEM (LVN_FIRST-2) +#define LVN_DELETEITEM (LVN_FIRST-3) +#define LVN_DELETEALLITEMS (LVN_FIRST-4) +#define LVN_BEGINLABELEDITA (LVN_FIRST-5) +#define LVN_BEGINLABELEDITW (LVN_FIRST-75) +#define LVN_ENDLABELEDITA (LVN_FIRST-6) +#define LVN_ENDLABELEDITW (LVN_FIRST-76) +#define LVN_COLUMNCLICK (LVN_FIRST-8) +#define LVN_BEGINDRAG (LVN_FIRST-9) +#define LVN_BEGINRDRAG (LVN_FIRST-11) -#define ListView_SetItemCount(hwnd,count) \ - (BOOL)SNDMSG((hwnd),LVM_SETITEMCOUNT,(WPARAM)(INT)(count),0) -#define ListView_SetTextBkColor(hwnd,clrBk) \ - (BOOL)SNDMSG((hwnd),LVM_SETTEXTBKCOLOR,0,(LPARAM)(COLORREF)(clrBk)) -#define ListView_SetTextColor(hwnd,clrBk) \ - (BOOL)SNDMSG((hwnd),LVM_SETTEXTCOLOR,0,(LPARAM)(COLORREF)(clrBk)) -#define ListView_DeleteColumn(hwnd,col)\ - (LRESULT)SNDMSG((hwnd),LVM_DELETECOLUMN,0,(LPARAM)(INT)(col)) -#define ListView_GetColumnA(hwnd,x,col)\ - (LRESULT)SNDMSGA((hwnd),LVM_GETCOLUMNA,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNA)(col)) -#define ListView_GetColumnW(hwnd,x,col)\ - (LRESULT)SNDMSGW((hwnd),LVM_GETCOLUMNW,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNW)(col)) -#define ListView_GetColumn WINELIB_NAME_AW(ListView_GetColumn) -#define ListView_SetColumnA(hwnd,x,col)\ - (LRESULT)SNDMSGA((hwnd),LVM_SETCOLUMNA,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNA)(col)) -#define ListView_SetColumnW(hwnd,x,col)\ - (LRESULT)SNDMSGW((hwnd),LVM_SETCOLUMNW,(WPARAM)(INT)(x),(LPARAM)(LPLVCOLUMNW)(col)) -#define ListView_SetColumn WINELIB_NAME_AW(ListView_SetColumn) -#define ListView_GetColumnWidth(hwnd,x)\ - (INT)SNDMSG((hwnd),LVM_GETCOLUMNWIDTH,(WPARAM)(INT)(x),0L) -#define ListView_SetColumnWidth(hwnd,x,width)\ - (BOOL)SNDMSG((hwnd),LVM_SETCOLUMNWIDTH,(WPARAM)(INT)(x),(LPARAM)(MAKELPARAM(width,0))) +#define LVN_ODCACHEHINT (LVN_FIRST-13) +#define LVN_ODFINDITEMA (LVN_FIRST-52) +#define LVN_ODFINDITEMW (LVN_FIRST-79) +#define LVN_ITEMACTIVATE (LVN_FIRST-14) +#define LVN_ODSTATECHANGED (LVN_FIRST-15) -#define ListView_GetNextItem(hwnd,nItem,flags) \ - (INT)SNDMSG((hwnd),LVM_GETNEXTITEM,(WPARAM)(INT)(nItem),(LPARAM)(MAKELPARAM(flags,0))) -#define ListView_FindItemA(hwnd,nItem,plvfi) \ - (INT)SNDMSGA((hwnd),LVM_FINDITEMA,(WPARAM)(INT)(nItem),(LPARAM)(LVFINDINFOA*)(plvfi)) -#define ListView_FindItemW(hwnd,nItem,plvfi) \ - (INT)SNDMSGW((hwnd),LVM_FINDITEMW,(WPARAM)(INT)(nItem),(LPARAM)(LVFINDINFOW*)(plvfi)) -#define ListView_FindItem WINELIB_NAME_AW(ListView_FindItem) - -#define ListView_Arrange(hwnd,code) \ - (INT)SNDMSG((hwnd),LVM_ARRANGE,(WPARAM)(INT)(code),0L) -#define ListView_GetItemPosition(hwnd,i,ppt) \ - (INT)SNDMSG((hwnd),LVM_GETITEMPOSITION,(WPARAM)(INT)(i),(LPARAM)(LPPOINT)(ppt)) -#define ListView_GetItemRect(hwnd,i,prc,code) \ - (BOOL)SNDMSG((hwnd), LVM_GETITEMRECT, (WPARAM)(int)(i), \ - ((prc) ? (((RECT*)(prc))->left = (code),(LPARAM)(RECT \ - *)(prc)) : (LPARAM)(RECT*)NULL)) -#define ListView_SetItemA(hwnd,pitem) \ - (INT)SNDMSGA((hwnd),LVM_SETITEMA,0,(LPARAM)(const LVITEMA *)(pitem)) -#define ListView_SetItemW(hwnd,pitem) \ - (INT)SNDMSGW((hwnd),LVM_SETITEMW,0,(LPARAM)(const LVITEMW *)(pitem)) -#define ListView_SetItem WINELIB_NAME_AW(ListView_SetItem) -#define ListView_SetItemState(hwnd,i,data,dataMask) \ -{ LVITEM _LVi; _LVi.state = data; _LVi.stateMask = dataMask;\ - SNDMSG(hwnd, LVM_SETITEMSTATE, (WPARAM)(UINT)i, (LPARAM) (LPLVITEM)&_LVi);} -#define ListView_GetItemState(hwnd,i,mask) \ - (UINT)SNDMSG((hwnd),LVM_GETITEMSTATE,(WPARAM)(UINT)(i),(LPARAM)(UINT)(mask)) -#define ListView_SetCheckState(hwndLV, i, bCheck) \ - { LVITEM _LVi; _LVi.state = INDEXTOSTATEIMAGEMASK((bCheck)?2:1); _LVi.stateMask = LVIS_STATEIMAGEMASK; \ - SNDMSG(hwndLV, LVM_SETITEMSTATE, (WPARAM)(UINT)(i), (LPARAM)(LPLVITEM)&_LVi);} -#define ListView_GetCheckState(hwndLV, i) \ - (((UINT)SNDMSG((hwndLV), LVM_GETITEMSTATE, (i), LVIS_STATEIMAGEMASK) >> 12) - 1) -#define ListView_GetCountPerPage(hwnd) \ - (BOOL)SNDMSG((hwnd),LVM_GETCOUNTPERPAGE,0,0L) -#define ListView_GetImageList(hwnd,iImageList) \ - (HIMAGELIST)SNDMSG((hwnd),LVM_GETIMAGELIST,(WPARAM)(INT)(iImageList),0L) -#define ListView_GetStringWidthA(hwnd,pstr) \ - (INT)SNDMSGA((hwnd),LVM_GETSTRINGWIDTHA,0,(LPARAM)(LPCSTR)(pstr)) -#define ListView_GetStringWidthW(hwnd,pstr) \ - (INT)SNDMSGW((hwnd),LVM_GETSTRINGWIDTHW,0,(LPARAM)(LPCWSTR)(pstr)) -#define ListView_GetStringWidth WINELIB_NAME_AW(ListView_GetStringWidth) -#define ListView_GetTopIndex(hwnd) \ - (BOOL)SNDMSG((hwnd),LVM_GETTOPINDEX,0,0L) -#define ListView_Scroll(hwnd,dx,dy) \ - (BOOL)SNDMSG((hwnd),LVM_SCROLL,(WPARAM)(INT)(dx),(LPARAM)(INT)(dy)) -#define ListView_EnsureVisible(hwnd,i,fPartialOk) \ - (BOOL)SNDMSG((hwnd),LVM_ENSUREVISIBLE,(WPARAM)(INT)i,(LPARAM)(BOOL)fPartialOk) -#define ListView_SetBkColor(hwnd,clrBk) \ - (BOOL)SNDMSG((hwnd),LVM_SETBKCOLOR,0,(LPARAM)(COLORREF)(clrBk)) -#define ListView_SetImageList(hwnd,himl,iImageList) \ - (HIMAGELIST)SNDMSG((hwnd),LVM_SETIMAGELIST,(WPARAM)(iImageList),(LPARAM)(HIMAGELIST)(himl)) -#define ListView_GetItemCount(hwnd) \ - (INT)SNDMSG((hwnd),LVM_GETITEMCOUNT,0,0L) -#define ListView_RedrawItems(hwnd,first,last) \ - (BOOL)SNDMSG((hwnd),LVM_REDRAWITEMS,(WPARAM)(INT)(first),(LPARAM)(INT)(last)) -#define ListView_GetEditControl(hwnd) \ - (HWND)SNDMSG((hwnd), LVM_GETEDITCONTROL, 0, 0) -#define ListView_GetTextColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0) -#define ListView_GetTextBkColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), LVM_GETTEXTBKCOLOR, 0, 0) -#define ListView_GetBkColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), LVM_GETBKCOLOR, 0, 0) -#define ListView_GetItemA(hwnd,pitem) \ - (BOOL)SNDMSGA((hwnd),LVM_GETITEMA,0,(LPARAM)(LVITEMA *)(pitem)) -#define ListView_GetItemW(hwnd,pitem) \ - (BOOL)SNDMSGW((hwnd),LVM_GETITEMW,0,(LPARAM)(LVITEMW *)(pitem)) -#define ListView_GetItem WINELIB_NAME_AW(ListView_GetItem) -#define ListView_GetOrigin(hwnd,ppt) \ - (BOOL)SNDMSG((hwnd),LVM_GETORIGIN,0,(LPARAM)(POINT *)(ppt)) - -#define ListView_HitTest(hwnd,pinfo) \ - (INT)SNDMSG((hwnd),LVM_HITTEST,0,(LPARAM)(LPLVHITTESTINFO)(pinfo)) - -#define ListView_InsertItemA(hwnd,pitem) \ - (INT)SNDMSGA((hwnd),LVM_INSERTITEMA,0,(LPARAM)(const LVITEMA *)(pitem)) -#define ListView_InsertItemW(hwnd,pitem) \ - (INT)SNDMSGW((hwnd),LVM_INSERTITEMW,0,(LPARAM)(const LVITEMW *)(pitem)) -#define ListView_InsertItem WINELIB_NAME_AW(ListView_InsertItem) - -#define ListView_DeleteAllItems(hwnd) \ - (BOOL)SNDMSG((hwnd),LVM_DELETEALLITEMS,0,0L) - -#define ListView_InsertColumnA(hwnd,iCol,pcol) \ - (INT)SNDMSGA((hwnd),LVM_INSERTCOLUMNA,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNA *)(pcol)) -#define ListView_InsertColumnW(hwnd,iCol,pcol) \ - (INT)SNDMSGW((hwnd),LVM_INSERTCOLUMNW,(WPARAM)(INT)(iCol),(LPARAM)(const LVCOLUMNW *)(pcol)) -#define ListView_InsertColumn WINELIB_NAME_AW(ListView_InsertColumn) - -#define ListView_SortItems(hwndLV,_pfnCompare,_lPrm) \ - (BOOL)SNDMSG((hwndLV),LVM_SORTITEMS,(WPARAM)(LPARAM)_lPrm,(LPARAM)(PFNLVCOMPARE)_pfnCompare) -#define ListView_SortItemsEx(hwndLV, _pfnCompare, _lPrm) \ - (BOOL)SNDMSG((hwndLV), LVM_SORTITEMSEX, (WPARAM)(LPARAM)(_lPrm), (LPARAM)(PFNLVCOMPARE)(_pfnCompare)) - -#define ListView_SetItemPosition(hwndLV, i, x, y) \ - (BOOL)SNDMSG((hwndLV),LVM_SETITEMPOSITION,(WPARAM)(INT)(i),MAKELPARAM((x),(y))) -#define ListView_GetSelectedCount(hwndLV) \ - (UINT)SNDMSG((hwndLV),LVM_GETSELECTEDCOUNT,0,0L) - -#define ListView_EditLabelA(hwndLV, i) \ - (HWND)SNDMSG((hwndLV),LVM_EDITLABELA,(WPARAM)(int)(i), 0L) -#define ListView_EditLabelW(hwndLV, i) \ - (HWND)SNDMSG((hwndLV),LVM_EDITLABELW,(WPARAM)(int)(i), 0L) -#define ListView_EditLabel WINELIB_NAME_AW(ListView_EditLabel) - -#define ListView_GetItemTextA(hwndLV, i, _iSubItem, _pszText, _cchTextMax) \ -{ \ - LVITEMA _LVi;\ - _LVi.iSubItem = _iSubItem;\ - _LVi.cchTextMax = _cchTextMax;\ - _LVi.pszText = _pszText;\ - SNDMSGA(hwndLV, LVM_GETITEMTEXTA, (WPARAM)(i), (LPARAM)&_LVi);\ -} -#define ListView_GetItemTextW(hwndLV, i, _iSubItem, _pszText, _cchTextMax) \ -{ \ - LVITEMW _LVi;\ - _LVi.iSubItem = _iSubItem;\ - _LVi.cchTextMax = _cchTextMax;\ - _LVi.pszText = _pszText;\ - SNDMSGW(hwndLV, LVM_GETITEMTEXTW, (WPARAM)(i), (LPARAM)&_LVi);\ -} -#define ListView_GetItemText WINELIB_NAME_AW(ListView_GetItemText) -#define ListView_SetItemPosition32(hwnd,n,x1,y1) \ -{ POINT ptNewPos; ptNewPos.x = (x1); ptNewPos.y = (y1); SNDMSG((hwnd), LVM_SETITEMPOSITION32, (WPARAM)(int)(n), (LPARAM)&ptNewPos); } -#define ListView_SetItemTextA(hwndLV, i, _iSubItem, _pszText) \ -{ LVITEMA _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\ - SNDMSGA(hwndLV, LVM_SETITEMTEXTA, (WPARAM)i, (LPARAM) (LVITEMA*)&_LVi);} -#define ListView_SetItemTextW(hwndLV, i, _iSubItem, _pszText) \ -{ LVITEMW _LVi; _LVi.iSubItem = _iSubItem; _LVi.pszText = _pszText;\ - SNDMSGW(hwndLV, LVM_SETITEMTEXTW, (WPARAM)i, (LPARAM) (LVITEMW*)& _LVi);} -#define ListView_SetItemText WINELIB_NAME_AW(ListView_SetItemText) - -#define ListView_DeleteItem(hwndLV, i) \ - (BOOL)SNDMSG(hwndLV, LVM_DELETEITEM, (WPARAM)(int)(i), 0L) -#define ListView_Update(hwndLV, i) \ - (BOOL)SNDMSG((hwndLV), LVM_UPDATE, (WPARAM)(i), 0L) -#define ListView_GetColumnOrderArray(hwndLV, iCount, pi) \ - (BOOL)SNDMSG((hwndLV), LVM_GETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi) -#define ListView_GetExtendedListViewStyle(hwndLV) \ - (DWORD)SNDMSG((hwndLV), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0L) -#define ListView_GetHotCursor(hwndLV) \ - (HCURSOR)SNDMSG((hwndLV), LVM_GETHOTCURSOR, 0, 0L) -#define ListView_GetHotItem(hwndLV) \ - (int)SNDMSG((hwndLV), LVM_GETHOTITEM, 0, 0L) -#define ListView_GetItemSpacing(hwndLV, fSmall) \ - (DWORD)SNDMSG((hwndLV), LVM_GETITEMSPACING, (WPARAM)fSmall, 0L) -#define ListView_GetSubItemRect(hwndLV, iItem, iSubItem, code, prc) \ - (BOOL)SNDMSG((hwndLV), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \ - ((prc) ? ((((LPRECT)(prc))->top = iSubItem), (((LPRECT)(prc))->left = code), (LPARAM)(prc)) : 0)) -#define ListView_GetToolTips(hwndLV) \ - (HWND)SNDMSG((hwndLV), LVM_GETTOOLTIPS, 0, 0L) -#define ListView_SetColumnOrderArray(hwndLV, iCount, pi) \ - (BOOL)SNDMSG((hwndLV), LVM_SETCOLUMNORDERARRAY, (WPARAM)iCount, (LPARAM)(LPINT)pi) -#define ListView_SetExtendedListViewStyle(hwndLV, dw) \ - (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)dw) -#define ListView_SetExtendedListViewStyleEx(hwndLV, dwMask, dw) \ - (DWORD)SNDMSG((hwndLV), LVM_SETEXTENDEDLISTVIEWSTYLE, (WPARAM)dwMask, (LPARAM)dw) -#define ListView_SetHotCursor(hwndLV, hcur) \ - (HCURSOR)SNDMSG((hwndLV), LVM_SETHOTCURSOR, 0, (LPARAM)hcur) -#define ListView_SetHotItem(hwndLV, i) \ - (int)SNDMSG((hwndLV), LVM_SETHOTITEM, (WPARAM)i, 0L) -#define ListView_SetIconSpacing(hwndLV, cx, cy) \ - (DWORD)SNDMSG((hwndLV), LVM_SETICONSPACING, 0, MAKELONG(cx,cy)) -#define ListView_SetToolTips(hwndLV, hwndNewHwnd) \ - (HWND)SNDMSG((hwndLV), LVM_SETTOOLTIPS, (WPARAM)hwndNewHwnd, 0L) -#define ListView_SubItemHitTest(hwndLV, plvhti) \ - (int)SNDMSG((hwndLV), LVM_SUBITEMHITTEST, 0, (LPARAM)(LPLVHITTESTINFO)(plvhti)) -#define ListView_GetSelectionMark(hwndLV) \ - (int)SNDMSG((hwndLV), LVM_GETSELECTIONMARK, 0, 0) -#define ListView_SetSelectionMark(hwndLV, iItem) \ - (int)SNDMSG((hwndLV), LVM_SETSELECTIONMARK, 0, (LPARAM)(iItem)) -#define ListView_GetViewRect(hwndLV, prc) \ - (BOOL)SNDMSG((hwndLV),LVM_GETVIEWRECT,0,(LPARAM)(LPRECT)(prc)) -#define ListView_GetHeader(hwndLV) \ - (HWND)SNDMSG((hwndLV),LVM_GETHEADER,0,0L) -#define ListView_SetSelectedColumn(hwnd, iCol) \ - SNDMSG((hwnd), LVM_SETSELECTEDCOLUMN, (WPARAM)iCol, 0) -#define ListView_SetTileWidth(hwnd, cpWidth) \ - SNDMSG((hwnd), LVM_SETTILEWIDTH, (WPARAM)cpWidth, 0) -#define ListView_SetView(hwnd, iView) \ - (DWORD)SNDMSG((hwnd), LVM_SETVIEW, (WPARAM)(DWORD)iView, 0) -#define ListView_GetView(hwnd) \ - (DWORD)SNDMSG((hwnd), LVM_GETVIEW, 0, 0) -#define ListView_InsertGroup(hwnd, index, pgrp) \ - SNDMSG((hwnd), LVM_INSERTGROUP, (WPARAM)index, (LPARAM)pgrp) -#define ListView_SetGroupHeaderImageList(hwnd, himl) \ - SNDMSG((hwnd), LVM_SETIMAGELIST, (WPARAM)LVSIL_GROUPHEADER, (LPARAM)himl) -#define ListView_GetGroupHeaderImageList(hwnd) \ - SNDMSG((hwnd), LVM_GETIMAGELIST, (WPARAM)LVSIL_GROUPHEADER, 0) -#define ListView_SetGroupInfo(hwnd, iGroupId, pgrp) \ - SNDMSG((hwnd), LVM_SETGROUPINFO, (WPARAM)iGroupId, (LPARAM)pgrp) -#define ListView_GetGroupInfo(hwnd, iGroupId, pgrp) \ - SNDMSG((hwnd), LVM_GETGROUPINFO, (WPARAM)iGroupId, (LPARAM)pgrp) -#define ListView_RemoveGroup(hwnd, iGroupId) \ - SNDMSG((hwnd), LVM_REMOVEGROUP, (WPARAM)iGroupId, 0) -#define ListView_MoveGroup(hwnd, iGroupId, toIndex) \ - SNDMSG((hwnd), LVM_MOVEGROUP, (WPARAM)iGroupId, (LPARAM)toIndex) -#define ListView_MoveItemToGroup(hwnd, idItemFrom, idGroupTo) \ - SNDMSG((hwnd), LVM_MOVEITEMTOGROUP, (WPARAM)idItemFrom, (LPARAM)idGroupTo) -#define ListView_SetGroupMetrics(hwnd, pGroupMetrics) \ - SNDMSG((hwnd), LVM_SETGROUPMETRICS, 0, (LPARAM)pGroupMetrics) -#define ListView_GetGroupMetrics(hwnd, pGroupMetrics) \ - SNDMSG((hwnd), LVM_GETGROUPMETRICS, 0, (LPARAM)pGroupMetrics) -#define ListView_EnableGroupView(hwnd, fEnable) \ - SNDMSG((hwnd), LVM_ENABLEGROUPVIEW, (WPARAM)fEnable, 0) -#define ListView_SortGroups(hwnd, _pfnGroupCompate, _plv) \ - SNDMSG((hwnd), LVM_SORTGROUPS, (WPARAM)_pfnGroupCompate, (LPARAM)_plv) -#define ListView_InsertGroupSorted(hwnd, structInsert) \ - SNDMSG((hwnd), LVM_INSERTGROUPSORTED, (WPARAM)structInsert, 0) -#define ListView_RemoveAllGroups(hwnd) \ - SNDMSG((hwnd), LVM_REMOVEALLGROUPS, 0, 0) -#define ListView_HasGroup(hwnd, dwGroupId) \ - SNDMSG((hwnd), LVM_HASGROUP, dwGroupId, 0) -#define ListView_SetTileViewInfo(hwnd, ptvi) \ - SNDMSG((hwnd), LVM_SETTILEVIEWINFO, 0, (LPARAM)ptvi) -#define ListView_GetTileViewInfo(hwnd, ptvi) \ - SNDMSG((hwnd), LVM_GETTILEVIEWINFO, 0, (LPARAM)ptvi) -#define ListView_SetTileInfo(hwnd, pti) \ - SNDMSG((hwnd), LVM_SETTILEINFO, 0, (LPARAM)pti) -#define ListView_GetTileInfo(hwnd, pti) \ - SNDMSG((hwnd), LVM_GETTILEINFO, 0, (LPARAM)pti) -#define ListView_SetInsertMark(hwnd, lvim) \ - (BOOL)SNDMSG((hwnd), LVM_SETINSERTMARK, (WPARAM) 0, (LPARAM) (lvim)) -#define ListView_GetInsertMark(hwnd, lvim) \ - (BOOL)SNDMSG((hwnd), LVM_GETINSERTMARK, (WPARAM) 0, (LPARAM) (lvim)) -#define ListView_InsertMarkHitTest(hwnd, point, lvim) \ - (int)SNDMSG((hwnd), LVM_INSERTMARKHITTEST, (WPARAM)(LPPOINT)(point), (LPARAM)(LPLVINSERTMARK)(lvim)) -#define ListView_GetInsertMarkRect(hwnd, rc) \ - (int)SNDMSG((hwnd), LVM_GETINSERTMARKRECT, (WPARAM)0, (LPARAM)(LPRECT)(rc)) -#define ListView_SetInsertMarkColor(hwnd, color) \ - (COLORREF)SNDMSG((hwnd), LVM_SETINSERTMARKCOLOR, (WPARAM)0, (LPARAM)(COLORREF)(color)) -#define ListView_GetInsertMarkColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), LVM_GETINSERTMARKCOLOR, (WPARAM)0, (LPARAM)0) -#define ListView_SetInfoTip(hwndLV, plvInfoTip)\ - (BOOL)SNDMSG((hwndLV), LVM_SETINFOTIP, (WPARAM)0, (LPARAM)plvInfoTip) -#define ListView_GetSelectedColumn(hwnd) \ - (UINT)SNDMSG((hwnd), LVM_GETSELECTEDCOLUMN, 0, 0) -#define ListView_IsGroupViewEnabled(hwnd) \ - (BOOL)SNDMSG((hwnd), LVM_ISGROUPVIEWENABLED, 0, 0) -#define ListView_GetOutlineColor(hwnd) \ - (COLORREF)SNDMSG((hwnd), LVM_GETOUTLINECOLOR, 0, 0) -#define ListView_SetOutlineColor(hwnd, color) \ - (COLORREF)SNDMSG((hwnd), LVM_SETOUTLINECOLOR, (WPARAM)0, (LPARAM)(COLORREF)(color)) -#define ListView_CancelEditLabel(hwnd) \ - (VOID)SNDMSG((hwnd), LVM_CANCELEDITLABEL, (WPARAM)0, (LPARAM)0) -#define ListView_MapIndexToID(hwnd, index) \ - (UINT)SNDMSG((hwnd), LVM_MAPINDEXTOID, (WPARAM)index, (LPARAM)0) -#define ListView_MapIDToIndex(hwnd, id) \ - (UINT)SNDMSG((hwnd), LVM_MAPIDTOINDEX, (WPARAM)id, (LPARAM)0) -#define ListView_SetUnicodeFormat(hwnd, fUnicode) \ - (BOOL)SNDMSG((hwnd), LVM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0) -#define ListView_GetUnicodeFormat(hwnd) \ - (BOOL)SNDMSG((hwnd), LVM_GETUNICODEFORMAT, 0, 0) - -/* Tab Control */ - -#define WC_TABCONTROLA "SysTabControl32" -#if defined(__GNUC__) -# define WC_TABCONTROLW (const WCHAR []){ 'S','y','s', \ - 'T','a','b','C','o','n','t','r','o','l','3','2',0 } -#elif defined(_MSC_VER) -# define WC_TABCONTROLW L"SysTabControl32" +#ifdef UNICODE +#define LVN_ODFINDITEM LVN_ODFINDITEMW #else -static const WCHAR WC_TABCONTROLW[] = { 'S','y','s', - 'T','a','b','C','o','n','t','r','o','l','3','2',0 }; +#define LVN_ODFINDITEM LVN_ODFINDITEMA #endif -#define WC_TABCONTROL WINELIB_NAME_AW(WC_TABCONTROL) -/* tab control styles */ -#define TCS_SCROLLOPPOSITE 0x0001 /* assumes multiline tab */ -#define TCS_BOTTOM 0x0002 -#define TCS_RIGHT 0x0002 -#define TCS_MULTISELECT 0x0004 /* allow multi-select in button mode */ -#define TCS_FLATBUTTONS 0x0008 -#define TCS_FORCEICONLEFT 0x0010 -#define TCS_FORCELABELLEFT 0x0020 -#define TCS_HOTTRACK 0x0040 -#define TCS_VERTICAL 0x0080 -#define TCS_TABS 0x0000 -#define TCS_BUTTONS 0x0100 -#define TCS_SINGLELINE 0x0000 -#define TCS_MULTILINE 0x0200 -#define TCS_RIGHTJUSTIFY 0x0000 -#define TCS_FIXEDWIDTH 0x0400 -#define TCS_RAGGEDRIGHT 0x0800 -#define TCS_FOCUSONBUTTONDOWN 0x1000 -#define TCS_OWNERDRAWFIXED 0x2000 -#define TCS_TOOLTIPS 0x4000 -#define TCS_FOCUSNEVER 0x8000 -#define TCS_EX_FLATSEPARATORS 0x00000001 /* to be used with */ -#define TCS_EX_REGISTERDROP 0x00000002 /* TCM_SETEXTENDEDSTYLE */ +#define LVN_HOTTRACK (LVN_FIRST-21) +#define LVN_GETDISPINFOA (LVN_FIRST-50) +#define LVN_GETDISPINFOW (LVN_FIRST-77) +#define LVN_SETDISPINFOA (LVN_FIRST-51) +#define LVN_SETDISPINFOW (LVN_FIRST-78) +#ifdef UNICODE +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITW +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITW +#define LVN_GETDISPINFO LVN_GETDISPINFOW +#define LVN_SETDISPINFO LVN_SETDISPINFOW +#else +#define LVN_BEGINLABELEDIT LVN_BEGINLABELEDITA +#define LVN_ENDLABELEDIT LVN_ENDLABELEDITA +#define LVN_GETDISPINFO LVN_GETDISPINFOA +#define LVN_SETDISPINFO LVN_SETDISPINFOA +#endif -#define TCM_FIRST 0x1300 +#define LVIF_DI_SETITEM 0x1000 -#define TCM_GETIMAGELIST (TCM_FIRST + 2) -#define TCM_SETIMAGELIST (TCM_FIRST + 3) -#define TCM_GETITEMCOUNT (TCM_FIRST + 4) -#define TCM_GETITEM WINELIB_NAME_AW(TCM_GETITEM) -#define TCM_GETITEMA (TCM_FIRST + 5) -#define TCM_GETITEMW (TCM_FIRST + 60) -#define TCM_SETITEMA (TCM_FIRST + 6) -#define TCM_SETITEMW (TCM_FIRST + 61) -#define TCM_SETITEM WINELIB_NAME_AW(TCM_SETITEM) -#define TCM_INSERTITEMA (TCM_FIRST + 7) -#define TCM_INSERTITEMW (TCM_FIRST + 62) -#define TCM_INSERTITEM WINELIB_NAME_AW(TCM_INSERTITEM) -#define TCM_DELETEITEM (TCM_FIRST + 8) -#define TCM_DELETEALLITEMS (TCM_FIRST + 9) -#define TCM_GETITEMRECT (TCM_FIRST + 10) -#define TCM_GETCURSEL (TCM_FIRST + 11) -#define TCM_SETCURSEL (TCM_FIRST + 12) -#define TCM_HITTEST (TCM_FIRST + 13) -#define TCM_SETITEMEXTRA (TCM_FIRST + 14) -#define TCM_ADJUSTRECT (TCM_FIRST + 40) -#define TCM_SETITEMSIZE (TCM_FIRST + 41) -#define TCM_REMOVEIMAGE (TCM_FIRST + 42) -#define TCM_SETPADDING (TCM_FIRST + 43) -#define TCM_GETROWCOUNT (TCM_FIRST + 44) -#define TCM_GETTOOLTIPS (TCM_FIRST + 45) -#define TCM_SETTOOLTIPS (TCM_FIRST + 46) -#define TCM_GETCURFOCUS (TCM_FIRST + 47) -#define TCM_SETCURFOCUS (TCM_FIRST + 48) -#define TCM_SETMINTABWIDTH (TCM_FIRST + 49) -#define TCM_DESELECTALL (TCM_FIRST + 50) -#define TCM_HIGHLIGHTITEM (TCM_FIRST + 51) -#define TCM_SETEXTENDEDSTYLE (TCM_FIRST + 52) -#define TCM_GETEXTENDEDSTYLE (TCM_FIRST + 53) -#define TCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define TCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define LV_DISPINFOA NMLVDISPINFOA +#define LV_DISPINFOW NMLVDISPINFOW +#define LV_DISPINFO NMLVDISPINFO + typedef struct tagLVDISPINFO { + NMHDR hdr; + LVITEMA item; + } NMLVDISPINFOA,*LPNMLVDISPINFOA; -#define TCIF_TEXT 0x0001 -#define TCIF_IMAGE 0x0002 -#define TCIF_RTLREADING 0x0004 -#define TCIF_PARAM 0x0008 -#define TCIF_STATE 0x0010 + typedef struct tagLVDISPINFOW { + NMHDR hdr; + LVITEMW item; + } NMLVDISPINFOW,*LPNMLVDISPINFOW; -#define TCIS_BUTTONPRESSED 0x0001 -#define TCIS_HIGHLIGHTED 0x0002 +#ifdef UNICODE +#define NMLVDISPINFO NMLVDISPINFOW +#else +#define NMLVDISPINFO NMLVDISPINFOA +#endif -/* TabCtrl Macros */ -#define TabCtrl_GetImageList(hwnd) \ - (HIMAGELIST)SNDMSG((hwnd), TCM_GETIMAGELIST, 0, 0L) -#define TabCtrl_SetImageList(hwnd, himl) \ - (HIMAGELIST)SNDMSG((hwnd), TCM_SETIMAGELIST, 0, (LPARAM)(UINT)(HIMAGELIST)(himl)) -#define TabCtrl_GetItemCount(hwnd) \ - (int)SNDMSG((hwnd), TCM_GETITEMCOUNT, 0, 0L) -#define TabCtrl_GetItemA(hwnd, iItem, pitem) \ - (BOOL)SNDMSGA((hwnd), TCM_GETITEMA, (WPARAM)(int)iItem, (LPARAM)(TCITEMA *)(pitem)) -#define TabCtrl_GetItemW(hwnd, iItem, pitem) \ - (BOOL)SNDMSGW((hwnd), TCM_GETITEMW, (WPARAM)(int)iItem, (LPARAM)(TCITEMW *)(pitem)) -#define TabCtrl_GetItem WINELIB_NAME_AW(TabCtrl_GetItem) -#define TabCtrl_SetItemA(hwnd, iItem, pitem) \ - (BOOL)SNDMSGA((hwnd), TCM_SETITEMA, (WPARAM)(int)iItem, (LPARAM)(TCITEMA *)(pitem)) -#define TabCtrl_SetItemW(hwnd, iItem, pitem) \ - (BOOL)SNDMSGW((hwnd), TCM_SETITEMW, (WPARAM)(int)iItem, (LPARAM)(TCITEMW *)(pitem)) -#define TabCtrl_SetItem WINELIB_NAME_AW(TabCtrl_SetItem) -#define TabCtrl_InsertItemA(hwnd, iItem, pitem) \ - (int)SNDMSGA((hwnd), TCM_INSERTITEMA, (WPARAM)(int)iItem, (LPARAM)(const TCITEMA *)(pitem)) -#define TabCtrl_InsertItemW(hwnd, iItem, pitem) \ - (int)SNDMSGW((hwnd), TCM_INSERTITEMW, (WPARAM)(int)iItem, (LPARAM)(const TCITEMW *)(pitem)) -#define TabCtrl_InsertItem WINELIB_NAME_AW(TabCtrl_InsertItem) -#define TabCtrl_DeleteItem(hwnd, i) \ - (BOOL)SNDMSG((hwnd), TCM_DELETEITEM, (WPARAM)(int)(i), 0L) -#define TabCtrl_DeleteAllItems(hwnd) \ - (BOOL)SNDMSG((hwnd), TCM_DELETEALLITEMS, 0, 0L) -#define TabCtrl_GetItemRect(hwnd, i, prc) \ - (BOOL)SNDMSG((hwnd), TCM_GETITEMRECT, (WPARAM)(int)(i), (LPARAM)(RECT *)(prc)) -#define TabCtrl_GetCurSel(hwnd) \ - (int)SNDMSG((hwnd), TCM_GETCURSEL, 0, 0) -#define TabCtrl_SetCurSel(hwnd, i) \ - (int)SNDMSG((hwnd), TCM_SETCURSEL, (WPARAM)i, 0) -#define TabCtrl_HitTest(hwndTC, pinfo) \ - (int)SNDMSG((hwndTC), TCM_HITTEST, 0, (LPARAM)(TC_HITTESTINFO *)(pinfo)) -#define TabCtrl_SetItemExtra(hwndTC, cb) \ - (BOOL)SNDMSG((hwndTC), TCM_SETITEMEXTRA, (WPARAM)(cb), 0L) -#define TabCtrl_AdjustRect(hwnd, bLarger, prc) \ - (int)SNDMSG(hwnd, TCM_ADJUSTRECT, (WPARAM)(BOOL)bLarger, (LPARAM)(RECT *)prc) -#define TabCtrl_SetItemSize(hwnd, x, y) \ - (DWORD)SNDMSG((hwnd), TCM_SETITEMSIZE, 0, MAKELPARAM(x,y)) -#define TabCtrl_RemoveImage(hwnd, i) \ - (void)SNDMSG((hwnd), TCM_REMOVEIMAGE, i, 0L) -#define TabCtrl_SetPadding(hwnd, cx, cy) \ - (void)SNDMSG((hwnd), TCM_SETPADDING, 0, MAKELPARAM(cx, cy)) -#define TabCtrl_GetRowCount(hwnd) \ - (int)SNDMSG((hwnd), TCM_GETROWCOUNT, 0, 0L) -#define TabCtrl_GetToolTips(hwnd) \ - (HWND)SNDMSG((hwnd), TCM_GETTOOLTIPS, 0, 0L) -#define TabCtrl_SetToolTips(hwnd, hwndTT) \ - (void)SNDMSG((hwnd), TCM_SETTOOLTIPS, (WPARAM)hwndTT, 0L) -#define TabCtrl_GetCurFocus(hwnd) \ - (int)SNDMSG((hwnd), TCM_GETCURFOCUS, 0, 0) -#define TabCtrl_SetCurFocus(hwnd, i) \ - SNDMSG((hwnd),TCM_SETCURFOCUS, i, 0) -#define TabCtrl_SetMinTabWidth(hwnd, x) \ - (int)SNDMSG((hwnd), TCM_SETMINTABWIDTH, 0, x) -#define TabCtrl_DeselectAll(hwnd, fExcludeFocus)\ - (void)SNDMSG((hwnd), TCM_DESELECTALL, fExcludeFocus, 0) -#define TabCtrl_GetUnicodeFormat(hwnd) \ - (BOOL)SNDMSG((hwnd), TCM_GETUNICODEFORMAT, 0, 0) -#define TabCtrl_SetUnicodeFormat(hwnd, fUnicode) \ - (BOOL)SNDMSG((hwnd), TCM_SETUNICODEFORMAT, (WPARAM)fUnicode, 0) -#define TabCtrl_GetExtendedStyle(hwnd) \ - (BOOL)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, 0) -#define TabCtrl_SetExtendedStyle(hwnd, dwExStyle) \ - (BOOL)SNDMSG((hwnd), TCM_GETEXTENDEDSTYLE, 0, (LPARAM)dwExStyle) -#define TabCtrl_HighlightItem(hwnd, i, fHighlight) \ - (BOOL)SNDMSG((hwnd), TCM_HIGHLIGHTITEM, (WPARAM)i, (LPARAM)MAKELONG(fHighlight, 0)) +#define LVN_KEYDOWN (LVN_FIRST-55) -/* constants for TCHITTESTINFO */ - -#define TCHT_NOWHERE 0x01 -#define TCHT_ONITEMICON 0x02 -#define TCHT_ONITEMLABEL 0x04 -#define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL) - -typedef struct tagTCITEMHEADERA -{ - UINT mask; - UINT lpReserved1; - UINT lpReserved2; - LPSTR pszText; - int cchTextMax; - int iImage; -} TCITEMHEADERA, *LPTCITEMHEADERA; - -typedef struct tagTCITEMHEADERW -{ - UINT mask; - UINT lpReserved1; - UINT lpReserved2; - LPWSTR pszText; - int cchTextMax; - int iImage; -} TCITEMHEADERW, *LPTCITEMHEADERW; - -#define TCITEMHEADER WINELIB_NAME_AW(TCITEMHEADER) -#define LPTCITEMHEADER WINELIB_NAME_AW(LPTCITEMHEADER) -#define TC_ITEMHEADER WINELIB_NAME_AW(TCITEMHEADER) -#define LPTC_ITEMHEADER WINELIB_NAME_AW(LPTCITEMHEADER) - -typedef struct tagTCITEMA -{ - UINT mask; - UINT dwState; - UINT dwStateMask; - LPSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; -} TCITEMA, *LPTCITEMA; - -typedef struct tagTCITEMW -{ - UINT mask; - DWORD dwState; - DWORD dwStateMask; - LPWSTR pszText; - INT cchTextMax; - INT iImage; - LPARAM lParam; -} TCITEMW, *LPTCITEMW; - -#define TCITEM WINELIB_NAME_AW(TCITEM) -#define LPTCITEM WINELIB_NAME_AW(LPTCITEM) -#define TC_ITEM WINELIB_NAME_AW(TCITEM) -#define LPTC_ITEM WINELIB_NAME_AW(LPTCITEM) - -#define TCN_FIRST (0U-550U) -#define TCN_LAST (0U-580U) -#define TCN_KEYDOWN (TCN_FIRST - 0) -#define TCN_SELCHANGE (TCN_FIRST - 1) -#define TCN_SELCHANGING (TCN_FIRST - 2) -#define TCN_GETOBJECT (TCN_FIRST - 3) -#define TCN_FOCUSCHANGE (TCN_FIRST - 4) +#define LV_KEYDOWN NMLVKEYDOWN #include -typedef struct tagTCKEYDOWN -{ + + typedef struct tagLVKEYDOWN { NMHDR hdr; WORD wVKey; UINT flags; -} NMTCKEYDOWN; + } NMLVKEYDOWN,*LPNMLVKEYDOWN; + #include -#define TC_KEYDOWN NMTCKEYDOWN +#define LVN_MARQUEEBEGIN (LVN_FIRST-56) -/* ComboBoxEx control */ + typedef struct tagNMLVGETINFOTIPA { + NMHDR hdr; + DWORD dwFlags; + LPSTR pszText; + int cchTextMax; + int iItem; + int iSubItem; + LPARAM lParam; + } NMLVGETINFOTIPA,*LPNMLVGETINFOTIPA; -#define WC_COMBOBOXEXA "ComboBoxEx32" -#if defined(__GNUC__) -# define WC_COMBOBOXEXW (const WCHAR []){ 'C','o','m','b','o', \ - 'B','o','x','E','x','3','2',0 } -#elif defined(_MSC_VER) -# define WC_COMBOBOXEXW L"ComboBoxEx32" + typedef struct tagNMLVGETINFOTIPW { + NMHDR hdr; + DWORD dwFlags; + LPWSTR pszText; + int cchTextMax; + int iItem; + int iSubItem; + LPARAM lParam; + } NMLVGETINFOTIPW,*LPNMLVGETINFOTIPW; + +#define LVGIT_UNFOLDED 0x1 + +#define LVN_GETINFOTIPA (LVN_FIRST-57) +#define LVN_GETINFOTIPW (LVN_FIRST-58) + +#ifdef UNICODE +#define LVN_GETINFOTIP LVN_GETINFOTIPW +#define NMLVGETINFOTIP NMLVGETINFOTIPW +#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPW #else -static const WCHAR WC_COMBOBOXEXW[] = { 'C','o','m','b','o', - 'B','o','x','E','x','3','2',0 }; +#define LVN_GETINFOTIP LVN_GETINFOTIPA +#define NMLVGETINFOTIP NMLVGETINFOTIPA +#define LPNMLVGETINFOTIP LPNMLVGETINFOTIPA #endif -#define WC_COMBOBOXEX WINELIB_NAME_AW(WC_COMBOBOXEX) -#define CBEIF_TEXT 0x00000001 -#define CBEIF_IMAGE 0x00000002 -#define CBEIF_SELECTEDIMAGE 0x00000004 -#define CBEIF_OVERLAY 0x00000008 -#define CBEIF_INDENT 0x00000010 -#define CBEIF_LPARAM 0x00000020 -#define CBEIF_DI_SETITEM 0x10000000 + typedef struct tagNMLVSCROLL { + NMHDR hdr; + int dx; + int dy; + } NMLVSCROLL,*LPNMLVSCROLL; -#define CBEM_INSERTITEMA (WM_USER+1) -#define CBEM_INSERTITEMW (WM_USER+11) -#define CBEM_INSERTITEM WINELIB_NAME_AW(CBEM_INSERTITEM) -#define CBEM_SETIMAGELIST (WM_USER+2) -#define CBEM_GETIMAGELIST (WM_USER+3) -#define CBEM_GETITEMA (WM_USER+4) -#define CBEM_GETITEMW (WM_USER+13) -#define CBEM_GETITEM WINELIB_NAME_AW(CBEM_GETITEM) -#define CBEM_SETITEMA (WM_USER+5) -#define CBEM_SETITEMW (WM_USER+12) -#define CBEM_SETITEM WINELIB_NAME_AW(CBEM_SETITEM) -#define CBEM_DELETEITEM CB_DELETESTRING -#define CBEM_GETCOMBOCONTROL (WM_USER+6) -#define CBEM_GETEDITCONTROL (WM_USER+7) -#define CBEM_SETEXSTYLE (WM_USER+8) -#define CBEM_GETEXSTYLE (WM_USER+9) -#define CBEM_GETEXTENDEDSTYLE (WM_USER+9) -#define CBEM_SETEXTENDEDSTYLE (WM_USER+14) -#define CBEM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT -#define CBEM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define CBEM_HASEDITCHANGED (WM_USER+10) -#define CBEM_SETWINDOWTHEME CCM_SETWINDOWTHEME +#define LVN_BEGINSCROLL (LVN_FIRST-80) +#define LVN_ENDSCROLL (LVN_FIRST-81) +#endif -#define CBEIF_TEXT 0x00000001 -#define CBEIF_IMAGE 0x00000002 -#define CBEIF_SELECTEDIMAGE 0x00000004 -#define CBEIF_OVERLAY 0x00000008 -#define CBEIF_INDENT 0x00000010 -#define CBEIF_LPARAM 0x00000020 -#define CBEIF_DI_SETITEM 0x10000000 +#ifndef NOTREEVIEW -#define CBEN_FIRST (0U-800U) -#define CBEN_LAST (0U-830U) +#define WC_TREEVIEWA "SysTreeView32" +#define WC_TREEVIEWW L"SysTreeView32" +#ifdef UNICODE +#define WC_TREEVIEW WC_TREEVIEWW +#else +#define WC_TREEVIEW WC_TREEVIEWA +#endif -#define CBEN_GETDISPINFOA (CBEN_FIRST - 0) -#define CBEN_GETDISPINFOW (CBEN_FIRST - 7) -#define CBEN_GETDISPINFO WINELIB_NAME_AW(CBEN_GETDISPINFO) -#define CBEN_INSERTITEM (CBEN_FIRST - 1) -#define CBEN_DELETEITEM (CBEN_FIRST - 2) -#define CBEN_BEGINEDIT (CBEN_FIRST - 4) -#define CBEN_ENDEDITA (CBEN_FIRST - 5) -#define CBEN_ENDEDITW (CBEN_FIRST - 6) -#define CBEN_ENDEDIT WINELIB_NAME_AW(CBEN_ENDEDIT) -#define CBEN_DRAGBEGINA (CBEN_FIRST - 8) -#define CBEN_DRAGBEGINW (CBEN_FIRST - 9) -#define CBEN_DRAGBEGIN WINELIB_NAME_AW(CBEN_DRAGBEGIN) +#define TVS_HASBUTTONS 0x1 +#define TVS_HASLINES 0x2 +#define TVS_LINESATROOT 0x4 +#define TVS_EDITLABELS 0x8 +#define TVS_DISABLEDRAGDROP 0x10 +#define TVS_SHOWSELALWAYS 0x20 +#define TVS_RTLREADING 0x40 +#define TVS_NOTOOLTIPS 0x80 +#define TVS_CHECKBOXES 0x100 +#define TVS_TRACKSELECT 0x200 +#define TVS_SINGLEEXPAND 0x400 +#define TVS_INFOTIP 0x800 +#define TVS_FULLROWSELECT 0x1000 +#define TVS_NOSCROLL 0x2000 +#define TVS_NONEVENHEIGHT 0x4000 +#define TVS_NOHSCROLL 0x8000 -#define CBES_EX_NOEDITIMAGE 0x00000001 -#define CBES_EX_NOEDITIMAGEINDENT 0x00000002 -#define CBES_EX_PATHWORDBREAKPROC 0x00000004 -#define CBES_EX_NOSIZELIMIT 0x00000008 -#define CBES_EX_CASESENSITIVE 0x00000010 + typedef struct _TREEITEM *HTREEITEM; +#define TVIF_TEXT 0x1 +#define TVIF_IMAGE 0x2 +#define TVIF_PARAM 0x4 +#define TVIF_STATE 0x8 +#define TVIF_HANDLE 0x10 +#define TVIF_SELECTEDIMAGE 0x20 +#define TVIF_CHILDREN 0x40 +#define TVIF_INTEGRAL 0x80 +#define TVIS_SELECTED 0x2 +#define TVIS_CUT 0x4 +#define TVIS_DROPHILITED 0x8 +#define TVIS_BOLD 0x10 +#define TVIS_EXPANDED 0x20 +#define TVIS_EXPANDEDONCE 0x40 +#define TVIS_EXPANDPARTIAL 0x80 +#define TVIS_OVERLAYMASK 0xf00 +#define TVIS_STATEIMAGEMASK 0xF000 +#define TVIS_USERMASK 0xF000 -typedef struct tagCOMBOBOXEXITEMA -{ +#define I_CHILDRENCALLBACK (-1) + +#define LPTV_ITEMW LPTVITEMW +#define LPTV_ITEMA LPTVITEMA +#define TV_ITEMW TVITEMW +#define TV_ITEMA TVITEMA +#define LPTV_ITEM LPTVITEM +#define TV_ITEM TVITEM + + typedef struct tagTVITEMA { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + } TVITEMA,*LPTVITEMA; + + typedef struct tagTVITEMW { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + } TVITEMW,*LPTVITEMW; + + typedef struct tagTVITEMEXA { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + int iIntegral; + } TVITEMEXA,*LPTVITEMEXA; + + typedef struct tagTVITEMEXW { + UINT mask; + HTREEITEM hItem; + UINT state; + UINT stateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + int iSelectedImage; + int cChildren; + LPARAM lParam; + int iIntegral; + } TVITEMEXW,*LPTVITEMEXW; +#ifdef UNICODE + typedef TVITEMEXW TVITEMEX; + typedef LPTVITEMEXW LPTVITEMEX; +#else + typedef TVITEMEXA TVITEMEX; + typedef LPTVITEMEXA LPTVITEMEX; +#endif + +#ifdef UNICODE +#define TVITEM TVITEMW +#define LPTVITEM LPTVITEMW +#else +#define TVITEM TVITEMA +#define LPTVITEM LPTVITEMA +#endif + +#define TVI_ROOT ((HTREEITEM)(ULONG_PTR)-0x10000) +#define TVI_FIRST ((HTREEITEM)(ULONG_PTR)-0xffff) +#define TVI_LAST ((HTREEITEM)(ULONG_PTR)-0xfffe) +#define TVI_SORT ((HTREEITEM)(ULONG_PTR)-0xfffd) + +#define LPTV_INSERTSTRUCTA LPTVINSERTSTRUCTA +#define LPTV_INSERTSTRUCTW LPTVINSERTSTRUCTW +#define TV_INSERTSTRUCTA TVINSERTSTRUCTA +#define TV_INSERTSTRUCTW TVINSERTSTRUCTW +#define TV_INSERTSTRUCT TVINSERTSTRUCT +#define LPTV_INSERTSTRUCT LPTVINSERTSTRUCT + +#define TVINSERTSTRUCTA_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTA,item) +#define TVINSERTSTRUCTW_V1_SIZE CCSIZEOF_STRUCT(TVINSERTSTRUCTW,item) + + typedef struct tagTVINSERTSTRUCTA { + HTREEITEM hParent; + HTREEITEM hInsertAfter; + __MINGW_EXTENSION union { + TVITEMEXA itemex; + TV_ITEMA item; + } DUMMYUNIONNAME; + } TVINSERTSTRUCTA,*LPTVINSERTSTRUCTA; + + typedef struct tagTVINSERTSTRUCTW { + HTREEITEM hParent; + HTREEITEM hInsertAfter; + __MINGW_EXTENSION union { + TVITEMEXW itemex; + TV_ITEMW item; + } DUMMYUNIONNAME; + } TVINSERTSTRUCTW,*LPTVINSERTSTRUCTW; + +#ifdef UNICODE +#define TVINSERTSTRUCT TVINSERTSTRUCTW +#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTW +#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTW_V1_SIZE +#else +#define TVINSERTSTRUCT TVINSERTSTRUCTA +#define LPTVINSERTSTRUCT LPTVINSERTSTRUCTA +#define TVINSERTSTRUCT_V1_SIZE TVINSERTSTRUCTA_V1_SIZE +#endif + +#define TVM_INSERTITEMA (TV_FIRST+0) +#define TVM_INSERTITEMW (TV_FIRST+50) +#ifdef UNICODE +#define TVM_INSERTITEM TVM_INSERTITEMW +#else +#define TVM_INSERTITEM TVM_INSERTITEMA +#endif + +#define TreeView_InsertItem(hwnd,lpis) (HTREEITEM)SNDMSG((hwnd),TVM_INSERTITEM,0,(LPARAM)(LPTV_INSERTSTRUCT)(lpis)) + +#define TVM_DELETEITEM (TV_FIRST+1) +#define TreeView_DeleteItem(hwnd,hitem) (WINBOOL)SNDMSG((hwnd),TVM_DELETEITEM,0,(LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_DeleteAllItems(hwnd) (WINBOOL)SNDMSG((hwnd),TVM_DELETEITEM,0,(LPARAM)TVI_ROOT) + +#define TVM_EXPAND (TV_FIRST+2) +#define TreeView_Expand(hwnd,hitem,code) (WINBOOL)SNDMSG((hwnd),TVM_EXPAND,(WPARAM)(code),(LPARAM)(HTREEITEM)(hitem)) + +#define TVE_COLLAPSE 0x1 +#define TVE_EXPAND 0x2 +#define TVE_TOGGLE 0x3 +#define TVE_EXPANDPARTIAL 0x4000 +#define TVE_COLLAPSERESET 0x8000 + +#define TVM_GETITEMRECT (TV_FIRST+4) +#define TreeView_GetItemRect(hwnd,hitem,prc,code) (*(HTREEITEM *)prc = (hitem),(WINBOOL)SNDMSG((hwnd),TVM_GETITEMRECT,(WPARAM)(code),(LPARAM)(RECT *)(prc))) + +#define TVM_GETCOUNT (TV_FIRST+5) +#define TreeView_GetCount(hwnd) (UINT)SNDMSG((hwnd),TVM_GETCOUNT,0,0) + +#define TVM_GETINDENT (TV_FIRST+6) +#define TreeView_GetIndent(hwnd) (UINT)SNDMSG((hwnd),TVM_GETINDENT,0,0) + +#define TVM_SETINDENT (TV_FIRST+7) +#define TreeView_SetIndent(hwnd,indent) (WINBOOL)SNDMSG((hwnd),TVM_SETINDENT,(WPARAM)(indent),0) + +#define TVM_GETIMAGELIST (TV_FIRST+8) +#define TreeView_GetImageList(hwnd,iImage) (HIMAGELIST)SNDMSG((hwnd),TVM_GETIMAGELIST,iImage,0) + +#define TVSIL_NORMAL 0 +#define TVSIL_STATE 2 + +#define TVM_SETIMAGELIST (TV_FIRST+9) +#define TreeView_SetImageList(hwnd,himl,iImage) (HIMAGELIST)SNDMSG((hwnd),TVM_SETIMAGELIST,iImage,(LPARAM)(HIMAGELIST)(himl)) + +#define TVM_GETNEXTITEM (TV_FIRST+10) +#define TreeView_GetNextItem(hwnd,hitem,code) (HTREEITEM)SNDMSG((hwnd),TVM_GETNEXTITEM,(WPARAM)(code),(LPARAM)(HTREEITEM)(hitem)) + +#define TVGN_ROOT 0x0 +#define TVGN_NEXT 0x1 +#define TVGN_PREVIOUS 0x2 +#define TVGN_PARENT 0x3 +#define TVGN_CHILD 0x4 +#define TVGN_FIRSTVISIBLE 0x5 +#define TVGN_NEXTVISIBLE 0x6 +#define TVGN_PREVIOUSVISIBLE 0x7 +#define TVGN_DROPHILITE 0x8 +#define TVGN_CARET 0x9 +#define TVGN_LASTVISIBLE 0xa + +#define TVSI_NOSINGLEEXPAND 0x8000 + +#define TreeView_GetChild(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_CHILD) +#define TreeView_GetNextSibling(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_NEXT) +#define TreeView_GetPrevSibling(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_PREVIOUS) +#define TreeView_GetParent(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_PARENT) +#define TreeView_GetFirstVisible(hwnd) TreeView_GetNextItem(hwnd,NULL,TVGN_FIRSTVISIBLE) +#define TreeView_GetNextVisible(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_NEXTVISIBLE) +#define TreeView_GetPrevVisible(hwnd,hitem) TreeView_GetNextItem(hwnd,hitem,TVGN_PREVIOUSVISIBLE) +#define TreeView_GetSelection(hwnd) TreeView_GetNextItem(hwnd,NULL,TVGN_CARET) +#define TreeView_GetDropHilight(hwnd) TreeView_GetNextItem(hwnd,NULL,TVGN_DROPHILITE) +#define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd,NULL,TVGN_ROOT) +#define TreeView_GetLastVisible(hwnd) TreeView_GetNextItem(hwnd,NULL,TVGN_LASTVISIBLE) + +#define TVM_SELECTITEM (TV_FIRST+11) +#define TreeView_Select(hwnd,hitem,code) (WINBOOL)SNDMSG((hwnd),TVM_SELECTITEM,(WPARAM)(code),(LPARAM)(HTREEITEM)(hitem)) + +#define TreeView_SelectItem(hwnd,hitem) TreeView_Select(hwnd,hitem,TVGN_CARET) +#define TreeView_SelectDropTarget(hwnd,hitem) TreeView_Select(hwnd,hitem,TVGN_DROPHILITE) +#define TreeView_SelectSetFirstVisible(hwnd,hitem) TreeView_Select(hwnd,hitem,TVGN_FIRSTVISIBLE) + +#define TVM_GETITEMA (TV_FIRST+12) +#define TVM_GETITEMW (TV_FIRST+62) + +#ifdef UNICODE +#define TVM_GETITEM TVM_GETITEMW +#else +#define TVM_GETITEM TVM_GETITEMA +#endif + +#define TreeView_GetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),TVM_GETITEM,0,(LPARAM)(TV_ITEM *)(pitem)) + +#define TVM_SETITEMA (TV_FIRST+13) +#define TVM_SETITEMW (TV_FIRST+63) + +#ifdef UNICODE +#define TVM_SETITEM TVM_SETITEMW +#else +#define TVM_SETITEM TVM_SETITEMA +#endif + +#define TreeView_SetItem(hwnd,pitem) (WINBOOL)SNDMSG((hwnd),TVM_SETITEM,0,(LPARAM)(const TV_ITEM *)(pitem)) + +#define TVM_EDITLABELA (TV_FIRST+14) +#define TVM_EDITLABELW (TV_FIRST+65) +#ifdef UNICODE +#define TVM_EDITLABEL TVM_EDITLABELW +#else +#define TVM_EDITLABEL TVM_EDITLABELA +#endif + +#define TreeView_EditLabel(hwnd,hitem) (HWND)SNDMSG((hwnd),TVM_EDITLABEL,0,(LPARAM)(HTREEITEM)(hitem)) + +#define TVM_GETEDITCONTROL (TV_FIRST+15) +#define TreeView_GetEditControl(hwnd) (HWND)SNDMSG((hwnd),TVM_GETEDITCONTROL,0,0) + +#define TVM_GETVISIBLECOUNT (TV_FIRST+16) +#define TreeView_GetVisibleCount(hwnd) (UINT)SNDMSG((hwnd),TVM_GETVISIBLECOUNT,0,0) + +#define TVM_HITTEST (TV_FIRST+17) +#define TreeView_HitTest(hwnd,lpht) (HTREEITEM)SNDMSG((hwnd),TVM_HITTEST,0,(LPARAM)(LPTV_HITTESTINFO)(lpht)) + +#define LPTV_HITTESTINFO LPTVHITTESTINFO +#define TV_HITTESTINFO TVHITTESTINFO + + typedef struct tagTVHITTESTINFO { + POINT pt; + UINT flags; + HTREEITEM hItem; + } TVHITTESTINFO,*LPTVHITTESTINFO; + +#define TVHT_NOWHERE 0x1 +#define TVHT_ONITEMICON 0x2 +#define TVHT_ONITEMLABEL 0x4 +#define TVHT_ONITEM (TVHT_ONITEMICON | TVHT_ONITEMLABEL | TVHT_ONITEMSTATEICON) +#define TVHT_ONITEMINDENT 0x8 +#define TVHT_ONITEMBUTTON 0x10 +#define TVHT_ONITEMRIGHT 0x20 +#define TVHT_ONITEMSTATEICON 0x40 + +#define TVHT_ABOVE 0x100 +#define TVHT_BELOW 0x200 +#define TVHT_TORIGHT 0x400 +#define TVHT_TOLEFT 0x800 + +#define TVM_CREATEDRAGIMAGE (TV_FIRST+18) +#define TreeView_CreateDragImage(hwnd,hitem) (HIMAGELIST)SNDMSG((hwnd),TVM_CREATEDRAGIMAGE,0,(LPARAM)(HTREEITEM)(hitem)) + +#define TVM_SORTCHILDREN (TV_FIRST+19) +#define TreeView_SortChildren(hwnd,hitem,recurse) (WINBOOL)SNDMSG((hwnd),TVM_SORTCHILDREN,(WPARAM)(recurse),(LPARAM)(HTREEITEM)(hitem)) + +#define TVM_ENSUREVISIBLE (TV_FIRST+20) +#define TreeView_EnsureVisible(hwnd,hitem) (WINBOOL)SNDMSG((hwnd),TVM_ENSUREVISIBLE,0,(LPARAM)(HTREEITEM)(hitem)) + +#define TVM_SORTCHILDRENCB (TV_FIRST+21) +#define TreeView_SortChildrenCB(hwnd,psort,recurse) (WINBOOL)SNDMSG((hwnd),TVM_SORTCHILDRENCB,(WPARAM)(recurse),(LPARAM)(LPTV_SORTCB)(psort)) + +#define TVM_ENDEDITLABELNOW (TV_FIRST+22) +#define TreeView_EndEditLabelNow(hwnd,fCancel) (WINBOOL)SNDMSG((hwnd),TVM_ENDEDITLABELNOW,(WPARAM)(fCancel),0) + +#define TVM_GETISEARCHSTRINGA (TV_FIRST+23) +#define TVM_GETISEARCHSTRINGW (TV_FIRST+64) + +#ifdef UNICODE +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGW +#else +#define TVM_GETISEARCHSTRING TVM_GETISEARCHSTRINGA +#endif + +#define TVM_SETTOOLTIPS (TV_FIRST+24) +#define TreeView_SetToolTips(hwnd,hwndTT) (HWND)SNDMSG((hwnd),TVM_SETTOOLTIPS,(WPARAM)(hwndTT),0) +#define TVM_GETTOOLTIPS (TV_FIRST+25) +#define TreeView_GetToolTips(hwnd) (HWND)SNDMSG((hwnd),TVM_GETTOOLTIPS,0,0) +#define TreeView_GetISearchString(hwndTV,lpsz) (WINBOOL)SNDMSG((hwndTV),TVM_GETISEARCHSTRING,0,(LPARAM)(LPTSTR)(lpsz)) + +#define TVM_SETINSERTMARK (TV_FIRST+26) +#define TreeView_SetInsertMark(hwnd,hItem,fAfter) (WINBOOL)SNDMSG((hwnd),TVM_SETINSERTMARK,(WPARAM) (fAfter),(LPARAM) (hItem)) +#define TVM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TreeView_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),TVM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) +#define TVM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TreeView_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),TVM_GETUNICODEFORMAT,0,0) + +#define TVM_SETITEMHEIGHT (TV_FIRST+27) +#define TreeView_SetItemHeight(hwnd,iHeight) (int)SNDMSG((hwnd),TVM_SETITEMHEIGHT,(WPARAM)(iHeight),0) +#define TVM_GETITEMHEIGHT (TV_FIRST+28) +#define TreeView_GetItemHeight(hwnd) (int)SNDMSG((hwnd),TVM_GETITEMHEIGHT,0,0) +#define TVM_SETBKCOLOR (TV_FIRST+29) +#define TreeView_SetBkColor(hwnd,clr) (COLORREF)SNDMSG((hwnd),TVM_SETBKCOLOR,0,(LPARAM)(clr)) +#define TVM_SETTEXTCOLOR (TV_FIRST+30) +#define TreeView_SetTextColor(hwnd,clr) (COLORREF)SNDMSG((hwnd),TVM_SETTEXTCOLOR,0,(LPARAM)(clr)) +#define TVM_GETBKCOLOR (TV_FIRST+31) +#define TreeView_GetBkColor(hwnd) (COLORREF)SNDMSG((hwnd),TVM_GETBKCOLOR,0,0) +#define TVM_GETTEXTCOLOR (TV_FIRST+32) +#define TreeView_GetTextColor(hwnd) (COLORREF)SNDMSG((hwnd),TVM_GETTEXTCOLOR,0,0) +#define TVM_SETSCROLLTIME (TV_FIRST+33) +#define TreeView_SetScrollTime(hwnd,uTime) (UINT)SNDMSG((hwnd),TVM_SETSCROLLTIME,uTime,0) +#define TVM_GETSCROLLTIME (TV_FIRST+34) +#define TreeView_GetScrollTime(hwnd) (UINT)SNDMSG((hwnd),TVM_GETSCROLLTIME,0,0) +#define TVM_SETINSERTMARKCOLOR (TV_FIRST+37) +#define TreeView_SetInsertMarkColor(hwnd,clr) (COLORREF)SNDMSG((hwnd),TVM_SETINSERTMARKCOLOR,0,(LPARAM)(clr)) +#define TVM_GETINSERTMARKCOLOR (TV_FIRST+38) +#define TreeView_GetInsertMarkColor(hwnd) (COLORREF)SNDMSG((hwnd),TVM_GETINSERTMARKCOLOR,0,0) + +#define TreeView_SetItemState(hwndTV,hti,data,_mask) { TVITEM _ms_TVi; _ms_TVi.mask = TVIF_STATE; _ms_TVi.hItem = hti; _ms_TVi.stateMask = _mask; _ms_TVi.state = data; SNDMSG((hwndTV),TVM_SETITEM,0,(LPARAM)(TV_ITEM *)&_ms_TVi);} +#define TreeView_SetCheckState(hwndTV,hti,fCheck) TreeView_SetItemState(hwndTV,hti,INDEXTOSTATEIMAGEMASK((fCheck)?2:1),TVIS_STATEIMAGEMASK) +#define TVM_GETITEMSTATE (TV_FIRST+39) +#define TreeView_GetItemState(hwndTV,hti,mask) (UINT)SNDMSG((hwndTV),TVM_GETITEMSTATE,(WPARAM)(hti),(LPARAM)(mask)) +#define TreeView_GetCheckState(hwndTV,hti) ((((UINT)(SNDMSG((hwndTV),TVM_GETITEMSTATE,(WPARAM)(hti),TVIS_STATEIMAGEMASK))) >> 12) -1) +#define TVM_SETLINECOLOR (TV_FIRST+40) +#define TreeView_SetLineColor(hwnd,clr) (COLORREF)SNDMSG((hwnd),TVM_SETLINECOLOR,0,(LPARAM)(clr)) +#define TVM_GETLINECOLOR (TV_FIRST+41) +#define TreeView_GetLineColor(hwnd) (COLORREF)SNDMSG((hwnd),TVM_GETLINECOLOR,0,0) + +#define TVM_MAPACCIDTOHTREEITEM (TV_FIRST+42) +#define TreeView_MapAccIDToHTREEITEM(hwnd,id) (HTREEITEM)SNDMSG((hwnd),TVM_MAPACCIDTOHTREEITEM,id,0) + +#define TVM_MAPHTREEITEMTOACCID (TV_FIRST+43) +#define TreeView_MapHTREEITEMToAccID(hwnd,htreeitem) (UINT)SNDMSG((hwnd),TVM_MAPHTREEITEMTOACCID,(WPARAM)htreeitem,0) + + typedef int (CALLBACK *PFNTVCOMPARE)(LPARAM lParam1,LPARAM lParam2,LPARAM lParamSort); + +#define LPTV_SORTCB LPTVSORTCB +#define TV_SORTCB TVSORTCB + + typedef struct tagTVSORTCB { + HTREEITEM hParent; + PFNTVCOMPARE lpfnCompare; + LPARAM lParam; + } TVSORTCB,*LPTVSORTCB; + +#define LPNM_TREEVIEWA LPNMTREEVIEWA +#define LPNM_TREEVIEWW LPNMTREEVIEWW +#define NM_TREEVIEWW NMTREEVIEWW +#define NM_TREEVIEWA NMTREEVIEWA +#define LPNM_TREEVIEW LPNMTREEVIEW +#define NM_TREEVIEW NMTREEVIEW + + typedef struct tagNMTREEVIEWA { + NMHDR hdr; + UINT action; + TVITEMA itemOld; + TVITEMA itemNew; + POINT ptDrag; + } NMTREEVIEWA,*LPNMTREEVIEWA; + + typedef struct tagNMTREEVIEWW { + NMHDR hdr; + UINT action; + TVITEMW itemOld; + TVITEMW itemNew; + POINT ptDrag; + } NMTREEVIEWW,*LPNMTREEVIEWW; + +#ifdef UNICODE +#define NMTREEVIEW NMTREEVIEWW +#define LPNMTREEVIEW LPNMTREEVIEWW +#else +#define NMTREEVIEW NMTREEVIEWA +#define LPNMTREEVIEW LPNMTREEVIEWA +#endif + +#define TVN_SELCHANGINGA (TVN_FIRST-1) +#define TVN_SELCHANGINGW (TVN_FIRST-50) +#define TVN_SELCHANGEDA (TVN_FIRST-2) +#define TVN_SELCHANGEDW (TVN_FIRST-51) + +#define TVC_UNKNOWN 0x0 +#define TVC_BYMOUSE 0x1 +#define TVC_BYKEYBOARD 0x2 + +#define TVN_GETDISPINFOA (TVN_FIRST-3) +#define TVN_GETDISPINFOW (TVN_FIRST-52) +#define TVN_SETDISPINFOA (TVN_FIRST-4) +#define TVN_SETDISPINFOW (TVN_FIRST-53) + +#define TVIF_DI_SETITEM 0x1000 + +#define TV_DISPINFOA NMTVDISPINFOA +#define TV_DISPINFOW NMTVDISPINFOW +#define TV_DISPINFO NMTVDISPINFO + + typedef struct tagTVDISPINFOA { + NMHDR hdr; + TVITEMA item; + } NMTVDISPINFOA,*LPNMTVDISPINFOA; + + typedef struct tagTVDISPINFOW { + NMHDR hdr; + TVITEMW item; + } NMTVDISPINFOW,*LPNMTVDISPINFOW; + +#ifdef UNICODE +#define NMTVDISPINFO NMTVDISPINFOW +#define LPNMTVDISPINFO LPNMTVDISPINFOW +#else +#define NMTVDISPINFO NMTVDISPINFOA +#define LPNMTVDISPINFO LPNMTVDISPINFOA +#endif + +#if (_WIN32_IE >= 0x0600) + +typedef struct tagTVDISPINFOEXA { + NMHDR hdr; + TVITEMEXA item; +} NMTVDISPINFOEXA, *LPNMTVDISPINFOEXA; + +typedef struct tagTVDISPINFOEXW { + NMHDR hdr; + TVITEMEXW item; +} NMTVDISPINFOEXW, *LPNMTVDISPINFOEXW; + +#ifdef UNICODE +#define NMTVDISPINFOEX NMTVDISPINFOEXW +#define LPNMTVDISPINFOEX LPNMTVDISPINFOEXW +#else +#define NMTVDISPINFOEX NMTVDISPINFOEXA +#define LPNMTVDISPINFOEX LPNMTVDISPINFOEXA +#endif /* UNICODE */ + +#define TV_DISPINFOEXA NMTVDISPINFOEXA +#define TV_DISPINFOEXW NMTVDISPINFOEXW +#define TV_DISPINFOEX NMTVDISPINFOEX + +#endif /* (_WIN32_IE >= 0x0600) */ + +#define TVN_ITEMEXPANDINGA (TVN_FIRST-5) +#define TVN_ITEMEXPANDINGW (TVN_FIRST-54) +#define TVN_ITEMEXPANDEDA (TVN_FIRST-6) +#define TVN_ITEMEXPANDEDW (TVN_FIRST-55) +#define TVN_BEGINDRAGA (TVN_FIRST-7) +#define TVN_BEGINDRAGW (TVN_FIRST-56) +#define TVN_BEGINRDRAGA (TVN_FIRST-8) +#define TVN_BEGINRDRAGW (TVN_FIRST-57) +#define TVN_DELETEITEMA (TVN_FIRST-9) +#define TVN_DELETEITEMW (TVN_FIRST-58) +#define TVN_BEGINLABELEDITA (TVN_FIRST-10) +#define TVN_BEGINLABELEDITW (TVN_FIRST-59) +#define TVN_ENDLABELEDITA (TVN_FIRST-11) +#define TVN_ENDLABELEDITW (TVN_FIRST-60) +#define TVN_KEYDOWN (TVN_FIRST-12) +#define TVN_GETINFOTIPA (TVN_FIRST-13) +#define TVN_GETINFOTIPW (TVN_FIRST-14) +#define TVN_SINGLEEXPAND (TVN_FIRST-15) + +#define TVNRET_DEFAULT 0 +#define TVNRET_SKIPOLD 1 +#define TVNRET_SKIPNEW 2 + +#define TV_KEYDOWN NMTVKEYDOWN + +#include + + typedef struct tagTVKEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; + } NMTVKEYDOWN,*LPNMTVKEYDOWN; + +#include + +#ifdef UNICODE +#define TVN_SELCHANGING TVN_SELCHANGINGW +#define TVN_SELCHANGED TVN_SELCHANGEDW +#define TVN_GETDISPINFO TVN_GETDISPINFOW +#define TVN_SETDISPINFO TVN_SETDISPINFOW +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGW +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDW +#define TVN_BEGINDRAG TVN_BEGINDRAGW +#define TVN_BEGINRDRAG TVN_BEGINRDRAGW +#define TVN_DELETEITEM TVN_DELETEITEMW +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITW +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITW +#else +#define TVN_SELCHANGING TVN_SELCHANGINGA +#define TVN_SELCHANGED TVN_SELCHANGEDA +#define TVN_GETDISPINFO TVN_GETDISPINFOA +#define TVN_SETDISPINFO TVN_SETDISPINFOA +#define TVN_ITEMEXPANDING TVN_ITEMEXPANDINGA +#define TVN_ITEMEXPANDED TVN_ITEMEXPANDEDA +#define TVN_BEGINDRAG TVN_BEGINDRAGA +#define TVN_BEGINRDRAG TVN_BEGINRDRAGA +#define TVN_DELETEITEM TVN_DELETEITEMA +#define TVN_BEGINLABELEDIT TVN_BEGINLABELEDITA +#define TVN_ENDLABELEDIT TVN_ENDLABELEDITA +#endif + +#define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW,clrTextBk) + + typedef struct tagNMTVCUSTOMDRAW { + NMCUSTOMDRAW nmcd; + COLORREF clrText; + COLORREF clrTextBk; + int iLevel; + } NMTVCUSTOMDRAW,*LPNMTVCUSTOMDRAW; + + typedef struct tagNMTVGETINFOTIPA { + NMHDR hdr; + LPSTR pszText; + int cchTextMax; + HTREEITEM hItem; + LPARAM lParam; + } NMTVGETINFOTIPA,*LPNMTVGETINFOTIPA; + + typedef struct tagNMTVGETINFOTIPW { + NMHDR hdr; + LPWSTR pszText; + int cchTextMax; + HTREEITEM hItem; + LPARAM lParam; + } NMTVGETINFOTIPW,*LPNMTVGETINFOTIPW; + +#ifdef UNICODE +#define TVN_GETINFOTIP TVN_GETINFOTIPW +#define NMTVGETINFOTIP NMTVGETINFOTIPW +#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPW +#else +#define TVN_GETINFOTIP TVN_GETINFOTIPA +#define NMTVGETINFOTIP NMTVGETINFOTIPA +#define LPNMTVGETINFOTIP LPNMTVGETINFOTIPA +#endif + +#define TVCDRF_NOIMAGES 0x10000 +#endif + +#ifndef NOUSEREXCONTROLS + +#define WC_COMBOBOXEXW L"ComboBoxEx32" +#define WC_COMBOBOXEXA "ComboBoxEx32" + +#ifdef UNICODE +#define WC_COMBOBOXEX WC_COMBOBOXEXW +#else +#define WC_COMBOBOXEX WC_COMBOBOXEXA +#endif + +#define CBEIF_TEXT 0x1 +#define CBEIF_IMAGE 0x2 +#define CBEIF_SELECTEDIMAGE 0x4 +#define CBEIF_OVERLAY 0x8 +#define CBEIF_INDENT 0x10 +#define CBEIF_LPARAM 0x20 + +#define CBEIF_DI_SETITEM 0x10000000 + + typedef struct tagCOMBOBOXEXITEMA { UINT mask; INT_PTR iItem; LPSTR pszText; @@ -4349,11 +3887,11 @@ typedef struct tagCOMBOBOXEXITEMA int iOverlay; int iIndent; LPARAM lParam; -} COMBOBOXEXITEMA, *PCOMBOBOXEXITEMA; -typedef COMBOBOXEXITEMA const *PCCOMBOEXITEMA; /* Yes, there's a BOX missing */ + } COMBOBOXEXITEMA,*PCOMBOBOXEXITEMA; + typedef COMBOBOXEXITEMA CONST *PCCOMBOEXITEMA; -typedef struct tagCOMBOBOXEXITEMW -{ + typedef struct tagCOMBOBOXEXITEMW + { UINT mask; INT_PTR iItem; LPWSTR pszText; @@ -4363,809 +3901,1212 @@ typedef struct tagCOMBOBOXEXITEMW int iOverlay; int iIndent; LPARAM lParam; -} COMBOBOXEXITEMW, *PCOMBOBOXEXITEMW; -typedef COMBOBOXEXITEMW const *PCCOMBOEXITEMW; /* Yes, there's a BOX missing */ + } COMBOBOXEXITEMW,*PCOMBOBOXEXITEMW; + typedef COMBOBOXEXITEMW CONST *PCCOMBOEXITEMW; -#define COMBOBOXEXITEM WINELIB_NAME_AW(COMBOBOXEXITEM) -#define PCOMBOBOXEXITEM WINELIB_NAME_AW(PCOMBOBOXEXITEM) -#define PCCOMBOBOXEXITEM WINELIB_NAME_AW(PCCOMBOEXITEM) /* Yes, there's a BOX missing */ +#ifdef UNICODE +#define COMBOBOXEXITEM COMBOBOXEXITEMW +#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMW +#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMW +#else +#define COMBOBOXEXITEM COMBOBOXEXITEMA +#define PCOMBOBOXEXITEM PCOMBOBOXEXITEMA +#define PCCOMBOBOXEXITEM PCCOMBOBOXEXITEMA +#endif -#define CBENF_KILLFOCUS 1 -#define CBENF_RETURN 2 -#define CBENF_ESCAPE 3 -#define CBENF_DROPDOWN 4 +#define CBEM_INSERTITEMA (WM_USER+1) +#define CBEM_SETIMAGELIST (WM_USER+2) +#define CBEM_GETIMAGELIST (WM_USER+3) +#define CBEM_GETITEMA (WM_USER+4) +#define CBEM_SETITEMA (WM_USER+5) +#define CBEM_DELETEITEM CB_DELETESTRING +#define CBEM_GETCOMBOCONTROL (WM_USER+6) +#define CBEM_GETEDITCONTROL (WM_USER+7) +#define CBEM_SETEXSTYLE (WM_USER+8) +#define CBEM_SETEXTENDEDSTYLE (WM_USER+14) +#define CBEM_GETEXSTYLE (WM_USER+9) +#define CBEM_GETEXTENDEDSTYLE (WM_USER+9) +#define CBEM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define CBEM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define CBEM_HASEDITCHANGED (WM_USER+10) +#define CBEM_INSERTITEMW (WM_USER+11) +#define CBEM_SETITEMW (WM_USER+12) +#define CBEM_GETITEMW (WM_USER+13) + +#ifdef UNICODE +#define CBEM_INSERTITEM CBEM_INSERTITEMW +#define CBEM_SETITEM CBEM_SETITEMW +#define CBEM_GETITEM CBEM_GETITEMW +#else +#define CBEM_INSERTITEM CBEM_INSERTITEMA +#define CBEM_SETITEM CBEM_SETITEMA +#define CBEM_GETITEM CBEM_GETITEMA +#endif + +#define CBEM_SETWINDOWTHEME CCM_SETWINDOWTHEME + +#define CBES_EX_NOEDITIMAGE 0x1 +#define CBES_EX_NOEDITIMAGEINDENT 0x2 +#define CBES_EX_PATHWORDBREAKPROC 0x4 +#define CBES_EX_NOSIZELIMIT 0x8 +#define CBES_EX_CASESENSITIVE 0x10 + + typedef struct { + NMHDR hdr; + COMBOBOXEXITEMA ceItem; + } NMCOMBOBOXEXA,*PNMCOMBOBOXEXA; + + typedef struct { + NMHDR hdr; + COMBOBOXEXITEMW ceItem; + } NMCOMBOBOXEXW,*PNMCOMBOBOXEXW; + +#ifdef UNICODE +#define NMCOMBOBOXEX NMCOMBOBOXEXW +#define PNMCOMBOBOXEX PNMCOMBOBOXEXW +#define CBEN_GETDISPINFO CBEN_GETDISPINFOW +#else +#define NMCOMBOBOXEX NMCOMBOBOXEXA +#define PNMCOMBOBOXEX PNMCOMBOBOXEXA +#define CBEN_GETDISPINFO CBEN_GETDISPINFOA +#endif + +#define CBEN_GETDISPINFOA (CBEN_FIRST - 0) +#define CBEN_INSERTITEM (CBEN_FIRST - 1) +#define CBEN_DELETEITEM (CBEN_FIRST - 2) +#define CBEN_BEGINEDIT (CBEN_FIRST - 4) +#define CBEN_ENDEDITA (CBEN_FIRST - 5) +#define CBEN_ENDEDITW (CBEN_FIRST - 6) + +#define CBEN_GETDISPINFOW (CBEN_FIRST - 7) + +#define CBEN_DRAGBEGINA (CBEN_FIRST - 8) +#define CBEN_DRAGBEGINW (CBEN_FIRST - 9) + +#ifdef UNICODE +#define CBEN_DRAGBEGIN CBEN_DRAGBEGINW +#else +#define CBEN_DRAGBEGIN CBEN_DRAGBEGINA +#endif + +#ifdef UNICODE +#define CBEN_ENDEDIT CBEN_ENDEDITW +#else +#define CBEN_ENDEDIT CBEN_ENDEDITA +#endif + +#define CBENF_KILLFOCUS 1 +#define CBENF_RETURN 2 +#define CBENF_ESCAPE 3 +#define CBENF_DROPDOWN 4 #define CBEMAXSTRLEN 260 -typedef struct tagNMCBEENDEDITW -{ - NMHDR hdr; - BOOL fChanged; - int iNewSelection; - WCHAR szText[CBEMAXSTRLEN]; - int iWhy; -} NMCBEENDEDITW, *LPNMCBEENDEDITW, *PNMCBEENDEDITW; - -typedef struct tagNMCBEENDEDITA -{ - NMHDR hdr; - BOOL fChanged; - int iNewSelection; - char szText[CBEMAXSTRLEN]; - int iWhy; -} NMCBEENDEDITA, *LPNMCBEENDEDITA, *PNMCBEENDEDITA; - -#define NMCBEENDEDIT WINELIB_NAME_AW(NMCBEENDEDIT) -#define LPNMCBEENDEDIT WINELIB_NAME_AW(LPNMCBEENDEDIT) -#define PNMCBEENDEDIT WINELIB_NAME_AW(PNMCBEENDEDIT) - -typedef struct -{ - NMHDR hdr; - COMBOBOXEXITEMA ceItem; -} NMCOMBOBOXEXA, *PNMCOMBOBOXEXA; - -typedef struct -{ - NMHDR hdr; - COMBOBOXEXITEMW ceItem; -} NMCOMBOBOXEXW, *PNMCOMBOBOXEXW; - -#define NMCOMBOBOXEX WINELIB_NAME_AW(NMCOMBOBOXEX) -#define PNMCOMBOBOXEX WINELIB_NAME_AW(PNMCOMBOBOXEX) - -typedef struct -{ - NMHDR hdr; - int iItemid; - char szText[CBEMAXSTRLEN]; -} NMCBEDRAGBEGINA, *PNMCBEDRAGBEGINA, *LPNMCBEDRAGBEGINA; - -typedef struct -{ + typedef struct { NMHDR hdr; int iItemid; WCHAR szText[CBEMAXSTRLEN]; -} NMCBEDRAGBEGINW, *PNMCBEDRAGBEGINW, *LPNMCBEDRAGBEGINW; + }NMCBEDRAGBEGINW,*LPNMCBEDRAGBEGINW,*PNMCBEDRAGBEGINW; -#define NMCBEDRAGBEGIN WINELIB_NAME_AW(NMCBEDRAGBEGIN) -#define PNMCBEDRAGBEGIN WINELIB_NAME_AW(PNMCBEDRAGBEGIN) -#define LPNMCBEDRAGBEGIN WINELIB_NAME_AW(LPNMCBEDRAGBEGIN) - - -/* Hotkey control */ - -#define HOTKEY_CLASSA "msctls_hotkey32" -#if defined(__GNUC__) -# define HOTKEY_CLASSW (const WCHAR []){ 'm','s','c','t','l','s','_', \ - 'h','o','t','k','e','y','3','2',0 } -#elif defined(_MSC_VER) -# define HOTKEY_CLASSW L"msctls_hotkey32" -#else -static const WCHAR HOTKEY_CLASSW[] = { 'm','s','c','t','l','s','_', - 'h','o','t','k','e','y','3','2',0 }; -#endif -#define HOTKEY_CLASS WINELIB_NAME_AW(HOTKEY_CLASS) - -#define HOTKEYF_SHIFT 0x01 -#define HOTKEYF_CONTROL 0x02 -#define HOTKEYF_ALT 0x04 -#define HOTKEYF_EXT 0x08 - -#define HKCOMB_NONE 0x0001 -#define HKCOMB_S 0x0002 -#define HKCOMB_C 0x0004 -#define HKCOMB_A 0x0008 -#define HKCOMB_SC 0x0010 -#define HKCOMB_SA 0x0020 -#define HKCOMB_CA 0x0040 -#define HKCOMB_SCA 0x0080 - -#define HKM_SETHOTKEY (WM_USER+1) -#define HKM_GETHOTKEY (WM_USER+2) -#define HKM_SETRULES (WM_USER+3) - - -/* animate control */ - -#define ANIMATE_CLASSA "SysAnimate32" -#if defined(__GNUC__) -# define ANIMATE_CLASSW (const WCHAR []){ 'S','y','s', \ - 'A','n','i','m','a','t','e','3','2',0 } -#elif defined(_MSC_VER) -# define ANIMATE_CLASSW L"SysAnimate32" -#else -static const WCHAR ANIMATE_CLASSW[] = { 'S','y','s', - 'A','n','i','m','a','t','e','3','2',0 }; -#endif -#define ANIMATE_CLASS WINELIB_NAME_AW(ANIMATE_CLASS) - -#define ACS_CENTER 0x0001 -#define ACS_TRANSPARENT 0x0002 -#define ACS_AUTOPLAY 0x0004 -#define ACS_TIMER 0x0008 /* no threads, just timers */ - -#define ACM_OPENA (WM_USER+100) -#define ACM_OPENW (WM_USER+103) -#define ACM_OPEN WINELIB_NAME_AW(ACM_OPEN) -#define ACM_PLAY (WM_USER+101) -#define ACM_STOP (WM_USER+102) - -#define ACN_START 1 -#define ACN_STOP 2 - -#define Animate_CreateA(hwndP,id,dwStyle,hInstance) \ - CreateWindowA(ANIMATE_CLASSA,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL) -#define Animate_CreateW(hwndP,id,dwStyle,hInstance) \ - CreateWindowW(ANIMATE_CLASSW,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL) -#define Animate_Create WINELIB_NAME_AW(Animate_Create) -#define Animate_OpenA(hwnd,szName) \ - (BOOL)SNDMSGA(hwnd,ACM_OPENA,0,(LPARAM)(LPSTR)(szName)) -#define Animate_OpenW(hwnd,szName) \ - (BOOL)SNDMSGW(hwnd,ACM_OPENW,0,(LPARAM)(LPWSTR)(szName)) -#define Animate_Open WINELIB_NAME_AW(Animate_Open) -#define Animate_OpenExA(hwnd,hInst,szName) \ - (BOOL)SNDMSGA(hwnd,ACM_OPENA,(WPARAM)hInst,(LPARAM)(LPSTR)(szName)) -#define Animate_OpenExW(hwnd,hInst,szName) \ - (BOOL)SNDMSGW(hwnd,ACM_OPENW,(WPARAM)hInst,(LPARAM)(LPWSTR)(szName)) -#define Animate_OpenEx WINELIB_NAME_AW(Animate_OpenEx) -#define Animate_Play(hwnd,from,to,rep) \ - (BOOL)SNDMSG(hwnd,ACM_PLAY,(WPARAM)(UINT)(rep),(LPARAM)MAKELONG(from,to)) -#define Animate_Stop(hwnd) \ - (BOOL)SNDMSG(hwnd,ACM_STOP,0,0) -#define Animate_Close(hwnd) \ - (BOOL)SNDMSG(hwnd,ACM_OPENA,0,0) -#define Animate_Seek(hwnd,frame) \ - (BOOL)SNDMSG(hwnd,ACM_PLAY,1,(LPARAM)MAKELONG(frame,frame)) - - -/************************************************************************** - * IP Address control - */ - -#define WC_IPADDRESSA "SysIPAddress32" -#if defined(__GNUC__) -# define WC_IPADDRESSW (const WCHAR []){ 'S','y','s', \ - 'I','P','A','d','d','r','e','s','s','3','2',0 } -#elif defined(_MSC_VER) -# define WC_IPADDRESSW L"SysIPAddress32" -#else -static const WCHAR WC_IPADDRESSW[] = { 'S','y','s', - 'I','P','A','d','d','r','e','s','s','3','2',0 }; -#endif -#define WC_IPADDRESS WINELIB_NAME_AW(WC_IPADDRESS) - -#define IPM_CLEARADDRESS (WM_USER+100) -#define IPM_SETADDRESS (WM_USER+101) -#define IPM_GETADDRESS (WM_USER+102) -#define IPM_SETRANGE (WM_USER+103) -#define IPM_SETFOCUS (WM_USER+104) -#define IPM_ISBLANK (WM_USER+105) - -#define IPN_FIRST (0U-860U) -#define IPN_LAST (0U-879U) -#define IPN_FIELDCHANGED (IPN_FIRST-0) - -typedef struct tagNMIPADDRESS -{ + typedef struct { NMHDR hdr; - INT iField; - INT iValue; -} NMIPADDRESS, *LPNMIPADDRESS; + int iItemid; + char szText[CBEMAXSTRLEN]; + }NMCBEDRAGBEGINA,*LPNMCBEDRAGBEGINA,*PNMCBEDRAGBEGINA; -#define MAKEIPRANGE(low,high) \ - ((LPARAM)(WORD)(((BYTE)(high)<<8)+(BYTE)(low))) -#define MAKEIPADDRESS(b1,b2,b3,b4) \ - ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4)))) - -#define FIRST_IPADDRESS(x) (((x)>>24)&0xff) -#define SECOND_IPADDRESS(x) (((x)>>16)&0xff) -#define THIRD_IPADDRESS(x) (((x)>>8)&0xff) -#define FOURTH_IPADDRESS(x) ((x)&0xff) - - -/************************************************************************** - * Native Font control - */ - -#define WC_NATIVEFONTCTLA "NativeFontCtl" -#if defined(__GNUC__) -# define WC_NATIVEFONTCTLW (const WCHAR []){ 'N','a','t','i','v','e', \ - 'F','o','n','t','C','t','l',0 } -#elif defined(_MSC_VER) -# define WC_NATIVEFONTCTLW L"NativeFontCtl" +#ifdef UNICODE +#define NMCBEDRAGBEGIN NMCBEDRAGBEGINW +#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINW +#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINW #else -static const WCHAR WC_NATIVEFONTCTLW[] = { 'N','a','t','i','v','e', - 'F','o','n','t','C','t','l',0 }; +#define NMCBEDRAGBEGIN NMCBEDRAGBEGINA +#define LPNMCBEDRAGBEGIN LPNMCBEDRAGBEGINA +#define PNMCBEDRAGBEGIN PNMCBEDRAGBEGINA #endif -#define WC_NATIVEFONTCTL WINELIB_NAME_AW(WC_NATIVEFONTCTL) -#define NFS_EDIT 0x0001 -#define NFS_STATIC 0x0002 -#define NFS_LISTCOMBO 0x0004 -#define NFS_BUTTON 0x0008 -#define NFS_ALL 0x0010 + typedef struct { + NMHDR hdr; + WINBOOL fChanged; + int iNewSelection; + WCHAR szText[CBEMAXSTRLEN]; + int iWhy; + } NMCBEENDEDITW,*LPNMCBEENDEDITW,*PNMCBEENDEDITW; + typedef struct { + NMHDR hdr; + WINBOOL fChanged; + int iNewSelection; + char szText[CBEMAXSTRLEN]; + int iWhy; + } NMCBEENDEDITA,*LPNMCBEENDEDITA,*PNMCBEENDEDITA; -/************************************************************************** - * Month calendar control - * - */ - -#define MONTHCAL_CLASSA "SysMonthCal32" -#if defined(__GNUC__) -# define MONTHCAL_CLASSW (const WCHAR []){ 'S','y','s', \ - 'M','o','n','t','h','C','a','l','3','2',0 } -#elif defined(_MSC_VER) -# define MONTHCAL_CLASSW L"SysMonthCal32" +#ifdef UNICODE +#define NMCBEENDEDIT NMCBEENDEDITW +#define LPNMCBEENDEDIT LPNMCBEENDEDITW +#define PNMCBEENDEDIT PNMCBEENDEDITW #else -static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', - 'M','o','n','t','h','C','a','l','3','2',0 }; +#define NMCBEENDEDIT NMCBEENDEDITA +#define LPNMCBEENDEDIT LPNMCBEENDEDITA +#define PNMCBEENDEDIT PNMCBEENDEDITA +#endif #endif -#define MONTHCAL_CLASS WINELIB_NAME_AW(MONTHCAL_CLASS) -#define MCM_FIRST 0x1000 -#define MCN_FIRST (0U-750U) -#define MCN_LAST (0U-759U) +#ifndef NOTABCONTROL +#define WC_TABCONTROLA "SysTabControl32" +#define WC_TABCONTROLW L"SysTabControl32" +#ifdef UNICODE +#define WC_TABCONTROL WC_TABCONTROLW +#else +#define WC_TABCONTROL WC_TABCONTROLA +#endif -#define MCM_GETCURSEL (MCM_FIRST + 1) -#define MCM_SETCURSEL (MCM_FIRST + 2) -#define MCM_GETMAXSELCOUNT (MCM_FIRST + 3) -#define MCM_SETMAXSELCOUNT (MCM_FIRST + 4) -#define MCM_GETSELRANGE (MCM_FIRST + 5) -#define MCM_SETSELRANGE (MCM_FIRST + 6) -#define MCM_GETMONTHRANGE (MCM_FIRST + 7) -#define MCM_SETDAYSTATE (MCM_FIRST + 8) -#define MCM_GETMINREQRECT (MCM_FIRST + 9) -#define MCM_SETCOLOR (MCM_FIRST + 10) -#define MCM_GETCOLOR (MCM_FIRST + 11) -#define MCM_SETTODAY (MCM_FIRST + 12) -#define MCM_GETTODAY (MCM_FIRST + 13) -#define MCM_HITTEST (MCM_FIRST + 14) -#define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST + 15) -#define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST + 16) -#define MCM_GETRANGE (MCM_FIRST + 17) -#define MCM_SETRANGE (MCM_FIRST + 18) -#define MCM_GETMONTHDELTA (MCM_FIRST + 19) -#define MCM_SETMONTHDELTA (MCM_FIRST + 20) -#define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21) -#define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT -#define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TCS_SCROLLOPPOSITE 0x1 +#define TCS_BOTTOM 0x2 +#define TCS_RIGHT 0x2 +#define TCS_MULTISELECT 0x4 +#define TCS_FLATBUTTONS 0x8 +#define TCS_FORCEICONLEFT 0x10 +#define TCS_FORCELABELLEFT 0x20 +#define TCS_HOTTRACK 0x40 +#define TCS_VERTICAL 0x80 +#define TCS_TABS 0x0 +#define TCS_BUTTONS 0x100 +#define TCS_SINGLELINE 0x0 +#define TCS_MULTILINE 0x200 +#define TCS_RIGHTJUSTIFY 0x0 +#define TCS_FIXEDWIDTH 0x400 +#define TCS_RAGGEDRIGHT 0x800 +#define TCS_FOCUSONBUTTONDOWN 0x1000 +#define TCS_OWNERDRAWFIXED 0x2000 +#define TCS_TOOLTIPS 0x4000 +#define TCS_FOCUSNEVER 0x8000 +#define TCS_EX_FLATSEPARATORS 0x1 +#define TCS_EX_REGISTERDROP 0x2 -/* Notifications */ +#define TCM_GETIMAGELIST (TCM_FIRST+2) +#define TabCtrl_GetImageList(hwnd) (HIMAGELIST)SNDMSG((hwnd),TCM_GETIMAGELIST,0,0L) -#define MCN_SELCHANGE (MCN_FIRST + 1) -#define MCN_GETDAYSTATE (MCN_FIRST + 3) -#define MCN_SELECT (MCN_FIRST + 4) +#define TCM_SETIMAGELIST (TCM_FIRST+3) +#define TabCtrl_SetImageList(hwnd,himl) (HIMAGELIST)SNDMSG((hwnd),TCM_SETIMAGELIST,0,(LPARAM)(HIMAGELIST)(himl)) -#define MCSC_BACKGROUND 0 -#define MCSC_TEXT 1 -#define MCSC_TITLEBK 2 -#define MCSC_TITLETEXT 3 -#define MCSC_MONTHBK 4 +#define TCM_GETITEMCOUNT (TCM_FIRST+4) +#define TabCtrl_GetItemCount(hwnd) (int)SNDMSG((hwnd),TCM_GETITEMCOUNT,0,0L) + +#define TCIF_TEXT 0x1 +#define TCIF_IMAGE 0x2 +#define TCIF_RTLREADING 0x4 +#define TCIF_PARAM 0x8 +#define TCIF_STATE 0x10 + +#define TCIS_BUTTONPRESSED 0x1 +#define TCIS_HIGHLIGHTED 0x2 + +#define TC_ITEMHEADERA TCITEMHEADERA +#define TC_ITEMHEADERW TCITEMHEADERW +#define TC_ITEMHEADER TCITEMHEADER + + typedef struct tagTCITEMHEADERA { + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPSTR pszText; + int cchTextMax; + int iImage; + } TCITEMHEADERA,*LPTCITEMHEADERA; + + typedef struct tagTCITEMHEADERW { + UINT mask; + UINT lpReserved1; + UINT lpReserved2; + LPWSTR pszText; + int cchTextMax; + int iImage; + } TCITEMHEADERW,*LPTCITEMHEADERW; + +#ifdef UNICODE +#define TCITEMHEADER TCITEMHEADERW +#define LPTCITEMHEADER LPTCITEMHEADERW +#else +#define TCITEMHEADER TCITEMHEADERA +#define LPTCITEMHEADER LPTCITEMHEADERA +#endif + +#define TC_ITEMA TCITEMA +#define TC_ITEMW TCITEMW +#define TC_ITEM TCITEM + + typedef struct tagTCITEMA { + UINT mask; + DWORD dwState; + DWORD dwStateMask; + LPSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + } TCITEMA,*LPTCITEMA; + + typedef struct tagTCITEMW { + UINT mask; + DWORD dwState; + DWORD dwStateMask; + LPWSTR pszText; + int cchTextMax; + int iImage; + LPARAM lParam; + } TCITEMW,*LPTCITEMW; + +#ifdef UNICODE +#define TCITEM TCITEMW +#define LPTCITEM LPTCITEMW +#else +#define TCITEM TCITEMA +#define LPTCITEM LPTCITEMA +#endif + +#define TCM_GETITEMA (TCM_FIRST+5) +#define TCM_GETITEMW (TCM_FIRST+60) + +#ifdef UNICODE +#define TCM_GETITEM TCM_GETITEMW +#else +#define TCM_GETITEM TCM_GETITEMA +#endif + +#define TabCtrl_GetItem(hwnd,iItem,pitem) (WINBOOL)SNDMSG((hwnd),TCM_GETITEM,(WPARAM)(int)(iItem),(LPARAM)(TC_ITEM *)(pitem)) + +#define TCM_SETITEMA (TCM_FIRST+6) +#define TCM_SETITEMW (TCM_FIRST+61) + +#ifdef UNICODE +#define TCM_SETITEM TCM_SETITEMW +#else +#define TCM_SETITEM TCM_SETITEMA +#endif + +#define TabCtrl_SetItem(hwnd,iItem,pitem) (WINBOOL)SNDMSG((hwnd),TCM_SETITEM,(WPARAM)(int)(iItem),(LPARAM)(TC_ITEM *)(pitem)) + +#define TCM_INSERTITEMA (TCM_FIRST+7) +#define TCM_INSERTITEMW (TCM_FIRST+62) + +#ifdef UNICODE +#define TCM_INSERTITEM TCM_INSERTITEMW +#else +#define TCM_INSERTITEM TCM_INSERTITEMA +#endif + +#define TabCtrl_InsertItem(hwnd,iItem,pitem) (int)SNDMSG((hwnd),TCM_INSERTITEM,(WPARAM)(int)(iItem),(LPARAM)(const TC_ITEM *)(pitem)) + +#define TCM_DELETEITEM (TCM_FIRST+8) +#define TabCtrl_DeleteItem(hwnd,i) (WINBOOL)SNDMSG((hwnd),TCM_DELETEITEM,(WPARAM)(int)(i),0L) + +#define TCM_DELETEALLITEMS (TCM_FIRST+9) +#define TabCtrl_DeleteAllItems(hwnd) (WINBOOL)SNDMSG((hwnd),TCM_DELETEALLITEMS,0,0L) + +#define TCM_GETITEMRECT (TCM_FIRST+10) +#define TabCtrl_GetItemRect(hwnd,i,prc) (WINBOOL)SNDMSG((hwnd),TCM_GETITEMRECT,(WPARAM)(int)(i),(LPARAM)(RECT *)(prc)) + +#define TCM_GETCURSEL (TCM_FIRST+11) +#define TabCtrl_GetCurSel(hwnd) (int)SNDMSG((hwnd),TCM_GETCURSEL,0,0) + +#define TCM_SETCURSEL (TCM_FIRST+12) +#define TabCtrl_SetCurSel(hwnd,i) (int)SNDMSG((hwnd),TCM_SETCURSEL,(WPARAM)(i),0) + +#define TCHT_NOWHERE 0x1 +#define TCHT_ONITEMICON 0x2 +#define TCHT_ONITEMLABEL 0x4 +#define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL) + +#define LPTC_HITTESTINFO LPTCHITTESTINFO +#define TC_HITTESTINFO TCHITTESTINFO + + typedef struct tagTCHITTESTINFO { + POINT pt; + UINT flags; + } TCHITTESTINFO,*LPTCHITTESTINFO; + +#define TCM_HITTEST (TCM_FIRST+13) +#define TabCtrl_HitTest(hwndTC,pinfo) (int)SNDMSG((hwndTC),TCM_HITTEST,0,(LPARAM)(TC_HITTESTINFO *)(pinfo)) +#define TCM_SETITEMEXTRA (TCM_FIRST+14) +#define TabCtrl_SetItemExtra(hwndTC,cb) (WINBOOL)SNDMSG((hwndTC),TCM_SETITEMEXTRA,(WPARAM)(cb),0L) +#define TCM_ADJUSTRECT (TCM_FIRST+40) +#define TabCtrl_AdjustRect(hwnd,bLarger,prc) (int)SNDMSG(hwnd,TCM_ADJUSTRECT,(WPARAM)(WINBOOL)(bLarger),(LPARAM)(RECT *)prc) +#define TCM_SETITEMSIZE (TCM_FIRST+41) +#define TabCtrl_SetItemSize(hwnd,x,y) (DWORD)SNDMSG((hwnd),TCM_SETITEMSIZE,0,MAKELPARAM(x,y)) +#define TCM_REMOVEIMAGE (TCM_FIRST+42) +#define TabCtrl_RemoveImage(hwnd,i) (void)SNDMSG((hwnd),TCM_REMOVEIMAGE,i,0L) +#define TCM_SETPADDING (TCM_FIRST+43) +#define TabCtrl_SetPadding(hwnd,cx,cy) (void)SNDMSG((hwnd),TCM_SETPADDING,0,MAKELPARAM(cx,cy)) +#define TCM_GETROWCOUNT (TCM_FIRST+44) +#define TabCtrl_GetRowCount(hwnd) (int)SNDMSG((hwnd),TCM_GETROWCOUNT,0,0L) +#define TCM_GETTOOLTIPS (TCM_FIRST+45) +#define TabCtrl_GetToolTips(hwnd) (HWND)SNDMSG((hwnd),TCM_GETTOOLTIPS,0,0L) +#define TCM_SETTOOLTIPS (TCM_FIRST+46) +#define TabCtrl_SetToolTips(hwnd,hwndTT) (void)SNDMSG((hwnd),TCM_SETTOOLTIPS,(WPARAM)(hwndTT),0L) +#define TCM_GETCURFOCUS (TCM_FIRST+47) +#define TabCtrl_GetCurFocus(hwnd) (int)SNDMSG((hwnd),TCM_GETCURFOCUS,0,0) +#define TCM_SETCURFOCUS (TCM_FIRST+48) +#define TabCtrl_SetCurFocus(hwnd,i) SNDMSG((hwnd),TCM_SETCURFOCUS,i,0) +#define TCM_SETMINTABWIDTH (TCM_FIRST+49) +#define TabCtrl_SetMinTabWidth(hwnd,x) (int)SNDMSG((hwnd),TCM_SETMINTABWIDTH,0,x) +#define TCM_DESELECTALL (TCM_FIRST+50) +#define TabCtrl_DeselectAll(hwnd,fExcludeFocus) (void)SNDMSG((hwnd),TCM_DESELECTALL,fExcludeFocus,0) +#define TCM_HIGHLIGHTITEM (TCM_FIRST+51) +#define TabCtrl_HighlightItem(hwnd,i,fHighlight) (WINBOOL)SNDMSG((hwnd),TCM_HIGHLIGHTITEM,(WPARAM)(i),(LPARAM)MAKELONG (fHighlight,0)) +#define TCM_SETEXTENDEDSTYLE (TCM_FIRST+52) +#define TabCtrl_SetExtendedStyle(hwnd,dw) (DWORD)SNDMSG((hwnd),TCM_SETEXTENDEDSTYLE,0,dw) +#define TCM_GETEXTENDEDSTYLE (TCM_FIRST+53) +#define TabCtrl_GetExtendedStyle(hwnd) (DWORD)SNDMSG((hwnd),TCM_GETEXTENDEDSTYLE,0,0) +#define TCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define TabCtrl_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),TCM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) +#define TCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define TabCtrl_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),TCM_GETUNICODEFORMAT,0,0) + +#define TCN_KEYDOWN (TCN_FIRST - 0) + +#define TC_KEYDOWN NMTCKEYDOWN + +#include + + typedef struct tagTCKEYDOWN { + NMHDR hdr; + WORD wVKey; + UINT flags; + } NMTCKEYDOWN; + +#include + +#define TCN_SELCHANGE (TCN_FIRST - 1) +#define TCN_SELCHANGING (TCN_FIRST - 2) +#define TCN_GETOBJECT (TCN_FIRST - 3) +#define TCN_FOCUSCHANGE (TCN_FIRST - 4) +#endif + +#ifndef NOANIMATE + +#define ANIMATE_CLASSW L"SysAnimate32" +#define ANIMATE_CLASSA "SysAnimate32" +#ifdef UNICODE +#define ANIMATE_CLASS ANIMATE_CLASSW +#else +#define ANIMATE_CLASS ANIMATE_CLASSA +#endif + +#define ACS_CENTER 0x1 +#define ACS_TRANSPARENT 0x2 +#define ACS_AUTOPLAY 0x4 +#define ACS_TIMER 0x8 + +#define ACM_OPENA (WM_USER+100) +#define ACM_OPENW (WM_USER+103) +#ifdef UNICODE +#define ACM_OPEN ACM_OPENW +#else +#define ACM_OPEN ACM_OPENA +#endif + +#define ACM_PLAY (WM_USER+101) +#define ACM_STOP (WM_USER+102) + +#define ACN_START 1 +#define ACN_STOP 2 + +#define Animate_Create(hwndP,id,dwStyle,hInstance) CreateWindow(ANIMATE_CLASS,NULL,dwStyle,0,0,0,0,hwndP,(HMENU)(id),hInstance,NULL) + +#define Animate_Open(hwnd,szName) (WINBOOL)SNDMSG(hwnd,ACM_OPEN,0,(LPARAM)(LPTSTR)(szName)) +#define Animate_OpenEx(hwnd,hInst,szName) (WINBOOL)SNDMSG(hwnd,ACM_OPEN,(WPARAM)(hInst),(LPARAM)(LPTSTR)(szName)) +#define Animate_Play(hwnd,from,to,rep) (WINBOOL)SNDMSG(hwnd,ACM_PLAY,(WPARAM)(rep),(LPARAM)MAKELONG(from,to)) +#define Animate_Stop(hwnd) (WINBOOL)SNDMSG(hwnd,ACM_STOP,0,0) +#define Animate_Close(hwnd) Animate_Open(hwnd,NULL) +#define Animate_Seek(hwnd,frame) Animate_Play(hwnd,frame,frame,1) +#endif + +#ifndef NOMONTHCAL +#define MONTHCAL_CLASSW L"SysMonthCal32" +#define MONTHCAL_CLASSA "SysMonthCal32" +#ifdef UNICODE +#define MONTHCAL_CLASS MONTHCAL_CLASSW +#else +#define MONTHCAL_CLASS MONTHCAL_CLASSA +#endif + + typedef DWORD MONTHDAYSTATE,*LPMONTHDAYSTATE; + +#define MCM_FIRST 0x1000 + +#define MCM_GETCURSEL (MCM_FIRST+1) +#define MonthCal_GetCurSel(hmc,pst) (WINBOOL)SNDMSG(hmc,MCM_GETCURSEL,0,(LPARAM)(pst)) +#define MCM_SETCURSEL (MCM_FIRST+2) +#define MonthCal_SetCurSel(hmc,pst) (WINBOOL)SNDMSG(hmc,MCM_SETCURSEL,0,(LPARAM)(pst)) +#define MCM_GETMAXSELCOUNT (MCM_FIRST+3) +#define MonthCal_GetMaxSelCount(hmc) (DWORD)SNDMSG(hmc,MCM_GETMAXSELCOUNT,0,0L) +#define MCM_SETMAXSELCOUNT (MCM_FIRST+4) +#define MonthCal_SetMaxSelCount(hmc,n) (WINBOOL)SNDMSG(hmc,MCM_SETMAXSELCOUNT,(WPARAM)(n),0L) +#define MCM_GETSELRANGE (MCM_FIRST+5) +#define MonthCal_GetSelRange(hmc,rgst) SNDMSG(hmc,MCM_GETSELRANGE,0,(LPARAM)(rgst)) +#define MCM_SETSELRANGE (MCM_FIRST+6) +#define MonthCal_SetSelRange(hmc,rgst) SNDMSG(hmc,MCM_SETSELRANGE,0,(LPARAM)(rgst)) +#define MCM_GETMONTHRANGE (MCM_FIRST+7) +#define MonthCal_GetMonthRange(hmc,gmr,rgst) (DWORD)SNDMSG(hmc,MCM_GETMONTHRANGE,(WPARAM)(gmr),(LPARAM)(rgst)) +#define MCM_SETDAYSTATE (MCM_FIRST+8) +#define MonthCal_SetDayState(hmc,cbds,rgds) SNDMSG(hmc,MCM_SETDAYSTATE,(WPARAM)(cbds),(LPARAM)(rgds)) +#define MCM_GETMINREQRECT (MCM_FIRST+9) +#define MonthCal_GetMinReqRect(hmc,prc) SNDMSG(hmc,MCM_GETMINREQRECT,0,(LPARAM)(prc)) +#define MCM_SETCOLOR (MCM_FIRST+10) +#define MonthCal_SetColor(hmc,iColor,clr) SNDMSG(hmc,MCM_SETCOLOR,iColor,clr) +#define MCM_GETCOLOR (MCM_FIRST+11) +#define MonthCal_GetColor(hmc,iColor) SNDMSG(hmc,MCM_GETCOLOR,iColor,0) + +#define MCSC_BACKGROUND 0 +#define MCSC_TEXT 1 +#define MCSC_TITLEBK 2 +#define MCSC_TITLETEXT 3 +#define MCSC_MONTHBK 4 #define MCSC_TRAILINGTEXT 5 -#define MCS_DAYSTATE 0x0001 -#define MCS_MULTISELECT 0x0002 -#define MCS_WEEKNUMBERS 0x0004 -#define MCS_NOTODAY 0x0010 -#define MCS_NOTODAYCIRCLE 0x0008 -#define MCS_NOTRAILINGDATES 0x0040 +#define MCM_SETTODAY (MCM_FIRST+12) +#define MonthCal_SetToday(hmc,pst) SNDMSG(hmc,MCM_SETTODAY,0,(LPARAM)(pst)) +#define MCM_GETTODAY (MCM_FIRST+13) +#define MonthCal_GetToday(hmc,pst) (WINBOOL)SNDMSG(hmc,MCM_GETTODAY,0,(LPARAM)(pst)) +#define MCM_HITTEST (MCM_FIRST+14) +#define MonthCal_HitTest(hmc,pinfo) SNDMSG(hmc,MCM_HITTEST,0,(LPARAM)(PMCHITTESTINFO)(pinfo)) -#define MCHT_TITLE 0x00010000 -#define MCHT_CALENDAR 0x00020000 -#define MCHT_TODAYLINK 0x00030000 + typedef struct { + UINT cbSize; + POINT pt; -#define MCHT_NEXT 0x01000000 -#define MCHT_PREV 0x02000000 -#define MCHT_NOWHERE 0x00000000 -#define MCHT_TITLEBK (MCHT_TITLE) -#define MCHT_TITLEMONTH (MCHT_TITLE | 0x0001) -#define MCHT_TITLEYEAR (MCHT_TITLE | 0x0002) -#define MCHT_TITLEBTNNEXT (MCHT_TITLE | MCHT_NEXT | 0x0003) -#define MCHT_TITLEBTNPREV (MCHT_TITLE | MCHT_PREV | 0x0003) - -#define MCHT_CALENDARBK (MCHT_CALENDAR) -#define MCHT_CALENDARDATE (MCHT_CALENDAR | 0x0001) -#define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE | MCHT_NEXT) -#define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE | MCHT_PREV) -#define MCHT_CALENDARDAY (MCHT_CALENDAR | 0x0002) -#define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR | 0x0003) - - - -#define GMR_VISIBLE 0 -#define GMR_DAYSTATE 1 - - -/* Month calendar's structures */ - - -typedef struct { - UINT cbSize; - POINT pt; - UINT uHit; - SYSTEMTIME st; - /* Vista */ - RECT rc; - INT iOffset; - INT iRow; - INT iCol; -} MCHITTESTINFO, *PMCHITTESTINFO; - -#define MCHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(MCHITTESTINFO, st) - -typedef struct tagNMSELCHANGE -{ - NMHDR nmhdr; - SYSTEMTIME stSelStart; - SYSTEMTIME stSelEnd; -} NMSELCHANGE, *LPNMSELCHANGE; - -typedef NMSELCHANGE NMSELECT, *LPNMSELECT; -typedef DWORD MONTHDAYSTATE, *LPMONTHDAYSTATE; - -typedef struct tagNMDAYSTATE -{ - NMHDR nmhdr; - SYSTEMTIME stStart; - int cDayState; - LPMONTHDAYSTATE prgDayState; -} NMDAYSTATE, *LPNMDAYSTATE; - - -/* macros */ - -#define MonthCal_GetCurSel(hmc, pst) \ - (BOOL)SNDMSG(hmc, MCM_GETCURSEL, 0, (LPARAM)(pst)) -#define MonthCal_SetCurSel(hmc, pst) \ - (BOOL)SNDMSG(hmc, MCM_SETCURSEL, 0, (LPARAM)(pst)) -#define MonthCal_GetMaxSelCount(hmc) \ - (DWORD)SNDMSG(hmc, MCM_GETMAXSELCOUNT, 0, 0L) -#define MonthCal_SetMaxSelCount(hmc, n) \ - (BOOL)SNDMSG(hmc, MCM_SETMAXSELCOUNT, (WPARAM)(n), 0L) -#define MonthCal_GetSelRange(hmc, rgst) \ - SNDMSG(hmc, MCM_GETSELRANGE, 0, (LPARAM) (rgst)) -#define MonthCal_SetSelRange(hmc, rgst) \ - SNDMSG(hmc, MCM_SETSELRANGE, 0, (LPARAM) (rgst)) -#define MonthCal_GetMonthRange(hmc, gmr, rgst) \ - (DWORD)SNDMSG(hmc, MCM_GETMONTHRANGE, (WPARAM)(gmr), (LPARAM)(rgst)) -#define MonthCal_SetDayState(hmc, cbds, rgds) \ - SNDMSG(hmc, MCM_SETDAYSTATE, (WPARAM)(cbds), (LPARAM)(rgds)) -#define MonthCal_GetMinReqRect(hmc, prc) \ - SNDMSG(hmc, MCM_GETMINREQRECT, 0, (LPARAM)(prc)) -#define MonthCal_SetColor(hmc, iColor, clr)\ - SNDMSG(hmc, MCM_SETCOLOR, iColor, clr) -#define MonthCal_GetColor(hmc, iColor) \ - SNDMSG(hmc, MCM_SETCOLOR, iColor, 0) -#define MonthCal_GetToday(hmc, pst)\ - (BOOL)SNDMSG(hmc, MCM_GETTODAY, 0, (LPARAM)pst) -#define MonthCal_SetToday(hmc, pst)\ - SNDMSG(hmc, MCM_SETTODAY, 0, (LPARAM)pst) -#define MonthCal_HitTest(hmc, pinfo) \ - SNDMSG(hmc, MCM_HITTEST, 0, (LPARAM)(PMCHITTESTINFO)pinfo) -#define MonthCal_SetFirstDayOfWeek(hmc, iDay) \ - SNDMSG(hmc, MCM_SETFIRSTDAYOFWEEK, 0, iDay) -#define MonthCal_GetFirstDayOfWeek(hmc) \ - (DWORD)SNDMSG(hmc, MCM_GETFIRSTDAYOFWEEK, 0, 0) -#define MonthCal_GetRange(hmc, rgst) \ - (DWORD)SNDMSG(hmc, MCM_GETRANGE, 0, (LPARAM)(rgst)) -#define MonthCal_SetRange(hmc, gd, rgst) \ - (BOOL)SNDMSG(hmc, MCM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst)) -#define MonthCal_GetMonthDelta(hmc) \ - (int)SNDMSG(hmc, MCM_GETMONTHDELTA, 0, 0) -#define MonthCal_SetMonthDelta(hmc, n) \ - (int)SNDMSG(hmc, MCM_SETMONTHDELTA, n, 0) -#define MonthCal_GetMaxTodayWidth(hmc) \ - (DWORD)SNDMSG(hmc, MCM_GETMAXTODAYWIDTH, 0, 0) -#define MonthCal_SetUnicodeFormat(hwnd, fUnicode) \ - (BOOL)SNDMSG((hwnd), MCM_SETUNICODEFORMAT, (WPARAM)(fUnicode), 0) -#define MonthCal_GetUnicodeFormat(hwnd) \ - (BOOL)SNDMSG((hwnd), MCM_GETUNICODEFORMAT, 0, 0) - - -/************************************************************************** - * Date and time picker control - */ - -#define DATETIMEPICK_CLASSA "SysDateTimePick32" -#if defined(__GNUC__) -# define DATETIMEPICK_CLASSW (const WCHAR []){ 'S','y','s', \ - 'D','a','t','e','T','i','m','e','P','i','c','k','3','2',0 } -#elif defined(_MSC_VER) -# define DATETIMEPICK_CLASSW L"SysDateTimePick32" -#else -static const WCHAR DATETIMEPICK_CLASSW[] = { 'S','y','s', - 'D','a','t','e','T','i','m','e','P','i','c','k','3','2',0 }; -#endif -#define DATETIMEPICK_CLASS WINELIB_NAME_AW(DATETIMEPICK_CLASS) - -#define DTM_FIRST 0x1000 -#define DTN_FIRST (0U-760U) -#define DTN_LAST (0U-799U) - - -#define DTM_GETSYSTEMTIME (DTM_FIRST+1) -#define DTM_SETSYSTEMTIME (DTM_FIRST+2) -#define DTM_GETRANGE (DTM_FIRST+3) -#define DTM_SETRANGE (DTM_FIRST+4) -#define DTM_SETFORMATA (DTM_FIRST+5) -#define DTM_SETFORMATW (DTM_FIRST + 50) -#define DTM_SETFORMAT WINELIB_NAME_AW(DTM_SETFORMAT) -#define DTM_SETMCCOLOR (DTM_FIRST+6) -#define DTM_GETMCCOLOR (DTM_FIRST+7) -#define DTM_GETMONTHCAL (DTM_FIRST+8) -#define DTM_SETMCFONT (DTM_FIRST+9) -#define DTM_GETMCFONT (DTM_FIRST+10) - - -/* Datetime Notifications */ - -#define DTN_DATETIMECHANGE (DTN_FIRST + 1) -#define DTN_USERSTRINGA (DTN_FIRST + 2) -#define DTN_WMKEYDOWNA (DTN_FIRST + 3) -#define DTN_FORMATA (DTN_FIRST + 4) -#define DTN_FORMATQUERYA (DTN_FIRST + 5) -#define DTN_DROPDOWN (DTN_FIRST + 6) -#define DTN_CLOSEUP (DTN_FIRST + 7) -#define DTN_USERSTRINGW (DTN_FIRST + 15) -#define DTN_WMKEYDOWNW (DTN_FIRST + 16) -#define DTN_FORMATW (DTN_FIRST + 17) -#define DTN_FORMATQUERYW (DTN_FIRST + 18) - -#define DTN_USERSTRING WINELIB_NAME_AW(DTN_USERSTRING) -#define DTN_WMKEYDOWN WINELIB_NAME_AW(DTN_WMKEYDOWN) -#define DTN_FORMAT WINELIB_NAME_AW(DTN_FORMAT) -#define DTN_FORMATQUERY WINELIB_NAME_AW(DTN_FORMATQUERY) - -#define DTS_SHORTDATEFORMAT 0x0000 -#define DTS_UPDOWN 0x0001 -#define DTS_SHOWNONE 0x0002 -#define DTS_LONGDATEFORMAT 0x0004 -#define DTS_TIMEFORMAT 0x0009 -#define DTS_APPCANPARSE 0x0010 -#define DTS_RIGHTALIGN 0x0020 - -typedef struct tagNMDATETIMECHANGE -{ - NMHDR nmhdr; - DWORD dwFlags; - SYSTEMTIME st; -} NMDATETIMECHANGE, *LPNMDATETIMECHANGE; - -typedef struct tagNMDATETIMESTRINGA -{ - NMHDR nmhdr; - LPCSTR pszUserString; + UINT uHit; SYSTEMTIME st; - DWORD dwFlags; -} NMDATETIMESTRINGA, *LPNMDATETIMESTRINGA; + } MCHITTESTINFO,*PMCHITTESTINFO; -typedef struct tagNMDATETIMESTRINGW -{ - NMHDR nmhdr; - LPCWSTR pszUserString; - SYSTEMTIME st; - DWORD dwFlags; -} NMDATETIMESTRINGW, *LPNMDATETIMESTRINGW; +#define MCHT_TITLE 0x10000 +#define MCHT_CALENDAR 0x20000 +#define MCHT_TODAYLINK 0x30000 -DECL_WINELIB_TYPE_AW(NMDATETIMESTRING) -DECL_WINELIB_TYPE_AW(LPNMDATETIMESTRING) +#define MCHT_NEXT 0x1000000 +#define MCHT_PREV 0x2000000 -typedef struct tagNMDATETIMEWMKEYDOWNA -{ - NMHDR nmhdr; - int nVirtKey; - LPCSTR pszFormat; - SYSTEMTIME st; -} NMDATETIMEWMKEYDOWNA, *LPNMDATETIMEWMKEYDOWNA; +#define MCHT_NOWHERE 0x0 -typedef struct tagNMDATETIMEWMKEYDOWNW -{ - NMHDR nmhdr; - int nVirtKey; - LPCWSTR pszFormat; - SYSTEMTIME st; -} NMDATETIMEWMKEYDOWNW, *LPNMDATETIMEWMKEYDOWNW; +#define MCHT_TITLEBK (MCHT_TITLE) +#define MCHT_TITLEMONTH (MCHT_TITLE | 0x1) +#define MCHT_TITLEYEAR (MCHT_TITLE | 0x2) +#define MCHT_TITLEBTNNEXT (MCHT_TITLE | MCHT_NEXT | 0x3) +#define MCHT_TITLEBTNPREV (MCHT_TITLE | MCHT_PREV | 0x3) -DECL_WINELIB_TYPE_AW(NMDATETIMEWMKEYDOWN) -DECL_WINELIB_TYPE_AW(LPNMDATETIMEWMKEYDOWN) +#define MCHT_CALENDARBK (MCHT_CALENDAR) +#define MCHT_CALENDARDATE (MCHT_CALENDAR | 0x1) +#define MCHT_CALENDARDATENEXT (MCHT_CALENDARDATE | MCHT_NEXT) +#define MCHT_CALENDARDATEPREV (MCHT_CALENDARDATE | MCHT_PREV) +#define MCHT_CALENDARDAY (MCHT_CALENDAR | 0x2) +#define MCHT_CALENDARWEEKNUM (MCHT_CALENDAR | 0x3) -typedef struct tagNMDATETIMEFORMATA -{ +#define MCM_SETFIRSTDAYOFWEEK (MCM_FIRST+15) +#define MonthCal_SetFirstDayOfWeek(hmc,iDay) SNDMSG(hmc,MCM_SETFIRSTDAYOFWEEK,0,iDay) +#define MCM_GETFIRSTDAYOFWEEK (MCM_FIRST+16) +#define MonthCal_GetFirstDayOfWeek(hmc) (DWORD)SNDMSG(hmc,MCM_GETFIRSTDAYOFWEEK,0,0) +#define MCM_GETRANGE (MCM_FIRST+17) +#define MonthCal_GetRange(hmc,rgst) (DWORD)SNDMSG(hmc,MCM_GETRANGE,0,(LPARAM)(rgst)) +#define MCM_SETRANGE (MCM_FIRST+18) +#define MonthCal_SetRange(hmc,gd,rgst) (WINBOOL)SNDMSG(hmc,MCM_SETRANGE,(WPARAM)(gd),(LPARAM)(rgst)) +#define MCM_GETMONTHDELTA (MCM_FIRST+19) +#define MonthCal_GetMonthDelta(hmc) (int)SNDMSG(hmc,MCM_GETMONTHDELTA,0,0) +#define MCM_SETMONTHDELTA (MCM_FIRST+20) +#define MonthCal_SetMonthDelta(hmc,n) (int)SNDMSG(hmc,MCM_SETMONTHDELTA,n,0) +#define MCM_GETMAXTODAYWIDTH (MCM_FIRST+21) +#define MonthCal_GetMaxTodayWidth(hmc) (DWORD)SNDMSG(hmc,MCM_GETMAXTODAYWIDTH,0,0) +#define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT +#define MonthCal_SetUnicodeFormat(hwnd,fUnicode) (WINBOOL)SNDMSG((hwnd),MCM_SETUNICODEFORMAT,(WPARAM)(fUnicode),0) +#define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT +#define MonthCal_GetUnicodeFormat(hwnd) (WINBOOL)SNDMSG((hwnd),MCM_GETUNICODEFORMAT,0,0) + + typedef struct tagNMSELCHANGE { NMHDR nmhdr; - LPCSTR pszFormat; + SYSTEMTIME stSelStart; + SYSTEMTIME stSelEnd; + } NMSELCHANGE,*LPNMSELCHANGE; + +#define MCN_SELCHANGE (MCN_FIRST+1) + + typedef struct tagNMDAYSTATE { + NMHDR nmhdr; + SYSTEMTIME stStart; + int cDayState; + + LPMONTHDAYSTATE prgDayState; + } NMDAYSTATE,*LPNMDAYSTATE; + +#define MCN_GETDAYSTATE (MCN_FIRST+3) + + typedef NMSELCHANGE NMSELECT,*LPNMSELECT; + +#define MCN_SELECT (MCN_FIRST+4) + +#define MCS_DAYSTATE 0x1 +#define MCS_MULTISELECT 0x2 +#define MCS_WEEKNUMBERS 0x4 +#define MCS_NOTODAYCIRCLE 0x8 +#define MCS_NOTODAY 0x10 + +#define GMR_VISIBLE 0 +#define GMR_DAYSTATE 1 +#endif + +#ifndef NODATETIMEPICK +#define DATETIMEPICK_CLASSW L"SysDateTimePick32" +#define DATETIMEPICK_CLASSA "SysDateTimePick32" +#ifdef UNICODE +#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSW +#else +#define DATETIMEPICK_CLASS DATETIMEPICK_CLASSA +#endif +#define DTM_FIRST 0x1000 + +#define DTM_GETSYSTEMTIME (DTM_FIRST+1) +#define DateTime_GetSystemtime(hdp,pst) (DWORD)SNDMSG(hdp,DTM_GETSYSTEMTIME,0,(LPARAM)(pst)) +#define DTM_SETSYSTEMTIME (DTM_FIRST+2) +#define DateTime_SetSystemtime(hdp,gd,pst) (WINBOOL)SNDMSG(hdp,DTM_SETSYSTEMTIME,(WPARAM)(gd),(LPARAM)(pst)) +#define DTM_GETRANGE (DTM_FIRST+3) +#define DateTime_GetRange(hdp,rgst) (DWORD)SNDMSG(hdp,DTM_GETRANGE,0,(LPARAM)(rgst)) +#define DTM_SETRANGE (DTM_FIRST+4) +#define DateTime_SetRange(hdp,gd,rgst) (WINBOOL)SNDMSG(hdp,DTM_SETRANGE,(WPARAM)(gd),(LPARAM)(rgst)) +#define DTM_SETFORMATA (DTM_FIRST+5) +#define DTM_SETFORMATW (DTM_FIRST+50) + +#ifdef UNICODE +#define DTM_SETFORMAT DTM_SETFORMATW +#else +#define DTM_SETFORMAT DTM_SETFORMATA +#endif + +#define DateTime_SetFormat(hdp,sz) (WINBOOL)SNDMSG(hdp,DTM_SETFORMAT,0,(LPARAM)(sz)) + +#define DTM_SETMCCOLOR (DTM_FIRST+6) +#define DateTime_SetMonthCalColor(hdp,iColor,clr) SNDMSG(hdp,DTM_SETMCCOLOR,iColor,clr) +#define DTM_GETMCCOLOR (DTM_FIRST+7) +#define DateTime_GetMonthCalColor(hdp,iColor) SNDMSG(hdp,DTM_GETMCCOLOR,iColor,0) +#define DTM_GETMONTHCAL (DTM_FIRST+8) +#define DateTime_GetMonthCal(hdp) (HWND)SNDMSG(hdp,DTM_GETMONTHCAL,0,0) +#define DTM_SETMCFONT (DTM_FIRST+9) +#define DateTime_SetMonthCalFont(hdp,hfont,fRedraw) SNDMSG(hdp,DTM_SETMCFONT,(WPARAM)(hfont),(LPARAM)(fRedraw)) +#define DTM_GETMCFONT (DTM_FIRST+10) +#define DateTime_GetMonthCalFont(hdp) SNDMSG(hdp,DTM_GETMCFONT,0,0) + +#define DTS_UPDOWN 0x1 +#define DTS_SHOWNONE 0x2 +#define DTS_SHORTDATEFORMAT 0x0 +#define DTS_LONGDATEFORMAT 0x4 +#define DTS_SHORTDATECENTURYFORMAT 0xc +#define DTS_TIMEFORMAT 0x9 +#define DTS_APPCANPARSE 0x10 +#define DTS_RIGHTALIGN 0x20 + +#define DTN_DATETIMECHANGE (DTN_FIRST+1) + typedef struct tagNMDATETIMECHANGE { + NMHDR nmhdr; + DWORD dwFlags; + SYSTEMTIME st; + } NMDATETIMECHANGE,*LPNMDATETIMECHANGE; + +#define DTN_USERSTRINGA (DTN_FIRST+2) +#define DTN_USERSTRINGW (DTN_FIRST+15) + typedef struct tagNMDATETIMESTRINGA { + NMHDR nmhdr; + LPCSTR pszUserString; + SYSTEMTIME st; + DWORD dwFlags; + } NMDATETIMESTRINGA,*LPNMDATETIMESTRINGA; + + typedef struct tagNMDATETIMESTRINGW { + NMHDR nmhdr; + LPCWSTR pszUserString; + SYSTEMTIME st; + DWORD dwFlags; + } NMDATETIMESTRINGW,*LPNMDATETIMESTRINGW; + +#ifdef UNICODE +#define DTN_USERSTRING DTN_USERSTRINGW +#define NMDATETIMESTRING NMDATETIMESTRINGW +#define LPNMDATETIMESTRING LPNMDATETIMESTRINGW +#else +#define DTN_USERSTRING DTN_USERSTRINGA +#define NMDATETIMESTRING NMDATETIMESTRINGA +#define LPNMDATETIMESTRING LPNMDATETIMESTRINGA +#endif + +#define DTN_WMKEYDOWNA (DTN_FIRST+3) +#define DTN_WMKEYDOWNW (DTN_FIRST+16) + typedef struct tagNMDATETIMEWMKEYDOWNA { + NMHDR nmhdr; + int nVirtKey; + LPCSTR pszFormat; + SYSTEMTIME st; + } NMDATETIMEWMKEYDOWNA,*LPNMDATETIMEWMKEYDOWNA; + + typedef struct tagNMDATETIMEWMKEYDOWNW { + NMHDR nmhdr; + int nVirtKey; + LPCWSTR pszFormat; + SYSTEMTIME st; + } NMDATETIMEWMKEYDOWNW,*LPNMDATETIMEWMKEYDOWNW; + +#ifdef UNICODE +#define DTN_WMKEYDOWN DTN_WMKEYDOWNW +#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNW +#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNW +#else +#define DTN_WMKEYDOWN DTN_WMKEYDOWNA +#define NMDATETIMEWMKEYDOWN NMDATETIMEWMKEYDOWNA +#define LPNMDATETIMEWMKEYDOWN LPNMDATETIMEWMKEYDOWNA +#endif + +#define DTN_FORMATA (DTN_FIRST+4) +#define DTN_FORMATW (DTN_FIRST+17) + typedef struct tagNMDATETIMEFORMATA { + NMHDR nmhdr; + LPCSTR pszFormat; SYSTEMTIME st; LPCSTR pszDisplay; CHAR szDisplay[64]; -} NMDATETIMEFORMATA, *LPNMDATETIMEFORMATA; + } NMDATETIMEFORMATA,*LPNMDATETIMEFORMATA; - -typedef struct tagNMDATETIMEFORMATW -{ + typedef struct tagNMDATETIMEFORMATW { NMHDR nmhdr; LPCWSTR pszFormat; SYSTEMTIME st; LPCWSTR pszDisplay; WCHAR szDisplay[64]; -} NMDATETIMEFORMATW, *LPNMDATETIMEFORMATW; + } NMDATETIMEFORMATW,*LPNMDATETIMEFORMATW; -DECL_WINELIB_TYPE_AW(NMDATETIMEFORMAT) -DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMAT) +#ifdef UNICODE +#define DTN_FORMAT DTN_FORMATW +#define NMDATETIMEFORMAT NMDATETIMEFORMATW +#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATW +#else +#define DTN_FORMAT DTN_FORMATA +#define NMDATETIMEFORMAT NMDATETIMEFORMATA +#define LPNMDATETIMEFORMAT LPNMDATETIMEFORMATA +#endif -typedef struct tagNMDATETIMEFORMATQUERYA -{ +#define DTN_FORMATQUERYA (DTN_FIRST+5) +#define DTN_FORMATQUERYW (DTN_FIRST+18) + typedef struct tagNMDATETIMEFORMATQUERYA { NMHDR nmhdr; LPCSTR pszFormat; SIZE szMax; -} NMDATETIMEFORMATQUERYA, *LPNMDATETIMEFORMATQUERYA; + } NMDATETIMEFORMATQUERYA,*LPNMDATETIMEFORMATQUERYA; -typedef struct tagNMDATETIMEFORMATQUERYW -{ + typedef struct tagNMDATETIMEFORMATQUERYW { NMHDR nmhdr; LPCWSTR pszFormat; SIZE szMax; -} NMDATETIMEFORMATQUERYW, *LPNMDATETIMEFORMATQUERYW; + } NMDATETIMEFORMATQUERYW,*LPNMDATETIMEFORMATQUERYW; -DECL_WINELIB_TYPE_AW(NMDATETIMEFORMATQUERY) -DECL_WINELIB_TYPE_AW(LPNMDATETIMEFORMATQUERY) +#ifdef UNICODE +#define DTN_FORMATQUERY DTN_FORMATQUERYW +#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYW +#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYW +#else +#define DTN_FORMATQUERY DTN_FORMATQUERYA +#define NMDATETIMEFORMATQUERY NMDATETIMEFORMATQUERYA +#define LPNMDATETIMEFORMATQUERY LPNMDATETIMEFORMATQUERYA +#endif +#define DTN_DROPDOWN (DTN_FIRST+6) +#define DTN_CLOSEUP (DTN_FIRST+7) +#define GDTR_MIN 0x1 +#define GDTR_MAX 0x2 -#define GDT_ERROR -1 -#define GDT_VALID 0 -#define GDT_NONE 1 +#define GDT_ERROR -1 +#define GDT_VALID 0 +#define GDT_NONE 1 -#define GDTR_MIN 0x0001 -#define GDTR_MAX 0x0002 +#ifndef NOIPADDRESS +#define IPM_CLEARADDRESS (WM_USER+100) +#define IPM_SETADDRESS (WM_USER+101) +#define IPM_GETADDRESS (WM_USER+102) +#define IPM_SETRANGE (WM_USER+103) +#define IPM_SETFOCUS (WM_USER+104) +#define IPM_ISBLANK (WM_USER+105) +#define WC_IPADDRESSW L"SysIPAddress32" +#define WC_IPADDRESSA "SysIPAddress32" -#define DateTime_GetSystemtime(hdp, pst) \ - (DWORD)SNDMSG (hdp, DTM_GETSYSTEMTIME , 0, (LPARAM)(pst)) -#define DateTime_SetSystemtime(hdp, gd, pst) \ - (BOOL)SNDMSG (hdp, DTM_SETSYSTEMTIME, (LPARAM)(gd), (LPARAM)(pst)) -#define DateTime_GetRange(hdp, rgst) \ - (DWORD)SNDMSG (hdp, DTM_GETRANGE, 0, (LPARAM)(rgst)) -#define DateTime_SetRange(hdp, gd, rgst) \ - (BOOL)SNDMSG (hdp, DTM_SETRANGE, (WPARAM)(gd), (LPARAM)(rgst)) -#define DateTime_SetFormatA(hdp, sz) \ - (BOOL)SNDMSGA (hdp, DTM_SETFORMATA, 0, (LPARAM)(sz)) -#define DateTime_SetFormatW(hdp, sz) \ - (BOOL)SNDMSGW (hdp, DTM_SETFORMATW, 0, (LPARAM)(sz)) -#define DateTime_SetFormat WINELIB_NAME_AW(DateTime_SetFormat) -#define DateTime_GetMonthCalColor(hdp, iColor) \ - SNDMSG (hdp, DTM_GETMCCOLOR, iColor, 0) -#define DateTime_SetMonthCalColor(hdp, iColor, clr) \ - SNDMSG (hdp, DTM_SETMCCOLOR, iColor, clr) -#define DateTime_GetMonthCal(hdp) \ - (HWND) SNDMSG (hdp, DTM_GETMONTHCAL, 0, 0) -#define DateTime_SetMonthCalFont(hdp, hfont, fRedraw) \ - SNDMSG (hdp, DTM_SETMCFONT, (WPARAM)hfont, (LPARAM)fRedraw) -#define DateTime_GetMonthCalFont(hdp) \ - SNDMSG (hdp, DTM_GETMCFONT, 0, 0) +#ifdef UNICODE +#define WC_IPADDRESS WC_IPADDRESSW +#else +#define WC_IPADDRESS WC_IPADDRESSA +#endif -#define DA_LAST (0x7fffffff) -#define DPA_APPEND (0x7fffffff) -#define DPA_ERR (-1) +#define IPN_FIELDCHANGED (IPN_FIRST - 0) + typedef struct tagNMIPADDRESS { + NMHDR hdr; + int iField; + int iValue; + } NMIPADDRESS,*LPNMIPADDRESS; -#define DSA_APPEND (0x7fffffff) -#define DSA_ERR (-1) +#define MAKEIPRANGE(low,high) ((LPARAM)(WORD)(((BYTE)(high) << 8)+(BYTE)(low))) -struct _DSA; -typedef struct _DSA *HDSA; +#define MAKEIPADDRESS(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4)))) -typedef INT (CALLBACK *PFNDSAENUMCALLBACK)(LPVOID, LPVOID); +#define FIRST_IPADDRESS(x) ((x>>24) & 0xff) +#define SECOND_IPADDRESS(x) ((x>>16) & 0xff) +#define THIRD_IPADDRESS(x) ((x>>8) & 0xff) +#define FOURTH_IPADDRESS(x) (x & 0xff) +#endif -HDSA WINAPI DSA_Create(INT, INT); -BOOL WINAPI DSA_Destroy(HDSA); -void WINAPI DSA_DestroyCallback(HDSA, PFNDSAENUMCALLBACK, LPVOID); -LPVOID WINAPI DSA_GetItemPtr(HDSA, INT); -INT WINAPI DSA_InsertItem(HDSA, INT, LPVOID); +#ifndef NOPAGESCROLLER +#define WC_PAGESCROLLERW L"SysPager" +#define WC_PAGESCROLLERA "SysPager" -#define DPAS_SORTED 0x0001 -#define DPAS_INSERTBEFORE 0x0002 -#define DPAS_INSERTAFTER 0x0004 +#ifdef UNICODE +#define WC_PAGESCROLLER WC_PAGESCROLLERW +#else +#define WC_PAGESCROLLER WC_PAGESCROLLERA +#endif +#define PGS_VERT 0x0 +#define PGS_HORZ 0x1 +#define PGS_AUTOSCROLL 0x2 +#define PGS_DRAGNDROP 0x4 -struct _DPA; -typedef struct _DPA *HDPA; +#define PGF_INVISIBLE 0 +#define PGF_NORMAL 1 +#define PGF_GRAYED 2 +#define PGF_DEPRESSED 4 +#define PGF_HOT 8 -#define DPA_GetPtrCount(hdpa) (*(INT*)(hdpa)) +#define PGB_TOPORLEFT 0 +#define PGB_BOTTOMORRIGHT 1 -typedef INT (CALLBACK *PFNDPAENUMCALLBACK)(LPVOID, LPVOID); -typedef INT (CALLBACK *PFNDPACOMPARE)(LPVOID, LPVOID, LPARAM); -typedef PVOID (CALLBACK *PFNDPAMERGE)(UINT,PVOID,PVOID,LPARAM); +#define PGM_SETCHILD (PGM_FIRST+1) +#define Pager_SetChild(hwnd,hwndChild) (void)SNDMSG((hwnd),PGM_SETCHILD,0,(LPARAM)(hwndChild)) -/* merge callback codes */ -#define DPAMM_MERGE 1 -#define DPAMM_DELETE 2 -#define DPAMM_INSERT 3 +#define PGM_RECALCSIZE (PGM_FIRST+2) +#define Pager_RecalcSize(hwnd) (void)SNDMSG((hwnd),PGM_RECALCSIZE,0,0) -/* merge options */ -#define DPAM_SORTED 0x00000001 -#define DPAM_NORMAL 0x00000002 -#define DPAM_UNION 0x00000004 -#define DPAM_INTERSECT 0x00000008 +#define PGM_FORWARDMOUSE (PGM_FIRST+3) +#define Pager_ForwardMouse(hwnd,bForward) (void)SNDMSG((hwnd),PGM_FORWARDMOUSE,(WPARAM)(bForward),0) -HDPA WINAPI DPA_Create(INT); -BOOL WINAPI DPA_Destroy(HDPA); -LPVOID WINAPI DPA_DeletePtr(HDPA, INT); -BOOL WINAPI DPA_DeleteAllPtrs(HDPA); -BOOL WINAPI DPA_SetPtr(HDPA, INT, LPVOID); -LPVOID WINAPI DPA_GetPtr(HDPA, INT); -INT WINAPI DPA_GetPtrIndex(HDPA, LPCVOID); -ULONGLONG WINAPI DPA_GetSize(HDPA); -BOOL WINAPI DPA_Grow(HDPA, INT); -INT WINAPI DPA_InsertPtr(HDPA, INT, LPVOID); -BOOL WINAPI DPA_Sort(HDPA, PFNDPACOMPARE, LPARAM); -void WINAPI DPA_EnumCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID); -void WINAPI DPA_DestroyCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID); -INT WINAPI DPA_Search(HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT); -BOOL WINAPI DPA_Merge(HDPA, HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM); +#define PGM_SETBKCOLOR (PGM_FIRST+4) +#define Pager_SetBkColor(hwnd,clr) (COLORREF)SNDMSG((hwnd),PGM_SETBKCOLOR,0,(LPARAM)(clr)) -/* save/load from stream */ -typedef struct _DPASTREAMINFO -{ - INT iPos; /* item index */ - LPVOID pvItem; +#define PGM_GETBKCOLOR (PGM_FIRST+5) +#define Pager_GetBkColor(hwnd) (COLORREF)SNDMSG((hwnd),PGM_GETBKCOLOR,0,0) + +#define PGM_SETBORDER (PGM_FIRST+6) +#define Pager_SetBorder(hwnd,iBorder) (int)SNDMSG((hwnd),PGM_SETBORDER,0,(LPARAM)(iBorder)) + +#define PGM_GETBORDER (PGM_FIRST+7) +#define Pager_GetBorder(hwnd) (int)SNDMSG((hwnd),PGM_GETBORDER,0,0) + +#define PGM_SETPOS (PGM_FIRST+8) +#define Pager_SetPos(hwnd,iPos) (int)SNDMSG((hwnd),PGM_SETPOS,0,(LPARAM)(iPos)) + +#define PGM_GETPOS (PGM_FIRST+9) +#define Pager_GetPos(hwnd) (int)SNDMSG((hwnd),PGM_GETPOS,0,0) + +#define PGM_SETBUTTONSIZE (PGM_FIRST+10) +#define Pager_SetButtonSize(hwnd,iSize) (int)SNDMSG((hwnd),PGM_SETBUTTONSIZE,0,(LPARAM)(iSize)) + +#define PGM_GETBUTTONSIZE (PGM_FIRST+11) +#define Pager_GetButtonSize(hwnd) (int)SNDMSG((hwnd),PGM_GETBUTTONSIZE,0,0) + +#define PGM_GETBUTTONSTATE (PGM_FIRST+12) +#define Pager_GetButtonState(hwnd,iButton) (DWORD)SNDMSG((hwnd),PGM_GETBUTTONSTATE,0,(LPARAM)(iButton)) + +#define PGM_GETDROPTARGET CCM_GETDROPTARGET +#define Pager_GetDropTarget(hwnd,ppdt) (void)SNDMSG((hwnd),PGM_GETDROPTARGET,0,(LPARAM)(ppdt)) + +#define PGN_SCROLL (PGN_FIRST-1) + +#define PGF_SCROLLUP 1 +#define PGF_SCROLLDOWN 2 +#define PGF_SCROLLLEFT 4 +#define PGF_SCROLLRIGHT 8 + +#define PGK_SHIFT 1 +#define PGK_CONTROL 2 +#define PGK_MENU 4 + +#include + + typedef struct { + NMHDR hdr; + WORD fwKeys; + RECT rcParent; + int iDir; + int iXpos; + int iYpos; + int iScroll; + }NMPGSCROLL,*LPNMPGSCROLL; + +#include + +#define PGN_CALCSIZE (PGN_FIRST-2) + +#define PGF_CALCWIDTH 1 +#define PGF_CALCHEIGHT 2 + + typedef struct { + NMHDR hdr; + DWORD dwFlag; + int iWidth; + int iHeight; + }NMPGCALCSIZE,*LPNMPGCALCSIZE; + +#define PGN_HOTITEMCHANGE (PGN_FIRST-3) + + typedef struct tagNMPGHOTITEM + { + NMHDR hdr; + int idOld; + int idNew; + DWORD dwFlags; + } NMPGHOTITEM,*LPNMPGHOTITEM; +#endif + +#ifndef NONATIVEFONTCTL + +#define WC_NATIVEFONTCTLW L"NativeFontCtl" +#define WC_NATIVEFONTCTLA "NativeFontCtl" + +#ifdef UNICODE +#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLW +#else +#define WC_NATIVEFONTCTL WC_NATIVEFONTCTLA +#endif + +#define NFS_EDIT 0x1 +#define NFS_STATIC 0x2 +#define NFS_LISTCOMBO 0x4 +#define NFS_BUTTON 0x8 +#define NFS_ALL 0x10 +#define NFS_USEFONTASSOC 0x20 +#endif + +#ifndef NOBUTTON +#define WC_BUTTONA "Button" +#define WC_BUTTONW L"Button" +#ifdef UNICODE +#define WC_BUTTON WC_BUTTONW +#else +#define WC_BUTTON WC_BUTTONA +#endif + +#define BUTTON_IMAGELIST_ALIGN_LEFT 0 +#define BUTTON_IMAGELIST_ALIGN_RIGHT 1 +#define BUTTON_IMAGELIST_ALIGN_TOP 2 +#define BUTTON_IMAGELIST_ALIGN_BOTTOM 3 +#define BUTTON_IMAGELIST_ALIGN_CENTER 4 + + typedef struct { + HIMAGELIST himl; + RECT margin; + UINT uAlign; + } BUTTON_IMAGELIST,*PBUTTON_IMAGELIST; + +#define BCM_GETIDEALSIZE (BCM_FIRST+0x1) +#define Button_GetIdealSize(hwnd,psize) (WINBOOL)SNDMSG((hwnd),BCM_GETIDEALSIZE,0,(LPARAM)(psize)) + +#define BCM_SETIMAGELIST (BCM_FIRST+0x2) +#define Button_SetImageList(hwnd,pbuttonImagelist) (WINBOOL)SNDMSG((hwnd),BCM_SETIMAGELIST,0,(LPARAM)(pbuttonImagelist)) + +#define BCM_GETIMAGELIST (BCM_FIRST+0x3) +#define Button_GetImageList(hwnd,pbuttonImagelist) (WINBOOL)SNDMSG((hwnd),BCM_GETIMAGELIST,0,(LPARAM)(pbuttonImagelist)) + +#define BCM_SETTEXTMARGIN (BCM_FIRST+0x4) +#define Button_SetTextMargin(hwnd,pmargin) (WINBOOL)SNDMSG((hwnd),BCM_SETTEXTMARGIN,0,(LPARAM)(pmargin)) +#define BCM_GETTEXTMARGIN (BCM_FIRST+0x5) +#define Button_GetTextMargin(hwnd,pmargin) (WINBOOL)SNDMSG((hwnd),BCM_GETTEXTMARGIN,0,(LPARAM)(pmargin)) + + typedef struct tagNMBCHOTITEM { + NMHDR hdr; + DWORD dwFlags; + } NMBCHOTITEM,*LPNMBCHOTITEM; + +#define BCN_HOTITEMCHANGE (BCN_FIRST+0x1) + +#define BST_HOT 0x200 + +#endif + +#ifndef NOSTATIC +#define WC_STATICA "Static" +#define WC_STATICW L"Static" +#ifdef UNICODE +#define WC_STATIC WC_STATICW +#else +#define WC_STATIC WC_STATICA +#endif + +#ifndef NOEDIT +#define WC_EDITA "Edit" +#define WC_EDITW L"Edit" +#ifdef UNICODE +#define WC_EDIT WC_EDITW +#else +#define WC_EDIT WC_EDITA +#endif + +#define EM_SETCUEBANNER (ECM_FIRST+1) +#define Edit_SetCueBannerText(hwnd,lpcwText) (WINBOOL)SNDMSG((hwnd),EM_SETCUEBANNER,0,(LPARAM)(lpcwText)) +#define EM_GETCUEBANNER (ECM_FIRST+2) +#define Edit_GetCueBannerText(hwnd,lpwText,cchText) (WINBOOL)SNDMSG((hwnd),EM_GETCUEBANNER,(WPARAM)(lpwText),(LPARAM)(cchText)) + + typedef struct _tagEDITBALLOONTIP { + DWORD cbStruct; + LPCWSTR pszTitle; + LPCWSTR pszText; + INT ttiIcon; + } EDITBALLOONTIP,*PEDITBALLOONTIP; +#define EM_SHOWBALLOONTIP (ECM_FIRST+3) +#define Edit_ShowBalloonTip(hwnd,peditballoontip) (WINBOOL)SNDMSG((hwnd),EM_SHOWBALLOONTIP,0,(LPARAM)(peditballoontip)) +#define EM_HIDEBALLOONTIP (ECM_FIRST+4) +#define Edit_HideBalloonTip(hwnd) (WINBOOL)SNDMSG((hwnd),EM_HIDEBALLOONTIP,0,0) +#endif + +#ifndef NOLISTBOX +#define WC_LISTBOXA "ListBox" +#define WC_LISTBOXW L"ListBox" +#ifdef UNICODE +#define WC_LISTBOX WC_LISTBOXW +#else +#define WC_LISTBOX WC_LISTBOXA +#endif +#endif + +#ifndef NOCOMBOBOX +#define WC_COMBOBOXA "ComboBox" +#define WC_COMBOBOXW L"ComboBox" +#ifdef UNICODE +#define WC_COMBOBOX WC_COMBOBOXW +#else +#define WC_COMBOBOX WC_COMBOBOXA +#endif +#endif + +#define CB_SETMINVISIBLE (CBM_FIRST+1) +#define CB_GETMINVISIBLE (CBM_FIRST+2) + +#define ComboBox_SetMinVisible(hwnd,iMinVisible) (WINBOOL)SNDMSG((hwnd),CB_SETMINVISIBLE,(WPARAM)iMinVisible,0) +#define ComboBox_GetMinVisible(hwnd) (int)SNDMSG((hwnd),CB_GETMINVISIBLE,0,0) + +#ifndef NOSCROLLBAR +#define WC_SCROLLBARA "ScrollBar" +#define WC_SCROLLBARW L"ScrollBar" +#ifdef UNICODE +#define WC_SCROLLBAR WC_SCROLLBARW +#else +#define WC_SCROLLBAR WC_SCROLLBARA +#endif +#endif + +#define INVALID_LINK_INDEX (-1) +#define MAX_LINKID_TEXT 48 +#define L_MAX_URL_LENGTH (2048+32+sizeof("://")) + +#define WC_LINK L"SysLink" + +#define LWS_TRANSPARENT 0x1 +#define LWS_IGNORERETURN 0x2 + +#define LIF_ITEMINDEX 0x1 +#define LIF_STATE 0x2 +#define LIF_ITEMID 0x4 +#define LIF_URL 0x8 + +#define LIS_FOCUSED 0x1 +#define LIS_ENABLED 0x2 +#define LIS_VISITED 0x4 + + typedef struct tagLITEM { + UINT mask; + int iLink; + UINT state; + UINT stateMask; + WCHAR szID[MAX_LINKID_TEXT]; + WCHAR szUrl[L_MAX_URL_LENGTH]; + } LITEM,*PLITEM; + + typedef struct tagLHITTESTINFO { + POINT pt; + LITEM item; + } LHITTESTINFO,*PLHITTESTINFO; + + typedef struct tagNMLINK { + NMHDR hdr; + LITEM item; + } NMLINK,*PNMLINK; + +#define LM_HITTEST (WM_USER+0x300) +#define LM_GETIDEALHEIGHT (WM_USER+0x301) +#define LM_SETITEM (WM_USER+0x302) +#define LM_GETITEM (WM_USER+0x303) + +#ifndef NOMUI + void WINAPI InitMUILanguage(LANGID uiLang); + LANGID WINAPI GetMUILanguage(void); +#endif +#endif + +#define DA_LAST (0x7fffffff) +#define DPA_APPEND (0x7fffffff) +#define DPA_ERR (-1) + +#define DSA_APPEND (0x7fffffff) +#define DSA_ERR (-1) + + typedef struct _DSA *HDSA; + + typedef int (CALLBACK *PFNDPAENUMCALLBACK)(void *p,void *pData); + typedef int (CALLBACK *PFNDSAENUMCALLBACK)(void *p,void *pData); + + WINCOMMCTRLAPI HDSA WINAPI DSA_Create(int cbItem,int cItemGrow); + WINCOMMCTRLAPI WINBOOL WINAPI DSA_Destroy(HDSA hdsa); + WINCOMMCTRLAPI void WINAPI DSA_DestroyCallback(HDSA hdsa,PFNDSAENUMCALLBACK pfnCB,void *pData); + WINCOMMCTRLAPI PVOID WINAPI DSA_GetItemPtr(HDSA hdsa,int i); + WINCOMMCTRLAPI int WINAPI DSA_InsertItem(HDSA hdsa,int i,void *pitem); + + typedef struct _DPA *HDPA; + + WINCOMMCTRLAPI HDPA WINAPI DPA_Create(int cItemGrow); + WINCOMMCTRLAPI WINBOOL WINAPI DPA_Destroy(HDPA hdpa); + WINCOMMCTRLAPI PVOID WINAPI DPA_DeletePtr(HDPA hdpa,int i); + WINCOMMCTRLAPI WINBOOL WINAPI DPA_DeleteAllPtrs(HDPA hdpa); + WINCOMMCTRLAPI void WINAPI DPA_EnumCallback(HDPA hdpa,PFNDPAENUMCALLBACK pfnCB,void *pData); + WINCOMMCTRLAPI void WINAPI DPA_DestroyCallback(HDPA hdpa,PFNDPAENUMCALLBACK pfnCB,void *pData); + WINCOMMCTRLAPI WINBOOL WINAPI DPA_SetPtr(HDPA hdpa,int i,void *p); + WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa,int i,void *p); + WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa,INT_PTR i); + + typedef int (CALLBACK *PFNDPACOMPARE)(void *p1,void *p2,LPARAM lParam); + + WINCOMMCTRLAPI WINBOOL WINAPI DPA_Sort(HDPA hdpa,PFNDPACOMPARE pfnCompare,LPARAM lParam); + +#define DPAS_SORTED 0x1 +#define DPAS_INSERTBEFORE 0x2 +#define DPAS_INSERTAFTER 0x4 + + WINCOMMCTRLAPI int WINAPI DPA_Search(HDPA hdpa,void *pFind,int iStart,PFNDPACOMPARE pfnCompare,LPARAM lParam,UINT options); + WINCOMMCTRLAPI WINBOOL WINAPI Str_SetPtrW(LPWSTR *ppsz,LPCWSTR psz); + +#ifndef NOTRACKMOUSEEVENT + +#ifndef WM_MOUSEHOVER +#define WM_MOUSEHOVER 0x2a1 +#define WM_MOUSELEAVE 0x2a3 +#endif + +#ifndef TME_HOVER + +#define TME_HOVER 0x1 +#define TME_LEAVE 0x2 +#define TME_NONCLIENT 0x10 +#define TME_QUERY 0x40000000 +#define TME_CANCEL 0x80000000 + +#define HOVER_DEFAULT 0xffffffff + + typedef struct tagTRACKMOUSEEVENT { + DWORD cbSize; + DWORD dwFlags; + HWND hwndTrack; + DWORD dwHoverTime; + } TRACKMOUSEEVENT,*LPTRACKMOUSEEVENT; +#endif + + WINCOMMCTRLAPI WINBOOL WINAPI _TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack); +#endif + +#ifndef NOFLATSBAPIS + +#define WSB_PROP_CYVSCROLL 0x1L +#define WSB_PROP_CXHSCROLL 0x2L +#define WSB_PROP_CYHSCROLL 0x4L +#define WSB_PROP_CXVSCROLL 0x8L +#define WSB_PROP_CXHTHUMB 0x10L +#define WSB_PROP_CYVTHUMB 0x20L +#define WSB_PROP_VBKGCOLOR 0x40L +#define WSB_PROP_HBKGCOLOR 0x80L +#define WSB_PROP_VSTYLE 0x100L +#define WSB_PROP_HSTYLE 0x200L +#define WSB_PROP_WINSTYLE 0x400L +#define WSB_PROP_PALETTE 0x800L +#define WSB_PROP_MASK 0xfffL + +#define FSB_FLAT_MODE 2 +#define FSB_ENCARTA_MODE 1 +#define FSB_REGULAR_MODE 0 + + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_EnableScrollBar(HWND,int,UINT); + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_ShowScrollBar(HWND,int code,WINBOOL); + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_GetScrollRange(HWND,int code,LPINT,LPINT); + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_GetScrollInfo(HWND,int code,LPSCROLLINFO); + WINCOMMCTRLAPI int WINAPI FlatSB_GetScrollPos(HWND,int code); + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_GetScrollProp(HWND,int propIndex,LPINT); +#ifdef _WIN64 + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_GetScrollPropPtr(HWND,int propIndex,PINT_PTR); +#else +#define FlatSB_GetScrollPropPtr FlatSB_GetScrollProp +#endif + + WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollPos(HWND,int code,int pos,WINBOOL fRedraw); + WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollInfo(HWND,int code,LPSCROLLINFO,WINBOOL fRedraw); + WINCOMMCTRLAPI int WINAPI FlatSB_SetScrollRange(HWND,int code,int min,int max,WINBOOL fRedraw); + WINCOMMCTRLAPI WINBOOL WINAPI FlatSB_SetScrollProp(HWND,UINT index,INT_PTR newValue,WINBOOL); +#define FlatSB_SetScrollPropPtr FlatSB_SetScrollProp + WINCOMMCTRLAPI WINBOOL WINAPI InitializeFlatSB(HWND); + WINCOMMCTRLAPI HRESULT WINAPI UninitializeFlatSB(HWND); +#endif +#endif + + typedef LRESULT (CALLBACK *SUBCLASSPROC)(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam,UINT_PTR uIdSubclass,DWORD_PTR dwRefData); + + WINBOOL WINAPI SetWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass,DWORD_PTR dwRefData); + WINBOOL WINAPI GetWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass,DWORD_PTR *pdwRefData); + WINBOOL WINAPI RemoveWindowSubclass(HWND hWnd,SUBCLASSPROC pfnSubclass,UINT_PTR uIdSubclass); + LRESULT WINAPI DefSubclassProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); + int WINAPI DrawShadowText(HDC hdc,LPCWSTR pszText,UINT cch,RECT *prc,DWORD dwFlags,COLORREF crText,COLORREF crShadow,int ixOffset,int iyOffset); + +typedef struct _DPASTREAMINFO { + int iPos; + void *pvItem; } DPASTREAMINFO; struct IStream; -typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, LPVOID); +typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, void*); +typedef void* (CALLBACK *PFNDPAMERGE)(UINT, void*, void*, LPARAM); +typedef const void* (CALLBACK *PFNDPAMERGECONST)(UINT, const void*, const void*, LPARAM); -HRESULT WINAPI DPA_LoadStream(HDPA*, PFNDPASTREAM, struct IStream*, LPVOID); -HRESULT WINAPI DPA_SaveStream(HDPA, PFNDPASTREAM, struct IStream*, LPVOID); + WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(HDPA * phdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); + WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(HDPA hdpa, PFNDPASTREAM pfn, struct IStream * pstream, void *pvInstData); + WINCOMMCTRLAPI BOOL WINAPI DPA_Grow(HDPA pdpa, IN int cp); + WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(HDPA hdpa, IN int i, void *p); + WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(HDPA hdpa, INT_PTR i); + WINCOMMCTRLAPI BOOL WINAPI DPA_SetPtr(HDPA hdpa, IN int i, void *p); + WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(HDPA hdpa, const void *p); -BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR); +#define DPA_GetPtrCount(hdpa) (*(int *)(hdpa)) +#define DPA_SetPtrCount(hdpa, cItems) (*(int *)(hdpa) = (cItems)) +#define DPA_GetPtrPtr(hdpa) (*((void * **)((BYTE *)(hdpa) + sizeof(void *)))) +#define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem) +#define DPA_FastDeleteLastPtr(hdpa) (--*(int *)(hdpa)) +#define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i]) -/************************************************************************** - * SysLink control - */ +#define DPAM_SORTED 1 +#define DPAM_NORMAL 2 +#define DPAM_UNION 4 +#define DPAM_INTERSECT 8 -#if defined(__GNUC__) -# define WC_LINK (const WCHAR []){ 'S','y','s','L','i','n','k',0 } -#elif defined(_MSC_VER) -# define WC_LINK L"SysLink" -#else -static const WCHAR WC_LINK[] = { 'S','y','s','L','i','n','k',0 }; -#endif - -/* SysLink styles */ -#define LWS_TRANSPARENT 0x0001 -#define LWS_IGNORERETURN 0x0002 - -/* SysLink messages */ -#define LM_HITTEST (WM_USER + 768) -#define LM_GETIDEALHEIGHT (WM_USER + 769) -#define LM_GETIDEALSIZE (LM_GETIDEALHEIGHT) -#define LM_SETITEM (WM_USER + 770) -#define LM_GETITEM (WM_USER + 771) - -/* SysLink links flags */ - -#define LIF_ITEMINDEX 1 -#define LIF_STATE 2 -#define LIF_ITEMID 4 -#define LIF_URL 8 - -/* SysLink links states */ - -#define LIS_FOCUSED 1 -#define LIS_ENABLED 2 -#define LIS_VISITED 4 - -/* SysLink misc. */ - -#define INVALID_LINK_INDEX (-1) -#define MAX_LINKID_TEXT 48 -#define L_MAX_URL_LENGTH 2084 - -/* SysLink structures */ - -typedef struct tagLITEM -{ - UINT mask; - int iLink; - UINT state; - UINT stateMask; - WCHAR szID[MAX_LINKID_TEXT]; - WCHAR szUrl[L_MAX_URL_LENGTH]; -} LITEM, *PLITEM; - -typedef struct tagLHITTESTINFO -{ - POINT pt; - LITEM item; -} LHITTESTINFO, *PLHITTESTINFO; - -typedef struct tagNMLINK -{ - NMHDR hdr; - LITEM item; -} NMLINK, *PNMLINK; - -typedef struct tagNMLVLINK -{ - NMHDR hdr; - LITEM link; - int iItem; - int iSubItem; -} NMLVLINK, *PNMLVLINK; - -/************************************************************************** - * Static control - */ - -#define WC_STATICA "Static" -#if defined(__GNUC__) -# define WC_STATICW (const WCHAR []){ 'S','t','a','t','i','c',0 } -#elif defined(_MSC_VER) -# define WC_STATICW L"Static" -#else -static const WCHAR WC_STATICW[] = { 'S','t','a','t','i','c',0 }; -#endif -#define WC_STATIC WINELIB_NAME_AW(WC_STATIC) - -/************************************************************************** - * Combobox control - */ - -#define WC_COMBOBOXA "ComboBox" -#if defined(__GNUC__) -# define WC_COMBOBOXW (const WCHAR []){ 'C','o','m','b','o','B','o','x',0 } -#elif defined(_MSC_VER) -# define WC_COMBOBOXW L"ComboBox" -#else -static const WCHAR WC_COMBOBOXW[] = { 'C','o','m','b','o','B','o','x',0 }; -#endif -#define WC_COMBOBOX WINELIB_NAME_AW(WC_COMBOBOX) - -/************************************************************************** - * Edit control - */ - -#define WC_EDITA "Edit" -#if defined(__GNUC__) -# define WC_EDITW (const WCHAR []){ 'E','d','i','t',0 } -#elif defined(_MSC_VER) -# define WC_EDITW L"Edit" -#else -static const WCHAR WC_EDITW[] = { 'E','d','i','t',0 }; -#endif -#define WC_EDIT WINELIB_NAME_AW(WC_EDIT) - -/************************************************************************** - * Listbox control - */ - -#define WC_LISTBOXA "ListBox" -#if defined(__GNUC__) -# define WC_LISTBOXW (const WCHAR []){ 'L','i','s','t','B','o','x',0 } -#elif defined(_MSC_VER) -# define WC_LISTBOXW L"ListBox" -#else -static const WCHAR WC_LISTBOXW[] = { 'L','i','s','t','B','o','x',0 }; -#endif -#define WC_LISTBOX WINELIB_NAME_AW(WC_LISTBOX) - -/************************************************************************** - * Scrollbar control - */ - -#define WC_SCROLLBARA "ScrollBar" -#if defined(__GNUC__) -# define WC_SCROLLBARW (const WCHAR []){ 'S','c','r','o','l','l','B','a','r',0 } -#elif defined(_MSC_VER) -# define WC_SCROLLBARW L"ScrollBar" -#else -static const WCHAR WC_SCROLLBARW[] = { 'S','c','r','o','l','l','B','a','r',0 }; -#endif -#define WC_SCROLLBAR WINELIB_NAME_AW(WC_SCROLLBAR) +#define DPAMM_MERGE 1 +#define DPAMM_DELETE 2 +#define DPAMM_INSERT 3 #ifdef __cplusplus } #endif - -#endif /* __WINE_COMMCTRL_H */ +#endif +#endif diff --git a/include/psdk/dhcpcapi.h b/include/psdk/dhcpcapi.h index a6f93d13e35..9b7416c773f 100644 --- a/include/psdk/dhcpcapi.h +++ b/include/psdk/dhcpcapi.h @@ -1,17 +1,33 @@ #ifndef _DHCPCAPI_H #define _DHCPCAPI_H -#include -#include - #ifdef __cplusplus extern "C" { #endif - VOID WINAPI DhcpLeaseIpAddress( ULONG AdapterIndex ); - VOID WINAPI DhcpReleaseIpAddressLease( ULONG AdapterIndex ); - VOID WINAPI DhcpStaticRefreshParams - ( ULONG AdapterIndex, ULONG IpAddress, ULONG NetMask ); +DWORD APIENTRY DhcpLeaseIpAddress( DWORD AdapterIndex ); +DWORD APIENTRY DhcpQueryHWInfo( DWORD AdapterIndex, + PDWORD MediaType, + PDWORD Mtu, + PDWORD Speed ); +DWORD APIENTRY DhcpReleaseIpAddressLease( DWORD AdapterIndex ); +DWORD APIENTRY DhcpRenewIpAddressLease( DWORD AdapterIndex ); +DWORD APIENTRY DhcpStaticRefreshParams( DWORD AdapterIndex, + DWORD Address, + DWORD Netmask ); +DWORD APIENTRY +DhcpNotifyConfigChange(LPWSTR ServerName, + LPWSTR AdapterName, + BOOL NewIpAddress, + DWORD IpIndex, + DWORD IpAddress, + DWORD SubnetMask, + int DhcpAction); +DWORD APIENTRY DhcpRosGetAdapterInfo( DWORD AdapterIndex, + PBOOL DhcpEnabled, + PDWORD DhcpServer, + time_t *LeaseObtained, + time_t *LeaseExpires ); #ifdef __cplusplus } diff --git a/include/psdk/gdiplusflat.h b/include/psdk/gdiplusflat.h index cd97a70332e..8312e16490a 100644 --- a/include/psdk/gdiplusflat.h +++ b/include/psdk/gdiplusflat.h @@ -561,8 +561,9 @@ GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection(GpPathGradient*,BOOL); GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient*,REAL,REAL); GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient*, - ARGB*,INT*); + GDIPCONST ARGB*,INT*); GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient*,GpWrapMode); +GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient*,INT*); /* PathIterator */ GpStatus WINGDIPAPI GdipCreatePathIter(GpPathIterator**,GpPath*); diff --git a/include/psdk/psdk.rbuild b/include/psdk/psdk.rbuild index 02256ebc338..ebf38da2d59 100644 --- a/include/psdk/psdk.rbuild +++ b/include/psdk/psdk.rbuild @@ -47,6 +47,7 @@ richole.idl sensevts.idl servprov.idl + shdeprecated.idl shldisp.idl shobjidl.idl shtypes.idl @@ -68,6 +69,8 @@ xmldso.idl xmldom.idl xmllite.idl + wia_lh.idl + wia_xp.idl stdole2.idl diff --git a/include/psdk/shdeprecated.idl b/include/psdk/shdeprecated.idl new file mode 100644 index 00000000000..304b0875224 --- /dev/null +++ b/include/psdk/shdeprecated.idl @@ -0,0 +1,31 @@ +/* + * Deprecated shell interfaces + * + * Copyright (C) 2010 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "objidl.idl"; + +[ + object, + local, + uuid(5836fb00-8187-11cf-a12b-00aa004ae837) +] +interface IShellService : IUnknown +{ + HRESULT SetOwner( [in] IUnknown *pUnk ); +} diff --git a/include/psdk/shlwapi.h b/include/psdk/shlwapi.h index 29e70b76d8c..223bcdd3c05 100644 --- a/include/psdk/shlwapi.h +++ b/include/psdk/shlwapi.h @@ -1028,24 +1028,6 @@ typedef struct _DLLVERSIONINFO2 { HRESULT WINAPI DllInstall(BOOL,LPCWSTR) DECLSPEC_HIDDEN; -#if (_WIN32_IE >= 0x0600) -#define SHGVSPB_PERUSER 0x00000001 -#define SHGVSPB_ALLUSERS 0x00000002 -#define SHGVSPB_PERFOLDER 0x00000004 -#define SHGVSPB_ALLFOLDERS 0x00000008 -#define SHGVSPB_INHERIT 0x00000010 -#define SHGVSPB_ROAM 0x00000020 -#define SHGVSPB_NOAUTODEFAULTS 0x80000000 - -#define SHGVSPB_FOLDER (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER) -#define SHGVSPB_FOLDERNODEFAULTS (SHGVSPB_PERUSER | SHGVSPB_PERFOLDER | SHGVSPB_NOAUTODEFAULTS) -#define SHGVSPB_USERDEFAULTS (SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS) -#define SHGVSPB_GLOBALDEAFAULTS (SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS) - -HRESULT WINAPI SHGetViewStatePropertyBag(LPCITEMIDLIST pidl, LPWSTR bag_name, DWORD flags, REFIID riid, void **ppv); -#endif /* (_WIN32_IE >= 0x0600) */ - - /* IsOS definitions */ #define OS_WIN32SORGREATER 0x00 @@ -1103,6 +1085,15 @@ BOOL WINAPI IsOS(DWORD); #define FDTF_RTLDATE 0x00000200 #define FDTF_NOAUTOREADINGORDER 0x00000400 + +typedef struct +{ + const IID *piid; + int dwOffset; +} QITAB, *LPQITAB; + +HRESULT WINAPI QISearch(void* base, const QITAB *pqit, REFIID riid, void **ppv); + #include #ifdef __cplusplus diff --git a/include/psdk/sti.h b/include/psdk/sti.h index 56650f5a011..204492d9a2f 100644 --- a/include/psdk/sti.h +++ b/include/psdk/sti.h @@ -31,6 +31,147 @@ extern "C" { DEFINE_GUID(CLSID_Sti, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); +DEFINE_GUID(IID_IStillImageW, 0x641BD880, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); + +DEFINE_GUID(IID_IStillImageA, 0xA7B1F740, 0x1D7F, 0x11D1, 0xAC, 0xA9, 0x00, 0xA0, 0x24, 0x38, 0xAD, 0x48); + +#define STI_VERSION_REAL 0x00000002 +#define STI_VERSION_FLAG_UNICODE 0x01000000 + +#ifndef WINE_NO_UNICODE_MACROS +# ifdef UNICODE +# define STI_VERSION (STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE) +# else +# define STI_VERSION (STI_VERSION_REAL) +# endif +#endif + +typedef struct IStillImageA *PSTIA; +typedef struct IStillImageW *PSTIW; +DECL_WINELIB_TYPE_AW(PSTI) +typedef struct IStillImageA *LPSTILLIMAGEA; +typedef struct IStillImageW *LPSTILLIMAGEW; +DECL_WINELIB_TYPE_AW(LPSTILLIMAGE) +typedef struct IStiDeviceA *PSTIDEVICEA; +typedef struct IStiDeviceW *PSTIDEVICEW; +DECL_WINELIB_TYPE_AW(PSTIDEVICE) + +HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter); +HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter); +#define StiCreateInstance WINELIB_NAME_AW(StiCreateInstance) + +typedef DWORD STI_DEVICE_TYPE; +typedef enum _STI_DEVICE_MJ_TYPE +{ + StiDeviceTypeDefault = 0, + StiDeviceTypeScanner = 1, + StiDeviceTypeDigitalCamera = 2, + StiDeviceTypeStreamingVideo = 3 +} STI_DEVICE_MJ_TYPE; + +#define GET_STIDEVICE_TYPE(dwDevType) HIWORD(dwDevType) +#define GET_STIDEVICE_SUBTYPE(dwDevType) LOWORD(dwDevType) + +typedef struct _STI_DEV_CAPS { + DWORD dwGeneric; +} STI_DEV_CAPS, *PSTI_DEV_CAPS; + +#define STI_MAX_INTERNAL_NAME_LENGTH 128 + +typedef struct _STI_DEVICE_INFORMATIONW { + DWORD dwSize; + STI_DEVICE_TYPE DeviceType; + WCHAR szDeviceInternalName[STI_MAX_INTERNAL_NAME_LENGTH]; + STI_DEV_CAPS DeviceCapabilities; + DWORD dwHardwareConfiguration; + LPWSTR pszVendorDescription; + LPWSTR pszDeviceDescription; + LPWSTR pszPortName; + LPWSTR pszPropProvider; + LPWSTR pszLocalName; +} STI_DEVICE_INFORMATIONW, *PSTI_DEVICE_INFORMATIONW; + +typedef STI_DEVICE_INFORMATIONW STI_DEVICE_INFORMATION; +typedef PSTI_DEVICE_INFORMATIONW PSTI_DEVICE_INFORMATION; + +#define MAX_NOTIFICATION_DATA 64 + +typedef struct _STINOTIFY { + DWORD dwSize; + GUID guidNotificationCode; + BYTE abNotificationData[MAX_NOTIFICATION_DATA]; +} STINOTIFY,*LPSTINOTIFY; + +#define INTERFACE IStillImageW +DECLARE_INTERFACE_(IStillImageW, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** IStillImageW methods ***/ + STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; + STDMETHOD(GetDeviceList)(THIS_ DWORD dwType, DWORD dwFlags, DWORD *pdwItemsReturned, LPVOID *ppBuffer) PURE; + STDMETHOD(GetDeviceInfo)(THIS_ LPWSTR pwszDeviceName, LPVOID *ppBuffer) PURE; + STDMETHOD(CreateDevice)(THIS_ LPWSTR pwszDeviceName, DWORD dwMode, PSTIDEVICEW *pDevice, LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetDeviceValue)(THIS_ LPWSTR pwszDeviceName, LPWSTR pValueName, LPDWORD pType, LPBYTE pData, LPDWORD cbData) PURE; + STDMETHOD(SetDeviceValue)(THIS_ LPWSTR pwszDeviceName, LPWSTR pValueName, DWORD type, LPBYTE pData, DWORD cbData) PURE; + STDMETHOD(GetSTILaunchInformation)(THIS_ LPWSTR pwszDeviceName, DWORD *pdwEventCode, LPWSTR pwszEventName) PURE; + STDMETHOD(RegisterLaunchApplication)(THIS_ LPWSTR pwszAppName, LPWSTR pwszCommandLine) PURE; + STDMETHOD(UnregisterLaunchApplication)(THIS_ LPWSTR pwszAppName) PURE; + STDMETHOD(EnableHwNotifications)(THIS_ LPCWSTR pwszDeviceName, BOOL bNewState) PURE; + STDMETHOD(GetHwNotificationState)(THIS_ LPCWSTR pwszDeviceName, BOOL *pbCurrentState) PURE; + STDMETHOD(RefreshDeviceBus)(THIS_ LPCWSTR pwszDeviceName) PURE; + STDMETHOD(LaunchApplicationForDevice)(THIS_ LPWSTR pwszDeviceName, LPWSTR pwszAppName, LPSTINOTIFY pStiNotify); + STDMETHOD(SetupDeviceParameters)(THIS_ PSTI_DEVICE_INFORMATIONW pDevInfo); + STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType, LPCWSTR pszMessage) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define IStillImage_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IStillImage_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IStillImage_Release(p) (p)->lpVtbl->Release(p) +/*** IStillImage methods ***/ +#define IStillImage_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IStillImage_GetDeviceList(p,a,b,c,d) (p)->lpVtbl->GetDeviceList(p,a,b,c,d) +#define IStillImage_GetDeviceInfo(p,a,b) (p)->lpVtbl->GetDeviceInfo(p,a,b) +#define IStillImage_CreateDevice(p,a,b,c,d) (p)->lpVtbl->CreateDevice(p,a,b,c,d) +#define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->GetDeviceValue(p,a,b,c,d,e) +#define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->lpVtbl->SetDeviceValue(p,a,b,c,d,e) +#define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->lpVtbl->GetSTILaunchInformation(p,a,b,c) +#define IStillImage_RegisterLaunchApplication(p,a,b) (p)->lpVtbl->RegisterLaunchApplication(p,a,b) +#define IStillImage_UnregisterLaunchApplication(p,a) (p)->lpVtbl->UnregisterLaunchApplication(p,a) +#define IStillImage_EnableHwNotifications(p,a,b) (p)->lpVtbl->EnableHwNotifications(p,a,b) +#define IStillImage_GetHwNotificationState(p,a,b) (p)->lpVtbl->GetHwNotificationState(p,a,b) +#define IStillImage_RefreshDeviceBus(p,a) (p)->lpVtbl->RefreshDeviceBus(p,a) +#define IStillImage_LaunchApplicationForDevice(p,a,b,c) (p)->lpVtbl->LaunchApplicationForDevice(p,a,b,c) +#define IStillImage_SetupDeviceParameters(p,a) (p)->lpVtbl->SetupDeviceParameters(p,a) +#define IStillImage_WriteToErrorLog(p,a,b) (p)->lpVtbl->WriteToErrorLog(p,a,b) +#else +/*** IUnknown methods ***/ +#define IStillImage_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IStillImage_AddRef(p) (p)->AddRef() +#define IStillImage_Release(p) (p)->Release() +/*** IStillImage methods ***/ +#define IStillImage_Initialize(p,a,b) (p)->Initialize(a,b) +#define IStillImage_GetDeviceList(p,a,b,c,d) (p)->GetDeviceList(a,b,c,d) +#define IStillImage_GetDeviceInfo(p,a,b) (p)->GetDeviceInfo(a,b) +#define IStillImage_CreateDevice(p,a,b,c,d) (p)->CreateDevice(a,b,c,d) +#define IStillImage_GetDeviceValue(p,a,b,c,d,e) (p)->GetDeviceValue(a,b,c,d,e) +#define IStillImage_SetDeviceValue(p,a,b,c,d,e) (p)->SetDeviceValue(a,b,c,d,e) +#define IStillImage_GetSTILaunchInformation(p,a,b,c) (p)->GetSTILaunchInformation(a,b,c) +#define IStillImage_RegisterLaunchApplication(p,a,b) (p)->RegisterLaunchApplication(a,b) +#define IStillImage_UnregisterLaunchApplication(p,a) (p)->UnregisterLaunchApplication(a) +#define IStillImage_EnableHwNotifications(p,a,b) (p)->EnableHwNotifications(a,b) +#define IStillImage_GetHwNotificationState(p,a,b) (p)->GetHwNotificationState(a,b) +#define IStillImage_RefreshDeviceBus(p,a) (p)->RefreshDeviceBus(a) +#define IStillImage_LaunchApplicationForDevice(p,a,b,c) (p)->LaunchApplicationForDevice(a,b,c) +#define IStillImage_SetupDeviceParameters(p,a) (p)->SetupDeviceParameters(a) +#define IStillImage_WriteToErrorLog(p,a,b) (p)->WriteToErrorLog(a,b) +#endif + #ifdef __cplusplus }; #endif diff --git a/include/psdk/strsafe.h b/include/psdk/strsafe.h new file mode 100644 index 00000000000..7f09e1bd0fe --- /dev/null +++ b/include/psdk/strsafe.h @@ -0,0 +1,626 @@ +#ifndef __STRSAFE_H_ +#define __STRSAFE_H_ + +#include +#include + +#if defined(STRSAFE_NO_CCH_FUNCTIONS) && defined(STRSAFE_NO_CB_FUNCTIONS) +#error Both STRSAFE_NO_CCH_FUNCTIONS and STRSAFE_NO_CB_FUNCTIONS are defined +#endif + +#ifndef SUCCEEDED +#define SUCCEEDED(Status) ((HRESULT)(Status) >= 0) +#endif +#define STRSAFE_MAX_CCH 2147483647 +#define STRSAFE_E_INVALID_PARAMETER ((HRESULT)0x80070057L) +#define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) +#define STRSAFE_E_END_OF_FILE ((HRESULT)0x80070026L) + +#define STRSAFE_FILL_BEHIND_NULL 0x00000200 +#define STRSAFE_IGNORE_NULLS 0x00000200 +#define STRSAFE_FILL_ON_FAILURE 0x00000400 +#define STRSAFE_NULL_ON_FAILURE 0x00000800 +#define STRSAFE_NO_TRUNCATION 0x00001000 + +#ifndef S_OK +#define S_OK ((HRESULT)0x00000000L) +#endif + +#define STRSAFE_MIN(a,b) (((a) < (b))?(a):(b)) + +#ifndef _HRESULT_DEFINED +#define _HRESULT_DEFINED +typedef long HRESULT; +#endif + +typedef char * STRSAFE_LPSTR; +typedef const char * STRSAFE_LPCSTR; +typedef wchar_t * STRSAFE_LPWSTR; +typedef const wchar_t * STRSAFE_LPCWSTR; +typedef unsigned long STRSAFE_DWORD; + +#define STRSAFE_PASS2 + +/* Implement Cb functions for ansi and unicode */ +#ifndef STRSAFE_NO_CB_FUNCTIONS +#define STRSAFE_CB +#define STRSAFE_UNICODE 0 +# include +#undef STRSAFE_UNICODE +#define STRSAFE_UNICODE 1 +# include +#undef STRSAFE_UNICODE +#undef STRSAFE_CB +#endif // !STRSAFE_NO_CB_FUNCTIONS + +/* Implement Cch functions for ansi and unicode */ +#ifndef STRSAFE_NO_CCH_FUNCTIONS +#define STRSAFE_UNICODE 0 +# include +#undef STRSAFE_UNICODE +#define STRSAFE_UNICODE 1 +# include +#undef STRSAFE_UNICODE +#endif // !STRSAFE_NO_CCH_FUNCTIONS + +#undef STRSAFE_PASS2 + +/* Now define the functions depending on UNICODE */ +#if defined(UNICODE) +# define STRSAFE_UNICODE 1 +#else +# define STRSAFE_UNICODE 0 +#endif +#include +#undef STRSAFE_UNICODE + +#endif // !__STRSAFE_H_ + +/*****************************************************************************/ + +#if defined(STRSAFE_UNICODE) +#if (STRSAFE_UNICODE == 1) + +#define STRSAFE_LPTSTR STRSAFE_LPWSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCWSTR +#define STRSAFE_TCHAR wchar_t + +#define StringCbCat StringCbCatW +#define StringCbCatEx StringCbCatExW +#define StringCbCatN StringCbCatNW +#define StringCbCatNEx StringCbCatNExW +#define StringCbCatWorker StringCxxCatWorkerW +#define StringCbCopy StringCbCopyW +#define StringCbCopyEx StringCbCopyExW +#define StringCbCopyN StringCbCopyNW +#define StringCbCopyNEx StringCbCopyNExW +#define StringCbGets StringCbGetsW +#define StringCbGetsEx StringCbGetsExW +#define StringCbLength StringCbLengthW +#define StringCbPrintf StringCbPrintfW +#define StringCbPrintfEx StringCbPrintfExW +#define StringCbVPrintf StringCbVPrintfW +#define StringCbVPrintfEx StringCbVPrintfExW +#define StringCchCat StringCchCatW +#define StringCchCatEx StringCchCatExW +#define StringCchCatN StringCchCatNW +#define StringCchCatNEx StringCchCatNExW +#define StringCchCatWorker StringCchCatWorkerW +#define StringCchCopy StringCchCopyW +#define StringCchCopyEx StringCchCopyExW +#define StringCchCopyN StringCchCopyNW +#define StringCchCopyNEx StringCchCopyNExW +#define StringCchGets StringCchGetsW +#define StringCchGetsEx StringCchGetsExW +#define StringCchLength StringCchLengthW +#define StringCchPrintf StringCchPrintfW +#define StringCchPrintfEx StringCchPrintfExW +#define StringCchVPrintf StringCchVPrintfW +#define StringCchVPrintfEx StringCchVPrintfExW +#define _vsnprintfAW _vsnwprintf + +#else // (STRSAFE_UNICODE != 1) + +#define STRSAFE_LPTSTR STRSAFE_LPSTR +#define STRSAFE_LPCTSTR STRSAFE_LPCSTR +#define STRSAFE_TCHAR char + +#define StringCbCat StringCbCatA +#define StringCbCatEx StringCbCatExA +#define StringCbCatN StringCbCatNA +#define StringCbCatNEx StringCbCatNExA +#define StringCbCatWorker StringCxxCatWorkerA +#define StringCbCopy StringCbCopyA +#define StringCbCopyEx StringCbCopyExA +#define StringCbCopyN StringCbCopyNA +#define StringCbCopyNEx StringCbCopyNExA +#define StringCbGets StringCbGetsA +#define StringCbGetsEx StringCbGetsExA +#define StringCbLength StringCbLengthA +#define StringCbPrintf StringCbPrintfA +#define StringCbPrintfEx StringCbPrintfExA +#define StringCbVPrintf StringCbVPrintfA +#define StringCbVPrintfEx StringCbVPrintfExA +#define StringCchCat StringCchCatA +#define StringCchCatEx StringCchCatExA +#define StringCchCatN StringCchCatNA +#define StringCchCatNEx StringCchCatNExA +#define StringCchCatWorker StringCchCatWorkerA +#define StringCchCopy StringCchCopyA +#define StringCchCopyEx StringCchCopyExA +#define StringCchCopyN StringCchCopyNA +#define StringCchCopyNEx StringCchCopyNExA +#define StringCchGets StringCchGetsA +#define StringCchGetsEx StringCchGetsExA +#define StringCchLength StringCchLengthA +#define StringCchPrintf StringCchPrintfA +#define StringCchPrintfEx StringCchPrintfExA +#define StringCchVPrintf StringCchVPrintfA +#define StringCchVPrintfEx StringCchVPrintfExA +#define _vsnprintfAW _vsnprintf + +#endif // (STRSAFE_UNICODE != 1) +#endif // defined(STRSAFE_UNICODE) + +/*****************************************************************************/ + +#if defined (STRSAFE_PASS2) + +#if defined(STRSAFE_CB) + +#define STRSAFE_CXXtoCB(x) (x) +#define STRSAFE_CBtoCXX(x) (x) +#define STRSAFE_CXXtoCCH(x) (x)/sizeof(STRSAFE_TCHAR) +#define STRSAFE_CCHtoCXX(x) (x)*sizeof(STRSAFE_TCHAR) +#define StringCxxCat StringCbCat +#define StringCxxCatEx StringCbCatEx +#define StringCxxCatN StringCbCatN +#define StringCxxCatNEx StringCbCatNEx +#define StringCxxCatWorker StringCbCatWorker +#define StringCxxCopy StringCbCopy +#define StringCxxCopyEx StringCbCopyEx +#define StringCxxCopyN StringCbCopyN +#define StringCxxCopyNEx StringCbCopyNEx +#define StringCxxGets StringCbGets +#define StringCxxGetsEx StringCbGetsEx +#define StringCxxLength StringCbLength +#define StringCxxPrintf StringCbPrintf +#define StringCxxPrintfEx StringCbPrintfEx +#define StringCxxVPrintf StringCbVPrintf +#define StringCxxVPrintfEx StringCbVPrintfEx + +#else // !STRSAFE_CB + +#define STRSAFE_CXXtoCB(x) (x)*sizeof(STRSAFE_TCHAR) +#define STRSAFE_CBtoCXX(x) (x)/sizeof(STRSAFE_TCHAR) +#define STRSAFE_CXXtoCCH(x) (x) +#define STRSAFE_CCHtoCXX(x) (x) +#define StringCxxCat StringCchCat +#define StringCxxCatEx StringCchCatEx +#define StringCxxCatN StringCchCatN +#define StringCxxCatNEx StringCchCatNEx +#define StringCxxCatWorker StringCchCatWorker +#define StringCxxCopy StringCchCopy +#define StringCxxCopyEx StringCchCopyEx +#define StringCxxCopyN StringCchCopyN +#define StringCxxCopyNEx StringCchCopyNEx +#define StringCxxGets StringCchGets +#define StringCxxGetsEx StringCchGetsEx +#define StringCxxLength StringCchLength +#define StringCxxPrintf StringCchPrintf +#define StringCxxPrintfEx StringCchPrintfEx +#define StringCxxVPrintf StringCchVPrintf +#define StringCxxVPrintfEx StringCchVPrintfEx + +#endif // !STRSAFE_CB + +#ifdef STRSAFE_LIB + +/* Normal function prototypes only */ +#define STRSAFEAPI HRESULT __stdcall + +STRSAFEAPI StringCxxCat(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCxxCatEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCatN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend); +STRSAFEAPI StringCxxCatNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbMaxAppend, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCopy(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc); +STRSAFEAPI StringCxxCopyEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxCopyN(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc); +STRSAFEAPI StringCxxCopyNEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszSrc, size_t cbSrc, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxGets(STRSAFE_LPTSTR pszDest, size_t cxDest); +STRSAFEAPI StringCxxGetsEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags); +STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcb); +STRSAFEAPI StringCxxPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringCxxPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCTSTR pszFormat, ...); +STRSAFEAPI StringCxxVPrintf(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPCTSTR pszFormat, va_list args); +STRSAFEAPI StringCxxVPrintfEx(STRSAFE_LPTSTR pszDest, size_t cxDest, STRSAFE_LPTSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, LPCTSTR pszFormat, va_list args); + +#else // !STRSAFE_LIB + +/* Create inlined versions */ +#define STRSAFEAPI HRESULT static __inline__ + +#define STRSAFE_MAX_CXX STRSAFE_CCHtoCXX(STRSAFE_MAX_CCH) + +STRSAFEAPI +StringCxxCatWorker( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszSrc, + size_t cxMaxAppend, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + int UseN) +{ + HRESULT result; + STRSAFE_LPTSTR psz = pszDest; + size_t cch = STRSAFE_CXXtoCCH(cxDest); + + if (!pszDest || !pszSrc || cxDest > STRSAFE_MAX_CXX || cxDest == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + for (--psz; *(++psz) != 0 && --cch > 0;); + if (cch == 0) + { + return STRSAFE_E_INSUFFICIENT_BUFFER; + } + + if (UseN) + { + cch = STRSAFE_MIN(cxDest, STRSAFE_CXXtoCCH(cxMaxAppend)); + } + + for (--pszSrc, --psz; (*(++psz) = *(++pszSrc)) != 0 && --cch > 0;); + if (cch == 0) + { + result = STRSAFE_E_INSUFFICIENT_BUFFER; + } + else + result = S_OK; + + if (ppszDestEnd) + { + *ppszDestEnd = psz; + } + + if (pcbRemaining) + { + *pcbRemaining = STRSAFE_CCHtoCXX(cch); + } + + if (dwFlags & STRSAFE_FILL_BEHIND_NULL) + { + for (--psz, ++cch; --cch; *(++psz) = dwFlags & 0xff); + } + + if (!SUCCEEDED(result)) + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + cch = STRSAFE_CXXtoCCH(cxDest); + for (--pszDest, ++cch; --cch; *(++pszDest) = dwFlags & 0xff); + } + + if (dwFlags & STRSAFE_NULL_ON_FAILURE) + { + *pszDest = 0; + } + } + + return result; +} + +STRSAFEAPI +StringCxxCatEx( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszSrc, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + return StringCxxCatWorker(pszDest, cxDest, pszSrc, 0, ppszDestEnd, pcbRemaining, dwFlags, 0); +} + +STRSAFEAPI +StringCxxCat( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszSrc) +{ + return StringCxxCatWorker(pszDest, cxDest, pszSrc, 0, NULL, NULL, 0, 0); +} + +STRSAFEAPI +StringCxxCatN( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszSrc, + size_t cbMaxAppend) +{ + return StringCxxCatWorker(pszDest, cxDest, pszSrc, cbMaxAppend, NULL, NULL, 0, 1); +} + +STRSAFEAPI +StringCxxCatNEx( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszSrc, + size_t cbMaxAppend, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + return StringCxxCatWorker(pszDest, cxDest, pszSrc, cbMaxAppend, ppszDestEnd, pcbRemaining, dwFlags, 1); +} + +STRSAFEAPI +StringCxxCopy( + STRSAFE_LPTSTR pszDest, + size_t cbDest, + STRSAFE_LPCTSTR pszSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxCopyEx( + STRSAFE_LPTSTR pszDest, + size_t cbDest, + STRSAFE_LPCTSTR pszSrc, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxCopyN( + STRSAFE_LPTSTR pszDest, + size_t cbDest, + STRSAFE_LPCTSTR pszSrc, + size_t cbSrc) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxCopyNEx( + STRSAFE_LPTSTR pszDest, + size_t cbDest, + STRSAFE_LPCTSTR pszSrc, + size_t cbSrc, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxGets( + STRSAFE_LPTSTR pszDest, + size_t cbDest) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxGetsEx( + STRSAFE_LPTSTR pszDest, + size_t cbDest, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags) +{ + return 0; // FIXME +} + +STRSAFEAPI +StringCxxLength( + STRSAFE_LPCTSTR psz, + size_t cxMax, + size_t *pcx) +{ + size_t cch = STRSAFE_CXXtoCCH(cxMax); + + /* Default return on error */ + if (pcx) + *pcx = 0; + + if (!psz || cxMax > STRSAFE_MAX_CXX || cxMax == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + for (--psz; *(++psz) != 0 && --cch > 0;); + + if (cch == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + + if (pcx) + *pcx = cxMax - STRSAFE_CCHtoCXX(cch); + + return S_OK; +} + +STRSAFEAPI +StringCxxVPrintfEx( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcxRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCTSTR pszFormat, + va_list args) +{ + size_t cchDest = STRSAFE_CXXtoCCH(cxDest); + size_t cchMax = cchDest - 1; + int iResult; + HRESULT hr; + + if (dwFlags & STRSAFE_IGNORE_NULLS) + { + if (!pszDest) pszDest = (STRSAFE_LPTSTR)L""; + if (!pszFormat) pszFormat = (STRSAFE_LPTSTR)L""; + } + + if (!pszDest || !pszFormat || cxDest > STRSAFE_MAX_CXX || cxDest == 0) + { + return STRSAFE_E_INVALID_PARAMETER; + } + +#if (STRSAFE_USE_SECURE_CRT == 1) + iResult = _vsnprintf_sAW(pszDest, cchDest, cchMax, pszFormat, args); +#else + iResult = _vsnprintfAW(pszDest, cchMax, pszFormat, args); +#endif + + hr = (iResult == -1) ? STRSAFE_E_INSUFFICIENT_BUFFER : S_OK; + + if ((size_t)iResult >= cchMax) + { + pszDest[cchMax] = 0; + iResult = cchMax; + } + + if (ppszDestEnd) *ppszDestEnd = pszDest + iResult; + + if (pcxRemaining) *pcxRemaining = STRSAFE_CCHtoCXX(cchMax - iResult); + + if (SUCCEEDED(hr)) + { + if ((dwFlags & STRSAFE_FILL_BEHIND_NULL) && (iResult + 1 < cchMax)) + { + memset(pszDest + iResult + 1, + dwFlags & 0xff, + (cchMax - iResult - 1) * sizeof(STRSAFE_TCHAR)); + } + } + else + { + if (dwFlags & STRSAFE_FILL_ON_FAILURE) + { + memset(pszDest, dwFlags & 0xff, cchMax * sizeof(STRSAFE_TCHAR)); + } + else if (dwFlags & STRSAFE_NULL_ON_FAILURE) + { + *pszDest = 0; + } + } + + return hr; +} + +STRSAFEAPI +StringCxxVPrintf( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszFormat, + va_list args) +{ + return StringCxxVPrintfEx(pszDest, cxDest, NULL, NULL, 0, pszFormat, args); +} + +STRSAFEAPI +StringCxxPrintf( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPCTSTR pszFormat, ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCxxVPrintf(pszDest, cxDest, pszFormat, args); + va_end(args); + return result; +} + +STRSAFEAPI +StringCxxPrintfEx( + STRSAFE_LPTSTR pszDest, + size_t cxDest, + STRSAFE_LPTSTR *ppszDestEnd, + size_t *pcbRemaining, + STRSAFE_DWORD dwFlags, + STRSAFE_LPCTSTR pszFormat, ...) +{ + HRESULT result; + va_list args; + va_start(args, pszFormat); + result = StringCxxVPrintfEx(pszDest, cxDest, ppszDestEnd, pcbRemaining, dwFlags, pszFormat, args); + va_end(args); + return result; +} + +#endif // !STRSAFE_LIB + +/* Functions are implemented or defined, clear #defines for next pass */ +#undef StringCxxCat +#undef StringCxxCatEx +#undef StringCxxCatN +#undef StringCxxCatNEx +#undef StringCxxCatWorker +#undef StringCxxCopy +#undef StringCxxCopyEx +#undef StringCxxCopyN +#undef StringCxxCopyNEx +#undef StringCxxGets +#undef StringCxxGetsEx +#undef StringCxxLength +#undef StringCxxPrintf +#undef StringCxxPrintfEx +#undef StringCxxVPrintf +#undef StringCxxVPrintfEx + +#undef StringCbCat +#undef StringCbCatEx +#undef StringCbCatN +#undef StringCbCatNEx +#undef StringCbCatWorker +#undef StringCbCopy +#undef StringCbCopyEx +#undef StringCbCopyN +#undef StringCbCopyNEx +#undef StringCbGets +#undef StringCbGetsEx +#undef StringCbLength +#undef StringCbPrintf +#undef StringCbPrintfEx +#undef StringCbVPrintf +#undef StringCbVPrintfEx +#undef StringCchCat +#undef StringCchCatEx +#undef StringCchCatN +#undef StringCchCatNEx +#undef StringCchCatWorker +#undef StringCchCopy +#undef StringCchCopyEx +#undef StringCchCopyN +#undef StringCchCopyNEx +#undef StringCchGets +#undef StringCchGetsEx +#undef StringCchLength +#undef StringCchPrintf +#undef StringCchPrintfEx +#undef StringCchVPrintf +#undef StringCchVPrintfEx +#undef _vsnprintfAW + +#undef STRSAFE_LPTSTR +#undef STRSAFE_LPCTSTR +#undef STRSAFE_TCHAR + +#undef STRSAFE_CXXtoCB +#undef STRSAFE_CBtoCXX +#undef STRSAFE_CXXtoCCH +#undef STRSAFE_CCHtoCXX + +#endif // defined (STRSAFE_PASS2) + diff --git a/include/psdk/wia.h b/include/psdk/wia.h new file mode 100644 index 00000000000..3a0497e6d83 --- /dev/null +++ b/include/psdk/wia.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifdef __WINESRC__ +#error Specify wia_lh.h or wia_xp.h explicitly in Wine +#endif + +#if (_WIN32_WINNT >= 0x0600) +#include +#elif (_WIN32_WINNT >= 0x0501) +#include +#endif diff --git a/include/psdk/wia_lh.idl b/include/psdk/wia_lh.idl new file mode 100644 index 00000000000..5024787a6fc --- /dev/null +++ b/include/psdk/wia_lh.idl @@ -0,0 +1,127 @@ +/* + * Copyright 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "wtypes.idl"; +import "objidl.idl"; + +interface IEnumWIA_DEV_INFO; +interface IWiaItem; +interface IWiaEventCallback; + +cpp_quote("DEFINE_GUID(CLSID_WiaDevMgr, 0xa1f4e726,0x8cf1,0x11d1,0xbf,0x92,0x00,0x60,0x08,0x1e,0xd8,0x11);") + +[ + object, + uuid(5eb2502a-8cf1-11d1-bf92-0060081ed811) +] +interface IWiaDevMgr : IUnknown +{ + HRESULT EnumDeviceInfo( + [in] LONG lFlag, + [retval, out] IEnumWIA_DEV_INFO **ppIEnum); + + HRESULT CreateDevice( + [in] BSTR bstrDeviceID, + [out] IWiaItem **ppWiaItemRoot); + + HRESULT SelectDeviceDlg( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [in, out] BSTR *pbstrDeviceID, + [retval, out] IWiaItem **ppItemRoot); + + HRESULT SelectDeviceDlgID( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [retval, out] BSTR *pbstrDeviceID); + + HRESULT GetImageDlg( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [in] LONG lIntent, + [in] IWiaItem *pItemRoot, + [in] BSTR bstrFilename, + [in, out] GUID *pguidFormat); + + HRESULT RegisterEventCallbackProgram( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [in] BSTR bstrCommandline, + [in] BSTR bstrName, + [in] BSTR bstrDescription, + [in] BSTR bstrIcon); + + HRESULT RegisterEventCallbackInterface( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [unique, in] IWiaEventCallback *pIWiaEventCallback, + [out] IUnknown **pEventObject); + + HRESULT RegisterEventCallbackCLSID( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [unique, in] const GUID *pClsID, + [in] BSTR bstrName, + [in] BSTR bstrDescription, + [in] BSTR bstrIcon); + + HRESULT AddDeviceDlg( + [in] HWND hwndParent, + [in] LONG lFlags); +} + +[ + object, + uuid(5e38b83c-8cf1-11d1-bf92-0060081ed811) +] +interface IEnumWIA_DEV_INFO : IUnknown +{ + /* fill in */ +} + +[ + object, + uuid(4db1ad10-3391-11d2-9a33-00c04fa36145) +] +interface IWiaItem : IUnknown +{ + /* FIXME: fill in */ +} + +[ + object, + uuid(ae6287b0-0084-11d2-973b-00a0c9068f2e) +] +interface IWiaEventCallback : IUnknown +{ + HRESULT ImageEventCallback( + [in] const GUID *pEventGUID, + [in] BSTR bstrEventDescription, + [in] BSTR bstrDeviceID, + [in] BSTR bstrDeviceDescription, + [in] DWORD dwDeviceType, + [in] BSTR bstrFullItemName, + [in,out] ULONG *pulEventType, + [in] ULONG ulReserved); +} diff --git a/include/psdk/wia_xp.idl b/include/psdk/wia_xp.idl new file mode 100644 index 00000000000..5024787a6fc --- /dev/null +++ b/include/psdk/wia_xp.idl @@ -0,0 +1,127 @@ +/* + * Copyright 2009 Damjan Jovanovic + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "wtypes.idl"; +import "objidl.idl"; + +interface IEnumWIA_DEV_INFO; +interface IWiaItem; +interface IWiaEventCallback; + +cpp_quote("DEFINE_GUID(CLSID_WiaDevMgr, 0xa1f4e726,0x8cf1,0x11d1,0xbf,0x92,0x00,0x60,0x08,0x1e,0xd8,0x11);") + +[ + object, + uuid(5eb2502a-8cf1-11d1-bf92-0060081ed811) +] +interface IWiaDevMgr : IUnknown +{ + HRESULT EnumDeviceInfo( + [in] LONG lFlag, + [retval, out] IEnumWIA_DEV_INFO **ppIEnum); + + HRESULT CreateDevice( + [in] BSTR bstrDeviceID, + [out] IWiaItem **ppWiaItemRoot); + + HRESULT SelectDeviceDlg( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [in, out] BSTR *pbstrDeviceID, + [retval, out] IWiaItem **ppItemRoot); + + HRESULT SelectDeviceDlgID( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [retval, out] BSTR *pbstrDeviceID); + + HRESULT GetImageDlg( + [in] HWND hwndParent, + [in] LONG lDeviceType, + [in] LONG lFlags, + [in] LONG lIntent, + [in] IWiaItem *pItemRoot, + [in] BSTR bstrFilename, + [in, out] GUID *pguidFormat); + + HRESULT RegisterEventCallbackProgram( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [in] BSTR bstrCommandline, + [in] BSTR bstrName, + [in] BSTR bstrDescription, + [in] BSTR bstrIcon); + + HRESULT RegisterEventCallbackInterface( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [unique, in] IWiaEventCallback *pIWiaEventCallback, + [out] IUnknown **pEventObject); + + HRESULT RegisterEventCallbackCLSID( + [in] LONG lFlags, + [in] BSTR bstrDeviceID, + [in] const GUID *pEventGUID, + [unique, in] const GUID *pClsID, + [in] BSTR bstrName, + [in] BSTR bstrDescription, + [in] BSTR bstrIcon); + + HRESULT AddDeviceDlg( + [in] HWND hwndParent, + [in] LONG lFlags); +} + +[ + object, + uuid(5e38b83c-8cf1-11d1-bf92-0060081ed811) +] +interface IEnumWIA_DEV_INFO : IUnknown +{ + /* fill in */ +} + +[ + object, + uuid(4db1ad10-3391-11d2-9a33-00c04fa36145) +] +interface IWiaItem : IUnknown +{ + /* FIXME: fill in */ +} + +[ + object, + uuid(ae6287b0-0084-11d2-973b-00a0c9068f2e) +] +interface IWiaEventCallback : IUnknown +{ + HRESULT ImageEventCallback( + [in] const GUID *pEventGUID, + [in] BSTR bstrEventDescription, + [in] BSTR bstrDeviceID, + [in] BSTR bstrDeviceDescription, + [in] DWORD dwDeviceType, + [in] BSTR bstrFullItemName, + [in,out] ULONG *pulEventType, + [in] ULONG ulReserved); +} diff --git a/include/psdk/winbase.h b/include/psdk/winbase.h index 6b38dacb365..79c52ac5579 100644 --- a/include/psdk/winbase.h +++ b/include/psdk/winbase.h @@ -2301,6 +2301,9 @@ VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE); VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE); #endif BOOL WINAPI WinLoadTrustProvider(GUID*); +BOOL WINAPI Wow64DisableWow64FsRedirection(PVOID*); +BOOLEAN WINAPI Wow64EnableWow64FsRedirection(BOOLEAN); +BOOL WINAPI Wow64RevertWow64FsRedirection(PVOID); BOOL WINAPI WriteFile(HANDLE,LPCVOID,DWORD,LPDWORD,LPOVERLAPPED); BOOL WINAPI WriteFileEx(HANDLE,LPCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); BOOL WINAPI WriteFileGather(HANDLE,FILE_SEGMENT_ELEMENT*,DWORD,LPDWORD,LPOVERLAPPED); diff --git a/include/reactos/subsys/csrss/csrss.h b/include/reactos/subsys/csrss/csrss.h index 1f276fa16d9..0119bad99a3 100644 --- a/include/reactos/subsys/csrss/csrss.h +++ b/include/reactos/subsys/csrss/csrss.h @@ -472,6 +472,11 @@ typedef struct DWORD ProcessGroup; } CSRSS_GENERATE_CTRL_EVENT, *PCSRSS_GENERATE_CTRL_EVENT; +typedef struct +{ + HANDLE OutputHandle; + COORD Size; +} CSRSS_SET_SCREEN_BUFFER_SIZE, *PCSRSS_SET_SCREEN_BUFFER_SIZE; #define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type)) @@ -551,6 +556,7 @@ typedef struct #define GET_CONSOLE_ALIASES_EXES_LENGTH (0x3D) #define GENERATE_CTRL_EVENT (0x3E) #define CREATE_THREAD (0x3F) +#define SET_SCREEN_BUFFER_SIZE (0x40) /* Keep in sync with definition below. */ #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS)) @@ -624,6 +630,7 @@ typedef struct _CSR_API_MESSAGE CSRSS_GET_CONSOLE_ALIASES_EXES GetConsoleAliasesExes; CSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH GetConsoleAliasesExesLength; CSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent; + CSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize; } Data; } CSR_API_MESSAGE, *PCSR_API_MESSAGE; diff --git a/include/reactos/win32k/ntuser.h b/include/reactos/win32k/ntuser.h index 53a8f6a3311..0d6d7811db7 100644 --- a/include/reactos/win32k/ntuser.h +++ b/include/reactos/win32k/ntuser.h @@ -514,7 +514,7 @@ typedef struct _WND HRGN hrgnClip; HRGN hrgnNewFrame; /* Window name. */ - UNICODE_STRING strName; + LARGE_UNICODE_STRING strName; /* Size of the extra data associated with the window. */ ULONG cbwndExtra; HWND hWndLastActive; @@ -1469,31 +1469,12 @@ NtUserCreateLocalMemHandle( DWORD Unknown2, DWORD Unknown3); -HWND -NTAPI -NtUserCreateWindowEx( - DWORD dwExStyle, - PUNICODE_STRING lpClassName, - PUNICODE_STRING lpWindowName, - DWORD dwStyle, - LONG x, - LONG y, - LONG nWidth, - LONG nHeight, - HWND hWndParent, - HMENU hMenu, - HINSTANCE hInstance, - LPVOID lpParam, - DWORD dwShowMode, - BOOL bUnicodeWindow, - DWORD dwUnknown); -#if 0 HWND NTAPI NtUserCreateWindowEx( DWORD dwExStyle, // |= 0x80000000 == Ansi used to set WNDS_ANSICREATOR PLARGE_STRING plstrClassName, - PLARGE_STRING plstrClsVesrion, + PLARGE_STRING plstrClsVersion, PLARGE_STRING plstrWindowName, DWORD dwStyle, int x, @@ -1506,7 +1487,6 @@ NtUserCreateWindowEx( LPVOID lpParam, DWORD dwFlags, PVOID acbiBuffer); -#endif HWINSTA NTAPI diff --git a/include/reactos/wine/commctrl.h b/include/reactos/wine/commctrl.h new file mode 100644 index 00000000000..47c3a806d11 --- /dev/null +++ b/include/reactos/wine/commctrl.h @@ -0,0 +1,72 @@ + +#ifndef _INC_COMMCTRL_WINE +#define _INC_COMMCTRL_WINE + +#define DPA_GetPtr DPA_GetPtr_wine_hack +#define FlatSB_SetScrollProp FlatSB_SetScrollProp_wine_hack + +#if (_WIN32_IE < 0x501) +#undef _WIN32_IE +#define _WIN32_IE 0x0501 +#endif + +#include_next + +#undef DPA_GetPtr +LPVOID WINAPI DPA_GetPtr(HDPA, INT); + +#undef FlatSB_SetScrollProp +BOOL WINAPI FlatSB_SetScrollProp(HWND, UINT, INT, BOOL); + +#define DRAGLISTMSGSTRINGA "commctrl_DragListMsg" +#if defined(__GNUC__) +# define DRAGLISTMSGSTRINGW (const WCHAR []){ 'c','o','m','m','c','t','r','l', \ + '_','D','r','a','g','L','i','s','t','M','s','g',0 } +#elif defined(_MSC_VER) +# define DRAGLISTMSGSTRINGW L"commctrl_DragListMsg" +#else +static const WCHAR DRAGLISTMSGSTRINGW[] = { 'c','o','m','m','c','t','r','l', + '_','D','r','a','g','L','i','s','t','M','s','g',0 }; +#endif + +#define FLATSB_CLASSA "flatsb_class32" +#if defined(__GNUC__) +# define FLATSB_CLASSW (const WCHAR []){ 'f','l','a','t','s','b','_', \ + 'c','l','a','s','s','3','2',0 } +#elif defined(_MSC_VER) +# define FLATSB_CLASSW L"flatsb_class32" +#else +static const WCHAR FLATSB_CLASSW[] = { 'f','l','a','t','s','b','_', + 'c','l','a','s','s','3','2',0 }; +#endif + +typedef TBSAVEPARAMSW *LPTBSAVEPARAMSW; + +typedef LVFINDINFOA *LPLVFINDINFOA; +typedef LVFINDINFOW *LPLVFINDINFOW; + +#define SB_SETBORDERS (WM_USER+5) +#define TBSTYLE_EX_UNDOC1 0x00000004 /* similar to TBSTYLE_WRAPABLE */ + +/* these are undocumented and the names are guesses */ +typedef struct +{ + NMHDR hdr; + HWND hwndDialog; +} NMTBINITCUSTOMIZE; + +typedef struct +{ + NMHDR hdr; + INT idNew; + INT iDirection; /* left is -1, right is 1 */ + DWORD dwReason; /* HICF_* */ +} NMTBWRAPHOTITEM; + +#define LPNMLVDISPINFO WINELIB_NAME_AW(LPNMLVDISPINFO) + +/* undocumented messages in Toolbar */ +#define TB_UNKWN45D (WM_USER+93) +#define TB_UNKWN464 (WM_USER+100) + +#endif /* _INC_COMMCTRL_WINE */ diff --git a/lib/cmlib/cminit.c b/lib/cmlib/cminit.c index 59b3843432f..1be9b656a80 100644 --- a/lib/cmlib/cminit.c +++ b/lib/cmlib/cminit.c @@ -21,7 +21,7 @@ CmCreateRootNode( SIZE_T NameSize; /* Allocate the cell */ - NameSize = utf16_wcslen(Name) * sizeof(WCHAR); + NameSize = strlenW(Name) * sizeof(WCHAR); RootCellIndex = HvAllocateCell(Hive, FIELD_OFFSET(CM_KEY_NODE, Name) + NameSize, Stable, diff --git a/lib/cmlib/cmlib.h b/lib/cmlib/cmlib.h index c6823b06a47..e472fd35c4f 100644 --- a/lib/cmlib/cmlib.h +++ b/lib/cmlib/cmlib.h @@ -13,6 +13,7 @@ #define _CMLIB_DEBUG_ 1 #ifdef CMLIB_HOST + #include #include #include #include diff --git a/lib/cmlib/cmlib.rbuild b/lib/cmlib/cmlib.rbuild index 506eef92334..ab81a0256a2 100644 --- a/lib/cmlib/cmlib.rbuild +++ b/lib/cmlib/cmlib.rbuild @@ -14,6 +14,8 @@ hivewrt.c + " " + . diff --git a/lib/drivers/ip/transport/tcp/tcp.c b/lib/drivers/ip/transport/tcp/tcp.c index ae02e4a2d05..187c9a56cc7 100644 --- a/lib/drivers/ip/transport/tcp/tcp.c +++ b/lib/drivers/ip/transport/tcp/tcp.c @@ -735,16 +735,24 @@ NTSTATUS TCPClose Socket = Connection->SocketContext; Connection->SocketContext = NULL; - /* We need to close here otherwise oskit will never indicate - * SEL_FIN and we will never fully close the connection - */ - Status = TCPTranslateError( OskitTCPClose( Socket ) ); - - if (!NT_SUCCESS(Status)) + /* Don't try to close again if the other side closed us already */ + if (Connection->SignalState != SEL_FIN) { - Connection->SocketContext = Socket; - UnlockObject(Connection, OldIrql); - return Status; + /* We need to close here otherwise oskit will never indicate + * SEL_FIN and we will never fully close the connection */ + Status = TCPTranslateError( OskitTCPClose( Socket ) ); + + if (!NT_SUCCESS(Status)) + { + Connection->SocketContext = Socket; + UnlockObject(Connection, OldIrql); + return Status; + } + } + else + { + /* We are already closed by the other end so return success */ + Status = STATUS_SUCCESS; } if (Connection->AddressFile) diff --git a/lib/drivers/oskittcp/oskittcp/osenv.c b/lib/drivers/oskittcp/oskittcp/osenv.c index d29fa5fa239..aa8d246c63f 100644 --- a/lib/drivers/oskittcp/oskittcp/osenv.c +++ b/lib/drivers/oskittcp/oskittcp/osenv.c @@ -41,5 +41,10 @@ void* oskit_bufio_create(int len) } void oskit_bufio_map(void *srcbuf, void**dstbuf, int off, int len) { +#if DBG + if (off != 0) + panic("oskit_bufio_map: offset is non-zero"); +#endif + *dstbuf = srcbuf; } diff --git a/lib/host/wcsfuncs/wcsfuncs.c b/lib/host/wcsfuncs/wcsfuncs.c index fc40b7408c6..58dafe13cd3 100644 --- a/lib/host/wcsfuncs/wcsfuncs.c +++ b/lib/host/wcsfuncs/wcsfuncs.c @@ -18,6 +18,17 @@ SIZE_T utf16_wcslen(PCWSTR str) return i; } + +SIZE_T strlenW(PCWSTR str) +{ + SIZE_T i; + + for(i = 0; str[i]; i++); + + return i; +} + + PWSTR utf16_wcschr(PWSTR str, WCHAR c) { SIZE_T i; @@ -30,6 +41,18 @@ PWSTR utf16_wcschr(PWSTR str, WCHAR c) return NULL; } +PWSTR strchrW(PWSTR str, WCHAR c) +{ + SIZE_T i; + + for(i = 0; str[i] && str[i] != c; i++); + + if(str[i]) + return &str[i]; + else + return NULL; +} + INT utf16_wcsncmp(PCWSTR string1, PCWSTR string2, size_t count) { while(count--) @@ -46,3 +69,20 @@ INT utf16_wcsncmp(PCWSTR string1, PCWSTR string2, size_t count) return 0; } + +INT strncmpW(PCWSTR string1, PCWSTR string2, size_t count) +{ + while(count--) + { + if(*string1 != *string2) + return 1; + + if(*string1 == 0) + return 0; + + string1++; + string2++; + } + + return 0; +} diff --git a/lib/lib.rbuild b/lib/lib.rbuild index 42e49d6ab2f..fe9cf995715 100644 --- a/lib/lib.rbuild +++ b/lib/lib.rbuild @@ -37,6 +37,9 @@ + + + diff --git a/lib/newinflib/README.txt b/lib/newinflib/README.txt new file mode 100644 index 00000000000..5e27e2b0d5e --- /dev/null +++ b/lib/newinflib/README.txt @@ -0,0 +1,16 @@ +Routines to handle .inf files. + +This is the UNICODE-enabled version of inflib. It will be used by usetup and mkhive. + +This library is used to share .inf handling code between build tools and +ReactOS code. Two versions are built, "inflib_host" (for use by build tools) +and "inflib" (for use by ReactOS code). Both depend on the same core source, +with a wrapper for the appropriate interface. +Most of the differences between the host and the ReactOS environment are +abstracted away in builddep.h. Of particular note is that the host version +uses Ansi characters while the ReactOS version uses Unicode. So, the core +source uses TCHARs. builddep.h depends on a preprocessor variable INFLIB_HOST +which is defined when building the host version (inflib.mak) but not defined +when building the ReactOS version (inflib.xml). +The wrappers have "host" or "ros" in their filename. The library interface is +"infhost.h" for the host version, "infros.h" for the ReactOS version. diff --git a/lib/newinflib/builddep.h b/lib/newinflib/builddep.h new file mode 100644 index 00000000000..51b4d4850d7 --- /dev/null +++ b/lib/newinflib/builddep.h @@ -0,0 +1,87 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * COPYRIGHT: Copyright 2005 Ge van Geldorp + */ + +#ifdef INFLIB_HOST + +/* Definitions native to the host on which we're building */ + +#include +#include + +#include +#include +#include +#include + +#define FREE(Area) free(Area) +#define MALLOC(Size) malloc((size_t)(Size)) +#define ZEROMEMORY(Area, Size) memset((Area), '\0', (size_t)(Size)) +#define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (size_t)(Size)) + +#define STATUS_SUCCESS 0 +#define INF_STATUS_SUCCESS 0 +#define INF_STATUS_NO_MEMORY ENOMEM +#define INF_STATUS_INVALID_PARAMETER EINVAL +#define INF_STATUS_NOT_FOUND ENOENT +#define INF_STATUS_BUFFER_OVERFLOW E2BIG +#define INF_SUCCESS(x) (0 == (x)) + +#define STRFMT "%s" + +NTSTATUS NTAPI RtlMultiByteToUnicodeN(IN PWCHAR UnicodeString, + IN ULONG UnicodeSize, IN PULONG ResultSize, IN PCSTR MbString, IN ULONG MbSize); + +BOOLEAN NTAPI RtlIsTextUnicode( PVOID buf, INT len, INT *pf ); + + +#define IS_TEXT_UNICODE_ASCII16 1 +#define IS_TEXT_UNICODE_REVERSE_ASCII16 16 +#define IS_TEXT_UNICODE_STATISTICS 2 +#define IS_TEXT_UNICODE_REVERSE_STATISTICS 32 +#define IS_TEXT_UNICODE_CONTROLS 4 +#define IS_TEXT_UNICODE_REVERSE_CONTROLS 64 +#define IS_TEXT_UNICODE_SIGNATURE 8 +#define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128 +#define IS_TEXT_UNICODE_ILLEGAL_CHARS 256 +#define IS_TEXT_UNICODE_ODD_LENGTH 512 +#define IS_TEXT_UNICODE_NULL_BYTES 4096 +#define IS_TEXT_UNICODE_UNICODE_MASK 15 +#define IS_TEXT_UNICODE_REVERSE_MASK 240 +#define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840 +#define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440 + +#else /* ! defined(INFLIB_HOST) */ + +/* ReactOS definitions */ + +#define UNICODE +#define _UNICODE +#define WIN32_NO_STATUS +#include +#define NTOS_MODE_USER +#include + +extern PVOID InfpHeap; + +#define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area)) +#define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size)) +#define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size)) +#define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size)) + +#define INF_STATUS_SUCCESS STATUS_SUCCESS +#define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY +#define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER +#define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND +#define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW +#define INF_SUCCESS(x) (0 <= (x)) + +#define STRFMT "%S" + +#endif /* INFLIB_HOST */ + +#include + +/* EOF */ diff --git a/lib/newinflib/infcommon.h b/lib/newinflib/infcommon.h new file mode 100644 index 00000000000..a80f2029078 --- /dev/null +++ b/lib/newinflib/infcommon.h @@ -0,0 +1,16 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +#pragma once + +#define MAX_INF_STRING_LENGTH 512 + +typedef void *HINF, **PHINF; +typedef struct _INFCONTEXT *PINFCONTEXT; + +/* EOF */ diff --git a/lib/newinflib/infcore.c b/lib/newinflib/infcore.c new file mode 100644 index 00000000000..7e187359e2a --- /dev/null +++ b/lib/newinflib/infcore.c @@ -0,0 +1,832 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" + +#define NDEBUG +#include + +#define CONTROL_Z '\x1a' +#define MAX_SECTION_NAME_LEN 255 +#define MAX_FIELD_LEN 511 /* larger fields get silently truncated */ +/* actual string limit is MAX_INF_STRING_LENGTH+1 (plus terminating null) under Windows */ +#define MAX_STRING_LEN (MAX_INF_STRING_LENGTH+1) + + +/* parser definitions */ + +enum parser_state +{ + LINE_START, /* at beginning of a line */ + SECTION_NAME, /* parsing a section name */ + KEY_NAME, /* parsing a key name */ + VALUE_NAME, /* parsing a value name */ + EOL_BACKSLASH, /* backslash at end of line */ + QUOTES, /* inside quotes */ + LEADING_SPACES, /* leading spaces */ + TRAILING_SPACES, /* trailing spaces */ + COMMENT, /* inside a comment */ + NB_PARSER_STATES +}; + +struct parser +{ + const WCHAR *start; /* start position of item being parsed */ + const WCHAR *end; /* end of buffer */ + PINFCACHE file; /* file being built */ + enum parser_state state; /* current parser state */ + enum parser_state stack[4]; /* state stack */ + int stack_pos; /* current pos in stack */ + + PINFCACHESECTION cur_section; /* pointer to the section being parsed*/ + PINFCACHELINE line; /* current line */ + unsigned int line_pos; /* current line position in file */ + INFSTATUS error; /* error code */ + unsigned int token_len; /* current token len */ + WCHAR token[MAX_FIELD_LEN+1]; /* current token */ +}; + +typedef const WCHAR * (*parser_state_func)( struct parser *parser, const WCHAR *pos ); + +/* parser state machine functions */ +static const WCHAR *line_start_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *section_name_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *key_name_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *value_name_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *eol_backslash_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *quotes_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *leading_spaces_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *trailing_spaces_state( struct parser *parser, const WCHAR *pos ); +static const WCHAR *comment_state( struct parser *parser, const WCHAR *pos ); + +static const parser_state_func parser_funcs[NB_PARSER_STATES] = +{ + line_start_state, /* LINE_START */ + section_name_state, /* SECTION_NAME */ + key_name_state, /* KEY_NAME */ + value_name_state, /* VALUE_NAME */ + eol_backslash_state, /* EOL_BACKSLASH */ + quotes_state, /* QUOTES */ + leading_spaces_state, /* LEADING_SPACES */ + trailing_spaces_state, /* TRAILING_SPACES */ + comment_state /* COMMENT */ +}; + + +/* PRIVATE FUNCTIONS ********************************************************/ + +static PINFCACHELINE +InfpFreeLine (PINFCACHELINE Line) +{ + PINFCACHELINE Next; + PINFCACHEFIELD Field; + + if (Line == NULL) + { + return NULL; + } + + Next = Line->Next; + if (Line->Key != NULL) + { + FREE (Line->Key); + Line->Key = NULL; + } + + /* Remove data fields */ + while (Line->FirstField != NULL) + { + Field = Line->FirstField->Next; + FREE (Line->FirstField); + Line->FirstField = Field; + } + Line->LastField = NULL; + + FREE (Line); + + return Next; +} + + +PINFCACHESECTION +InfpFreeSection (PINFCACHESECTION Section) +{ + PINFCACHESECTION Next; + + if (Section == NULL) + { + return NULL; + } + + /* Release all keys */ + Next = Section->Next; + while (Section->FirstLine != NULL) + { + Section->FirstLine = InfpFreeLine (Section->FirstLine); + } + Section->LastLine = NULL; + + FREE (Section); + + return Next; +} + + +PINFCACHESECTION +InfpFindSection(PINFCACHE Cache, + PCWSTR Name) +{ + PINFCACHESECTION Section = NULL; + + if (Cache == NULL || Name == NULL) + { + return NULL; + } + + /* iterate through list of sections */ + Section = Cache->FirstSection; + while (Section != NULL) + { + if (strcmpiW(Section->Name, Name) == 0) + { + return Section; + } + + /* get the next section*/ + Section = Section->Next; + } + + return NULL; +} + + +PINFCACHESECTION +InfpAddSection(PINFCACHE Cache, + PCWSTR Name) +{ + PINFCACHESECTION Section = NULL; + ULONG Size; + + if (Cache == NULL || Name == NULL) + { + DPRINT("Invalid parameter\n"); + return NULL; + } + + /* Allocate and initialize the new section */ + Size = (ULONG)FIELD_OFFSET(INFCACHESECTION, + Name[strlenW(Name) + 1]); + Section = (PINFCACHESECTION)MALLOC(Size); + if (Section == NULL) + { + DPRINT("MALLOC() failed\n"); + return NULL; + } + ZEROMEMORY (Section, + Size); + + /* Copy section name */ + strcpyW(Section->Name, Name); + + /* Append section */ + if (Cache->FirstSection == NULL) + { + Cache->FirstSection = Section; + Cache->LastSection = Section; + } + else + { + Cache->LastSection->Next = Section; + Section->Prev = Cache->LastSection; + Cache->LastSection = Section; + } + + return Section; +} + + +PINFCACHELINE +InfpAddLine(PINFCACHESECTION Section) +{ + PINFCACHELINE Line; + + if (Section == NULL) + { + DPRINT("Invalid parameter\n"); + return NULL; + } + + Line = (PINFCACHELINE)MALLOC(sizeof(INFCACHELINE)); + if (Line == NULL) + { + DPRINT("MALLOC() failed\n"); + return NULL; + } + ZEROMEMORY(Line, + sizeof(INFCACHELINE)); + + /* Append line */ + if (Section->FirstLine == NULL) + { + Section->FirstLine = Line; + Section->LastLine = Line; + } + else + { + Section->LastLine->Next = Line; + Line->Prev = Section->LastLine; + Section->LastLine = Line; + } + Section->LineCount++; + + return Line; +} + + +PVOID +InfpAddKeyToLine(PINFCACHELINE Line, + PCWSTR Key) +{ + if (Line == NULL) + { + DPRINT1("Invalid Line\n"); + return NULL; + } + + if (Line->Key != NULL) + { + DPRINT1("Line already has a key\n"); + return NULL; + } + + Line->Key = (PWCHAR)MALLOC((strlenW(Key) + 1) * sizeof(WCHAR)); + if (Line->Key == NULL) + { + DPRINT1("MALLOC() failed\n"); + return NULL; + } + + strcpyW(Line->Key, Key); + + return (PVOID)Line->Key; +} + + +PVOID +InfpAddFieldToLine(PINFCACHELINE Line, + PCWSTR Data) +{ + PINFCACHEFIELD Field; + ULONG Size; + + Size = (ULONG)FIELD_OFFSET(INFCACHEFIELD, + Data[strlenW(Data) + 1]); + Field = (PINFCACHEFIELD)MALLOC(Size); + if (Field == NULL) + { + DPRINT1("MALLOC() failed\n"); + return NULL; + } + ZEROMEMORY (Field, + Size); + strcpyW(Field->Data, Data); + + /* Append key */ + if (Line->FirstField == NULL) + { + Line->FirstField = Field; + Line->LastField = Field; + } + else + { + Line->LastField->Next = Field; + Field->Prev = Line->LastField; + Line->LastField = Field; + } + Line->FieldCount++; + + return (PVOID)Field; +} + + +PINFCACHELINE +InfpFindKeyLine(PINFCACHESECTION Section, + PCWSTR Key) +{ + PINFCACHELINE Line; + + Line = Section->FirstLine; + while (Line != NULL) + { + if (Line->Key != NULL && strcmpiW(Line->Key, Key) == 0) + { + return Line; + } + + Line = Line->Next; + } + + return NULL; +} + + +/* push the current state on the parser stack */ +__inline static void push_state( struct parser *parser, enum parser_state state ) +{ +// assert( parser->stack_pos < sizeof(parser->stack)/sizeof(parser->stack[0]) ); + parser->stack[parser->stack_pos++] = state; +} + + +/* pop the current state */ +__inline static void pop_state( struct parser *parser ) +{ +// assert( parser->stack_pos ); + parser->state = parser->stack[--parser->stack_pos]; +} + + +/* set the parser state and return the previous one */ +__inline static enum parser_state set_state( struct parser *parser, enum parser_state state ) +{ + enum parser_state ret = parser->state; + parser->state = state; + return ret; +} + + +/* check if the pointer points to an end of file */ +__inline static int is_eof( struct parser *parser, const WCHAR *ptr ) +{ + return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == 0); +} + + +/* check if the pointer points to an end of line */ +__inline static int is_eol( struct parser *parser, const WCHAR *ptr ) +{ + return (ptr >= parser->end || + *ptr == CONTROL_Z || + *ptr == '\n' || + (*ptr == '\r' && *(ptr + 1) == '\n') || + *ptr == 0); +} + + +/* push data from current token start up to pos into the current token */ +static int push_token( struct parser *parser, const WCHAR *pos ) +{ + UINT len = (UINT)(pos - parser->start); + const WCHAR *src = parser->start; + WCHAR *dst = parser->token + parser->token_len; + + if (len > MAX_FIELD_LEN - parser->token_len) + len = MAX_FIELD_LEN - parser->token_len; + + parser->token_len += len; + for ( ; len > 0; len--, dst++, src++) + { + if (*src) + { + *dst = *src; + } + else + { + *dst = ' '; + } + } + + *dst = 0; + parser->start = pos; + + return 0; +} + + + +/* add a section with the current token as name */ +static PVOID add_section_from_token( struct parser *parser ) +{ + PINFCACHESECTION Section; + + if (parser->token_len > MAX_SECTION_NAME_LEN) + { + parser->error = INF_STATUS_SECTION_NAME_TOO_LONG; + return NULL; + } + + Section = InfpFindSection(parser->file, + parser->token); + if (Section == NULL) + { + /* need to create a new one */ + Section= InfpAddSection(parser->file, + parser->token); + if (Section == NULL) + { + parser->error = INF_STATUS_NOT_ENOUGH_MEMORY; + return NULL; + } + } + + parser->token_len = 0; + parser->cur_section = Section; + + return (PVOID)Section; +} + + +/* add a field containing the current token to the current line */ +static struct field *add_field_from_token( struct parser *parser, int is_key ) +{ + PVOID field; + + if (!parser->line) /* need to start a new line */ + { + if (parser->cur_section == NULL) /* got a line before the first section */ + { + parser->error = INF_STATUS_WRONG_INF_STYLE; + return NULL; + } + + parser->line = InfpAddLine(parser->cur_section); + if (parser->line == NULL) + goto error; + } + else + { +// assert(!is_key); + } + + if (is_key) + { + field = InfpAddKeyToLine(parser->line, parser->token); + } + else + { + field = InfpAddFieldToLine(parser->line, parser->token); + } + + if (field != NULL) + { + parser->token_len = 0; + return field; + } + +error: + parser->error = INF_STATUS_NOT_ENOUGH_MEMORY; + return NULL; +} + + +/* close the current line and prepare for parsing a new one */ +static void close_current_line( struct parser *parser ) +{ + parser->line = NULL; +} + + + +/* handler for parser LINE_START state */ +static const WCHAR *line_start_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p; + + for (p = pos; !is_eof( parser, p ); p++) + { + switch(*p) + { + case '\r': + continue; + + case '\n': + parser->line_pos++; + close_current_line( parser ); + break; + + case ';': + push_state( parser, LINE_START ); + set_state( parser, COMMENT ); + return p + 1; + + case '[': + parser->start = p + 1; + set_state( parser, SECTION_NAME ); + return p + 1; + + default: + if (!isspaceW(*p)) + { + parser->start = p; + set_state( parser, KEY_NAME ); + return p; + } + break; + } + } + close_current_line( parser ); + return NULL; +} + + +/* handler for parser SECTION_NAME state */ +static const WCHAR *section_name_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p; + + for (p = pos; !is_eol( parser, p ); p++) + { + if (*p == ']') + { + push_token( parser, p ); + if (add_section_from_token( parser ) == NULL) + return NULL; + push_state( parser, LINE_START ); + set_state( parser, COMMENT ); /* ignore everything else on the line */ + return p + 1; + } + } + parser->error = INF_STATUS_BAD_SECTION_NAME_LINE; /* unfinished section name */ + return NULL; +} + + +/* handler for parser KEY_NAME state */ +static const WCHAR *key_name_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p, *token_end = parser->start; + + for (p = pos; !is_eol( parser, p ); p++) + { + if (*p == ',') break; + switch(*p) + { + + case '=': + push_token( parser, token_end ); + if (!add_field_from_token( parser, 1 )) return NULL; + parser->start = p + 1; + push_state( parser, VALUE_NAME ); + set_state( parser, LEADING_SPACES ); + return p + 1; + case ';': + push_token( parser, token_end ); + if (!add_field_from_token( parser, 0 )) return NULL; + push_state( parser, LINE_START ); + set_state( parser, COMMENT ); + return p + 1; + case '"': + push_token( parser, token_end ); + parser->start = p + 1; + push_state( parser, KEY_NAME ); + set_state( parser, QUOTES ); + return p + 1; + case '\\': + push_token( parser, token_end ); + parser->start = p; + push_state( parser, KEY_NAME ); + set_state( parser, EOL_BACKSLASH ); + return p; + default: + if (!isspaceW(*p)) token_end = p + 1; + else + { + push_token( parser, p ); + push_state( parser, KEY_NAME ); + set_state( parser, TRAILING_SPACES ); + return p; + } + break; + } + } + push_token( parser, token_end ); + set_state( parser, VALUE_NAME ); + return p; +} + + +/* handler for parser VALUE_NAME state */ +static const WCHAR *value_name_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p, *token_end = parser->start; + + for (p = pos; !is_eol( parser, p ); p++) + { + switch(*p) + { + case ';': + push_token( parser, token_end ); + if (!add_field_from_token( parser, 0 )) return NULL; + push_state( parser, LINE_START ); + set_state( parser, COMMENT ); + return p + 1; + case ',': + push_token( parser, token_end ); + if (!add_field_from_token( parser, 0 )) return NULL; + parser->start = p + 1; + push_state( parser, VALUE_NAME ); + set_state( parser, LEADING_SPACES ); + return p + 1; + case '"': + push_token( parser, token_end ); + parser->start = p + 1; + push_state( parser, VALUE_NAME ); + set_state( parser, QUOTES ); + return p + 1; + case '\\': + push_token( parser, token_end ); + parser->start = p; + push_state( parser, VALUE_NAME ); + set_state( parser, EOL_BACKSLASH ); + return p; + default: + if (!isspaceW(*p)) token_end = p + 1; + else + { + push_token( parser, p ); + push_state( parser, VALUE_NAME ); + set_state( parser, TRAILING_SPACES ); + return p; + } + break; + } + } + push_token( parser, token_end ); + if (!add_field_from_token( parser, 0 )) return NULL; + set_state( parser, LINE_START ); + return p; +} + + +/* handler for parser EOL_BACKSLASH state */ +static const WCHAR *eol_backslash_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p; + + for (p = pos; !is_eof( parser, p ); p++) + { + switch(*p) + { + case '\r': + continue; + + case '\n': + parser->line_pos++; + parser->start = p + 1; + set_state( parser, LEADING_SPACES ); + return p + 1; + + case '\\': + continue; + + case ';': + push_state( parser, EOL_BACKSLASH ); + set_state( parser, COMMENT ); + return p + 1; + + default: + if (isspaceW(*p)) + continue; + push_token( parser, p ); + pop_state( parser ); + return p; + } + } + parser->start = p; + pop_state( parser ); + + return p; +} + + +/* handler for parser QUOTES state */ +static const WCHAR *quotes_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p, *token_end = parser->start; + + for (p = pos; !is_eol( parser, p ); p++) + { + if (*p == '"') + { + if (p+1 < parser->end && p[1] == '"') /* double quotes */ + { + push_token( parser, p + 1 ); + parser->start = token_end = p + 2; + p++; + } + else /* end of quotes */ + { + push_token( parser, p ); + parser->start = p + 1; + pop_state( parser ); + return p + 1; + } + } + } + push_token( parser, p ); + pop_state( parser ); + return p; +} + + +/* handler for parser LEADING_SPACES state */ +static const WCHAR *leading_spaces_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p; + + for (p = pos; !is_eol( parser, p ); p++) + { + if (*p == '\\') + { + parser->start = p; + set_state( parser, EOL_BACKSLASH ); + return p; + } + if (!isspaceW(*p)) + break; + } + parser->start = p; + pop_state( parser ); + return p; +} + + +/* handler for parser TRAILING_SPACES state */ +static const WCHAR *trailing_spaces_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p; + + for (p = pos; !is_eol( parser, p ); p++) + { + if (*p == '\\') + { + set_state( parser, EOL_BACKSLASH ); + return p; + } + if (!isspaceW(*p)) + break; + } + pop_state( parser ); + return p; +} + + +/* handler for parser COMMENT state */ +static const WCHAR *comment_state( struct parser *parser, const WCHAR *pos ) +{ + const WCHAR *p = pos; + + while (!is_eol( parser, p )) + p++; + pop_state( parser ); + return p; +} + + +/* parse a complete buffer */ +INFSTATUS +InfpParseBuffer (PINFCACHE file, + const WCHAR *buffer, + const WCHAR *end, + PULONG error_line) +{ + struct parser parser; + const WCHAR *pos = buffer; + + parser.start = buffer; + parser.end = end; + parser.file = file; + parser.line = NULL; + parser.state = LINE_START; + parser.stack_pos = 0; + parser.cur_section = NULL; + parser.line_pos = 1; + parser.error = 0; + parser.token_len = 0; + + /* parser main loop */ + while (pos) + pos = (parser_funcs[parser.state])(&parser, pos); + + if (parser.error) + { + if (error_line) + *error_line = parser.line_pos; + return parser.error; + } + + /* find the [strings] section */ + file->StringsSection = InfpFindSection(file, + L"Strings"); + + return INF_STATUS_SUCCESS; +} + +/* EOF */ diff --git a/lib/newinflib/infget.c b/lib/newinflib/infget.c new file mode 100644 index 00000000000..e2b360ab22d --- /dev/null +++ b/lib/newinflib/infget.c @@ -0,0 +1,668 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" + +#define NDEBUG +#include + +static unsigned int +InfpSubstituteString(PINFCACHE Inf, + const WCHAR *text, + WCHAR *buffer, + unsigned int size); + +/* retrieve the string substitution for a given string, or NULL if not found */ +/* if found, len is set to the substitution length */ +static PCWSTR +InfpGetSubstitutionString(PINFCACHE Inf, + PCWSTR str, + unsigned int *len, + BOOL no_trailing_slash) +{ + static const WCHAR percent = '%'; + + INFSTATUS Status = INF_STATUS_NOT_FOUND; + PINFCONTEXT Context = NULL; + PWCHAR Data = NULL; + WCHAR ValueName[MAX_INF_STRING_LENGTH +1]; + WCHAR StringLangId[13]; + + if (!*len) /* empty string (%%) is replaced by single percent */ + { + *len = 1; + return &percent; + } + + memcpy(ValueName, str, *len * sizeof(WCHAR)); + ValueName[*len] = 0; + + DPRINT("Value name: %S\n", ValueName); + + if (Inf->LanguageId != 0) + { + swprintf(StringLangId, + L"Strings.%04hx", + Inf->LanguageId); + + Status = InfpFindFirstLine(Inf, + StringLangId, + ValueName, + &Context); + if (Status != INF_STATUS_SUCCESS) + { + swprintf(StringLangId, + L"Strings.%04hx", + MAKELANGID(PRIMARYLANGID(Inf->LanguageId), SUBLANG_NEUTRAL)); + + Status = InfpFindFirstLine(Inf, + StringLangId, + ValueName, + &Context); + if (Status != INF_STATUS_SUCCESS) + { + Status = InfpFindFirstLine(Inf, + L"Strings", + ValueName, + &Context); + } + } + } + else + { + Status = InfpFindFirstLine(Inf, + L"Strings", + ValueName, + &Context); + } + + if (Status != INF_STATUS_SUCCESS || Context == NULL) + return NULL; + + Status = InfpGetData(Context, + NULL, + &Data); + + InfpFreeContext(Context); + + if (Status == STATUS_SUCCESS) + { + *len = strlenW(Data); + DPRINT("Substitute: %S Length: %ul\n", Data, *len); + return Data; + } + + return NULL; +} + + +/* do string substitutions on the specified text */ +/* the buffer is assumed to be large enough */ +/* returns necessary length not including terminating null */ +static unsigned int +InfpSubstituteString(PINFCACHE Inf, + PCWSTR text, + PWSTR buffer, + unsigned int size) +{ + const WCHAR *start, *subst, *p; + unsigned int len, total = 0; + int inside = 0; + + if (!buffer) size = MAX_INF_STRING_LENGTH + 1; + for (p = start = text; *p; p++) + { + if (*p != '%') continue; + inside = !inside; + if (inside) /* start of a %xx% string */ + { + len = (unsigned int)(p - start); + if (len > size - 1) len = size - 1; + if (buffer) memcpy( buffer + total, start, len * sizeof(WCHAR) ); + total += len; + size -= len; + start = p; + } + else /* end of the %xx% string, find substitution */ + { + len = (unsigned int)(p - start - 1); + subst = InfpGetSubstitutionString( Inf, start + 1, &len, p[1] == '\\' ); + if (!subst) + { + subst = start; + len = (unsigned int)(p - start + 1); + } + if (len > size - 1) len = size - 1; + if (buffer) memcpy( buffer + total, subst, len * sizeof(WCHAR) ); + total += len; + size -= len; + start = p + 1; + } + } + + if (start != p) /* unfinished string, copy it */ + { + len = (unsigned int)(p - start); + if (len > size - 1) len = size - 1; + if (buffer) memcpy( buffer + total, start, len * sizeof(WCHAR) ); + total += len; + } + if (buffer && size) buffer[total] = 0; + return total; +} + + +INFSTATUS +InfpFindFirstLine(PINFCACHE Cache, + PCWSTR Section, + PCWSTR Key, + PINFCONTEXT *Context) +{ + PINFCACHESECTION CacheSection; + PINFCACHELINE CacheLine; + + if (Cache == NULL || Section == NULL || Context == NULL) + { + DPRINT1("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + CacheSection = InfpFindSection(Cache, Section); + if (NULL == CacheSection) + { + DPRINT("Section not found\n"); + return INF_STATUS_NOT_FOUND; + } + + if (Key != NULL) + { + CacheLine = InfpFindKeyLine(CacheSection, Key); + } + else + { + CacheLine = CacheSection->FirstLine; + } + + if (NULL == CacheLine) + { + DPRINT("Key not found\n"); + return INF_STATUS_NOT_FOUND; + } + + *Context = MALLOC(sizeof(INFCONTEXT)); + if (NULL == *Context) + { + DPRINT1("MALLOC() failed\n"); + return INF_STATUS_NO_MEMORY; + } + (*Context)->Inf = (PVOID)Cache; + (*Context)->Section = (PVOID)CacheSection; + (*Context)->Line = (PVOID)CacheLine; + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut) +{ + PINFCACHELINE CacheLine; + + if (ContextIn == NULL || ContextOut == NULL) + return INF_STATUS_INVALID_PARAMETER; + + if (ContextIn->Line == NULL) + return INF_STATUS_INVALID_PARAMETER; + + CacheLine = (PINFCACHELINE)ContextIn->Line; + if (CacheLine->Next == NULL) + return INF_STATUS_NOT_FOUND; + + if (ContextIn != ContextOut) + { + ContextOut->Inf = ContextIn->Inf; + ContextOut->Section = ContextIn->Section; + } + ContextOut->Line = (PVOID)(CacheLine->Next); + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpFindFirstMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut) +{ + PINFCACHELINE CacheLine; + + if (ContextIn == NULL || ContextOut == NULL || Key == NULL || *Key == 0) + return INF_STATUS_INVALID_PARAMETER; + + if (ContextIn->Inf == NULL || ContextIn->Section == NULL) + return INF_STATUS_INVALID_PARAMETER; + + CacheLine = ((PINFCACHESECTION)(ContextIn->Section))->FirstLine; + while (CacheLine != NULL) + { + if (CacheLine->Key != NULL && strcmpiW (CacheLine->Key, Key) == 0) + { + + if (ContextIn != ContextOut) + { + ContextOut->Inf = ContextIn->Inf; + ContextOut->Section = ContextIn->Section; + } + ContextOut->Line = (PVOID)CacheLine; + + return INF_STATUS_SUCCESS; + } + + CacheLine = CacheLine->Next; + } + + return INF_STATUS_NOT_FOUND; +} + + +INFSTATUS +InfpFindNextMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut) +{ + PINFCACHELINE CacheLine; + + if (ContextIn == NULL || ContextOut == NULL || Key == NULL || *Key == 0) + return INF_STATUS_INVALID_PARAMETER; + + if (ContextIn->Inf == NULL || ContextIn->Section == NULL || ContextIn->Line == NULL) + return INF_STATUS_INVALID_PARAMETER; + + CacheLine = (PINFCACHELINE)ContextIn->Line; + while (CacheLine != NULL) + { + if (CacheLine->Key != NULL && strcmpiW (CacheLine->Key, Key) == 0) + { + + if (ContextIn != ContextOut) + { + ContextOut->Inf = ContextIn->Inf; + ContextOut->Section = ContextIn->Section; + } + ContextOut->Line = (PVOID)CacheLine; + + return INF_STATUS_SUCCESS; + } + + CacheLine = CacheLine->Next; + } + + return INF_STATUS_NOT_FOUND; +} + + +LONG +InfpGetLineCount(HINF InfHandle, + PCWSTR Section) +{ + PINFCACHE Cache; + PINFCACHESECTION CacheSection; + + if (InfHandle == NULL || Section == NULL) + { + DPRINT("Invalid parameter\n"); + return -1; + } + + Cache = (PINFCACHE)InfHandle; + + /* Iterate through list of sections */ + CacheSection = Cache->FirstSection; + while (CacheSection != NULL) + { + /* Are the section names the same? */ + if (strcmpiW(CacheSection->Name, Section) == 0) + { + return CacheSection->LineCount; + } + + /* Get the next section */ + CacheSection = CacheSection->Next; + } + + DPRINT("Section not found\n"); + + return -1; +} + + +/* InfpGetLineText */ + + +LONG +InfpGetFieldCount(PINFCONTEXT Context) +{ + if (Context == NULL || Context->Line == NULL) + return 0; + + return ((PINFCACHELINE)Context->Line)->FieldCount; +} + + +INFSTATUS +InfpGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + PUCHAR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + ULONG Index; + ULONG Size; + PUCHAR Ptr; + + if (Context == NULL || Context->Line == NULL || FieldIndex == 0) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + if (RequiredSize != NULL) + *RequiredSize = 0; + + CacheLine = (PINFCACHELINE)Context->Line; + + if (FieldIndex > (ULONG)CacheLine->FieldCount) + return INF_STATUS_NOT_FOUND; + + CacheField = CacheLine->FirstField; + for (Index = 1; Index < FieldIndex; Index++) + CacheField = CacheField->Next; + + Size = (ULONG)CacheLine->FieldCount - FieldIndex + 1; + + if (RequiredSize != NULL) + *RequiredSize = Size; + + if (ReturnBuffer != NULL) + { + if (ReturnBufferSize < Size) + return INF_STATUS_BUFFER_OVERFLOW; + + /* Copy binary data */ + Ptr = ReturnBuffer; + while (CacheField != NULL) + { + *Ptr = (UCHAR)strtoulW(CacheField->Data, NULL, 16); + + Ptr++; + CacheField = CacheField->Next; + } + } + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + PLONG IntegerValue) +{ + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + ULONG Index; + PWCHAR Ptr; + + if (Context == NULL || Context->Line == NULL || IntegerValue == NULL) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + CacheLine = (PINFCACHELINE)Context->Line; + + if (FieldIndex > (ULONG)CacheLine->FieldCount) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + if (FieldIndex == 0) + { + Ptr = CacheLine->Key; + } + else + { + CacheField = CacheLine->FirstField; + for (Index = 1; Index < FieldIndex; Index++) + CacheField = CacheField->Next; + + Ptr = CacheField->Data; + } + + *IntegerValue = (LONG)strtolW(Ptr, NULL, 0); + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + PINFCACHEFIELD FieldPtr; + ULONG Index; + ULONG Size; + PWCHAR Ptr; + + if (Context == NULL || Context->Line == NULL || FieldIndex == 0) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + if (RequiredSize != NULL) + *RequiredSize = 0; + + CacheLine = (PINFCACHELINE)Context->Line; + + if (FieldIndex > (ULONG)CacheLine->FieldCount) + return INF_STATUS_INVALID_PARAMETER; + + CacheField = CacheLine->FirstField; + for (Index = 1; Index < FieldIndex; Index++) + CacheField = CacheField->Next; + + /* Calculate the required buffer size */ + FieldPtr = CacheField; + Size = 0; + while (FieldPtr != NULL) + { + Size += ((ULONG)strlenW(FieldPtr->Data) + 1); + FieldPtr = FieldPtr->Next; + } + Size++; + + if (RequiredSize != NULL) + *RequiredSize = Size; + + if (ReturnBuffer != NULL) + { + if (ReturnBufferSize < Size) + return INF_STATUS_BUFFER_OVERFLOW; + + /* Copy multi-sz string */ + Ptr = ReturnBuffer; + FieldPtr = CacheField; + while (FieldPtr != NULL) + { + Size = (ULONG)strlenW(FieldPtr->Data) + 1; + + strcpyW(Ptr, FieldPtr->Data); + + Ptr = Ptr + Size; + FieldPtr = FieldPtr->Next; + } + *Ptr = 0; + } + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + ULONG Index; + PWCHAR Ptr; + ULONG Size; + + if (Context == NULL || Context->Line == NULL || FieldIndex == 0) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + if (RequiredSize != NULL) + *RequiredSize = 0; + + CacheLine = (PINFCACHELINE)Context->Line; + + if (FieldIndex > (ULONG)CacheLine->FieldCount) + return INF_STATUS_INVALID_PARAMETER; + + if (FieldIndex == 0) + { + Ptr = CacheLine->Key; + } + else + { + CacheField = CacheLine->FirstField; + for (Index = 1; Index < FieldIndex; Index++) + CacheField = CacheField->Next; + + Ptr = CacheField->Data; + } + +// Size = (ULONG)strlenW(Ptr) + 1; + Size = InfpSubstituteString(Context->Inf, + Ptr, + NULL, + 0); + + if (RequiredSize != NULL) + *RequiredSize = Size + 1; + + if (ReturnBuffer != NULL) + { + if (ReturnBufferSize <= Size) + return INF_STATUS_BUFFER_OVERFLOW; + +// strcpyW(ReturnBuffer, Ptr); + InfpSubstituteString(Context->Inf, + Ptr, + ReturnBuffer, + ReturnBufferSize); + } + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpGetData(PINFCONTEXT Context, + PWCHAR *Key, + PWCHAR *Data) +{ + PINFCACHELINE CacheKey; + + if (Context == NULL || Context->Line == NULL || Data == NULL) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + CacheKey = (PINFCACHELINE)Context->Line; + if (Key != NULL) + *Key = CacheKey->Key; + + if (Data != NULL) + { + if (CacheKey->FirstField == NULL) + { + *Data = NULL; + } + else + { + *Data = CacheKey->FirstField->Data; + } + } + + return INF_STATUS_SUCCESS; +} + + +INFSTATUS +InfpGetDataField(PINFCONTEXT Context, + ULONG FieldIndex, + PWCHAR *Data) +{ + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + ULONG Index; + + if (Context == NULL || Context->Line == NULL || Data == NULL) + { + DPRINT("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + CacheLine = (PINFCACHELINE)Context->Line; + + if (FieldIndex > (ULONG)CacheLine->FieldCount) + return INF_STATUS_INVALID_PARAMETER; + + if (FieldIndex == 0) + { + *Data = CacheLine->Key; + } + else + { + CacheField = CacheLine->FirstField; + for (Index = 1; Index < FieldIndex; Index++) + CacheField = CacheField->Next; + + *Data = CacheField->Data; + } + + return INF_STATUS_SUCCESS; +} + +VOID +InfpFreeContext(PINFCONTEXT Context) +{ + FREE(Context); +} + +/* EOF */ diff --git a/lib/newinflib/infhost.h b/lib/newinflib/infhost.h new file mode 100644 index 00000000000..b1dfaaf8a86 --- /dev/null +++ b/lib/newinflib/infhost.h @@ -0,0 +1,80 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include "infcommon.h" + +extern int InfHostOpenBufferedFile(PHINF InfHandle, + void *Buffer, + ULONG BufferSize, + LANGID LanguageId, + ULONG *ErrorLine); +extern int InfHostOpenFile(PHINF InfHandle, + const CHAR *FileName, + LANGID LanguageId, + ULONG *ErrorLine); +extern int InfHostWriteFile(HINF InfHandle, + const CHAR *FileName, + const CHAR *HeaderComment); +extern void InfHostCloseFile(HINF InfHandle); +extern int InfHostFindFirstLine(HINF InfHandle, + const WCHAR *Section, + const WCHAR *Key, + PINFCONTEXT *Context); +extern int InfHostFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut); +extern int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, + const WCHAR *Key, + PINFCONTEXT ContextOut); +extern int InfHostFindNextMatchLine(PINFCONTEXT ContextIn, + const WCHAR *Key, + PINFCONTEXT ContextOut); +extern LONG InfHostGetLineCount(HINF InfHandle, + const WCHAR *Section); +extern LONG InfHostGetFieldCount(PINFCONTEXT Context); +extern int InfHostGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + UCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize); +extern int InfHostGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + ULONG *IntegerValue); +extern int InfHostGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize); +extern int InfHostGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize); +extern int InfHostGetData(PINFCONTEXT Context, + WCHAR **Key, + WCHAR **Data); +extern int InfHostGetDataField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR **Data); +extern int InfHostFindOrAddSection(HINF InfHandle, + const WCHAR *Section, + PINFCONTEXT *Context); +extern int InfHostAddLine(PINFCONTEXT Context, const WCHAR *Key); +extern int InfHostAddField(PINFCONTEXT Context, const WCHAR *Data); +extern void InfHostFreeContext(PINFCONTEXT Context); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* EOF */ diff --git a/lib/newinflib/infhostgen.c b/lib/newinflib/infhostgen.c new file mode 100644 index 00000000000..3e3d915a04f --- /dev/null +++ b/lib/newinflib/infhostgen.c @@ -0,0 +1,303 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infhost.h" + +#define NDEBUG +#include + +/* PUBLIC FUNCTIONS *********************************************************/ + +int +InfHostOpenBufferedFile(PHINF InfHandle, + void *Buffer, + ULONG BufferSize, + LANGID LanguageId, + ULONG *ErrorLine) +{ + INFSTATUS Status; + PINFCACHE Cache; + WCHAR *FileBuffer; + ULONG FileBufferSize; + + *InfHandle = NULL; + *ErrorLine = (ULONG)-1; + + /* Allocate file buffer */ + FileBufferSize = BufferSize + 2; + FileBuffer = MALLOC(FileBufferSize); + if (FileBuffer == NULL) + { + DPRINT1("MALLOC() failed\n"); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + MEMCPY(FileBuffer, Buffer, BufferSize); + + /* Append string terminator */ + FileBuffer[BufferSize] = 0; + FileBuffer[BufferSize + 1] = 0; + + /* Allocate infcache header */ + Cache = (PINFCACHE)MALLOC(sizeof(INFCACHE)); + if (Cache == NULL) + { + DPRINT1("MALLOC() failed\n"); + FREE(FileBuffer); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + /* Initialize inicache header */ + ZEROMEMORY(Cache, + sizeof(INFCACHE)); + + Cache->LanguageId = LanguageId; + + /* Parse the inf buffer */ + if (!RtlIsTextUnicode(FileBuffer, (INT)FileBufferSize, NULL)) + { +// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf }; + WCHAR *new_buff; +// UINT codepage = CP_ACP; + UINT offset = 0; + +// if (BufferSize > sizeof(utf8_bom) && !memcmp(FileBuffer, utf8_bom, sizeof(utf8_bom) )) +// { +// codepage = CP_UTF8; +// offset = sizeof(utf8_bom); +// } + + new_buff = MALLOC(FileBufferSize * sizeof(WCHAR)); + if (new_buff != NULL) + { + ULONG len; + Status = RtlMultiByteToUnicodeN(new_buff, + FileBufferSize * sizeof(WCHAR), + &len, + (char *)FileBuffer + offset, + FileBufferSize - offset); + + Status = InfpParseBuffer(Cache, + new_buff, + new_buff + len / sizeof(WCHAR), + ErrorLine); + FREE(new_buff); + } + else + Status = INF_STATUS_INSUFFICIENT_RESOURCES; + } + else + { + WCHAR *new_buff = (WCHAR *)FileBuffer; + /* UCS-16 files should start with the Unicode BOM; we should skip it */ + if (*new_buff == 0xfeff) + { + new_buff++; + FileBufferSize -= sizeof(WCHAR); + } + Status = InfpParseBuffer(Cache, + new_buff, + (WCHAR*)((char*)new_buff + FileBufferSize), + ErrorLine); + } + + if (!INF_SUCCESS(Status)) + { + FREE(Cache); + Cache = NULL; + } + + /* Free file buffer */ + FREE(FileBuffer); + + *InfHandle = (HINF)Cache; + + return INF_SUCCESS(Status) ? 0 : -1; +} + + +int +InfHostOpenFile(PHINF InfHandle, + const CHAR *FileName, + LANGID LanguageId, + ULONG *ErrorLine) +{ + FILE *File; + CHAR *FileBuffer; + ULONG FileLength; + ULONG FileBufferLength; + PINFCACHE Cache; + INFSTATUS Status = INF_STATUS_SUCCESS; + + *InfHandle = NULL; + *ErrorLine = (ULONG)-1; + + /* Open the inf file */ + File = fopen(FileName, "rb"); + if (NULL == File) + { + DPRINT1("fopen() failed (errno %d)\n", errno); + return -1; + } + + DPRINT("fopen() successful\n"); + + /* Query file size */ + if (fseek(File, (size_t)0, SEEK_END)) + { + DPRINT1("fseek() to EOF failed (errno %d)\n", errno); + fclose(File); + return -1; + } + + FileLength = (ULONG)ftell(File); + if ((ULONG) -1 == FileLength) + { + DPRINT1("ftell() failed (errno %d)\n", errno); + fclose(File); + return -1; + } + DPRINT("File size: %u\n", (UINT)FileLength); + + /* Rewind */ + if (fseek(File, (size_t)0, SEEK_SET)) + { + DPRINT1("fseek() to BOF failed (errno %d)\n", errno); + fclose(File); + return -1; + } + + /* Allocate file buffer */ + FileBufferLength = FileLength + 2; + FileBuffer = MALLOC(FileBufferLength); + if (FileBuffer == NULL) + { + DPRINT1("MALLOC() failed\n"); + fclose(File); + return -1; + } + + /* Read file */ + if (FileLength != fread(FileBuffer, (size_t)1, (size_t)FileLength, File)) + { + DPRINT1("fread() failed (errno %d)\n", errno); + FREE(FileBuffer); + fclose(File); + return -1; + } + + fclose(File); + + /* Append string terminator */ + FileBuffer[FileLength] = 0; + FileBuffer[FileLength + 1] = 0; + + /* Allocate infcache header */ + Cache = (PINFCACHE)MALLOC(sizeof(INFCACHE)); + if (Cache == NULL) + { + DPRINT1("MALLOC() failed\n"); + FREE(FileBuffer); + return -1; + } + + /* Initialize inicache header */ + ZEROMEMORY(Cache, + sizeof(INFCACHE)); + + Cache->LanguageId = LanguageId; + + /* Parse the inf buffer */ + if (!RtlIsTextUnicode(FileBuffer, (INT)FileBufferLength, NULL)) + { +// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf }; + WCHAR *new_buff; +// UINT codepage = CP_ACP; + UINT offset = 0; + +// if (FileLength > sizeof(utf8_bom) && !memcmp(FileBuffer, utf8_bom, sizeof(utf8_bom) )) +// { +// codepage = CP_UTF8; +// offset = sizeof(utf8_bom); +// } + + new_buff = MALLOC(FileBufferLength * sizeof(WCHAR)); + if (new_buff != NULL) + { + ULONG len; + Status = RtlMultiByteToUnicodeN(new_buff, + FileBufferLength * sizeof(WCHAR), + &len, + (char *)FileBuffer + offset, + FileBufferLength - offset); + + Status = InfpParseBuffer(Cache, + new_buff, + new_buff + len / sizeof(WCHAR), + ErrorLine); + + FREE(new_buff); + } + else + Status = INF_STATUS_INSUFFICIENT_RESOURCES; + } + else + { + WCHAR *new_buff = (WCHAR *)FileBuffer; + /* UCS-16 files should start with the Unicode BOM; we should skip it */ + if (*new_buff == 0xfeff) + { + new_buff++; + FileBufferLength -= sizeof(WCHAR); + } + Status = InfpParseBuffer(Cache, + new_buff, + (WCHAR*)((char*)new_buff + FileBufferLength), + ErrorLine); + } + + if (!INF_SUCCESS(Status)) + { + FREE(Cache); + Cache = NULL; + } + + /* Free file buffer */ + FREE(FileBuffer); + + *InfHandle = (HINF)Cache; + + return INF_SUCCESS(Status) ? 0 : -1; +} + + +void +InfHostCloseFile(HINF InfHandle) +{ + PINFCACHE Cache; + + Cache = (PINFCACHE)InfHandle; + + if (Cache == NULL) + { + return; + } + + while (Cache->FirstSection != NULL) + { + Cache->FirstSection = InfpFreeSection(Cache->FirstSection); + } + Cache->LastSection = NULL; + + FREE(Cache); +} + +/* EOF */ diff --git a/lib/newinflib/infhostget.c b/lib/newinflib/infhostget.c new file mode 100644 index 00000000000..bd49be17002 --- /dev/null +++ b/lib/newinflib/infhostget.c @@ -0,0 +1,249 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infhost.h" + +#define NDEBUG +#include + +int +InfHostFindFirstLine(HINF InfHandle, + const WCHAR *Section, + const WCHAR *Key, + PINFCONTEXT *Context) +{ + INFSTATUS Status; + + Status = InfpFindFirstLine(InfHandle, Section, Key, Context); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut) +{ + INFSTATUS Status; + + Status = InfpFindNextLine(ContextIn, ContextOut); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, + const WCHAR *Key, + PINFCONTEXT ContextOut) +{ + INFSTATUS Status; + + Status = InfpFindFirstMatchLine(ContextIn, Key, ContextOut); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostFindNextMatchLine(PINFCONTEXT ContextIn, + const WCHAR *Key, + PINFCONTEXT ContextOut) +{ + INFSTATUS Status; + + Status = InfpFindNextMatchLine(ContextIn, Key, ContextOut); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +LONG +InfHostGetLineCount(HINF InfHandle, + PCWSTR Section) +{ + return InfpGetLineCount(InfHandle, Section); +} + + +/* InfGetLineText */ + + +LONG +InfHostGetFieldCount(PINFCONTEXT Context) +{ + return InfpGetFieldCount(Context); +} + + +int +InfHostGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + UCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize) +{ + INFSTATUS Status; + + Status = InfpGetBinaryField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + ULONG *IntegerValue) +{ + INFSTATUS Status; + + Status = InfpGetIntField(Context, FieldIndex, (PLONG)IntegerValue); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize) +{ + INFSTATUS Status; + + Status = InfpGetMultiSzField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR *ReturnBuffer, + ULONG ReturnBufferSize, + ULONG *RequiredSize) +{ + INFSTATUS Status; + + Status = InfpGetStringField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostGetData(PINFCONTEXT Context, + WCHAR **Key, + WCHAR **Data) +{ + INFSTATUS Status; + + Status = InfpGetData(Context, Key, Data); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + + +int +InfHostGetDataField(PINFCONTEXT Context, + ULONG FieldIndex, + WCHAR **Data) +{ + INFSTATUS Status; + + Status = InfpGetDataField(Context, FieldIndex, Data); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + +VOID +InfHostFreeContext(PINFCONTEXT Context) +{ + InfpFreeContext(Context); +} + +/* EOF */ diff --git a/lib/newinflib/infhostput.c b/lib/newinflib/infhostput.c new file mode 100644 index 00000000000..a5233e50545 --- /dev/null +++ b/lib/newinflib/infhostput.c @@ -0,0 +1,115 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * COPYRIGHT: Copyright 2005 Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infhost.h" + +#define NDEBUG +#include + +int +InfHostWriteFile(HINF InfHandle, + const CHAR *FileName, + const CHAR *HeaderComment) +{ + WCHAR *Buffer; + ULONG BufferSize; + INFSTATUS Status; + FILE *File; + + Status = InfpBuildFileBuffer((PINFCACHE) InfHandle, &Buffer, &BufferSize); + if (! INF_SUCCESS(Status)) + { + errno = Status; + return -1; + } + + File = fopen(FileName, "wb"); + if (NULL == File) + { + FREE(Buffer); + DPRINT1("fopen() failed (errno %d)\n", errno); + return -1; + } + + DPRINT("fopen() successful\n"); + + if (NULL != HeaderComment && '\0' != *HeaderComment) + { +// fprintf(File, "; %s\r\n\r\n", HeaderComment); + } + + if (BufferSize != fwrite(Buffer, (size_t)1, (size_t)BufferSize, File)) + { + DPRINT1("fwrite() failed (errno %d)\n", errno); + fclose(File); + FREE(Buffer); + return -1; + } + + fclose(File); + + FREE(Buffer); + + return 0; +} + +int +InfHostFindOrAddSection(HINF InfHandle, + const WCHAR *Section, + PINFCONTEXT *Context) +{ + INFSTATUS Status; + + Status = InfpFindOrAddSection((PINFCACHE) InfHandle, Section, Context); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + +int +InfHostAddLine(PINFCONTEXT Context, const WCHAR *Key) +{ + INFSTATUS Status; + + Status = InfpAddLineWithKey(Context, Key); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + +int +InfHostAddField(PINFCONTEXT Context, const WCHAR *Data) +{ + INFSTATUS Status; + + Status = InfpAddField(Context, Data); + if (INF_SUCCESS(Status)) + { + return 0; + } + else + { + errno = Status; + return -1; + } +} + +/* EOF */ diff --git a/lib/newinflib/infhostrtl.c b/lib/newinflib/infhostrtl.c new file mode 100644 index 00000000000..ddc9b84884a --- /dev/null +++ b/lib/newinflib/infhostrtl.c @@ -0,0 +1,151 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infhost.h" + +#define NDEBUG +#include + +NTSTATUS NTAPI +RtlMultiByteToUnicodeN( + IN PWCHAR UnicodeString, + IN ULONG UnicodeSize, + IN PULONG ResultSize, + IN PCSTR MbString, + IN ULONG MbSize) +{ + ULONG Size = 0; + ULONG i; + PUCHAR WideString; + + /* single-byte code page */ + if (MbSize > (UnicodeSize / sizeof(WCHAR))) + Size = UnicodeSize / sizeof(WCHAR); + else + Size = MbSize; + + if (ResultSize != NULL) + *ResultSize = Size * sizeof(WCHAR); + + WideString = (PUCHAR)UnicodeString; + for (i = 0; i < Size; i++) + { + WideString[2 * i + 0] = (UCHAR)MbString[i]; + WideString[2 * i + 1] = 0; + } + + return STATUS_SUCCESS; +} + + +BOOLEAN +NTAPI +RtlIsTextUnicode( PVOID buf, INT len, INT *pf ) +{ + static const WCHAR std_control_chars[] = {'\r','\n','\t',' ',0x3000,0}; + static const WCHAR byterev_control_chars[] = {0x0d00,0x0a00,0x0900,0x2000,0}; + const WCHAR *s = buf; + int i; + unsigned int flags = MAXULONG, out_flags = 0; + + if (len < sizeof(WCHAR)) + { + /* FIXME: MSDN documents IS_TEXT_UNICODE_BUFFER_TOO_SMALL but there is no such thing... */ + if (pf) *pf = 0; + return FALSE; + } + if (pf) + flags = (unsigned int)*pf; + /* + * Apply various tests to the text string. According to the + * docs, each test "passed" sets the corresponding flag in + * the output flags. But some of the tests are mutually + * exclusive, so I don't see how you could pass all tests ... + */ + + /* Check for an odd length ... pass if even. */ + if (len & 1) out_flags |= IS_TEXT_UNICODE_ODD_LENGTH; + + if (((char *)buf)[len - 1] == 0) + len--; /* Windows seems to do something like that to avoid e.g. false IS_TEXT_UNICODE_NULL_BYTES */ + + len /= (INT)sizeof(WCHAR); + /* Windows only checks the first 256 characters */ + if (len > 256) len = 256; + + /* Check for the special byte order unicode marks. */ + if (*s == 0xFEFF) out_flags |= IS_TEXT_UNICODE_SIGNATURE; + if (*s == 0xFFFE) out_flags |= IS_TEXT_UNICODE_REVERSE_SIGNATURE; + + /* apply some statistical analysis */ + if (flags & IS_TEXT_UNICODE_STATISTICS) + { + int stats = 0; + /* FIXME: checks only for ASCII characters in the unicode stream */ + for (i = 0; i < len; i++) + { + if (s[i] <= 255) stats++; + } + if (stats > len / 2) + out_flags |= IS_TEXT_UNICODE_STATISTICS; + } + + /* Check for unicode NULL chars */ + if (flags & IS_TEXT_UNICODE_NULL_BYTES) + { + for (i = 0; i < len; i++) + { + if (!(s[i] & 0xff) || !(s[i] >> 8)) + { + out_flags |= IS_TEXT_UNICODE_NULL_BYTES; + break; + } + } + } + + if (flags & IS_TEXT_UNICODE_CONTROLS) + { + for (i = 0; i < len; i++) + { + if (strchrW(std_control_chars, s[i])) + { + out_flags |= IS_TEXT_UNICODE_CONTROLS; + break; + } + } + } + + if (flags & IS_TEXT_UNICODE_REVERSE_CONTROLS) + { + for (i = 0; i < len; i++) + { + if (strchrW(byterev_control_chars, s[i])) + { + out_flags |= IS_TEXT_UNICODE_REVERSE_CONTROLS; + break; + } + } + } + + if (pf) + { + out_flags &= (unsigned int)*pf; + *pf = (INT)out_flags; + } + /* check for flags that indicate it's definitely not valid Unicode */ + if (out_flags & (IS_TEXT_UNICODE_REVERSE_MASK | IS_TEXT_UNICODE_NOT_UNICODE_MASK)) return FALSE; + /* now check for invalid ASCII, and assume Unicode if so */ + if (out_flags & IS_TEXT_UNICODE_NOT_ASCII_MASK) return TRUE; + /* now check for Unicode flags */ + if (out_flags & IS_TEXT_UNICODE_UNICODE_MASK) return TRUE; + /* no flags set */ + return FALSE; +} diff --git a/lib/newinflib/inflib.h b/lib/newinflib/inflib.h new file mode 100644 index 00000000000..7dff17fa035 --- /dev/null +++ b/lib/newinflib/inflib.h @@ -0,0 +1,15 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * COPYRIGHT: Copyright 2005 Ge van Geldorp + */ + +#include +#include +#include + +#include "builddep.h" +#include "infcommon.h" +#include "infpriv.h" + +/* EOF */ diff --git a/lib/newinflib/inflib.mak b/lib/newinflib/inflib.mak new file mode 100644 index 00000000000..a0edbe26b96 --- /dev/null +++ b/lib/newinflib/inflib.mak @@ -0,0 +1,76 @@ +INFLIB_BASE = $(LIB_BASE_)newinflib +INFLIB_BASE_ = $(INFLIB_BASE)$(SEP) +INFLIB_INT = $(INTERMEDIATE_)$(INFLIB_BASE)_host +INFLIB_INT_ = $(INTERMEDIATE_)$(INFLIB_BASE)_host$(SEP) +INFLIB_OUT = $(OUTPUT_)$(INFLIB_BASE)_host +INFLIB_OUT_ = $(OUTPUT_)$(INFLIB_BASE)_host$(SEP) + +$(INFLIB_INT): | $(LIB_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(INFLIB_OUT): | $(OUTPUT_)$(LIB_BASE) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +INFLIB_HOST_TARGET = \ + $(INFLIB_OUT)$(SEP)newinflib.a + +INFLIB_HOST_SOURCES = $(addprefix $(INFLIB_BASE_), \ + infcore.c \ + infget.c \ + infput.c \ + infhostgen.c \ + infhostget.c \ + infhostput.c \ + infhostrtl.c \ + ) + +INFLIB_HOST_OBJECTS = \ + $(subst $(INFLIB_BASE), $(INFLIB_INT), $(INFLIB_HOST_SOURCES:.c=.o)) + +INFLIB_HOST_CFLAGS = -O3 -Wall -Wpointer-arith -Wconversion \ + -Wstrict-prototypes -Wmissing-prototypes -DINFLIB_HOST \ + -Iinclude/reactos -Iinclude $(HOST_CFLAGS) + +$(INFLIB_HOST_TARGET): $(INFLIB_HOST_OBJECTS) | $(INFLIB_OUT) + $(ECHO_HOSTAR) + $(host_ar) -r $@ $(INFLIB_HOST_OBJECTS) + +$(INFLIB_INT_)infcore.o: $(INFLIB_BASE_)infcore.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infget.o: $(INFLIB_BASE_)infget.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infput.o: $(INFLIB_BASE_)infput.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infhostgen.o: $(INFLIB_BASE_)infhostgen.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infhostget.o: $(INFLIB_BASE_)infhostget.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infhostput.o: $(INFLIB_BASE_)infhostput.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +$(INFLIB_INT_)infhostrtl.o: $(INFLIB_BASE_)infhostrtl.c | $(INFLIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(INFLIB_HOST_CFLAGS) -c $< -o $@ + +.PHONY: newinflib_host +newinflib_host: $(INFLIB_HOST_TARGET) + +.PHONY: newinflib_host_clean +newinflib_host_clean: + -@$(rm) $(INFLIB_HOST_TARGET) $(INFLIB_HOST_OBJECTS) 2>$(NUL) +clean: newinflib_host_clean diff --git a/lib/newinflib/inflib.rbuild b/lib/newinflib/inflib.rbuild new file mode 100644 index 00000000000..7c758a7c332 --- /dev/null +++ b/lib/newinflib/inflib.rbuild @@ -0,0 +1,32 @@ + + + + + . + infcore.c + infget.c + infput.c + infrosgen.c + infrosget.c + infrosput.c + + + " " + + . + + + + -Wwrite-strings + -Wpointer-arith + + + infcore.c + infget.c + infput.c + infhostgen.c + infhostget.c + infhostput.c + infhostrtl.c + + diff --git a/lib/newinflib/infpriv.h b/lib/newinflib/infpriv.h new file mode 100644 index 00000000000..c7adededd5d --- /dev/null +++ b/lib/newinflib/infpriv.h @@ -0,0 +1,145 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +#pragma once + +#ifndef FIELD_OFFSET +#define FIELD_OFFSET(t,f) ((ptrdiff_t)&(((t*)0)->f)) +#endif + +#define INF_STATUS_INSUFFICIENT_RESOURCES ((INFSTATUS)0xC000009A) +#define INF_STATUS_BAD_SECTION_NAME_LINE ((INFSTATUS)0xC0700001) +#define INF_STATUS_SECTION_NAME_TOO_LONG ((INFSTATUS)0xC0700002) +#define INF_STATUS_WRONG_INF_STYLE ((INFSTATUS)0xC0700003) +#define INF_STATUS_NOT_ENOUGH_MEMORY ((INFSTATUS)0xC0700004) + +typedef struct _INFCACHEFIELD +{ + struct _INFCACHEFIELD *Next; + struct _INFCACHEFIELD *Prev; + + WCHAR Data[1]; +} INFCACHEFIELD, *PINFCACHEFIELD; + +typedef struct _INFCACHELINE +{ + struct _INFCACHELINE *Next; + struct _INFCACHELINE *Prev; + + LONG FieldCount; + + PWCHAR Key; + + PINFCACHEFIELD FirstField; + PINFCACHEFIELD LastField; + +} INFCACHELINE, *PINFCACHELINE; + +typedef struct _INFCACHESECTION +{ + struct _INFCACHESECTION *Next; + struct _INFCACHESECTION *Prev; + + PINFCACHELINE FirstLine; + PINFCACHELINE LastLine; + + LONG LineCount; + + WCHAR Name[1]; +} INFCACHESECTION, *PINFCACHESECTION; + +typedef struct _INFCACHE +{ + LANGID LanguageId; + PINFCACHESECTION FirstSection; + PINFCACHESECTION LastSection; + + PINFCACHESECTION StringsSection; +} INFCACHE, *PINFCACHE; + +typedef struct _INFCONTEXT +{ + PINFCACHE Inf; + PINFCACHESECTION Section; + PINFCACHELINE Line; +} INFCONTEXT; + +typedef int INFSTATUS; + +/* FUNCTIONS ****************************************************************/ + +extern INFSTATUS InfpParseBuffer(PINFCACHE file, + const WCHAR *buffer, + const WCHAR *end, + PULONG error_line); +extern PINFCACHESECTION InfpFreeSection(PINFCACHESECTION Section); +extern PINFCACHESECTION InfpAddSection(PINFCACHE Cache, + PCWSTR Name); +extern PINFCACHELINE InfpAddLine(PINFCACHESECTION Section); +extern PVOID InfpAddKeyToLine(PINFCACHELINE Line, + PCWSTR Key); +extern PVOID InfpAddFieldToLine(PINFCACHELINE Line, + PCWSTR Data); +extern PINFCACHELINE InfpFindKeyLine(PINFCACHESECTION Section, + PCWSTR Key); +extern PINFCACHESECTION InfpFindSection(PINFCACHE Cache, + PCWSTR Section); + +extern INFSTATUS InfpBuildFileBuffer(PINFCACHE InfHandle, + PWCHAR *Buffer, + PULONG BufferSize); + +extern INFSTATUS InfpFindFirstLine(PINFCACHE InfHandle, + PCWSTR Section, + PCWSTR Key, + PINFCONTEXT *Context); +extern INFSTATUS InfpFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut); +extern INFSTATUS InfpFindFirstMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut); +extern INFSTATUS InfpFindNextMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut); +extern LONG InfpGetLineCount(HINF InfHandle, + PCWSTR Section); +extern LONG InfpGetFieldCount(PINFCONTEXT Context); +extern INFSTATUS InfpGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + PUCHAR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern INFSTATUS InfpGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + PLONG IntegerValue); +extern INFSTATUS InfpGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern INFSTATUS InfpGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern INFSTATUS InfpGetData(PINFCONTEXT Context, + PWCHAR *Key, + PWCHAR *Data); +extern INFSTATUS InfpGetDataField(PINFCONTEXT Context, + ULONG FieldIndex, + PWCHAR *Data); + +extern INFSTATUS InfpFindOrAddSection(PINFCACHE Cache, + PCWSTR Section, + PINFCONTEXT *Context); +extern INFSTATUS InfpAddLineWithKey(PINFCONTEXT Context, PCWSTR Key); +extern INFSTATUS InfpAddField(PINFCONTEXT Context, PCWSTR Data); + +extern VOID InfpFreeContext(PINFCONTEXT Context); + +/* EOF */ diff --git a/lib/newinflib/infput.c b/lib/newinflib/infput.c new file mode 100644 index 00000000000..c049f3fdcf5 --- /dev/null +++ b/lib/newinflib/infput.c @@ -0,0 +1,264 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * COPYRIGHT: Copyright 2005 Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" + +#define NDEBUG +#include + +#define EOL L"\r\n" +#define SIZE_INC 1024 + +typedef struct _OUTPUTBUFFER +{ + PWCHAR Buffer; + PWCHAR Current; + ULONG TotalSize; + ULONG FreeSize; + INFSTATUS Status; +} OUTPUTBUFFER, *POUTPUTBUFFER; + +static void +Output(POUTPUTBUFFER OutBuf, PCWSTR Text) +{ + ULONG Length; + PWCHAR NewBuf; + ULONG NewSize; + + /* Skip mode? */ + if (! INF_SUCCESS(OutBuf->Status)) + { + return; + } + + /* Doesn't fit? */ + Length = (ULONG)strlenW(Text) * sizeof(WCHAR); + if (OutBuf->FreeSize < Length + 1 && INF_SUCCESS(OutBuf->Status)) + { + DPRINT("Out of free space. TotalSize %u FreeSize %u Length %u\n", + (UINT)OutBuf->TotalSize, (UINT)OutBuf->FreeSize, (UINT)Length); + /* Round up to next SIZE_INC */ + NewSize = OutBuf->TotalSize + + (((Length + 1) - OutBuf->FreeSize + (SIZE_INC - 1)) / + SIZE_INC) * SIZE_INC; + DPRINT("NewSize %u\n", (UINT)NewSize); + NewBuf = MALLOC(NewSize); + /* Abort if failed */ + if (NULL == NewBuf) + { + DPRINT1("MALLOC() failed\n"); + OutBuf->Status = INF_STATUS_NO_MEMORY; + return; + } + + /* Need to copy old contents? */ + if (NULL != OutBuf->Buffer) + { + DPRINT("Copying %u bytes from old content\n", + (UINT)(OutBuf->TotalSize - OutBuf->FreeSize)); + MEMCPY(NewBuf, OutBuf->Buffer, OutBuf->TotalSize - OutBuf->FreeSize); + OutBuf->Current = NewBuf + (OutBuf->Current - OutBuf->Buffer); + FREE(OutBuf->Buffer); + } + else + { + OutBuf->Current = NewBuf; + } + OutBuf->Buffer = NewBuf; + OutBuf->FreeSize += NewSize - OutBuf->TotalSize; + OutBuf->TotalSize = NewSize; + DPRINT("After reallocation TotalSize %u FreeSize %u\n", + (UINT)OutBuf->TotalSize, (UINT)OutBuf->FreeSize); + } + + /* We're guaranteed to have enough room now. Copy char by char because of + possible "conversion" from Unicode to Ansi */ + while (Length--) + { + *OutBuf->Current++ = *Text++; + OutBuf->FreeSize--; + } + *OutBuf->Current = '\0'; +} + +INFSTATUS +InfpBuildFileBuffer(PINFCACHE Cache, + PWCHAR *Buffer, + PULONG BufferSize) +{ + OUTPUTBUFFER OutBuf; + PINFCACHESECTION CacheSection; + PINFCACHELINE CacheLine; + PINFCACHEFIELD CacheField; + PWCHAR p; + BOOLEAN NeedQuotes; + + OutBuf.Buffer = NULL; + OutBuf.Current = NULL; + OutBuf.FreeSize = 0; + OutBuf.TotalSize = 0; + OutBuf.Status = INF_STATUS_SUCCESS; + + /* Iterate through list of sections */ + CacheSection = Cache->FirstSection; + while (CacheSection != NULL) + { + DPRINT("Processing section %S\n", CacheSection->Name); + if (CacheSection != Cache->FirstSection) + { + Output(&OutBuf, EOL); + } + Output(&OutBuf, L"["); + Output(&OutBuf, CacheSection->Name); + Output(&OutBuf, L"]"); + Output(&OutBuf, EOL); + + /* Iterate through list of lines */ + CacheLine = CacheSection->FirstLine; + while (CacheLine != NULL) + { + if (NULL != CacheLine->Key) + { + DPRINT("Line with key %S\n", CacheLine->Key); + Output(&OutBuf, CacheLine->Key); + Output(&OutBuf, L" = "); + } + else + { + DPRINT("Line without key\n"); + } + + /* Iterate through list of lines */ + CacheField = CacheLine->FirstField; + while (CacheField != NULL) + { + if (CacheField != CacheLine->FirstField) + { + Output(&OutBuf, L","); + } + p = CacheField->Data; + NeedQuotes = FALSE; + while (L'\0' != *p && ! NeedQuotes) + { + NeedQuotes = (BOOLEAN)(L',' == *p || L';' == *p || + L'\\' == *p); + p++; + } + if (NeedQuotes) + { + Output(&OutBuf, L"\""); + Output(&OutBuf, CacheField->Data); + Output(&OutBuf, L"\""); + } + else + { + Output(&OutBuf, CacheField->Data); + } + + /* Get the next field */ + CacheField = CacheField->Next; + } + + Output(&OutBuf, EOL); + /* Get the next line */ + CacheLine = CacheLine->Next; + } + + /* Get the next section */ + CacheSection = CacheSection->Next; + } + + if (INF_SUCCESS(OutBuf.Status)) + { + *Buffer = OutBuf.Buffer; + *BufferSize = OutBuf.TotalSize - OutBuf.FreeSize; + } + else if (NULL != OutBuf.Buffer) + { + FREE(OutBuf.Buffer); + } + + return INF_STATUS_SUCCESS; +} + +INFSTATUS +InfpFindOrAddSection(PINFCACHE Cache, + PCWSTR Section, + PINFCONTEXT *Context) +{ + DPRINT("InfpFindOrAddSection section %S\n", Section); + + *Context = MALLOC(sizeof(INFCONTEXT)); + if (NULL == *Context) + { + DPRINT1("MALLOC() failed\n"); + return INF_STATUS_NO_MEMORY; + } + + (*Context)->Inf = Cache; + (*Context)->Section = InfpFindSection(Cache, Section); + (*Context)->Line = NULL; + if (NULL == (*Context)->Section) + { + DPRINT("Section not found, creating it\n"); + (*Context)->Section = InfpAddSection(Cache, Section); + if (NULL == (*Context)->Section) + { + DPRINT("Failed to create section\n"); + FREE(*Context); + return INF_STATUS_NO_MEMORY; + } + } + + return INF_STATUS_SUCCESS; +} + +INFSTATUS +InfpAddLineWithKey(PINFCONTEXT Context, PCWSTR Key) +{ + if (NULL == Context) + { + DPRINT1("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + Context->Line = InfpAddLine(Context->Section); + if (NULL == Context->Line) + { + DPRINT("Failed to create line\n"); + return INF_STATUS_NO_MEMORY; + } + + if (NULL != Key && NULL == InfpAddKeyToLine(Context->Line, Key)) + { + DPRINT("Failed to add key\n"); + return INF_STATUS_NO_MEMORY; + } + + return INF_STATUS_SUCCESS; +} + +INFSTATUS +InfpAddField(PINFCONTEXT Context, PCWSTR Data) +{ + if (NULL == Context || NULL == Context->Line) + { + DPRINT1("Invalid parameter\n"); + return INF_STATUS_INVALID_PARAMETER; + } + + if (NULL == InfpAddFieldToLine(Context->Line, Data)) + { + DPRINT("Failed to add field\n"); + return INF_STATUS_NO_MEMORY; + } + + return INF_STATUS_SUCCESS; +} + +/* EOF */ diff --git a/lib/newinflib/infros.h b/lib/newinflib/infros.h new file mode 100644 index 00000000000..92dbc5133db --- /dev/null +++ b/lib/newinflib/infros.h @@ -0,0 +1,81 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +extern VOID InfSetHeap(PVOID Heap); +extern NTSTATUS InfOpenBufferedFile(PHINF InfHandle, + PVOID Buffer, + ULONG BufferSize, + LANGID LanguageId, + PULONG ErrorLine); +extern NTSTATUS InfOpenFile(PHINF InfHandle, + PUNICODE_STRING FileName, + LANGID LanguageId, + PULONG ErrorLine); +extern NTSTATUS InfWriteFile(HINF InfHandle, + PUNICODE_STRING FileName, + PUNICODE_STRING HeaderComment); +extern VOID InfCloseFile(HINF InfHandle); +extern BOOLEAN InfFindFirstLine(HINF InfHandle, + PCWSTR Section, + PCWSTR Key, + PINFCONTEXT *Context); +extern BOOLEAN InfFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut); +extern BOOLEAN InfFindFirstMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut); +extern BOOLEAN InfFindNextMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut); +extern LONG InfGetLineCount(HINF InfHandle, + PCWSTR Section); +extern LONG InfGetFieldCount(PINFCONTEXT Context); +extern BOOLEAN InfGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + PUCHAR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern BOOLEAN InfGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + PLONG IntegerValue); +extern BOOLEAN InfGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern BOOLEAN InfGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize); +extern BOOLEAN InfGetData(PINFCONTEXT Context, + PWCHAR *Key, + PWCHAR *Data); +extern BOOLEAN InfGetDataField(PINFCONTEXT Context, + ULONG FieldIndex, + PWCHAR *Data); +extern BOOLEAN InfFindOrAddSection(HINF InfHandle, + PCWSTR Section, + PINFCONTEXT *Context); +extern BOOLEAN InfAddLine(PINFCONTEXT Context, PCWSTR Key); +extern BOOLEAN InfAddField(PINFCONTEXT Context, PCWSTR Data); +extern VOID InfFreeContext(PINFCONTEXT Context); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* EOF */ diff --git a/lib/newinflib/infrosgen.c b/lib/newinflib/infrosgen.c new file mode 100644 index 00000000000..b23403b96c0 --- /dev/null +++ b/lib/newinflib/infrosgen.c @@ -0,0 +1,365 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infros.h" + +#define NDEBUG +#include + +/* PRIVATE FUNCTIONS ********************************************************/ + +static int InfpHeapRefCount; + +static VOID +CheckHeap() +{ + if (NULL == InfpHeap) + { + InfpHeap = RtlCreateHeap(HEAP_GROWABLE, NULL, 0, 0, NULL, NULL); + } + if (0 <= InfpHeapRefCount) + { + InfpHeapRefCount++; + } +} + + +/* PUBLIC FUNCTIONS *********************************************************/ + +PVOID InfpHeap; + +VOID +InfSetHeap(PVOID Heap) +{ + if (NULL == InfpHeap) + { + InfpHeap = Heap; + InfpHeapRefCount = -1; + } +} + + +NTSTATUS +InfOpenBufferedFile(PHINF InfHandle, + PVOID Buffer, + ULONG BufferSize, + LANGID LanguageId, + PULONG ErrorLine) +{ + INFSTATUS Status; + PINFCACHE Cache; + PCHAR FileBuffer; + ULONG FileBufferSize; + + CheckHeap(); + + *InfHandle = NULL; + *ErrorLine = (ULONG)-1; + + /* Allocate file buffer */ + FileBufferSize = BufferSize + 2; + FileBuffer = MALLOC(FileBufferSize); + if (FileBuffer == NULL) + { + DPRINT1("MALLOC() failed\n"); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + MEMCPY(FileBuffer, Buffer, BufferSize); + + /* Append string terminator */ + FileBuffer[BufferSize] = 0; + FileBuffer[BufferSize + 1] = 0; + + /* Allocate infcache header */ + Cache = (PINFCACHE)MALLOC(sizeof(INFCACHE)); + if (Cache == NULL) + { + DPRINT("MALLOC() failed\n"); + FREE(FileBuffer); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + /* Initialize inicache header */ + ZEROMEMORY(Cache, + sizeof(INFCACHE)); + + Cache->LanguageId = LanguageId; + + /* Parse the inf buffer */ + if (!RtlIsTextUnicode(FileBuffer, FileBufferSize, NULL)) + { +// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf }; + WCHAR *new_buff; +// UINT codepage = CP_ACP; + UINT offset = 0; + +// if (BufferSize > sizeof(utf8_bom) && !memcmp(FileBuffer, utf8_bom, sizeof(utf8_bom) )) +// { +// codepage = CP_UTF8; +// offset = sizeof(utf8_bom); +// } + + new_buff = MALLOC(FileBufferSize * sizeof(WCHAR)); + if (new_buff != NULL) + { + ULONG len; + Status = RtlMultiByteToUnicodeN(new_buff, + FileBufferSize * sizeof(WCHAR), + &len, + (char *)FileBuffer + offset, + FileBufferSize - offset); + + Status = InfpParseBuffer(Cache, + new_buff, + new_buff + len / sizeof(WCHAR), + ErrorLine); + FREE(new_buff); + } + else + Status = INF_STATUS_INSUFFICIENT_RESOURCES; + } + else + { + WCHAR *new_buff = (WCHAR *)FileBuffer; + /* UCS-16 files should start with the Unicode BOM; we should skip it */ + if (*new_buff == 0xfeff) + { + new_buff++; + FileBufferSize -= sizeof(WCHAR); + } + Status = InfpParseBuffer(Cache, + new_buff, + (WCHAR*)((char*)new_buff + FileBufferSize), + ErrorLine); + } + + if (!INF_SUCCESS(Status)) + { + FREE(Cache); + Cache = NULL; + } + + /* Free file buffer */ + FREE(FileBuffer); + + *InfHandle = (HINF)Cache; + + return(Status); +} + + +NTSTATUS +InfOpenFile(PHINF InfHandle, + PUNICODE_STRING FileName, + LANGID LanguageId, + PULONG ErrorLine) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + FILE_STANDARD_INFORMATION FileInfo; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE FileHandle; + NTSTATUS Status; + PCHAR FileBuffer; + ULONG FileLength; + ULONG FileBufferLength; + LARGE_INTEGER FileOffset; + PINFCACHE Cache; + + CheckHeap(); + + *InfHandle = NULL; + *ErrorLine = (ULONG)-1; + + /* Open the inf file */ + InitializeObjectAttributes(&ObjectAttributes, + FileName, + 0, + NULL, + NULL); + + Status = NtOpenFile(&FileHandle, + GENERIC_READ | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); + if (!INF_SUCCESS(Status)) + { + DPRINT("NtOpenFile() failed (Status %lx)\n", Status); + return(Status); + } + + DPRINT("NtOpenFile() successful\n"); + + /* Query file size */ + Status = NtQueryInformationFile(FileHandle, + &IoStatusBlock, + &FileInfo, + sizeof(FILE_STANDARD_INFORMATION), + FileStandardInformation); + if (!INF_SUCCESS(Status)) + { + DPRINT("NtQueryInformationFile() failed (Status %lx)\n", Status); + NtClose(FileHandle); + return(Status); + } + + FileLength = FileInfo.EndOfFile.u.LowPart; + + DPRINT("File size: %lu\n", FileLength); + + /* Allocate file buffer */ + FileBufferLength = FileLength + 2; + FileBuffer = MALLOC(FileBufferLength); + if (FileBuffer == NULL) + { + DPRINT1("MALLOC() failed\n"); + NtClose(FileHandle); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + /* Read file */ + FileOffset.QuadPart = 0ULL; + Status = NtReadFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + FileBuffer, + FileLength, + &FileOffset, + NULL); + + /* Append string terminator */ + FileBuffer[FileLength] = 0; + FileBuffer[FileLength + 1] = 0; + + NtClose(FileHandle); + + if (!INF_SUCCESS(Status)) + { + DPRINT("NtReadFile() failed (Status %lx)\n", Status); + FREE(FileBuffer); + return(Status); + } + + /* Allocate infcache header */ + Cache = (PINFCACHE)MALLOC(sizeof(INFCACHE)); + if (Cache == NULL) + { + DPRINT("MALLOC() failed\n"); + FREE(FileBuffer); + return(INF_STATUS_INSUFFICIENT_RESOURCES); + } + + /* Initialize inicache header */ + ZEROMEMORY(Cache, + sizeof(INFCACHE)); + + Cache->LanguageId = LanguageId; + + /* Parse the inf buffer */ + if (!RtlIsTextUnicode(FileBuffer, FileBufferLength, NULL)) + { +// static const BYTE utf8_bom[3] = { 0xef, 0xbb, 0xbf }; + WCHAR *new_buff; +// UINT codepage = CP_ACP; + UINT offset = 0; + +// if (FileLength > sizeof(utf8_bom) && !memcmp(FileBuffer, utf8_bom, sizeof(utf8_bom) )) +// { +// codepage = CP_UTF8; +// offset = sizeof(utf8_bom); +// } + + new_buff = MALLOC(FileBufferLength * sizeof(WCHAR)); + if (new_buff != NULL) + { + ULONG len; + Status = RtlMultiByteToUnicodeN(new_buff, + FileBufferLength * sizeof(WCHAR), + &len, + (char *)FileBuffer + offset, + FileBufferLength - offset); + + Status = InfpParseBuffer(Cache, + new_buff, + new_buff + len / sizeof(WCHAR), + ErrorLine); + FREE(new_buff); + } + else + Status = INF_STATUS_INSUFFICIENT_RESOURCES; + } + else + { + WCHAR *new_buff = (WCHAR *)FileBuffer; + /* UCS-16 files should start with the Unicode BOM; we should skip it */ + if (*new_buff == 0xfeff) + { + new_buff++; + FileBufferLength -= sizeof(WCHAR); + } + Status = InfpParseBuffer(Cache, + new_buff, + (WCHAR*)((char*)new_buff + FileBufferLength), + ErrorLine); + } + + if (!INF_SUCCESS(Status)) + { + FREE(Cache); + Cache = NULL; + } + + /* Free file buffer */ + FREE(FileBuffer); + + *InfHandle = (HINF)Cache; + + return(Status); +} + + +VOID +InfCloseFile(HINF InfHandle) +{ + PINFCACHE Cache; + + Cache = (PINFCACHE)InfHandle; + + if (Cache == NULL) + { + return; + } + + while (Cache->FirstSection != NULL) + { + Cache->FirstSection = InfpFreeSection(Cache->FirstSection); + } + Cache->LastSection = NULL; + + FREE(Cache); + + if (0 < InfpHeapRefCount) + { + InfpHeapRefCount--; + if (0 == InfpHeapRefCount) + { + RtlDestroyHeap(InfpHeap); + InfpHeap = NULL; + } + } +} + + +/* EOF */ diff --git a/lib/newinflib/infrosget.c b/lib/newinflib/infrosget.c new file mode 100644 index 00000000000..9f3e7b06abf --- /dev/null +++ b/lib/newinflib/infrosget.c @@ -0,0 +1,140 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * PROGRAMMER: Royce Mitchell III + * Eric Kohl + * Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infros.h" + +#define NDEBUG +#include + + +BOOLEAN +InfFindFirstLine(HINF InfHandle, + PCWSTR Section, + PCWSTR Key, + PINFCONTEXT *Context) +{ + return INF_SUCCESS(InfpFindFirstLine(InfHandle, Section, Key, Context)); +} + + +BOOLEAN +InfFindNextLine(PINFCONTEXT ContextIn, + PINFCONTEXT ContextOut) +{ + return INF_SUCCESS(InfpFindNextLine(ContextIn, ContextOut)); +} + + +BOOLEAN +InfFindFirstMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut) +{ + return INF_SUCCESS(InfpFindFirstMatchLine(ContextIn, Key, ContextOut)); +} + + +BOOLEAN +InfFindNextMatchLine(PINFCONTEXT ContextIn, + PCWSTR Key, + PINFCONTEXT ContextOut) +{ + return INF_SUCCESS(InfpFindNextMatchLine(ContextIn, Key, ContextOut)); +} + + +LONG +InfGetLineCount(HINF InfHandle, + PCWSTR Section) +{ + return InfpGetLineCount(InfHandle, Section); +} + + +/* InfGetLineText */ + + +LONG +InfGetFieldCount(PINFCONTEXT Context) +{ + return InfpGetFieldCount(Context); +} + + +BOOLEAN +InfGetBinaryField(PINFCONTEXT Context, + ULONG FieldIndex, + PUCHAR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + return INF_SUCCESS(InfpGetBinaryField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize)); +} + + +BOOLEAN +InfGetIntField(PINFCONTEXT Context, + ULONG FieldIndex, + PLONG IntegerValue) +{ + return INF_SUCCESS(InfpGetIntField(Context, FieldIndex, IntegerValue)); +} + + +BOOLEAN +InfGetMultiSzField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + return INF_SUCCESS(InfpGetMultiSzField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize)); +} + + +BOOLEAN +InfGetStringField(PINFCONTEXT Context, + ULONG FieldIndex, + PWSTR ReturnBuffer, + ULONG ReturnBufferSize, + PULONG RequiredSize) +{ + return INF_SUCCESS(InfpGetStringField(Context, FieldIndex, ReturnBuffer, + ReturnBufferSize, RequiredSize)); +} + + +BOOLEAN +InfGetData(PINFCONTEXT Context, + PWCHAR *Key, + PWCHAR *Data) +{ + return INF_SUCCESS(InfpGetData(Context, Key, Data)); +} + + +BOOLEAN +InfGetDataField (PINFCONTEXT Context, + ULONG FieldIndex, + PWCHAR *Data) +{ + return INF_SUCCESS(InfpGetDataField(Context, FieldIndex, Data)); +} + +VOID +InfFreeContext(PINFCONTEXT Context) +{ + InfpFreeContext(Context); +} + +/* EOF */ diff --git a/lib/newinflib/infrosput.c b/lib/newinflib/infrosput.c new file mode 100644 index 00000000000..f5d3df9399e --- /dev/null +++ b/lib/newinflib/infrosput.c @@ -0,0 +1,132 @@ +/* + * PROJECT: .inf file parser + * LICENSE: GPL - See COPYING in the top level directory + * COPYRIGHT: Copyright 2005 Ge van Geldorp + */ + +/* INCLUDES *****************************************************************/ + +#include "inflib.h" +#include "infros.h" + +#define NDEBUG +#include + +NTSTATUS +InfWriteFile(HINF InfHandle, + PUNICODE_STRING FileName, + PUNICODE_STRING HeaderComment) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + HANDLE FileHandle; + NTSTATUS Status; + INFSTATUS InfStatus; + PWCHAR Buffer; + ULONG BufferSize; + PWCHAR HeaderBuffer; + ULONG HeaderBufferSize; + UINT Index; + + InfStatus = InfpBuildFileBuffer((PINFCACHE) InfHandle, &Buffer, &BufferSize); + if (! INF_SUCCESS(InfStatus)) + { + DPRINT("Failed to create buffer (Status 0x%lx)\n", InfStatus); + return InfStatus; + } + + /* Open the inf file */ + InitializeObjectAttributes(&ObjectAttributes, + FileName, + 0, + NULL, + NULL); + + Status = NtOpenFile(&FileHandle, + GENERIC_WRITE | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + 0, + FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE); + if (!INF_SUCCESS(Status)) + { + DPRINT1("NtOpenFile() failed (Status %lx)\n", Status); + FREE(Buffer); + return Status; + } + + DPRINT("NtOpenFile() successful\n"); + + if (NULL != HeaderComment && 0 != HeaderComment->Length) + { + /* This is just a comment header, don't abort on errors here */ + HeaderBufferSize = HeaderComment->Length + 7 * sizeof(WCHAR); + HeaderBuffer = MALLOC(HeaderBufferSize); + if (NULL != HeaderBuffer) + { + strcpyW(HeaderBuffer, L"; "); + for (Index = 0; Index < HeaderComment->Length / sizeof(WCHAR); Index++) + { + HeaderBuffer[2 + Index] = HeaderComment->Buffer[Index]; + } + strcpyW(HeaderBuffer + (2 + HeaderComment->Length / sizeof(WCHAR)), + L"\r\n\r\n"); + NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + HeaderBuffer, + HeaderBufferSize, + NULL, + NULL); + FREE(HeaderBuffer); + } + } + + /* Write main contents */ + Status = NtWriteFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Buffer, + BufferSize, + NULL, + NULL); + + NtClose(FileHandle); + FREE(Buffer); + + if (!INF_SUCCESS(Status)) + { + DPRINT1("NtWriteFile() failed (Status %lx)\n", Status); + FREE(Buffer); + return(Status); + } + + return STATUS_SUCCESS; +} + +BOOLEAN +InfFindOrAddSection(HINF InfHandle, + PCWSTR Section, + PINFCONTEXT *Context) +{ + return INF_SUCCESS(InfpFindOrAddSection((PINFCACHE) InfHandle, + Section, Context)); +} + +BOOLEAN +InfHostAddLine(PINFCONTEXT Context, PCWSTR Key) +{ + return INF_SUCCESS(InfpAddLineWithKey(Context, Key)); +} + +BOOLEAN +InfHostAddField(PINFCONTEXT Context, PCWSTR Data) +{ + return INF_SUCCESS(InfpAddField(Context, Data)); +} + +/* EOF */ diff --git a/lib/rtl/message.c b/lib/rtl/message.c index a2b17839324..065e260bf0b 100644 --- a/lib/rtl/message.c +++ b/lib/rtl/message.c @@ -17,105 +17,109 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlFindMessage(PVOID BaseAddress, - ULONG Type, - ULONG Language, - ULONG MessageId, - PRTL_MESSAGE_RESOURCE_ENTRY *MessageResourceEntry) +NTSTATUS +NTAPI +RtlFindMessage( + PVOID BaseAddress, + ULONG Type, + ULONG Language, + ULONG MessageId, + PRTL_MESSAGE_RESOURCE_ENTRY *MessageResourceEntry) { - LDR_RESOURCE_INFO ResourceInfo; - PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; - PRTL_MESSAGE_RESOURCE_DATA MessageTable; - NTSTATUS Status; - ULONG EntryOffset = 0, IdOffset = 0; - PRTL_MESSAGE_RESOURCE_ENTRY MessageEntry; - ULONG i; + LDR_RESOURCE_INFO ResourceInfo; + PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; + PRTL_MESSAGE_RESOURCE_DATA MessageTable; + NTSTATUS Status; + ULONG EntryOffset = 0, IdOffset = 0; + PRTL_MESSAGE_RESOURCE_ENTRY MessageEntry; + ULONG i; - DPRINT("RtlFindMessage()\n"); + DPRINT("RtlFindMessage()\n"); - ResourceInfo.Type = Type; - ResourceInfo.Name = 1; - ResourceInfo.Language = Language; + ResourceInfo.Type = Type; + ResourceInfo.Name = 1; + ResourceInfo.Language = Language; - Status = LdrFindResource_U(BaseAddress, - &ResourceInfo, - RESOURCE_DATA_LEVEL, - &ResourceDataEntry); - if (!NT_SUCCESS(Status)) - { - return Status; - } + Status = LdrFindResource_U(BaseAddress, + &ResourceInfo, + RESOURCE_DATA_LEVEL, + &ResourceDataEntry); + if (!NT_SUCCESS(Status)) + { + return Status; + } - DPRINT("ResourceDataEntry: %p\n", ResourceDataEntry); + DPRINT("ResourceDataEntry: %p\n", ResourceDataEntry); - Status = LdrAccessResource(BaseAddress, - ResourceDataEntry, - (PVOID*)&MessageTable, - NULL); - if (!NT_SUCCESS(Status)) - { - return Status; - } + Status = LdrAccessResource(BaseAddress, + ResourceDataEntry, + (PVOID*)&MessageTable, + NULL); + if (!NT_SUCCESS(Status)) + { + return Status; + } - DPRINT("MessageTable: %p\n", MessageTable); + DPRINT("MessageTable: %p\n", MessageTable); - DPRINT("NumberOfBlocks %lu\n", MessageTable->NumberOfBlocks); - for (i = 0; i < MessageTable->NumberOfBlocks; i++) - { - DPRINT("LoId 0x%08lx HiId 0x%08lx Offset 0x%08lx\n", - MessageTable->Blocks[i].LowId, - MessageTable->Blocks[i].HighId, - MessageTable->Blocks[i].OffsetToEntries); - } + DPRINT("NumberOfBlocks %lu\n", MessageTable->NumberOfBlocks); + for (i = 0; i < MessageTable->NumberOfBlocks; i++) + { + DPRINT("LoId 0x%08lx HiId 0x%08lx Offset 0x%08lx\n", + MessageTable->Blocks[i].LowId, + MessageTable->Blocks[i].HighId, + MessageTable->Blocks[i].OffsetToEntries); + } - for (i = 0; i < MessageTable->NumberOfBlocks; i++) - { - if ((MessageId >= MessageTable->Blocks[i].LowId) && - (MessageId <= MessageTable->Blocks[i].HighId)) - { - EntryOffset = MessageTable->Blocks[i].OffsetToEntries; - IdOffset = MessageId - MessageTable->Blocks[i].LowId; - break; - } + for (i = 0; i < MessageTable->NumberOfBlocks; i++) + { + if ((MessageId >= MessageTable->Blocks[i].LowId) && + (MessageId <= MessageTable->Blocks[i].HighId)) + { + EntryOffset = MessageTable->Blocks[i].OffsetToEntries; + IdOffset = MessageId - MessageTable->Blocks[i].LowId; + break; + } - if (MessageId < MessageTable->Blocks[i].LowId) - { - return STATUS_MESSAGE_NOT_FOUND; - } - } + if (MessageId < MessageTable->Blocks[i].LowId) + { + return STATUS_MESSAGE_NOT_FOUND; + } + } - if (MessageTable->NumberOfBlocks <= i) - { - return STATUS_MESSAGE_NOT_FOUND; - } + if (MessageTable->NumberOfBlocks <= i) + { + return STATUS_MESSAGE_NOT_FOUND; + } - MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY)((PUCHAR)MessageTable + MessageTable->Blocks[i].OffsetToEntries); + MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY) + ((PUCHAR)MessageTable + MessageTable->Blocks[i].OffsetToEntries); - DPRINT("EntryOffset 0x%08lx\n", EntryOffset); - DPRINT("IdOffset 0x%08lx\n", IdOffset); + DPRINT("EntryOffset 0x%08lx\n", EntryOffset); + DPRINT("IdOffset 0x%08lx\n", IdOffset); - DPRINT("MessageEntry: %p\n", MessageEntry); - for (i = 0; i < IdOffset; i++) - { - MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY)((PUCHAR)MessageEntry + (ULONG)MessageEntry->Length); - } + DPRINT("MessageEntry: %p\n", MessageEntry); + for (i = 0; i < IdOffset; i++) + { + MessageEntry = (PRTL_MESSAGE_RESOURCE_ENTRY) + ((PUCHAR)MessageEntry + (ULONG)MessageEntry->Length); + } - if (MessageEntry->Flags == 0) - { - DPRINT("AnsiText: %s\n", MessageEntry->Text); - } - else - { - DPRINT("UnicodeText: %S\n", (PWSTR)MessageEntry->Text); - } + if (MessageEntry->Flags == 0) + { + DPRINT("AnsiText: %s\n", MessageEntry->Text); + } + else + { + DPRINT("UnicodeText: %S\n", (PWSTR)MessageEntry->Text); + } - if (MessageResourceEntry != NULL) - { - *MessageResourceEntry = MessageEntry; - } + if (MessageResourceEntry != NULL) + { + *MessageResourceEntry = MessageEntry; + } - return STATUS_SUCCESS; + return STATUS_SUCCESS; } @@ -139,22 +143,24 @@ RtlFindMessage(PVOID BaseAddress, * * @unimplemented */ -NTSTATUS NTAPI -RtlFormatMessage(PWSTR Message, - UCHAR MaxWidth, - BOOLEAN IgnoreInserts, - BOOLEAN Ansi, - BOOLEAN ArgumentIsArray, - va_list *Arguments, - PWSTR Buffer, - ULONG BufferSize) +NTSTATUS +NTAPI +RtlFormatMessage( + PWSTR Message, + UCHAR MaxWidth, + BOOLEAN IgnoreInserts, + BOOLEAN Ansi, + BOOLEAN ArgumentIsArray, + va_list *Arguments, + PWSTR Buffer, + ULONG BufferSize) { - DPRINT1("RtlFormatMessage(%S, %u, %s, %s, %s, %s, %p, %lu)\n", - Message, MaxWidth, IgnoreInserts ? "TRUE" : "FALSE", Ansi ? "TRUE" : "FALSE", - ArgumentIsArray ? "TRUE" : "FALSE", (PSTR)Arguments, Buffer, BufferSize); + DPRINT1("RtlFormatMessage(%S, %u, %s, %s, %s, %s, %p, %lu)\n", + Message, MaxWidth, IgnoreInserts ? "TRUE" : "FALSE", Ansi ? "TRUE" : "FALSE", + ArgumentIsArray ? "TRUE" : "FALSE", (PSTR)Arguments, Buffer, BufferSize); - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; } /* EOF */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 828e413dbc1..a1fbc15d694 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -52,13 +52,13 @@ reactos/dll/win32/comctl32 # Autosync ?? reactos/dll/win32/comdlg32 # Autosync reactos/dll/win32/compstui # Autosync reactos/dll/win32/credui # Autosync -reactos/dll/win32/crypt32 # Synced to Wine-1_1_40 +reactos/dll/win32/crypt32 # Synced to Wine-1_1_43 reactos/dll/win32/cryptdlg # Autosync reactos/dll/win32/cryptdll # Autosync reactos/dll/win32/cryptnet # Autosync reactos/dll/win32/cryptui # Autosync reactos/dll/win32/dbghelp # Synced to Wine-20080802 -reactos/dll/win32/dciman32 # Synced to Wine-1_0-rc2 +reactos/dll/win32/dciman32 # Synced to Wine-1_1_43 reactos/dll/win32/dwmapi # Autosync reactos/dll/win32/fusion # Autosync reactos/dll/win32/gdiplus # Autosync @@ -113,7 +113,7 @@ reactos/dll/win32/mstask # Autosync reactos/dll/win32/msvcrt20 # Autosync reactos/dll/win32/msvfw32 # Autosync reactos/dll/win32/msvidc32 # Autosync -reactos/dll/win32/msxml3 # Synced to Wine-1_1_40 +reactos/dll/win32/msxml3 # Synced to Wine-1_1_43 reactos/dll/win32/nddeapi # Autosync reactos/dll/win32/netapi32 # Autosync reactos/dll/win32/ntdsapi # Autosync @@ -144,6 +144,8 @@ reactos/dll/win32/rsabase # Autosync reactos/dll/win32/rsaenh # Autosync reactos/dll/win32/sccbase # Autosync reactos/dll/win32/schannel # Autosync ?? +reactos/dll/win32/secur32 # Forked +reactos/dll/win32/security # Forked (different .spec) reactos/dll/win32/sensapi # Autosync reactos/dll/win32/setupapi # Forked at Wine-20050524 reactos/dll/win32/shell32 # Forked at Wine-20071011 @@ -154,7 +156,7 @@ reactos/dll/win32/slbcsp # Autosync reactos/dll/win32/softpub # Autosync reactos/dll/win32/spoolss # Autosync reactos/dll/win32/stdole2.tlb # Autosync -reactos/dll/win32/sti # Autosync ?? +reactos/dll/win32/sti # Autosync reactos/dll/win32/sxs # Autosync reactos/dll/win32/tapi32 # Autosync reactos/dll/win32/traffic # Autosync @@ -203,7 +205,7 @@ In addition the following libs, dlls and source files are mostly based on code p from Winehq CVS. If you are looking to update something in these files check Wine current souces first as it may already be fixed. -reactos/lib/uuid # Synced to Wine-20080114 +reactos/lib/sdk/uuid # Synced to Wine-1.1.42 advapi32 - reactos/dll/win32/advapi32/crypt/*.c # ekohl says we're not sharing this diff --git a/media/drivers/etc/etc.rbuild b/media/drivers/etc/etc.rbuild index 5302cc6ccd0..1ed562ed2ba 100644 --- a/media/drivers/etc/etc.rbuild +++ b/media/drivers/etc/etc.rbuild @@ -1,6 +1,8 @@ + hosts + hosts services services diff --git a/media/drivers/etc/hosts b/media/drivers/etc/hosts new file mode 100644 index 00000000000..f8352ba6721 --- /dev/null +++ b/media/drivers/etc/hosts @@ -0,0 +1,3 @@ +# ReactOS hosts file + +127.0.0.1 localhost diff --git a/media/inf/cpu.inf b/media/inf/cpu.inf index 087ab209a62..90cc393d7b9 100644 Binary files a/media/inf/cpu.inf and b/media/inf/cpu.inf differ diff --git a/media/inf/display.inf b/media/inf/display.inf index a9469631e79..f2179abb9c1 100644 Binary files a/media/inf/display.inf and b/media/inf/display.inf differ diff --git a/media/inf/ports.inf b/media/inf/ports.inf index 8423d3216ac..198bf980a56 100644 Binary files a/media/inf/ports.inf and b/media/inf/ports.inf differ diff --git a/ntoskrnl/config/cmdata.c b/ntoskrnl/config/cmdata.c index b3df10ce438..6dbf2a0380d 100644 --- a/ntoskrnl/config/cmdata.c +++ b/ntoskrnl/config/cmdata.c @@ -11,7 +11,8 @@ #include "ntoskrnl.h" #define NDEBUG #include "debug.h" - +#include "./../mm/ARM3/miarm.h" + /* GLOBALS *******************************************************************/ ULONG DummyData; @@ -252,7 +253,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"DynamicMemory", - &DummyData, + &MmDynamicPfn, NULL, NULL }, @@ -260,7 +261,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"Mirroring", - &DummyData, + &MmMirroring, NULL, NULL }, @@ -273,14 +274,6 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = NULL }, - { - L"Session Manager\\Memory Management", - L"SessionViewSize", - &DummyData, - NULL, - NULL - }, - { L"Session Manager\\Memory Management", L"SessionImageSize", @@ -300,7 +293,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"PoolUsageMaximum", - &DummyData, + &MmConsumedPoolPercentage, NULL, NULL }, @@ -308,7 +301,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"MapAllocationFragment", - &DummyData, + &MmAllocationFragment, NULL, NULL }, @@ -316,7 +309,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"PagedPoolSize", - &DummyData, + &MmSizeOfPagedPoolInBytes, NULL, NULL }, @@ -324,7 +317,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"NonPagedPoolSize", - &DummyData, + &MmSizeOfNonPagedPoolInBytes, NULL, NULL }, @@ -340,7 +333,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"LargeSystemCache", - &DummyData, + &MmLargeSystemCache, NULL, NULL }, @@ -356,7 +349,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"SystemPages", - &DummyData, + &MmNumberOfSystemPtes, NULL, NULL }, @@ -364,7 +357,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"LowMemoryThreshold", - &DummyData, + &MmLowMemoryThreshold, NULL, NULL }, @@ -372,7 +365,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"HighMemoryThreshold", - &DummyData, + &MmHighMemoryThreshold, NULL, NULL }, @@ -396,7 +389,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"SecondLevelDataCache", - &DummyData, + &MmSecondaryColors, NULL, NULL }, @@ -404,7 +397,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"ClearPageFileAtShutdown", - &DummyData, + &MmZeroPageFile, NULL, NULL }, @@ -452,7 +445,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"ProtectNonPagedPool", - &DummyData, + &MmProtectFreedNonPagedPool, NULL, NULL }, @@ -460,7 +453,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"TrackLockedPages", - &DummyData, + &MmTrackLockedPages, NULL, NULL }, @@ -468,7 +461,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"TrackPtes", - &DummyData, + &MmTrackPtes, NULL, NULL }, @@ -476,15 +469,15 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"VerifyDrivers", - &DummyData, - &DummyData, - &DummyData + MmVerifyDriverBuffer, + &MmVerifyDriverBufferLength, + &MmVerifyDriverBufferType }, { L"Session Manager\\Memory Management", L"VerifyDriverLevel", - &DummyData, + &MmVerifyDriverLevel, NULL, NULL }, @@ -508,7 +501,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"EnforceWriteProtection", - &DummyData, + &MmEnforceWriteProtection, NULL, NULL }, @@ -516,7 +509,7 @@ CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager\\Memory Management", L"MakeLowMemory", - &DummyData, + &MmMakeLowMemory, NULL, NULL }, diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c index fed59bce758..cc040e4b60d 100644 --- a/ntoskrnl/ex/init.c +++ b/ntoskrnl/ex/init.c @@ -1612,7 +1612,7 @@ Phase1InitializationDiscard(IN PVOID Context) else if (!strncmp(SafeBoot, "NETWORK", 7)) { /* With Networking */ - InitSafeBootMode = 1; + InitSafeBootMode = 2; SafeBoot += 7; MessageCode = BOOTING_IN_SAFEMODE_NETWORK; } diff --git a/ntoskrnl/include/internal/i386/intrin_i.h b/ntoskrnl/include/internal/i386/intrin_i.h index 94501841149..6cb2a7cbf0a 100644 --- a/ntoskrnl/include/internal/i386/intrin_i.h +++ b/ntoskrnl/include/internal/i386/intrin_i.h @@ -42,11 +42,11 @@ Ke386SaveFpuState(IN PFX_SAVE_AREA SaveArea) extern ULONG KeI386FxsrPresent; if (KeI386FxsrPresent) { - __asm__ __volatile__ ("fxsave %0\n" : : "m"(SaveArea)); + __asm__ __volatile__ ("fxsave %0\n" : : "m"(*SaveArea)); } else { - __asm__ __volatile__ ("fnsave %0\n wait\n" : : "m"(SaveArea)); + __asm__ __volatile__ ("fnsave %0\n wait\n" : : "m"(*SaveArea)); } } diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h index 3decd2c3d8d..edd86bbaab4 100644 --- a/ntoskrnl/include/internal/i386/mm.h +++ b/ntoskrnl/include/internal/i386/mm.h @@ -14,8 +14,10 @@ PULONG MmGetPageDirectory(VOID); #define PAGETABLE_MAP (0xc0000000) #define PAGEDIRECTORY_MAP (0xc0000000 + (PAGETABLE_MAP / (1024))) +/* FIXME: These are different for PAE */ #define PTE_BASE 0xC0000000 #define PDE_BASE 0xC0300000 +#define PDE_TOP 0xC0300FFF #define PTE_TOP 0xC03FFFFF #define HYPER_SPACE 0xC0400000 diff --git a/ntoskrnl/include/internal/io.h b/ntoskrnl/include/internal/io.h index 1faff6bfcea..9398ef1d7ff 100644 --- a/ntoskrnl/include/internal/io.h +++ b/ntoskrnl/include/internal/io.h @@ -88,21 +88,6 @@ #define IopFreeMdlFromLookaside \ ObpFreeCapturedAttributes -// -// Returns the size of a CM_RESOURCE_LIST -// -#define CM_RESOURCE_LIST_SIZE(ResList) \ - (ResList->Count == 1) ? \ - FIELD_OFFSET( \ - CM_RESOURCE_LIST, \ - List[0].PartialResourceList. \ - PartialDescriptors[(ResList)-> \ - List[0]. \ - PartialResourceList. \ - Count]) \ - : \ - FIELD_OFFSET(CM_RESOURCE_LIST, List) - // // Determines if the IRP is Synchronous // @@ -506,6 +491,21 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT PVOID Context; } DEVICETREE_TRAVERSE_CONTEXT, *PDEVICETREE_TRAVERSE_CONTEXT; +// +// Resource code +// +ULONG +NTAPI +IopCalculateResourceListSize( + IN PCM_RESOURCE_LIST ResourceList +); + +NTSTATUS +NTAPI +IopAssignDeviceResources( + IN PDEVICE_NODE DeviceNode +); + // // PNP Routines // diff --git a/ntoskrnl/io/iomgr/deviface.c b/ntoskrnl/io/iomgr/deviface.c index 114e308c4a8..a9b5e475705 100644 --- a/ntoskrnl/io/iomgr/deviface.c +++ b/ntoskrnl/io/iomgr/deviface.c @@ -20,6 +20,180 @@ static PWCHAR BaseKeyString = L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\DeviceClasses\\"; +static +NTSTATUS +OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, + IN ACCESS_MASK DesiredAccess, + IN OPTIONAL PHANDLE GuidKey, + IN OPTIONAL PHANDLE DeviceKey, + IN OPTIONAL PHANDLE InstanceKey) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + WCHAR PathBuffer[MAX_PATH]; + UNICODE_STRING BaseKeyU; + UNICODE_STRING GuidString, SubKeyName, ReferenceString; + PWCHAR StartPosition, EndPosition; + HANDLE ClassesKey; + PHANDLE GuidKeyRealP, DeviceKeyRealP, InstanceKeyRealP; + HANDLE GuidKeyReal, DeviceKeyReal, InstanceKeyReal; + NTSTATUS Status; + + SubKeyName.Buffer = NULL; + + if (GuidKey != NULL) + GuidKeyRealP = GuidKey; + else + GuidKeyRealP = &GuidKeyReal; + + if (DeviceKey != NULL) + DeviceKeyRealP = DeviceKey; + else + DeviceKeyRealP = &DeviceKeyReal; + + if (InstanceKey != NULL) + InstanceKeyRealP = InstanceKey; + else + InstanceKeyRealP = &InstanceKeyReal; + + *GuidKeyRealP = INVALID_HANDLE_VALUE; + *DeviceKeyRealP = INVALID_HANDLE_VALUE; + *InstanceKeyRealP = INVALID_HANDLE_VALUE; + + BaseKeyU.Buffer = PathBuffer; + BaseKeyU.Length = 0; + BaseKeyU.MaximumLength = MAX_PATH * sizeof(WCHAR); + + RtlAppendUnicodeToString(&BaseKeyU, BaseKeyString); + + /* Open the DeviceClasses key */ + InitializeObjectAttributes(&ObjectAttributes, + &BaseKeyU, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + Status = ZwOpenKey(&ClassesKey, + DesiredAccess | KEY_ENUMERATE_SUB_KEYS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open %wZ\n", &BaseKeyU); + goto cleanup; + } + + StartPosition = wcschr(SymbolicLinkName->Buffer, L'{'); + EndPosition = wcschr(SymbolicLinkName->Buffer, L'}'); + if (!StartPosition || !EndPosition || StartPosition > EndPosition) + { + DPRINT1("Bad symbolic link: %wZ\n", SymbolicLinkName); + return STATUS_INVALID_PARAMETER_1; + } + GuidString.Buffer = StartPosition; + GuidString.MaximumLength = GuidString.Length = (USHORT)((ULONG_PTR)(EndPosition + 1) - (ULONG_PTR)StartPosition); + + InitializeObjectAttributes(&ObjectAttributes, + &GuidString, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + ClassesKey, + NULL); + Status = ZwOpenKey(GuidKeyRealP, + DesiredAccess | KEY_ENUMERATE_SUB_KEYS, + &ObjectAttributes); + ZwClose(ClassesKey); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open %wZ%wZ (%x)\n", &BaseKeyU, &GuidString, Status); + goto cleanup; + } + + SubKeyName.Buffer = ExAllocatePool(PagedPool, SymbolicLinkName->Length); + if (!SubKeyName.Buffer) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + SubKeyName.MaximumLength = SymbolicLinkName->Length; + SubKeyName.Length = 0; + + RtlAppendUnicodeStringToString(&SubKeyName, + SymbolicLinkName); + + SubKeyName.Buffer[0] = L'#'; + SubKeyName.Buffer[1] = L'#'; + SubKeyName.Buffer[2] = L'?'; + SubKeyName.Buffer[3] = L'#'; + + ReferenceString.Buffer = wcsrchr(SubKeyName.Buffer, '\\'); + if (ReferenceString.Buffer != NULL) + { + ReferenceString.Buffer[0] = L'#'; + + SubKeyName.Length = (USHORT)((ULONG_PTR)(ReferenceString.Buffer) - (ULONG_PTR)SubKeyName.Buffer); + ReferenceString.Length = SymbolicLinkName->Length - SubKeyName.Length; + } + else + { + RtlInitUnicodeString(&ReferenceString, L"#"); + } + + InitializeObjectAttributes(&ObjectAttributes, + &SubKeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + *GuidKeyRealP, + NULL); + Status = ZwOpenKey(DeviceKeyRealP, + DesiredAccess | KEY_ENUMERATE_SUB_KEYS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open %wZ%wZ\\%wZ\n", &BaseKeyU, &GuidString, &SubKeyName); + goto cleanup; + } + + InitializeObjectAttributes(&ObjectAttributes, + &ReferenceString, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + *DeviceKeyRealP, + NULL); + Status = ZwOpenKey(InstanceKeyRealP, + DesiredAccess, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open %wZ%wZ\\%wZ%\\%wZ (%x)\n", &BaseKeyU, &GuidString, &SubKeyName, &ReferenceString, Status); + goto cleanup; + } + + Status = STATUS_SUCCESS; + +cleanup: + if (SubKeyName.Buffer != NULL) + ExFreePool(SubKeyName.Buffer); + + if (NT_SUCCESS(Status)) + { + if (!GuidKey) + ZwClose(*GuidKeyRealP); + + if (!DeviceKey) + ZwClose(*DeviceKeyRealP); + + if (!InstanceKey) + ZwClose(*InstanceKeyRealP); + } + else + { + if (*GuidKeyRealP != INVALID_HANDLE_VALUE) + ZwClose(*GuidKeyRealP); + + if (*DeviceKeyRealP != INVALID_HANDLE_VALUE) + ZwClose(*DeviceKeyRealP); + + if (*InstanceKeyRealP != INVALID_HANDLE_VALUE) + ZwClose(*InstanceKeyRealP); + } + + return Status; +} /*++ * @name IoOpenDeviceInterfaceRegistryKey * @unimplemented @@ -50,159 +224,37 @@ IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DeviceInterfaceKey) { - WCHAR StrBuff[MAX_PATH], PathBuff[MAX_PATH]; - PWCHAR Guid, RefString; - UNICODE_STRING DevParamU = RTL_CONSTANT_STRING(L"\\Device Parameters"); - UNICODE_STRING PrefixU = RTL_CONSTANT_STRING(L"\\??\\"); - UNICODE_STRING KeyPath, KeyName; - UNICODE_STRING MatchableGuid; - UNICODE_STRING GuidString; - HANDLE GuidKey, hInterfaceKey; - ULONG Index = 0; - PKEY_BASIC_INFORMATION KeyInformation; - ULONG KeyInformationLength; - OBJECT_ATTRIBUTES ObjectAttributes; - NTSTATUS Status; - ULONG RequiredLength; + HANDLE InstanceKey, DeviceParametersKey; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING DeviceParametersU = RTL_CONSTANT_STRING(L"Device Parameters"); - swprintf(StrBuff, L"##?#%s", &SymbolicLinkName->Buffer[PrefixU.Length / sizeof(WCHAR)]); + Status = OpenRegistryHandlesFromSymbolicLink(SymbolicLinkName, + KEY_CREATE_SUB_KEY, + NULL, + NULL, + &InstanceKey); + if (!NT_SUCCESS(Status)) + return Status; - RefString = wcsstr(StrBuff, L"\\"); - if (RefString) - { - RefString[0] = 0; - } + InitializeObjectAttributes(&ObjectAttributes, + &DeviceParametersU, + OBJ_CASE_INSENSITIVE | OBJ_OPENIF, + InstanceKey, + NULL); + Status = ZwCreateKey(&DeviceParametersKey, + DesiredAccess, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL); + ZwClose(InstanceKey); - RtlInitUnicodeString(&MatchableGuid, StrBuff); + if (NT_SUCCESS(Status)) + *DeviceInterfaceKey = DeviceParametersKey; - Guid = wcsstr(StrBuff, L"{"); - if (!Guid) - return STATUS_OBJECT_NAME_NOT_FOUND; - - KeyPath.Buffer = PathBuff; - KeyPath.Length = 0; - KeyPath.MaximumLength = MAX_PATH * sizeof(WCHAR); - - GuidString.Buffer = Guid; - GuidString.Length = GuidString.MaximumLength = 38 * sizeof(WCHAR); - - RtlAppendUnicodeToString(&KeyPath, BaseKeyString); - RtlAppendUnicodeStringToString(&KeyPath, &GuidString); - - InitializeObjectAttributes(&ObjectAttributes, - &KeyPath, - OBJ_CASE_INSENSITIVE, - 0, - NULL); - - Status = ZwOpenKey(&GuidKey, KEY_CREATE_SUB_KEY, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - return Status; - - while (TRUE) - { - Status = ZwEnumerateKey(GuidKey, - Index, - KeyBasicInformation, - NULL, - 0, - &RequiredLength); - if (Status == STATUS_NO_MORE_ENTRIES) - break; - else if (Status == STATUS_BUFFER_TOO_SMALL) - { - KeyInformationLength = RequiredLength; - KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); - if (!KeyInformation) - { - ZwClose(GuidKey); - return STATUS_INSUFFICIENT_RESOURCES; - } - - Status = ZwEnumerateKey(GuidKey, - Index, - KeyBasicInformation, - KeyInformation, - KeyInformationLength, - &RequiredLength); - } - else - { - ZwClose(GuidKey); - return STATUS_OBJECT_PATH_NOT_FOUND; - } - Index++; - - if (!NT_SUCCESS(Status)) - { - ZwClose(GuidKey); - return Status; - } - - KeyName.Length = KeyName.MaximumLength = KeyInformation->NameLength; - KeyName.Buffer = KeyInformation->Name; - - if (!RtlEqualUnicodeString(&KeyName, &MatchableGuid, TRUE)) - { - ExFreePool(KeyInformation); - continue; - } - - KeyPath.Length = 0; - RtlAppendUnicodeStringToString(&KeyPath, &KeyName); - RtlAppendUnicodeToString(&KeyPath, L"\\"); - - /* check for presence of a reference string */ - if (RefString) - { - /* append reference string */ - RefString[0] = L'#'; - RtlInitUnicodeString(&KeyName, RefString); - } - else - { - /* no reference string */ - RtlInitUnicodeString(&KeyName, L"#"); - } - RtlAppendUnicodeStringToString(&KeyPath, &KeyName); - - /* initialize reference string attributes */ - InitializeObjectAttributes(&ObjectAttributes, - &KeyPath, - OBJ_CASE_INSENSITIVE, - GuidKey, - NULL); - - /* now open device interface key */ - Status = ZwOpenKey(&hInterfaceKey, KEY_CREATE_SUB_KEY, &ObjectAttributes); - - if (NT_SUCCESS(Status)) - { - /* check if it provides a DeviceParameters key */ - InitializeObjectAttributes(&ObjectAttributes, &DevParamU, OBJ_CASE_INSENSITIVE, hInterfaceKey, NULL); - - Status = ZwCreateKey(DeviceInterfaceKey, DesiredAccess, &ObjectAttributes, 0, NULL, REG_OPTION_NON_VOLATILE, NULL); - - if (NT_SUCCESS(Status)) - { - /* DeviceParameters key present */ - ZwClose(hInterfaceKey); - } - else - { - /* fall back to device interface */ - *DeviceInterfaceKey = hInterfaceKey; - Status = STATUS_SUCCESS; - } - } - - /* close class key */ - ZwClose(GuidKey); - ExFreePool(KeyInformation); - return Status; - } - - return STATUS_OBJECT_PATH_NOT_FOUND; + return Status; } /*++ @@ -395,10 +447,11 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, PKEY_BASIC_INFORMATION DeviceBi = NULL; PKEY_BASIC_INFORMATION ReferenceBi = NULL; PKEY_VALUE_PARTIAL_INFORMATION bip = NULL; + PKEY_VALUE_PARTIAL_INFORMATION PartialInfo; UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; BOOLEAN FoundRightPDO = FALSE; - ULONG i = 0, j, Size; + ULONG i = 0, j, Size, NeededLength, ActualLength, LinkedValue; UNICODE_STRING ReturnBuffer = { 0, 0, NULL }; NTSTATUS Status; @@ -552,7 +605,6 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, /* We have to check if the interface is enabled, by * reading the Linked value in the Control subkey */ -#if 0 InitializeObjectAttributes( &ObjectAttributes, &Control, @@ -572,17 +624,63 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, } else if (!NT_SUCCESS(Status)) { - DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status); + DPRINT1("ZwOpenKey() failed with status 0x%08lx\n", Status); + goto cleanup; + } + + RtlInitUnicodeString(&KeyName, L"Linked"); + Status = ZwQueryValueKey(ControlKey, + &KeyName, + KeyValuePartialInformation, + NULL, + 0, + &NeededLength); + if (Status == STATUS_BUFFER_TOO_SMALL) + { + ActualLength = NeededLength; + PartialInfo = ExAllocatePool(NonPagedPool, ActualLength); + if (!PartialInfo) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwQueryValueKey(ControlKey, + &KeyName, + KeyValuePartialInformation, + PartialInfo, + ActualLength, + &NeededLength); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwQueryValueKey #2 failed (%x)\n", Status); + ExFreePool(PartialInfo); + goto cleanup; + } + + if (PartialInfo->Type != REG_DWORD || PartialInfo->DataLength != sizeof(ULONG)) + { + DPRINT1("Bad registry read\n"); + ExFreePool(PartialInfo); + goto cleanup; + } + + RtlCopyMemory(&LinkedValue, + PartialInfo->Data, + PartialInfo->DataLength); + + ExFreePool(PartialInfo); + if (LinkedValue == 0) + { + /* This interface isn't active */ + goto NextReferenceString; + } + } + else + { + DPRINT1("ZwQueryValueKey #1 failed (%x)\n", Status); goto cleanup; } -#endif - /* FIXME: Read the Linked value - * If it doesn't exist => ERROR - * If it is not a REG_DWORD or Size != sizeof(ULONG) => ERROR - * If its value is 0, go to NextReferenceString - * At the moment, do as if it is active... - */ - DPRINT1("Checking if device is enabled is not implemented yet!\n"); } /* Read the SymbolicLink string and add it into SymbolicLinkList */ @@ -661,10 +759,17 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, DPRINT("RtlAppendUnicodeStringToString() failed with status 0x%08lx\n", Status); goto cleanup; } + /* RtlAppendUnicodeStringToString added a NULL at the end of the + * destination string, but didn't increase the Length field. + * Do it for it. + */ + ReturnBuffer.Length += sizeof(WCHAR); + NextReferenceString: ExFreePool(ReferenceBi); ReferenceBi = NULL; - ExFreePool(bip); + if (bip) + ExFreePool(bip); bip = NULL; if (ReferenceKey != INVALID_HANDLE_VALUE) { @@ -701,8 +806,11 @@ NextReferenceString: Status = STATUS_INSUFFICIENT_RESOURCES; goto cleanup; } - RtlCopyMemory(NewBuffer, ReturnBuffer.Buffer, ReturnBuffer.Length); - ExFreePool(ReturnBuffer.Buffer); + if (ReturnBuffer.Buffer) + { + RtlCopyMemory(NewBuffer, ReturnBuffer.Buffer, ReturnBuffer.Length); + ExFreePool(ReturnBuffer.Buffer); + } ReturnBuffer.Buffer = NewBuffer; } ReturnBuffer.Buffer[ReturnBuffer.Length / sizeof(WCHAR)] = UNICODE_NULL; @@ -1055,7 +1163,6 @@ IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, RtlAppendUnicodeStringToString(SymbolicLinkName, ReferenceString); } SymbolicLinkName->Buffer[SymbolicLinkName->Length/sizeof(WCHAR)] = L'\0'; - SymbolicLinkName->Length += sizeof(WCHAR); /* Write symbolic link name in registry */ SymbolicLinkName->Buffer[1] = '\\'; @@ -1119,7 +1226,10 @@ IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, PWCHAR EndPosition; NTSTATUS Status; LPCGUID EventGuid; - + HANDLE InstanceHandle, ControlHandle; + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES ObjectAttributes; + ULONG LinkedValue; if (SymbolicLinkName == NULL) return STATUS_INVALID_PARAMETER_1; @@ -1141,6 +1251,51 @@ IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, SymLink.Buffer = SymbolicLinkName->Buffer; SymLink.MaximumLength = SymLink.Length = (USHORT)((ULONG_PTR)(EndPosition + 1) - (ULONG_PTR)SymLink.Buffer); DPRINT("IoSetDeviceInterfaceState('%wZ', %d)\n", SymbolicLinkName, Enable); + + Status = OpenRegistryHandlesFromSymbolicLink(SymbolicLinkName, + KEY_CREATE_SUB_KEY, + NULL, + NULL, + &InstanceHandle); + if (!NT_SUCCESS(Status)) + return Status; + + RtlInitUnicodeString(&KeyName, L"Control"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + InstanceHandle, + NULL); + Status = ZwCreateKey(&ControlHandle, + KEY_SET_VALUE, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + NULL); + ZwClose(InstanceHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to create the Control subkey\n"); + return Status; + } + + LinkedValue = (Enable ? 1 : 0); + + RtlInitUnicodeString(&KeyName, L"Linked"); + Status = ZwSetValueKey(ControlHandle, + &KeyName, + 0, + REG_DWORD, + &LinkedValue, + sizeof(ULONG)); + ZwClose(ControlHandle); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to write the Linked value\n"); + return Status; + } + /* Get pointer to the PDO */ Status = IoGetDeviceObjectPointer( &SymLink, diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 35c7447dc41..645b837de81 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -44,21 +44,6 @@ typedef struct _INVALIDATE_DEVICE_RELATION_DATA } INVALIDATE_DEVICE_RELATION_DATA, *PINVALIDATE_DEVICE_RELATION_DATA; /* FUNCTIONS *****************************************************************/ - -NTSTATUS -IopAssignDeviceResources( - IN PDEVICE_NODE DeviceNode, - OUT ULONG *pRequiredSize); - -NTSTATUS -IopTranslateDeviceResources( - IN PDEVICE_NODE DeviceNode, - IN ULONG RequiredSize); - -NTSTATUS -IopUpdateResourceMapForPnPDevice( - IN PDEVICE_NODE DeviceNode); - NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, @@ -81,19 +66,20 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode, NTSTATUS Status; if (!DriverObject->DriverExtension->AddDevice) + { + DeviceNode->Flags |= DNF_LEGACY_DRIVER; + } + + if (DeviceNode->Flags & DNF_LEGACY_DRIVER) + { + DeviceNode->Flags |= DNF_ADDED + DNF_STARTED; return STATUS_SUCCESS; + } /* This is a Plug and Play driver */ DPRINT("Plug and Play driver found\n"); ASSERT(DeviceNode->PhysicalDeviceObject); - /* Check if this plug-and-play driver is used as a legacy one for this device node */ - if (IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER)) - { - IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); - return STATUS_SUCCESS; - } - DPRINT("Calling %wZ->AddDevice(%wZ)\n", &DriverObject->DriverName, &DeviceNode->InstancePath); @@ -133,11 +119,25 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode, ObDereferenceObject(Fdo); IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED); - IopDeviceNodeSetFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY); return STATUS_SUCCESS; } +VOID +NTAPI +IopSendRemoveDevice(IN PDEVICE_OBJECT DeviceObject) +{ + IO_STACK_LOCATION Stack; + PVOID Dummy; + + RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); + Stack.MajorFunction = IRP_MJ_PNP; + Stack.MinorFunction = IRP_MN_REMOVE_DEVICE; + + /* Drivers should never fail a IRP_MN_REMOVE_DEVICE request */ + IopSynchronousCall(DeviceObject, &Stack, &Dummy); +} + VOID NTAPI IopStartDevice2(IN PDEVICE_OBJECT DeviceObject) @@ -156,13 +156,9 @@ IopStartDevice2(IN PDEVICE_OBJECT DeviceObject) Stack.MinorFunction = IRP_MN_START_DEVICE; /* Check if we didn't already report the resources */ - // if (!DeviceNode->Flags & DNF_RESOURCE_REPORTED) + if (!(DeviceNode->Flags & DNF_RESOURCE_REPORTED)) { /* Report them */ - if (DeviceNode->Flags & DNF_RESOURCE_REPORTED) - { - DPRINT1("Warning: Setting resource pointers even though DNF_RESOURCE_REPORTED is set\n"); - } Stack.Parameters.StartDevice.AllocatedResources = DeviceNode->ResourceList; Stack.Parameters.StartDevice.AllocatedResourcesTranslated = @@ -176,15 +172,19 @@ IopStartDevice2(IN PDEVICE_OBJECT DeviceObject) Status = IopSynchronousCall(DeviceObject, &Stack, &Dummy); if (!NT_SUCCESS(Status)) { - /* FIXME: TODO */ - DPRINT1("Warning: PnP Start failed\n"); - //ASSERT(FALSE); + /* Send an IRP_MN_REMOVE_DEVICE request */ + IopSendRemoveDevice(DeviceObject); + + /* Set the appropriate flag */ + DeviceNode->Flags |= DNF_START_FAILED; + + DPRINT1("Warning: PnP Start failed (%wZ)\n", &DeviceNode->InstancePath); return; } /* Otherwise, mark us as started */ DeviceNode->Flags |= DNF_STARTED; - + /* We now need enumeration */ DeviceNode->Flags |= DNF_NEED_ENUMERATION_ONLY; } @@ -198,11 +198,9 @@ IopStartAndEnumerateDevice(IN PDEVICE_NODE DeviceNode) PAGED_CODE(); /* Sanity check */ - // ASSERT((DeviceNode->Flags & DNF_ADDED)); - if (!(DeviceNode->Flags & DNF_ADDED)) DPRINT1("Warning: Starting a device node without DNF_ADDED\n"); + ASSERT((DeviceNode->Flags & DNF_ADDED)); ASSERT((DeviceNode->Flags & (DNF_RESOURCE_ASSIGNED | DNF_RESOURCE_REPORTED | - DNF_NO_RESOURCE_REQUIRED | DNF_NO_RESOURCE_REQUIRED))); ASSERT((!(DeviceNode->Flags & (DNF_HAS_PROBLEM | DNF_STARTED | @@ -212,26 +210,27 @@ IopStartAndEnumerateDevice(IN PDEVICE_NODE DeviceNode) DeviceObject = DeviceNode->PhysicalDeviceObject; /* Check if we're not started yet */ - //if (!DeviceNode->Flags & DNF_STARTED) + if (!(DeviceNode->Flags & DNF_STARTED)) { /* Start us */ IopStartDevice2(DeviceObject); } /* Do we need to query IDs? This happens in the case of manual reporting */ - //if (DeviceNode->Flags & DNF_NEED_QUERY_IDS) - //{ - // DPRINT1("Warning: Device node has DNF_NEED_QUERY_IDS\n"); +#if 0 + if (DeviceNode->Flags & DNF_NEED_QUERY_IDS) + { + DPRINT1("Warning: Device node has DNF_NEED_QUERY_IDS\n"); /* And that case shouldn't happen yet */ - // ASSERT(FALSE); - //} + ASSERT(FALSE); + } +#endif /* Make sure we're started, and check if we need enumeration */ if ((DeviceNode->Flags & DNF_STARTED) && (DeviceNode->Flags & DNF_NEED_ENUMERATION_ONLY)) { /* Enumerate us */ - //Status = IopEnumerateDevice(DeviceObject); IoSynchronousInvalidateDeviceRelations(DeviceObject, BusRelations); IopDeviceNodeClearFlag(DeviceNode, DNF_NEED_ENUMERATION_ONLY); Status = STATUS_SUCCESS; @@ -250,56 +249,18 @@ NTSTATUS IopStartDevice( PDEVICE_NODE DeviceNode) { - IO_STATUS_BLOCK IoStatusBlock; - IO_STACK_LOCATION Stack; - ULONG RequiredLength; NTSTATUS Status; HANDLE InstanceHandle = INVALID_HANDLE_VALUE, ControlHandle = INVALID_HANDLE_VALUE; UNICODE_STRING KeyName; OBJECT_ATTRIBUTES ObjectAttributes; - IopDeviceNodeSetFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); - DPRINT("Sending IRP_MN_FILTER_RESOURCE_REQUIREMENTS to device stack\n"); - Stack.Parameters.FilterResourceRequirements.IoResourceRequirementList = DeviceNode->ResourceRequirements; - Status = IopInitiatePnpIrp( - DeviceNode->PhysicalDeviceObject, - &IoStatusBlock, - IRP_MN_FILTER_RESOURCE_REQUIREMENTS, - &Stack); - if (!NT_SUCCESS(Status) && Status != STATUS_NOT_SUPPORTED) + if (DeviceNode->Flags & (DNF_STARTED | DNF_START_REQUEST_PENDING)) { - DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n"); - IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); - return Status; - } - else if (NT_SUCCESS(Status)) - { - DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information; + /* Nothing to do here */ + return STATUS_SUCCESS; } - Status = IopAssignDeviceResources(DeviceNode, &RequiredLength); - if (NT_SUCCESS(Status)) - { - Status = IopTranslateDeviceResources(DeviceNode, RequiredLength); - if (NT_SUCCESS(Status)) - { - Status = IopUpdateResourceMapForPnPDevice(DeviceNode); - if (!NT_SUCCESS(Status)) - { - DPRINT("IopUpdateResourceMap() failed (Status 0x%08lx)\n", Status); - } - } - else - { - DPRINT("IopTranslateDeviceResources() failed (Status 0x%08lx)\n", Status); - } - } - else - { - DPRINT("IopAssignDeviceResources() failed (Status 0x%08lx)\n", Status); - } - IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); - + Status = IopAssignDeviceResources(DeviceNode); if (!NT_SUCCESS(Status)) goto ByeBye; @@ -326,21 +287,8 @@ IopStartDevice( RtlInitUnicodeString(&KeyName, L"ActiveService"); Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length); // } - - /* FIX: Should be done somewhere in resoure code? */ - if (NT_SUCCESS(Status) && DeviceNode->ResourceList) - { - RtlInitUnicodeString(&KeyName, L"AllocConfig"); - Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_RESOURCE_LIST, - DeviceNode->ResourceList, CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList)); - } ByeBye: - if (NT_SUCCESS(Status)) - IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); - else - IopDeviceNodeSetFlag(DeviceNode, DNF_START_FAILED); - if (ControlHandle != INVALID_HANDLE_VALUE) ZwClose(ControlHandle); @@ -611,8 +559,9 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode, return Status; } - /* This is for drivers passed on the command line to ntoskrnl.exe */ IopDeviceNodeSetFlag(Node, DNF_LEGACY_DRIVER); + IopDeviceNodeSetFlag(Node, DNF_ADDED); + IopDeviceNodeSetFlag(Node, DNF_STARTED); } Node->PhysicalDeviceObject = PhysicalDeviceObject; @@ -957,135 +906,6 @@ IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, return STATUS_UNSUCCESSFUL; } -NTSTATUS -IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2Key) -{ - NTSTATUS Status; - ULONG Disposition; - HANDLE PnpMgrLevel1, PnpMgrLevel2, ResourceMapKey; - UNICODE_STRING KeyName; - OBJECT_ATTRIBUTES ObjectAttributes; - - RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - 0, - NULL); - Status = ZwCreateKey(&ResourceMapKey, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_VOLATILE, - &Disposition); - if (!NT_SUCCESS(Status)) - return Status; - - RtlInitUnicodeString(&KeyName, Level1Key); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - ResourceMapKey, - NULL); - Status = ZwCreateKey(&PnpMgrLevel1, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_VOLATILE, - &Disposition); - ZwClose(ResourceMapKey); - if (!NT_SUCCESS(Status)) - return Status; - - RtlInitUnicodeString(&KeyName, Level2Key); - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE | OBJ_OPENIF, - PnpMgrLevel1, - NULL); - Status = ZwCreateKey(&PnpMgrLevel2, - KEY_ALL_ACCESS, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_VOLATILE, - &Disposition); - ZwClose(PnpMgrLevel1); - if (!NT_SUCCESS(Status)) - return Status; - - if (DeviceNode->ResourceList) - { - WCHAR NameBuff[256]; - UNICODE_STRING NameU; - UNICODE_STRING Suffix; - ULONG OldLength; - - ASSERT(DeviceNode->ResourceListTranslated); - - NameU.Buffer = NameBuff; - NameU.Length = 0; - NameU.MaximumLength = 256 * sizeof(WCHAR); - - Status = IoGetDeviceProperty(DeviceNode->PhysicalDeviceObject, - DevicePropertyPhysicalDeviceObjectName, - NameU.MaximumLength, - NameU.Buffer, - &OldLength); - ASSERT(Status == STATUS_SUCCESS); - - NameU.Length = (USHORT)OldLength; - - RtlInitUnicodeString(&Suffix, L".Raw"); - RtlAppendUnicodeStringToString(&NameU, &Suffix); - - Status = ZwSetValueKey(PnpMgrLevel2, - &NameU, - 0, - REG_RESOURCE_LIST, - DeviceNode->ResourceList, - CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList)); - if (!NT_SUCCESS(Status)) - { - ZwClose(PnpMgrLevel2); - return Status; - } - - /* "Remove" the suffix by setting the length back to what it used to be */ - NameU.Length = (USHORT)OldLength; - - RtlInitUnicodeString(&Suffix, L".Translated"); - RtlAppendUnicodeStringToString(&NameU, &Suffix); - - Status = ZwSetValueKey(PnpMgrLevel2, - &NameU, - 0, - REG_RESOURCE_LIST, - DeviceNode->ResourceListTranslated, - CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceListTranslated)); - ZwClose(PnpMgrLevel2); - if (!NT_SUCCESS(Status)) - return Status; - } - else - { - ZwClose(PnpMgrLevel2); - } - - IopDeviceNodeSetFlag(DeviceNode, DNF_RESOURCE_ASSIGNED); - - return STATUS_SUCCESS; -} - -NTSTATUS -IopUpdateResourceMapForPnPDevice(IN PDEVICE_NODE DeviceNode) -{ - return IopUpdateResourceMap(DeviceNode, L"PnP Manager", L"PnpManager"); -} - NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode) @@ -1094,7 +914,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, UNICODE_STRING KeyName; HANDLE LogConfKey; ULONG ResCount; - ULONG ListSize, ResultLength; + ULONG ResultLength; NTSTATUS Status; HANDLE ControlHandle; @@ -1122,15 +942,13 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, ResCount = DeviceNode->BootResources->Count; if (ResCount != 0) { - ListSize = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); - RtlInitUnicodeString(&KeyName, L"BootConfig"); Status = ZwSetValueKey(LogConfKey, &KeyName, 0, REG_RESOURCE_LIST, DeviceNode->BootResources, - ListSize); + IopCalculateResourceListSize(DeviceNode->BootResources)); } } @@ -1187,894 +1005,6 @@ IopSetDeviceInstanceData(HANDLE InstanceKey, return Status; } -BOOLEAN -IopCheckResourceDescriptor( - IN PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc, - IN PCM_RESOURCE_LIST ResourceList, - IN BOOLEAN Silent, - OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) -{ - ULONG i, ii; - BOOLEAN Result = FALSE; - - if (ResDesc->ShareDisposition == CmResourceShareShared) - return FALSE; - - for (i = 0; i < ResourceList->Count; i++) - { - PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList->List[i].PartialResourceList; - for (ii = 0; ii < ResList->Count; ii++) - { - PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc2 = &ResList->PartialDescriptors[ii]; - - /* We don't care about shared resources */ - if (ResDesc->ShareDisposition == CmResourceShareShared && - ResDesc2->ShareDisposition == CmResourceShareShared) - continue; - - /* Make sure we're comparing the same types */ - if (ResDesc->Type != ResDesc2->Type) - continue; - - switch (ResDesc->Type) - { - case CmResourceTypeMemory: - if ((ResDesc->u.Memory.Start.QuadPart < ResDesc2->u.Memory.Start.QuadPart && - ResDesc->u.Memory.Start.QuadPart + ResDesc->u.Memory.Length > - ResDesc2->u.Memory.Start.QuadPart) || (ResDesc2->u.Memory.Start.QuadPart < - ResDesc->u.Memory.Start.QuadPart && ResDesc2->u.Memory.Start.QuadPart + - ResDesc2->u.Memory.Length > ResDesc->u.Memory.Start.QuadPart)) - { - if (!Silent) - { - DPRINT1("Resource conflict: Memory (0x%x to 0x%x vs. 0x%x to 0x%x)\n", - ResDesc->u.Memory.Start.QuadPart, ResDesc->u.Memory.Start.QuadPart + - ResDesc->u.Memory.Length, ResDesc2->u.Memory.Start.QuadPart, - ResDesc2->u.Memory.Start.QuadPart + ResDesc2->u.Memory.Length); - } - - Result = TRUE; - - goto ByeBye; - } - break; - - case CmResourceTypePort: - if ((ResDesc->u.Port.Start.QuadPart < ResDesc2->u.Port.Start.QuadPart && - ResDesc->u.Port.Start.QuadPart + ResDesc->u.Port.Length > - ResDesc2->u.Port.Start.QuadPart) || (ResDesc2->u.Port.Start.QuadPart < - ResDesc->u.Port.Start.QuadPart && ResDesc2->u.Port.Start.QuadPart + - ResDesc2->u.Port.Length > ResDesc->u.Port.Start.QuadPart)) - { - if (!Silent) - { - DPRINT1("Resource conflict: Port (0x%x to 0x%x vs. 0x%x to 0x%x)\n", - ResDesc->u.Port.Start.QuadPart, ResDesc->u.Port.Start.QuadPart + - ResDesc->u.Port.Length, ResDesc2->u.Port.Start.QuadPart, - ResDesc2->u.Port.Start.QuadPart + ResDesc2->u.Port.Length); - } - - Result = TRUE; - - goto ByeBye; - } - break; - - case CmResourceTypeInterrupt: - if (ResDesc->u.Interrupt.Vector == ResDesc2->u.Interrupt.Vector) - { - if (!Silent) - { - DPRINT1("Resource conflict: IRQ (0x%x 0x%x vs. 0x%x 0x%x)\n", - ResDesc->u.Interrupt.Vector, ResDesc->u.Interrupt.Level, - ResDesc2->u.Interrupt.Vector, ResDesc2->u.Interrupt.Level); - } - - Result = TRUE; - - goto ByeBye; - } - break; - - case CmResourceTypeBusNumber: - if ((ResDesc->u.BusNumber.Start < ResDesc2->u.BusNumber.Start && - ResDesc->u.BusNumber.Start + ResDesc->u.BusNumber.Length > - ResDesc2->u.BusNumber.Start) || (ResDesc2->u.BusNumber.Start < - ResDesc->u.BusNumber.Start && ResDesc2->u.BusNumber.Start + - ResDesc2->u.BusNumber.Length > ResDesc->u.BusNumber.Start)) - { - if (!Silent) - { - DPRINT1("Resource conflict: Bus number (0x%x to 0x%x vs. 0x%x to 0x%x)\n", - ResDesc->u.BusNumber.Start, ResDesc->u.BusNumber.Start + - ResDesc->u.BusNumber.Length, ResDesc2->u.BusNumber.Start, - ResDesc2->u.BusNumber.Start + ResDesc2->u.BusNumber.Length); - } - - Result = TRUE; - - goto ByeBye; - } - break; - - case CmResourceTypeDma: - if (ResDesc->u.Dma.Channel == ResDesc2->u.Dma.Channel) - { - if (!Silent) - { - DPRINT1("Resource conflict: Dma (0x%x 0x%x vs. 0x%x 0x%x)\n", - ResDesc->u.Dma.Channel, ResDesc->u.Dma.Port, - ResDesc2->u.Dma.Channel, ResDesc2->u.Dma.Port); - } - - Result = TRUE; - - goto ByeBye; - } - break; - } - } - } - -ByeBye: - - if (Result && ConflictingDescriptor) - { - RtlCopyMemory(ConflictingDescriptor, - ResDesc, - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - } - - return Result; -} - - -BOOLEAN -IopCheckForResourceConflict( - IN PCM_RESOURCE_LIST ResourceList1, - IN PCM_RESOURCE_LIST ResourceList2, - IN BOOLEAN Silent, - OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) -{ - ULONG i, ii; - BOOLEAN Result = FALSE; - - for (i = 0; i < ResourceList1->Count; i++) - { - PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList1->List[i].PartialResourceList; - for (ii = 0; ii < ResList->Count; ii++) - { - PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc = &ResList->PartialDescriptors[ii]; - - Result = IopCheckResourceDescriptor(ResDesc, - ResourceList2, - Silent, - ConflictingDescriptor); - if (Result) goto ByeBye; - } - } - - -ByeBye: - - return Result; -} - -NTSTATUS -IopDetectResourceConflict( - IN PCM_RESOURCE_LIST ResourceList, - IN BOOLEAN Silent, - OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - HANDLE ResourceMapKey = INVALID_HANDLE_VALUE, ChildKey2 = INVALID_HANDLE_VALUE, ChildKey3 = INVALID_HANDLE_VALUE; - ULONG KeyInformationLength, RequiredLength, KeyValueInformationLength, KeyNameInformationLength; - PKEY_BASIC_INFORMATION KeyInformation; - PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; - PKEY_VALUE_BASIC_INFORMATION KeyNameInformation; - ULONG ChildKeyIndex1 = 0, ChildKeyIndex2 = 0, ChildKeyIndex3 = 0; - NTSTATUS Status; - - RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); - InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, 0, NULL); - Status = ZwOpenKey(&ResourceMapKey, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - /* The key is missing which means we are the first device */ - return STATUS_SUCCESS; - } - - while (TRUE) - { - Status = ZwEnumerateKey(ResourceMapKey, - ChildKeyIndex1, - KeyBasicInformation, - NULL, - 0, - &RequiredLength); - if (Status == STATUS_NO_MORE_ENTRIES) - break; - else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL) - { - KeyInformationLength = RequiredLength; - KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); - if (!KeyInformation) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - - Status = ZwEnumerateKey(ResourceMapKey, - ChildKeyIndex1, - KeyBasicInformation, - KeyInformation, - KeyInformationLength, - &RequiredLength); - } - else - goto cleanup; - ChildKeyIndex1++; - if (!NT_SUCCESS(Status)) - goto cleanup; - - KeyName.Buffer = KeyInformation->Name; - KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ResourceMapKey, - NULL); - Status = ZwOpenKey(&ChildKey2, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); - ExFreePool(KeyInformation); - if (!NT_SUCCESS(Status)) - goto cleanup; - - while (TRUE) - { - Status = ZwEnumerateKey(ChildKey2, - ChildKeyIndex2, - KeyBasicInformation, - NULL, - 0, - &RequiredLength); - if (Status == STATUS_NO_MORE_ENTRIES) - break; - else if (Status == STATUS_BUFFER_TOO_SMALL) - { - KeyInformationLength = RequiredLength; - KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); - if (!KeyInformation) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - - Status = ZwEnumerateKey(ChildKey2, - ChildKeyIndex2, - KeyBasicInformation, - KeyInformation, - KeyInformationLength, - &RequiredLength); - } - else - goto cleanup; - ChildKeyIndex2++; - if (!NT_SUCCESS(Status)) - goto cleanup; - - KeyName.Buffer = KeyInformation->Name; - KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; - InitializeObjectAttributes(&ObjectAttributes, - &KeyName, - OBJ_CASE_INSENSITIVE, - ChildKey2, - NULL); - Status = ZwOpenKey(&ChildKey3, KEY_QUERY_VALUE, &ObjectAttributes); - ExFreePool(KeyInformation); - if (!NT_SUCCESS(Status)) - goto cleanup; - - while (TRUE) - { - Status = ZwEnumerateValueKey(ChildKey3, - ChildKeyIndex3, - KeyValuePartialInformation, - NULL, - 0, - &RequiredLength); - if (Status == STATUS_NO_MORE_ENTRIES) - break; - else if (Status == STATUS_BUFFER_TOO_SMALL) - { - KeyValueInformationLength = RequiredLength; - KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength); - if (!KeyValueInformation) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - - Status = ZwEnumerateValueKey(ChildKey3, - ChildKeyIndex3, - KeyValuePartialInformation, - KeyValueInformation, - KeyValueInformationLength, - &RequiredLength); - } - else - goto cleanup; - if (!NT_SUCCESS(Status)) - goto cleanup; - - Status = ZwEnumerateValueKey(ChildKey3, - ChildKeyIndex3, - KeyValueBasicInformation, - NULL, - 0, - &RequiredLength); - if (Status == STATUS_BUFFER_TOO_SMALL) - { - KeyNameInformationLength = RequiredLength; - KeyNameInformation = ExAllocatePool(PagedPool, KeyNameInformationLength + sizeof(WCHAR)); - if (!KeyNameInformation) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - - Status = ZwEnumerateValueKey(ChildKey3, - ChildKeyIndex3, - KeyValueBasicInformation, - KeyNameInformation, - KeyNameInformationLength, - &RequiredLength); - } - else - goto cleanup; - - ChildKeyIndex3++; - - if (!NT_SUCCESS(Status)) - goto cleanup; - - KeyNameInformation->Name[KeyNameInformation->NameLength / sizeof(WCHAR)] = UNICODE_NULL; - - /* Skip translated entries */ - if (wcsstr(KeyNameInformation->Name, L".Translated")) - { - ExFreePool(KeyNameInformation); - continue; - } - - ExFreePool(KeyNameInformation); - - if (IopCheckForResourceConflict(ResourceList, - (PCM_RESOURCE_LIST)KeyValueInformation->Data, - Silent, - ConflictingDescriptor)) - { - ExFreePool(KeyValueInformation); - Status = STATUS_CONFLICTING_ADDRESSES; - goto cleanup; - } - - ExFreePool(KeyValueInformation); - } - } - } - -cleanup: - if (ResourceMapKey != INVALID_HANDLE_VALUE) - ZwClose(ResourceMapKey); - if (ChildKey2 != INVALID_HANDLE_VALUE) - ZwClose(ChildKey2); - if (ChildKey3 != INVALID_HANDLE_VALUE) - ZwClose(ChildKey3); - - if (Status == STATUS_NO_MORE_ENTRIES) - Status = STATUS_SUCCESS; - - return Status; -} - -BOOLEAN -IopCheckDescriptorForConflict(PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc, OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) -{ - CM_RESOURCE_LIST CmList; - NTSTATUS Status; - - CmList.Count = 1; - CmList.List[0].InterfaceType = InterfaceTypeUndefined; - CmList.List[0].BusNumber = 0; - CmList.List[0].PartialResourceList.Version = 1; - CmList.List[0].PartialResourceList.Revision = 1; - CmList.List[0].PartialResourceList.Count = 1; - CmList.List[0].PartialResourceList.PartialDescriptors[0] = *CmDesc; - - Status = IopDetectResourceConflict(&CmList, TRUE, ConflictingDescriptor); - if (Status == STATUS_CONFLICTING_ADDRESSES) - return TRUE; - - return FALSE; -} - -BOOLEAN -IopFindBusNumberResource( - IN PIO_RESOURCE_DESCRIPTOR IoDesc, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) -{ - ULONG Start; - CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; - - ASSERT(IoDesc->Type == CmDesc->Type); - ASSERT(IoDesc->Type == CmResourceTypeBusNumber); - - for (Start = IoDesc->u.BusNumber.MinBusNumber; - Start < IoDesc->u.BusNumber.MaxBusNumber; - Start++) - { - CmDesc->u.BusNumber.Length = IoDesc->u.BusNumber.Length; - CmDesc->u.BusNumber.Start = Start; - - if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) - { - Start += ConflictingDesc.u.BusNumber.Start + ConflictingDesc.u.BusNumber.Length; - } - else - { - return TRUE; - } - } - - return FALSE; -} - -BOOLEAN -IopFindMemoryResource( - IN PIO_RESOURCE_DESCRIPTOR IoDesc, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) -{ - ULONGLONG Start; - CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; - - ASSERT(IoDesc->Type == CmDesc->Type); - ASSERT(IoDesc->Type == CmResourceTypeMemory); - - for (Start = IoDesc->u.Memory.MinimumAddress.QuadPart; - Start < IoDesc->u.Memory.MaximumAddress.QuadPart; - Start++) - { - CmDesc->u.Memory.Length = IoDesc->u.Memory.Length; - CmDesc->u.Memory.Start.QuadPart = Start; - - if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) - { - Start += ConflictingDesc.u.Memory.Start.QuadPart + ConflictingDesc.u.Memory.Length; - } - else - { - return TRUE; - } - } - - return FALSE; -} - -BOOLEAN -IopFindPortResource( - IN PIO_RESOURCE_DESCRIPTOR IoDesc, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) -{ - ULONGLONG Start; - CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; - - ASSERT(IoDesc->Type == CmDesc->Type); - ASSERT(IoDesc->Type == CmResourceTypePort); - - for (Start = IoDesc->u.Port.MinimumAddress.QuadPart; - Start < IoDesc->u.Port.MaximumAddress.QuadPart; - Start++) - { - CmDesc->u.Port.Length = IoDesc->u.Port.Length; - CmDesc->u.Port.Start.QuadPart = Start; - - if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) - { - Start += ConflictingDesc.u.Port.Start.QuadPart + ConflictingDesc.u.Port.Length; - } - else - { - return TRUE; - } - } - - return FALSE; -} - -BOOLEAN -IopFindDmaResource( - IN PIO_RESOURCE_DESCRIPTOR IoDesc, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) -{ - ULONG Channel; - - ASSERT(IoDesc->Type == CmDesc->Type); - ASSERT(IoDesc->Type == CmResourceTypeDma); - - for (Channel = IoDesc->u.Dma.MinimumChannel; - Channel < IoDesc->u.Dma.MaximumChannel; - Channel++) - { - CmDesc->u.Dma.Channel = Channel; - CmDesc->u.Dma.Port = 0; - - if (!IopCheckDescriptorForConflict(CmDesc, NULL)) - return TRUE; - } - - return FALSE; -} - -BOOLEAN -IopFindInterruptResource( - IN PIO_RESOURCE_DESCRIPTOR IoDesc, - OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) -{ - ULONG Vector; - - ASSERT(IoDesc->Type == CmDesc->Type); - ASSERT(IoDesc->Type == CmResourceTypeInterrupt); - - for (Vector = IoDesc->u.Interrupt.MinimumVector; - Vector < IoDesc->u.Interrupt.MaximumVector; - Vector++) - { - CmDesc->u.Interrupt.Vector = Vector; - CmDesc->u.Interrupt.Level = Vector; - CmDesc->u.Interrupt.Affinity = (KAFFINITY)-1; - - if (!IopCheckDescriptorForConflict(CmDesc, NULL)) - return TRUE; - } - - return FALSE; -} - -NTSTATUS -IopCreateResourceListFromRequirements( - IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList, - OUT PCM_RESOURCE_LIST *ResourceList) -{ - ULONG i, ii, Size; - PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc; - - Size = FIELD_OFFSET(CM_RESOURCE_LIST, List); - for (i = 0; i < RequirementsList->AlternativeLists; i++) - { - PIO_RESOURCE_LIST ResList = &RequirementsList->List[i]; - Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) - + ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - } - - *ResourceList = ExAllocatePool(PagedPool, Size); - if (!*ResourceList) - return STATUS_INSUFFICIENT_RESOURCES; - - (*ResourceList)->Count = 1; - (*ResourceList)->List[0].BusNumber = RequirementsList->BusNumber; - (*ResourceList)->List[0].InterfaceType = RequirementsList->InterfaceType; - (*ResourceList)->List[0].PartialResourceList.Version = 1; - (*ResourceList)->List[0].PartialResourceList.Revision = 1; - (*ResourceList)->List[0].PartialResourceList.Count = 0; - - ResDesc = &(*ResourceList)->List[0].PartialResourceList.PartialDescriptors[0]; - - for (i = 0; i < RequirementsList->AlternativeLists; i++) - { - PIO_RESOURCE_LIST ResList = &RequirementsList->List[i]; - for (ii = 0; ii < ResList->Count; ii++) - { - PIO_RESOURCE_DESCRIPTOR ReqDesc = &ResList->Descriptors[ii]; - - /* FIXME: Handle alternate ranges */ - if (ReqDesc->Option == IO_RESOURCE_ALTERNATIVE) - continue; - - ResDesc->Type = ReqDesc->Type; - ResDesc->Flags = ReqDesc->Flags; - ResDesc->ShareDisposition = ReqDesc->ShareDisposition; - - switch (ReqDesc->Type) - { - case CmResourceTypeInterrupt: - if (!IopFindInterruptResource(ReqDesc, ResDesc)) - { - DPRINT1("Failed to find an available interrupt resource (0x%x to 0x%x)\n", - ReqDesc->u.Interrupt.MinimumVector, ReqDesc->u.Interrupt.MaximumVector); - - if (ReqDesc->Option == 0) - { - ExFreePool(*ResourceList); - return STATUS_CONFLICTING_ADDRESSES; - } - } - break; - - case CmResourceTypePort: - if (!IopFindPortResource(ReqDesc, ResDesc)) - { - DPRINT1("Failed to find an available port resource (0x%x to 0x%x length: 0x%x)\n", - ReqDesc->u.Port.MinimumAddress.QuadPart, ReqDesc->u.Port.MaximumAddress.QuadPart, - ReqDesc->u.Port.Length); - - if (ReqDesc->Option == 0) - { - ExFreePool(*ResourceList); - return STATUS_CONFLICTING_ADDRESSES; - } - } - break; - - case CmResourceTypeMemory: - if (!IopFindMemoryResource(ReqDesc, ResDesc)) - { - DPRINT1("Failed to find an available memory resource (0x%x to 0x%x length: 0x%x)\n", - ReqDesc->u.Memory.MinimumAddress.QuadPart, ReqDesc->u.Memory.MaximumAddress.QuadPart, - ReqDesc->u.Memory.Length); - - if (ReqDesc->Option == 0) - { - ExFreePool(*ResourceList); - return STATUS_CONFLICTING_ADDRESSES; - } - } - break; - - case CmResourceTypeBusNumber: - if (!IopFindBusNumberResource(ReqDesc, ResDesc)) - { - DPRINT1("Failed to find an available bus number resource (0x%x to 0x%x length: 0x%x)\n", - ReqDesc->u.BusNumber.MinBusNumber, ReqDesc->u.BusNumber.MaxBusNumber, - ReqDesc->u.BusNumber.Length); - - if (ReqDesc->Option == 0) - { - ExFreePool(*ResourceList); - return STATUS_CONFLICTING_ADDRESSES; - } - } - break; - - case CmResourceTypeDma: - if (!IopFindDmaResource(ReqDesc, ResDesc)) - { - DPRINT1("Failed to find an available dma resource (0x%x to 0x%x)\n", - ReqDesc->u.Dma.MinimumChannel, ReqDesc->u.Dma.MaximumChannel); - - if (ReqDesc->Option == 0) - { - ExFreePool(*ResourceList); - return STATUS_CONFLICTING_ADDRESSES; - } - } - break; - - default: - DPRINT1("Unsupported resource type: %x\n", ReqDesc->Type); - break; - } - - (*ResourceList)->List[0].PartialResourceList.Count++; - ResDesc++; - } - } - - return STATUS_SUCCESS; -} - -NTSTATUS -IopAssignDeviceResources( - IN PDEVICE_NODE DeviceNode, - OUT ULONG *pRequiredSize) -{ - PCM_PARTIAL_RESOURCE_LIST pPartialResourceList; - ULONG Size; - ULONG i; - ULONG j; - NTSTATUS Status; - - if (!DeviceNode->BootResources && !DeviceNode->ResourceRequirements) - { - /* No resource needed for this device */ - DeviceNode->ResourceList = NULL; - *pRequiredSize = 0; - return STATUS_SUCCESS; - } - - /* Fill DeviceNode->ResourceList - * FIXME: the PnP arbiter should go there! - * Actually, use the BootResources if provided, else the resource requirements - */ - - if (DeviceNode->BootResources) - { - /* Browse the boot resources to know if we have some custom structures */ - Size = FIELD_OFFSET(CM_RESOURCE_LIST, List); - for (i = 0; i < DeviceNode->BootResources->Count; i++) - { - pPartialResourceList = &DeviceNode->BootResources->List[i].PartialResourceList; - Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) + - pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - for (j = 0; j < pPartialResourceList->Count; j++) - { - if (pPartialResourceList->PartialDescriptors[j].Type == CmResourceTypeDeviceSpecific) - Size += pPartialResourceList->PartialDescriptors[j].u.DeviceSpecificData.DataSize; - } - } - - DeviceNode->ResourceList = ExAllocatePool(PagedPool, Size); - if (!DeviceNode->ResourceList) - { - Status = STATUS_NO_MEMORY; - goto ByeBye; - } - RtlCopyMemory(DeviceNode->ResourceList, DeviceNode->BootResources, Size); - - Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL); - if (NT_SUCCESS(Status) || !DeviceNode->ResourceRequirements) - { - if (!NT_SUCCESS(Status) && !DeviceNode->ResourceRequirements) - { - DPRINT1("Using conflicting boot resources because no requirements were supplied!\n"); - } - - *pRequiredSize = Size; - return STATUS_SUCCESS; - } - else - { - DPRINT1("Boot resources for %wZ cause a resource conflict!\n", &DeviceNode->InstancePath); - ExFreePool(DeviceNode->ResourceList); - } - } - - Status = IopCreateResourceListFromRequirements(DeviceNode->ResourceRequirements, - &DeviceNode->ResourceList); - if (!NT_SUCCESS(Status)) - goto ByeBye; - - Size = FIELD_OFFSET(CM_RESOURCE_LIST, List); - for (i = 0; i < DeviceNode->ResourceList->Count; i++) - { - pPartialResourceList = &DeviceNode->ResourceList->List[i].PartialResourceList; - Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) + - pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - } - - Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL); - if (!NT_SUCCESS(Status)) - goto ByeBye; - - *pRequiredSize = Size; - return STATUS_SUCCESS; - -ByeBye: - if (DeviceNode->ResourceList) - { - ExFreePool(DeviceNode->ResourceList); - DeviceNode->ResourceList = NULL; - } - *pRequiredSize = 0; - return Status; -} - - -NTSTATUS -IopTranslateDeviceResources( - IN PDEVICE_NODE DeviceNode, - IN ULONG RequiredSize) -{ - PCM_PARTIAL_RESOURCE_LIST pPartialResourceList; - PCM_PARTIAL_RESOURCE_DESCRIPTOR DescriptorRaw, DescriptorTranslated; - ULONG i, j; - NTSTATUS Status; - - if (!DeviceNode->ResourceList) - { - DeviceNode->ResourceListTranslated = NULL; - return STATUS_SUCCESS; - } - - /* That's easy to translate a resource list. Just copy the - * untranslated one and change few fields in the copy - */ - DeviceNode->ResourceListTranslated = ExAllocatePool(PagedPool, RequiredSize); - if (!DeviceNode->ResourceListTranslated) - { - Status =STATUS_NO_MEMORY; - goto cleanup; - } - RtlCopyMemory(DeviceNode->ResourceListTranslated, DeviceNode->ResourceList, RequiredSize); - - for (i = 0; i < DeviceNode->ResourceList->Count; i++) - { - pPartialResourceList = &DeviceNode->ResourceList->List[i].PartialResourceList; - for (j = 0; j < pPartialResourceList->Count; j++) - { - DescriptorRaw = &pPartialResourceList->PartialDescriptors[j]; - DescriptorTranslated = &DeviceNode->ResourceListTranslated->List[i].PartialResourceList.PartialDescriptors[j]; - switch (DescriptorRaw->Type) - { - case CmResourceTypePort: - { - ULONG AddressSpace = 1; /* IO space */ - if (!HalTranslateBusAddress( - DeviceNode->ResourceList->List[i].InterfaceType, - DeviceNode->ResourceList->List[i].BusNumber, - DescriptorRaw->u.Port.Start, - &AddressSpace, - &DescriptorTranslated->u.Port.Start)) - { - Status = STATUS_UNSUCCESSFUL; - goto cleanup; - } - break; - } - case CmResourceTypeInterrupt: - { - DescriptorTranslated->u.Interrupt.Vector = HalGetInterruptVector( - DeviceNode->ResourceList->List[i].InterfaceType, - DeviceNode->ResourceList->List[i].BusNumber, - DescriptorRaw->u.Interrupt.Level, - DescriptorRaw->u.Interrupt.Vector, - (PKIRQL)&DescriptorTranslated->u.Interrupt.Level, - &DescriptorRaw->u.Interrupt.Affinity); - break; - } - case CmResourceTypeMemory: - { - ULONG AddressSpace = 0; /* Memory space */ - if (!HalTranslateBusAddress( - DeviceNode->ResourceList->List[i].InterfaceType, - DeviceNode->ResourceList->List[i].BusNumber, - DescriptorRaw->u.Memory.Start, - &AddressSpace, - &DescriptorTranslated->u.Memory.Start)) - { - Status = STATUS_UNSUCCESSFUL; - goto cleanup; - } - } - - case CmResourceTypeDma: - case CmResourceTypeBusNumber: - case CmResourceTypeDeviceSpecific: - /* Nothing to do */ - break; - default: - DPRINT1("Unknown resource descriptor type 0x%x\n", DescriptorRaw->Type); - Status = STATUS_NOT_IMPLEMENTED; - goto cleanup; - } - } - } - return STATUS_SUCCESS; - -cleanup: - /* Yes! Also delete ResourceList because ResourceList and - * ResourceListTranslated should be a pair! */ - ExFreePool(DeviceNode->ResourceList); - DeviceNode->ResourceList = NULL; - if (DeviceNode->ResourceListTranslated) - { - ExFreePool(DeviceNode->ResourceListTranslated); - DeviceNode->ResourceList = NULL; - } - return Status; -} - - /* * IopGetParentIdPrefix * @@ -2608,10 +1538,6 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, { DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information; - if (IoStatusBlock.Information) - IopDeviceNodeSetFlag(DeviceNode, DNF_RESOURCE_REPORTED); - else - IopDeviceNodeSetFlag(DeviceNode, DNF_NO_RESOURCE_REQUIRED); } else { @@ -2619,7 +1545,6 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, DeviceNode->ResourceRequirements = NULL; } - if (InstanceKey != NULL) { IopSetDeviceInstanceData(InstanceKey, DeviceNode); @@ -4285,7 +3210,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, Length = 0; if (DeviceNode->BootResources->Count != 0) { - Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); + Length = IopCalculateResourceListSize(DeviceNode->BootResources); } Data = DeviceNode->BootResources; break; @@ -4295,7 +3220,7 @@ IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, Length = 0; if (DeviceNode->BootResources->Count != 0) { - Length = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); + Length = IopCalculateResourceListSize(DeviceNode->BootResources); } Data = DeviceNode->BootResources; break; diff --git a/ntoskrnl/io/pnpmgr/pnpnotify.c b/ntoskrnl/io/pnpmgr/pnpnotify.c index c328c80965f..f19f986e4e3 100644 --- a/ntoskrnl/io/pnpmgr/pnpnotify.c +++ b/ntoskrnl/io/pnpmgr/pnpnotify.c @@ -42,6 +42,8 @@ IopNotifyPlugPlayNotification( PLIST_ENTRY ListEntry; PVOID NotificationStructure; BOOLEAN CallCurrentEntry; + UNICODE_STRING GuidString; + NTSTATUS Status; ASSERT(DeviceObject); @@ -71,6 +73,13 @@ IopNotifyPlugPlayNotification( RtlCopyMemory(&NotificationInfos->Event, Event, sizeof(GUID)); RtlCopyMemory(&NotificationInfos->InterfaceClassGuid, EventCategoryData1, sizeof(GUID)); NotificationInfos->SymbolicLinkName = (PUNICODE_STRING)EventCategoryData2; + Status = RtlStringFromGUID(&NotificationInfos->InterfaceClassGuid, &GuidString); + if (!NT_SUCCESS(Status)) + { + KeReleaseGuardedMutex(&PnpNotifyListLock); + ExFreePool(NotificationStructure); + return; + } break; } case EventCategoryHardwareProfileChange: @@ -125,12 +134,17 @@ IopNotifyPlugPlayNotification( ChangeEntry = CONTAINING_RECORD(ListEntry, PNP_NOTIFY_ENTRY, PnpNotifyList); CallCurrentEntry = FALSE; + if (ChangeEntry->EventCategory != EventCategory) + { + ListEntry = ListEntry->Flink; + continue; + } + switch (EventCategory) { case EventCategoryDeviceInterfaceChange: { - if (ChangeEntry->EventCategory == EventCategory - && RtlCompareUnicodeString(&ChangeEntry->Guid, (PUNICODE_STRING)EventCategoryData1, FALSE) == 0) + if (RtlCompareUnicodeString(&ChangeEntry->Guid, &GuidString, FALSE) == 0) { CallCurrentEntry = TRUE; } @@ -174,6 +188,8 @@ IopNotifyPlugPlayNotification( } KeReleaseGuardedMutex(&PnpNotifyListLock); ExFreePoolWithTag(NotificationStructure, TAG_PNP_NOTIFY); + if (EventCategory == EventCategoryDeviceInterfaceChange) + RtlFreeUnicodeString(&GuidString); } /* PUBLIC FUNCTIONS **********************************************************/ diff --git a/ntoskrnl/io/pnpmgr/pnpreport.c b/ntoskrnl/io/pnpmgr/pnpreport.c index 4995b16fd65..f69bce02721 100644 --- a/ntoskrnl/io/pnpmgr/pnpreport.c +++ b/ntoskrnl/io/pnpmgr/pnpreport.c @@ -18,28 +18,14 @@ IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle); -NTSTATUS -IopAssignDeviceResources( - IN PDEVICE_NODE DeviceNode, - OUT ULONG *pRequiredSize); - NTSTATUS IopSetDeviceInstanceData(HANDLE InstanceKey, PDEVICE_NODE DeviceNode); -NTSTATUS -IopTranslateDeviceResources( - IN PDEVICE_NODE DeviceNode, - IN ULONG RequiredSize); - NTSTATUS IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode, PVOID Context); -NTSTATUS -IopUpdateResourceMapForPnPDevice( - IN PDEVICE_NODE DeviceNode); - NTSTATUS IopDetectResourceConflict( IN PCM_RESOURCE_LIST ResourceList); @@ -189,6 +175,11 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, /* We don't send IRP_MN_START_DEVICE */ IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); + /* We need to get device IDs */ +#if 0 + IopDeviceNodeSetFlag(DeviceNode, DNF_NEED_QUERY_IDS); +#endif + /* This is a legacy driver for this device */ IopDeviceNodeSetFlag(DeviceNode, DNF_LEGACY_DRIVER); @@ -258,9 +249,7 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, if (DeviceNode->BootResources) IopDeviceNodeSetFlag(DeviceNode, DNF_HAS_BOOT_CONFIG); - if (DeviceNode->ResourceRequirements) - IopDeviceNodeSetFlag(DeviceNode, DNF_RESOURCE_REPORTED); - else + if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources) IopDeviceNodeSetFlag(DeviceNode, DNF_NO_RESOURCE_REQUIRED); /* Write the resource information to the registry */ @@ -269,27 +258,7 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject, /* If the caller didn't get the resources assigned for us, do it now */ if (!ResourceAssigned) { - IopDeviceNodeSetFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); - Status = IopAssignDeviceResources(DeviceNode, &RequiredLength); - if (NT_SUCCESS(Status)) - { - Status = IopTranslateDeviceResources(DeviceNode, RequiredLength); - if (NT_SUCCESS(Status)) - { - Status = IopUpdateResourceMapForPnPDevice(DeviceNode); - if (NT_SUCCESS(Status) && DeviceNode->ResourceList) - { - RtlInitUnicodeString(&ValueName, L"AllocConfig"); - Status = ZwSetValueKey(InstanceKey, - &ValueName, - 0, - REG_RESOURCE_LIST, - DeviceNode->ResourceList, - CM_RESOURCE_LIST_SIZE(DeviceNode->ResourceList)); - } - } - } - IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); + Status = IopAssignDeviceResources(DeviceNode); /* See if we failed */ if (!NT_SUCCESS(Status)) diff --git a/ntoskrnl/io/pnpmgr/pnpres.c b/ntoskrnl/io/pnpmgr/pnpres.c new file mode 100644 index 00000000000..88148901112 --- /dev/null +++ b/ntoskrnl/io/pnpmgr/pnpres.c @@ -0,0 +1,1159 @@ +/* + * PROJECT: ReactOS Kernel + * COPYRIGHT: GPL - See COPYING in the top level directory + * FILE: ntoskrnl/io/pnpmgr/pnpres.c + * PURPOSE: Resource handling code + * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org) + * ReactOS Portable Systems Group + */ + +#include + +#define NDEBUG +#include + +NTSTATUS +IopDetectResourceConflict( + IN PCM_RESOURCE_LIST ResourceList, + IN BOOLEAN Silent, + OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor); + +ULONG +NTAPI +IopCalculateResourceListSize( + IN PCM_RESOURCE_LIST ResourceList) +{ + ULONG Size, i, j; + PCM_PARTIAL_RESOURCE_LIST pPartialResourceList; + + Size = FIELD_OFFSET(CM_RESOURCE_LIST, List); + for (i = 0; i < ResourceList->Count; i++) + { + pPartialResourceList = &ResourceList->List[i].PartialResourceList; + Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) + + pPartialResourceList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + for (j = 0; j < pPartialResourceList->Count; j++) + { + if (pPartialResourceList->PartialDescriptors[j].Type == CmResourceTypeDeviceSpecific) + Size += pPartialResourceList->PartialDescriptors[j].u.DeviceSpecificData.DataSize; + } + } + + return Size; +} + +static +BOOLEAN +IopCheckDescriptorForConflict(PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc, OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) +{ + CM_RESOURCE_LIST CmList; + NTSTATUS Status; + + CmList.Count = 1; + CmList.List[0].InterfaceType = InterfaceTypeUndefined; + CmList.List[0].BusNumber = 0; + CmList.List[0].PartialResourceList.Version = 1; + CmList.List[0].PartialResourceList.Revision = 1; + CmList.List[0].PartialResourceList.Count = 1; + CmList.List[0].PartialResourceList.PartialDescriptors[0] = *CmDesc; + + Status = IopDetectResourceConflict(&CmList, TRUE, ConflictingDescriptor); + if (Status == STATUS_CONFLICTING_ADDRESSES) + return TRUE; + + return FALSE; +} + +static +BOOLEAN +IopFindBusNumberResource( + IN PIO_RESOURCE_DESCRIPTOR IoDesc, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) +{ + ULONG Start; + CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; + + ASSERT(IoDesc->Type == CmDesc->Type); + ASSERT(IoDesc->Type == CmResourceTypeBusNumber); + + for (Start = IoDesc->u.BusNumber.MinBusNumber; + Start < IoDesc->u.BusNumber.MaxBusNumber; + Start++) + { + CmDesc->u.BusNumber.Length = IoDesc->u.BusNumber.Length; + CmDesc->u.BusNumber.Start = Start; + + if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) + { + Start += ConflictingDesc.u.BusNumber.Start + ConflictingDesc.u.BusNumber.Length; + } + else + { + return TRUE; + } + } + + return FALSE; +} + +static +BOOLEAN +IopFindMemoryResource( + IN PIO_RESOURCE_DESCRIPTOR IoDesc, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) +{ + ULONGLONG Start; + CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; + + ASSERT(IoDesc->Type == CmDesc->Type); + ASSERT(IoDesc->Type == CmResourceTypeMemory); + + for (Start = IoDesc->u.Memory.MinimumAddress.QuadPart; + Start < IoDesc->u.Memory.MaximumAddress.QuadPart; + Start++) + { + CmDesc->u.Memory.Length = IoDesc->u.Memory.Length; + CmDesc->u.Memory.Start.QuadPart = Start; + + if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) + { + Start += ConflictingDesc.u.Memory.Start.QuadPart + ConflictingDesc.u.Memory.Length; + } + else + { + return TRUE; + } + } + + return FALSE; +} + +static +BOOLEAN +IopFindPortResource( + IN PIO_RESOURCE_DESCRIPTOR IoDesc, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) +{ + ULONGLONG Start; + CM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDesc; + + ASSERT(IoDesc->Type == CmDesc->Type); + ASSERT(IoDesc->Type == CmResourceTypePort); + + for (Start = IoDesc->u.Port.MinimumAddress.QuadPart; + Start < IoDesc->u.Port.MaximumAddress.QuadPart; + Start++) + { + CmDesc->u.Port.Length = IoDesc->u.Port.Length; + CmDesc->u.Port.Start.QuadPart = Start; + + if (IopCheckDescriptorForConflict(CmDesc, &ConflictingDesc)) + { + Start += ConflictingDesc.u.Port.Start.QuadPart + ConflictingDesc.u.Port.Length; + } + else + { + return TRUE; + } + } + + return FALSE; +} + +static +BOOLEAN +IopFindDmaResource( + IN PIO_RESOURCE_DESCRIPTOR IoDesc, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) +{ + ULONG Channel; + + ASSERT(IoDesc->Type == CmDesc->Type); + ASSERT(IoDesc->Type == CmResourceTypeDma); + + for (Channel = IoDesc->u.Dma.MinimumChannel; + Channel < IoDesc->u.Dma.MaximumChannel; + Channel++) + { + CmDesc->u.Dma.Channel = Channel; + CmDesc->u.Dma.Port = 0; + + if (!IopCheckDescriptorForConflict(CmDesc, NULL)) + return TRUE; + } + + return FALSE; +} + +static +BOOLEAN +IopFindInterruptResource( + IN PIO_RESOURCE_DESCRIPTOR IoDesc, + OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDesc) +{ + ULONG Vector; + + ASSERT(IoDesc->Type == CmDesc->Type); + ASSERT(IoDesc->Type == CmResourceTypeInterrupt); + + for (Vector = IoDesc->u.Interrupt.MinimumVector; + Vector < IoDesc->u.Interrupt.MaximumVector; + Vector++) + { + CmDesc->u.Interrupt.Vector = Vector; + CmDesc->u.Interrupt.Level = Vector; + CmDesc->u.Interrupt.Affinity = (KAFFINITY)-1; + + if (!IopCheckDescriptorForConflict(CmDesc, NULL)) + return TRUE; + } + + return FALSE; +} + +static +NTSTATUS +IopCreateResourceListFromRequirements( + IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList, + OUT PCM_RESOURCE_LIST *ResourceList) +{ + ULONG i, ii, Size; + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc; + + Size = FIELD_OFFSET(CM_RESOURCE_LIST, List); + for (i = 0; i < RequirementsList->AlternativeLists; i++) + { + PIO_RESOURCE_LIST ResList = &RequirementsList->List[i]; + Size += FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) + + ResList->Count * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + } + + *ResourceList = ExAllocatePool(PagedPool, Size); + if (!*ResourceList) + return STATUS_INSUFFICIENT_RESOURCES; + + (*ResourceList)->Count = 1; + (*ResourceList)->List[0].BusNumber = RequirementsList->BusNumber; + (*ResourceList)->List[0].InterfaceType = RequirementsList->InterfaceType; + (*ResourceList)->List[0].PartialResourceList.Version = 1; + (*ResourceList)->List[0].PartialResourceList.Revision = 1; + (*ResourceList)->List[0].PartialResourceList.Count = 0; + + ResDesc = &(*ResourceList)->List[0].PartialResourceList.PartialDescriptors[0]; + + for (i = 0; i < RequirementsList->AlternativeLists; i++) + { + PIO_RESOURCE_LIST ResList = &RequirementsList->List[i]; + for (ii = 0; ii < ResList->Count; ii++) + { + PIO_RESOURCE_DESCRIPTOR ReqDesc = &ResList->Descriptors[ii]; + + /* FIXME: Handle alternate ranges */ + if (ReqDesc->Option == IO_RESOURCE_ALTERNATIVE) + continue; + + ResDesc->Type = ReqDesc->Type; + ResDesc->Flags = ReqDesc->Flags; + ResDesc->ShareDisposition = ReqDesc->ShareDisposition; + + switch (ReqDesc->Type) + { + case CmResourceTypeInterrupt: + if (!IopFindInterruptResource(ReqDesc, ResDesc)) + { + DPRINT1("Failed to find an available interrupt resource (0x%x to 0x%x)\n", + ReqDesc->u.Interrupt.MinimumVector, ReqDesc->u.Interrupt.MaximumVector); + + if (ReqDesc->Option == 0) + { + ExFreePool(*ResourceList); + return STATUS_CONFLICTING_ADDRESSES; + } + } + break; + + case CmResourceTypePort: + if (!IopFindPortResource(ReqDesc, ResDesc)) + { + DPRINT1("Failed to find an available port resource (0x%x to 0x%x length: 0x%x)\n", + ReqDesc->u.Port.MinimumAddress.QuadPart, ReqDesc->u.Port.MaximumAddress.QuadPart, + ReqDesc->u.Port.Length); + + if (ReqDesc->Option == 0) + { + ExFreePool(*ResourceList); + return STATUS_CONFLICTING_ADDRESSES; + } + } + break; + + case CmResourceTypeMemory: + if (!IopFindMemoryResource(ReqDesc, ResDesc)) + { + DPRINT1("Failed to find an available memory resource (0x%x to 0x%x length: 0x%x)\n", + ReqDesc->u.Memory.MinimumAddress.QuadPart, ReqDesc->u.Memory.MaximumAddress.QuadPart, + ReqDesc->u.Memory.Length); + + if (ReqDesc->Option == 0) + { + ExFreePool(*ResourceList); + return STATUS_CONFLICTING_ADDRESSES; + } + } + break; + + case CmResourceTypeBusNumber: + if (!IopFindBusNumberResource(ReqDesc, ResDesc)) + { + DPRINT1("Failed to find an available bus number resource (0x%x to 0x%x length: 0x%x)\n", + ReqDesc->u.BusNumber.MinBusNumber, ReqDesc->u.BusNumber.MaxBusNumber, + ReqDesc->u.BusNumber.Length); + + if (ReqDesc->Option == 0) + { + ExFreePool(*ResourceList); + return STATUS_CONFLICTING_ADDRESSES; + } + } + break; + + case CmResourceTypeDma: + if (!IopFindDmaResource(ReqDesc, ResDesc)) + { + DPRINT1("Failed to find an available dma resource (0x%x to 0x%x)\n", + ReqDesc->u.Dma.MinimumChannel, ReqDesc->u.Dma.MaximumChannel); + + if (ReqDesc->Option == 0) + { + ExFreePool(*ResourceList); + return STATUS_CONFLICTING_ADDRESSES; + } + } + break; + + default: + DPRINT1("Unsupported resource type: %x\n", ReqDesc->Type); + break; + } + + (*ResourceList)->List[0].PartialResourceList.Count++; + ResDesc++; + } + } + + return STATUS_SUCCESS; +} + +static +BOOLEAN +IopCheckResourceDescriptor( + IN PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc, + IN PCM_RESOURCE_LIST ResourceList, + IN BOOLEAN Silent, + OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) +{ + ULONG i, ii; + BOOLEAN Result = FALSE; + + if (ResDesc->ShareDisposition == CmResourceShareShared) + return FALSE; + + for (i = 0; i < ResourceList->Count; i++) + { + PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList->List[i].PartialResourceList; + for (ii = 0; ii < ResList->Count; ii++) + { + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc2 = &ResList->PartialDescriptors[ii]; + + /* We don't care about shared resources */ + if (ResDesc->ShareDisposition == CmResourceShareShared && + ResDesc2->ShareDisposition == CmResourceShareShared) + continue; + + /* Make sure we're comparing the same types */ + if (ResDesc->Type != ResDesc2->Type) + continue; + + switch (ResDesc->Type) + { + case CmResourceTypeMemory: + if ((ResDesc->u.Memory.Start.QuadPart < ResDesc2->u.Memory.Start.QuadPart && + ResDesc->u.Memory.Start.QuadPart + ResDesc->u.Memory.Length > + ResDesc2->u.Memory.Start.QuadPart) || (ResDesc2->u.Memory.Start.QuadPart < + ResDesc->u.Memory.Start.QuadPart && ResDesc2->u.Memory.Start.QuadPart + + ResDesc2->u.Memory.Length > ResDesc->u.Memory.Start.QuadPart)) + { + if (!Silent) + { + DPRINT1("Resource conflict: Memory (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc->u.Memory.Start.QuadPart, ResDesc->u.Memory.Start.QuadPart + + ResDesc->u.Memory.Length, ResDesc2->u.Memory.Start.QuadPart, + ResDesc2->u.Memory.Start.QuadPart + ResDesc2->u.Memory.Length); + } + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypePort: + if ((ResDesc->u.Port.Start.QuadPart < ResDesc2->u.Port.Start.QuadPart && + ResDesc->u.Port.Start.QuadPart + ResDesc->u.Port.Length > + ResDesc2->u.Port.Start.QuadPart) || (ResDesc2->u.Port.Start.QuadPart < + ResDesc->u.Port.Start.QuadPart && ResDesc2->u.Port.Start.QuadPart + + ResDesc2->u.Port.Length > ResDesc->u.Port.Start.QuadPart)) + { + if (!Silent) + { + DPRINT1("Resource conflict: Port (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc->u.Port.Start.QuadPart, ResDesc->u.Port.Start.QuadPart + + ResDesc->u.Port.Length, ResDesc2->u.Port.Start.QuadPart, + ResDesc2->u.Port.Start.QuadPart + ResDesc2->u.Port.Length); + } + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeInterrupt: + if (ResDesc->u.Interrupt.Vector == ResDesc2->u.Interrupt.Vector) + { + if (!Silent) + { + DPRINT1("Resource conflict: IRQ (0x%x 0x%x vs. 0x%x 0x%x)\n", + ResDesc->u.Interrupt.Vector, ResDesc->u.Interrupt.Level, + ResDesc2->u.Interrupt.Vector, ResDesc2->u.Interrupt.Level); + } + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeBusNumber: + if ((ResDesc->u.BusNumber.Start < ResDesc2->u.BusNumber.Start && + ResDesc->u.BusNumber.Start + ResDesc->u.BusNumber.Length > + ResDesc2->u.BusNumber.Start) || (ResDesc2->u.BusNumber.Start < + ResDesc->u.BusNumber.Start && ResDesc2->u.BusNumber.Start + + ResDesc2->u.BusNumber.Length > ResDesc->u.BusNumber.Start)) + { + if (!Silent) + { + DPRINT1("Resource conflict: Bus number (0x%x to 0x%x vs. 0x%x to 0x%x)\n", + ResDesc->u.BusNumber.Start, ResDesc->u.BusNumber.Start + + ResDesc->u.BusNumber.Length, ResDesc2->u.BusNumber.Start, + ResDesc2->u.BusNumber.Start + ResDesc2->u.BusNumber.Length); + } + + Result = TRUE; + + goto ByeBye; + } + break; + + case CmResourceTypeDma: + if (ResDesc->u.Dma.Channel == ResDesc2->u.Dma.Channel) + { + if (!Silent) + { + DPRINT1("Resource conflict: Dma (0x%x 0x%x vs. 0x%x 0x%x)\n", + ResDesc->u.Dma.Channel, ResDesc->u.Dma.Port, + ResDesc2->u.Dma.Channel, ResDesc2->u.Dma.Port); + } + + Result = TRUE; + + goto ByeBye; + } + break; + } + } + } + +ByeBye: + + if (Result && ConflictingDescriptor) + { + RtlCopyMemory(ConflictingDescriptor, + ResDesc, + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + } + + return Result; +} + +static +NTSTATUS +IopUpdateControlKeyWithResources(IN PDEVICE_NODE DeviceNode) +{ + UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT); + UNICODE_STRING Control = RTL_CONSTANT_STRING(L"Control"); + UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"AllocConfig"); + HANDLE EnumKey, InstanceKey, ControlKey; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + + /* Open the Enum key */ + Status = IopOpenRegistryKeyEx(&EnumKey, NULL, &EnumRoot, KEY_ENUMERATE_SUB_KEYS); + if (!NT_SUCCESS(Status)) + return Status; + + /* Open the instance key (eg. Root\PNP0A03) */ + Status = IopOpenRegistryKeyEx(&InstanceKey, EnumKey, &DeviceNode->InstancePath, KEY_ENUMERATE_SUB_KEYS); + ZwClose(EnumKey); + + if (!NT_SUCCESS(Status)) + return Status; + + /* Create/Open the Control key */ + InitializeObjectAttributes(&ObjectAttributes, + &Control, + OBJ_CASE_INSENSITIVE, + InstanceKey, + NULL); + Status = ZwCreateKey(&ControlKey, + KEY_SET_VALUE, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + NULL); + ZwClose(InstanceKey); + + if (!NT_SUCCESS(Status)) + return Status; + + /* Write the resource list */ + Status = ZwSetValueKey(ControlKey, + &ValueName, + 0, + REG_RESOURCE_LIST, + DeviceNode->ResourceList, + IopCalculateResourceListSize(DeviceNode->ResourceList)); + ZwClose(ControlKey); + + if (!NT_SUCCESS(Status)) + return Status; + + return STATUS_SUCCESS; +} + +static +NTSTATUS +IopFilterResourceRequirements(IN PDEVICE_NODE DeviceNode) +{ + IO_STACK_LOCATION Stack; + IO_STATUS_BLOCK IoStatusBlock; + NTSTATUS Status; + + DPRINT("Sending IRP_MN_FILTER_RESOURCE_REQUIREMENTS to device stack\n"); + + Stack.Parameters.FilterResourceRequirements.IoResourceRequirementList = DeviceNode->ResourceRequirements; + Status = IopInitiatePnpIrp( + DeviceNode->PhysicalDeviceObject, + &IoStatusBlock, + IRP_MN_FILTER_RESOURCE_REQUIREMENTS, + &Stack); + if (!NT_SUCCESS(Status) && Status != STATUS_NOT_SUPPORTED) + { + DPRINT("IopInitiatePnpIrp(IRP_MN_FILTER_RESOURCE_REQUIREMENTS) failed\n"); + return Status; + } + else if (NT_SUCCESS(Status)) + { + DeviceNode->ResourceRequirements = (PIO_RESOURCE_REQUIREMENTS_LIST)IoStatusBlock.Information; + } + + return STATUS_SUCCESS; +} + + +NTSTATUS +IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2Key) +{ + NTSTATUS Status; + ULONG Disposition; + HANDLE PnpMgrLevel1, PnpMgrLevel2, ResourceMapKey; + UNICODE_STRING KeyName; + OBJECT_ATTRIBUTES ObjectAttributes; + + RtlInitUnicodeString(&KeyName, + L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_OPENIF, + 0, + NULL); + Status = ZwCreateKey(&ResourceMapKey, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + if (!NT_SUCCESS(Status)) + return Status; + + RtlInitUnicodeString(&KeyName, Level1Key); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_OPENIF, + ResourceMapKey, + NULL); + Status = ZwCreateKey(&PnpMgrLevel1, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + ZwClose(ResourceMapKey); + if (!NT_SUCCESS(Status)) + return Status; + + RtlInitUnicodeString(&KeyName, Level2Key); + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE | OBJ_OPENIF, + PnpMgrLevel1, + NULL); + Status = ZwCreateKey(&PnpMgrLevel2, + KEY_ALL_ACCESS, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_VOLATILE, + &Disposition); + ZwClose(PnpMgrLevel1); + if (!NT_SUCCESS(Status)) + return Status; + + if (DeviceNode->ResourceList) + { + WCHAR NameBuff[256]; + UNICODE_STRING NameU; + UNICODE_STRING Suffix; + ULONG OldLength; + + ASSERT(DeviceNode->ResourceListTranslated); + + NameU.Buffer = NameBuff; + NameU.Length = 0; + NameU.MaximumLength = 256 * sizeof(WCHAR); + + Status = IoGetDeviceProperty(DeviceNode->PhysicalDeviceObject, + DevicePropertyPhysicalDeviceObjectName, + NameU.MaximumLength, + NameU.Buffer, + &OldLength); + ASSERT(Status == STATUS_SUCCESS); + + NameU.Length = (USHORT)OldLength; + + RtlInitUnicodeString(&Suffix, L".Raw"); + RtlAppendUnicodeStringToString(&NameU, &Suffix); + + Status = ZwSetValueKey(PnpMgrLevel2, + &NameU, + 0, + REG_RESOURCE_LIST, + DeviceNode->ResourceList, + IopCalculateResourceListSize(DeviceNode->ResourceList)); + if (!NT_SUCCESS(Status)) + { + ZwClose(PnpMgrLevel2); + return Status; + } + + /* "Remove" the suffix by setting the length back to what it used to be */ + NameU.Length = (USHORT)OldLength; + + RtlInitUnicodeString(&Suffix, L".Translated"); + RtlAppendUnicodeStringToString(&NameU, &Suffix); + + Status = ZwSetValueKey(PnpMgrLevel2, + &NameU, + 0, + REG_RESOURCE_LIST, + DeviceNode->ResourceListTranslated, + IopCalculateResourceListSize(DeviceNode->ResourceListTranslated)); + ZwClose(PnpMgrLevel2); + if (!NT_SUCCESS(Status)) + return Status; + } + else + { + ZwClose(PnpMgrLevel2); + } + + return STATUS_SUCCESS; +} + +NTSTATUS +IopUpdateResourceMapForPnPDevice(IN PDEVICE_NODE DeviceNode) +{ + return IopUpdateResourceMap(DeviceNode, L"PnP Manager", L"PnpManager"); +} + +static +NTSTATUS +IopTranslateDeviceResources( + IN PDEVICE_NODE DeviceNode) +{ + PCM_PARTIAL_RESOURCE_LIST pPartialResourceList; + PCM_PARTIAL_RESOURCE_DESCRIPTOR DescriptorRaw, DescriptorTranslated; + ULONG i, j, ListSize; + NTSTATUS Status; + + if (!DeviceNode->ResourceList) + { + DeviceNode->ResourceListTranslated = NULL; + return STATUS_SUCCESS; + } + + /* That's easy to translate a resource list. Just copy the + * untranslated one and change few fields in the copy + */ + ListSize = IopCalculateResourceListSize(DeviceNode->ResourceList); + + DeviceNode->ResourceListTranslated = ExAllocatePool(PagedPool, ListSize); + if (!DeviceNode->ResourceListTranslated) + { + Status =STATUS_NO_MEMORY; + goto cleanup; + } + RtlCopyMemory(DeviceNode->ResourceListTranslated, DeviceNode->ResourceList, ListSize); + + for (i = 0; i < DeviceNode->ResourceList->Count; i++) + { + pPartialResourceList = &DeviceNode->ResourceList->List[i].PartialResourceList; + for (j = 0; j < pPartialResourceList->Count; j++) + { + DescriptorRaw = &pPartialResourceList->PartialDescriptors[j]; + DescriptorTranslated = &DeviceNode->ResourceListTranslated->List[i].PartialResourceList.PartialDescriptors[j]; + switch (DescriptorRaw->Type) + { + case CmResourceTypePort: + { + ULONG AddressSpace = 1; /* IO space */ + if (!HalTranslateBusAddress( + DeviceNode->ResourceList->List[i].InterfaceType, + DeviceNode->ResourceList->List[i].BusNumber, + DescriptorRaw->u.Port.Start, + &AddressSpace, + &DescriptorTranslated->u.Port.Start)) + { + Status = STATUS_UNSUCCESSFUL; + goto cleanup; + } + break; + } + case CmResourceTypeInterrupt: + { + DescriptorTranslated->u.Interrupt.Vector = HalGetInterruptVector( + DeviceNode->ResourceList->List[i].InterfaceType, + DeviceNode->ResourceList->List[i].BusNumber, + DescriptorRaw->u.Interrupt.Level, + DescriptorRaw->u.Interrupt.Vector, + (PKIRQL)&DescriptorTranslated->u.Interrupt.Level, + &DescriptorRaw->u.Interrupt.Affinity); + break; + } + case CmResourceTypeMemory: + { + ULONG AddressSpace = 0; /* Memory space */ + if (!HalTranslateBusAddress( + DeviceNode->ResourceList->List[i].InterfaceType, + DeviceNode->ResourceList->List[i].BusNumber, + DescriptorRaw->u.Memory.Start, + &AddressSpace, + &DescriptorTranslated->u.Memory.Start)) + { + Status = STATUS_UNSUCCESSFUL; + goto cleanup; + } + } + + case CmResourceTypeDma: + case CmResourceTypeBusNumber: + case CmResourceTypeDeviceSpecific: + /* Nothing to do */ + break; + default: + DPRINT1("Unknown resource descriptor type 0x%x\n", DescriptorRaw->Type); + Status = STATUS_NOT_IMPLEMENTED; + goto cleanup; + } + } + } + return STATUS_SUCCESS; + +cleanup: + /* Yes! Also delete ResourceList because ResourceList and + * ResourceListTranslated should be a pair! */ + ExFreePool(DeviceNode->ResourceList); + DeviceNode->ResourceList = NULL; + if (DeviceNode->ResourceListTranslated) + { + ExFreePool(DeviceNode->ResourceListTranslated); + DeviceNode->ResourceList = NULL; + } + return Status; +} + +NTSTATUS +NTAPI +IopAssignDeviceResources( + IN PDEVICE_NODE DeviceNode) +{ + NTSTATUS Status; + ULONG ListSize; + + IopDeviceNodeSetFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); + + Status = IopFilterResourceRequirements(DeviceNode); + if (!NT_SUCCESS(Status)) + goto ByeBye; + + if (!DeviceNode->BootResources && !DeviceNode->ResourceRequirements) + { + DeviceNode->Flags |= DNF_NO_RESOURCE_REQUIRED; + DeviceNode->Flags &= ~DNF_ASSIGNING_RESOURCES; + + /* No resource needed for this device */ + DeviceNode->ResourceList = NULL; + DeviceNode->ResourceListTranslated = NULL; + + return STATUS_SUCCESS; + } + + /* Fill DeviceNode->ResourceList + * FIXME: the PnP arbiter should go there! + * Actually, use the BootResources if provided, else the resource requirements + */ + + if (DeviceNode->BootResources) + { + ListSize = IopCalculateResourceListSize(DeviceNode->BootResources); + + DeviceNode->ResourceList = ExAllocatePool(PagedPool, ListSize); + if (!DeviceNode->ResourceList) + { + Status = STATUS_NO_MEMORY; + goto ByeBye; + } + RtlCopyMemory(DeviceNode->ResourceList, DeviceNode->BootResources, ListSize); + + Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL); + if (NT_SUCCESS(Status) || !DeviceNode->ResourceRequirements) + { + if (!NT_SUCCESS(Status) && !DeviceNode->ResourceRequirements) + { + DPRINT1("Using conflicting boot resources because no requirements were supplied!\n"); + } + + goto Finish; + } + else + { + DPRINT1("Boot resources for %wZ cause a resource conflict!\n", &DeviceNode->InstancePath); + ExFreePool(DeviceNode->ResourceList); + } + } + + Status = IopCreateResourceListFromRequirements(DeviceNode->ResourceRequirements, + &DeviceNode->ResourceList); + if (!NT_SUCCESS(Status)) + goto ByeBye; + + Status = IopDetectResourceConflict(DeviceNode->ResourceList, FALSE, NULL); + if (!NT_SUCCESS(Status)) + goto ByeBye; + +Finish: + Status = IopTranslateDeviceResources(DeviceNode); + if (!NT_SUCCESS(Status)) + goto ByeBye; + + Status = IopUpdateResourceMapForPnPDevice(DeviceNode); + if (!NT_SUCCESS(Status)) + goto ByeBye; + + Status = IopUpdateControlKeyWithResources(DeviceNode); + if (!NT_SUCCESS(Status)) + goto ByeBye; + + IopDeviceNodeSetFlag(DeviceNode, DNF_RESOURCE_ASSIGNED); + + IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); + + return STATUS_SUCCESS; + +ByeBye: + if (DeviceNode->ResourceList) + { + ExFreePool(DeviceNode->ResourceList); + DeviceNode->ResourceList = NULL; + } + + DeviceNode->ResourceListTranslated = NULL; + + IopDeviceNodeClearFlag(DeviceNode, DNF_ASSIGNING_RESOURCES); + + return Status; +} + +static +BOOLEAN +IopCheckForResourceConflict( + IN PCM_RESOURCE_LIST ResourceList1, + IN PCM_RESOURCE_LIST ResourceList2, + IN BOOLEAN Silent, + OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) +{ + ULONG i, ii; + BOOLEAN Result = FALSE; + + for (i = 0; i < ResourceList1->Count; i++) + { + PCM_PARTIAL_RESOURCE_LIST ResList = &ResourceList1->List[i].PartialResourceList; + for (ii = 0; ii < ResList->Count; ii++) + { + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResDesc = &ResList->PartialDescriptors[ii]; + + Result = IopCheckResourceDescriptor(ResDesc, + ResourceList2, + Silent, + ConflictingDescriptor); + if (Result) goto ByeBye; + } + } + + +ByeBye: + + return Result; +} + +NTSTATUS +IopDetectResourceConflict( + IN PCM_RESOURCE_LIST ResourceList, + IN BOOLEAN Silent, + OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName; + HANDLE ResourceMapKey = INVALID_HANDLE_VALUE, ChildKey2 = INVALID_HANDLE_VALUE, ChildKey3 = INVALID_HANDLE_VALUE; + ULONG KeyInformationLength, RequiredLength, KeyValueInformationLength, KeyNameInformationLength; + PKEY_BASIC_INFORMATION KeyInformation; + PKEY_VALUE_PARTIAL_INFORMATION KeyValueInformation; + PKEY_VALUE_BASIC_INFORMATION KeyNameInformation; + ULONG ChildKeyIndex1 = 0, ChildKeyIndex2 = 0, ChildKeyIndex3 = 0; + NTSTATUS Status; + + RtlInitUnicodeString(&KeyName, L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP"); + InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, 0, NULL); + Status = ZwOpenKey(&ResourceMapKey, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); + if (!NT_SUCCESS(Status)) + { + /* The key is missing which means we are the first device */ + return STATUS_SUCCESS; + } + + while (TRUE) + { + Status = ZwEnumerateKey(ResourceMapKey, + ChildKeyIndex1, + KeyBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_OVERFLOW || Status == STATUS_BUFFER_TOO_SMALL) + { + KeyInformationLength = RequiredLength; + KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + if (!KeyInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateKey(ResourceMapKey, + ChildKeyIndex1, + KeyBasicInformation, + KeyInformation, + KeyInformationLength, + &RequiredLength); + } + else + goto cleanup; + ChildKeyIndex1++; + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyName.Buffer = KeyInformation->Name; + KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ResourceMapKey, + NULL); + Status = ZwOpenKey(&ChildKey2, KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &ObjectAttributes); + ExFreePool(KeyInformation); + if (!NT_SUCCESS(Status)) + goto cleanup; + + while (TRUE) + { + Status = ZwEnumerateKey(ChildKey2, + ChildKeyIndex2, + KeyBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyInformationLength = RequiredLength; + KeyInformation = ExAllocatePool(PagedPool, KeyInformationLength); + if (!KeyInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateKey(ChildKey2, + ChildKeyIndex2, + KeyBasicInformation, + KeyInformation, + KeyInformationLength, + &RequiredLength); + } + else + goto cleanup; + ChildKeyIndex2++; + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyName.Buffer = KeyInformation->Name; + KeyName.MaximumLength = KeyName.Length = KeyInformation->NameLength; + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + ChildKey2, + NULL); + Status = ZwOpenKey(&ChildKey3, KEY_QUERY_VALUE, &ObjectAttributes); + ExFreePool(KeyInformation); + if (!NT_SUCCESS(Status)) + goto cleanup; + + while (TRUE) + { + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValuePartialInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_NO_MORE_ENTRIES) + break; + else if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyValueInformationLength = RequiredLength; + KeyValueInformation = ExAllocatePool(PagedPool, KeyValueInformationLength); + if (!KeyValueInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValuePartialInformation, + KeyValueInformation, + KeyValueInformationLength, + &RequiredLength); + } + else + goto cleanup; + if (!NT_SUCCESS(Status)) + goto cleanup; + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValueBasicInformation, + NULL, + 0, + &RequiredLength); + if (Status == STATUS_BUFFER_TOO_SMALL) + { + KeyNameInformationLength = RequiredLength; + KeyNameInformation = ExAllocatePool(PagedPool, KeyNameInformationLength + sizeof(WCHAR)); + if (!KeyNameInformation) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + + Status = ZwEnumerateValueKey(ChildKey3, + ChildKeyIndex3, + KeyValueBasicInformation, + KeyNameInformation, + KeyNameInformationLength, + &RequiredLength); + } + else + goto cleanup; + + ChildKeyIndex3++; + + if (!NT_SUCCESS(Status)) + goto cleanup; + + KeyNameInformation->Name[KeyNameInformation->NameLength / sizeof(WCHAR)] = UNICODE_NULL; + + /* Skip translated entries */ + if (wcsstr(KeyNameInformation->Name, L".Translated")) + { + ExFreePool(KeyNameInformation); + continue; + } + + ExFreePool(KeyNameInformation); + + if (IopCheckForResourceConflict(ResourceList, + (PCM_RESOURCE_LIST)KeyValueInformation->Data, + Silent, + ConflictingDescriptor)) + { + ExFreePool(KeyValueInformation); + Status = STATUS_CONFLICTING_ADDRESSES; + goto cleanup; + } + + ExFreePool(KeyValueInformation); + } + } + } + +cleanup: + if (ResourceMapKey != INVALID_HANDLE_VALUE) + ZwClose(ResourceMapKey); + if (ChildKey2 != INVALID_HANDLE_VALUE) + ZwClose(ChildKey2); + if (ChildKey3 != INVALID_HANDLE_VALUE) + ZwClose(ChildKey3); + + if (Status == STATUS_NO_MORE_ENTRIES) + Status = STATUS_SUCCESS; + + return Status; +} + diff --git a/ntoskrnl/io/pnpmgr/pnproot.c b/ntoskrnl/io/pnpmgr/pnproot.c index 30c612f1fc3..6f1834e5298 100644 --- a/ntoskrnl/io/pnpmgr/pnproot.c +++ b/ntoskrnl/io/pnpmgr/pnproot.c @@ -1069,6 +1069,11 @@ PnpRootPdoPnpControl( DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n"); break; + case IRP_MN_REMOVE_DEVICE: + DPRINT1("IRP_MN_REMOVE_DEVICE is UNIMPLEMENTED!\n"); + Status = STATUS_SUCCESS; + break; + case IRP_MN_QUERY_ID: /* 0x13 */ Status = PdoQueryId(DeviceObject, Irp, IrpSp); break; diff --git a/ntoskrnl/kd/kdinit.c b/ntoskrnl/kd/kdinit.c index aae380e922a..5fcc0ee8cd2 100644 --- a/ntoskrnl/kd/kdinit.c +++ b/ntoskrnl/kd/kdinit.c @@ -166,20 +166,19 @@ KdInitSystem(ULONG BootPhase, /* XXX Check for settings that we support */ if (strstr(CommandLine, "BREAK")) KdpEarlyBreak = TRUE; if (strstr(CommandLine, "NODEBUG")) KdDebuggerEnabled = FALSE; - if (strstr(CommandLine, "CRASHDEBUG")) KdDebuggerEnabled = FALSE; - if (strstr(CommandLine, "DEBUG")) + else if (strstr(CommandLine, "CRASHDEBUG")) KdDebuggerEnabled = FALSE; + else if (strstr(CommandLine, "DEBUG")) { /* Enable on the serial port */ KdDebuggerEnabled = TRUE; + KdDebuggerNotPresent = FALSE; KdpDebugMode.Serial = TRUE; - } #ifdef KDBG - /* Get the KDBG Settings and enable it */ - KdDebuggerEnabled = TRUE; - KdDebuggerNotPresent = FALSE; - KdbpGetCommandLineSettings(LoaderBlock->LoadOptions); + /* Get the KDBG Settings */ + KdbpGetCommandLineSettings(LoaderBlock->LoadOptions); #endif + } /* Get the port and baud rate */ Port = strstr(CommandLine, "DEBUGPORT"); diff --git a/ntoskrnl/kdbg/kdb.c b/ntoskrnl/kdbg/kdb.c index 058e1128e0e..9fb099c8b10 100644 --- a/ntoskrnl/kdbg/kdb.c +++ b/ntoskrnl/kdbg/kdb.c @@ -1697,7 +1697,7 @@ KdbpGetCommandLineSettings( while (p1 && (p2 = strchr(p1, ' '))) { - p2++; + p2 += 2; if (!_strnicmp(p2, "KDSERIAL", 8)) { diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index fa42826c9fa..5583ecec639 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -823,7 +823,8 @@ KdbpCmdBackTrace( break; } - if (!KdbSymPrintAddress((PVOID)Address)) + /* Print the location of the call instruction */ + if (!KdbSymPrintAddress((PVOID)(Address - 5))) KdbpPrint("<%08x>\n", Address); else KdbpPrint("\n"); @@ -1222,7 +1223,13 @@ KdbpCmdThread( str2 = ""; } - if (Thread->Tcb.TrapFrame) + if (!Thread->Tcb.InitialStack) + { + /* Thread has no kernel stack (probably terminated) */ + Esp = Ebp = NULL; + Eip = 0; + } + else if (Thread->Tcb.TrapFrame) { if (Thread->Tcb.TrapFrame->PreviousPreviousMode == KernelMode) Esp = (PULONG)Thread->Tcb.TrapFrame->TempEsp; diff --git a/ntoskrnl/ke/i386/exp.c b/ntoskrnl/ke/i386/exp.c index 284ff19e3bf..38dded77062 100644 --- a/ntoskrnl/ke/i386/exp.c +++ b/ntoskrnl/ke/i386/exp.c @@ -584,7 +584,7 @@ KeContextToTrapFrame(IN PCONTEXT Context, } /* Handle the Debug Registers */ - if ((ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS) + if (0 && (ContextFlags & CONTEXT_DEBUG_REGISTERS) == CONTEXT_DEBUG_REGISTERS) { /* Loop DR registers */ for (i = 0; i < 4; i++) diff --git a/ntoskrnl/ke/i386/irqobj.c b/ntoskrnl/ke/i386/irqobj.c index 10170134d82..fca5bdc4cc5 100644 --- a/ntoskrnl/ke/i386/irqobj.c +++ b/ntoskrnl/ke/i386/irqobj.c @@ -251,7 +251,7 @@ KiChainedDispatch(IN PKTRAP_FRAME TrapFrame, if (Interrupt->SynchronizeIrql > Interrupt->Irql) { /* Raise to higher IRQL */ - OldIrql = KfRaiseIrql(Interrupt->Irql); + OldIrql = KfRaiseIrql(Interrupt->SynchronizeIrql); } /* Acquire interrupt lock */ diff --git a/ntoskrnl/ke/i386/traphdlr.c b/ntoskrnl/ke/i386/traphdlr.c index f9a954ec298..8c535103123 100644 --- a/ntoskrnl/ke/i386/traphdlr.c +++ b/ntoskrnl/ke/i386/traphdlr.c @@ -240,7 +240,7 @@ KiNpxHandler(IN PKTRAP_FRAME TrapFrame, } /* User or kernel trap -- get ready to issue an exception */ - if (Thread->NpxState == NPX_STATE_NOT_LOADED) + //if (Thread->NpxState == NPX_STATE_NOT_LOADED) { /* Update CR0 */ Cr0 = __readcr0(); @@ -248,7 +248,7 @@ KiNpxHandler(IN PKTRAP_FRAME TrapFrame, __writecr0(Cr0); /* Save FPU state */ - //Ke386SaveFpuState(SaveArea); + Ke386SaveFpuState(SaveArea); /* Mark CR0 state dirty */ Cr0 |= NPX_STATE_NOT_LOADED; @@ -1082,64 +1082,64 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame) * we should probably table this for now since it's not a "real" issue. */ - /* - * NOTE2: Another scenario is the IRET during a V8086 restore (BIOS Call) - * which will cause a GPF since the trap frame is a total mess (on purpose) - * as built in KiEnterV86Mode. - * - * The idea is to scan for IRET, scan for the known EIP adress, validate CS - * and then manually issue a jump to the V8086 return EIP. - */ - Instructions = (PUCHAR)TrapFrame->Eip; - if (Instructions[0] == 0xCF) - { - /* - * Some evil shit is going on here -- this is not the SS:ESP you're - * looking for! Instead, this is actually CS:EIP you're looking at! - * Why? Because part of the trap frame actually corresponds to the IRET - * stack during the trap exit! - */ - if ((TrapFrame->HardwareEsp == (ULONG)Ki386BiosCallReturnAddress) && - (TrapFrame->HardwareSegSs == (KGDT_R0_CODE | RPL_MASK))) - { - /* Exit the V86 trap! */ - Ki386BiosCallReturnAddress(TrapFrame); - } - else - { - /* Otherwise, this is another kind of IRET fault */ - UNIMPLEMENTED; - while (TRUE); - } - } + /* + * NOTE2: Another scenario is the IRET during a V8086 restore (BIOS Call) + * which will cause a GPF since the trap frame is a total mess (on purpose) + * as built in KiEnterV86Mode. + * + * The idea is to scan for IRET, scan for the known EIP adress, validate CS + * and then manually issue a jump to the V8086 return EIP. + */ + Instructions = (PUCHAR)TrapFrame->Eip; + if (Instructions[0] == 0xCF) + { + /* + * Some evil shit is going on here -- this is not the SS:ESP you're + * looking for! Instead, this is actually CS:EIP you're looking at! + * Why? Because part of the trap frame actually corresponds to the IRET + * stack during the trap exit! + */ + if ((TrapFrame->HardwareEsp == (ULONG)Ki386BiosCallReturnAddress) && + (TrapFrame->HardwareSegSs == (KGDT_R0_CODE | RPL_MASK))) + { + /* Exit the V86 trap! */ + Ki386BiosCallReturnAddress(TrapFrame); + } + else + { + /* Otherwise, this is another kind of IRET fault */ + UNIMPLEMENTED; + while (TRUE); + } + } /* So since we're not dealing with the above case, check for RDMSR/WRMSR */ - if ((Instructions[0] == 0xF) && // 2-byte opcode + if ((Instructions[0] == 0xF) && // 2-byte opcode (((Instructions[1] >> 8) == 0x30) || // RDMSR ((Instructions[2] >> 8) == 0x32))) // WRMSR - { + { /* Unknown CPU MSR, so raise an access violation */ KiDispatchException0Args(STATUS_ACCESS_VIOLATION, TrapFrame->Eip, TrapFrame); - } + } - /* Check for lazy segment load */ - if (TrapFrame->SegDs != (KGDT_R3_DATA | RPL_MASK)) - { - /* Fix it */ - TrapFrame->SegDs = (KGDT_R3_DATA | RPL_MASK); - } - else if (TrapFrame->SegEs != (KGDT_R3_DATA | RPL_MASK)) - { + /* Check for lazy segment load */ + if (TrapFrame->SegDs != (KGDT_R3_DATA | RPL_MASK)) + { + /* Fix it */ + TrapFrame->SegDs = (KGDT_R3_DATA | RPL_MASK); + } + else if (TrapFrame->SegEs != (KGDT_R3_DATA | RPL_MASK)) + { /* Fix it */ TrapFrame->SegEs = (KGDT_R3_DATA | RPL_MASK); - } - else - { - /* Whatever it is, we can't handle it */ - KiSystemFatalException(EXCEPTION_GP_FAULT, TrapFrame); - } + } + else + { + /* Whatever it is, we can't handle it */ + KiSystemFatalException(EXCEPTION_GP_FAULT, TrapFrame); + } /* Return to where we came from */ KiTrapReturn(TrapFrame); @@ -1206,7 +1206,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame) (PVOID)Cr2, TrapFrame->SegCs & MODE_MASK, TrapFrame); - if (Status == STATUS_SUCCESS) KiEoiHelper(TrapFrame); + if (NT_SUCCESS(Status)) KiEoiHelper(TrapFrame); /* Check for S-LIST fault */ if (TrapFrame->Eip == (ULONG_PTR)ExpInterlockedPopEntrySListFault) @@ -1353,7 +1353,7 @@ KiTrap13Handler(IN PKTRAP_FRAME TrapFrame) __writecr0(Cr0); /* Save FPU state */ - //Ke386SaveFpuState(SaveArea); + Ke386SaveFpuState(SaveArea); /* Mark CR0 state dirty */ Cr0 |= NPX_STATE_NOT_LOADED; @@ -1379,7 +1379,7 @@ KiTrap13Handler(IN PKTRAP_FRAME TrapFrame) FSW_UNDERFLOW | FSW_PRECISION); Error &= MxCsrMask; - + /* Now handle any of those legal errors */ if (Error & (FSW_INVALID_OPERATION | FSW_DENORMAL | diff --git a/ntoskrnl/ke/i386/v86vdm.c b/ntoskrnl/ke/i386/v86vdm.c index 2d1ff017f14..4903d3ea5f8 100644 --- a/ntoskrnl/ke/i386/v86vdm.c +++ b/ntoskrnl/ke/i386/v86vdm.c @@ -659,37 +659,87 @@ Ke386CallBios(IN ULONG Int, } /* - * @unimplemented + * @implemented */ BOOLEAN NTAPI Ke386IoSetAccessProcess(IN PKPROCESS Process, - IN ULONG Flag) + IN ULONG MapNumber) { - UNIMPLEMENTED; - return FALSE; + USHORT MapOffset; + PKPRCB Prcb; + KAFFINITY TargetProcessors; + + if(MapNumber > IOPM_COUNT) + return FALSE; + + MapOffset = KiComputeIopmOffset(MapNumber); + + Process->IopmOffset = MapOffset; + + TargetProcessors = Process->ActiveProcessors; + Prcb = KeGetCurrentPrcb(); + if (TargetProcessors & Prcb->SetMember) + KeGetPcr()->TSS->IoMapBase = MapOffset; + + return TRUE; } /* - * @unimplemented + * @implemented */ BOOLEAN NTAPI -Ke386SetIoAccessMap(IN ULONG Flag, - IN PVOID IopmBuffer) +Ke386SetIoAccessMap(IN ULONG MapNumber, + IN PKIO_ACCESS_MAP IopmBuffer) { - UNIMPLEMENTED; - return FALSE; + PKPROCESS CurrentProcess; + PKPRCB Prcb; + PVOID pt; + + if ((MapNumber > IOPM_COUNT) || (MapNumber == IO_ACCESS_MAP_NONE)) + return FALSE; + + Prcb = KeGetCurrentPrcb(); + + // Copy the IOP map and load the map for the current process. + pt = &(KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap); + RtlMoveMemory(pt, (PVOID)IopmBuffer, IOPM_SIZE); + CurrentProcess = Prcb->CurrentThread->ApcState.Process; + KeGetPcr()->TSS->IoMapBase = CurrentProcess->IopmOffset; + + return TRUE; } /* - * @unimplemented + * @implemented */ BOOLEAN NTAPI -Ke386QueryIoAccessMap(IN ULONG Flag, - IN PVOID IopmBuffer) +Ke386QueryIoAccessMap(IN ULONG MapNumber, + IN PKIO_ACCESS_MAP IopmBuffer) { - UNIMPLEMENTED; - return FALSE; + ULONG i; + PVOID Map; + PUCHAR p; + + if (MapNumber > IOPM_COUNT) + return FALSE; + + if (MapNumber == IO_ACCESS_MAP_NONE) + { + // no access, simply return a map of all 1s + p = (PUCHAR)IopmBuffer; + for (i = 0; i < IOPM_SIZE; i++) { + p[i] = (UCHAR)-1; + } + } + else + { + // copy the bits + Map = (PVOID)&(KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap); + RtlMoveMemory((PVOID)IopmBuffer, Map, IOPM_SIZE); + } + + return TRUE; } diff --git a/ntoskrnl/mm/ARM3/arm/init.c b/ntoskrnl/mm/ARM3/arm/init.c index e16b7b83441..091d0cb7b5e 100644 --- a/ntoskrnl/mm/ARM3/arm/init.c +++ b/ntoskrnl/mm/ARM3/arm/init.c @@ -41,7 +41,7 @@ ULONG MmSessionPoolSize; ULONG MmSessionImageSize; PVOID MiSystemViewStart; ULONG MmSystemViewSize; -PFN_NUMBER MmSystemPageDirectory; +PFN_NUMBER MmSystemPageDirectory[PD_COUNT]; PMMPTE MmSystemPagePtes; ULONG MmNumberOfSystemPtes; ULONG MxPfnAllocation; diff --git a/ntoskrnl/mm/ARM3/contmem.c b/ntoskrnl/mm/ARM3/contmem.c index 890bd74c0ea..0d7628bf88f 100644 --- a/ntoskrnl/mm/ARM3/contmem.c +++ b/ntoskrnl/mm/ARM3/contmem.c @@ -18,6 +18,185 @@ /* PRIVATE FUNCTIONS **********************************************************/ +PFN_NUMBER +NTAPI +MiFindContiguousPages(IN PFN_NUMBER LowestPfn, + IN PFN_NUMBER HighestPfn, + IN PFN_NUMBER BoundaryPfn, + IN PFN_NUMBER SizeInPages, + IN MEMORY_CACHING_TYPE CacheType) +{ + PFN_NUMBER Page, PageCount, LastPage, Length, BoundaryMask; + ULONG i = 0; + PMMPFN Pfn1, EndPfn; + KIRQL OldIrql; + PAGED_CODE (); + ASSERT(SizeInPages != 0); + + // + // Convert the boundary PFN into an alignment mask + // + BoundaryMask = ~(BoundaryPfn - 1); + + // + // Loop all the physical memory blocks + // + do + { + // + // Capture the base page and length of this memory block + // + Page = MmPhysicalMemoryBlock->Run[i].BasePage; + PageCount = MmPhysicalMemoryBlock->Run[i].PageCount; + + // + // Check how far this memory block will go + // + LastPage = Page + PageCount; + + // + // Trim it down to only the PFNs we're actually interested in + // + if ((LastPage - 1) > HighestPfn) LastPage = HighestPfn + 1; + if (Page < LowestPfn) Page = LowestPfn; + + // + // Skip this run if it's empty or fails to contain all the pages we need + // + if (!(PageCount) || ((Page + SizeInPages) > LastPage)) continue; + + // + // Now scan all the relevant PFNs in this run + // + Length = 0; + for (Pfn1 = MiGetPfnEntry(Page); Page < LastPage; Page++, Pfn1++) + { + // + // If this PFN is in use, ignore it + // + if (MiIsPfnInUse(Pfn1)) continue; + + // + // If we haven't chosen a start PFN yet and the caller specified an + // alignment, make sure the page matches the alignment restriction + // + if ((!(Length) && (BoundaryPfn)) && + (((Page ^ (Page + SizeInPages - 1)) & BoundaryMask))) + { + // + // It does not, so bail out + // + continue; + } + + // + // Increase the number of valid pages, and check if we have enough + // + if (++Length == SizeInPages) + { + // + // It appears we've amassed enough legitimate pages, rollback + // + Pfn1 -= (Length - 1); + Page -= (Length - 1); + + // + // Acquire the PFN lock + // + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + do + { + // + // Things might've changed for us. Is the page still free? + // + if (MiIsPfnInUse(Pfn1)) break; + + // + // So far so good. Is this the last confirmed valid page? + // + if (!--Length) + { + // + // Sanity check that we didn't go out of bounds + // + ASSERT(i != MmPhysicalMemoryBlock->NumberOfRuns); + + // + // Loop until all PFN entries have been processed + // + EndPfn = Pfn1 - SizeInPages + 1; + do + { + // + // This PFN is now a used page, set it up + // + MiUnlinkFreeOrZeroedPage(Pfn1); + Pfn1->u3.e2.ReferenceCount = 1; + Pfn1->u2.ShareCount = 1; + Pfn1->u3.e1.PageLocation = ActiveAndValid; + Pfn1->u3.e1.StartOfAllocation = 0; + Pfn1->u3.e1.EndOfAllocation = 0; + Pfn1->u3.e1.PrototypePte = 0; + Pfn1->u4.VerifierAllocation = 0; + Pfn1->PteAddress = (PVOID)0xBAADF00D; + + // + // Check if this is the last PFN, otherwise go on + // + if (Pfn1 == EndPfn) break; + Pfn1--; + } while (TRUE); + + // + // Mark the first and last PFN so we can find them later + // + Pfn1->u3.e1.StartOfAllocation = 1; + (Pfn1 + SizeInPages - 1)->u3.e1.EndOfAllocation = 1; + + // + // Now it's safe to let go of the PFN lock + // + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + + // + // Quick sanity check that the last PFN is consistent + // + EndPfn = Pfn1 + SizeInPages; + ASSERT(EndPfn == MiGetPfnEntry(Page + 1)); + + // + // Compute the first page, and make sure it's consistent + // + Page -= SizeInPages - 1; + ASSERT(Pfn1 == MiGetPfnEntry(Page)); + ASSERT(Page != 0); + return Page; + } + + // + // Keep going. The purpose of this loop is to reconfirm that + // after acquiring the PFN lock these pages are still usable + // + Pfn1++; + Page++; + } while (TRUE); + + // + // If we got here, something changed while we hadn't acquired + // the PFN lock yet, so we'll have to restart + // + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + Length = 0; + } + } + } while (++i != MmPhysicalMemoryBlock->NumberOfRuns); + + // + // And if we get here, it means no suitable physical memory runs were found + // + return 0; +} + PVOID NTAPI MiCheckForContiguousMemory(IN PVOID BaseAddress, @@ -143,7 +322,10 @@ MiFindContiguousMemory(IN PFN_NUMBER LowestPfn, { PFN_NUMBER Page; PHYSICAL_ADDRESS PhysicalAddress; - PAGED_CODE (); + PMMPFN Pfn1, EndPfn; + PMMPTE PointerPte; + PVOID BaseAddress; + PAGED_CODE(); ASSERT(SizeInPages != 0); // @@ -160,7 +342,22 @@ MiFindContiguousMemory(IN PFN_NUMBER LowestPfn, // We'll just piggyback on the I/O memory mapper // PhysicalAddress.QuadPart = Page << PAGE_SHIFT; - return MmMapIoSpace(PhysicalAddress, SizeInPages << PAGE_SHIFT, CacheType); + BaseAddress = MmMapIoSpace(PhysicalAddress, SizeInPages << PAGE_SHIFT, CacheType); + ASSERT(BaseAddress); + + /* Loop the PFN entries */ + Pfn1 = MiGetPfnEntry(Page); + EndPfn = Pfn1 + SizeInPages; + PointerPte = MiAddressToPte(BaseAddress); + do + { + /* Write the PTE address */ + Pfn1->PteAddress = PointerPte++; + Pfn1->u4.PteFrame = PFN_FROM_PTE(MiAddressToPte(PointerPte)); + } while (Pfn1++ < EndPfn); + + /* Return the address */ + return BaseAddress; } PVOID @@ -249,6 +446,7 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) KIRQL OldIrql; PFN_NUMBER PageFrameIndex, LastPage, PageCount; PMMPFN Pfn1, StartPfn; + PMMPTE PointerPte; PAGED_CODE(); // @@ -267,10 +465,9 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) return; } - // - // Otherwise, get the PTE and page number for the allocation - // - PageFrameIndex = PFN_FROM_PTE(MiAddressToPte(BaseAddress)); + /* Get the PTE and frame number for the allocation*/ + PointerPte = MiAddressToPte(BaseAddress); + PageFrameIndex = PFN_FROM_PTE(PointerPte); // // Now get the PFN entry for this, and make sure it's the correct one @@ -281,11 +478,11 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) // // This probably means you did a free on an address that was in between // - KeBugCheckEx (BAD_POOL_CALLER, - 0x60, - (ULONG_PTR)BaseAddress, - 0, - 0); + KeBugCheckEx(BAD_POOL_CALLER, + 0x60, + (ULONG_PTR)BaseAddress, + 0, + 0); } // @@ -294,16 +491,21 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) StartPfn = Pfn1; Pfn1->u3.e1.StartOfAllocation = 0; - // - // Look the PFNs - // + /* Loop the PFNs until we find the one that marks the end of the allocation */ do { - // - // Until we find the one that marks the end of the allocation - // + /* Make sure these are the pages we setup in the allocation routine */ + ASSERT(Pfn1->u3.e2.ReferenceCount == 1); + ASSERT(Pfn1->u2.ShareCount == 1); + ASSERT(Pfn1->PteAddress == PointerPte); + ASSERT(Pfn1->u3.e1.PageLocation == ActiveAndValid); + ASSERT(Pfn1->u4.VerifierAllocation == 0); + ASSERT(Pfn1->u3.e1.PrototypePte == 0); + + /* Keep going for assertions */ + PointerPte++; } while (Pfn1++->u3.e1.EndOfAllocation == 0); - + // // Found it, unmark it // @@ -328,14 +530,14 @@ MiFreeContiguousMemory(IN PVOID BaseAddress) // // Loop all the pages // - LastPage = PageFrameIndex + PageCount; + LastPage = PageFrameIndex + PageCount; do { // // Free each one, and move on // - MmReleasePageMemoryConsumer(MC_NPPOOL, PageFrameIndex); - } while (++PageFrameIndex < LastPage); + MmReleasePageMemoryConsumer(MC_NPPOOL, PageFrameIndex++); + } while (PageFrameIndex < LastPage); // // Release the PFN lock diff --git a/ntoskrnl/mm/ARM3/drvmgmt.c b/ntoskrnl/mm/ARM3/drvmgmt.c index 4811a441dd4..ad85c479ca5 100644 --- a/ntoskrnl/mm/ARM3/drvmgmt.c +++ b/ntoskrnl/mm/ARM3/drvmgmt.c @@ -21,55 +21,12 @@ MM_DRIVER_VERIFIER_DATA MmVerifierData; LIST_ENTRY MiVerifierDriverAddedThunkListHead; ULONG MiActiveVerifierThunks; - -/* PRIVATE FUNCTIONS *********************************************************/ - -PLDR_DATA_TABLE_ENTRY -NTAPI -MiLookupDataTableEntry(IN PVOID Address) -{ - PLDR_DATA_TABLE_ENTRY LdrEntry, FoundEntry = NULL; - PLIST_ENTRY NextEntry; - PAGED_CODE(); - - // - // Loop entries - // - NextEntry = PsLoadedModuleList.Flink; - do - { - // - // Get the loader entry - // - LdrEntry = CONTAINING_RECORD(NextEntry, - LDR_DATA_TABLE_ENTRY, - InLoadOrderLinks); - - // - // Check if the address matches - // - if ((Address >= LdrEntry->DllBase) && - (Address < (PVOID)((ULONG_PTR)LdrEntry->DllBase + - LdrEntry->SizeOfImage))) - { - // - // Found a match - // - FoundEntry = LdrEntry; - break; - } - - // - // Move on - // - NextEntry = NextEntry->Flink; - } while(NextEntry != &PsLoadedModuleList); - - // - // Return the entry - // - return FoundEntry; -} +WCHAR MmVerifyDriverBuffer[512] = {0}; +ULONG MmVerifyDriverBufferLength = sizeof(MmVerifyDriverBuffer); +ULONG MmVerifyDriverBufferType = REG_NONE; +ULONG MmVerifyDriverLevel = -1; +PVOID MmTriageActionTaken; +PVOID KernelVerifier; /* PUBLIC FUNCTIONS ***********************************************************/ @@ -107,68 +64,6 @@ MmLockPageableDataSection(IN PVOID AddressWithinSection) return AddressWithinSection; } -/* - * @unimplemented - */ -PVOID -NTAPI -MmPageEntireDriver(IN PVOID AddressWithinSection) -{ - //PMMPTE StartPte, EndPte; - PLDR_DATA_TABLE_ENTRY LdrEntry; - PAGED_CODE(); - - // - // Get the loader entry - // - LdrEntry = MiLookupDataTableEntry(AddressWithinSection); - if (!LdrEntry) return NULL; - - // - // Check if paging of kernel mode is disabled or if the driver is mapped as - // an image - // - if ((MmDisablePagingExecutive & 0x1) || (LdrEntry->SectionPointer)) - { - // - // Don't do anything, just return the base address - // - return LdrEntry->DllBase; - } - - // - // Wait for active DPCs to finish before we page out the driver - // - KeFlushQueuedDpcs(); - - // - // Get the PTE range for the whole driver image - // - //StartPte = MiGetPteAddress(LdrEntry->DllBase); - //EndPte = MiGetPteAddress(LdrEntry->DllBase + - // LdrEntry->SizeOfImage); - - // - // Enable paging for the PTE range - // - //MiSetPagingOfDriver(StartPte, EndPte); - - // - // Return the base address - // - return LdrEntry->DllBase; -} - -/* - * @unimplemented - */ -VOID -NTAPI -MmResetDriverPaging(IN PVOID AddressWithinSection) -{ - UNIMPLEMENTED; -} - /* * @unimplemented */ diff --git a/ntoskrnl/mm/ARM3/i386/init.c b/ntoskrnl/mm/ARM3/i386/init.c index 250324ca65f..c0226ebc8ac 100644 --- a/ntoskrnl/mm/ARM3/i386/init.c +++ b/ntoskrnl/mm/ARM3/i386/init.c @@ -151,6 +151,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) MMPTE TempPde, TempPte; PVOID NonPagedPoolExpansionVa; ULONG OldCount; + KIRQL OldIrql; /* Check for kernel stack size that's too big */ if (MmLargeStackSize > (KERNEL_LARGE_STACK_SIZE / _1KB)) @@ -338,7 +339,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) MmNonPagedSystemStart = (PVOID)((ULONG_PTR)MmNonPagedPoolStart - (MmNumberOfSystemPtes + 1) * PAGE_SIZE); MmNonPagedSystemStart = (PVOID)((ULONG_PTR)MmNonPagedSystemStart & - ~((4 * 1024 * 1024) - 1)); + ~(PDE_MAPPED_VA - 1)); // // Don't let it go below the minimum @@ -386,7 +387,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) // MmPfnDatabase[0] = (PVOID)0xB0000000; MmPfnDatabase[1] = &MmPfnDatabase[0][MmHighestPhysicalPage]; - ASSERT(((ULONG_PTR)MmPfnDatabase[0] & ((4 * 1024 * 1024) - 1)) == 0); + ASSERT(((ULONG_PTR)MmPfnDatabase[0] & (PDE_MAPPED_VA - 1)) == 0); // // Non paged pool comes after the PFN database @@ -541,21 +542,26 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock) // MiInitializeSystemPtes(PointerPte, MmNumberOfSystemPtes, SystemPteSpace); - // - // Get the PDE For hyperspace - // + /* Get the PDE For hyperspace */ StartPde = MiAddressToPde(HYPER_SPACE); - // - // Allocate a page for it and create it - // - PageFrameIndex = MmAllocPage(MC_SYSTEM); + /* Lock PFN database */ + OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); + + /* Allocate a page for hyperspace and create it */ + PageFrameIndex = MiRemoveAnyPage(0); TempPde.u.Hard.PageFrameNumber = PageFrameIndex; TempPde.u.Hard.Global = FALSE; // Hyperspace is local! ASSERT(StartPde->u.Hard.Valid == 0); ASSERT(TempPde.u.Hard.Valid == 1); *StartPde = TempPde; + /* Flush the TLB */ + KeFlushCurrentTb(); + + /* Release the lock */ + KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); + // // Zero out the page table now // diff --git a/ntoskrnl/mm/ARM3/largepag.c b/ntoskrnl/mm/ARM3/largepag.c new file mode 100644 index 00000000000..0cd1e502f2e --- /dev/null +++ b/ntoskrnl/mm/ARM3/largepag.c @@ -0,0 +1,102 @@ +/* + * PROJECT: ReactOS Kernel + * LICENSE: BSD - See COPYING.ARM in the top level directory + * FILE: ntoskrnl/mm/ARM3/largepag.c + * PURPOSE: ARM Memory Manager Large Page Support + * PROGRAMMERS: ReactOS Portable Systems Group + */ + +/* INCLUDES *******************************************************************/ + +#include +#define NDEBUG +#include + +#line 15 "ARMツウ::LARGEPAGE" +#define MODULE_INVOLVED_IN_ARM3 +#include "../ARM3/miarm.h" + +/* GLOBALS ********************************************************************/ + +LIST_ENTRY MmProcessList; +PMMPTE MiLargePageHyperPte; +ULONG MiLargePageRangeIndex; +MI_LARGE_PAGE_RANGES MiLargePageRanges[64]; +WCHAR MmLargePageDriverBuffer[512] = {0}; +ULONG MmLargePageDriverBufferLength = -1; +LIST_ENTRY MiLargePageDriverList; +BOOLEAN MiLargePageAllDrivers; + +/* FUNCTIONS ******************************************************************/ + +VOID +NTAPI +MiInitializeLargePageSupport(VOID) +{ +#if _MI_PAGING_LEVELS > 2 +#error "PAE/x64 Not Implemented" +#else + /* Initialize the large-page hyperspace PTE used for initial mapping */ + MiLargePageHyperPte = MiReserveSystemPtes(1, SystemPteSpace); + ASSERT(MiLargePageHyperPte); + MiLargePageHyperPte->u.Long = 0; + + /* Initialize the process tracking list, and insert the system process */ + InitializeListHead(&MmProcessList); + InsertTailList(&MmProcessList, &PsGetCurrentProcess()->MmProcessLinks); +#endif +} + +VOID +NTAPI +MiSyncCachedRanges(VOID) +{ + ULONG i; + + /* Scan every range */ + for (i = 0; i < MiLargePageRangeIndex; i++) + { + DPRINT1("No support for large pages\n"); + while (TRUE); + } +} + +VOID +NTAPI +MiInitializeDriverLargePageList(VOID) +{ + PWCHAR p, pp; + + /* Initialize the list */ + InitializeListHead(&MiLargePageDriverList); + + /* Bail out if there's nothing */ + if (MmLargePageDriverBufferLength == 0xFFFFFFFF) return; + + /* Loop from start to finish */ + p = MmLargePageDriverBuffer; + pp = MmLargePageDriverBuffer + (MmLargePageDriverBufferLength / sizeof(WCHAR)); + while (p < pp) + { + /* Skip whitespaces */ + if ((*p == L' ') || (*p == L'\n') || (*p == L'\r') || (*p == L'\t')) + { + /* Skip the character */ + p++; + continue; + } + + /* A star means everything */ + if (*p == L'*') + { + /* No need to keep going */ + MiLargePageAllDrivers = TRUE; + break; + } + + DPRINT1("Large page drivers not supported\n"); + ASSERT(FALSE); + } +} + +/* EOF */ diff --git a/ntoskrnl/mm/ARM3/mdlsup.c b/ntoskrnl/mm/ARM3/mdlsup.c index 0100040f1c7..1b95448fc43 100644 --- a/ntoskrnl/mm/ARM3/mdlsup.c +++ b/ntoskrnl/mm/ARM3/mdlsup.c @@ -16,6 +16,9 @@ #define MODULE_INVOLVED_IN_ARM3 #include "../ARM3/miarm.h" +BOOLEAN MmTrackPtes; +BOOLEAN MmTrackLockedPages; + /* PUBLIC FUNCTIONS ***********************************************************/ /* diff --git a/ntoskrnl/mm/ARM3/miarm.h b/ntoskrnl/mm/ARM3/miarm.h index 9808d167a81..8cf2d39534d 100644 --- a/ntoskrnl/mm/ARM3/miarm.h +++ b/ntoskrnl/mm/ARM3/miarm.h @@ -58,11 +58,80 @@ #error Define these please! #endif +#ifdef _M_IX86 +#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_I386 +#elif _M_ARM +#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM +#elif _M_AMD64 +#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_AMD64 +#else +#error Define these please! +#endif + +// +// Protection Bits part of the internal memory manager Protection Mask +// Taken from http://www.reactos.org/wiki/Techwiki:Memory_management_in_the_Windows_XP_kernel +// and public assertions. +// +#define MM_ZERO_ACCESS 0 +#define MM_READONLY 1 +#define MM_EXECUTE 2 +#define MM_EXECUTE_READ 3 +#define MM_READWRITE 4 +#define MM_WRITECOPY 5 +#define MM_EXECUTE_READWRITE 6 +#define MM_EXECUTE_WRITECOPY 7 +#define MM_NOCACHE 8 +#define MM_DECOMMIT 0x10 +#define MM_NOACCESS (MM_DECOMMIT | MM_NOCACHE) + +// +// Assertions for session images, addresses, and PTEs +// +#define MI_IS_SESSION_IMAGE_ADDRESS(Address) \ + (((Address) >= MiSessionImageStart) && ((Address) < MiSessionImageEnd)) + +#define MI_IS_SESSION_ADDRESS(Address) \ + (((Address) >= MmSessionBase) && ((Address) < MiSessionSpaceEnd)) + +#define MI_IS_SESSION_PTE(Pte) \ + ((((PMMPTE)Pte) >= MiSessionBasePte) && (((PMMPTE)Pte) < MiSessionLastPte)) + +// +// Corresponds to MMPTE_SOFTWARE.Protection +// +#ifdef _M_IX86 +#define MM_PTE_SOFTWARE_PROTECTION_BITS 5 +#elif _M_ARM +#define MM_PTE_SOFTWARE_PROTECTION_BITS 5 +#elif _M_AMD64 +#define MM_PTE_SOFTWARE_PROTECTION_BITS 5 +#else +#error Define these please! +#endif + +// +// Creates a software PTE with the given protection +// +#define MI_MAKE_SOFTWARE_PTE(p, x) ((p)->u.Long = (x << MM_PTE_SOFTWARE_PROTECTION_BITS)) + +// +// Special values for LoadedImports +// +#define MM_SYSLDR_NO_IMPORTS (PVOID)0xFFFFFFFE +#define MM_SYSLDR_BOOT_LOADED (PVOID)0xFFFFFFFF +#define MM_SYSLDR_SINGLE_ENTRY 0x1 + // // PFN List Sentinel // #define LIST_HEAD 0xFFFFFFFF +// +// Special IRQL value (found in assertions) +// +#define MM_NOIRQL (KIRQL)0xFFFFFFFF + // // FIXFIX: These should go in ex.h after the pool merge // @@ -167,10 +236,34 @@ typedef struct _MMCOLOR_TABLES PFN_NUMBER Count; } MMCOLOR_TABLES, *PMMCOLOR_TABLES; +typedef struct _MI_LARGE_PAGE_RANGES +{ + PFN_NUMBER StartFrame; + PFN_NUMBER LastFrame; +} MI_LARGE_PAGE_RANGES, *PMI_LARGE_PAGE_RANGES; + extern MMPTE HyperTemplatePte; extern MMPDE ValidKernelPde; extern MMPTE ValidKernelPte; - +extern BOOLEAN MmLargeSystemCache; +extern BOOLEAN MmZeroPageFile; +extern BOOLEAN MmProtectFreedNonPagedPool; +extern BOOLEAN MmTrackLockedPages; +extern BOOLEAN MmTrackPtes; +extern BOOLEAN MmDynamicPfn; +extern BOOLEAN MmMirroring; +extern BOOLEAN MmMakeLowMemory; +extern BOOLEAN MmEnforceWriteProtection; +extern ULONG MmAllocationFragment; +extern ULONG MmConsumedPoolPercentage; +extern ULONG MmVerifyDriverBufferType; +extern ULONG MmVerifyDriverLevel; +extern WCHAR MmVerifyDriverBuffer[512]; +extern WCHAR MmLargePageDriverBuffer[512]; +extern LIST_ENTRY MiLargePageDriverList; +extern BOOLEAN MiLargePageAllDrivers; +extern ULONG MmVerifyDriverBufferLength; +extern ULONG MmLargePageDriverBufferLength; extern ULONG MmSizeOfNonPagedPoolInBytes; extern ULONG MmMaximumNonPagedPoolInBytes; extern PFN_NUMBER MmMaximumNonPagedPoolInPages; @@ -204,6 +297,10 @@ extern PVOID MiSystemViewStart; extern ULONG MmSystemViewSize; extern PVOID MmSessionBase; extern PVOID MiSessionSpaceEnd; +extern PMMPTE MiSessionImagePteStart; +extern PMMPTE MiSessionImagePteEnd; +extern PMMPTE MiSessionBasePte; +extern PMMPTE MiSessionLastPte; extern ULONG MmSizeOfPagedPoolInBytes; extern PMMPTE MmSystemPagePtes; extern PVOID MmSystemCacheStart; @@ -242,11 +339,33 @@ extern PFN_NUMBER MmMinimumFreePages; extern PFN_NUMBER MmPlentyFreePages; extern PFN_NUMBER MiExpansionPoolPagesInitialCharge; extern PFN_NUMBER MmResidentAvailablePages; -extern PFN_NUMBER MmResidentAvailablePagesAtInit; +extern PFN_NUMBER MmResidentAvailableAtInit; +extern ULONG MmTotalFreeSystemPtes[MaximumPtePoolTypes]; +extern PFN_NUMBER MmTotalSystemDriverPages; +extern PVOID MiSessionImageStart; +extern PVOID MiSessionImageEnd; +extern PMMPTE MiHighestUserPte; +extern PMMPDE MiHighestUserPde; +extern PFN_NUMBER MmSystemPageDirectory[PD_COUNT]; #define MI_PFN_TO_PFNENTRY(x) (&MmPfnDatabase[1][x]) #define MI_PFNENTRY_TO_PFN(x) (x - MmPfnDatabase[1]) +// +// Returns if the page is physically resident (ie: a large page) +// FIXFIX: CISC/x86 only? +// +FORCEINLINE +BOOLEAN +MI_IS_PHYSICAL_ADDRESS(IN PVOID Address) +{ + PMMPDE PointerPde; + + /* Large pages are never paged out, always physically resident */ + PointerPde = MiAddressToPde(Address); + return ((PointerPde->u.Hard.LargePage) && (PointerPde->u.Hard.Valid)); +} + NTSTATUS NTAPI MmArmInitSystem( @@ -326,6 +445,12 @@ MmArmAccessFault( IN PVOID TrapInformation ); +NTSTATUS +FASTCALL +MiCheckPdeForPagedPool( + IN PVOID Address +); + VOID NTAPI MiInitializeNonPagedPool( @@ -449,6 +574,18 @@ MiRemoveHeadList( IN PMMPFNLIST ListHead ); +PFN_NUMBER +NTAPI +MiAllocatePfn( + IN PMMPTE PointerPte, + IN ULONG Protection +); + +PFN_NUMBER +NTAPI +MiRemoveAnyPage( + IN ULONG Color +); VOID NTAPI @@ -456,4 +593,34 @@ MiInsertPageInFreeList( IN PFN_NUMBER PageFrameIndex ); +PLDR_DATA_TABLE_ENTRY +NTAPI +MiLookupDataTableEntry( + IN PVOID Address +); + +VOID +NTAPI +MiInitializeDriverLargePageList( + VOID +); + +VOID +NTAPI +MiInitializeLargePageSupport( + VOID +); + +VOID +NTAPI +MiSyncCachedRanges( + VOID +); + +BOOLEAN +NTAPI +MiIsPfnInUse( + IN PMMPFN Pfn1 +); + /* EOF */ diff --git a/ntoskrnl/mm/ARM3/mminit.c b/ntoskrnl/mm/ARM3/mminit.c index 3e589512fff..25c37dcc9ac 100644 --- a/ntoskrnl/mm/ARM3/mminit.c +++ b/ntoskrnl/mm/ARM3/mminit.c @@ -136,6 +136,14 @@ ULONG MmSessionViewSize; ULONG MmSessionPoolSize; ULONG MmSessionImageSize; +/* + * These are the PTE addresses of the boundaries carved out above + */ +PMMPTE MiSessionImagePteStart; +PMMPTE MiSessionImagePteEnd; +PMMPTE MiSessionBasePte; +PMMPTE MiSessionLastPte; + // // The system view space, on the other hand, is where sections that are memory // mapped into "system space" end up. @@ -151,7 +159,7 @@ ULONG MmSystemViewSize; // map paged pool PDEs into external processes when they fault on a paged pool // address. // -PFN_NUMBER MmSystemPageDirectory; +PFN_NUMBER MmSystemPageDirectory[PD_COUNT]; PMMPTE MmSystemPagePtes; // @@ -217,6 +225,11 @@ ULONG MmUserProbeAddress; PVOID MmHighestUserAddress; PVOID MmSystemRangeStart; +/* And these store the respective highest PTE/PDE address */ +PMMPTE MiHighestUserPte; +PMMPDE MiHighestUserPde; + +/* These variables define the system cache address space */ PVOID MmSystemCacheStart; PVOID MmSystemCacheEnd; MMSUPPORT MmSystemCacheWs; @@ -301,6 +314,20 @@ PFN_NUMBER MmPlentyFreePages = 400; ULONG MmProductType; MM_SYSTEMSIZE MmSystemSize; +/* + * These values store the cache working set minimums and maximums, in pages + * + * The minimum value is boosted on systems with more than 24MB of RAM, and cut + * down to only 32 pages on embedded (<24MB RAM) systems. + * + * An extra boost of 2MB is given on systems with more than 33MB of RAM. + */ +PFN_NUMBER MmSystemCacheWsMinimum = 288; +PFN_NUMBER MmSystemCacheWsMaximum = 350; + +/* FIXME: Move to cache/working set code later */ +BOOLEAN MmLargeSystemCache; + /* PRIVATE FUNCTIONS **********************************************************/ // @@ -742,7 +769,7 @@ MiBuildPfnDatabaseFromPages(IN PLOADER_PARAMETER_BLOCK LoaderBlock) else { /* Next PDE mapped address */ - BaseAddress += PTE_COUNT * PAGE_SIZE; + BaseAddress += PDE_MAPPED_VA; } /* Next PTE */ @@ -1159,6 +1186,61 @@ MiInitializeMemoryEvents(VOID) return TRUE; } +VOID +NTAPI +MiAddHalIoMappings(VOID) +{ + PVOID BaseAddress; + PMMPTE PointerPde; + PMMPTE PointerPte; + ULONG i, j, PdeCount; + PFN_NUMBER PageFrameIndex; + + /* HAL Heap address -- should be on a PDE boundary */ + BaseAddress = (PVOID)0xFFC00000; + ASSERT(MiAddressToPteOffset(BaseAddress) == 0); + + /* Check how many PDEs the heap has */ + PointerPde = MiAddressToPde(BaseAddress); + PdeCount = PDE_COUNT - ADDR_TO_PDE_OFFSET(BaseAddress); + for (i = 0; i < PdeCount; i++) + { + /* Does the HAL own this mapping? */ + if ((PointerPde->u.Hard.Valid == 1) && + (PointerPde->u.Hard.LargePage == 0)) + { + /* Get the PTE for it and scan each page */ + PointerPte = MiAddressToPte(BaseAddress); + for (j = 0 ; j < PTE_COUNT; j++) + { + /* Does the HAL own this page? */ + if (PointerPte->u.Hard.Valid == 1) + { + /* Is the HAL using it for device or I/O mapped memory? */ + PageFrameIndex = PFN_FROM_PTE(PointerPte); + if (!MiGetPfnEntry(PageFrameIndex)) + { + /* FIXME: For PAT, we need to track I/O cache attributes for coherency */ + DPRINT1("HAL I/O Mapping at %p is unsafe\n", BaseAddress); + } + } + + /* Move to the next page */ + BaseAddress = (PVOID)((ULONG_PTR)BaseAddress + PAGE_SIZE); + PointerPte++; + } + } + else + { + /* Move to the next address */ + BaseAddress = (PVOID)((ULONG_PTR)BaseAddress + PDE_MAPPED_VA); + } + + /* Move to the next PDE */ + PointerPde++; + } +} + VOID NTAPI MmDumpArmPfnDatabase(VOID) @@ -1416,7 +1498,8 @@ MiBuildPagedPool(VOID) // Get the page frame number for the system page directory // PointerPte = MiAddressToPte(PDE_BASE); - MmSystemPageDirectory = PFN_FROM_PTE(PointerPte); + ASSERT(PD_COUNT == 1); + MmSystemPageDirectory[0] = PFN_FROM_PTE(PointerPte); // // Allocate a system PTE which will hold a copy of the page directory @@ -1433,7 +1516,8 @@ MiBuildPagedPool(VOID) // way). // TempPte = ValidKernelPte; - TempPte.u.Hard.PageFrameNumber = MmSystemPageDirectory; + ASSERT(PD_COUNT == 1); + TempPte.u.Hard.PageFrameNumber = MmSystemPageDirectory[0]; ASSERT(PointerPte->u.Hard.Valid == 0); ASSERT(TempPte.u.Hard.Valid == 1); *PointerPte = TempPte; @@ -1631,6 +1715,10 @@ MmArmInitSystem(IN ULONG Phase, MmUserProbeAddress = (ULONG_PTR)MmSystemRangeStart - 0x10000; MmHighestUserAddress = (PVOID)(MmUserProbeAddress - 1); + /* Highest PTE and PDE based on the addresses above */ + MiHighestUserPte = MiAddressToPte(MmHighestUserAddress); + MiHighestUserPde = MiAddressToPde(MmHighestUserAddress); + // // Get the size of the boot loader's image allocations and then round // that region up to a PDE size, so that any PDEs we might create for @@ -1639,8 +1727,8 @@ MmArmInitSystem(IN ULONG Phase, // MmBootImageSize = KeLoaderBlock->Extension->LoaderPagesSpanned; MmBootImageSize *= PAGE_SIZE; - MmBootImageSize = (MmBootImageSize + (4 * 1024 * 1024) - 1) & ~((4 * 1024 * 1024) - 1); - ASSERT((MmBootImageSize % (4 * 1024 * 1024)) == 0); + MmBootImageSize = (MmBootImageSize + PDE_MAPPED_VA - 1) & ~(PDE_MAPPED_VA - 1); + ASSERT((MmBootImageSize % PDE_MAPPED_VA) == 0); // // Set the size of session view, pool, and image @@ -1703,7 +1791,12 @@ MmArmInitSystem(IN ULONG Phase, // MiSystemViewStart = (PVOID)((ULONG_PTR)MmSessionBase - MmSystemViewSize); - + + /* Compute the PTE addresses for all the addresses we carved out */ + MiSessionImagePteStart = MiAddressToPte(MiSessionImageStart); + MiSessionImagePteEnd = MiAddressToPte(MiSessionImageEnd); + MiSessionBasePte = MiAddressToPte(MmSessionBase); + MiSessionLastPte = MiAddressToPte(MiSessionSpaceEnd); /* Initialize the user mode image list */ InitializeListHead(&MmLoadedUserImageList); @@ -1815,11 +1908,26 @@ MmArmInitSystem(IN ULONG Phase, } } - // - // Size up paged pool and build the shadow system page directory - // - MiBuildPagedPool(); - + /* Look for large page cache entries that need caching */ + MiSyncCachedRanges(); + + /* Loop for HAL Heap I/O device mappings that need coherency tracking */ + MiAddHalIoMappings(); + + /* Set the initial resident page count */ + MmResidentAvailablePages = MmAvailablePages - 32; + + /* Initialize large page structures on PAE/x64, and MmProcessList on x86 */ + MiInitializeLargePageSupport(); + + /* Check if the registry says any drivers should be loaded with large pages */ + MiInitializeDriverLargePageList(); + + /* Relocate the boot drivers into system PTE space and fixup their PFNs */ + MiReloadBootLoadedDrivers(LoaderBlock); + + /* FIXME: Call out into Driver Verifier for initialization */ + /* Check how many pages the system has */ if (MmNumberOfPhysicalPages <= (13 * _1MB)) { @@ -1828,13 +1936,22 @@ MmArmInitSystem(IN ULONG Phase, } else if (MmNumberOfPhysicalPages <= (19 * _1MB)) { - /* Set small system */ + /* Set small system and add 100 pages for the cache */ MmSystemSize = MmSmallSystem; + MmSystemCacheWsMinimum += 100; } else { - /* Set medium system */ + /* Set medium system and add 400 pages for the cache */ MmSystemSize = MmMediumSystem; + MmSystemCacheWsMinimum += 400; + } + + /* Check for less than 24MB */ + if (MmNumberOfPhysicalPages < ((24 * _1MB) / PAGE_SIZE)) + { + /* No more than 32 pages */ + MmSystemCacheWsMinimum = 32; } /* Check for more than 32MB */ @@ -1856,7 +1973,14 @@ MmArmInitSystem(IN ULONG Phase, } } } - + + /* Check for more than 33 MB */ + if (MmNumberOfPhysicalPages > ((33 * _1MB) / PAGE_SIZE)) + { + /* Add another 500 pages to the cache */ + MmSystemCacheWsMinimum += 500; + } + /* Now setup the shared user data fields */ ASSERT(SharedUserData->NumberOfPhysicalPages == 0); SharedUserData->NumberOfPhysicalPages = MmNumberOfPhysicalPages; @@ -1890,6 +2014,20 @@ MmArmInitSystem(IN ULONG Phase, /* Update working set tuning parameters */ MiAdjustWorkingSetManagerParameters(!MmProductType); + + /* Finetune the page count by removing working set and NP expansion */ + MmResidentAvailablePages -= MiExpansionPoolPagesInitialCharge; + MmResidentAvailablePages -= MmSystemCacheWsMinimum; + MmResidentAvailableAtInit = MmResidentAvailablePages; + if (MmResidentAvailablePages <= 0) + { + /* This should not happen */ + DPRINT1("System cache working set too big\n"); + return FALSE; + } + + /* Size up paged pool and build the shadow system page directory */ + MiBuildPagedPool(); } // diff --git a/ntoskrnl/mm/ARM3/pagfault.c b/ntoskrnl/mm/ARM3/pagfault.c index dbed3005446..7455a100af1 100644 --- a/ntoskrnl/mm/ARM3/pagfault.c +++ b/ntoskrnl/mm/ARM3/pagfault.c @@ -27,6 +27,10 @@ MiCheckPdeForPagedPool(IN PVOID Address) PMMPDE PointerPde; NTSTATUS Status = STATUS_SUCCESS; + /* No session support in ReactOS yet */ + ASSERT(MI_IS_SESSION_ADDRESS(Address) == FALSE); + ASSERT(MI_IS_SESSION_PTE(Address) == FALSE); + // // Check if this is a fault while trying to access the page table itself // @@ -60,6 +64,9 @@ MiCheckPdeForPagedPool(IN PVOID Address) // if (PointerPde->u.Hard.Valid == 0) { + /* This seems to be making the assumption that one PDE is one page long */ + ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT))); + // // Copy it from our double-mapped system page directory // @@ -88,6 +95,10 @@ MiResolveDemandZeroFault(IN PVOID Address, Address, Process); + /* Must currently only be called by paging path, for system addresses only */ + ASSERT(OldIrql == MM_NOIRQL); + ASSERT(Process == NULL); + // // Lock the PFN database // @@ -110,11 +121,16 @@ MiResolveDemandZeroFault(IN PVOID Address, // InterlockedIncrement(&KeGetCurrentPrcb()->MmDemandZeroCount); + /* Shouldn't see faults for user PTEs yet */ + ASSERT(PointerPte > MiHighestUserPte); + // // Build the PTE // TempPte = ValidKernelPte; TempPte.u.Hard.PageFrameNumber = PageFrameNumber; + ASSERT(TempPte.u.Hard.Valid == 1); + ASSERT(PointerPte->u.Hard.Valid == 0); *PointerPte = TempPte; ASSERT(PointerPte->u.Hard.Valid == 1); @@ -155,6 +171,9 @@ MiDispatchFault(IN BOOLEAN StoreInstruction, // TempPte = *PointerPte; + /* No prototype */ + ASSERT(PrototypePte == NULL); + // // The PTE must be invalid, but not totally blank // @@ -175,7 +194,8 @@ MiDispatchFault(IN BOOLEAN StoreInstruction, Status = MiResolveDemandZeroFault(Address, PointerPte, Process, - -1); + MM_NOIRQL); + ASSERT(KeAreAllApcsDisabled () == TRUE); if (NT_SUCCESS(Status)) { // @@ -304,7 +324,7 @@ MmArmAccessFault(IN BOOLEAN StoreInstruction, // // This might happen...not sure yet // - DPRINT1("FAULT ON PAGE TABLES!\n"); + DPRINT1("FAULT ON PAGE TABLES: %p %lx %lx!\n", Address, *PointerPte, *PointerPde); // // Map in the page table diff --git a/ntoskrnl/mm/ARM3/pfnlist.c b/ntoskrnl/mm/ARM3/pfnlist.c index 58043400af6..ff17eb0b3c8 100644 --- a/ntoskrnl/mm/ARM3/pfnlist.c +++ b/ntoskrnl/mm/ARM3/pfnlist.c @@ -18,6 +18,9 @@ /* GLOBALS ********************************************************************/ +BOOLEAN MmDynamicPfn; +BOOLEAN MmMirroring; + MMPFNLIST MmZeroedPageListHead = {0, ZeroedPageList, LIST_HEAD, LIST_HEAD}; MMPFNLIST MmFreePageListHead = {0, FreePageList, LIST_HEAD, LIST_HEAD}; MMPFNLIST MmStandbyPageListHead = {0, StandbyPageList, LIST_HEAD, LIST_HEAD}; @@ -241,6 +244,175 @@ MiUnlinkFreeOrZeroedPage(IN PMMPFN Entry) } } +PFN_NUMBER +NTAPI +MiRemovePageByColor(IN PFN_NUMBER PageIndex, + IN ULONG Color) +{ + PMMPFN Pfn1; + PMMPFNLIST ListHead; + MMLISTS ListName; + PFN_NUMBER OldFlink, OldBlink; + ULONG OldColor, OldCache; +#if 0 + PMMCOLOR_TABLES ColorTable; +#endif + /* Make sure PFN lock is held */ + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT(Color < MmSecondaryColors); + + /* Get the PFN entry */ + Pfn1 = MiGetPfnEntry(PageIndex); + ASSERT(Pfn1->u3.e1.RemovalRequested == 0); + ASSERT(Pfn1->u3.e1.Rom == 0); + + /* Capture data for later */ + OldColor = Pfn1->u3.e1.PageColor; + OldCache = Pfn1->u3.e1.CacheAttribute; + + /* Could be either on free or zero list */ + ListHead = MmPageLocationList[Pfn1->u3.e1.PageLocation]; + ListName = ListHead->ListName; + ASSERT(ListName <= FreePageList); + + /* Remove a page */ + ListHead->Total--; + + /* Get the forward and back pointers */ + OldFlink = Pfn1->u1.Flink; + OldBlink = Pfn1->u2.Blink; + + /* Check if the next entry is the list head */ + if (OldFlink != LIST_HEAD) + { + /* It is not, so set the backlink of the actual entry, to our backlink */ + MiGetPfnEntry(OldFlink)->u2.Blink = OldBlink; + } + else + { + /* Set the list head's backlink instead */ + ListHead->Blink = OldFlink; + } + + /* Check if the back entry is the list head */ + if (OldBlink != LIST_HEAD) + { + /* It is not, so set the backlink of the actual entry, to our backlink */ + MiGetPfnEntry(OldBlink)->u1.Flink = OldFlink; + } + else + { + /* Set the list head's backlink instead */ + ListHead->Flink = OldFlink; + } + + /* We are not on a list anymore */ + Pfn1->u1.Flink = Pfn1->u2.Blink = 0; + + /* Zero flags but restore color and cache */ + Pfn1->u3.e2.ShortFlags = 0; + Pfn1->u3.e1.PageColor = OldColor; + Pfn1->u3.e1.CacheAttribute = OldCache; +#if 0 // When switching to ARM3 + /* Get the first page on the color list */ + ColorTable = &MmFreePagesByColor[ListName][Color]; + ASSERT(ColorTable->Count >= 1); + + /* Set the forward link to whoever we were pointing to */ + ColorTable->Flink = Pfn1->OriginalPte.u.Long; + if (ColorTable->Flink == LIST_HEAD) + { + /* This is the beginning of the list, so set the sentinel value */ + ColorTable->Blink = LIST_HEAD; + } + else + { + /* The list is empty, so we are the first page */ + MiGetPfnEntry(ColorTable->Flink)->u4.PteFrame = -1; + } + + /* One more page */ + ColorTable->Total++; +#endif + /* See if we hit any thresholds */ + if (MmAvailablePages == MmHighMemoryThreshold) + { + /* Clear the high memory event */ + KeClearEvent(MiHighMemoryEvent); + } + else if (MmAvailablePages == MmLowMemoryThreshold) + { + /* Signal the low memory event */ + KeSetEvent(MiLowMemoryEvent, 0, FALSE); + } + + /* One less page */ + if (--MmAvailablePages < MmMinimumFreePages) + { + /* FIXME: Should wake up the MPW and working set manager, if we had one */ + } + + /* Return the page */ + return PageIndex; +} + +PFN_NUMBER +NTAPI +MiRemoveAnyPage(IN ULONG Color) +{ + PFN_NUMBER PageIndex; + PMMPFN Pfn1; + + /* Make sure PFN lock is held and we have pages */ + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT(MmAvailablePages != 0); + ASSERT(Color < MmSecondaryColors); + + /* Check the colored free list */ +#if 0 // Enable when using ARM3 database */ + PageIndex = MmFreePagesByColor[FreePageList][Color].Flink; + if (PageIndex == LIST_HEAD) + { + /* Check the colored zero list */ + PageIndex = MmFreePagesByColor[ZeroedPageList][Color].Flink; + if (PageIndex == LIST_HEAD) + { +#endif + /* Check the free list */ + PageIndex = MmFreePageListHead.Flink; + Color = PageIndex & MmSecondaryColorMask; + if (PageIndex == LIST_HEAD) + { + /* Check the zero list */ + ASSERT(MmFreePageListHead.Total == 0); + PageIndex = MmZeroedPageListHead.Flink; + Color = PageIndex & MmSecondaryColorMask; + ASSERT(PageIndex != LIST_HEAD); + if (PageIndex == LIST_HEAD) + { + /* FIXME: Should check the standby list */ + ASSERT(MmZeroedPageListHead.Total == 0); + } + } +#if 0 // Enable when using ARM3 database */ + } + } +#endif + + /* Remove the page from its list */ + PageIndex = MiRemovePageByColor(PageIndex, Color); + + /* Sanity checks */ + Pfn1 = MiGetPfnEntry(PageIndex); + ASSERT((Pfn1->u3.e1.PageLocation == FreePageList) || + (Pfn1->u3.e1.PageLocation == ZeroedPageList)); + ASSERT(Pfn1->u3.e2.ReferenceCount == 0); + ASSERT(Pfn1->u2.ShareCount == 0); + + /* Return the page */ + return PageIndex; +} + PMMPFN NTAPI MiRemoveHeadList(IN PMMPFNLIST ListHead) @@ -282,17 +454,19 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) { PMMPFNLIST ListHead; PFN_NUMBER LastPage; - PMMPFN Pfn1, Blink; + PMMPFN Pfn1; +#if 0 ULONG Color; - PMMCOLOR_TABLES ColorHead; - + PMMPFN Blink; + PMMCOLOR_TABLES ColorTable; +#endif /* Make sure the page index is valid */ ASSERT((PageFrameIndex != 0) && (PageFrameIndex <= MmHighestPhysicalPage) && (PageFrameIndex >= MmLowestPhysicalPage)); /* Get the PFN entry */ - Pfn1 = MI_PFN_TO_PFNENTRY(PageFrameIndex); + Pfn1 = MiGetPfnEntry(PageFrameIndex); /* Sanity checks that a right kind of page is being inserted here */ ASSERT(Pfn1->u4.MustBeCached == 0); @@ -310,7 +484,7 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) if (LastPage != LIST_HEAD) { /* Link us with the previous page, so we're at the end now */ - MI_PFN_TO_PFNENTRY(LastPage)->u1.Flink = PageFrameIndex; + MiGetPfnEntry(LastPage)->u1.Flink = PageFrameIndex; } else { @@ -333,8 +507,8 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) Pfn1->u4.InPageError = 0; Pfn1->u4.AweAllocation = 0; - /* Not yet until we switch to this */ - //MmAvailablePages++; + /* Increase available pages */ + MmAvailablePages++; /* Check if we've reached the configured low memory threshold */ if (MmAvailablePages == MmLowMemoryThreshold) @@ -348,21 +522,22 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) KeSetEvent(MiHighMemoryEvent, 0, FALSE); } +#if 0 // When using ARM3 PFN /* Get the page color */ Color = PageFrameIndex & MmSecondaryColorMask; /* Get the first page on the color list */ - ColorHead = &MmFreePagesByColor[FreePageList][Color]; - if (ColorHead->Flink == LIST_HEAD) + ColorTable = &MmFreePagesByColor[FreePageList][Color]; + if (ColorTable->Flink == LIST_HEAD) { /* The list is empty, so we are the first page */ Pfn1->u4.PteFrame = -1; - ColorHead->Flink = PageFrameIndex; + ColorTable->Flink = PageFrameIndex; } else { /* Get the previous page */ - Blink = (PMMPFN)ColorHead->Blink; + Blink = (PMMPFN)ColorTable->Blink; /* Make it link to us */ Pfn1->u4.PteFrame = MI_PFNENTRY_TO_PFN(Blink); @@ -370,13 +545,20 @@ MiInsertPageInFreeList(IN PFN_NUMBER PageFrameIndex) } /* Now initialize our own list pointers */ - ColorHead->Blink = Pfn1; + ColorTable->Blink = Pfn1; Pfn1->OriginalPte.u.Long = LIST_HEAD; /* And increase the count in the colored list */ - ColorHead->Count++; + ColorTable->Count++; +#endif - /* FIXME: Notify zero page thread if enough pages are on the free list now */ + /* Notify zero page thread if enough pages are on the free list now */ + extern KEVENT ZeroPageThreadEvent; + if ((MmFreePageListHead.Total > 8) && !(KeReadStateEvent(&ZeroPageThreadEvent))) + { + /* This is ReactOS-specific */ + KeSetEvent(&ZeroPageThreadEvent, IO_NO_INCREMENT, FALSE); + } } /* EOF */ diff --git a/ntoskrnl/mm/ARM3/pool.c b/ntoskrnl/mm/ARM3/pool.c index bd2f826c6d2..17c99223e00 100644 --- a/ntoskrnl/mm/ARM3/pool.c +++ b/ntoskrnl/mm/ARM3/pool.c @@ -26,6 +26,8 @@ KGUARDED_MUTEX MmPagedPoolMutex; MM_PAGED_POOL_INFO MmPagedPoolInfo; SIZE_T MmAllocatedNonPagedPool; ULONG MmSpecialPoolTag; +ULONG MmConsumedPoolPercentage; +BOOLEAN MmProtectFreedNonPagedPool; /* PRIVATE FUNCTIONS **********************************************************/ @@ -332,12 +334,13 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, // // Save it into our double-buffered system page directory // + /* This seems to be making the assumption that one PDE is one page long */ + ASSERT(PAGE_SIZE == (PD_COUNT * (sizeof(MMPTE) * PDE_COUNT))); MmSystemPagePtes[(ULONG_PTR)PointerPte & (PAGE_SIZE - 1) / sizeof(MMPTE)] = TempPte; - // - // Write the actual PTE now - // + /* Write the actual PTE now */ + ASSERT(TempPte.u.Hard.Valid == 1); *PointerPte++ = TempPte; // @@ -430,6 +433,7 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, // // Write the demand zero PTE and keep going // + ASSERT(PointerPte->u.Hard.Valid == 0); *PointerPte++ = TempPte; } while (PointerPte < StartPte); @@ -591,14 +595,15 @@ MiAllocatePoolPages(IN POOL_TYPE PoolType, // PageFrameNumber = MmAllocPage(MC_NPPOOL); - // - // Get the PFN entry for it - // + /* Get the PFN entry for it and fill it out */ Pfn1 = MiGetPfnEntry(PageFrameNumber); + Pfn1->u3.e2.ReferenceCount = 1; + Pfn1->u2.ShareCount = 1; + Pfn1->PteAddress = PointerPte; + Pfn1->u3.e1.PageLocation = ActiveAndValid; + Pfn1->u4.VerifierAllocation = 0; - // - // Write the PTE for it - // + /* Write the PTE for it */ TempPte.u.Hard.PageFrameNumber = PageFrameNumber; ASSERT(PointerPte->u.Hard.Valid == 0); ASSERT(TempPte.u.Hard.Valid == 1); diff --git a/ntoskrnl/mm/ARM3/procsup.c b/ntoskrnl/mm/ARM3/procsup.c index 24bd11a2586..8f1e6b732c1 100644 --- a/ntoskrnl/mm/ARM3/procsup.c +++ b/ntoskrnl/mm/ARM3/procsup.c @@ -153,7 +153,6 @@ MmCreateKernelStack(IN BOOLEAN GuiStack, // Next PTE // PointerPte++; - ASSERT(PointerPte->u.Hard.Valid == 0); // // Get a page @@ -164,6 +163,8 @@ MmCreateKernelStack(IN BOOLEAN GuiStack, // // Write it // + ASSERT(PointerPte->u.Hard.Valid == 0); + ASSERT(TempPte.u.Hard.Valid == 1); *PointerPte = TempPte; } @@ -243,26 +244,21 @@ MmGrowKernelStackEx(IN PVOID StackPointer, // Acquire the PFN DB lock // OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - + // // Loop each stack page // while (LimitPte >= NewLimitPte) { - // - // Sanity check - // - ASSERT(LimitPte->u.Hard.Valid == 0); - // // Get a page // PageFrameIndex = MmAllocPage(MC_NPPOOL); TempPte.u.Hard.PageFrameNumber = PageFrameIndex; - // - // Write it - // + /* Write the valid PTE */ + ASSERT(LimitPte->u.Hard.Valid == 0); + ASSERT(TempPte.u.Hard.Valid == 1); *LimitPte-- = TempPte; } diff --git a/ntoskrnl/mm/freelist.c b/ntoskrnl/mm/freelist.c index 7f2646f7452..b6b9806e4b0 100644 --- a/ntoskrnl/mm/freelist.c +++ b/ntoskrnl/mm/freelist.c @@ -36,8 +36,9 @@ /* The first array contains ReactOS PFNs, the second contains ARM3 PFNs */ PPHYSICAL_PAGE MmPfnDatabase[2]; -ULONG MmAvailablePages; -ULONG MmResidentAvailablePages; +PFN_NUMBER MmAvailablePages; +PFN_NUMBER MmResidentAvailablePages; +PFN_NUMBER MmResidentAvailableAtInit; SIZE_T MmTotalCommitLimit; SIZE_T MmTotalCommittedPages; @@ -48,7 +49,7 @@ SIZE_T MmPagedPoolCommit; SIZE_T MmPeakCommitment; SIZE_T MmtotalCommitLimitMaximum; -static KEVENT ZeroPageThreadEvent; +KEVENT ZeroPageThreadEvent; static BOOLEAN ZeroPageThreadShouldTerminate = FALSE; static RTL_BITMAP MiUserPfnBitMap; @@ -129,198 +130,21 @@ MmRemoveLRUUserPage(PFN_TYPE Page) BOOLEAN NTAPI -MiIsPfnInUse(IN PMMPFN Pfn1) +MiIsPfnFree(IN PMMPFN Pfn1) { - return ((Pfn1->u3.e1.PageLocation != FreePageList) && - (Pfn1->u3.e1.PageLocation != ZeroedPageList)); + /* Must be a free or zero page, with no references, linked */ + return ((Pfn1->u3.e1.PageLocation <= StandbyPageList) && + (Pfn1->u1.Flink) && + (Pfn1->u2.Blink) && + !(Pfn1->u3.e2.ReferenceCount)); } -PFN_NUMBER +BOOLEAN NTAPI -MiFindContiguousPages(IN PFN_NUMBER LowestPfn, - IN PFN_NUMBER HighestPfn, - IN PFN_NUMBER BoundaryPfn, - IN PFN_NUMBER SizeInPages, - IN MEMORY_CACHING_TYPE CacheType) +MiIsPfnInUse(IN PMMPFN Pfn1) { - PFN_NUMBER Page, PageCount, LastPage, Length, BoundaryMask; - ULONG i = 0; - PMMPFN Pfn1, EndPfn; - KIRQL OldIrql; - PAGED_CODE (); - ASSERT(SizeInPages != 0); - - // - // Convert the boundary PFN into an alignment mask - // - BoundaryMask = ~(BoundaryPfn - 1); - - // - // Loop all the physical memory blocks - // - do - { - // - // Capture the base page and length of this memory block - // - Page = MmPhysicalMemoryBlock->Run[i].BasePage; - PageCount = MmPhysicalMemoryBlock->Run[i].PageCount; - - // - // Check how far this memory block will go - // - LastPage = Page + PageCount; - - // - // Trim it down to only the PFNs we're actually interested in - // - if ((LastPage - 1) > HighestPfn) LastPage = HighestPfn + 1; - if (Page < LowestPfn) Page = LowestPfn; - - // - // Skip this run if it's empty or fails to contain all the pages we need - // - if (!(PageCount) || ((Page + SizeInPages) > LastPage)) continue; - - // - // Now scan all the relevant PFNs in this run - // - Length = 0; - for (Pfn1 = MiGetPfnEntry(Page); Page < LastPage; Page++, Pfn1++) - { - // - // If this PFN is in use, ignore it - // - if (MiIsPfnInUse(Pfn1)) continue; - - // - // If we haven't chosen a start PFN yet and the caller specified an - // alignment, make sure the page matches the alignment restriction - // - if ((!(Length) && (BoundaryPfn)) && - (((Page ^ (Page + SizeInPages - 1)) & BoundaryMask))) - { - // - // It does not, so bail out - // - continue; - } - - // - // Increase the number of valid pages, and check if we have enough - // - if (++Length == SizeInPages) - { - // - // It appears we've amassed enough legitimate pages, rollback - // - Pfn1 -= (Length - 1); - Page -= (Length - 1); - - // - // Acquire the PFN lock - // - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - do - { - // - // Things might've changed for us. Is the page still free? - // - if (MiIsPfnInUse(Pfn1)) break; - - // - // So far so good. Is this the last confirmed valid page? - // - if (!--Length) - { - // - // Sanity check that we didn't go out of bounds - // - ASSERT(i != MmPhysicalMemoryBlock->NumberOfRuns); - - // - // Loop until all PFN entries have been processed - // - EndPfn = Pfn1 - SizeInPages + 1; - do - { - // - // This PFN is now a used page, set it up - // - MiUnlinkFreeOrZeroedPage(Pfn1); - Pfn1->u3.e2.ReferenceCount = 1; - - // - // Check if it was already zeroed - // - if (Pfn1->u3.e1.PageLocation != ZeroedPageList) - { - // - // It wasn't, so zero it - // - MiZeroPage(MiGetPfnEntryIndex(Pfn1)); - } - - // - // Mark it in use - // - Pfn1->u3.e1.PageLocation = ActiveAndValid; - - // - // Check if this is the last PFN, otherwise go on - // - if (Pfn1 == EndPfn) break; - Pfn1--; - } while (TRUE); - - // - // Mark the first and last PFN so we can find them later - // - Pfn1->u3.e1.StartOfAllocation = 1; - (Pfn1 + SizeInPages - 1)->u3.e1.EndOfAllocation = 1; - - // - // Now it's safe to let go of the PFN lock - // - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - - // - // Quick sanity check that the last PFN is consistent - // - EndPfn = Pfn1 + SizeInPages; - ASSERT(EndPfn == MiGetPfnEntry(Page + 1)); - - // - // Compute the first page, and make sure it's consistent - // - Page -= SizeInPages - 1; - ASSERT(Pfn1 == MiGetPfnEntry(Page)); - ASSERT(Page != 0); - return Page; - } - - // - // Keep going. The purpose of this loop is to reconfirm that - // after acquiring the PFN lock these pages are still usable - // - Pfn1++; - Page++; - } while (TRUE); - - // - // If we got here, something changed while we hadn't acquired - // the PFN lock yet, so we'll have to restart - // - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - Length = 0; - } - } - } while (++i != MmPhysicalMemoryBlock->NumberOfRuns); - - // - // And if we get here, it means no suitable physical memory runs were found - // - return 0; + /* Standby list or higher, unlinked, and with references */ + return !MiIsPfnFree(Pfn1); } PMDL diff --git a/ntoskrnl/mm/mmfault.c b/ntoskrnl/mm/mmfault.c index e00739bb3b5..f908e608bed 100644 --- a/ntoskrnl/mm/mmfault.c +++ b/ntoskrnl/mm/mmfault.c @@ -274,15 +274,23 @@ MmAccessFault(IN BOOLEAN StoreInstruction, #endif } - // - // Check if this is an ARM3 memory area - // + /* + * Check if this is an ARM3 memory area or if there's no memory area at all. + * The latter can happen early in the boot cycle when ARM3 paged pool is in + * use before having defined the memory areas proper. + * A proper fix would be to define memory areas in the ARM3 code, but we want + * to avoid adding this ReactOS-specific construct to ARM3 code. + * Either way, in the future, as ReactOS-paged pool is eliminated, this hack + * can go away. + */ MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address); - if ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)) + if ((!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmSystemRangeStart)) || + ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3))) { // // Hand it off to more competent hands... // + DPRINT1("ARM3 fault\n"); return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation); } diff --git a/ntoskrnl/mm/mminit.c b/ntoskrnl/mm/mminit.c index 8a9fd4297c3..cb10634fdc2 100644 --- a/ntoskrnl/mm/mminit.c +++ b/ntoskrnl/mm/mminit.c @@ -398,18 +398,13 @@ MmInitSystem(IN ULONG Phase, /* Initialize paged pool */ MmInitializePagedPool(); - /* Initialize working sets */ - MiInitializeUserPfnBitmap(); - MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); - - /* Reload boot drivers */ - MiReloadBootLoadedDrivers(LoaderBlock); - /* Initialize the loaded module list */ MiInitializeLoadedModuleList(LoaderBlock); } else if (Phase == 1) { + MiInitializeUserPfnBitmap(); + MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory); MmInitializeRmapList(); MmInitializePageOp(); MmInitSectionImplementation(); diff --git a/ntoskrnl/mm/pagefile.c b/ntoskrnl/mm/pagefile.c index 1af2faccaa5..1ea2c41c29f 100644 --- a/ntoskrnl/mm/pagefile.c +++ b/ntoskrnl/mm/pagefile.c @@ -86,6 +86,8 @@ ULONG MiFreeSwapPages; /* Number of pages that have been allocated for swapping */ ULONG MiUsedSwapPages; +BOOLEAN MmZeroPageFile; + /* * Number of pages that have been reserved for swapping but not yet allocated */ diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index 582af62037d..fc708953a00 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -71,6 +71,8 @@ MM_SECTION_PAGEOUT_CONTEXT; POBJECT_TYPE MmSectionObjectType = NULL; +BOOLEAN MmAllocationFragment; + ULONG_PTR MmSubsectionBase; static GENERIC_MAPPING MmpSectionMapping = { diff --git a/ntoskrnl/mm/sysldr.c b/ntoskrnl/mm/sysldr.c index 281a3966bb2..fcecf3c8da5 100644 --- a/ntoskrnl/mm/sysldr.c +++ b/ntoskrnl/mm/sysldr.c @@ -39,10 +39,17 @@ ERESOURCE PsLoadedModuleResource; ULONG_PTR PsNtosImageBase; KMUTANT MmSystemLoadLock; +PFN_NUMBER MmTotalSystemDriverPages; + PVOID MmUnloadedDrivers; PVOID MmLastUnloadedDrivers; -PVOID MmTriageActionTaken; -PVOID KernelVerifier; + +BOOLEAN MmMakeLowMemory; +BOOLEAN MmEnforceWriteProtection = TRUE; + +PMMPTE MiKernelResourceStartPte, MiKernelResourceEndPte; +ULONG_PTR ExPoolCodeStart, ExPoolCodeEnd, MmPoolCodeStart, MmPoolCodeEnd; +ULONG_PTR MmPteCodeStart, MmPteCodeEnd; /* FUNCTIONS ******************************************************************/ @@ -188,120 +195,6 @@ MiLoadImageSection(IN OUT PVOID *SectionPtr, return Status; } -NTSTATUS -NTAPI -MiDereferenceImports(IN PLOAD_IMPORTS ImportList) -{ - SIZE_T i; - - /* Check if there's no imports or if we're a boot driver */ - if ((ImportList == (PVOID)-1) || - (ImportList == (PVOID)-2) || - (ImportList->Count == 0)) - { - /* Then there's nothing to do */ - return STATUS_SUCCESS; - } - - /* Otherwise, FIXME */ - DPRINT1("%u imports not dereferenced!\n", ImportList->Count); - for (i = 0; i < ImportList->Count; i++) - { - DPRINT1("%wZ <%wZ>\n", &ImportList->Entry[i]->FullDllName, &ImportList->Entry[i]->BaseDllName); - } - return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -MiClearImports(IN PLDR_DATA_TABLE_ENTRY LdrEntry) -{ - PAGED_CODE(); - - /* Check if there's no imports or we're a boot driver or only one entry */ - if ((LdrEntry->LoadedImports == (PVOID)-1) || - (LdrEntry->LoadedImports == (PVOID)-2) || - ((ULONG_PTR)LdrEntry->LoadedImports & 1)) - { - /* Nothing to do */ - return; - } - - /* Otherwise, free the import list */ - ExFreePool(LdrEntry->LoadedImports); -} - -PVOID -NTAPI -MiFindExportedRoutineByName(IN PVOID DllBase, - IN PANSI_STRING ExportName) -{ - PULONG NameTable; - PUSHORT OrdinalTable; - PIMAGE_EXPORT_DIRECTORY ExportDirectory; - LONG Low = 0, Mid = 0, High, Ret; - USHORT Ordinal; - PVOID Function; - ULONG ExportSize; - PULONG ExportTable; - PAGED_CODE(); - - /* Get the export directory */ - ExportDirectory = RtlImageDirectoryEntryToData(DllBase, - TRUE, - IMAGE_DIRECTORY_ENTRY_EXPORT, - &ExportSize); - if (!ExportDirectory) return NULL; - - /* Setup name tables */ - NameTable = (PULONG)((ULONG_PTR)DllBase + - ExportDirectory->AddressOfNames); - OrdinalTable = (PUSHORT)((ULONG_PTR)DllBase + - ExportDirectory->AddressOfNameOrdinals); - - /* Do a binary search */ - High = ExportDirectory->NumberOfNames - 1; - while (High >= Low) - { - /* Get new middle value */ - Mid = (Low + High) >> 1; - - /* Compare name */ - Ret = strcmp(ExportName->Buffer, (PCHAR)DllBase + NameTable[Mid]); - if (Ret < 0) - { - /* Update high */ - High = Mid - 1; - } - else if (Ret > 0) - { - /* Update low */ - Low = Mid + 1; - } - else - { - /* We got it */ - break; - } - } - - /* Check if we couldn't find it */ - if (High < Low) return NULL; - - /* Otherwise, this is the ordinal */ - Ordinal = OrdinalTable[Mid]; - - /* Resolve the address and write it */ - ExportTable = (PULONG)((ULONG_PTR)DllBase + - ExportDirectory->AddressOfFunctions); - Function = (PVOID)((ULONG_PTR)DllBase + ExportTable[Ordinal]); - - /* We found it! */ - ASSERT(!(Function > (PVOID)ExportDirectory) && - (Function < (PVOID)((ULONG_PTR)ExportDirectory + ExportSize))); - return Function; -} - PVOID NTAPI MiLocateExportName(IN PVOID DllBase, @@ -440,6 +333,200 @@ MmCallDllInitialize(IN PLDR_DATA_TABLE_ENTRY LdrEntry, return Status; } +BOOLEAN +NTAPI +MiCallDllUnloadAndUnloadDll(IN PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + NTSTATUS Status; + PMM_DLL_UNLOAD Func; + PAGED_CODE(); + + /* Get the unload routine */ + Func = (PMM_DLL_UNLOAD)MiLocateExportName(LdrEntry->DllBase, "DllUnload"); + if (!Func) return FALSE; + + /* Call it and check for success */ + Status = Func(); + if (!NT_SUCCESS(Status)) return FALSE; + + /* Lie about the load count so we can unload the image */ + ASSERT(LdrEntry->LoadCount == 0); + LdrEntry->LoadCount = 1; + + /* Unload it and return true */ + MmUnloadSystemImage(LdrEntry); + return TRUE; +} + +NTSTATUS +NTAPI +MiDereferenceImports(IN PLOAD_IMPORTS ImportList) +{ + SIZE_T i; + LOAD_IMPORTS SingleEntry; + PLDR_DATA_TABLE_ENTRY LdrEntry; + PVOID CurrentImports; + PAGED_CODE(); + + /* Check if there's no imports or if we're a boot driver */ + if ((ImportList == MM_SYSLDR_NO_IMPORTS) || + (ImportList == MM_SYSLDR_BOOT_LOADED) || + (ImportList->Count == 0)) + { + /* Then there's nothing to do */ + return STATUS_SUCCESS; + } + + /* Check for single-entry */ + if ((ULONG_PTR)ImportList & MM_SYSLDR_SINGLE_ENTRY) + { + /* Set it up */ + SingleEntry.Count = 1; + SingleEntry.Entry[0] = (PVOID)((ULONG_PTR)ImportList &~ MM_SYSLDR_SINGLE_ENTRY); + + /* Use this as the import list */ + ImportList = &SingleEntry; + } + + /* Loop the import list */ + for (i = 0; (i < ImportList->Count) && (ImportList->Entry[i]); i++) + { + /* Get the entry */ + LdrEntry = ImportList->Entry[i]; + DPRINT1("%wZ <%wZ>\n", &LdrEntry->FullDllName, &LdrEntry->BaseDllName); + + /* Skip boot loaded images */ + if (LdrEntry->LoadedImports == MM_SYSLDR_BOOT_LOADED) continue; + + /* Dereference the entry */ + ASSERT(LdrEntry->LoadCount >= 1); + if (!--LdrEntry->LoadCount) + { + /* Save the import data in case unload fails */ + CurrentImports = LdrEntry->LoadedImports; + + /* This is the last entry */ + LdrEntry->LoadedImports = MM_SYSLDR_NO_IMPORTS; + if (MiCallDllUnloadAndUnloadDll(LdrEntry)) + { + /* Unloading worked, parse this DLL's imports too */ + MiDereferenceImports(CurrentImports); + + /* Check if we had valid imports */ + if ((CurrentImports != MM_SYSLDR_BOOT_LOADED) || + (CurrentImports != MM_SYSLDR_NO_IMPORTS) || + !((ULONG_PTR)LdrEntry->LoadedImports & MM_SYSLDR_SINGLE_ENTRY)) + { + /* Free them */ + ExFreePool(CurrentImports); + } + } + else + { + /* Unload failed, restore imports */ + LdrEntry->LoadedImports = CurrentImports; + } + } + } + + /* Done */ + return STATUS_SUCCESS; +} + +VOID +NTAPI +MiClearImports(IN PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + PAGED_CODE(); + + /* Check if there's no imports or we're a boot driver or only one entry */ + if ((LdrEntry->LoadedImports == MM_SYSLDR_BOOT_LOADED) || + (LdrEntry->LoadedImports == MM_SYSLDR_NO_IMPORTS) || + ((ULONG_PTR)LdrEntry->LoadedImports & MM_SYSLDR_SINGLE_ENTRY)) + { + /* Nothing to do */ + return; + } + + /* Otherwise, free the import list */ + ExFreePool(LdrEntry->LoadedImports); + LdrEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; +} + +PVOID +NTAPI +MiFindExportedRoutineByName(IN PVOID DllBase, + IN PANSI_STRING ExportName) +{ + PULONG NameTable; + PUSHORT OrdinalTable; + PIMAGE_EXPORT_DIRECTORY ExportDirectory; + LONG Low = 0, Mid = 0, High, Ret; + USHORT Ordinal; + PVOID Function; + ULONG ExportSize; + PULONG ExportTable; + PAGED_CODE(); + + /* Get the export directory */ + ExportDirectory = RtlImageDirectoryEntryToData(DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_EXPORT, + &ExportSize); + if (!ExportDirectory) return NULL; + + /* Setup name tables */ + NameTable = (PULONG)((ULONG_PTR)DllBase + + ExportDirectory->AddressOfNames); + OrdinalTable = (PUSHORT)((ULONG_PTR)DllBase + + ExportDirectory->AddressOfNameOrdinals); + + /* Do a binary search */ + High = ExportDirectory->NumberOfNames - 1; + while (High >= Low) + { + /* Get new middle value */ + Mid = (Low + High) >> 1; + + /* Compare name */ + Ret = strcmp(ExportName->Buffer, (PCHAR)DllBase + NameTable[Mid]); + if (Ret < 0) + { + /* Update high */ + High = Mid - 1; + } + else if (Ret > 0) + { + /* Update low */ + Low = Mid + 1; + } + else + { + /* We got it */ + break; + } + } + + /* Check if we couldn't find it */ + if (High < Low) return NULL; + + /* Otherwise, this is the ordinal */ + Ordinal = OrdinalTable[Mid]; + + /* Validate the ordinal */ + if (Ordinal >= ExportDirectory->NumberOfFunctions) return NULL; + + /* Resolve the address and write it */ + ExportTable = (PULONG)((ULONG_PTR)DllBase + + ExportDirectory->AddressOfFunctions); + Function = (PVOID)((ULONG_PTR)DllBase + ExportTable[Ordinal]); + + /* We found it! */ + ASSERT(!(Function > (PVOID)ExportDirectory) && + (Function < (PVOID)((ULONG_PTR)ExportDirectory + ExportSize))); + return Function; +} + VOID NTAPI MiProcessLoaderEntry(IN PLDR_DATA_TABLE_ENTRY LdrEntry, @@ -474,9 +561,9 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, ULONG_PTR OldBaseTop, Delta; PLDR_DATA_TABLE_ENTRY LdrEntry; PLIST_ENTRY NextEntry; - ULONG ImportSize; + ULONG ImportSize, i; + PULONG_PTR ImageThunk; PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor; - PULONG ImageThunk; /* Calculate the top and delta */ OldBaseTop = (ULONG_PTR)OldBase + Size - 1; @@ -491,8 +578,30 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, LdrEntry = CONTAINING_RECORD(NextEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); +#ifdef _WORKING_LINKER_ + /* Get the IAT */ + ImageThunk = RtlImageDirectoryEntryToData(LdrEntry->DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_IAT, + &ImportSize); + if (!ImageThunk) continue; + /* Make sure we have an IAT */ + DPRINT("[Mm0]: Updating thunks in: %wZ\n", &LdrEntry->BaseDllName); + for (i = 0; i < ImportSize; i++, ImageThunk++) + { + /* Check if it's within this module */ + if ((*ImageThunk >= (ULONG_PTR)OldBase) && (*ImageThunk <= OldBaseTop)) + { + /* Relocate it */ + DPRINT("[Mm0]: Updating IAT at: %p. Old Entry: %p. New Entry: %p.\n", + ImageThunk, *ImageThunk, *ImageThunk + Delta); + *ImageThunk += Delta; + } + } +#else /* Get the import table */ + i = ImportSize; ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, @@ -525,6 +634,7 @@ MiUpdateThunks(IN PLOADER_PARAMETER_BLOCK LoaderBlock, /* Go to the next import */ ImportDescriptor++; } +#endif } } @@ -592,7 +702,7 @@ MiSnapThunk(IN PVOID DllBase, /* Get the hint and check if it's valid */ Hint = NameImport->Hint; if ((Hint < ExportDirectory->NumberOfNames) && - !(strcmp((PCHAR) NameImport->Name, (PCHAR)DllBase + NameTable[Hint]))) + !(strcmp((PCHAR)NameImport->Name, (PCHAR)DllBase + NameTable[Hint]))) { /* We have a match, get the ordinal number from here */ Ordinal = OrdinalTable[Hint]; @@ -763,7 +873,7 @@ MmUnloadSystemImage(IN PVOID ImageHandle) NULL); /* Check if this driver was loaded at boot and didn't get imports parsed */ - if (LdrEntry->LoadedImports == (PVOID)-1) goto Done; + if (LdrEntry->LoadedImports == MM_SYSLDR_BOOT_LOADED) goto Done; /* We should still be alive */ ASSERT(LdrEntry->LoadCount != 0); @@ -790,6 +900,7 @@ MmUnloadSystemImage(IN PVOID ImageHandle) } /* FIXME: Free the driver */ + DPRINT1("Leaking driver: %wZ\n", &LdrEntry->BaseDllName); //MmFreeSection(LdrEntry->DllBase); /* Check if we're linked in */ @@ -860,7 +971,7 @@ MiResolveImageReferences(IN PVOID ImageBase, __FUNCTION__, ImageBase, ImageFileDirectory); /* Assume no imports */ - *LoadImports = (PVOID)-2; + *LoadImports = MM_SYSLDR_NO_IMPORTS; /* Get the import descriptor */ ImportDescriptor = RtlImageDirectoryEntryToData(ImageBase, @@ -885,11 +996,12 @@ MiResolveImageReferences(IN PVOID ImageBase, LoadedImportsSize = ImportCount * sizeof(PVOID) + sizeof(SIZE_T); LoadedImports = ExAllocatePoolWithTag(PagedPool, LoadedImportsSize, - TAG_LDR_WSTR); + 'TDmM'); if (LoadedImports) { /* Zero it */ RtlZeroMemory(LoadedImports, LoadedImportsSize); + LoadedImports->Count = ImportCount; } } else @@ -909,10 +1021,12 @@ MiResolveImageReferences(IN PVOID ImageBase, GdiLink = GdiLink | !(_strnicmp(ImportName, "win32k", sizeof("win32k") - 1)); - /* We can also allow dxapi */ + /* We can also allow dxapi (for Windows compat, allow IRT and coverage )*/ NormalLink = NormalLink | ((_strnicmp(ImportName, "win32k", sizeof("win32k") - 1)) && - (_strnicmp(ImportName, "dxapi", sizeof("dxapi") - 1))); + (_strnicmp(ImportName, "dxapi", sizeof("dxapi") - 1)) && + (_strnicmp(ImportName, "coverage", sizeof("coverage") - 1)) && + (_strnicmp(ImportName, "irt", sizeof("irt") - 1))); /* Check if this is a valid GDI driver */ if ((GdiLink) && (NormalLink)) @@ -923,6 +1037,20 @@ MiResolveImageReferences(IN PVOID ImageBase, return STATUS_PROCEDURE_NOT_FOUND; } + /* Check for user-mode printer or video card drivers, which don't belong */ + if (!(_strnicmp(ImportName, "ntdll", sizeof("ntdll") - 1)) || + !(_strnicmp(ImportName, "winsrv", sizeof("winsrv") - 1)) || + !(_strnicmp(ImportName, "advapi32", sizeof("advapi32") - 1)) || + !(_strnicmp(ImportName, "kernel32", sizeof("kernel32") - 1)) || + !(_strnicmp(ImportName, "user32", sizeof("user32") - 1)) || + !(_strnicmp(ImportName, "gdi32", sizeof("gdi32") - 1))) + { + /* This is not kernel code */ + MiDereferenceImports(LoadedImports); + if (LoadedImports) ExFreePool(LoadedImports); + return STATUS_PROCEDURE_NOT_FOUND; + } + /* Check if this is a "core" import, which doesn't get referenced */ if (!(_strnicmp(ImportName, "ntoskrnl", sizeof("ntoskrnl") - 1)) || !(_strnicmp(ImportName, "win32k", sizeof("win32k") - 1)) || @@ -999,7 +1127,7 @@ CheckDllState: sizeof(UNICODE_NULL); DllName.Buffer = ExAllocatePoolWithTag(NonPagedPool, DllName.MaximumLength, - TAG_LDR_WSTR); + 'TDmM'); if (DllName.Buffer) { /* Setup the base length and copy it */ @@ -1011,13 +1139,13 @@ CheckDllState: /* Now add the import name and null-terminate it */ RtlAppendStringToString((PSTRING)&DllName, (PSTRING)&NameString); - DllName.Buffer[(DllName.MaximumLength - 1) / sizeof(WCHAR)] = UNICODE_NULL; + DllName.Buffer[(DllName.MaximumLength - 1) / sizeof(WCHAR)] = UNICODE_NULL; /* Load the image */ Status = MmLoadSystemImage(&DllName, NamePrefix, NULL, - 0, + FALSE, (PVOID)&DllEntry, &DllBase); if (NT_SUCCESS(Status)) @@ -1080,8 +1208,8 @@ CheckDllState: if (!(LdrEntry->Flags & LDRP_LOAD_IN_PROGRESS)) { /* Add the entry */ - LoadedImports->Entry[LoadedImports->Count] = LdrEntry; - LoadedImports->Count++; + LoadedImports->Entry[ImportCount] = LdrEntry; + ImportCount++; } } @@ -1150,7 +1278,8 @@ CheckDllState: if (LoadedImports->Entry[i]) { /* Got an entry, OR it with 1 in case it's the single entry */ - ImportEntry = (PVOID)((ULONG_PTR)LoadedImports->Entry[i] | 1); + ImportEntry = (PVOID)((ULONG_PTR)LoadedImports->Entry[i] | + MM_SYSLDR_SINGLE_ENTRY); ImportCount++; } } @@ -1160,7 +1289,7 @@ CheckDllState: { /* Free the list and set it to no imports */ ExFreePoolWithTag(LoadedImports, TAG_LDR_WSTR); - LoadedImports = (PVOID)-2; + LoadedImports = MM_SYSLDR_NO_IMPORTS; } else if (ImportCount == 1) { @@ -1174,7 +1303,7 @@ CheckDllState: LoadedImportsSize = ImportCount * sizeof(PVOID) + sizeof(SIZE_T); NewImports = ExAllocatePoolWithTag(PagedPool, LoadedImportsSize, - TAG_LDR_WSTR); + 'TDmM'); if (NewImports) { /* Set count */ @@ -1383,6 +1512,331 @@ MiReloadBootLoadedDrivers(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } } +NTSTATUS +NTAPI +MiBuildImportsForBootDrivers(VOID) +{ + PLIST_ENTRY NextEntry, NextEntry2; + PLDR_DATA_TABLE_ENTRY LdrEntry, KernelEntry, HalEntry, LdrEntry2, LastEntry; + PLDR_DATA_TABLE_ENTRY* EntryArray; + UNICODE_STRING KernelName = RTL_CONSTANT_STRING(L"ntoskrnl.exe"); + UNICODE_STRING HalName = RTL_CONSTANT_STRING(L"hal.dll"); + PLOAD_IMPORTS LoadedImports; + ULONG LoadedImportsSize, ImportSize; + PULONG_PTR ImageThunk; + ULONG_PTR DllBase, DllEnd; + ULONG Modules = 0, i, j = 0; + PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor; + + /* Initialize variables */ + KernelEntry = HalEntry = LastEntry = NULL; + + /* Loop the loaded module list... we are early enough that no lock is needed */ + NextEntry = PsLoadedModuleList.Flink; + while (NextEntry != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Check if it's the kernel or HAL */ + if (RtlEqualUnicodeString(&KernelName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + KernelEntry = LdrEntry; + } + else if (RtlEqualUnicodeString(&HalName, &LdrEntry->BaseDllName, TRUE)) + { + /* Found it */ + HalEntry = LdrEntry; + } + + /* Check if this is a driver DLL */ + if (LdrEntry->Flags & LDRP_DRIVER_DEPENDENT_DLL) + { + /* Check if this is the HAL or kernel */ + if ((LdrEntry == HalEntry) || (LdrEntry == KernelEntry)) + { + /* Add a reference */ + LdrEntry->LoadCount = 1; + } + else + { + /* No referencing needed */ + LdrEntry->LoadCount = 0; + } + } + else + { + /* No referencing needed */ + LdrEntry->LoadCount = 0; + } + + /* Remember this came from the loader */ + LdrEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + + /* Keep looping */ + NextEntry = NextEntry->Flink; + Modules++; + } + + /* We must have at least found the kernel and HAL */ + if (!(HalEntry) || (!KernelEntry)) return STATUS_NOT_FOUND; + + /* Allocate the list */ + EntryArray = ExAllocatePoolWithTag(PagedPool, Modules * sizeof(PVOID), 'TDmM'); + if (!EntryArray) return STATUS_INSUFFICIENT_RESOURCES; + + /* Loop the loaded module list again */ + NextEntry = PsLoadedModuleList.Flink; + while (NextEntry != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); +#ifdef _WORKING_LOADER_ + /* Get its imports */ + ImageThunk = RtlImageDirectoryEntryToData(LdrEntry->DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_IAT, + &ImportSize); + if (!ImageThunk) +#else + /* Get its imports */ + ImportDescriptor = RtlImageDirectoryEntryToData(LdrEntry->DllBase, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &ImportSize); + if (!ImportDescriptor) +#endif + { + /* None present */ + LdrEntry->LoadedImports = MM_SYSLDR_NO_IMPORTS; + NextEntry = NextEntry->Flink; + continue; + } + + /* Clear the list and count the number of IAT thunks */ + RtlZeroMemory(EntryArray, Modules * sizeof(PVOID)); +#ifdef _WORKING_LOADER_ + ImportSize /= sizeof(ULONG_PTR); + + /* Scan the thunks */ + for (i = 0, DllBase = 0, DllEnd = 0; i < ImportSize; i++, ImageThunk++) +#else + i = DllBase = DllEnd = 0; + while ((ImportDescriptor->Name) && + (ImportDescriptor->OriginalFirstThunk)) + { + /* Get the image thunk */ + ImageThunk = (PVOID)((ULONG_PTR)LdrEntry->DllBase + + ImportDescriptor->FirstThunk); + while (*ImageThunk) +#endif + { + /* Do we already have an address? */ + if (DllBase) + { + /* Is the thunk in the same address? */ + if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd)) + { + /* Skip it, we already have a reference for it */ + ASSERT(EntryArray[j]); + ImageThunk++; + continue; + } + } + + /* Loop the loaded module list to locate this address owner */ + j = 0; + NextEntry2 = PsLoadedModuleList.Flink; + while (NextEntry2 != &PsLoadedModuleList) + { + /* Get the entry */ + LdrEntry2 = CONTAINING_RECORD(NextEntry2, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Get the address range for this module */ + DllBase = (ULONG_PTR)LdrEntry2->DllBase; + DllEnd = DllBase + LdrEntry2->SizeOfImage; + + /* Check if this IAT entry matches it */ + if ((*ImageThunk >= DllBase) && (*ImageThunk < DllEnd)) + { + /* Save it */ + //DPRINT1("Found imported dll: %wZ\n", &LdrEntry2->BaseDllName); + EntryArray[j] = LdrEntry2; + break; + } + + /* Keep searching */ + NextEntry2 = NextEntry2->Flink; + j++; + } + + /* Do we have a thunk outside the range? */ + if ((*ImageThunk < DllBase) || (*ImageThunk >= DllEnd)) + { + /* Could be 0... */ + if (*ImageThunk) + { + /* Should not be happening */ + DPRINT1("Broken IAT entry for %p at %p (%lx)\n", + LdrEntry, ImageThunk, *ImageThunk); + ASSERT(FALSE); + } + + /* Reset if we hit this */ + DllBase = 0; + } +#ifndef _WORKING_LOADER_ + ImageThunk++; + } + + i++; + ImportDescriptor++; +#endif + } + + /* Now scan how many imports we really have */ + for (i = 0, ImportSize = 0; i < Modules; i++) + { + /* Skip HAL and kernel */ + if ((EntryArray[i]) && + (EntryArray[i] != HalEntry) && + (EntryArray[i] != KernelEntry)) + { + /* A valid reference */ + LastEntry = EntryArray[i]; + ImportSize++; + } + } + + /* Do we have any imports after all? */ + if (!ImportSize) + { + /* No */ + LdrEntry->LoadedImports = MM_SYSLDR_NO_IMPORTS; + } + else if (ImportSize == 1) + { + /* A single entry import */ + LdrEntry->LoadedImports = (PVOID)((ULONG_PTR)LastEntry | MM_SYSLDR_SINGLE_ENTRY); + LastEntry->LoadCount++; + } + else + { + /* We need an import table */ + LoadedImportsSize = ImportSize * sizeof(PVOID) + sizeof(SIZE_T); + LoadedImports = ExAllocatePoolWithTag(PagedPool, + LoadedImportsSize, + 'TDmM'); + ASSERT(LoadedImports); + + /* Save the count */ + LoadedImports->Count = ImportSize; + + /* Now copy all imports */ + for (i = 0, j = 0; i < Modules; i++) + { + /* Skip HAL and kernel */ + if ((EntryArray[i]) && + (EntryArray[i] != HalEntry) && + (EntryArray[i] != KernelEntry)) + { + /* A valid reference */ + //DPRINT1("Found valid entry: %p\n", EntryArray[i]); + LoadedImports->Entry[j] = EntryArray[i]; + EntryArray[i]->LoadCount++; + j++; + } + } + + /* Should had as many entries as we expected */ + ASSERT(j == ImportSize); + LdrEntry->LoadedImports = LoadedImports; + } + + /* Next */ + NextEntry = NextEntry->Flink; + } + + /* Free the initial array */ + ExFreePool(EntryArray); + + /* FIXME: Might not need to keep the HAL/Kernel imports around */ + + /* Kernel and HAL are loaded at boot */ + KernelEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + HalEntry->LoadedImports = MM_SYSLDR_BOOT_LOADED; + + /* All worked well */ + return STATUS_SUCCESS; +} + +VOID +NTAPI +MiLocateKernelSections(IN PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + ULONG_PTR DllBase; + PIMAGE_NT_HEADERS NtHeaders; + PIMAGE_SECTION_HEADER SectionHeader; + ULONG Sections, Size; + + /* Get the kernel section header */ + DllBase = (ULONG_PTR)LdrEntry->DllBase; + NtHeaders = RtlImageNtHeader((PVOID)DllBase); + SectionHeader = IMAGE_FIRST_SECTION(NtHeaders); + + /* Loop all the sections */ + Sections = NtHeaders->FileHeader.NumberOfSections; + while (Sections) + { + /* Grab the size of the section */ + Size = max(SectionHeader->SizeOfRawData, SectionHeader->Misc.VirtualSize); + + /* Check for .RSRC section */ + if (*(PULONG)SectionHeader->Name == 'rsr.') + { + /* Remember the PTEs so we can modify them later */ + MiKernelResourceStartPte = MiAddressToPte(DllBase + + SectionHeader->VirtualAddress); + MiKernelResourceEndPte = MiKernelResourceStartPte + + BYTES_TO_PAGES(SectionHeader->VirtualAddress + Size); + } + else if (*(PULONG)SectionHeader->Name == 'LOOP') + { + /* POOLCODE vs. POOLMI */ + if (*(PULONG)&SectionHeader->Name[4] == 'EDOC') + { + /* Found Ex* Pool code */ + ExPoolCodeStart = DllBase + SectionHeader->VirtualAddress; + ExPoolCodeEnd = ExPoolCodeStart + Size; + } + else if (*(PUSHORT)&SectionHeader->Name[4] == 'MI') + { + /* Found Mm* Pool code */ + MmPoolCodeStart = DllBase + SectionHeader->VirtualAddress; + MmPoolCodeEnd = ExPoolCodeStart + Size; + } + } + else if ((*(PULONG)SectionHeader->Name == 'YSIM') && + (*(PULONG)&SectionHeader->Name[4] == 'ETPS')) + { + /* Found MISYSPTE (Mm System PTE code)*/ + MmPteCodeStart = DllBase + SectionHeader->VirtualAddress; + MmPteCodeEnd = ExPoolCodeStart + Size; + } + + /* Keep going */ + Sections--; + SectionHeader++; + } +} + BOOLEAN NTAPI MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) @@ -1403,6 +1857,9 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); PsNtosImageBase = (ULONG_PTR)LdrEntry->DllBase; + + /* Locate resource section, pool code, and system pte code */ + MiLocateKernelSections(LdrEntry); /* Loop the loader block */ while (NextEntry != ListHead) @@ -1416,7 +1873,7 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) if (!RtlImageNtHeader(LdrEntry->DllBase)) { /* Skip this entry */ - NextEntry= NextEntry->Flink; + NextEntry = NextEntry->Flink; continue; } @@ -1459,12 +1916,441 @@ MiInitializeLoadedModuleList(IN PLOADER_PARAMETER_BLOCK LoaderBlock) } /* Build the import lists for the boot drivers */ - //MiBuildImportsForBootDrivers(); + MiBuildImportsForBootDrivers(); /* We're done */ return TRUE; } +LOGICAL +NTAPI +MiUseLargeDriverPage(IN ULONG NumberOfPtes, + IN OUT PVOID *ImageBaseAddress, + IN PUNICODE_STRING BaseImageName, + IN BOOLEAN BootDriver) +{ + PLIST_ENTRY NextEntry; + BOOLEAN DriverFound = FALSE; + PMI_LARGE_PAGE_DRIVER_ENTRY LargePageDriverEntry; + ASSERT(KeGetCurrentIrql () <= APC_LEVEL); + ASSERT(*ImageBaseAddress >= MmSystemRangeStart); + +#ifdef _X86_ + if (!(KeFeatureBits & KF_LARGE_PAGE)) return FALSE; + if (!(__readcr4() & CR4_PSE)) return FALSE; +#endif + + /* Make sure there's enough system PTEs for a large page driver */ + if (MmTotalFreeSystemPtes[SystemPteSpace] < (16 * (PDE_MAPPED_VA >> PAGE_SHIFT))) + { + return FALSE; + } + + /* This happens if the registry key had a "*" (wildcard) in it */ + if (MiLargePageAllDrivers == 0) + { + /* It didn't, so scan the list */ + NextEntry = MiLargePageDriverList.Flink; + while (NextEntry != &MiLargePageDriverList) + { + /* Check if the driver name matches */ + LargePageDriverEntry = CONTAINING_RECORD(NextEntry, + MI_LARGE_PAGE_DRIVER_ENTRY, + Links); + if (RtlEqualUnicodeString(BaseImageName, + &LargePageDriverEntry->BaseName, + TRUE)) + { + /* Enable large pages for this driver */ + DriverFound = TRUE; + break; + } + + /* Keep trying */ + NextEntry = NextEntry->Flink; + } + + /* If we didn't find the driver, it doesn't need large pages */ + if (DriverFound == FALSE) return FALSE; + } + + /* Nothing to do yet */ + DPRINT1("Large pages not supported!\n"); + return FALSE; +} + +ULONG +NTAPI +MiComputeDriverProtection(IN BOOLEAN SessionSpace, + IN ULONG SectionProtection) +{ + ULONG Protection = MM_ZERO_ACCESS; + + /* Check if the caller gave anything */ + if (SectionProtection) + { + /* Always turn on execute access */ + SectionProtection |= IMAGE_SCN_MEM_EXECUTE; + + /* Check if the registry setting is on or not */ + if (!MmEnforceWriteProtection) + { + /* Turn on write access too */ + SectionProtection |= (IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_EXECUTE); + } + } + + /* Convert to internal PTE flags */ + if (SectionProtection & IMAGE_SCN_MEM_EXECUTE) Protection |= MM_EXECUTE; + if (SectionProtection & IMAGE_SCN_MEM_READ) Protection |= MM_READONLY; + + /* Check for write access */ + if (SectionProtection & IMAGE_SCN_MEM_WRITE) + { + /* Session space is not supported */ + if (SessionSpace) + { + DPRINT1("Session drivers not supported\n"); + ASSERT(SessionSpace == FALSE); + } + else + { + /* Convert to internal PTE flag */ + Protection = (Protection & MM_EXECUTE) ? MM_EXECUTE_READWRITE : MM_READWRITE; + } + } + + /* If there's no access at all by now, convert to internal no access flag */ + if (Protection == MM_ZERO_ACCESS) Protection = MM_NOACCESS; + + /* Return the computed PTE protection */ + return Protection; +} + +VOID +NTAPI +MiSetSystemCodeProtection(IN PMMPTE FirstPte, + IN PMMPTE LastPte, + IN ULONG ProtectionMask) +{ + /* I'm afraid to introduce regressions at the moment... */ + return; +} + +VOID +NTAPI +MiWriteProtectSystemImage(IN PVOID ImageBase) +{ + PIMAGE_NT_HEADERS NtHeaders; + PIMAGE_SECTION_HEADER Section; + PFN_NUMBER DriverPages; + ULONG CurrentProtection, SectionProtection, CombinedProtection, ProtectionMask; + ULONG Sections, Size; + ULONG_PTR BaseAddress, CurrentAddress; + PMMPTE PointerPte, StartPte, LastPte, CurrentPte, ComboPte = NULL; + ULONG CurrentMask, CombinedMask = 0; + PAGED_CODE(); + + /* No need to write protect physical memory-backed drivers (large pages) */ + if (MI_IS_PHYSICAL_ADDRESS(ImageBase)) return; + + /* Get the image headers */ + NtHeaders = RtlImageNtHeader(ImageBase); + if (!NtHeaders) return; + + /* Check if this is a session driver or not */ + if (!MI_IS_SESSION_ADDRESS(ImageBase)) + { + /* Don't touch NT4 drivers */ + if (NtHeaders->OptionalHeader.MajorOperatingSystemVersion < 5) return; + if (NtHeaders->OptionalHeader.MajorImageVersion < 5) return; + } + else + { + /* Not supported */ + DPRINT1("Session drivers not supported\n"); + ASSERT(FALSE); + } + + /* These are the only protection masks we care about */ + ProtectionMask = IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE; + + /* Calculate the number of pages this driver is occupying */ + DriverPages = BYTES_TO_PAGES(NtHeaders->OptionalHeader.SizeOfImage); + + /* Get the number of sections and the first section header */ + Sections = NtHeaders->FileHeader.NumberOfSections; + ASSERT(Sections != 0); + Section = IMAGE_FIRST_SECTION(NtHeaders); + + /* Loop all the sections */ + CurrentAddress = (ULONG_PTR)ImageBase; + while (Sections) + { + /* Get the section size */ + Size = max(Section->SizeOfRawData, Section->Misc.VirtualSize); + + /* Get its virtual address */ + BaseAddress = (ULONG_PTR)ImageBase + Section->VirtualAddress; + if (BaseAddress < CurrentAddress) + { + /* Windows doesn't like these */ + DPRINT1("Badly linked image!\n"); + return; + } + + /* Remember the current address */ + CurrentAddress = BaseAddress + Size - 1; + + /* Next */ + Sections--; + Section++; + } + + /* Get the number of sections and the first section header */ + Sections = NtHeaders->FileHeader.NumberOfSections; + ASSERT(Sections != 0); + Section = IMAGE_FIRST_SECTION(NtHeaders); + + /* Set the address at the end to initialize the loop */ + CurrentAddress = (ULONG_PTR)Section + Sections - 1; + CurrentProtection = IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ; + + /* Set the PTE points for the image, and loop its sections */ + StartPte = MiAddressToPte(ImageBase); + LastPte = StartPte + DriverPages; + while (Sections) + { + /* Get the section size */ + Size = max(Section->SizeOfRawData, Section->Misc.VirtualSize); + + /* Get its virtual address and PTE */ + BaseAddress = (ULONG_PTR)ImageBase + Section->VirtualAddress; + PointerPte = MiAddressToPte(BaseAddress); + + /* Check if we were already protecting a run, and found a new run */ + if ((ComboPte) && (PointerPte > ComboPte)) + { + /* Compute protection */ + CombinedMask = MiComputeDriverProtection(FALSE, CombinedProtection); + + /* Set it */ + MiSetSystemCodeProtection(ComboPte, ComboPte, CombinedMask); + + /* Check for overlap */ + if (ComboPte == StartPte) StartPte++; + + /* One done, reset variables */ + ComboPte = NULL; + CombinedProtection = 0; + } + + /* Break out when needed */ + if (PointerPte >= LastPte) break; + + /* Get the requested protection from the image header */ + SectionProtection = Section->Characteristics & ProtectionMask; + if (SectionProtection == CurrentProtection) + { + /* Same protection, so merge the request */ + CurrentAddress = BaseAddress + Size - 1; + + /* Next */ + Sections--; + Section++; + continue; + } + + /* This is now a new section, so close up the old one */ + CurrentPte = MiAddressToPte(CurrentAddress); + + /* Check for overlap */ + if (CurrentPte == PointerPte) + { + /* Skip the last PTE, since it overlaps with us */ + CurrentPte--; + + /* And set the PTE we will merge with */ + ASSERT((ComboPte == NULL) || (ComboPte == PointerPte)); + ComboPte = PointerPte; + + /* Get the most flexible protection by merging both */ + CombinedMask |= (SectionProtection | CurrentProtection); + } + + /* Loop any PTEs left */ + if (CurrentPte >= StartPte) + { + /* Sanity check */ + ASSERT(StartPte < LastPte); + + /* Make sure we don't overflow past the last PTE in the driver */ + if (CurrentPte >= LastPte) CurrentPte = LastPte - 1; + ASSERT(CurrentPte >= StartPte); + + /* Compute the protection and set it */ + CurrentMask = MiComputeDriverProtection(FALSE, CurrentProtection); + MiSetSystemCodeProtection(StartPte, CurrentPte, CurrentMask); + } + + /* Set new state */ + StartPte = PointerPte; + CurrentAddress = BaseAddress + Size - 1; + CurrentProtection = SectionProtection; + + /* Next */ + Sections--; + Section++; + } + + /* Is there a leftover section to merge? */ + if (ComboPte) + { + /* Compute and set the protection */ + CombinedMask = MiComputeDriverProtection(FALSE, CombinedProtection); + MiSetSystemCodeProtection(ComboPte, ComboPte, CombinedMask); + + /* Handle overlap */ + if (ComboPte == StartPte) StartPte++; + } + + /* Finally, handle the last section */ + CurrentPte = MiPteToAddress(CurrentAddress); + if ((StartPte < LastPte) && (CurrentPte >= StartPte)) + { + /* Handle overlap */ + if (CurrentPte >= LastPte) CurrentPte = LastPte - 1; + ASSERT(CurrentPte >= StartPte); + + /* Compute and set the protection */ + CurrentMask = MiComputeDriverProtection(FALSE, CurrentProtection); + MiSetSystemCodeProtection(StartPte, CurrentPte, CurrentMask); + } +} + +VOID +NTAPI +MiSetPagingOfDriver(IN PMMPTE PointerPte, + IN PMMPTE LastPte) +{ + PVOID ImageBase; + PETHREAD CurrentThread; + PFN_NUMBER PageCount = 0, PageFrameIndex; + PMMPFN Pfn1; + PAGED_CODE(); + + /* Get the driver's base address */ + ImageBase = MiPteToAddress(PointerPte); + ASSERT(MI_IS_SESSION_IMAGE_ADDRESS(ImageBase) == FALSE); + + /* If this is a large page, it's stuck in physical memory */ + if (MI_IS_PHYSICAL_ADDRESS(ImageBase)) return; + + /* We should lock the system working set -- we don't have one yet, so just be consistent */ + CurrentThread = PsGetCurrentThread(); + KeEnterGuardedRegion(); + ASSERT((CurrentThread->OwnsSystemWorkingSetExclusive == 0) && + (CurrentThread->OwnsSystemWorkingSetShared == 0)); + CurrentThread->OwnsSystemWorkingSetExclusive = 1; + + /* Loop the PTEs */ + while (PointerPte <= LastPte) + { + /* Check for valid PTE */ + if (PointerPte->u.Hard.Valid == 1) + { + PageFrameIndex = PFN_FROM_PTE(PointerPte); + Pfn1 = MiGetPfnEntry(PageFrameIndex); + ASSERT(Pfn1->u2.ShareCount == 1); + + /* No working sets in ReactOS yet */ + PageCount++; + } + + ImageBase = (PVOID)((ULONG_PTR)ImageBase + PAGE_SIZE); + PointerPte++; + } + + /* Release the working set "lock" */ + ASSERT(KeAreAllApcsDisabled() == TRUE); + CurrentThread->OwnsSystemWorkingSetExclusive = 0; + KeLeaveGuardedRegion(); + + /* Do we have any driver pages? */ + if (PageCount) + { + /* Update counters */ + InterlockedExchangeAdd((PLONG)&MmTotalSystemDriverPages, PageCount); + } +} + +VOID +NTAPI +MiEnablePagingOfDriver(IN PLDR_DATA_TABLE_ENTRY LdrEntry) +{ + ULONG_PTR ImageBase; + PIMAGE_NT_HEADERS NtHeaders; + ULONG Sections, Alignment, Size; + PIMAGE_SECTION_HEADER Section; + PMMPTE PointerPte = NULL, LastPte = NULL; + if (MmDisablePagingExecutive) return; + + /* Get the driver base address and its NT header */ + ImageBase = (ULONG_PTR)LdrEntry->DllBase; + NtHeaders = RtlImageNtHeader((PVOID)ImageBase); + if (!NtHeaders) return; + + /* Get the sections and their alignment */ + Sections = NtHeaders->FileHeader.NumberOfSections; + Alignment = NtHeaders->OptionalHeader.SectionAlignment - 1; + + /* Loop each section */ + Section = IMAGE_FIRST_SECTION(NtHeaders); + while (Sections) + { + /* Find PAGE or .edata */ + if ((*(PULONG)Section->Name == 'EGAP') || + (*(PULONG)Section->Name == 'ade.')) + { + /* Had we already done some work? */ + if (!PointerPte) + { + /* Nope, setup the first PTE address */ + PointerPte = MiAddressToPte(ROUND_TO_PAGES(ImageBase + + Section-> + VirtualAddress)); + } + + /* Compute the size */ + Size = max(Section->SizeOfRawData, Section->Misc.VirtualSize); + + /* Find the last PTE that maps this section */ + LastPte = MiAddressToPte(ImageBase + + Section->VirtualAddress + + Alignment + + Size - + PAGE_SIZE); + } + else + { + /* Had we found a section before? */ + if (PointerPte) + { + /* Mark it as pageable */ + MiSetPagingOfDriver(PointerPte, LastPte); + PointerPte = NULL; + } + } + + /* Keep searching */ + Sections--; + Section++; + } + + /* Handle the straggler */ + if (PointerPte) MiSetPagingOfDriver(PointerPte, LastPte); +} + BOOLEAN NTAPI MmVerifyImageIsOkForMpUse(IN PVOID BaseAddress) @@ -1501,15 +2387,24 @@ MmCheckSystemImage(IN HANDLE ImageHandle, IO_STATUS_BLOCK IoStatusBlock; FILE_STANDARD_INFORMATION FileStandardInfo; KAPC_STATE ApcState; + PIMAGE_NT_HEADERS NtHeaders; + OBJECT_ATTRIBUTES ObjectAttributes; PAGED_CODE(); + + /* Setup the object attributes */ + InitializeObjectAttributes(&ObjectAttributes, + NULL, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); /* Create a section for the DLL */ Status = ZwCreateSection(&SectionHandle, SECTION_MAP_EXECUTE, - NULL, + &ObjectAttributes, NULL, PAGE_EXECUTE, - SEC_COMMIT, + SEC_IMAGE, ImageHandle); if (!NT_SUCCESS(Status)) return Status; @@ -1541,17 +2436,35 @@ MmCheckSystemImage(IN HANDLE ImageHandle, &FileStandardInfo, sizeof(FileStandardInfo), FileStandardInformation); - if ( NT_SUCCESS(Status) ) + if (NT_SUCCESS(Status)) { /* First, verify the checksum */ if (!LdrVerifyMappedImageMatchesChecksum(ViewBase, - FileStandardInfo. - EndOfFile.LowPart, + ViewSize, FileStandardInfo. EndOfFile.LowPart)) { /* Set checksum failure */ Status = STATUS_IMAGE_CHECKSUM_MISMATCH; + goto Fail; + } + + /* Make sure it's a real image */ + NtHeaders = RtlImageNtHeader(ViewBase); + if (!NtHeaders) + { + /* Set checksum failure */ + Status = STATUS_IMAGE_CHECKSUM_MISMATCH; + goto Fail; + } + + /* Make sure it's for the correct architecture */ + if ((NtHeaders->FileHeader.Machine != IMAGE_FILE_MACHINE_NATIVE) || + (NtHeaders->OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC)) + { + /* Set protection failure */ + Status = STATUS_INVALID_IMAGE_PROTECT; + goto Fail; } /* Check that it's a valid SMP image if we have more then one CPU */ @@ -1563,6 +2476,7 @@ MmCheckSystemImage(IN HANDLE ImageHandle, } /* Unmap the section, close the handle, and return status */ +Fail: ZwUnmapViewOfSection(NtCurrentProcess(), ViewBase); KeUnstackDetachProcess(&ApcState); ZwClose(SectionHandle); @@ -1587,7 +2501,7 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName, UNICODE_STRING BaseName, BaseDirectory, PrefixName, UnicodeTemp; PLDR_DATA_TABLE_ENTRY LdrEntry = NULL; ULONG EntrySize, DriverSize; - PLOAD_IMPORTS LoadedImports = (PVOID)-2; + PLOAD_IMPORTS LoadedImports = MM_SYSLDR_NO_IMPORTS; PCHAR MissingApiName, Buffer; PWCHAR MissingDriverName; HANDLE SectionHandle; @@ -1611,7 +2525,7 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName, } /* Allocate a buffer we'll use for names */ - Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, TAG_LDR_WSTR); + Buffer = ExAllocatePoolWithTag(NonPagedPool, MAX_PATH, 'nLmM'); if (!Buffer) return STATUS_INSUFFICIENT_RESOURCES; /* Check for a separator */ @@ -1655,6 +2569,14 @@ MmLoadSystemImage(IN PUNICODE_STRING FileName, /* Check if we already have a name, use it instead */ if (LoadedName) BaseName = *LoadedName; + + /* Check for loader snap debugging */ + if (NtGlobalFlag & FLG_SHOW_LDR_SNAPS) + { + /* Print out standard string */ + DPRINT1("MM:SYSLDR Loading %wZ (%wZ) %s\n", + &PrefixName, &BaseName, Flags ? "in session space" : ""); + } /* Acquire the load lock */ LoaderScan: @@ -1750,7 +2672,7 @@ LoaderScan: Status = MmCheckSystemImage(FileHandle, FALSE); if ((Status == STATUS_IMAGE_CHECKSUM_MISMATCH) || (Status == STATUS_IMAGE_MP_UP_MISMATCH) || - (Status == STATUS_INVALID_IMAGE_FORMAT)) + (Status == STATUS_INVALID_IMAGE_PROTECT)) { /* Fail loading */ goto Quickie; @@ -1829,16 +2751,20 @@ LoaderScan: /* Check for success */ if (NT_SUCCESS(Status)) { - /* FIXME: Support large pages for drivers */ + /* Support large pages for drivers */ + MiUseLargeDriverPage(DriverSize / PAGE_SIZE, + &ModuleLoadBase, + &BaseName, + TRUE); } /* Dereference the section */ ObDereferenceObject(Section); Section = NULL; } - - /* Get the NT Header */ - NtHeader = RtlImageNtHeader(ModuleLoadBase); + + /* Check for failure of the load earlier */ + if (!NT_SUCCESS(Status)) goto Quickie; /* Relocate the driver */ Status = LdrRelocateImageWithBias(ModuleLoadBase, @@ -1849,6 +2775,10 @@ LoaderScan: STATUS_INVALID_IMAGE_FORMAT); if (!NT_SUCCESS(Status)) goto Quickie; + + /* Get the NT Header */ + NtHeader = RtlImageNtHeader(ModuleLoadBase); + /* Calculate the size we'll need for the entry and allocate it */ EntrySize = sizeof(LDR_DATA_TABLE_ENTRY) + BaseName.Length + @@ -1956,9 +2886,10 @@ LoaderScan: LdrEntry->Flags &= ~LDRP_LOAD_IN_PROGRESS; LdrEntry->LoadedImports = LoadedImports; - /* FIXME: Apply driver verifier */ + /* FIXME: Call driver verifier's loader function */ - /* FIXME: Write-protect the system image */ + /* Write-protect the system image */ + MiWriteProtectSystemImage(LdrEntry->DllBase); /* Check if notifications are enabled */ if (PsImageNotifyEnabled) @@ -2012,17 +2943,15 @@ LoaderScan: LdrEntry->Flags |= LDRP_DEBUG_SYMBOLS_LOADED; } - /* FIXME: Page the driver */ + /* Page the driver */ ASSERT(Section == NULL); + MiEnablePagingOfDriver(LdrEntry); /* Return pointers */ *ModuleObject = LdrEntry; *ImageBaseAddress = LdrEntry->DllBase; Quickie: - /* If we have a file handle, close it */ - if (FileHandle) ZwClose(FileHandle); - /* Check if we have the lock acquired */ if (LockOwned) { @@ -2032,6 +2961,9 @@ Quickie: LockOwned = FALSE; } + /* If we have a file handle, close it */ + if (FileHandle) ZwClose(FileHandle); + /* Check if we had a prefix */ if (NamePrefix) ExFreePool(PrefixName.Buffer); @@ -2040,6 +2972,90 @@ Quickie: return Status; } +PLDR_DATA_TABLE_ENTRY +NTAPI +MiLookupDataTableEntry(IN PVOID Address) +{ + PLDR_DATA_TABLE_ENTRY LdrEntry, FoundEntry = NULL; + PLIST_ENTRY NextEntry; + PAGED_CODE(); + + /* Loop entries */ + NextEntry = PsLoadedModuleList.Flink; + do + { + /* Get the loader entry */ + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + /* Check if the address matches */ + if ((Address >= LdrEntry->DllBase) && + (Address < (PVOID)((ULONG_PTR)LdrEntry->DllBase + + LdrEntry->SizeOfImage))) + { + /* Found a match */ + FoundEntry = LdrEntry; + break; + } + + /* Move on */ + NextEntry = NextEntry->Flink; + } while(NextEntry != &PsLoadedModuleList); + + /* Return the entry */ + return FoundEntry; +} + +/* PUBLIC FUNCTIONS ***********************************************************/ + +/* + * @implemented + */ +PVOID +NTAPI +MmPageEntireDriver(IN PVOID AddressWithinSection) +{ + PMMPTE StartPte, EndPte; + PLDR_DATA_TABLE_ENTRY LdrEntry; + PAGED_CODE(); + + /* Get the loader entry */ + LdrEntry = MiLookupDataTableEntry(AddressWithinSection); + if (!LdrEntry) return NULL; + + /* Check if paging of kernel mode is disabled or if the driver is mapped as an image */ + if ((MmDisablePagingExecutive) || (LdrEntry->SectionPointer)) + { + /* Don't do anything, just return the base address */ + return LdrEntry->DllBase; + } + + /* Wait for active DPCs to finish before we page out the driver */ + KeFlushQueuedDpcs(); + + /* Get the PTE range for the whole driver image */ + StartPte = MiAddressToPte((ULONG_PTR)LdrEntry->DllBase); + EndPte = MiAddressToPte((ULONG_PTR)LdrEntry->DllBase + LdrEntry->SizeOfImage); + + /* Enable paging for the PTE range */ + ASSERT(MI_IS_SESSION_IMAGE_ADDRESS(AddressWithinSection) == FALSE); + MiSetPagingOfDriver(StartPte, EndPte); + + /* Return the base address */ + return LdrEntry->DllBase; +} + +/* + * @unimplemented + */ +VOID +NTAPI +MmResetDriverPaging(IN PVOID AddressWithinSection) +{ + UNIMPLEMENTED; +} + /* * @implemented */ diff --git a/ntoskrnl/ntoskrnl-generic.rbuild b/ntoskrnl/ntoskrnl-generic.rbuild index a349f887312..5dc63c62e56 100644 --- a/ntoskrnl/ntoskrnl-generic.rbuild +++ b/ntoskrnl/ntoskrnl-generic.rbuild @@ -270,6 +270,7 @@ pnpmgr.c pnpnotify.c pnpreport.c + pnpres.c pnproot.c pnputil.c @@ -394,6 +395,7 @@ expool.c hypermap.c iosup.c + largepag.c mdlsup.c mminit.c mmsup.c diff --git a/ntoskrnl/rtl/libsupp.c b/ntoskrnl/rtl/libsupp.c index 27f78952c72..4a6c8bc55ea 100644 --- a/ntoskrnl/rtl/libsupp.c +++ b/ntoskrnl/rtl/libsupp.c @@ -317,7 +317,7 @@ RtlWalkFrameChain(OUT PVOID *Callers, &StackBegin, &StackEnd); if (!Result) return 0; - } + } /* Use a SEH block for maximum protection */ _SEH2_TRY @@ -331,12 +331,11 @@ RtlWalkFrameChain(OUT PVOID *Callers, /* Make sure we can trust the TEB and trap frame */ if (!(Teb) || - !(Thread->SystemThread) || (KeIsAttachedProcess()) || (KeGetCurrentIrql() >= DISPATCH_LEVEL)) { /* Invalid or unsafe attempt to get the stack */ - return 0; + _SEH2_YIELD(return 0;) } /* Get the stack limits */ diff --git a/subsystems/ntvdm/ntvdm.c b/subsystems/ntvdm/ntvdm.c index afa44ef23de..5a9a29a8e58 100644 --- a/subsystems/ntvdm/ntvdm.c +++ b/subsystems/ntvdm/ntvdm.c @@ -282,8 +282,8 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho WCHAR PromptMsg[RC_STRING_MAX_SIZE]; CHAR InputBuffer[255]; - LoadString( GetModuleHandle(NULL), STRING_WelcomeMsg, (LPTSTR) WelcomeMsg,sizeof(WelcomeMsg) / sizeof(WelcomeMsg[0])); - LoadString( GetModuleHandle(NULL), STRING_PromptMsg, (LPTSTR) PromptMsg ,sizeof(PromptMsg) / sizeof(PromptMsg[0])); + LoadStringW( GetModuleHandle(NULL), STRING_WelcomeMsg, WelcomeMsg,sizeof(WelcomeMsg) / sizeof(WelcomeMsg[0])); + LoadStringW( GetModuleHandle(NULL), STRING_PromptMsg, PromptMsg ,sizeof(PromptMsg) / sizeof(PromptMsg[0])); AllocConsole(); SetConsoleTitleW(L"ntvdm"); diff --git a/subsystems/win32/csrss/include/conio.h b/subsystems/win32/csrss/include/conio.h index 35d71863a15..cf62ac71c52 100644 --- a/subsystems/win32/csrss/include/conio.h +++ b/subsystems/win32/csrss/include/conio.h @@ -61,6 +61,7 @@ typedef struct tagCSRSS_CONSOLE_VTBL BOOL (WINAPI *ChangeTitle)(PCSRSS_CONSOLE Console); VOID (WINAPI *CleanupConsole)(PCSRSS_CONSOLE Console); BOOL (WINAPI *ChangeIcon)(PCSRSS_CONSOLE Console, HICON hWindowIcon); + NTSTATUS (WINAPI *ResizeBuffer)(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer, COORD Size); } CSRSS_CONSOLE_VTBL, *PCSRSS_CONSOLE_VTBL; typedef struct tagCSRSS_CONSOLE @@ -137,6 +138,7 @@ CSR_API(CsrGetConsoleOutputCodePage); CSR_API(CsrSetConsoleOutputCodePage); CSR_API(CsrGetProcessList); CSR_API(CsrGenerateCtrlEvent); +CSR_API(CsrSetScreenBufferSize); #define ConioInitScreenBuffer(Console, Buff) (Console)->Vtbl->InitScreenBuffer((Console), (Buff)) #define ConioDrawRegion(Console, Region) (Console)->Vtbl->DrawRegion((Console), (Region)) @@ -150,6 +152,8 @@ CSR_API(CsrGenerateCtrlEvent); (Console)->Vtbl->UpdateScreenInfo(Console, Buff) #define ConioChangeTitle(Console) (Console)->Vtbl->ChangeTitle(Console) #define ConioCleanupConsole(Console) (Console)->Vtbl->CleanupConsole(Console) +#define ConioChangeIcon(Console, hWindowIcon) (Console)->Vtbl->ChangeIcon(Console, hWindowIcon) +#define ConioResizeBuffer(Console, Buff, Size) (Console)->Vtbl->ResizeBuffer(Console, Buff, Size) #define ConioRectHeight(Rect) \ (((Rect)->top) > ((Rect)->bottom) ? 0 : ((Rect)->bottom) - ((Rect)->top) + 1) @@ -164,7 +168,6 @@ CSR_API(CsrGenerateCtrlEvent); Win32CsrLockObject((ProcessData), (Handle), (Object_t **)(Ptr), Access, CONIO_SCREEN_BUFFER_MAGIC) #define ConioUnlockScreenBuffer(Buff) \ Win32CsrUnlockObject((Object_t *) Buff) -#define ConioChangeIcon(Console, hWindowIcon) (Console)->Vtbl->ChangeIcon(Console, hWindowIcon) /* alias.c */ VOID IntDeleteAllAliases(struct tagALIAS_HEADER *RootHeader); diff --git a/subsystems/win32/csrss/win32csr/conio.c b/subsystems/win32/csrss/win32csr/conio.c index fa3244e0d7e..493ac172db0 100644 --- a/subsystems/win32/csrss/win32csr/conio.c +++ b/subsystems/win32/csrss/win32csr/conio.c @@ -26,11 +26,14 @@ #define ConsoleInputUnicodeCharToAnsiChar(Console, dChar, sWChar) \ WideCharToMultiByte((Console)->CodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) +#define ConsoleInputAnsiCharToUnicodeChar(Console, dWChar, sChar) \ + MultiByteToWideChar((Console)->CodePage, 0, (sChar), 1, (dWChar), 1) + #define ConsoleUnicodeCharToAnsiChar(Console, dChar, sWChar) \ WideCharToMultiByte((Console)->OutputCodePage, 0, (sWChar), 1, (dChar), 1, NULL, NULL) -#define ConsoleAnsiCharToUnicodeChar(Console, sWChar, dChar) \ - MultiByteToWideChar((Console)->OutputCodePage, 0, (dChar), 1, (sWChar), 1) +#define ConsoleAnsiCharToUnicodeChar(Console, dWChar, sChar) \ + MultiByteToWideChar((Console)->OutputCodePage, 0, (sChar), 1, (dWChar), 1) /* FUNCTIONS *****************************************************************/ @@ -616,7 +619,7 @@ CSR_API(CsrReadConsole) else { if(Request->Data.ReadConsoleRequest.Unicode) - UnicodeBuffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar; /* FIXME */ + ConsoleInputAnsiCharToUnicodeChar(Console, &UnicodeBuffer[i], &Input->InputEvent.Event.KeyEvent.uChar.AsciiChar); else Buffer[i] = Input->InputEvent.Event.KeyEvent.uChar.AsciiChar; } @@ -3118,4 +3121,33 @@ CSR_API(CsrGenerateCtrlEvent) return Status; } +CSR_API(CsrSetScreenBufferSize) +{ + NTSTATUS Status; + PCSRSS_CONSOLE Console; + PCSRSS_SCREEN_BUFFER Buff; + + Request->Header.u1.s1.TotalLength = sizeof(CSR_API_MESSAGE); + Request->Header.u1.s1.DataLength = sizeof(CSR_API_MESSAGE) - sizeof(PORT_MESSAGE); + + Status = ConioConsoleFromProcessData(ProcessData, &Console); + if (!NT_SUCCESS(Status)) + { + return Status; + } + + Status = ConioLockScreenBuffer(ProcessData, Request->Data.SetScreenBufferSize.OutputHandle, &Buff, GENERIC_WRITE); + if (!NT_SUCCESS(Status)) + { + ConioUnlockConsole(Console); + return Status; + } + + Status = ConioResizeBuffer(Console, Buff, Request->Data.SetScreenBufferSize.Size); + ConioUnlockScreenBuffer(Buff); + ConioUnlockConsole(Console); + + return Status; +} + /* EOF */ diff --git a/subsystems/win32/csrss/win32csr/dllmain.c b/subsystems/win32/csrss/win32csr/dllmain.c index 2b3c6b7a1a4..f8332a7ea76 100644 --- a/subsystems/win32/csrss/win32csr/dllmain.c +++ b/subsystems/win32/csrss/win32csr/dllmain.c @@ -74,6 +74,7 @@ static CSRSS_API_DEFINITION Win32CsrApiDefinitions[] = CSRSS_DEFINE_API(GET_CONSOLE_ALIASES_EXES, CsrGetConsoleAliasesExes), CSRSS_DEFINE_API(GET_CONSOLE_ALIASES_EXES_LENGTH, CsrGetConsoleAliasesExesLength), CSRSS_DEFINE_API(GENERATE_CTRL_EVENT, CsrGenerateCtrlEvent), + CSRSS_DEFINE_API(SET_SCREEN_BUFFER_SIZE, CsrSetScreenBufferSize), { 0, 0, NULL } }; @@ -180,402 +181,6 @@ Win32CsrInitComplete(void) return TRUE; } -static BOOL WINAPI -Win32CsrHardError(IN PCSRSS_PROCESS_DATA ProcessData, - IN PHARDERROR_MSG HardErrorMessage) -{ - UINT responce = MB_OK; - NTSTATUS Status; - HANDLE hProcess; - OBJECT_ATTRIBUTES ObjectAttributes; - ULONG nParam = 0; - PRTL_MESSAGE_RESOURCE_ENTRY MessageResource; - ULONG_PTR ParameterList[MAXIMUM_HARDERROR_PARAMETERS]; - LPSTR CaptionText, MessageBody; - LPWSTR szxCaptionText, szxMessageBody; - DWORD SizeOfAllUnicodeStrings = 0; - PROCESS_BASIC_INFORMATION ClientBasicInfo; - UNICODE_STRING ClientFileNameU; - UNICODE_STRING TempStringU; - UNICODE_STRING ParameterStringU; - ANSI_STRING ParamStringA; - ULONG UnicodeStringParameterMask = HardErrorMessage->UnicodeStringParameterMask; - int MessageBoxResponse; - - HardErrorMessage->Response = ResponseNotHandled; - - DPRINT("NumberOfParameters = %d\n", HardErrorMessage->NumberOfParameters); - DPRINT("Status = %lx\n", HardErrorMessage->Status); - - // open client process - InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); - Status = NtOpenProcess(&hProcess, PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, &ObjectAttributes, &HardErrorMessage->h.ClientId); - if( !NT_SUCCESS(Status) ) { - DPRINT1("NtOpenProcess failed with code: %lx\n", Status); - return FALSE; - } - - // let's get a name of the client process to display it in the caption of a message box - - ClientFileNameU.MaximumLength = 0; - ClientFileNameU.Length = 0; - ClientFileNameU.Buffer = NULL; - Status = NtQueryInformationProcess(hProcess, - ProcessBasicInformation, - &ClientBasicInfo, - sizeof(ClientBasicInfo), - NULL); - if( NT_SUCCESS(Status) ) { - PLIST_ENTRY ModuleListHead; - PLIST_ENTRY Entry; - PLDR_DATA_TABLE_ENTRY Module; - PPEB_LDR_DATA Ldr; - PPEB Peb = ClientBasicInfo.PebBaseAddress; - - if( Peb ) - { - Status = NtReadVirtualMemory(hProcess, &Peb->Ldr, &Ldr, sizeof(Ldr), NULL); - if( NT_SUCCESS(Status) ) { - ModuleListHead = &Ldr->InLoadOrderModuleList; - Status = NtReadVirtualMemory( - hProcess, - &ModuleListHead->Flink, - &Entry, - sizeof(Entry), - NULL - ); - - if( NT_SUCCESS(Status) ) - { - if (Entry != ModuleListHead) - { - LDR_DATA_TABLE_ENTRY ModuleData; - Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); - - Status = NtReadVirtualMemory(hProcess, Module, &ModuleData, sizeof(ModuleData), NULL); - if( NT_SUCCESS(Status) ) { - PVOID ClientDllBase; - - Status = NtReadVirtualMemory( - hProcess, - &Peb->ImageBaseAddress, - &ClientDllBase, - sizeof(ClientDllBase), - NULL - ); - if( NT_SUCCESS(Status) && (ClientDllBase == ModuleData.DllBase) ) { - - ClientFileNameU.MaximumLength = ModuleData.BaseDllName.MaximumLength; - ClientFileNameU.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, ClientFileNameU.MaximumLength); - Status = NtReadVirtualMemory( - hProcess, - ModuleData.BaseDllName.Buffer, - ClientFileNameU.Buffer, - ClientFileNameU.MaximumLength, - NULL - ); - if( NT_SUCCESS(Status) ) { - ClientFileNameU.Length = wcslen(ClientFileNameU.Buffer)*sizeof(wchar_t); - } - else { - RtlFreeHeap (RtlGetProcessHeap(), 0, ClientFileNameU.Buffer); - ClientFileNameU.Buffer = NULL; - } - - DPRINT("ClientFileNameU=\'%wZ\'\n", &ClientFileNameU); - } - } - } - } - } - } - } - - // read all unicode strings from client space - for(nParam = 0; nParam < HardErrorMessage->NumberOfParameters; nParam++, UnicodeStringParameterMask >>= 1) - { - if( UnicodeStringParameterMask & 0x01 ) { - Status = NtReadVirtualMemory(hProcess, - (PVOID)HardErrorMessage->Parameters[nParam], - (PVOID)&TempStringU, - sizeof(TempStringU), - NULL); - - if( NT_SUCCESS(Status) ) { - ParameterStringU.Buffer = (PWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, TempStringU.MaximumLength); - if( !ParameterStringU.Buffer ) { - DPRINT1("Cannot allocate memory %d\n", TempStringU.MaximumLength); - NtClose(hProcess); - if( ClientFileNameU.Buffer ) { - RtlFreeHeap (RtlGetProcessHeap(), 0, ClientFileNameU.Buffer); - } - return FALSE; - } - - Status = NtReadVirtualMemory(hProcess, - (PVOID)TempStringU.Buffer, - (PVOID)ParameterStringU.Buffer, - TempStringU.MaximumLength, - NULL); - if( !NT_SUCCESS(Status) ) { - DPRINT1("NtReadVirtualMemory failed with code: %lx\n", Status); - RtlFreeHeap (RtlGetProcessHeap(), 0, ParameterStringU.Buffer); - if( ClientFileNameU.Buffer ) { - RtlFreeHeap (RtlGetProcessHeap(), 0, ClientFileNameU.Buffer); - } - NtClose(hProcess); - return FALSE; - } - ParameterStringU.Length = TempStringU.Length; - ParameterStringU.MaximumLength = TempStringU.MaximumLength; - DPRINT("ParameterStringU=\'%wZ\'\n", &ParameterStringU); - RtlUnicodeStringToAnsiString(&ParamStringA, &ParameterStringU, TRUE); - ParameterList[nParam] = (ULONG_PTR)ParamStringA.Buffer; - SizeOfAllUnicodeStrings += ParamStringA.MaximumLength; - } - } - else { - // it's not a unicode string - ParameterList[nParam] = HardErrorMessage->Parameters[nParam]; - } - } - - NtClose(hProcess); - - // get text string of the error code - Status = RtlFindMessage( - (PVOID)GetModuleHandle(TEXT("ntdll")), - (ULONG_PTR)RT_MESSAGETABLE, - LANG_NEUTRAL, - HardErrorMessage->Status, - &MessageResource ); - if( !NT_SUCCESS(Status) ) { - // WE HAVE TO DISPLAY HERE: "Unknown hard error" - if( ClientFileNameU.Buffer ) { - szxCaptionText = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, ClientFileNameU.MaximumLength+64); - wsprintfW(szxCaptionText, L"%s - %hs", ClientFileNameU.Buffer, "Application Error"); - } else { - szxCaptionText = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, 64); - wsprintfW(szxCaptionText, L"System - Application Error"); - } - MessageBody = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, 38); - wsprintfA(MessageBody, "Unknown hard error"); - } - else { - LPSTR NtStatusString; - UNICODE_STRING MessageU; - ANSI_STRING MessageA; - USHORT CaptionSize = 0; - - if( !MessageResource->Flags ) { - /* we've got an ansi string */ - DPRINT("MessageResource->Text=%s\n", (PSTR)MessageResource->Text); - RtlInitAnsiString(&MessageA, MessageResource->Text); - } - else { - /* we've got a unicode string */ - DPRINT("MessageResource->Text=%S\n", (PWSTR)MessageResource->Text); - RtlInitUnicodeString(&MessageU, (PWSTR)MessageResource->Text); - RtlUnicodeStringToAnsiString(&MessageA, &MessageU, TRUE); - } - - // check whether a caption exists - if( *MessageA.Buffer == '{' ) { - // get size of the caption - for( CaptionSize = 0; (CaptionSize < MessageA.Length) && ('}' != MessageA.Buffer[CaptionSize]); CaptionSize++); - - CaptionText = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, CaptionSize); - RtlCopyMemory(CaptionText, MessageA.Buffer+1, CaptionSize-1); - CaptionSize += 2; // "}\r\n" - 3 - - szxCaptionText = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(wchar_t)*CaptionSize+ClientFileNameU.MaximumLength+128); - if( ClientFileNameU.Buffer ) { - wsprintfW(szxCaptionText, L"%s - %hs", ClientFileNameU.Buffer, CaptionText); - } else { - wsprintfW(szxCaptionText, L"System - %hs", CaptionText); - } - RtlFreeHeap (RtlGetProcessHeap(), 0, CaptionText); - } - else { - if( ClientFileNameU.Buffer ) { - szxCaptionText = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, ClientFileNameU.MaximumLength); - wsprintfW(szxCaptionText, L"%s", ClientFileNameU.Buffer); - } else { - szxCaptionText = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, 14); // 14 - "System\0\0" - wsprintfW(szxCaptionText, L"System"); - } - } - DPRINT("ParameterList[0]=0x%lx\n", ParameterList[0]); - if( STATUS_UNHANDLED_EXCEPTION == HardErrorMessage->Status ) - { - PRTL_MESSAGE_RESOURCE_ENTRY MsgResException; - MessageBody = NULL; - Status = RtlFindMessage( - (PVOID)GetModuleHandle(TEXT("ntdll")), - (ULONG_PTR)RT_MESSAGETABLE, - LANG_NEUTRAL, - ParameterList[0], - &MsgResException); - - if( NT_SUCCESS(Status) ) - { - UNICODE_STRING ExcMessageU; - ANSI_STRING ExcMessageA; - if( !MsgResException->Flags ) { - /* we've got an ansi string */ - DPRINT("MsgResException->Text=%s\n", (PSTR)MsgResException->Text); - RtlInitAnsiString(&ExcMessageA, MsgResException->Text); - } - else { - /* we've got a unicode string */ - DPRINT("MsgResException->Text=%S\n", (PWSTR)MsgResException->Text); - RtlInitUnicodeString(&ExcMessageU, (PWSTR)MsgResException->Text); - RtlUnicodeStringToAnsiString(&ExcMessageA, &ExcMessageU, TRUE); - } - - MessageBody = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MsgResException->Length+SizeOfAllUnicodeStrings+1024); // 1024 is a magic number I think it should be enough - if( STATUS_ACCESS_VIOLATION == ParameterList[0] ) { - LPSTR pOperationType; - if( ParameterList[2] ) pOperationType = "written"; - else pOperationType = "read"; - wsprintfA(MessageBody, ExcMessageA.Buffer, ParameterList[1], ParameterList[3], pOperationType); - } - else if( STATUS_IN_PAGE_ERROR == ParameterList[0] ) { - wsprintfA(MessageBody, ExcMessageA.Buffer, ParameterList[1], ParameterList[3], ParameterList[2]); - } - } - if( !MessageBody ) { - NtStatusString = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MessageResource->Length-CaptionSize); - RtlCopyMemory(NtStatusString, MessageA.Buffer+CaptionSize, (MessageResource->Length-CaptionSize)-1); - - MessageBody = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MessageResource->Length+SizeOfAllUnicodeStrings+1024); // 1024 is a magic number I think it should be enough - - wsprintfA(MessageBody, NtStatusString, - L"Unknown software exception", - ParameterList[0], - ParameterList[1]); - - RtlFreeHeap (RtlGetProcessHeap(), 0, NtStatusString); - } - } - else - { - NtStatusString = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MessageResource->Length-CaptionSize); - RtlCopyMemory(NtStatusString, MessageA.Buffer+CaptionSize, (MessageResource->Length-CaptionSize)-1); - - MessageBody = (LPSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, MessageResource->Length+SizeOfAllUnicodeStrings+1024); // 1024 is a magic number I think it should be enough - - wsprintfA(MessageBody, NtStatusString, - ParameterList[0], - ParameterList[1], - ParameterList[2], - ParameterList[3]); - - RtlFreeHeap (RtlGetProcessHeap(), 0, NtStatusString); - } - if( MessageResource->Flags ) { - /* we've got a unicode string */ - RtlFreeAnsiString(&MessageA); - } - } - if( ClientFileNameU.Buffer ) { - RtlFreeHeap (RtlGetProcessHeap(), 0, ClientFileNameU.Buffer); - } - - szxMessageBody = (LPWSTR)RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(wchar_t)*(strlen(MessageBody)+1)); - wsprintfW(szxMessageBody, L"%hs", MessageBody); - RtlFreeHeap (RtlGetProcessHeap(), 0, MessageBody); - - switch ( HardErrorMessage->ValidResponseOptions ) - { - case OptionAbortRetryIgnore: - responce = MB_ABORTRETRYIGNORE; - break; - - case OptionOk: - responce = MB_OK; - break; - - case OptionOkCancel: - responce = MB_OKCANCEL; - break; - - case OptionRetryCancel: - responce = MB_RETRYCANCEL; - break; - - case OptionYesNo: - responce = MB_YESNO; - break; - - case OptionYesNoCancel: - responce = MB_YESNOCANCEL; - break; - - case OptionShutdownSystem: - // XZ?? - break; - - default: - DPRINT1("Wrong option: ValidResponseOptions = %d\n", HardErrorMessage->ValidResponseOptions); - ASSERT(FALSE); - break; - } - - // FIXME: We should not use MessageBox !!!! - DPRINT1("%S\n", szxMessageBody); - MessageBoxResponse = MessageBoxW(0, szxMessageBody, szxCaptionText, responce|MB_ICONERROR|MB_SYSTEMMODAL|MB_SETFOREGROUND); - - RtlFreeHeap (RtlGetProcessHeap(), 0, szxMessageBody); - RtlFreeHeap (RtlGetProcessHeap(), 0, szxCaptionText); - - switch( MessageBoxResponse ) - { - case IDOK: - HardErrorMessage->Response = ResponseOk; - break; - - case IDCANCEL: - HardErrorMessage->Response = ResponseCancel; - break; - - case IDYES: - HardErrorMessage->Response = ResponseYes; - break; - - case IDNO: - HardErrorMessage->Response = ResponseNo; - break; - - case IDABORT: - HardErrorMessage->Response = ResponseAbort; - break; - - case IDIGNORE: - HardErrorMessage->Response = ResponseIgnore; - break; - - case IDRETRY: - HardErrorMessage->Response = ResponseRetry; - break; - - case 10://IDTRYAGAIN: - HardErrorMessage->Response = ResponseTryAgain; - break; - - case 11://IDCONTINUE: - HardErrorMessage->Response = ResponseContinue; - break; - - default: - ASSERT(FALSE); - break; - } - - return TRUE; -} - - BOOL WINAPI Win32CsrInitialization(PCSRSS_API_DEFINITION *ApiDefinitions, PCSRSS_OBJECT_DEFINITION *ObjectDefinitions, diff --git a/subsystems/win32/csrss/win32csr/guiconsole.c b/subsystems/win32/csrss/win32csr/guiconsole.c index 51eca7c21c7..243246d5d47 100644 --- a/subsystems/win32/csrss/win32csr/guiconsole.c +++ b/subsystems/win32/csrss/win32csr/guiconsole.c @@ -22,7 +22,6 @@ typedef struct GUI_CONSOLE_DATA_TAG HFONT Font; unsigned CharWidth; unsigned CharHeight; - PWCHAR LineBuffer; BOOL CursorBlinkOn; BOOL ForceCursorOff; CRITICAL_SECTION Lock; @@ -48,6 +47,8 @@ typedef struct GUI_CONSOLE_DATA_TAG COLORREF PopupText; COLORREF Colors[16]; WCHAR szProcessName[MAX_PATH]; + BOOL WindowSizeLock; + POINT OldCursor; } GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; #ifndef WM_APP @@ -625,7 +626,7 @@ GuiConsoleUseDefaults(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PCSRSS_ if (Buffer) { Buffer->MaxX = 80; - Buffer->MaxY = 25; + Buffer->MaxY = 300; Buffer->CursorInfo.bVisible = TRUE; Buffer->CursorInfo.dwSize = CSR_DEFAULT_CURSOR_SIZE; } @@ -638,8 +639,8 @@ GuiConsoleInitScrollbar(PCSRSS_CONSOLE Console, HWND hwnd) SCROLLINFO sInfo; PGUI_CONSOLE_DATA GuiData = Console->PrivateData; - DWORD Width = Console->Size.X * GuiData->CharWidth + 2 * GetSystemMetrics(SM_CXFIXEDFRAME); - DWORD Height = Console->Size.Y * GuiData->CharHeight + 2 * GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION); + DWORD Width = Console->Size.X * GuiData->CharWidth + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + DWORD Height = Console->Size.Y * GuiData->CharHeight + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); /* set scrollbar sizes */ sInfo.cbSize = sizeof(SCROLLINFO); @@ -667,6 +668,7 @@ GuiConsoleInitScrollbar(PCSRSS_CONSOLE Console, HWND hwnd) SetScrollInfo(hwnd, SB_HORZ, &sInfo, TRUE); Height += GetSystemMetrics(SM_CYHSCROLL); ShowScrollBar(hwnd, SB_HORZ, TRUE); + } else { @@ -710,9 +712,6 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create) InitializeCriticalSection(&GuiData->Lock); - GuiData->LineBuffer = (PWCHAR)HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, - Console->Size.X * sizeof(WCHAR)); - GuiData->Font = CreateFontW(LOWORD(GuiData->FontSize), 0, //HIWORD(GuiData->FontSize), 0, @@ -779,9 +778,13 @@ GuiConsoleHandleNcCreate(HWND hWnd, CREATESTRUCTW *Create) Console->PrivateData = GuiData; SetWindowLongPtrW(hWnd, GWL_USERDATA, (DWORD_PTR) Console); - SetTimer(hWnd, 1, CURSOR_BLINK_TIME, NULL); + SetTimer(hWnd, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); GuiConsoleCreateSysMenu(Console); + + GuiData->WindowSizeLock = TRUE; GuiConsoleInitScrollbar(Console, hWnd); + GuiData->WindowSizeLock = FALSE; + SetEvent(GuiData->hGuiInitEvent); return (BOOL) DefWindowProcW(hWnd, WM_NCCREATE, 0, (LPARAM) Create); @@ -888,21 +891,22 @@ GuiConsolePaint(PCSRSS_CONSOLE Console, for (Line = TopLine; Line <= BottomLine; Line++) { + WCHAR LineBuffer[80]; From = ConioCoordToPointer(Buff, LeftChar, Line); Start = LeftChar; - To = GuiData->LineBuffer; + To = LineBuffer; for (Char = LeftChar; Char <= RightChar; Char++) { - if (*(From + 1) != LastAttribute) + if (*(From + 1) != LastAttribute || (Char - Start == sizeof(LineBuffer) / sizeof(WCHAR))) { TextOutW(hDC, (Start - Buff->ShowX) * GuiData->CharWidth, (Line - Buff->ShowY) * GuiData->CharHeight, - GuiData->LineBuffer, + LineBuffer, Char - Start); Start = Char; - To = GuiData->LineBuffer; + To = LineBuffer; Attribute = *(From + 1); if (Attribute != LastAttribute) { @@ -925,7 +929,7 @@ GuiConsolePaint(PCSRSS_CONSOLE Console, TextOutW(hDC, (Start - Buff->ShowX) * GuiData->CharWidth, (Line - Buff->ShowY) * GuiData->CharHeight, - GuiData->LineBuffer, + LineBuffer, RightChar - Start + 1); } @@ -1157,6 +1161,11 @@ GuiWriteStream(PCSRSS_CONSOLE Console, RECT *Region, LONG CursorStartX, LONG Cur { GuiInvalidateCell(Buff, GuiData, Console->hWindow, CursorEndX, CursorEndY); } + + // Set up the update timer (very short interval) - this is a "hack" for getting the OS to + // repaint the window without having it just freeze up and stay on the screen permanently. + GuiData->CursorBlinkOn = TRUE; + SetTimer(Console->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); } static BOOL WINAPI @@ -1219,16 +1228,93 @@ GuiConsoleHandleTimer(HWND hWnd) { PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; + PCSRSS_SCREEN_BUFFER Buff; RECT CursorRect; - GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); - GuiData->CursorBlinkOn = ! GuiData->CursorBlinkOn; + SetTimer(hWnd, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL); - CursorRect.left = Console->ActiveBuffer->CurrentX; - CursorRect.top = Console->ActiveBuffer->CurrentY; + GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); + + Buff = Console->ActiveBuffer; + CursorRect.left = Buff->CurrentX; + CursorRect.top = Buff->CurrentY; CursorRect.right = CursorRect.left; CursorRect.bottom = CursorRect.top; GuiDrawRegion(Console, &CursorRect); + GuiData->CursorBlinkOn = ! GuiData->CursorBlinkOn; + + if((GuiData->OldCursor.x != Buff->CurrentX) || (GuiData->OldCursor.y != Buff->CurrentY)) + { + SCROLLINFO xScroll; + int OldScrollX = -1, OldScrollY = -1; + int NewScrollX = -1, NewScrollY = -1; + + xScroll.cbSize = sizeof(SCROLLINFO); + xScroll.fMask = SIF_POS; + // Capture the original position of the scroll bars and save them. + if(GetScrollInfo(hWnd, SB_HORZ, &xScroll))OldScrollX = xScroll.nPos; + if(GetScrollInfo(hWnd, SB_VERT, &xScroll))OldScrollY = xScroll.nPos; + + // If we successfully got the info for the horizontal scrollbar + if(OldScrollX >= 0) + { + if((Buff->CurrentX < Buff->ShowX)||(Buff->CurrentX >= (Buff->ShowX + Console->Size.X))) + { + // Handle the horizontal scroll bar + if(Buff->CurrentX >= Console->Size.X) NewScrollX = Buff->CurrentX - Console->Size.X + 1; + else NewScrollX = 0; + } + else + { + NewScrollX = OldScrollX; + } + } + // If we successfully got the info for the vertical scrollbar + if(OldScrollY >= 0) + { + if((Buff->CurrentY < Buff->ShowY) || (Buff->CurrentY >= (Buff->ShowY + Console->Size.Y))) + { + // Handle the vertical scroll bar + if(Buff->CurrentY >= Console->Size.Y) NewScrollY = Buff->CurrentY - Console->Size.Y + 1; + else NewScrollY = 0; + } + else + { + NewScrollY = OldScrollY; + } + } + + // Adjust scroll bars and refresh the window if the cursor has moved outside the visible area + // NOTE: OldScroll# and NewScroll# will both be -1 (initial value) if the info for the respective scrollbar + // was not obtained successfully in the previous steps. This means their difference is 0 (no scrolling) + // and their associated scrollbar is left alone. + if((OldScrollX != NewScrollX) || (OldScrollY != NewScrollY)) + { + Buff->ShowX = NewScrollX; + Buff->ShowY = NewScrollY; + ScrollWindowEx(hWnd, + (OldScrollX - NewScrollX) * GuiData->CharWidth, + (OldScrollY - NewScrollY) * GuiData->CharHeight, + NULL, + NULL, + NULL, + NULL, + SW_INVALIDATE); + if(NewScrollX >= 0) + { + xScroll.nPos = NewScrollX; + SetScrollInfo(hWnd, SB_HORZ, &xScroll, TRUE); + } + if(NewScrollY >= 0) + { + xScroll.nPos = NewScrollY; + SetScrollInfo(hWnd, SB_VERT, &xScroll, TRUE); + } + UpdateWindow(hWnd); + GuiData->OldCursor.x = Buff->CurrentX; + GuiData->OldCursor.y = Buff->CurrentY; + } + } } static VOID FASTCALL @@ -1518,16 +1604,83 @@ GuiConsoleHandleSysMenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, PGUI_CON return Ret; } +static VOID FASTCALL +GuiConsoleGetMinMaxInfo(HWND hWnd, PMINMAXINFO minMaxInfo) +{ + PCSRSS_CONSOLE Console; + PGUI_CONSOLE_DATA GuiData; + GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); + if((Console == NULL)|| (GuiData == NULL)) return; + + DWORD windx = CONGUI_MIN_WIDTH * GuiData->CharWidth + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + DWORD windy = CONGUI_MIN_HEIGHT * GuiData->CharHeight + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); + + minMaxInfo->ptMinTrackSize.x = windx; + minMaxInfo->ptMinTrackSize.y = windy; + + windx = (Console->ActiveBuffer->MaxX) * GuiData->CharWidth + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + windy = (Console->ActiveBuffer->MaxY) * GuiData->CharHeight + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); + + if(Console->Size.X < Console->ActiveBuffer->MaxX) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar + if(Console->Size.Y < Console->ActiveBuffer->MaxY) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar + + minMaxInfo->ptMaxTrackSize.x = windx; + minMaxInfo->ptMaxTrackSize.y = windy; +} static VOID FASTCALL GuiConsoleResize(HWND hWnd, WPARAM wParam, LPARAM lParam) { PCSRSS_CONSOLE Console; PGUI_CONSOLE_DATA GuiData; - GuiConsoleGetDataPointers(hWnd, &Console, &GuiData); - if (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED) + if((Console == NULL) || (GuiData == NULL)) return; + + if ((GuiData->WindowSizeLock == FALSE) && (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED)) { - DPRINT1("GuiConsoleResize X %d Y %d\n", LOWORD(lParam), HIWORD(lParam)); + PCSRSS_SCREEN_BUFFER Buff = Console->ActiveBuffer; + + GuiData->WindowSizeLock = TRUE; + + DWORD windx = LOWORD(lParam); + DWORD windy = HIWORD(lParam); + + // Compensate for existing scroll bars (because lParam values do not accommodate scroll bar) + if(Console->Size.X < Buff->MaxX) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar + if(Console->Size.Y < Buff->MaxY) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar + + DWORD charx = windx / GuiData->CharWidth; + DWORD chary = windy / GuiData->CharHeight; + + // Character alignment (round size up or down) + if((windx % GuiData->CharWidth) >= (GuiData->CharWidth / 2)) ++charx; + if((windy % GuiData->CharHeight) >= (GuiData->CharHeight / 2)) ++chary; + + // Compensate for added scroll bars in new window + if(charx < Buff->MaxX)windy -= GetSystemMetrics(SM_CYHSCROLL); // new window will have a horizontal scroll bar + if(chary < Buff->MaxY)windx -= GetSystemMetrics(SM_CXVSCROLL); // new window will have a vertical scroll bar + + charx = windx / GuiData->CharWidth; + chary = windy / GuiData->CharHeight; + + // Character alignment (round size up or down) + if((windx % GuiData->CharWidth) >= (GuiData->CharWidth / 2)) ++charx; + if((windy % GuiData->CharHeight) >= (GuiData->CharHeight / 2)) ++chary; + + // Resize window + if((charx != Console->Size.X) || (chary != Console->Size.Y)) + { + Console->Size.X = (charx <= Buff->MaxX) ? charx : Buff->MaxX; + Console->Size.Y = (chary <= Buff->MaxY) ? chary : Buff->MaxY; + } + + GuiConsoleInitScrollbar(Console, hWnd); + + // Adjust the start of the visible area if we are attempting to show nonexistent areas + if((Buff->MaxX - Buff->ShowX) < Console->Size.X) Buff->ShowX = Buff->MaxX - Console->Size.X; + if((Buff->MaxY - Buff->ShowY) < Console->Size.Y) Buff->ShowY = Buff->MaxY - Console->Size.Y; + InvalidateRect(hWnd, NULL, TRUE); + + GuiData->WindowSizeLock = FALSE; } } VOID @@ -1555,11 +1708,105 @@ GuiConsoleHandleScrollbarMenu() } +static NTSTATUS WINAPI +GuiResizeBuffer(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer, COORD Size) +{ + BYTE * Buffer; + DWORD Offset = 0; + BYTE * OldPtr; + USHORT CurrentY; + BYTE * OldBuffer; +#if HAVE_WMEMSET + USHORT value = MAKEWORD(' ', ScreenBuffer->DefaultAttrib); +#endif + DWORD diff; + DWORD i; + + /* Buffer size is not allowed to be smaller than window size */ + if (Size.X < Console->Size.X || Size.Y < Console->Size.Y) + return STATUS_INVALID_PARAMETER; + + if (Size.X == ScreenBuffer->MaxX && Size.Y == ScreenBuffer->MaxY) + return STATUS_SUCCESS; + + Buffer = HeapAlloc(Win32CsrApiHeap, 0, Size.X * Size.Y * 2); + if (!Buffer) + return STATUS_NO_MEMORY; + + DPRINT1("Resizing (%d,%d) to (%d,%d)\n", ScreenBuffer->MaxX, ScreenBuffer->MaxY, Size.X, Size.Y); + OldBuffer = ScreenBuffer->Buffer; + + for (CurrentY = 0; CurrentY < ScreenBuffer->MaxY && CurrentY < Size.Y; CurrentY++) + { + OldPtr = ConioCoordToPointer(ScreenBuffer, 0, CurrentY); + if (Size.X <= ScreenBuffer->MaxX) + { + /* reduce size */ + RtlCopyMemory(&Buffer[Offset], OldPtr, Size.X * 2); + Offset += (Size.X * 2); + } + else + { + /* enlarge size */ + RtlCopyMemory(&Buffer[Offset], OldPtr, ScreenBuffer->MaxX * 2); + Offset += (ScreenBuffer->MaxX * 2); + + diff = Size.X - ScreenBuffer->MaxX; + /* zero new part of it */ +#if HAVE_WMEMSET + wmemset((WCHAR*)&Buffer[Offset], value, diff); +#else + for (i = 0; i < diff; i++) + { + Buffer[Offset++] = ' '; + Buffer[Offset++] = ScreenBuffer->DefaultAttrib; + } +#endif + } + } + + if (Size.Y > ScreenBuffer->MaxY) + { + diff = Size.X * (Size.Y - ScreenBuffer->MaxY); +#if HAVE_WMEMSET + wmemset((WCHAR*)&Buffer[Offset], value, diff); +#else + for (i = 0; i < diff; i++) + { + Buffer[Offset++] = ' '; + Buffer[Offset++] = ScreenBuffer->DefaultAttrib; + } +#endif + } + + (void)InterlockedExchangePointer((PVOID volatile *)&ScreenBuffer->Buffer, Buffer); + HeapFree(Win32CsrApiHeap, 0, OldBuffer); + ScreenBuffer->MaxX = Size.X; + ScreenBuffer->MaxY = Size.Y; + ScreenBuffer->VirtualY = 0; + + /* Ensure cursor and window are within buffer */ + if (ScreenBuffer->CurrentX >= Size.X) + ScreenBuffer->CurrentX = Size.X - 1; + if (ScreenBuffer->CurrentY >= Size.Y) + ScreenBuffer->CurrentY = Size.Y - 1; + if (ScreenBuffer->ShowX > Size.X - Console->Size.X) + ScreenBuffer->ShowX = Size.X - Console->Size.X; + if (ScreenBuffer->ShowY > Size.Y - Console->Size.Y) + ScreenBuffer->ShowY = Size.Y - Console->Size.Y; + + /* TODO: Should update scrollbar, but can't use anything that + * calls SendMessage or it could cause deadlock */ + + return STATUS_SUCCESS; +} + static VOID FASTCALL GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsoleInfo pConInfo) { DWORD windx, windy; PCSRSS_SCREEN_BUFFER ActiveBuffer = Console->ActiveBuffer; + COORD BufSize; BOOL SizeChanged = FALSE; EnterCriticalSection(&ActiveBuffer->Header.Lock); @@ -1571,104 +1818,9 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole /* apply cursor size */ ActiveBuffer->CursorInfo.dwSize = min(max(pConInfo->CursorSize, 1), 100); - windx = LOWORD(pConInfo->ScreenBuffer); - windy = HIWORD(pConInfo->ScreenBuffer); - - if (windx != ActiveBuffer->MaxX || windy != ActiveBuffer->MaxY) - { - BYTE * Buffer = HeapAlloc(Win32CsrApiHeap, 0, windx * windy * 2); - - if (Buffer) - { - DWORD Offset = 0; - BYTE * OldPtr; - USHORT CurrentY; - BYTE * OldBuffer; - USHORT value; - DWORD diff; - DWORD i; - - value = MAKEWORD(' ', ActiveBuffer->DefaultAttrib); - - DPRINT("MaxX %d MaxY %d windx %d windy %d value %04x DefaultAttrib %d\n",ActiveBuffer->MaxX, ActiveBuffer->MaxY, windx, windy, value, ActiveBuffer->DefaultAttrib); - OldBuffer = ActiveBuffer->Buffer; - - for (CurrentY = 0; CurrentY < min(ActiveBuffer->MaxY, windy); CurrentY++) - { - OldPtr = ConioCoordToPointer(ActiveBuffer, 0, CurrentY); - if (windx <= ActiveBuffer->MaxX) - { - /* reduce size */ - RtlCopyMemory(&Buffer[Offset], OldPtr, windx * 2); - Offset += (windx * 2); - } - else - { - /* enlarge size */ - RtlCopyMemory(&Buffer[Offset], OldPtr, ActiveBuffer->MaxX * 2); - Offset += (ActiveBuffer->MaxX * 2); - - diff = windx - ActiveBuffer->MaxX; - /* zero new part of it */ -#if HAVE_WMEMSET - wmemset((WCHAR*)&Buffer[Offset], value, diff); -#else - for (i = 0; i < diff; i++) - { - Buffer[Offset++] = ' '; - Buffer[Offset++] = ActiveBuffer->DefaultAttrib; - } -#endif - } - } - - if (windy > ActiveBuffer->MaxY) - { - diff = windy - ActiveBuffer->MaxY; -#if HAVE_WMEMSET - wmemset((WCHAR*)&Buffer[Offset], value, diff * windx); -#else - for (i = 0; i < diff * windx; i++) - { - Buffer[Offset++] = ' '; - Buffer[Offset++] = ActiveBuffer->DefaultAttrib; - } -#endif - } - - (void)InterlockedExchangePointer((PVOID volatile *)&ActiveBuffer->Buffer, Buffer); - HeapFree(Win32CsrApiHeap, 0, OldBuffer); - ActiveBuffer->MaxX = windx; - ActiveBuffer->MaxY = windy; - ActiveBuffer->VirtualY = 0; - SizeChanged = TRUE; - } - else - { - LeaveCriticalSection(&ActiveBuffer->Header.Lock); - return; - } - } - windx = LOWORD(pConInfo->WindowSize); windy = HIWORD(pConInfo->WindowSize); - if (windx > Console->Size.X) - { - PWCHAR LineBuffer = HeapAlloc(Win32CsrApiHeap, HEAP_ZERO_MEMORY, windx * sizeof(WCHAR)); - if (LineBuffer) - { - HeapFree(Win32CsrApiHeap, 0, GuiData->LineBuffer); - GuiData->LineBuffer = LineBuffer; - } - else - { - LeaveCriticalSection(&ActiveBuffer->Header.Lock); - return; - } - } - - if (windx != Console->Size.X || windy != Console->Size.Y) { /* resize window */ @@ -1677,9 +1829,19 @@ GuiApplyUserSettings(PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA GuiData, PConsole SizeChanged = TRUE; } + BufSize.X = LOWORD(pConInfo->ScreenBuffer); + BufSize.Y = HIWORD(pConInfo->ScreenBuffer); + if (BufSize.X != ActiveBuffer->MaxX || BufSize.Y != ActiveBuffer->MaxY) + { + if (NT_SUCCESS(GuiResizeBuffer(Console, ActiveBuffer, BufSize))) + SizeChanged = TRUE; + } + if (SizeChanged) { + GuiData->WindowSizeLock = TRUE; GuiConsoleInitScrollbar(Console, pConInfo->hConsoleWindow); + GuiData->WindowSizeLock = FALSE; } LeaveCriticalSection(&ActiveBuffer->Header.Lock); @@ -1839,6 +2001,9 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_VSCROLL: Result = GuiConsoleHandleScroll(hWnd, msg, wParam); break; + case WM_GETMINMAXINFO: + GuiConsoleGetMinMaxInfo(hWnd, (PMINMAXINFO)lParam); + break; case WM_SIZE: GuiConsoleResize(hWnd, wParam, lParam); break; @@ -1886,17 +2051,18 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { Title = L""; } - NewWindow = CreateWindowW(L"ConsoleWindowClass", - Title, - WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_HSCROLL | WS_VSCROLL, //WS_OVERLAPPEDWINDOW - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - CW_USEDEFAULT, - NULL, - NULL, - (HINSTANCE) GetModuleHandleW(NULL), - (PVOID) Console); + NewWindow = CreateWindowExW(WS_EX_CLIENTEDGE, + L"ConsoleWindowClass", + Title, + WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + CW_USEDEFAULT, + NULL, + NULL, + (HINSTANCE) GetModuleHandleW(NULL), + (PVOID) Console); if (NULL != Buffer) { HeapFree(Win32CsrApiHeap, 0, Buffer); @@ -2079,7 +2245,8 @@ static CSRSS_CONSOLE_VTBL GuiVtbl = GuiUpdateScreenInfo, GuiChangeTitle, GuiCleanupConsole, - GuiChangeIcon + GuiChangeIcon, + GuiResizeBuffer, }; NTSTATUS FASTCALL @@ -2154,7 +2321,7 @@ GuiInitConsole(PCSRSS_CONSOLE Console) /* wait untill initialization has finished */ WaitForSingleObject(GuiData->hGuiInitEvent, INFINITE); - DPRINT1("received event Console %p GuiData %p X %d Y %d\n", Console, Console->PrivateData, Console->Size.X, Console->Size.Y); + DPRINT("received event Console %p GuiData %p X %d Y %d\n", Console, Console->PrivateData, Console->Size.X, Console->Size.Y); CloseHandle(GuiData->hGuiInitEvent); GuiData->hGuiInitEvent = NULL; diff --git a/subsystems/win32/csrss/win32csr/guiconsole.h b/subsystems/win32/csrss/win32csr/guiconsole.h index f933d933b6e..072ef8c8886 100644 --- a/subsystems/win32/csrss/win32csr/guiconsole.h +++ b/subsystems/win32/csrss/win32csr/guiconsole.h @@ -8,6 +8,11 @@ #include "api.h" +#define CONGUI_MIN_WIDTH 10 +#define CONGUI_MIN_HEIGHT 10 +#define CONGUI_UPDATE_TIME 0 +#define CONGUI_UPDATE_TIMER 1 + NTSTATUS FASTCALL GuiInitConsole(PCSRSS_CONSOLE Console); /*EOF*/ diff --git a/subsystems/win32/csrss/win32csr/harderror.c b/subsystems/win32/csrss/win32csr/harderror.c new file mode 100644 index 00000000000..4b46e340842 --- /dev/null +++ b/subsystems/win32/csrss/win32csr/harderror.c @@ -0,0 +1,554 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: subsys/csrss/win32csr/dllmain.c + * PURPOSE: Initialization + * PROGRAMMERS: Dmitry Philippov (shedon@mail.ru) + * Timo Kreuzer (timo.kreuzer@reactos.org) + */ + +/* INCLUDES ******************************************************************/ + +#define NDEBUG +#include "w32csr.h" +#include +#include + +#define IDTRYAGAIN 10 +#define IDCONTINUE 11 + +/* FUNCTIONS *****************************************************************/ + +static +NTSTATUS +CsrpGetClientFileName( + OUT PUNICODE_STRING ClientFileNameU, + HANDLE hProcess) +{ + PLIST_ENTRY ModuleListHead; + PLIST_ENTRY Entry; + PLDR_DATA_TABLE_ENTRY Module; + PPEB_LDR_DATA Ldr; + PROCESS_BASIC_INFORMATION ClientBasicInfo; + LDR_DATA_TABLE_ENTRY ModuleData; + PVOID ClientDllBase; + NTSTATUS Status; + PPEB Peb; + + /* Initialize string */ + ClientFileNameU->MaximumLength = 0; + ClientFileNameU->Length = 0; + ClientFileNameU->Buffer = NULL; + + /* Query process information */ + Status = NtQueryInformationProcess(hProcess, + ProcessBasicInformation, + &ClientBasicInfo, + sizeof(ClientBasicInfo), + NULL); + if (!NT_SUCCESS(Status)) return Status; + + Peb = ClientBasicInfo.PebBaseAddress; + if (!Peb) return STATUS_UNSUCCESSFUL; + + Status = NtReadVirtualMemory(hProcess, &Peb->Ldr, &Ldr, sizeof(Ldr), NULL); + if (!NT_SUCCESS(Status)) return Status; + + ModuleListHead = &Ldr->InLoadOrderModuleList; + Status = NtReadVirtualMemory(hProcess, + &ModuleListHead->Flink, + &Entry, + sizeof(Entry), + NULL); + if (!NT_SUCCESS(Status)) return Status; + + if (Entry == ModuleListHead) return STATUS_UNSUCCESSFUL; + + Module = CONTAINING_RECORD(Entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + + Status = NtReadVirtualMemory(hProcess, + Module, + &ModuleData, + sizeof(ModuleData), + NULL); + if (!NT_SUCCESS(Status)) return Status; + + Status = NtReadVirtualMemory(hProcess, + &Peb->ImageBaseAddress, + &ClientDllBase, + sizeof(ClientDllBase), + NULL); + if (!NT_SUCCESS(Status)) return Status; + + if (ClientDllBase != ModuleData.DllBase) return STATUS_UNSUCCESSFUL; + + ClientFileNameU->MaximumLength = ModuleData.BaseDllName.MaximumLength; + ClientFileNameU->Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + ClientFileNameU->MaximumLength); + + Status = NtReadVirtualMemory(hProcess, + ModuleData.BaseDllName.Buffer, + ClientFileNameU->Buffer, + ClientFileNameU->MaximumLength, + NULL); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(RtlGetProcessHeap(), 0, ClientFileNameU->Buffer); + ClientFileNameU->Buffer = NULL; + ClientFileNameU->MaximumLength = 0; + return Status; + } + + ClientFileNameU->Length = wcslen(ClientFileNameU->Buffer)*sizeof(wchar_t); + DPRINT("ClientFileNameU=\'%wZ\'\n", &ClientFileNameU); + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +CsrpCaptureStringParameters( + OUT PULONG_PTR Parameters, + OUT PULONG SizeOfAllUnicodeStrings, + IN PHARDERROR_MSG HardErrorMessage, + HANDLE hProcess) +{ + ULONG nParam, UnicodeStringParameterMask, Size = 0; + NTSTATUS Status; + UNICODE_STRING TempStringU; + PWSTR ParamString; + + UnicodeStringParameterMask = HardErrorMessage->UnicodeStringParameterMask; + + /* Read all strings from client space */ + for (nParam = 0; + nParam < HardErrorMessage->NumberOfParameters; + nParam++, UnicodeStringParameterMask >>= 1) + { + Parameters[nParam] = 0; + + /* Check if the current parameter is a unicode string */ + if (UnicodeStringParameterMask & 0x01) + { + /* Read the UNICODE_STRING from the process memory */ + Status = NtReadVirtualMemory(hProcess, + (PVOID)HardErrorMessage->Parameters[nParam], + &TempStringU, + sizeof(TempStringU), + NULL); + + if (!NT_SUCCESS(Status)) return Status; + + /* Allocate a buffer for the string */ + ParamString = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + TempStringU.Length + sizeof(WCHAR)); + + if (!ParamString) + { + DPRINT1("Cannot allocate memory %d\n", TempStringU.Length); + return STATUS_NO_MEMORY; + } + + /* Read the string buffer from the process memory */ + Status = NtReadVirtualMemory(hProcess, + TempStringU.Buffer, + ParamString, + TempStringU.Length, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtReadVirtualMemory failed with code: %lx\n", Status); + RtlFreeHeap(RtlGetProcessHeap(), 0, ParamString); + return Status; + } + + /* Zero terminate the string */ + ParamString[TempStringU.Length / sizeof(WCHAR)] = 0; + DPRINT("ParamString=\'%S\'\n", ParamString); + + Parameters[nParam] = (ULONG_PTR)ParamString; + Size += TempStringU.Length; + } + else + { + /* It's not a unicode string */ + Parameters[nParam] = HardErrorMessage->Parameters[nParam]; + } + } + + *SizeOfAllUnicodeStrings = Size; + return STATUS_SUCCESS; +} + +static +VOID +CsrpFreeStringParameters( + IN OUT PULONG_PTR Parameters, + IN PHARDERROR_MSG HardErrorMessage) +{ + ULONG nParam, UnicodeStringParameterMask; + + UnicodeStringParameterMask = HardErrorMessage->UnicodeStringParameterMask; + + /* Loop all parameters */ + for (nParam = 0; + nParam < HardErrorMessage->NumberOfParameters; + nParam++, UnicodeStringParameterMask >>= 1) + { + /* Check if the current parameter is a string */ + if (UnicodeStringParameterMask & 0x01) + { + /* Free the string buffer */ + RtlFreeHeap(RtlGetProcessHeap(), 0, (PVOID)Parameters[nParam]); + } + } +} + + +static +NTSTATUS +CsrpFormatMessages( + OUT PUNICODE_STRING TextStringU, + OUT PUNICODE_STRING CaptionStringU, + IN PULONG_PTR Parameters, + IN ULONG SizeOfStrings, + IN PHARDERROR_MSG Message, + IN HANDLE hProcess) +{ + NTSTATUS Status; + UNICODE_STRING FileNameU, TempStringU, FormatU; + ANSI_STRING FormatA; + PRTL_MESSAGE_RESOURCE_ENTRY MessageResource; + PWSTR FormatString; + ULONG Size, ExceptionCode; + + /* Get the file name of the client process */ + CsrpGetClientFileName(&FileNameU, hProcess); + + /* Check if we have a file name */ + if (!FileNameU.Buffer) + { + /* No, use system */ + RtlInitUnicodeString(&FileNameU, L"System"); + } + + /* Get text string of the error code */ + Status = RtlFindMessage(GetModuleHandleW(L"ntdll"), + (ULONG_PTR)RT_MESSAGETABLE, + LANG_NEUTRAL, + Message->Status, + &MessageResource); + + if (NT_SUCCESS(Status)) + { + if (MessageResource->Flags) + { + RtlInitUnicodeString(&FormatU, (PWSTR)MessageResource->Text); + FormatA.Buffer = NULL; + } + else + { + RtlInitAnsiString(&FormatA, MessageResource->Text); + RtlAnsiStringToUnicodeString(&FormatU, &FormatA, TRUE); + } + } + else + { + /* Fall back to hardcoded value */ + RtlInitUnicodeString(&FormatU, L"Unknown Hard Error"); + FormatA.Buffer = NULL; + } + + FormatString = FormatU.Buffer; + + /* Check whether a caption exists */ + if (FormatString[0] == L'{') + { + /* Set caption start */ + TempStringU.Buffer = ++FormatString; + + /* Get size of the caption */ + for (Size = 0; *FormatString != 0 && *FormatString != L'}'; Size++) + FormatString++; + + /* Skip '}', '\r', '\n' */ + FormatString += 3; + + TempStringU.Length = Size * sizeof(WCHAR); + TempStringU.MaximumLength = TempStringU.Length; + } + else + { + /* FIXME: Set string based on severity */ + RtlInitUnicodeString(&TempStringU, L"Application Error"); + } + + /* Calculate buffer length for the caption */ + CaptionStringU->MaximumLength = FileNameU.Length + TempStringU.Length + + 4 * sizeof(WCHAR); + + /* Allocate a buffer for the caption */ + CaptionStringU->Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + CaptionStringU->MaximumLength); + + /* Append the file name, seperator and the caption text */ + CaptionStringU->Length = 0; + RtlAppendUnicodeStringToString(CaptionStringU, &FileNameU); + RtlAppendUnicodeToString(CaptionStringU, L" - "); + RtlAppendUnicodeStringToString(CaptionStringU, &TempStringU); + + /* Zero terminate the buffer */ + CaptionStringU->Buffer[CaptionStringU->Length] = 0; + + /* Free the file name buffer */ + RtlFreeUnicodeString(&FileNameU); + + /* Check if this is an exception message */ + if (Message->Status == STATUS_UNHANDLED_EXCEPTION) + { + ExceptionCode = Parameters[0]; + + /* Handle special cases */ + if (ExceptionCode == STATUS_ACCESS_VIOLATION) + { + Parameters[0] = Parameters[1]; + Parameters[1] = Parameters[3]; + if (Parameters[2]) Parameters[2] = (ULONG_PTR)L"written"; + else Parameters[2] = (ULONG_PTR)L"read"; + MessageResource = NULL; + } + else if (ExceptionCode == STATUS_IN_PAGE_ERROR) + { + Parameters[0] = Parameters[1]; + Parameters[1] = Parameters[3]; + MessageResource = NULL; + } + else + { + /* Fall back to hardcoded value */ + Parameters[2] = Parameters[1]; + Parameters[1] = Parameters[0]; + Parameters[0] = (ULONG_PTR)L"unknown software exception"; + } + + if (!MessageResource) + { + /* Get text string of the exception code */ + Status = RtlFindMessage(GetModuleHandleW(L"ntdll"), + (ULONG_PTR)RT_MESSAGETABLE, + LANG_NEUTRAL, + ExceptionCode, + &MessageResource); + + if (NT_SUCCESS(Status)) + { + if (FormatA.Buffer) RtlFreeUnicodeString(&FormatU); + + if (MessageResource->Flags) + { + RtlInitUnicodeString(&FormatU, (PWSTR)MessageResource->Text); + FormatA.Buffer = NULL; + } + else + { + RtlInitAnsiString(&FormatA, MessageResource->Text); + RtlAnsiStringToUnicodeString(&FormatU, &FormatA, TRUE); + } + FormatString = FormatU.Buffer; + } + else + { + /* Fall back to hardcoded value */ + Parameters[2] = Parameters[1]; + Parameters[1] = Parameters[0]; + Parameters[0] = (ULONG_PTR)L"unknown software exception"; + } + } + } + + /* Calculate length of text buffer */ + TextStringU->MaximumLength = FormatU.Length + SizeOfStrings + 42 * sizeof(WCHAR); + + /* Allocate a buffer for the text */ + TextStringU->Buffer = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + TextStringU->MaximumLength); + + /* Wrap in SEH to protect from invalid string parameters */ + _SEH2_TRY + { + /* Print the string into the buffer */ + StringCbPrintfW(TextStringU->Buffer, + TextStringU->MaximumLength, + FormatString, + Parameters[0], + Parameters[1], + Parameters[2], + Parameters[3], + Parameters[4]); + Status = STATUS_SUCCESS; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Set error and free buffers */ + Status = _SEH2_GetExceptionCode(); + RtlFreeHeap(RtlGetProcessHeap(), 0, TextStringU->Buffer); + RtlFreeHeap(RtlGetProcessHeap(), 0, CaptionStringU->Buffer); + } + _SEH2_END + + if (NT_SUCCESS(Status)) + { + TextStringU->Length = wcslen(TextStringU->Buffer) * sizeof(WCHAR); + } + + if (FormatA.Buffer) RtlFreeUnicodeString(&FormatU); + + return Status; +} + +static +ULONG +CsrpMessageBox( + PWSTR Text, + PWSTR Caption, + ULONG ValidResponseOptions, + ULONG Severity) +{ + ULONG Type, MessageBoxResponse; + + /* Set the message box type */ + switch (ValidResponseOptions) + { + case OptionAbortRetryIgnore: + Type = MB_ABORTRETRYIGNORE; + break; + case OptionOk: + Type = MB_OK; + break; + case OptionOkCancel: + Type = MB_OKCANCEL; + break; + case OptionRetryCancel: + Type = MB_RETRYCANCEL; + break; + case OptionYesNo: + Type = MB_YESNO; + break; + case OptionYesNoCancel: + Type = MB_YESNOCANCEL; + break; + case OptionShutdownSystem: + Type = MB_RETRYCANCEL; // FIXME??? + break; + /* Anything else is invalid */ + default: + return ResponseNotHandled; + } + + /* Set severity */ + if (Severity == STATUS_SEVERITY_INFORMATIONAL) Type |= MB_ICONINFORMATION; + else if (Severity == STATUS_SEVERITY_WARNING) Type |= MB_ICONWARNING; + else if (Severity == STATUS_SEVERITY_ERROR) Type |= MB_ICONERROR; + + Type |= MB_SYSTEMMODAL | MB_SETFOREGROUND; + + DPRINT("Text = '%S', Caption = '%S', Severity = %d, Type = 0x%lx\n", + Text, Caption, Severity, Type); + + /* Display a message box */ + MessageBoxResponse = MessageBoxW(0, Text, Caption, Type); + + /* Return response value */ + switch (MessageBoxResponse) + { + case IDOK: return ResponseOk; + case IDCANCEL: return ResponseCancel; + case IDYES: return ResponseYes; + case IDNO: return ResponseNo; + case IDABORT: return ResponseAbort; + case IDIGNORE: return ResponseIgnore; + case IDRETRY: return ResponseRetry; + case IDTRYAGAIN: return ResponseTryAgain; + case IDCONTINUE: return ResponseContinue; + } + + return ResponseNotHandled; +} + +BOOL +WINAPI +Win32CsrHardError( + IN PCSRSS_PROCESS_DATA ProcessData, + IN PHARDERROR_MSG Message) +{ + ULONG_PTR Parameters[MAXIMUM_HARDERROR_PARAMETERS]; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING TextU, CaptionU; + NTSTATUS Status; + HANDLE hProcess; + ULONG Size; + + /* Default to not handled */ + Message->Response = ResponseNotHandled; + + /* Make sure we don't have too many parameters */ + if (Message->NumberOfParameters > MAXIMUM_HARDERROR_PARAMETERS) + Message->NumberOfParameters = MAXIMUM_HARDERROR_PARAMETERS; + + /* Initialize object attributes */ + InitializeObjectAttributes(&ObjectAttributes, NULL, 0, NULL, NULL); + + /* Open client process */ + Status = NtOpenProcess(&hProcess, + PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, + &ObjectAttributes, + &Message->h.ClientId); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("NtOpenProcess failed with code: %lx\n", Status); + return FALSE; + } + + /* Capture all string parameters from the process memory */ + Status = CsrpCaptureStringParameters(Parameters, &Size, Message, hProcess); + if (!NT_SUCCESS(Status)) + { + NtClose(hProcess); + return FALSE; + } + + /* Format the caption and message box text */ + Status = CsrpFormatMessages(&TextU, + &CaptionU, + Parameters, + Size, + Message, + hProcess); + + /* Cleanup */ + CsrpFreeStringParameters(Parameters, Message); + NtClose(hProcess); + + if (!NT_SUCCESS(Status)) + { + return FALSE; + } + + /* Display the message box */ + Message->Response = CsrpMessageBox(TextU.Buffer, + CaptionU.Buffer, + Message->ValidResponseOptions, + (ULONG)Message->Status >> 30); + + RtlFreeUnicodeString(&TextU); + RtlFreeUnicodeString(&CaptionU); + + return TRUE; +} + diff --git a/subsystems/win32/csrss/win32csr/tuiconsole.c b/subsystems/win32/csrss/win32csr/tuiconsole.c index 02f5abfc2bf..5c03f93d590 100644 --- a/subsystems/win32/csrss/win32csr/tuiconsole.c +++ b/subsystems/win32/csrss/win32csr/tuiconsole.c @@ -290,6 +290,19 @@ TuiCleanupConsole(PCSRSS_CONSOLE Console) } } +static BOOL WINAPI +TuiChangeIcon(PCSRSS_CONSOLE Console, HICON hWindowIcon) +{ + return TRUE; +} + +static NTSTATUS WINAPI +TuiResizeBuffer(PCSRSS_CONSOLE Console, PCSRSS_SCREEN_BUFFER ScreenBuffer, COORD Size) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + DWORD WINAPI TuiConsoleThread (PVOID Data) { @@ -340,7 +353,8 @@ static CSRSS_CONSOLE_VTBL TuiVtbl = TuiUpdateScreenInfo, TuiChangeTitle, TuiCleanupConsole, - NULL // ChangeIcon + TuiChangeIcon, + TuiResizeBuffer, }; NTSTATUS FASTCALL diff --git a/subsystems/win32/csrss/win32csr/w32csr.h b/subsystems/win32/csrss/win32csr/w32csr.h index f6f0f4e649c..5ecc378a7c7 100644 --- a/subsystems/win32/csrss/win32csr/w32csr.h +++ b/subsystems/win32/csrss/win32csr/w32csr.h @@ -35,4 +35,11 @@ /* shared header with console.dll */ #include "console.h" + +BOOL +WINAPI +Win32CsrHardError( + IN PCSRSS_PROCESS_DATA ProcessData, + IN PHARDERROR_MSG Message); + /* EOF */ diff --git a/subsystems/win32/csrss/win32csr/win32csr.rbuild b/subsystems/win32/csrss/win32csr/win32csr.rbuild index 7a14f63f806..eec81fcba60 100644 --- a/subsystems/win32/csrss/win32csr/win32csr.rbuild +++ b/subsystems/win32/csrss/win32csr/win32csr.rbuild @@ -14,6 +14,7 @@ advapi32 win32ksys psapi + pseh w32csr.h alias.c conio.c @@ -21,6 +22,7 @@ dllmain.c exitros.c guiconsole.c + harderror.c tuiconsole.c appswitch.c win32csr.rc diff --git a/subsystems/win32/win32k/dib/dib.c b/subsystems/win32/win32k/dib/dib.c index c0e8bbf26bf..30591d3d27d 100644 --- a/subsystems/win32/win32k/dib/dib.c +++ b/subsystems/win32/win32k/dib/dib.c @@ -7,7 +7,7 @@ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib16bpp.c b/subsystems/win32/win32k/dib/dib16bpp.c index cbc0129903b..de569716586 100644 --- a/subsystems/win32/win32k/dib/dib16bpp.c +++ b/subsystems/win32/win32k/dib/dib16bpp.c @@ -8,7 +8,7 @@ * Gregor Anich */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib1bpp.c b/subsystems/win32/win32k/dib/dib1bpp.c index 35ee87047b6..ebea73d3326 100644 --- a/subsystems/win32/win32k/dib/dib1bpp.c +++ b/subsystems/win32/win32k/dib/dib1bpp.c @@ -6,7 +6,7 @@ * PROGRAMMERS: Jason Filby */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib24bpp.c b/subsystems/win32/win32k/dib/dib24bpp.c index 2106d9b4e1d..3810024a6f8 100644 --- a/subsystems/win32/win32k/dib/dib24bpp.c +++ b/subsystems/win32/win32k/dib/dib24bpp.c @@ -8,7 +8,7 @@ * Gregor Anich */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib24bppc.c b/subsystems/win32/win32k/dib/dib24bppc.c index 79a71c9b4aa..ca09cee518b 100644 --- a/subsystems/win32/win32k/dib/dib24bppc.c +++ b/subsystems/win32/win32k/dib/dib24bppc.c @@ -7,7 +7,7 @@ * Magnus Olsen */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib32bpp.c b/subsystems/win32/win32k/dib/dib32bpp.c index edf3f63aa35..6c4704b1c96 100644 --- a/subsystems/win32/win32k/dib/dib32bpp.c +++ b/subsystems/win32/win32k/dib/dib32bpp.c @@ -8,7 +8,7 @@ * Gregor Anich */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib32bppc.c b/subsystems/win32/win32k/dib/dib32bppc.c index da86647367f..859e9507e0e 100644 --- a/subsystems/win32/win32k/dib/dib32bppc.c +++ b/subsystems/win32/win32k/dib/dib32bppc.c @@ -7,7 +7,7 @@ * Magnus Olsen */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib4bpp.c b/subsystems/win32/win32k/dib/dib4bpp.c index 4ae4f8b8f47..1626b8e8397 100644 --- a/subsystems/win32/win32k/dib/dib4bpp.c +++ b/subsystems/win32/win32k/dib/dib4bpp.c @@ -7,7 +7,7 @@ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/dib8bpp.c b/subsystems/win32/win32k/dib/dib8bpp.c index cfbdb0a2db8..95b09cbb73c 100644 --- a/subsystems/win32/win32k/dib/dib8bpp.c +++ b/subsystems/win32/win32k/dib/dib8bpp.c @@ -8,7 +8,7 @@ * Gregor Anich */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/floodfill.c b/subsystems/win32/win32k/dib/floodfill.c index 21bd2c306ab..c31c262d9fc 100644 --- a/subsystems/win32/win32k/dib/floodfill.c +++ b/subsystems/win32/win32k/dib/floodfill.c @@ -6,7 +6,7 @@ * PROGRAMMER: Gregor Schneider, */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/dib/stretchblt.c b/subsystems/win32/win32k/dib/stretchblt.c index 579014ace91..b6d479d8703 100644 --- a/subsystems/win32/win32k/dib/stretchblt.c +++ b/subsystems/win32/win32k/dib/stretchblt.c @@ -8,7 +8,7 @@ * Gregor Schneider */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/alphablend.c b/subsystems/win32/win32k/eng/alphablend.c index 30ba88fd386..34b2930cd68 100644 --- a/subsystems/win32/win32k/eng/alphablend.c +++ b/subsystems/win32/win32k/eng/alphablend.c @@ -6,7 +6,7 @@ * PROGRAMER: Jason Filby */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/bitblt.c b/subsystems/win32/win32k/eng/bitblt.c index 3c65aaa6862..8806aa75fc5 100644 --- a/subsystems/win32/win32k/eng/bitblt.c +++ b/subsystems/win32/win32k/eng/bitblt.c @@ -9,7 +9,7 @@ * 2/10/1999: Created */ -#include +#include #define NDEBUG #include @@ -51,6 +51,9 @@ BltMask(SURFOBJ* psoDest, ULONG Pattern = 0; HBITMAP hbmPattern; + ASSERT(psoSource == NULL); + ASSERT(pptlSource == NULL); + if (psoMask == NULL) { return FALSE; @@ -662,8 +665,8 @@ static BOOLEAN APIENTRY AlphaBltMask(SURFOBJ* psoDest, SURFOBJ* psoSource, // unused SURFOBJ* psoMask, - XLATEOBJ* ColorTranslation, - XLATEOBJ* SrcColorTranslation, + XLATEOBJ* pxloRGB2Dest, + XLATEOBJ* pxloBrush, RECTL* prclDest, POINTL* pptlSource, // unused POINTL* pptlMask, @@ -675,12 +678,15 @@ AlphaBltMask(SURFOBJ* psoDest, ULONG Background, BrushColor, NewColor; BYTE *tMask, *lMask; + ASSERT(psoSource == NULL); + ASSERT(pptlSource == NULL); + dx = prclDest->right - prclDest->left; dy = prclDest->bottom - prclDest->top; if (psoMask != NULL) { - BrushColor = XLATEOBJ_iXlate(SrcColorTranslation, pbo ? pbo->iSolidColor : 0); + BrushColor = XLATEOBJ_iXlate(pxloBrush, pbo ? pbo->iSolidColor : 0); r = (int)GetRValue(BrushColor); g = (int)GetGValue(BrushColor); b = (int)GetBValue(BrushColor); @@ -701,14 +707,14 @@ AlphaBltMask(SURFOBJ* psoDest, else { Background = DIB_GetSource(psoDest, prclDest->left + i, prclDest->top + j, - SrcColorTranslation); + pxloBrush); NewColor = RGB((*lMask * (r - GetRValue(Background)) >> 8) + GetRValue(Background), (*lMask * (g - GetGValue(Background)) >> 8) + GetGValue(Background), (*lMask * (b - GetBValue(Background)) >> 8) + GetBValue(Background)); - Background = XLATEOBJ_iXlate(ColorTranslation, NewColor); + Background = XLATEOBJ_iXlate(pxloRGB2Dest, NewColor); DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_PutPixel( psoDest, prclDest->left + i, prclDest->top + j, Background); } @@ -846,10 +852,10 @@ EngMaskBitBlt(SURFOBJ *psoDest, case DC_TRIVIAL: if (psoMask->iBitmapFormat == BMF_8BPP) Ret = AlphaBltMask(psoOutput, NULL , psoInput, DestColorTranslation, SourceColorTranslation, - &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin); + &OutputRect, NULL, &InputPoint, pbo, &AdjustedBrushOrigin); else Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, - &OutputRect, &InputPoint, pptlMask, pbo, &AdjustedBrushOrigin, + &OutputRect, NULL, &InputPoint, pbo, &AdjustedBrushOrigin, R4_MASK); break; case DC_RECT: @@ -864,13 +870,13 @@ EngMaskBitBlt(SURFOBJ *psoDest, Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; if (psoMask->iBitmapFormat == BMF_8BPP) { - Ret = AlphaBltMask(psoOutput, psoInput, psoMask, DestColorTranslation, SourceColorTranslation, - &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin); + Ret = AlphaBltMask(psoOutput, NULL, psoInput, DestColorTranslation, SourceColorTranslation, + &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin); } else { - Ret = BltMask(psoOutput, psoInput, psoMask, DestColorTranslation, - &CombinedRect, &Pt, pptlMask, pbo, &AdjustedBrushOrigin, R4_MASK); + Ret = BltMask(psoOutput, NULL, psoInput, DestColorTranslation, + &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin, R4_MASK); } } break; @@ -908,17 +914,17 @@ EngMaskBitBlt(SURFOBJ *psoDest, Pt.y = InputPoint.y + CombinedRect.top - OutputRect.top; if (psoMask->iBitmapFormat == BMF_8BPP) { - Ret = AlphaBltMask(psoOutput, psoInput, psoMask, + Ret = AlphaBltMask(psoOutput, NULL, psoInput, DestColorTranslation, SourceColorTranslation, - &CombinedRect, &Pt, pptlMask, pbo, + &CombinedRect, NULL, &Pt, pbo, &AdjustedBrushOrigin) && Ret; } else { - Ret = BltMask(psoOutput, psoInput, psoMask, - DestColorTranslation, &CombinedRect, &Pt, - pptlMask, pbo, &AdjustedBrushOrigin, + Ret = BltMask(psoOutput, NULL, psoInput, + DestColorTranslation, &CombinedRect, NULL, + &Pt, pbo, &AdjustedBrushOrigin, R4_MASK) && Ret; } } diff --git a/subsystems/win32/win32k/eng/clip.c b/subsystems/win32/win32k/eng/clip.c index d9bfe0e0960..0235d0f27b7 100644 --- a/subsystems/win32/win32k/eng/clip.c +++ b/subsystems/win32/win32k/eng/clip.c @@ -27,7 +27,7 @@ * 21/8/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/copybits.c b/subsystems/win32/win32k/eng/copybits.c index 1cabfb955f2..73a477dd13d 100644 --- a/subsystems/win32/win32k/eng/copybits.c +++ b/subsystems/win32/win32k/eng/copybits.c @@ -26,7 +26,7 @@ * 8/18/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/debug.c b/subsystems/win32/win32k/eng/debug.c index 91b39820db1..9e2e7226a0e 100644 --- a/subsystems/win32/win32k/eng/debug.c +++ b/subsystems/win32/win32k/eng/debug.c @@ -27,7 +27,7 @@ * 11/7/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/device.c b/subsystems/win32/win32k/eng/device.c index 301497afcc7..0e51ea05eef 100644 --- a/subsystems/win32/win32k/eng/device.c +++ b/subsystems/win32/win32k/eng/device.c @@ -7,7 +7,7 @@ * Timo Kreuzer */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/driverobj.c b/subsystems/win32/win32k/eng/driverobj.c index 900812eeabd..cb6ff389450 100644 --- a/subsystems/win32/win32k/eng/driverobj.c +++ b/subsystems/win32/win32k/eng/driverobj.c @@ -8,7 +8,7 @@ /** Includes ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/engbrush.c b/subsystems/win32/win32k/eng/engbrush.c index 1337e298024..3c3d1d7b151 100644 --- a/subsystems/win32/win32k/eng/engbrush.c +++ b/subsystems/win32/win32k/eng/engbrush.c @@ -7,7 +7,7 @@ * Timo Kreuzer */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/engevent.c b/subsystems/win32/win32k/eng/engevent.c index e978786bdb3..d38c32ae2d1 100644 --- a/subsystems/win32/win32k/eng/engevent.c +++ b/subsystems/win32/win32k/eng/engevent.c @@ -8,7 +8,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/engmisc.c b/subsystems/win32/win32k/eng/engmisc.c index bb65ef6e733..af544c95d55 100644 --- a/subsystems/win32/win32k/eng/engmisc.c +++ b/subsystems/win32/win32k/eng/engmisc.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/engwindow.c b/subsystems/win32/win32k/eng/engwindow.c index aed25f0e8b8..5628610e58e 100644 --- a/subsystems/win32/win32k/eng/engwindow.c +++ b/subsystems/win32/win32k/eng/engwindow.c @@ -29,7 +29,7 @@ /* TODO: Check how the WNDOBJ implementation should behave with a driver on windows. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/error.c b/subsystems/win32/win32k/eng/error.c index d81b3822d84..d78da06d545 100644 --- a/subsystems/win32/win32k/eng/error.c +++ b/subsystems/win32/win32k/eng/error.c @@ -1,4 +1,4 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/float.c b/subsystems/win32/win32k/eng/float.c index ebee480c728..2ca5fe9b796 100644 --- a/subsystems/win32/win32k/eng/float.c +++ b/subsystems/win32/win32k/eng/float.c @@ -28,7 +28,7 @@ /* INCLUDES *****************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/gradient.c b/subsystems/win32/win32k/eng/gradient.c index 7559b17ddba..c3ef6535c04 100644 --- a/subsystems/win32/win32k/eng/gradient.c +++ b/subsystems/win32/win32k/eng/gradient.c @@ -27,7 +27,7 @@ * 3/7/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/lineto.c b/subsystems/win32/win32k/eng/lineto.c index 049c0a9e79c..a67b47af5b1 100644 --- a/subsystems/win32/win32k/eng/lineto.c +++ b/subsystems/win32/win32k/eng/lineto.c @@ -19,7 +19,7 @@ * $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/mapping.c b/subsystems/win32/win32k/eng/mapping.c index 39de58264d1..7e445d7c631 100644 --- a/subsystems/win32/win32k/eng/mapping.c +++ b/subsystems/win32/win32k/eng/mapping.c @@ -6,7 +6,7 @@ * PROGRAMER: */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/mem.c b/subsystems/win32/win32k/eng/mem.c index 3beb023572c..a49e4fe5cab 100644 --- a/subsystems/win32/win32k/eng/mem.c +++ b/subsystems/win32/win32k/eng/mem.c @@ -27,7 +27,7 @@ * 3/7/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/mouse.c b/subsystems/win32/win32k/eng/mouse.c index d96e8dd4ed2..f5f6b2f30ca 100644 --- a/subsystems/win32/win32k/eng/mouse.c +++ b/subsystems/win32/win32k/eng/mouse.c @@ -9,7 +9,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/paint.c b/subsystems/win32/win32k/eng/paint.c index 81d1e67b40c..29cd723d4b0 100644 --- a/subsystems/win32/win32k/eng/paint.c +++ b/subsystems/win32/win32k/eng/paint.c @@ -27,7 +27,7 @@ * 3/7/1999: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/perfcnt.c b/subsystems/win32/win32k/eng/perfcnt.c index e69ff02a921..381abc40c20 100644 --- a/subsystems/win32/win32k/eng/perfcnt.c +++ b/subsystems/win32/win32k/eng/perfcnt.c @@ -25,7 +25,7 @@ * PROGRAMER: Ge van Geldorp */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/semaphor.c b/subsystems/win32/win32k/eng/semaphor.c index 5ef403d8670..d09d4c9022b 100644 --- a/subsystems/win32/win32k/eng/semaphor.c +++ b/subsystems/win32/win32k/eng/semaphor.c @@ -1,4 +1,4 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/sort.c b/subsystems/win32/win32k/eng/sort.c index df6a1dab97a..0b9354bc599 100644 --- a/subsystems/win32/win32k/eng/sort.c +++ b/subsystems/win32/win32k/eng/sort.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/stretchblt.c b/subsystems/win32/win32k/eng/stretchblt.c index ee5711c6d15..932d93d5cb4 100644 --- a/subsystems/win32/win32k/eng/stretchblt.c +++ b/subsystems/win32/win32k/eng/stretchblt.c @@ -6,7 +6,7 @@ * PROGRAMER: Jason Filby */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/string.c b/subsystems/win32/win32k/eng/string.c index 6ab902a1bb9..14cbc5be3bf 100644 --- a/subsystems/win32/win32k/eng/string.c +++ b/subsystems/win32/win32k/eng/string.c @@ -1,5 +1,5 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/surface.c b/subsystems/win32/win32k/eng/surface.c index 5a85d1ac1b6..126ae9542ce 100644 --- a/subsystems/win32/win32k/eng/surface.c +++ b/subsystems/win32/win32k/eng/surface.c @@ -12,7 +12,7 @@ * refer to \test\microwin\src\engine\devdraw.c for info on correct pixel plotting for various formats */ -#include +#include #define NDEBUG #include @@ -204,108 +204,59 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf, return NewBitmap; } -VOID Decompress4bpp(SIZEL Size, BYTE *CompressedBits, BYTE *UncompressedBits, LONG Delta) +BOOL DecompressBitmap(SIZEL Size, BYTE *CompressedBits, BYTE *UncompressedBits, LONG Delta, ULONG Format) { - int x = 0; - int y = Size.cy - 1; - int c; - int length; - int width = ((Size.cx+1)/2); - int height = Size.cy - 1; + INT x = 0; + INT y = Size.cy - 1; + INT c; + INT length; + INT width; + INT height = Size.cy - 1; BYTE *begin = CompressedBits; BYTE *bits = CompressedBits; BYTE *temp; - while (y >= 0) - { - length = *bits++ / 2; - if (length) - { - c = *bits++; - while (length--) - { - if (x >= width) break; - temp = UncompressedBits + (((height - y) * Delta) + x); - x++; - *temp = c; - } - } - else - { - length = *bits++; - switch (length) - { - case RLE_EOL: - x = 0; - y--; - break; - case RLE_END: - return; - case RLE_DELTA: - x += (*bits++)/2; - y -= (*bits++)/2; - break; - default: - length /= 2; - while (length--) - { - c = *bits++; - if (x < width) - { - temp = UncompressedBits + (((height - y) * Delta) + x); - x++; - *temp = c; - } - } - if ((bits - begin) & 1) - { - bits++; - } - } - } - } -} + INT shift = 0; -VOID Decompress8bpp(SIZEL Size, BYTE *CompressedBits, BYTE *UncompressedBits, LONG Delta) -{ - int x = 0; - int y = Size.cy - 1; - int c; - int length; - int width = Size.cx; - int height = Size.cy - 1; - BYTE *begin = CompressedBits; - BYTE *bits = CompressedBits; - BYTE *temp; - while (y >= 0) + if (Format == BMF_4RLE) + shift = 1; + else if(Format != BMF_8RLE) + return FALSE; + + width = ((Size.cx + shift) >> shift); + + _SEH2_TRY { - length = *bits++; - if (length) + while (y >= 0) { - c = *bits++; - while (length--) + length = (*bits++) >> shift; + if (length) { - if (x >= width) break; - temp = UncompressedBits + (((height - y) * Delta) + x); - x++; - *temp = c; + c = *bits++; + while (length--) + { + if (x >= width) break; + temp = UncompressedBits + (((height - y) * Delta) + x); + x++; + *temp = c; + } } - } - else - { - length = *bits++; - switch (length) + else { + length = *bits++; + switch (length) + { case RLE_EOL: x = 0; y--; break; case RLE_END: - return; + _SEH2_YIELD(return TRUE); case RLE_DELTA: - x += *bits++; - y -= *bits++; + x += (*bits++) >> shift; + y -= (*bits++) >> shift; break; default: + length = length >> shift; while (length--) { c = *bits++; @@ -320,9 +271,18 @@ VOID Decompress8bpp(SIZEL Size, BYTE *CompressedBits, BYTE *UncompressedBits, LO { bits++; } + } } } } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + DPRINT1("Decoding error\n"); + _SEH2_YIELD(return FALSE); + } + _SEH2_END; + + return TRUE; } HBITMAP FASTCALL @@ -362,7 +322,7 @@ IntCreateBitmap(IN SIZEL Size, pso->cjBits = pso->lDelta * Size.cy; UncompressedFormat = BMF_4BPP; UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB); - Decompress4bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta); + DecompressBitmap(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta, Format); } else if (Format == BMF_8RLE) { @@ -370,7 +330,7 @@ IntCreateBitmap(IN SIZEL Size, pso->cjBits = pso->lDelta * Size.cy; UncompressedFormat = BMF_8BPP; UncompressedBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB); - Decompress8bpp(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta); + DecompressBitmap(Size, (BYTE *)Bits, (BYTE *)UncompressedBits, pso->lDelta, Format); } else { @@ -467,6 +427,7 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, PSURFACE psurf; SIZEL LocalSize; BOOLEAN AllocatedLocally = FALSE; + PVOID DecompressedBits = NULL; /* * First, check the format so we can get the aligned scanline width. @@ -500,17 +461,29 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, break; case BMF_8RLE: - case BMF_4RLE: - case BMF_JPEG: - case BMF_PNG: + ScanLine = (BitmapInfo->Width + 3) & ~3; Compressed = TRUE; break; + case BMF_4RLE: + ScanLine = ((BitmapInfo->Width + 7) & ~7) >> 1; + Compressed = TRUE; + break; + + case BMF_JPEG: + case BMF_PNG: + ASSERT(FALSE); // ENGDDI shouldn't be creating PNGs for drivers ;-) + DPRINT1("No support for JPEG and PNG formats\n"); + return NULL; default: DPRINT1("Invalid bitmap format\n"); return NULL; } + /* Save local bitmap size */ + LocalSize.cy = BitmapInfo->Height; + LocalSize.cx = BitmapInfo->Width; + /* Does the device manage its own surface? */ if (!Bits) { @@ -519,7 +492,8 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, { /* Note: we should not be seeing this scenario from ENGDDI */ ASSERT(FALSE); - Size = BitmapInfo->Size; + DPRINT1("RLE compressed bitmap requested with no valid bitmap bits\n"); + return NULL; } else { @@ -551,6 +525,22 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, { /* Should not have asked for user memory */ ASSERT((BitmapInfo->Flags & BMF_USERMEM) == 0); + + if (Compressed) + { + DecompressedBits = EngAllocMem(FL_ZERO_MEMORY, BitmapInfo->Height * ScanLine, TAG_DIB); + + if(!DecompressedBits) + return NULL; + + if(!DecompressBitmap(LocalSize, (BYTE *)Bits, (BYTE *)DecompressedBits, ScanLine, BitmapInfo->Format)) + { + EngFreeMem(DecompressedBits); + return NULL; + } + + BitmapInfo->Format = (BitmapInfo->Format == BMF_4RLE) ? BMF_4BPP : BMF_8BPP; + } } /* Allocate the actual surface object structure */ @@ -564,6 +554,8 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, else EngFreeMem(Bits); } + if (DecompressedBits) + EngFreeMem(DecompressedBits); return NULL; } @@ -584,11 +576,9 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, pso->fjBitmap = BitmapInfo->Flags & (BMF_TOPDOWN | BMF_UMPDMEM | BMF_USERMEM); /* Save size and type */ - LocalSize.cy = BitmapInfo->Height; - LocalSize.cx = BitmapInfo->Width; pso->sizlBitmap = LocalSize; pso->iType = STYPE_BITMAP; - + /* Device-managed surface, no flags or dimension */ pso->dhsurf = 0; pso->dhpdev = NULL; @@ -599,48 +589,28 @@ SURFMEM_bCreateDib(IN PDEVBITMAPINFO BitmapInfo, psurf->hSecure = NULL; psurf->hDIBSection = NULL; psurf->flHooks = 0; - + /* Set bits */ - pso->pvBits = Bits; - - /* Check for bitmap type */ - if (!Compressed) + if(Compressed) + pso->pvBits = DecompressedBits; + else + pso->pvBits = Bits; + + /* Number of bits is based on the height times the scanline */ + pso->cjBits = BitmapInfo->Height * ScanLine; + if (BitmapInfo->Flags & BMF_TOPDOWN) { - /* Number of bits is based on the height times the scanline */ - pso->cjBits = BitmapInfo->Height * ScanLine; - if (BitmapInfo->Flags & BMF_TOPDOWN) - { - /* For topdown, the base address starts with the bits */ - pso->pvScan0 = pso->pvBits; - pso->lDelta = ScanLine; - } - else - { - /* Otherwise we start with the end and go up */ - pso->pvScan0 = (PVOID)((ULONG_PTR)pso->pvBits + pso->cjBits - ScanLine); - pso->lDelta = -ScanLine; - } + /* For topdown, the base address starts with the bits */ + pso->pvScan0 = pso->pvBits; + pso->lDelta = ScanLine; } else { - /* Compressed surfaces don't have scanlines! */ - pso->lDelta = 0; - pso->cjBits = BitmapInfo->Size; - - /* Check for JPG or PNG */ - if ((BitmapInfo->Format != BMF_JPEG) && (BitmapInfo->Format != BMF_PNG)) - { - /* Wherever the bit data is */ - pso->pvScan0 = pso->pvBits; - } - else - { - /* Fancy formats don't use a base address */ - pso->pvScan0 = NULL; - ASSERT(FALSE); // ENGDDI shouldn't be creating PNGs for drivers ;-) - } + /* Otherwise we start with the end and go up */ + pso->pvScan0 = (PVOID)((ULONG_PTR)pso->pvBits + pso->cjBits - ScanLine); + pso->lDelta = -ScanLine; } - + /* Finally set the handle and uniq */ pso->hsurf = (HSURF)psurf->BaseObject.hHmgr; pso->iUniq = 0; diff --git a/subsystems/win32/win32k/eng/transblt.c b/subsystems/win32/win32k/eng/transblt.c index 4ef59544680..bca22440edd 100644 --- a/subsystems/win32/win32k/eng/transblt.c +++ b/subsystems/win32/win32k/eng/transblt.c @@ -27,7 +27,7 @@ * 4/6/2004: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/eng/xlate.c b/subsystems/win32/win32k/eng/xlate.c index fcdd0b89b4b..27d06846fe8 100644 --- a/subsystems/win32/win32k/eng/xlate.c +++ b/subsystems/win32/win32k/eng/xlate.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ -#include +#include #include diff --git a/subsystems/win32/win32k/include/desktop.h b/subsystems/win32/win32k/include/desktop.h index ecdd4209376..406ee7bef0e 100644 --- a/subsystems/win32/win32k/include/desktop.h +++ b/subsystems/win32/win32k/include/desktop.h @@ -24,8 +24,6 @@ typedef struct _DESKTOP DWORD dwMouseHoverTime; /* ReactOS */ - /* Rectangle of the work area */ - RECTL WorkArea; /* Pointer to the active queue. */ PVOID ActiveMessageQueue; /* Handle of the desktop window. */ @@ -69,9 +67,6 @@ IntDesktopObjectParse(IN PVOID ParseObject, VOID APIENTRY IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters); -VOID FASTCALL -IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect); - LRESULT CALLBACK IntDesktopWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/subsystems/win32/win32k/include/msgqueue.h b/subsystems/win32/win32k/include/msgqueue.h index 5752481c9d4..a8cc896df03 100644 --- a/subsystems/win32/win32k/include/msgqueue.h +++ b/subsystems/win32/win32k/include/msgqueue.h @@ -6,6 +6,7 @@ #define MSQ_NORMAL 0 #define MSQ_ISHOOK 1 #define MSQ_ISEVENT 2 +#define MSQ_SENTNOWAIT 0x80000000 typedef struct _USER_MESSAGE { @@ -28,6 +29,7 @@ typedef struct _USER_SENT_MESSAGE /* entry in the dispatching list of the sender's message queue */ LIST_ENTRY DispatchingListEntry; INT HookMessage; + BOOL HasPackedLParam; } USER_SENT_MESSAGE, *PUSER_SENT_MESSAGE; typedef struct _USER_SENT_MESSAGE_NOTIFY @@ -184,6 +186,20 @@ co_IntSendMessageTimeout(HWND hWnd, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult); + +LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam); +LRESULT FASTCALL +co_IntSendMessageWithCallBack(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + SENDASYNCPROC CompletionCallback, + ULONG_PTR CompletionCallbackContext, + ULONG_PTR *uResult); + LRESULT FASTCALL IntDispatchMessage(MSG* Msg); BOOL FASTCALL @@ -248,6 +264,16 @@ VOID APIENTRY MsqRemoveWindowMessagesFromQueue(PVOID pWindow); /* F*(&$ headers, (message) == WM_NCRBUTTON##code || \ (message) == WM_NCXBUTTON##code ) +#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE +#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST)) + +#define IS_MOUSE_MESSAGE(message) \ + ((message >= WM_NCMOUSEFIRST && message <= WM_NCMOUSELAST) || \ + (message >= WM_MOUSEFIRST && message <= WM_MOUSELAST)) + +#define IS_KBD_MESSAGE(message) \ + (message == WM_KEYDOWN || message == WM_KEYUP) + HANDLE FASTCALL IntMsqSetWakeMask(DWORD WakeMask); diff --git a/subsystems/win32/win32k/include/rect.h b/subsystems/win32/win32k/include/rect.h index 156dd55f120..e24bc4b0127 100644 --- a/subsystems/win32/win32k/include/rect.h +++ b/subsystems/win32/win32k/include/rect.h @@ -56,3 +56,7 @@ RECTL_bIntersectRect(RECTL *prclDst, const RECTL *prcl1, const RECTL *prcl2); VOID FASTCALL RECTL_vMakeWellOrdered(RECTL *prcl); + +VOID +FASTCALL +RECTL_vInflateRect(RECTL *rect, INT dx, INT dy); diff --git a/subsystems/win32/win32k/include/timer.h b/subsystems/win32/win32k/include/timer.h index 2b65b0e55d8..a41b8c30dbe 100644 --- a/subsystems/win32/win32k/include/timer.h +++ b/subsystems/win32/win32k/include/timer.h @@ -23,12 +23,14 @@ typedef struct _TIMER #define TMRF_ONESHOT 0x0010 #define TMRF_WAITING 0x0020 #define TMRF_TIFROMWND 0x0040 +#define TMRF_DELETEPENDING 0x8000 extern PKTIMER MasterTimer; NTSTATUS FASTCALL InitTimerImpl(VOID); -BOOL FASTCALL IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer); -UINT_PTR FASTCALL IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer); +BOOL FASTCALL DestroyTimersForThread(PTHREADINFO pti); +BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer); +UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type); PTIMER FASTCALL FindSystemTimer(PMSG); BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,PWINDOW_OBJECT,WPARAM,LPARAM); VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD); diff --git a/subsystems/win32/win32k/include/win32k.h b/subsystems/win32/win32k/include/win32kp.h similarity index 100% rename from subsystems/win32/win32k/include/win32k.h rename to subsystems/win32/win32k/include/win32kp.h diff --git a/subsystems/win32/win32k/include/window.h b/subsystems/win32/win32k/include/window.h index 16098e456b1..90143244458 100644 --- a/subsystems/win32/win32k/include/window.h +++ b/subsystems/win32/win32k/include/window.h @@ -155,7 +155,7 @@ IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG); -PWND APIENTRY co_IntCreateWindowEx(DWORD,PUNICODE_STRING,PUNICODE_STRING,DWORD,LONG,LONG,LONG,LONG,HWND,HMENU,HINSTANCE,LPVOID,DWORD,BOOL); +PWND APIENTRY co_IntCreateWindowEx(DWORD,PUNICODE_STRING,PLARGE_STRING,DWORD,LONG,LONG,LONG,LONG,HWND,HMENU,HINSTANCE,LPVOID,DWORD,BOOL); WNDPROC FASTCALL IntGetWindowProc(PWND,BOOL); /* EOF */ diff --git a/subsystems/win32/win32k/ldr/loader.c b/subsystems/win32/win32k/ldr/loader.c index 9803c8d4009..50a87560e6a 100644 --- a/subsystems/win32/win32k/ldr/loader.c +++ b/subsystems/win32/win32k/ldr/loader.c @@ -20,7 +20,7 @@ * */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/main/dllmain.c b/subsystems/win32/win32k/main/dllmain.c index 8d106e725a3..3eb5753d231 100644 --- a/subsystems/win32/win32k/main/dllmain.c +++ b/subsystems/win32/win32k/main/dllmain.c @@ -20,7 +20,7 @@ * Entry Point for win32k.sys */ -#include +#include #include #define NDEBUG @@ -290,6 +290,8 @@ Win32kThreadCallback(struct _ETHREAD *Thread, Win32Thread->TIF_flags |= TIF_INCLEANUP; DceFreeThreadDCE(Win32Thread); HOOK_DestroyThreadHooks(Thread); + /* Cleanup timers */ + DestroyTimersForThread(Win32Thread); UnregisterThreadHotKeys(Thread); /* what if this co_ func crash in umode? what will clean us up then? */ co_DestroyThreadWindows(Thread); diff --git a/subsystems/win32/win32k/misc/copy.c b/subsystems/win32/win32k/misc/copy.c index 5668ade27b5..a40a5be6ffb 100644 --- a/subsystems/win32/win32k/misc/copy.c +++ b/subsystems/win32/win32k/misc/copy.c @@ -1,4 +1,4 @@ -#include "w32k.h" +#include "win32k.h" NTSTATUS _MmCopyFromCaller( PVOID Target, PVOID Source, UINT Bytes ) { NTSTATUS Status = STATUS_SUCCESS; diff --git a/subsystems/win32/win32k/misc/driver.c b/subsystems/win32/win32k/misc/driver.c index e713f323e7b..1219f94effa 100644 --- a/subsystems/win32/win32k/misc/driver.c +++ b/subsystems/win32/win32k/misc/driver.c @@ -23,7 +23,7 @@ * */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/misc/err.c b/subsystems/win32/win32k/misc/err.c index c1c66eaac94..b7fcb2cde31 100644 --- a/subsystems/win32/win32k/misc/err.c +++ b/subsystems/win32/win32k/misc/err.c @@ -27,7 +27,7 @@ * 06-06-2001 CSH Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/misc/file.c b/subsystems/win32/win32k/misc/file.c index 263ed12e0b7..1e2281aa517 100644 --- a/subsystems/win32/win32k/misc/file.c +++ b/subsystems/win32/win32k/misc/file.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/misc/math.c b/subsystems/win32/win32k/misc/math.c index 6b4fc0c9013..11ffc1ed847 100644 --- a/subsystems/win32/win32k/misc/math.c +++ b/subsystems/win32/win32k/misc/math.c @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include /* * FIXME! Is there a better algorithm. like FT_MulDiv diff --git a/subsystems/win32/win32k/misc/registry.c b/subsystems/win32/win32k/misc/registry.c index f03de06e5f6..fcaefabb62f 100644 --- a/subsystems/win32/win32k/misc/registry.c +++ b/subsystems/win32/win32k/misc/registry.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/misc/rtlstr.c b/subsystems/win32/win32k/misc/rtlstr.c index 7e1da4b7672..06f8d3eff80 100644 --- a/subsystems/win32/win32k/misc/rtlstr.c +++ b/subsystems/win32/win32k/misc/rtlstr.c @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include /* FUNCTIONS *****************************************************************/ VOID diff --git a/subsystems/win32/win32k/misc/usrheap.c b/subsystems/win32/win32k/misc/usrheap.c index e8b1908fcfc..c371121c657 100644 --- a/subsystems/win32/win32k/misc/usrheap.c +++ b/subsystems/win32/win32k/misc/usrheap.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntddraw/d3d.c b/subsystems/win32/win32k/ntddraw/d3d.c index 8371ff1a882..f30f08cdae9 100644 --- a/subsystems/win32/win32k/ntddraw/d3d.c +++ b/subsystems/win32/win32k/ntddraw/d3d.c @@ -13,7 +13,7 @@ * NtGdiDdUnlock and NtGdiDdUnlockD3D ultimately call the same function in dxg.sys */ -#include +#include #include diff --git a/subsystems/win32/win32k/ntddraw/dd.c b/subsystems/win32/win32k/ntddraw/dd.c index 9cccbce1ef0..a1207ed33a2 100644 --- a/subsystems/win32/win32k/ntddraw/dd.c +++ b/subsystems/win32/win32k/ntddraw/dd.c @@ -8,7 +8,7 @@ * 19/1-2006 Magnus Olsen */ -#include +#include #include /************************************************************************/ diff --git a/subsystems/win32/win32k/ntddraw/ddraw.c b/subsystems/win32/win32k/ntddraw/ddraw.c index 3abbd18eed4..19b6931b01b 100644 --- a/subsystems/win32/win32k/ntddraw/ddraw.c +++ b/subsystems/win32/win32k/ntddraw/ddraw.c @@ -8,7 +8,7 @@ * 19/1-2006 Magnus Olsen */ -#include +#include #include PGD_DXDDSTARTUPDXGRAPHICS gpfnStartupDxGraphics = NULL; diff --git a/subsystems/win32/win32k/ntddraw/ddsurf.c b/subsystems/win32/win32k/ntddraw/ddsurf.c index 388be271343..ae46f887e11 100644 --- a/subsystems/win32/win32k/ntddraw/ddsurf.c +++ b/subsystems/win32/win32k/ntddraw/ddsurf.c @@ -8,7 +8,7 @@ * 19/7-2006 Magnus Olsen */ -#include +#include #include /************************************************************************/ diff --git a/subsystems/win32/win32k/ntddraw/dvp.c b/subsystems/win32/win32k/ntddraw/dvp.c index de5fe6ad926..a03be0fa30c 100644 --- a/subsystems/win32/win32k/ntddraw/dvp.c +++ b/subsystems/win32/win32k/ntddraw/dvp.c @@ -9,7 +9,7 @@ */ -#include +#include #include /************************************************************************/ diff --git a/subsystems/win32/win32k/ntddraw/dxeng.c b/subsystems/win32/win32k/ntddraw/dxeng.c index 586c496bdff..58413a584ff 100644 --- a/subsystems/win32/win32k/ntddraw/dxeng.c +++ b/subsystems/win32/win32k/ntddraw/dxeng.c @@ -6,7 +6,7 @@ * PROGRAMMERS: Magnus Olsen (magnus@greatlord.com) */ -#include +#include #include HSEMAPHORE ghsemShareDevLock = NULL; diff --git a/subsystems/win32/win32k/ntddraw/eng.c b/subsystems/win32/win32k/ntddraw/eng.c index 675b5965710..f55525a6b51 100644 --- a/subsystems/win32/win32k/ntddraw/eng.c +++ b/subsystems/win32/win32k/ntddraw/eng.c @@ -11,7 +11,7 @@ */ -#include +#include #include /************************************************************************/ diff --git a/subsystems/win32/win32k/ntddraw/mocomp.c b/subsystems/win32/win32k/ntddraw/mocomp.c index 08c3f9488c4..bc80584faa9 100644 --- a/subsystems/win32/win32k/ntddraw/mocomp.c +++ b/subsystems/win32/win32k/ntddraw/mocomp.c @@ -9,7 +9,7 @@ */ -#include +#include #include /************************************************************************/ diff --git a/subsystems/win32/win32k/ntuser/accelerator.c b/subsystems/win32/win32k/ntuser/accelerator.c index 544ecedcfc7..b59f1d1b7de 100644 --- a/subsystems/win32/win32k/ntuser/accelerator.c +++ b/subsystems/win32/win32k/ntuser/accelerator.c @@ -49,7 +49,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/callback.c b/subsystems/win32/win32k/ntuser/callback.c index 9a8de743c54..eb4db061d10 100644 --- a/subsystems/win32/win32k/ntuser/callback.c +++ b/subsystems/win32/win32k/ntuser/callback.c @@ -14,7 +14,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/callproc.c b/subsystems/win32/win32k/ntuser/callproc.c index 866bac1afbf..dc8496dd431 100644 --- a/subsystems/win32/win32k/ntuser/callproc.c +++ b/subsystems/win32/win32k/ntuser/callproc.c @@ -9,7 +9,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/caret.c b/subsystems/win32/win32k/ntuser/caret.c index ee5e33ba565..418ddb5323b 100644 --- a/subsystems/win32/win32k/ntuser/caret.c +++ b/subsystems/win32/win32k/ntuser/caret.c @@ -11,7 +11,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -189,7 +189,7 @@ co_IntSetCaretPos(int X, int Y) ThreadQueue->CaretInfo->Pos.x = X; ThreadQueue->CaretInfo->Pos.y = Y; co_IntSendMessage(ThreadQueue->CaretInfo->hWnd, WM_SYSTIMER, IDCARETTIMER, 0); - IntSetTimer(ThreadQueue->CaretInfo->hWnd, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); + IntSetTimer(UserGetWindowObject(ThreadQueue->CaretInfo->hWnd), IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TMRF_SYSTEM); } return TRUE; } @@ -302,7 +302,7 @@ BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL) { co_IntSendMessage(ThreadQueue->CaretInfo->hWnd, WM_SYSTIMER, IDCARETTIMER, 0); } - IntSetTimer(ThreadQueue->CaretInfo->hWnd, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); + IntSetTimer(UserGetWindowObject(ThreadQueue->CaretInfo->hWnd), IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TMRF_SYSTEM); } return TRUE; diff --git a/subsystems/win32/win32k/ntuser/class.c b/subsystems/win32/win32k/ntuser/class.c index f1755fecd54..b24b26f4199 100644 --- a/subsystems/win32/win32k/ntuser/class.c +++ b/subsystems/win32/win32k/ntuser/class.c @@ -9,7 +9,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/clipboard.c b/subsystems/win32/win32k/ntuser/clipboard.c index 55032c44e61..a44bbab169a 100644 --- a/subsystems/win32/win32k/ntuser/clipboard.c +++ b/subsystems/win32/win32k/ntuser/clipboard.c @@ -7,7 +7,7 @@ * Pablo Borobia */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/csr.c b/subsystems/win32/win32k/ntuser/csr.c index a1e425e629b..9487af53689 100644 --- a/subsystems/win32/win32k/ntuser/csr.c +++ b/subsystems/win32/win32k/ntuser/csr.c @@ -7,7 +7,7 @@ * PROGRAMER: Ge van Geldorp (ge@gse.nl) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/cursoricon.c b/subsystems/win32/win32k/ntuser/cursoricon.c index 6c9532caae9..3fe0211ea53 100644 --- a/subsystems/win32/win32k/ntuser/cursoricon.c +++ b/subsystems/win32/win32k/ntuser/cursoricon.c @@ -36,7 +36,7 @@ * CURICON_PROCESS structs starting at CurIcon->ProcessList. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/defwnd.c b/subsystems/win32/win32k/ntuser/defwnd.c index 2a59f10f94b..f5e2bd1fc1d 100644 --- a/subsystems/win32/win32k/ntuser/defwnd.c +++ b/subsystems/win32/win32k/ntuser/defwnd.c @@ -7,7 +7,7 @@ * */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/desktop.c b/subsystems/win32/win32k/ntuser/desktop.c index 0f635d0cb7c..1c972f95075 100644 --- a/subsystems/win32/win32k/ntuser/desktop.c +++ b/subsystems/win32/win32k/ntuser/desktop.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -419,35 +419,6 @@ IntValidateDesktopHandle( return Status; } -VOID FASTCALL -IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect) -{ - RECTL *Ret; - - ASSERT(Desktop); - - Ret = &Desktop->WorkArea; - if((Ret->right == -1) && ScreenDeviceContext) - { - PDC dc; - SURFACE *psurf; - dc = DC_LockDc(ScreenDeviceContext); - /* FIXME - Handle dc == NULL!!!! */ - psurf = dc->dclevel.pSurface; - if (psurf) - { - Ret->right = psurf->SurfObj.sizlBitmap.cx; - Ret->bottom = psurf->SurfObj.sizlBitmap.cy; - } - DC_UnlockDc(dc); - } - - if(Rect) - { - *Rect = *Ret; - } -} - PDESKTOP FASTCALL IntGetActiveDesktop(VOID) { @@ -911,7 +882,8 @@ NtUserCreateDesktop( ULONG_PTR HeapSize = 4 * 1024 * 1024; /* FIXME */ HWINSTA hWindowStation = NULL ; PUNICODE_STRING lpszDesktopName = NULL; - UNICODE_STRING ClassName, WindowName, MenuName; + UNICODE_STRING ClassName, MenuName; + LARGE_STRING WindowName; PWND pWnd = NULL; DECLARE_RETURN(HDESK); @@ -1052,13 +1024,6 @@ NtUserCreateDesktop( lpszDesktopName->Buffer, lpszDesktopName->Length); - // init desktop area - DesktopObject->WorkArea.left = 0; - DesktopObject->WorkArea.top = 0; - DesktopObject->WorkArea.right = -1; - DesktopObject->WorkArea.bottom = -1; - IntGetDesktopWorkArea(DesktopObject, NULL); - /* Initialize some local (to win32k) desktop state. */ InitializeListHead(&DesktopObject->PtiList); DesktopObject->ActiveMessageQueue = NULL; diff --git a/subsystems/win32/win32k/ntuser/display.c b/subsystems/win32/win32k/ntuser/display.c index c652e30e45a..561171dedeb 100644 --- a/subsystems/win32/win32k/ntuser/display.c +++ b/subsystems/win32/win32k/ntuser/display.c @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/event.c b/subsystems/win32/win32k/ntuser/event.c index 2dc8eae7376..d170983d088 100644 --- a/subsystems/win32/win32k/ntuser/event.c +++ b/subsystems/win32/win32k/ntuser/event.c @@ -6,7 +6,7 @@ * PROGRAMER: James Tabor (james.tabor@rectos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/focus.c b/subsystems/win32/win32k/ntuser/focus.c index 0f39b96674d..ee9c2ff93ad 100644 --- a/subsystems/win32/win32k/ntuser/focus.c +++ b/subsystems/win32/win32k/ntuser/focus.c @@ -18,7 +18,7 @@ * */ -#include +#include #define NDEBUG #include @@ -53,8 +53,8 @@ co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd) { if (hWndPrev) { - co_IntPostOrSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, 0); - co_IntPostOrSendMessage(hWndPrev, WM_ACTIVATE, + co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0); + co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, UserGetWindowLong(hWndPrev, GWL_STYLE, FALSE) & WS_MINIMIZE), (LPARAM)hWnd); } @@ -110,7 +110,11 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) HANDLE OldTID = IntGetWndThreadId(WindowPrev); HANDLE NewTID = IntGetWndThreadId(Window); - DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID); + DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID); + if (Window->Wnd->style & WS_MINIMIZE) + { + DPRINT("Widow was minimized\n"); + } if (OldTID != NewTID) { @@ -120,10 +124,11 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) for (phWnd = List; *phWnd; ++phWnd) { cWindow = UserGetWindowObject(*phWnd); + if (cWindow && (IntGetWndThreadId(cWindow) == OldTID)) { // FALSE if the window is being deactivated, // ThreadId that owns the window being activated. - co_IntPostOrSendMessage(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); + co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); } } for (phWnd = List; *phWnd; ++phWnd) @@ -132,7 +137,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) if (cWindow && (IntGetWndThreadId(cWindow) == NewTID)) { // TRUE if the window is being activated, // ThreadId that owns the window being deactivated. - co_IntPostOrSendMessage(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); + co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); } } ExFreePool(List); @@ -144,10 +149,9 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate) UserDerefObjectCo(Window); /* FIXME: IntIsWindow */ - - co_IntPostOrSendMessage(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); + co_IntSendMessageNoWait(hWnd, WM_NCACTIVATE, (WPARAM)(hWnd == UserGetForegroundWindow()), 0); /* FIXME: WA_CLICKACTIVE */ - co_IntPostOrSendMessage(hWnd, WM_ACTIVATE, + co_IntSendMessageNoWait(hWnd, WM_ACTIVATE, MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE, UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE), (LPARAM)hWndPrev); @@ -227,6 +231,7 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin if (PrevForegroundQueue != 0) { hWndPrev = PrevForegroundQueue->ActiveWindow; + hWndFocusPrev = PrevForegroundQueue->FocusWindow; } if (hWndPrev == hWnd) @@ -235,15 +240,14 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin return TRUE; } - hWndFocusPrev = (PrevForegroundQueue == FocusWindow->pti->MessageQueue - ? FocusWindow->pti->MessageQueue->FocusWindow : NULL); - /* FIXME: Call hooks. */ co_IntSendDeactivateMessages(hWndPrev, hWnd); co_IntSendKillFocusMessages(hWndFocusPrev, hWndFocus); + IntSetFocusMessageQueue(Window->pti->MessageQueue); + if (Window->pti->MessageQueue) { Window->pti->MessageQueue->ActiveWindow = hWnd; diff --git a/subsystems/win32/win32k/ntuser/guicheck.c b/subsystems/win32/win32k/ntuser/guicheck.c index f0ee364f9d8..e3766d8c4b2 100644 --- a/subsystems/win32/win32k/ntuser/guicheck.c +++ b/subsystems/win32/win32k/ntuser/guicheck.c @@ -33,7 +33,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/hook.c b/subsystems/win32/win32k/ntuser/hook.c index bca944e4ce7..a71ea9bebf2 100644 --- a/subsystems/win32/win32k/ntuser/hook.c +++ b/subsystems/win32/win32k/ntuser/hook.c @@ -10,7 +10,7 @@ * Copyright (C) 2002 Alexandre Julliard */ -#include +#include #define NDEBUG #include @@ -1050,6 +1050,12 @@ NtUserCallNextHookEx(int Code, if (!HookObj) RETURN( 0); + /* Check that the first hook in the chain is not this hook */ + NextObj = IntGetFirstHook(IntGetTable(HookObj), HookObj->HookId); + + /* Its the same so it has already been called */ + if (HookObj == NextObj) RETURN(0); + UserReferenceObject(HookObj); Ansi = HookObj->Ansi; diff --git a/subsystems/win32/win32k/ntuser/hotkey.c b/subsystems/win32/win32k/ntuser/hotkey.c index c2585f3db7e..4ec1f1b5658 100644 --- a/subsystems/win32/win32k/ntuser/hotkey.c +++ b/subsystems/win32/win32k/ntuser/hotkey.c @@ -40,7 +40,7 @@ windows/threads on destops not belonging to WinSta0 to set hotkeys (recieve noti /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/input.c b/subsystems/win32/win32k/ntuser/input.c index 6b02f2d270e..006b0f123b0 100644 --- a/subsystems/win32/win32k/ntuser/input.c +++ b/subsystems/win32/win32k/ntuser/input.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #include #define NDEBUG @@ -22,7 +22,7 @@ extern NTSTATUS Win32kInitWin32Thread(PETHREAD Thread); /* GLOBALS *******************************************************************/ PTHREADINFO ptiRawInput; -PKTIMER MasterTimer; +PKTIMER MasterTimer = NULL; PATTACHINFO gpai = NULL; static HANDLE MouseDeviceHandle; @@ -204,6 +204,16 @@ MouseThreadMain(PVOID StartContext) NTSTATUS Status; MOUSE_ATTRIBUTES MouseAttr; + Status = Win32kInitWin32Thread(PsGetCurrentThread()); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Win32K: Failed making keyboard thread a win32 thread.\n"); + return; //(Status); + } + + KeSetPriorityThread(&PsGetCurrentThread()->Tcb, + LOW_REALTIME_PRIORITY + 3); + InitializeObjectAttributes(&MouseObjectAttributes, &MouseDeviceName, 0, @@ -869,14 +879,6 @@ RawInputThreadMain(PVOID StartContext) Objects[0] = &InputThreadsStart; - - MasterTimer = ExAllocatePoolWithTag(NonPagedPool, sizeof(KTIMER), TAG_INPUT); - if (!MasterTimer) - { - DPRINT1("Win32K: Failed making Raw Input thread a win32 thread.\n"); - return; - } - KeInitializeTimer(MasterTimer); Objects[1] = MasterTimer; // This thread requires win32k! @@ -927,6 +929,15 @@ InitInputImpl(VOID) KeInitializeEvent(&InputThreadsStart, NotificationEvent, FALSE); + MasterTimer = ExAllocatePoolWithTag(NonPagedPool, sizeof(KTIMER), TAG_INPUT); + if (!MasterTimer) + { + DPRINT1("Win32K: Failed making Raw Input thread a win32 thread.\n"); + ASSERT(FALSE); + return STATUS_UNSUCCESSFUL; + } + KeInitializeTimer(MasterTimer); + /* Initialize the default keyboard layout */ if(!UserInitDefaultKeyboardLayout()) { @@ -1101,7 +1112,7 @@ IntMouseInput(MOUSEINPUT *mi) /* * Insert the messages into the system queue */ - Msg.wParam = CurInfo->ButtonsDown; + Msg.wParam = 0; Msg.lParam = MAKELPARAM(MousePos.x, MousePos.y); Msg.pt = MousePos; @@ -1124,6 +1135,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_LBUTTON] |= 0xc0; Msg.message = SwapBtnMsg[0][SwapButtons]; CurInfo->ButtonsDown |= SwapBtn[SwapButtons]; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } else if(mi->dwFlags & MOUSEEVENTF_LEFTUP) @@ -1131,6 +1143,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_LBUTTON] &= ~0x80; Msg.message = SwapBtnMsg[1][SwapButtons]; CurInfo->ButtonsDown &= ~SwapBtn[SwapButtons]; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } if(mi->dwFlags & MOUSEEVENTF_MIDDLEDOWN) @@ -1138,6 +1151,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_MBUTTON] |= 0xc0; Msg.message = WM_MBUTTONDOWN; CurInfo->ButtonsDown |= MK_MBUTTON; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } else if(mi->dwFlags & MOUSEEVENTF_MIDDLEUP) @@ -1145,6 +1159,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_MBUTTON] &= ~0x80; Msg.message = WM_MBUTTONUP; CurInfo->ButtonsDown &= ~MK_MBUTTON; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } if(mi->dwFlags & MOUSEEVENTF_RIGHTDOWN) @@ -1152,6 +1167,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_RBUTTON] |= 0xc0; Msg.message = SwapBtnMsg[0][!SwapButtons]; CurInfo->ButtonsDown |= SwapBtn[!SwapButtons]; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } else if(mi->dwFlags & MOUSEEVENTF_RIGHTUP) @@ -1159,6 +1175,7 @@ IntMouseInput(MOUSEINPUT *mi) gQueueKeyStateTable[VK_RBUTTON] &= ~0x80; Msg.message = SwapBtnMsg[1][!SwapButtons]; CurInfo->ButtonsDown &= ~SwapBtn[!SwapButtons]; + Msg.wParam |= CurInfo->ButtonsDown; MsqInsertSystemMessage(&Msg); } @@ -1175,15 +1192,15 @@ IntMouseInput(MOUSEINPUT *mi) if(mi->mouseData & XBUTTON1) { gQueueKeyStateTable[VK_XBUTTON1] |= 0xc0; + CurInfo->ButtonsDown |= MK_XBUTTON1; Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1); - CurInfo->ButtonsDown |= XBUTTON1; MsqInsertSystemMessage(&Msg); } if(mi->mouseData & XBUTTON2) { gQueueKeyStateTable[VK_XBUTTON2] |= 0xc0; + CurInfo->ButtonsDown |= MK_XBUTTON2; Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2); - CurInfo->ButtonsDown |= XBUTTON2; MsqInsertSystemMessage(&Msg); } } @@ -1193,15 +1210,15 @@ IntMouseInput(MOUSEINPUT *mi) if(mi->mouseData & XBUTTON1) { gQueueKeyStateTable[VK_XBUTTON1] &= ~0x80; + CurInfo->ButtonsDown &= ~MK_XBUTTON1; Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON1); - CurInfo->ButtonsDown &= ~XBUTTON1; MsqInsertSystemMessage(&Msg); } if(mi->mouseData & XBUTTON2) { gQueueKeyStateTable[VK_XBUTTON2] &= ~0x80; + CurInfo->ButtonsDown &= ~MK_XBUTTON2; Msg.wParam = MAKEWPARAM(CurInfo->ButtonsDown, XBUTTON2); - CurInfo->ButtonsDown &= ~XBUTTON2; MsqInsertSystemMessage(&Msg); } } @@ -1324,10 +1341,7 @@ IntKeyboardInput(KEYBDINPUT *ki) /* All messages have to contain the cursor point. */ pti = PsGetCurrentThreadWin32Thread(); Msg.pt = gpsi->ptCursor; - - DPRINT1("Kbd Hook msg %d wParam %d lParam 0x%08x dropped by WH_KEYBOARD_LL hook\n", - Msg.message, vk_hook, Msg.lParam); - + KbdHookData.vkCode = vk_hook; KbdHookData.scanCode = ki->wScan; KbdHookData.flags = flags >> 8; diff --git a/subsystems/win32/win32k/ntuser/kbdlayout.c b/subsystems/win32/win32k/ntuser/kbdlayout.c index ec07d34a82a..8ee11dc3983 100644 --- a/subsystems/win32/win32k/ntuser/kbdlayout.c +++ b/subsystems/win32/win32k/ntuser/kbdlayout.c @@ -12,7 +12,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/keyboard.c b/subsystems/win32/win32k/ntuser/keyboard.c index 813137856fc..075d79336d0 100644 --- a/subsystems/win32/win32k/ntuser/keyboard.c +++ b/subsystems/win32/win32k/ntuser/keyboard.c @@ -28,7 +28,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -42,7 +42,9 @@ /* Key States */ #define KS_DOWN_MASK 0xc0 #define KS_DOWN_BIT 0x80 -#define KS_LOCK_BIT 0x01 +#define KS_LOCK_BIT 0x01 +/* Scan Codes */ +#define SC_KEY_UP 0x8000 /* lParam bits */ #define LP_EXT_BIT (1<<24) /* From kbdxx.c -- Key changes with numlock */ @@ -720,6 +722,11 @@ NtUserToUnicodeEx( DPRINT("Enter NtUserSetKeyboardState\n"); UserEnterShared();//fixme: this syscall doesnt seem to need any locking... + /* Key up? */ + if (wScanCode & SC_KEY_UP) + { + RETURN(0); + } if( !NT_SUCCESS(MmCopyFromCaller(KeyStateBuf, lpKeyState, @@ -729,8 +736,8 @@ NtUserToUnicodeEx( RETURN(0); } - /* Virtual code is correct and key is pressed currently? */ - if (wVirtKey < 0x100 && KeyStateBuf[wVirtKey] & KS_DOWN_BIT) + /* Virtual code is correct? */ + if (wVirtKey < 0x100) { OutPwszBuff = ExAllocatePoolWithTag(NonPagedPool,sizeof(WCHAR) * cchBuff, TAG_STRING); if( !OutPwszBuff ) @@ -752,8 +759,6 @@ NtUserToUnicodeEx( MmCopyToCaller(pwszBuff,OutPwszBuff,sizeof(WCHAR)*cchBuff); ExFreePoolWithTag(OutPwszBuff, TAG_STRING); } - else - ret = 0; RETURN(ret); diff --git a/subsystems/win32/win32k/ntuser/menu.c b/subsystems/win32/win32k/ntuser/menu.c index 9bdbe026cf8..4da4922419d 100644 --- a/subsystems/win32/win32k/ntuser/menu.c +++ b/subsystems/win32/win32k/ntuser/menu.c @@ -9,7 +9,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -1296,15 +1296,6 @@ IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process) return TRUE; } -VOID APIENTRY -co_InflateRect(RECTL *rect, int dx, int dy) -{ - rect->left -= dx; - rect->top -= dy; - rect->right += dx; - rect->bottom += dy; -} - BOOLEAN APIENTRY intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti) { @@ -1334,17 +1325,17 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti) if (HAS_THICKFRAME( dwStyle, dwExStyle )) { /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXFRAME) and UserGetSystemMetrics(SM_CYFRAME) */ - co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) ); + RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME) ); } else if (HAS_DLGFRAME( dwStyle, dwExStyle )) { /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXDLGFRAME) and UserGetSystemMetrics(SM_CYDLGFRAME) */ - co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME)); + RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME)); } else if (HAS_THINFRAME( dwStyle, dwExStyle)) { /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */ - co_InflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) ); + RECTL_vInflateRect( &bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER) ); } /* We have additional border information if the window @@ -1355,13 +1346,13 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti) if (dwExStyle & WS_EX_CLIENTEDGE) { /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXEDGE) and UserGetSystemMetrics(SM_CYEDGE) */ - co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE)); + RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE)); } if (dwExStyle & WS_EX_STATICEDGE) { /* FIXME : Note this value should exists in pWindowObject for UserGetSystemMetrics(SM_CXBORDER) and UserGetSystemMetrics(SM_CYBORDER) */ - co_InflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER)); + RECTL_vInflateRect (&bti->rcTitleBar, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER)); } } } diff --git a/subsystems/win32/win32k/ntuser/message.c b/subsystems/win32/win32k/ntuser/message.c index 1b244b0e038..b626b881db4 100644 --- a/subsystems/win32/win32k/ntuser/message.c +++ b/subsystems/win32/win32k/ntuser/message.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -165,41 +165,47 @@ MsgMemorySize(PMSGMEMORY MsgMemoryEntry, WPARAM wParam, LPARAM lParam) } static NTSTATUS -PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam) +PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL NonPagedPoolNeeded) { NCCALCSIZE_PARAMS *UnpackedNcCalcsize; NCCALCSIZE_PARAMS *PackedNcCalcsize; CREATESTRUCTW *UnpackedCs; CREATESTRUCTW *PackedCs; - PUNICODE_STRING WindowName; + PLARGE_STRING WindowName; PUNICODE_STRING ClassName; + POOL_TYPE PoolType; UINT Size; PCHAR CsData; *lParamPacked = lParam; + + if (NonPagedPoolNeeded) + PoolType = NonPagedPool; + else + PoolType = PagedPool; + if (WM_NCCALCSIZE == Msg && wParam) { + UnpackedNcCalcsize = (NCCALCSIZE_PARAMS *) lParam; - if (UnpackedNcCalcsize->lppos != (PWINDOWPOS) (UnpackedNcCalcsize + 1)) + PackedNcCalcsize = ExAllocatePoolWithTag(PoolType, + sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS), + TAG_MSG); + + if (NULL == PackedNcCalcsize) { - PackedNcCalcsize = ExAllocatePoolWithTag(PagedPool, - sizeof(NCCALCSIZE_PARAMS) + sizeof(WINDOWPOS), - TAG_MSG); - if (NULL == PackedNcCalcsize) - { - DPRINT1("Not enough memory to pack lParam\n"); - return STATUS_NO_MEMORY; - } - RtlCopyMemory(PackedNcCalcsize, UnpackedNcCalcsize, sizeof(NCCALCSIZE_PARAMS)); - PackedNcCalcsize->lppos = (PWINDOWPOS) (PackedNcCalcsize + 1); - RtlCopyMemory(PackedNcCalcsize->lppos, UnpackedNcCalcsize->lppos, sizeof(WINDOWPOS)); - *lParamPacked = (LPARAM) PackedNcCalcsize; + DPRINT1("Not enough memory to pack lParam\n"); + return STATUS_NO_MEMORY; } + RtlCopyMemory(PackedNcCalcsize, UnpackedNcCalcsize, sizeof(NCCALCSIZE_PARAMS)); + PackedNcCalcsize->lppos = (PWINDOWPOS) (PackedNcCalcsize + 1); + RtlCopyMemory(PackedNcCalcsize->lppos, UnpackedNcCalcsize->lppos, sizeof(WINDOWPOS)); + *lParamPacked = (LPARAM) PackedNcCalcsize; } else if (WM_CREATE == Msg || WM_NCCREATE == Msg) { UnpackedCs = (CREATESTRUCTW *) lParam; - WindowName = (PUNICODE_STRING) UnpackedCs->lpszName; + WindowName = (PLARGE_STRING) UnpackedCs->lpszName; ClassName = (PUNICODE_STRING) UnpackedCs->lpszClass; Size = sizeof(CREATESTRUCTW) + WindowName->Length + sizeof(WCHAR); if (IS_ATOM(ClassName->Buffer)) @@ -210,7 +216,7 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam) { Size += sizeof(WCHAR) + ClassName->Length + sizeof(WCHAR); } - PackedCs = ExAllocatePoolWithTag(PagedPool, Size, TAG_MSG); + PackedCs = ExAllocatePoolWithTag(PoolType, Size, TAG_MSG); if (NULL == PackedCs) { DPRINT1("Not enough memory to pack lParam\n"); @@ -244,11 +250,28 @@ PackParam(LPARAM *lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam) *lParamPacked = (LPARAM) PackedCs; } + else if (PoolType == NonPagedPool) + { + PMSGMEMORY MsgMemoryEntry; + PVOID PackedData; + + MsgMemoryEntry = FindMsgMemory(Msg); + + if ((!MsgMemoryEntry) || (MsgMemoryEntry->Size < 0)) + { + /* Keep previous behavior */ + return STATUS_SUCCESS; + } + PackedData = ExAllocatePoolWithTag(NonPagedPool, MsgMemorySize(MsgMemoryEntry, wParam, lParam), TAG_MSG); + RtlCopyMemory(PackedData, (PVOID)lParam, MsgMemorySize(MsgMemoryEntry, wParam, lParam)); + *lParamPacked = (LPARAM)PackedData; + } + return STATUS_SUCCESS; } static NTSTATUS -UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam) +UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL NonPagedPoolUsed) { NCCALCSIZE_PARAMS *UnpackedParams; NCCALCSIZE_PARAMS *PackedParams; @@ -277,6 +300,23 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam) return STATUS_SUCCESS; } + else if (NonPagedPoolUsed) + { + PMSGMEMORY MsgMemoryEntry; + MsgMemoryEntry = FindMsgMemory(Msg); + if (MsgMemoryEntry->Size < 0) + { + /* Keep previous behavior */ + return STATUS_INVALID_PARAMETER; + } + + if (MsgMemory->Flags == MMS_FLAG_READWRITE) + { + //RtlCopyMemory((PVOID)lParam, (PVOID)lParamPacked, MsgMemory->Size); + } + ExFreePool((PVOID) lParamPacked); + return STATUS_SUCCESS; + } ASSERT(FALSE); @@ -394,7 +434,7 @@ IntDispatchMessage(PMSG pMsg) lParamBufferSize = MsgMemorySize(MsgMemoryEntry, pMsg->wParam, pMsg->lParam); } - if (! NT_SUCCESS(PackParam(&lParamPacked, pMsg->message, pMsg->wParam, pMsg->lParam))) + if (! NT_SUCCESS(PackParam(&lParamPacked, pMsg->message, pMsg->wParam, pMsg->lParam, FALSE))) { DPRINT1("Failed to pack message parameters\n"); return 0; @@ -408,7 +448,7 @@ IntDispatchMessage(PMSG pMsg) lParamPacked, lParamBufferSize); - if (! NT_SUCCESS(UnpackParam(lParamPacked, pMsg->message, pMsg->wParam, pMsg->lParam))) + if (! NT_SUCCESS(UnpackParam(lParamPacked, pMsg->message, pMsg->wParam, pMsg->lParam, FALSE))) { DPRINT1("Failed to unpack message parameters\n"); } @@ -645,6 +685,74 @@ co_IntTranslateMouseMessage( return FALSE; } +BOOL ProcessMouseMessage(MSG* Msg, USHORT HitTest, UINT RemoveMsg) +{ + MOUSEHOOKSTRUCT MHook; + EVENTMSG Event; + + Event.message = Msg->message; + Event.time = Msg->time; + Event.hwnd = Msg->hwnd; + Event.paramL = Msg->pt.x; + Event.paramH = Msg->pt.y; + co_HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&Event); + + + MHook.pt = Msg->pt; + MHook.hwnd = Msg->hwnd; + MHook.wHitTestCode = HitTest; + MHook.dwExtraInfo = 0; + if (co_HOOK_CallHooks( WH_MOUSE, + RemoveMsg ? HC_ACTION : HC_NOREMOVE, + Msg->message, + (LPARAM)&MHook )) + { + if (ISITHOOKED(WH_CBT)) + { + MHook.pt = Msg->pt; + MHook.hwnd = Msg->hwnd; + MHook.wHitTestCode = HitTest; + MHook.dwExtraInfo = 0; + co_HOOK_CallHooks( WH_CBT, + HCBT_CLICKSKIPPED, + Msg->message, + (LPARAM)&MHook); + } + return FALSE; + } + + return TRUE; +} + +BOOL ProcessKeyboardMessage(MSG* Msg, UINT RemoveMsg) +{ + EVENTMSG Event; + + Event.message = Msg->message; + Event.hwnd = Msg->hwnd; + Event.time = Msg->time; + Event.paramL = (Msg->wParam & 0xFF) | (HIWORD(Msg->lParam) << 8); + Event.paramH = Msg->lParam & 0x7FFF; + if (HIWORD(Msg->lParam) & 0x0100) Event.paramH |= 0x8000; + co_HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&Event); + + if (co_HOOK_CallHooks( WH_KEYBOARD, + RemoveMsg ? HC_ACTION : HC_NOREMOVE, + LOWORD(Msg->wParam), + Msg->lParam)) + { + if (ISITHOOKED(WH_CBT)) + { + /* skip this message */ + co_HOOK_CallHooks( WH_CBT, + HCBT_KEYSKIPPED, + LOWORD(Msg->wParam), + Msg->lParam ); + } + return FALSE; + } + return TRUE; +} /* * Internal version of PeekMessage() doing all the work */ @@ -662,7 +770,6 @@ co_IntPeekMessage( PUSER_MESSAGE Msg, BOOL Present, RemoveMessages; USER_REFERENCE_ENTRY Ref; USHORT HitTest; - MOUSEHOOKSTRUCT MHook; /* The queues and order in which they are checked are documented in the MSDN article on GetMessage() */ @@ -773,23 +880,8 @@ CheckMessages: goto MsgExit; } - if (ThreadQueue->WakeMask & QS_TIMER) - if (PostTimerMessages(Window)) // If there are timers ready, - goto CheckMessages; // go back and process them. - - // LOL! Polling Timer Queue? How much time is spent doing this? - /* Check for WM_(SYS)TIMER messages */ - Present = MsqGetTimerMessage( ThreadQueue, - Window, - MsgFilterMin, - MsgFilterMax, - &Msg->Msg, - RemoveMessages); - if (Present) - { - Msg->FreeLParam = FALSE; - goto MessageFound; - } + if (PostTimerMessages(Window)) + goto CheckMessages; if(Present) { @@ -867,52 +959,20 @@ MessageFound: } MsgExit: - if ( ISITHOOKED(WH_MOUSE) && - Msg->Msg.message >= WM_MOUSEFIRST && - Msg->Msg.message <= WM_MOUSELAST ) + if ( ISITHOOKED(WH_MOUSE) && IS_MOUSE_MESSAGE(Msg->Msg.message)) { - MHook.pt = Msg->Msg.pt; - MHook.hwnd = Msg->Msg.hwnd; - MHook.wHitTestCode = HitTest; - MHook.dwExtraInfo = 0; - if (co_HOOK_CallHooks( WH_MOUSE, - RemoveMsg ? HC_ACTION : HC_NOREMOVE, - Msg->Msg.message, - (LPARAM)&MHook )) - { - if (ISITHOOKED(WH_CBT)) - { - MHook.pt = Msg->Msg.pt; - MHook.hwnd = Msg->Msg.hwnd; - MHook.wHitTestCode = HitTest; - MHook.dwExtraInfo = 0; - co_HOOK_CallHooks( WH_CBT, - HCBT_CLICKSKIPPED, - Msg->Msg.message, - (LPARAM)&MHook); - } - return FALSE; - } - } + if(!ProcessMouseMessage(&Msg->Msg, HitTest, RemoveMsg)) + { + return FALSE; + } + } - if ( ISITHOOKED(WH_KEYBOARD) && - (Msg->Msg.message == WM_KEYDOWN || Msg->Msg.message == WM_KEYUP) ) + if ( ISITHOOKED(WH_KEYBOARD) && IS_KBD_MESSAGE(Msg->Msg.message)) { - if (co_HOOK_CallHooks( WH_KEYBOARD, - RemoveMsg ? HC_ACTION : HC_NOREMOVE, - LOWORD(Msg->Msg.wParam), - Msg->Msg.lParam)) - { - if (ISITHOOKED(WH_CBT)) - { - /* skip this message */ - co_HOOK_CallHooks( WH_CBT, - HCBT_KEYSKIPPED, - LOWORD(Msg->Msg.wParam), - Msg->Msg.lParam ); - } - return FALSE; - } + if(!ProcessKeyboardMessage(&Msg->Msg, RemoveMsg)) + { + return FALSE; + } } // The WH_GETMESSAGE hook enables an application to monitor messages about to // be returned by the GetMessage or PeekMessage function. @@ -1337,7 +1397,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd, lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam); } - if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam))) + if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, FALSE))) { DPRINT1("Failed to pack message parameters\n"); RETURN( FALSE); @@ -1357,7 +1417,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd, IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult); - if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam))) + if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE))) { DPRINT1("Failed to unpack message parameters\n"); RETURN( TRUE); @@ -1464,6 +1524,148 @@ co_IntSendMessageTimeout( HWND hWnd, return (LRESULT) TRUE; } +LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam) +{ + ULONG_PTR Result = 0; + co_IntSendMessageWithCallBack(hWnd, + Msg, + wParam, + lParam, + NULL, + 0, + &Result); + return Result; +} + +LRESULT FASTCALL +co_IntSendMessageWithCallBack( HWND hWnd, + UINT Msg, + WPARAM wParam, + LPARAM lParam, + SENDASYNCPROC CompletionCallback, + ULONG_PTR CompletionCallbackContext, + ULONG_PTR *uResult) +{ + ULONG_PTR Result; + PWINDOW_OBJECT Window = NULL; + PMSGMEMORY MsgMemoryEntry; + INT lParamBufferSize; + LPARAM lParamPacked; + PTHREADINFO Win32Thread; + DECLARE_RETURN(LRESULT); + USER_REFERENCE_ENTRY Ref; + PUSER_SENT_MESSAGE Message; + + if (!(Window = UserGetWindowObject(hWnd))) + { + RETURN(FALSE); + } + + UserRefObjectCo(Window, &Ref); + + if (Window->state & WINDOWSTATUS_DESTROYING) + { + /* FIXME - last error? */ + DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd); + RETURN(FALSE); + } + + Win32Thread = PsGetCurrentThreadWin32Thread(); + + IntCallWndProc( Window, hWnd, Msg, wParam, lParam); + + if (Win32Thread == NULL) + { + ASSERT(FALSE); + RETURN(FALSE); + } + + if (Win32Thread->TIF_flags & TIF_INCLEANUP) + { + /* Never send messages to exiting threads */ + RETURN(FALSE); + } + + /* See if this message type is present in the table */ + MsgMemoryEntry = FindMsgMemory(Msg); + if (NULL == MsgMemoryEntry) + { + lParamBufferSize = -1; + } + else + { + lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam); + } + + if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->pti->MessageQueue != Win32Thread->MessageQueue))) + { + DPRINT1("Failed to pack message parameters\n"); + RETURN( FALSE); + } + + /* If this is not a callback and it can be sent now, then send it. */ + if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL)) + { + + Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc, + !Window->Wnd->Unicode, + hWnd, + Msg, + wParam, + lParamPacked, + lParamBufferSize ); + if(uResult) + { + *uResult = Result; + } + } + + IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult); + + if (Window->pti->MessageQueue == Win32Thread->MessageQueue) + { + if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE))) + { + DPRINT1("Failed to unpack message parameters\n"); + RETURN(TRUE); + } + RETURN(TRUE); + } + + if(!(Message = ExAllocatePoolWithTag(NonPagedPool, sizeof(USER_SENT_MESSAGE), TAG_USRMSG))) + { + DPRINT1("MsqSendMessage(): Not enough memory to allocate a message"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + Message->Msg.hwnd = hWnd; + Message->Msg.message = Msg; + Message->Msg.wParam = wParam; + Message->Msg.lParam = lParamPacked; + Message->CompletionEvent = NULL; + Message->Result = 0; + Message->SenderQueue = Win32Thread->MessageQueue; + IntReferenceMessageQueue(Message->SenderQueue); + IntReferenceMessageQueue(Window->pti->MessageQueue); + Message->CompletionCallback = CompletionCallback; + Message->CompletionCallbackContext = CompletionCallbackContext; + Message->HookMessage = MSQ_NORMAL | MSQ_SENTNOWAIT; + Message->HasPackedLParam = (lParamBufferSize > 0); + + InsertTailList(&Window->pti->MessageQueue->SentMessagesListHead, &Message->ListEntry); + InsertTailList(&Win32Thread->MessageQueue->DispatchingMessagesHead, &Message->DispatchingListEntry); + IntDereferenceMessageQueue(Window->pti->MessageQueue); + IntDereferenceMessageQueue(Message->SenderQueue); + + RETURN(TRUE); + +CLEANUP: + if (Window) UserDerefObjectCo(Window); + END_CLEANUP; +} /* This function posts a message if the destination's message queue belongs to another thread, otherwise it sends the message. It does not support broadcast diff --git a/subsystems/win32/win32k/ntuser/metric.c b/subsystems/win32/win32k/ntuser/metric.c index 4519ff811ef..be2b1a10367 100644 --- a/subsystems/win32/win32k/ntuser/metric.c +++ b/subsystems/win32/win32k/ntuser/metric.c @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/misc.c b/subsystems/win32/win32k/ntuser/misc.c index 27faa8fc9e3..48ef50b7ae6 100644 --- a/subsystems/win32/win32k/ntuser/misc.c +++ b/subsystems/win32/win32k/ntuser/misc.c @@ -8,7 +8,7 @@ * 2003/05/22 Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/monitor.c b/subsystems/win32/win32k/ntuser/monitor.c index 072bad97df4..e0e290447ae 100644 --- a/subsystems/win32/win32k/ntuser/monitor.c +++ b/subsystems/win32/win32k/ntuser/monitor.c @@ -27,7 +27,7 @@ /* INCLUDES ******************************************************************/ -#include +#include /* FIXME: find include file for these */ #define MONITORINFOF_PRIMARY 1 @@ -344,10 +344,7 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect, RECTL MonitorRect, IntersectionRect; ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Monitor->Lock); - MonitorRect.left = 0; /* FIXME: get origin */ - MonitorRect.top = 0; /* FIXME: get origin */ - MonitorRect.right = MonitorRect.left + Monitor->GdiDevice->gdiinfo.ulHorzRes; - MonitorRect.bottom = MonitorRect.top + Monitor->GdiDevice->gdiinfo.ulVertRes; + MonitorRect = Monitor->rcMonitor; ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Monitor->Lock); DPRINT("MonitorRect: left = %d, top = %d, right = %d, bottom = %d\n", @@ -677,11 +674,8 @@ NtUserGetMonitorInfo( } /* fill monitor info */ - MonitorInfo.rcMonitor.left = 0; /* FIXME: get origin */ - MonitorInfo.rcMonitor.top = 0; /* FIXME: get origin */ - MonitorInfo.rcMonitor.right = MonitorInfo.rcMonitor.left + Monitor->GdiDevice->gdiinfo.ulHorzRes; - MonitorInfo.rcMonitor.bottom = MonitorInfo.rcMonitor.top + Monitor->GdiDevice->gdiinfo.ulVertRes; - MonitorInfo.rcWork = MonitorInfo.rcMonitor; /* FIXME: use DEVMODE panning to calculate work area? */ + MonitorInfo.rcMonitor = Monitor->rcMonitor; + MonitorInfo.rcWork = Monitor->rcWork; MonitorInfo.dwFlags = 0; if (Monitor->IsPrimary) diff --git a/subsystems/win32/win32k/ntuser/msgqueue.c b/subsystems/win32/win32k/ntuser/msgqueue.c index 2b1fedae85a..5bfe414b5ed 100644 --- a/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/subsystems/win32/win32k/ntuser/msgqueue.c @@ -28,7 +28,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -174,8 +174,41 @@ MsqInsertSystemMessage(MSG* Msg) LARGE_INTEGER LargeTickCount; KIRQL OldIrql; ULONG Prev; - EVENTMSG Event; + MSLLHOOKSTRUCT MouseHookData; + KeQueryTickCount(&LargeTickCount); + Msg->time = MsqCalculateMessageTime(&LargeTickCount); + + MouseHookData.pt.x = LOWORD(Msg->lParam); + MouseHookData.pt.y = HIWORD(Msg->lParam); + switch(Msg->message) + { + case WM_MOUSEWHEEL: + MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg->wParam)); + break; + case WM_XBUTTONDOWN: + case WM_XBUTTONUP: + case WM_XBUTTONDBLCLK: + case WM_NCXBUTTONDOWN: + case WM_NCXBUTTONUP: + case WM_NCXBUTTONDBLCLK: + MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg->wParam)); + break; + default: + MouseHookData.mouseData = 0; + break; + } + MouseHookData.flags = 0; + MouseHookData.time = Msg->time; + MouseHookData.dwExtraInfo = 0; + if( co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM) &MouseHookData)) + return; + + /* + * If we got WM_MOUSEMOVE and there are already messages in the + * system message queue, check if the last message is mouse move + * and if it is then just overwrite it. + */ IntLockSystemMessageQueue(OldIrql); /* @@ -189,22 +222,6 @@ MsqInsertSystemMessage(MSG* Msg) return; } - KeQueryTickCount(&LargeTickCount); - Msg->time = MsqCalculateMessageTime(&LargeTickCount); - - Event.message = Msg->message; - Event.time = Msg->time; - Event.hwnd = Msg->hwnd; - Event.paramL = Msg->pt.x; - Event.paramH = Msg->pt.y; - co_HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&Event); - - /* - * If we got WM_MOUSEMOVE and there are already messages in the - * system message queue, check if the last message is mouse move - * and if it is then just overwrite it. - */ - if (Msg->message == WM_MOUSEMOVE && SystemMessageQueueCount) { if (SystemMessageQueueTail == 0) @@ -623,7 +640,6 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo { PUSER_MESSAGE UserMsg; MSG Msg; - BOOL ProcessMessage; ASSERT(SystemMessageQueueHead < SYSTEM_MESSAGE_QUEUE_SIZE); Msg = SystemMessageQueue[SystemMessageQueueHead]; @@ -631,48 +647,14 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo (SystemMessageQueueHead + 1) % SYSTEM_MESSAGE_QUEUE_SIZE; SystemMessageQueueCount--; IntUnLockSystemMessageQueue(OldIrql); - if (WM_MOUSEFIRST <= Msg.message && Msg.message <= WM_MOUSELAST) - { - MSLLHOOKSTRUCT MouseHookData; - MouseHookData.pt.x = LOWORD(Msg.lParam); - MouseHookData.pt.y = HIWORD(Msg.lParam); - switch(Msg.message) - { - case WM_MOUSEWHEEL: - MouseHookData.mouseData = MAKELONG(0, GET_WHEEL_DELTA_WPARAM(Msg.wParam)); - break; - case WM_XBUTTONDOWN: - case WM_XBUTTONUP: - case WM_XBUTTONDBLCLK: - case WM_NCXBUTTONDOWN: - case WM_NCXBUTTONUP: - case WM_NCXBUTTONDBLCLK: - MouseHookData.mouseData = MAKELONG(0, HIWORD(Msg.wParam)); - break; - default: - MouseHookData.mouseData = 0; - break; - } - MouseHookData.flags = 0; - MouseHookData.time = Msg.time; - MouseHookData.dwExtraInfo = 0; - ProcessMessage = (0 == co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, - Msg.message, (LPARAM) &MouseHookData)); - } - else - { - ProcessMessage = TRUE; - } - if (ProcessMessage) - { - UserMsg = ExAllocateFromPagedLookasideList(&MessageLookasideList); - /* What to do if out of memory? For now we just panic a bit in debug */ - ASSERT(UserMsg); - UserMsg->FreeLParam = FALSE; - UserMsg->Msg = Msg; - InsertTailList(&HardwareMessageQueueHead, &UserMsg->ListEntry); - } + UserMsg = ExAllocateFromPagedLookasideList(&MessageLookasideList); + /* What to do if out of memory? For now we just panic a bit in debug */ + ASSERT(UserMsg); + UserMsg->FreeLParam = FALSE; + UserMsg->Msg = Msg; + InsertTailList(&HardwareMessageQueueHead, &UserMsg->ListEntry); + IntLockSystemMessageQueue(OldIrql); } HardwareMessageQueueStamp++; @@ -767,7 +749,6 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) MSG Msg; LARGE_INTEGER LargeTickCount; KBDLLHOOKSTRUCT KbdHookData; - EVENTMSG Event; BOOLEAN Entered = FALSE; DPRINT("MsqPostKeyboardMessage(uMsg 0x%x, wParam 0x%x, lParam 0x%x)\n", @@ -795,14 +776,6 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) KeQueryTickCount(&LargeTickCount); Msg.time = MsqCalculateMessageTime(&LargeTickCount); - Event.message = Msg.message; - Event.hwnd = Msg.hwnd; - Event.time = Msg.time; - Event.paramL = (Msg.wParam & 0xFF) | (HIWORD(Msg.lParam) << 8); - Event.paramH = Msg.lParam & 0x7FFF; - if (HIWORD(Msg.lParam) & 0x0100) Event.paramH |= 0x8000; - co_HOOK_CallHooks( WH_JOURNALRECORD, HC_ACTION, 0, (LPARAM)&Event); - /* We can't get the Msg.pt point here since we don't know thread (and thus the window station) the message will end up in yet. */ @@ -996,7 +969,7 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) /* remove the message from the dispatching list, so lock the sender's message queue */ SenderReturned = (Message->DispatchingListEntry.Flink == NULL); - if(!SenderReturned) + if (!SenderReturned) { /* only remove it from the dispatching list if not already removed by a timeout */ RemoveEntryList(&Message->DispatchingListEntry); @@ -1010,6 +983,12 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) *Message->Result = Result; } + if (Message->HasPackedLParam == TRUE) + { + if (Message->Msg.lParam) + ExFreePool((PVOID)Message->Msg.lParam); + } + /* Notify the sender. */ if (Message->CompletionEvent != NULL) { @@ -1037,9 +1016,12 @@ co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue) Notified: - /* dereference both sender and our queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(Message->SenderQueue); + /* Only if it is not a no wait message */ + if (!(Message->HookMessage & MSQ_SENTNOWAIT)) + { + IntDereferenceMessageQueue(Message->SenderQueue); + IntDereferenceMessageQueue(MessageQueue); + } /* free the message */ ExFreePool(Message); @@ -1090,7 +1072,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow) { DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n"); - RemoveEntryList(&SentMessage->ListEntry); + RemoveEntryList(&SentMessage->ListEntry); /* remove the message from the dispatching list */ if(SentMessage->DispatchingListEntry.Flink != NULL) @@ -1104,9 +1086,19 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow) KeSetEvent(SentMessage->CompletionEvent, IO_NO_INCREMENT, FALSE); } - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(SentMessage->SenderQueue); + if (SentMessage->HasPackedLParam == TRUE) + { + if (SentMessage->Msg.lParam) + ExFreePool((PVOID)SentMessage->Msg.lParam); + } + + /* Only if it is not a no wait message */ + if (!(SentMessage->HookMessage & MSQ_SENTNOWAIT)) + { + /* dereference our and the sender's message queue */ + IntDereferenceMessageQueue(MessageQueue); + IntDereferenceMessageQueue(SentMessage->SenderQueue); + } /* free the message */ ExFreePool(SentMessage); @@ -1174,6 +1166,7 @@ co_MsqSendMessage(PUSER_MESSAGE_QUEUE MessageQueue, IntReferenceMessageQueue(ThreadQueue); Message->CompletionCallback = NULL; Message->HookMessage = HookMessage; + Message->HasPackedLParam = FALSE; IntReferenceMessageQueue(MessageQueue); @@ -1526,9 +1519,19 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) KeSetEvent(CurrentSentMessage->CompletionEvent, IO_NO_INCREMENT, FALSE); } - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); + if (CurrentSentMessage->HasPackedLParam == TRUE) + { + if (CurrentSentMessage->Msg.lParam) + ExFreePool((PVOID)CurrentSentMessage->Msg.lParam); + } + + /* Only if it is not a no wait message */ + if (!(CurrentSentMessage->HookMessage & MSQ_SENTNOWAIT)) + { + /* dereference our and the sender's message queue */ + IntDereferenceMessageQueue(MessageQueue); + IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); + } /* free the message */ ExFreePool(CurrentSentMessage); @@ -1564,10 +1567,19 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue) KeSetEvent(CurrentSentMessage->CompletionEvent, IO_NO_INCREMENT, FALSE); } - /* dereference our and the sender's message queue */ - IntDereferenceMessageQueue(MessageQueue); - IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); + if (CurrentSentMessage->HasPackedLParam == TRUE) + { + if (CurrentSentMessage->Msg.lParam) + ExFreePool((PVOID)CurrentSentMessage->Msg.lParam); + } + /* Only if it is not a no wait message */ + if (!(CurrentSentMessage->HookMessage & MSQ_SENTNOWAIT)) + { + /* dereference our and the sender's message queue */ + IntDereferenceMessageQueue(MessageQueue); + IntDereferenceMessageQueue(CurrentSentMessage->SenderQueue); + } /* free the message */ ExFreePool(CurrentSentMessage); } diff --git a/subsystems/win32/win32k/ntuser/ntstubs.c b/subsystems/win32/win32k/ntuser/ntstubs.c index f9104fe5faa..2430a4df7ac 100644 --- a/subsystems/win32/win32k/ntuser/ntstubs.c +++ b/subsystems/win32/win32k/ntuser/ntstubs.c @@ -7,7 +7,7 @@ * REVISION HISTORY: * 04-06-2001 CSH Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/ntuser.c b/subsystems/win32/win32k/ntuser/ntuser.c index e51db8eb9a4..569acfdc54c 100644 --- a/subsystems/win32/win32k/ntuser/ntuser.c +++ b/subsystems/win32/win32k/ntuser/ntuser.c @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/object.c b/subsystems/win32/win32k/ntuser/object.c index cd5f59101ed..2ccc4356f75 100644 --- a/subsystems/win32/win32k/ntuser/object.c +++ b/subsystems/win32/win32k/ntuser/object.c @@ -22,7 +22,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/painting.c b/subsystems/win32/win32k/ntuser/painting.c index 66977db106f..0e042410757 100644 --- a/subsystems/win32/win32k/ntuser/painting.c +++ b/subsystems/win32/win32k/ntuser/painting.c @@ -11,7 +11,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -1896,7 +1896,13 @@ BOOL UserDrawCaption( if (str) UserDrawCaptionText(hMemDc, str, &r, uFlags); else if (pWnd != NULL) - UserDrawCaptionText(hMemDc, &pWnd->Wnd->strName, &r, uFlags); + { + UNICODE_STRING ustr; + ustr.Buffer = pWnd->Wnd->strName.Buffer; + ustr.Length = pWnd->Wnd->strName.Length; + ustr.MaximumLength = pWnd->Wnd->strName.MaximumLength; + UserDrawCaptionText(hMemDc, &ustr, &r, uFlags); + } } if(!NtGdiBitBlt(hDc, lpRc->left, lpRc->top, diff --git a/subsystems/win32/win32k/ntuser/prop.c b/subsystems/win32/win32k/ntuser/prop.c index cf41600c224..c596c0e02a5 100644 --- a/subsystems/win32/win32k/ntuser/prop.c +++ b/subsystems/win32/win32k/ntuser/prop.c @@ -27,7 +27,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/scrollbar.c b/subsystems/win32/win32k/ntuser/scrollbar.c index 065c7ccaeb0..8efd8721d76 100644 --- a/subsystems/win32/win32k/ntuser/scrollbar.c +++ b/subsystems/win32/win32k/ntuser/scrollbar.c @@ -10,7 +10,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/session.c b/subsystems/win32/win32k/ntuser/session.c index 1a8cddc0e49..88e453164cb 100644 --- a/subsystems/win32/win32k/ntuser/session.c +++ b/subsystems/win32/win32k/ntuser/session.c @@ -24,7 +24,7 @@ * PROGRAMER: Gunnar */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/simplecall.c b/subsystems/win32/win32k/ntuser/simplecall.c index f0dcc3a755b..77d8fb9d237 100644 --- a/subsystems/win32/win32k/ntuser/simplecall.c +++ b/subsystems/win32/win32k/ntuser/simplecall.c @@ -8,7 +8,7 @@ * 2008/03/20 Split from misc.c */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/sysparams.c b/subsystems/win32/win32k/ntuser/sysparams.c index 4768cb0d9a5..6fa98f9563b 100644 --- a/subsystems/win32/win32k/ntuser/sysparams.c +++ b/subsystems/win32/win32k/ntuser/sysparams.c @@ -11,7 +11,7 @@ // - does setting invalid fonts work? // - save appropriate text metrics -#include +#include #define NDEBUG #include @@ -895,26 +895,24 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl) } return (UINT_PTR)KEY_METRIC; - case SPI_GETWORKAREA: // FIXME: the workarea should be part of the MONITOR + case SPI_GETWORKAREA: { - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP pdesktop = pti->rpdesk; - RECTL rclWorkarea; + PMONITOR pmonitor = IntGetPrimaryMonitor(); - if(!pdesktop) + if(!pmonitor) return 0; - IntGetDesktopWorkArea(pdesktop, &rclWorkarea); - return SpiGet(pvParam, &rclWorkarea, sizeof(RECTL), fl); + return SpiGet(pvParam, &pmonitor->rcWork, sizeof(RECTL), fl); } - case SPI_SETWORKAREA: // FIXME: the workarea should be part of the MONITOR + case SPI_SETWORKAREA: { - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP pdesktop = pti->rpdesk; + /*FIXME: we should set the work area of the monitor + that contains the specified rectangle*/ + PMONITOR pmonitor = IntGetPrimaryMonitor(); RECT rcWorkArea; - if(!pdesktop) + if(!pmonitor) return 0; if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl)) @@ -929,7 +927,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl) rcWorkArea.bottom <= rcWorkArea.top) return 0; - pdesktop->WorkArea = rcWorkArea; + pmonitor->rcWork = rcWorkArea; if (fl & SPIF_UPDATEINIFILE) { // FIXME: what to do? diff --git a/subsystems/win32/win32k/ntuser/timer.c b/subsystems/win32/win32k/ntuser/timer.c index c706805a9c8..2d7b8d003d7 100644 --- a/subsystems/win32/win32k/ntuser/timer.c +++ b/subsystems/win32/win32k/ntuser/timer.c @@ -11,7 +11,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -57,7 +57,7 @@ CreateTimer(VOID) { Ret = UserCreateObject(gHandleTable, NULL, &Handle, otTimer, sizeof(TIMER)); if (Ret) InsertTailList(&FirstpTmr->ptmrList, &Ret->ptmrList); - } + } return Ret; } @@ -68,8 +68,8 @@ RemoveTimer(PTIMER pTmr) { if (pTmr) { - RemoveEntryList(&pTmr->ptmrList); - UserDeleteObject( UserHMGetHandle(pTmr), otTimer); + /* Set the flag, it will be removed when ready */ + pTmr->flags |= TMRF_DELETEPENDING; return TRUE; } return FALSE; @@ -83,7 +83,7 @@ FindTimer(PWINDOW_OBJECT Window, BOOL Distroy) { PLIST_ENTRY pLE; - PTIMER pTmr = FirstpTmr; + PTIMER pTmr = FirstpTmr, RetTmr = NULL; KeEnterCriticalRegion(); do { @@ -96,8 +96,8 @@ FindTimer(PWINDOW_OBJECT Window, if (Distroy) { RemoveTimer(pTmr); - pTmr = (PTIMER)1; // We are here to remove the timer. } + RetTmr = pTmr; break; } @@ -106,7 +106,7 @@ FindTimer(PWINDOW_OBJECT Window, } while (pTmr != FirstpTmr); KeLeaveCriticalRegion(); - return pTmr; + return RetTmr; } PTIMER @@ -162,15 +162,15 @@ ValidateTimerCallback(PTHREADINFO pti, return TRUE; } -// Rename it to IntSetTimer after move. UINT_PTR FASTCALL -InternalSetTimer( PWINDOW_OBJECT Window, +IntSetTimer( PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type) { PTIMER pTmr; + UINT Ret= IDEvent; LARGE_INTEGER DueTime; DueTime.QuadPart = (LONGLONG)(-10000000); @@ -197,6 +197,24 @@ InternalSetTimer( PWINDOW_OBJECT Window, Elapse = 10; } + if ((Window == NULL) && (!(Type & TMRF_SYSTEM))) + { + IntLockWindowlessTimerBitmap(); + IDEvent = RtlFindClearBitsAndSet(&WindowLessTimersBitMap, 1, HintIndex); + + if (IDEvent == (UINT_PTR) -1) + { + IntUnlockWindowlessTimerBitmap(); + DPRINT1("Unable to find a free window-less timer id\n"); + SetLastWin32Error(ERROR_NO_SYSTEM_RESOURCES); + return 0; + } + + HintIndex = ++IDEvent; + IntUnlockWindowlessTimerBitmap(); + Ret = IDEvent; + } + pTmr = FindTimer(Window, IDEvent, Type, FALSE); if (!pTmr) { @@ -215,18 +233,24 @@ InternalSetTimer( PWINDOW_OBJECT Window, pTmr->pWnd = Window; pTmr->cmsCountdown = Elapse; pTmr->cmsRate = Elapse; - pTmr->flags = Type|TMRF_INIT; // Set timer to Init mode. pTmr->pfn = TimerFunc; pTmr->nID = IDEvent; - - InsertTailList(&FirstpTmr->ptmrList, &pTmr->ptmrList); + pTmr->flags = Type|TMRF_INIT; // Set timer to Init mode. } - // Start the timer thread! - KeSetTimer(MasterTimer, DueTime, NULL); + pTmr->cmsCountdown = Elapse; + pTmr->cmsRate = Elapse; + if (pTmr->flags & TMRF_DELETEPENDING) + { + pTmr->flags &= ~TMRF_DELETEPENDING; + } - if (!pTmr->nID) return 1; - return pTmr->nID; + ASSERT(MasterTimer != NULL); + // Start the timer thread! + if (pTmr == FirstpTmr) + KeSetTimer(MasterTimer, DueTime, NULL); + + return Ret; } // @@ -248,7 +272,7 @@ StartTheTimers(VOID) { // Need to start gdi syncro timers then start timer with Hang App proc // that calles Idle process so the screen savers will know to run...... - InternalSetTimer(NULL, 0, 1000, SystemTimerProc, TMRF_RIT); + IntSetTimer(NULL, 0, 1000, SystemTimerProc, TMRF_RIT); } UINT_PTR @@ -256,14 +280,14 @@ FASTCALL SystemTimerSet( PWINDOW_OBJECT Window, UINT_PTR nIDEvent, UINT uElapse, - TIMERPROC lpTimerFunc) + TIMERPROC lpTimerFunc) { if (Window && Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess()) { SetLastWin32Error(ERROR_ACCESS_DENIED); return 0; } - return InternalSetTimer( Window, nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM); + return IntSetTimer( Window, nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM); } BOOL @@ -279,27 +303,23 @@ PostTimerMessages(PWINDOW_OBJECT Window) if (!pTmr) return FALSE; - if (Window && (int)Window != 1) - { - if (!Window->Wnd) return FALSE; - } - pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; KeEnterCriticalRegion(); + do { if ( (pTmr->flags & TMRF_READY) && (pTmr->pti == pti) && - (pTmr->pWnd == Window)) + ((pTmr->pWnd == Window) || (Window == NULL) ) ) { - Msg.hwnd = Window->hSelf; + Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->hSelf : 0; Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER; Msg.wParam = (WPARAM) pTmr->nID; Msg.lParam = (LPARAM) pTmr->pfn; - MsqPostMessage(ThreadQueue, &Msg, FALSE, QS_POSTMESSAGE); + MsqPostMessage(ThreadQueue, &Msg, FALSE, QS_TIMER); pTmr->flags &= ~TMRF_READY; ThreadQueue->WakeMask = ~QS_TIMER; Hit = TRUE; @@ -308,6 +328,7 @@ PostTimerMessages(PWINDOW_OBJECT Window) pLE = pTmr->ptmrList.Flink; pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); + KeLeaveCriticalRegion(); return Hit; @@ -329,7 +350,7 @@ ProcessTimers(VOID) KeQueryTickCount(&TickCount); Time = MsqCalculateMessageTime(&TickCount); - DueTime.QuadPart = (LONGLONG)(-10000000); + DueTime.QuadPart = (LONGLONG)(-1000000); do { @@ -340,13 +361,16 @@ ProcessTimers(VOID) continue; } - if (pTmr->flags & TMRF_INIT) + if (pTmr->flags & TMRF_INIT) + { pTmr->flags &= ~TMRF_INIT; // Skip this run. + } else { if (pTmr->cmsCountdown < 0) { - if (!(pTmr->flags & TMRF_READY)) + ASSERT(pTmr->pti); + if ((!(pTmr->flags & TMRF_READY)) && (!(pTmr->pti->TIF_flags & TIF_INCLEANUP))) { if (pTmr->flags & TMRF_ONESHOT) pTmr->flags |= TMRF_WAITING; @@ -362,21 +386,41 @@ ProcessTimers(VOID) // Set thread message queue for this timer. if (pTmr->pti->MessageQueue) { // Wakeup thread - pTmr->pti->MessageQueue->WakeMask |= QS_TIMER; + ASSERT(pTmr->pti->MessageQueue->NewMessages != NULL); KeSetEvent(pTmr->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE); } } } - pTmr->cmsCountdown = pTmr->cmsRate; + if (pTmr->flags & TMRF_DELETEPENDING) + { + DPRINT("Removing Timer %x from List\n", pTmr); + + /* FIXME: Fix this!!!! */ +/* + if (!pTmr->pWnd) + { + DPRINT1("Clearing Bits for WindowLess Timer\n"); + IntLockWindowlessTimerBitmap(); + RtlSetBits(&WindowLessTimersBitMap, pTmr->nID, 1); + IntUnlockWindowlessTimerBitmap(); + } +*/ + RemoveEntryList(&pTmr->ptmrList); + UserDeleteObject( UserHMGetHandle(pTmr), otTimer); + } + else + pTmr->cmsCountdown = pTmr->cmsRate; } else pTmr->cmsCountdown -= Time - TimeLast; } + pLE = pTmr->ptmrList.Flink; pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); } while (pTmr != FirstpTmr); // Restart the timer thread! + ASSERT(MasterTimer != NULL); KeSetTimer(MasterTimer, DueTime, NULL); TimeLast = Time; @@ -390,7 +434,7 @@ ProcessTimers(VOID) // // UINT_PTR FASTCALL -IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer) +InternalSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL SystemTimer) { PWINDOW_OBJECT Window; UINT_PTR Ret = 0; @@ -476,17 +520,66 @@ IntSetTimer(HWND Wnd, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, BOOL S return 0; } - +if (Ret == 0) ASSERT(FALSE); return Ret; } +BOOL FASTCALL +DestroyTimersForThread(PTHREADINFO pti) +{ + PLIST_ENTRY pLE; + PTIMER pTmr = FirstpTmr; + BOOL TimersRemoved = FALSE; + + if (FirstpTmr == NULL) + return FALSE; + + KeEnterCriticalRegion(); + + do + { + if ((pTmr) && (pTmr->pti == pti)) + { + pTmr->flags &= ~TMRF_READY; + pTmr->flags |= TMRF_DELETEPENDING; + TimersRemoved = TRUE; + } + pLE = pTmr->ptmrList.Flink; + pTmr = CONTAINING_RECORD(pLE, TIMER, ptmrList); + } while (pTmr != FirstpTmr); + + KeLeaveCriticalRegion(); + + return TimersRemoved; +} + BOOL FASTCALL -IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer) +IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer) +{ + PTIMER pTmr = NULL; + DPRINT("IntKillTimer Window %x id %p systemtimer %s\n", + Window, IDEvent, SystemTimer ? "TRUE" : "FALSE"); + + if (IDEvent == 0) + return FALSE; + + pTmr = FindTimer(Window, IDEvent, SystemTimer ? TMRF_SYSTEM : 0, TRUE); + return pTmr ? TRUE : FALSE; +} + + +// +// +// Old Kill Timer +// +// +BOOL FASTCALL +InternalKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer) { PTHREADINFO pti; PWINDOW_OBJECT Window = NULL; - + DPRINT("IntKillTimer wnd %x id %p systemtimer %s\n", Wnd, IDEvent, SystemTimer ? "TRUE" : "FALSE"); @@ -494,7 +587,7 @@ IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer) if (Wnd) { Window = UserGetWindowObject(Wnd); - + if (! MsqKillTimer(pti->MessageQueue, Wnd, IDEvent, SystemTimer ? WM_SYSTIMER : WM_TIMER)) { @@ -526,6 +619,8 @@ IntKillTimer(HWND Wnd, UINT_PTR IDEvent, BOOL SystemTimer) ASSERT(RtlAreBitsSet(&WindowLessTimersBitMap, IDEvent - 1, 1)); RtlClearBits(&WindowLessTimersBitMap, IDEvent - 1, 1); + HintIndex = IDEvent - 1; + IntUnlockWindowlessTimerBitmap(); } @@ -571,7 +666,7 @@ NtUserSetTimer DPRINT("Enter NtUserSetTimer\n"); UserEnterExclusive(); - RETURN(IntSetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc, FALSE)); + RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, 0)); CLEANUP: DPRINT("Leave NtUserSetTimer, ret=%i\n", _ret_); @@ -588,12 +683,15 @@ NtUserKillTimer UINT_PTR uIDEvent ) { + PWINDOW_OBJECT Window; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserKillTimer\n"); UserEnterExclusive(); - RETURN(IntKillTimer(hWnd, uIDEvent, FALSE)); + Window = UserGetWindowObject(hWnd); + + RETURN(IntKillTimer(Window, uIDEvent, FALSE)); CLEANUP: DPRINT("Leave NtUserKillTimer, ret=%i\n", _ret_); @@ -617,7 +715,7 @@ NtUserSetSystemTimer( UserEnterExclusive(); // This is wrong, lpTimerFunc is NULL! - RETURN(IntSetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc, TRUE)); + RETURN(IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, lpTimerFunc, TMRF_SYSTEM)); CLEANUP: DPRINT("Leave NtUserSetSystemTimer, ret=%i\n", _ret_); diff --git a/subsystems/win32/win32k/ntuser/useratom.c b/subsystems/win32/win32k/ntuser/useratom.c index 61b41648600..ca72f6143d5 100644 --- a/subsystems/win32/win32k/ntuser/useratom.c +++ b/subsystems/win32/win32k/ntuser/useratom.c @@ -24,7 +24,7 @@ * PROGRAMER: Filip Navara */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/vis.c b/subsystems/win32/win32k/ntuser/vis.c index f82ed555b72..d82e384cbf2 100644 --- a/subsystems/win32/win32k/ntuser/vis.c +++ b/subsystems/win32/win32k/ntuser/vis.c @@ -24,7 +24,7 @@ * PROGRAMMER: Ge van Geldorp (ge@gse.nl) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/ntuser/windc.c b/subsystems/win32/win32k/ntuser/windc.c index bde42e1396c..ed49ac6a920 100644 --- a/subsystems/win32/win32k/ntuser/windc.c +++ b/subsystems/win32/win32k/ntuser/windc.c @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -736,7 +736,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window) else { DPRINT1("Not POWNED or CLASSDC hwndCurrent -> %x \n", pDCE->hwndCurrent); - ASSERT(FALSE); + //ASSERT(FALSE); } } else diff --git a/subsystems/win32/win32k/ntuser/window.c b/subsystems/win32/win32k/ntuser/window.c index 4445fff8fed..e9f64d292f4 100644 --- a/subsystems/win32/win32k/ntuser/window.c +++ b/subsystems/win32/win32k/ntuser/window.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -1660,7 +1660,7 @@ IntCalcDefPosSize(PWINDOW_OBJECT Parent, RECTL *rc, BOOL IncPos) PWND APIENTRY co_IntCreateWindowEx(DWORD dwExStyle, PUNICODE_STRING ClassName, - PUNICODE_STRING WindowName, + PLARGE_STRING WindowName, DWORD dwStyle, LONG x, LONG y, @@ -1998,14 +1998,18 @@ AllocErr: else dwExStyle &= ~WS_EX_WINDOWEDGE; + dwExStyle &= ~WS_EX_SETANSICREATOR; + + Wnd->style = dwStyle & ~WS_VISIBLE; + /* Correct the window style. */ - if (!(dwStyle & WS_CHILD)) + if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD) { - dwStyle |= WS_CLIPSIBLINGS; + Wnd->style |= WS_CLIPSIBLINGS; DPRINT("3: Style is now %lx\n", dwStyle); - if (!(dwStyle & WS_POPUP)) + if (!(Wnd->style & WS_POPUP)) { - dwStyle |= WS_CAPTION; + Wnd->style |= WS_CAPTION; Window->state |= WINDOWOBJECT_NEED_SIZE; DPRINT("4: Style is now %lx\n", dwStyle); } @@ -2066,7 +2070,6 @@ AllocErr: Size.cy = nHeight; Wnd->ExStyle = dwExStyle; - Wnd->style = dwStyle & ~WS_VISIBLE; /* call hook */ Cs.lpCreateParams = lpParam; @@ -2099,6 +2102,8 @@ AllocErr: y = Cs.y; nWidth = Cs.cx; nHeight = Cs.cy; + + Cs.style = dwStyle; // FIXME: Need to set the Z order in the window link list if the hook callback changed it! // hwndInsertAfter = CbtCreate.hwndInsertAfter; @@ -2109,7 +2114,7 @@ AllocErr: PRTL_USER_PROCESS_PARAMETERS ProcessParams; BOOL CalculatedDefPosSize = FALSE; - IntGetDesktopWorkArea(Window->pti->rpdesk, &WorkArea); + UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0); rc = WorkArea; ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters; @@ -2216,22 +2221,16 @@ AllocErr: POINT MaxSize, MaxPos, MinTrack, MaxTrack; /* WinPosGetMinMaxInfo sends the WM_GETMINMAXINFO message */ - co_WinPosGetMinMaxInfo(Window, &MaxSize, &MaxPos, &MinTrack, - &MaxTrack); - if (MaxSize.x < Size.cx) - Size.cx = MaxSize.x; - if (MaxSize.y < Size.cy) - Size.cy = MaxSize.y; - if (Size.cx < MinTrack.x ) - Size.cx = MinTrack.x; - if (Size.cy < MinTrack.y ) - Size.cy = MinTrack.y; - if (Size.cx < 0) - Size.cx = 0; - if (Size.cy < 0) - Size.cy = 0; + co_WinPosGetMinMaxInfo(Window, &MaxSize, &MaxPos, &MinTrack, &MaxTrack); + if (Size.cx > MaxTrack.x) Size.cx = MaxTrack.x; + if (Size.cy > MaxTrack.y) Size.cy = MaxTrack.y; + if (Size.cx < MinTrack.x) Size.cx = MinTrack.x; + if (Size.cy < MinTrack.y) Size.cy = MinTrack.y; } + if (Size.cx < 0) Size.cx = 0; + if (Size.cy < 0) Size.cy = 0; + Wnd->rcWindow.left = Pos.x; Wnd->rcWindow.top = Pos.y; Wnd->rcWindow.right = Pos.x + Size.cx; @@ -2246,11 +2245,6 @@ AllocErr: /* FIXME: Initialize the window menu. */ /* Send a NCCREATE message. */ - Cs.cx = Size.cx; - Cs.cy = Size.cy; - Cs.x = Pos.x; - Cs.y = Pos.y; - DPRINT("[win32k.window] IntCreateWindowEx style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent); DPRINT("IntCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, Size.cx, Size.cy); DPRINT("IntCreateWindowEx(): About to send NCCREATE message.\n"); @@ -2333,6 +2327,11 @@ AllocErr: IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0); + /* By setting the flag below it can be examined to determine if the window + was created successfully and a valid pwnd was passed back to caller since + from here the function has to succeed. */ + Window->Wnd->state2 |= WNDS2_WMCREATEMSGPROCESSED; + /* Send move and size messages. */ if (!(Window->state & WINDOWOBJECT_NEED_SIZE)) { @@ -2488,106 +2487,166 @@ CLEANUP: END_CLEANUP; } -HWND APIENTRY -NtUserCreateWindowEx(DWORD dwExStyle, - PUNICODE_STRING UnsafeClassName, - PUNICODE_STRING UnsafeWindowName, - DWORD dwStyle, - LONG x, - LONG y, - LONG nWidth, - LONG nHeight, - HWND hWndParent, - HMENU hMenu, - HINSTANCE hInstance, - LPVOID lpParam, - DWORD dwShowMode, - BOOL bUnicodeWindow, - DWORD dwUnknown) +NTSTATUS +NTAPI +ProbeAndCaptureLargeString( + OUT PLARGE_STRING plstrSafe, + IN PLARGE_STRING plstrUnsafe) { - NTSTATUS Status; - UNICODE_STRING WindowName; - UNICODE_STRING ClassName; - HWND NewWindow = NULL; - PWND pNewWindow; - DECLARE_RETURN(HWND); + LARGE_STRING lstrTemp; + PVOID pvBuffer = NULL; - DPRINT("Enter NtUserCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, nWidth, nHeight); - UserEnterExclusive(); + _SEH2_TRY + { + /* Probe and copy the string */ + ProbeForRead(plstrUnsafe, sizeof(LARGE_STRING), sizeof(ULONG)); + lstrTemp = *plstrUnsafe; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Fail */ + _SEH2_YIELD(return _SEH2_GetExceptionCode();) + } + _SEH2_END - /* Get the class name (string or atom) */ - Status = MmCopyFromCaller(&ClassName, UnsafeClassName, sizeof(UNICODE_STRING)); - if (! NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN( NULL); - } - if (ClassName.Length != 0) - { - Status = IntSafeCopyUnicodeStringTerminateNULL(&ClassName, UnsafeClassName); - if (! NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN( NULL); - } - } - else if (! IS_ATOM(ClassName.Buffer)) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - RETURN(NULL); - } + if (lstrTemp.Length != 0) + { + /* Allocate a buffer from paged pool */ + pvBuffer = ExAllocatePoolWithTag(PagedPool, lstrTemp.Length, TAG_STRING); + if (!pvBuffer) + { + return STATUS_NO_MEMORY; + } - /* safely copy the window name */ - if (NULL != UnsafeWindowName) - { - Status = IntSafeCopyUnicodeString(&WindowName, UnsafeWindowName); - if (! NT_SUCCESS(Status)) - { - if (! IS_ATOM(ClassName.Buffer)) - { - ExFreePoolWithTag(ClassName.Buffer, TAG_STRING); - } - SetLastNtError(Status); - RETURN( NULL); - } - } - else - { - RtlInitUnicodeString(&WindowName, NULL); - } + _SEH2_TRY + { + /* Probe and copy the buffer */ + ProbeForRead(lstrTemp.Buffer, lstrTemp.Length, sizeof(WCHAR)); + RtlCopyMemory(pvBuffer, lstrTemp.Buffer, lstrTemp.Length); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Cleanup and fail */ + ExFreePool(pvBuffer); + _SEH2_YIELD(return _SEH2_GetExceptionCode();) + } + _SEH2_END + } - pNewWindow = co_IntCreateWindowEx( dwExStyle, - &ClassName, - &WindowName, - dwStyle, - x, - y, - nWidth, - nHeight, - hWndParent, - hMenu, - hInstance, - lpParam, - dwShowMode, - bUnicodeWindow); + /* Set the output string */ + plstrSafe->Buffer = pvBuffer; + plstrSafe->Length = lstrTemp.Length; + plstrSafe->MaximumLength = lstrTemp.Length; - if (pNewWindow) NewWindow = UserHMGetHandle(pNewWindow); + return STATUS_SUCCESS; +} - if (WindowName.Buffer) - { - ExFreePoolWithTag(WindowName.Buffer, TAG_STRING); - } - if (! IS_ATOM(ClassName.Buffer)) - { - ExFreePoolWithTag(ClassName.Buffer, TAG_STRING); - } +/** + * \todo Allow passing plstrClassName as ANSI. + */ +HWND +NTAPI +NtUserCreateWindowEx( + DWORD dwExStyle, + PLARGE_STRING plstrClassName, + PLARGE_STRING plstrClsVersion, + PLARGE_STRING plstrWindowName, + DWORD dwStyle, + int x, + int y, + int nWidth, + int nHeight, + HWND hWndParent, + HMENU hMenu, + HINSTANCE hInstance, + LPVOID lpParam, + DWORD dwFlags, + PVOID acbiBuffer) +{ + NTSTATUS Status; + LARGE_STRING lstrWindowName; + LARGE_STRING lstrClassName; + UNICODE_STRING ustrClassName; + HWND hwnd = NULL; + PWND pwnd; - RETURN( NewWindow); + DPRINT("Enter NtUserCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, nWidth, nHeight); + UserEnterExclusive(); -CLEANUP: - DPRINT("Leave NtUserCreateWindowEx, ret=%i\n",_ret_); + lstrWindowName.Buffer = NULL; + lstrClassName.Buffer = NULL; + + /* Check if we got a Window name */ + if (plstrWindowName) + { + /* Copy the string to kernel mode */ + Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName); + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + goto leave; + } + plstrWindowName = &lstrWindowName; + } + + /* Check if the class is an atom */ + if (IS_ATOM(plstrClassName)) + { + /* It is, pass the atom in the UNICODE_STRING */ + ustrClassName.Buffer = (PVOID)plstrClassName; + ustrClassName.Length = 0; + ustrClassName.MaximumLength = 0; + } + else + { + /* It's not, capture the class name */ + Status = ProbeAndCaptureLargeString(&lstrClassName, plstrClassName); + if (!NT_SUCCESS(Status)) + { + /* Set last error, cleanup and return */ + SetLastNtError(Status); + goto cleanup; + } + + /* We pass it on as a UNICODE_STRING */ + ustrClassName.Buffer = lstrClassName.Buffer; + ustrClassName.Length = lstrClassName.Length; + ustrClassName.MaximumLength = lstrClassName.MaximumLength; + } + + /* Call the internal function */ + pwnd = co_IntCreateWindowEx(dwExStyle, + &ustrClassName, + plstrWindowName, + dwStyle, + x, + y, + nWidth, + nHeight, + hWndParent, + hMenu, + hInstance, + lpParam, + SW_SHOW, + !(dwExStyle & WS_EX_SETANSICREATOR)); + + hwnd = pwnd ? UserHMGetHandle(pwnd) : NULL; + +cleanup: + if (lstrWindowName.Buffer) + { + ExFreePoolWithTag(lstrWindowName.Buffer, TAG_STRING); + } + if (lstrClassName.Buffer) + { + ExFreePoolWithTag(lstrClassName.Buffer, TAG_STRING); + } + +leave: + DPRINT("Leave NtUserCreateWindowEx, hwnd=%i\n", hwnd); UserLeave(); - END_CLEANUP; + + return hwnd; } /* @@ -2614,6 +2673,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) BOOLEAN isChild; PWND Wnd; HWND hWnd; + PTHREADINFO ti; ASSERT_REFS_CO(Window); // FIXME: temp hack? @@ -2633,8 +2693,8 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) return FALSE; } - /* Call hooks */ - if (ISITHOOKED(WH_CBT)) + /* If window was created successfully and it is hooked */ + if ((Wnd->state2 & WNDS2_WMCREATEMSGPROCESSED) && (ISITHOOKED(WH_CBT))) { if (co_HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hWnd, 0)) return FALSE; } @@ -2657,6 +2717,21 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) if (Window->pti->MessageQueue->CaptureWindow == Window->hSelf) Window->pti->MessageQueue->CaptureWindow = NULL; + /* + * Check if this window is the Shell's Desktop Window. If so set hShellWindow to NULL + */ + + ti = PsGetCurrentThreadWin32Thread(); + + if ((ti != NULL) & (ti->pDeskInfo != NULL)) + { + if (ti->pDeskInfo->hShellWindow == hWnd) + { + DPRINT1("Destroying the ShellWindow!\n"); + ti->pDeskInfo->hShellWindow = NULL; + } + } + IntDereferenceMessageQueue(Window->pti->MessageQueue); IntEngWindowChanged(Window, WOC_DELETE); @@ -2839,6 +2914,7 @@ IntFindWindow(PWINDOW_OBJECT Parent, BOOL CheckWindowName; HWND *List, *phWnd; HWND Ret = NULL; + UNICODE_STRING CurrentWindowName; ASSERT(Parent); @@ -2866,13 +2942,20 @@ IntFindWindow(PWINDOW_OBJECT Parent, /* Do not send WM_GETTEXT messages in the kernel mode version! The user mode version however calls GetWindowText() which will send WM_GETTEXT messages to windows belonging to its processes */ - if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->Wnd->strName), TRUE)) && - (!ClassAtom || Child->Wnd->pcls->atomClassName == ClassAtom)) + if (!ClassAtom || Child->Wnd->pcls->atomClassName == ClassAtom) { - Ret = Child->hSelf; - break; + // HACK: use UNICODE_STRING instead of LARGE_STRING + CurrentWindowName.Buffer = Child->Wnd->strName.Buffer; + CurrentWindowName.Length = Child->Wnd->strName.Length; + CurrentWindowName.MaximumLength = Child->Wnd->strName.MaximumLength; + if(!CheckWindowName || + (Child->Wnd->strName.Length < 0xFFFF && + !RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE))) + { + Ret = Child->hSelf; + break; + } } - } ExFreePool(List); } @@ -3029,6 +3112,8 @@ NtUserFindWindowEx(HWND hwndParent, /* search children */ while(*phWnd) { + UNICODE_STRING ustr; + if(!(TopLevelWindow = UserGetWindowObject(*(phWnd++)))) { continue; @@ -3037,8 +3122,12 @@ NtUserFindWindowEx(HWND hwndParent, /* Do not send WM_GETTEXT messages in the kernel mode version! The user mode version however calls GetWindowText() which will send WM_GETTEXT messages to windows belonging to its processes */ - WindowMatches = !CheckWindowName || !RtlCompareUnicodeString( - &WindowName, &TopLevelWindow->Wnd->strName, TRUE); + ustr.Buffer = TopLevelWindow->Wnd->strName.Buffer; + ustr.Length = TopLevelWindow->Wnd->strName.Length; + ustr.MaximumLength = TopLevelWindow->Wnd->strName.MaximumLength; + WindowMatches = !CheckWindowName || + (TopLevelWindow->Wnd->strName.Length < 0xFFFF && + !RtlCompareUnicodeString(&WindowName, &ustr, TRUE)); ClassMatches = (ClassAtom == (RTL_ATOM)0) || ClassAtom == TopLevelWindow->Wnd->pcls->atomClassName; @@ -4263,8 +4352,8 @@ NtUserRegisterWindowMessage(PUNICODE_STRING MessageNameUnsafe) } Ret = (UINT)IntAddAtom(SafeMessageName.Buffer); - - ExFreePoolWithTag(SafeMessageName.Buffer, TAG_STRING); + if (SafeMessageName.Buffer) + ExFreePoolWithTag(SafeMessageName.Buffer, TAG_STRING); RETURN( Ret); CLEANUP: diff --git a/subsystems/win32/win32k/ntuser/winpos.c b/subsystems/win32/win32k/ntuser/winpos.c index 13c58617279..67e5eadc92f 100644 --- a/subsystems/win32/win32k/ntuser/winpos.c +++ b/subsystems/win32/win32k/ntuser/winpos.c @@ -27,7 +27,7 @@ */ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include @@ -69,9 +69,6 @@ IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point) return TRUE; } - - - BOOL FASTCALL UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point) { @@ -120,8 +117,13 @@ BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL) style = Wnd->Wnd->style; if (!(style & WS_VISIBLE) && Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE; + if ((style & WS_MINIMIZE) && + Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE; if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE; - return !(style & WS_DISABLED); + return TRUE; + /* FIXME: This window could be disable because the child that closed + was a popup. */ + //return !(style & WS_DISABLED); } @@ -256,19 +258,17 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect) if (!Wnd->InternalPosInitialized) { RECTL WorkArea; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */ Parent = Window->spwndParent; if(Parent) { if(IntIsDesktopWindow(Parent)) - IntGetDesktopWorkArea(Desktop, &WorkArea); + UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0); else WorkArea = Parent->Wnd->rcClient; } else - IntGetDesktopWorkArea(Desktop, &WorkArea); + UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0); Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow; IntGetWindowBorderMeasures(Window, &XInc, &YInc); @@ -312,7 +312,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos) if (Wnd->style & WS_MINIMIZE) { - if (!co_IntSendMessage(Window->hSelf, WM_QUERYOPEN, 0, 0)) + if (!co_IntSendMessageNoWait(Window->hSelf, WM_QUERYOPEN, 0, 0)) { return(SWP_NOSIZE | SWP_NOMOVE); } @@ -398,36 +398,72 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos) return(SwpFlags); } -static -VOID FASTCALL -WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info) +BOOL +UserHasWindowEdge(DWORD Style, DWORD ExStyle) { - UINT XInc, YInc; - RECTL WorkArea; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */ + if (Style & WS_MINIMIZE) + return TRUE; + if (ExStyle & WS_EX_DLGMODALFRAME) + return TRUE; + if (ExStyle & WS_EX_STATICEDGE) + return FALSE; + if (Style & WS_THICKFRAME) + return TRUE; + Style &= WS_CAPTION; + if (Style == WS_DLGFRAME || Style == WS_CAPTION) + return TRUE; + return FALSE; +} - IntGetDesktopWorkArea(Desktop, &WorkArea); +VOID +UserGetWindowBorders(DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient) +{ + DWORD Border = 0; - /* Get default values. */ - Info->ptMinTrackSize.x = UserGetSystemMetrics(SM_CXMINTRACK); - Info->ptMinTrackSize.y = UserGetSystemMetrics(SM_CYMINTRACK); - - IntGetWindowBorderMeasures(Window, &XInc, &YInc); - Info->ptMaxSize.x = WorkArea.right - WorkArea.left + 2 * XInc; - Info->ptMaxSize.y = WorkArea.bottom - WorkArea.top + 2 * YInc; - Info->ptMaxTrackSize.x = Info->ptMaxSize.x; - Info->ptMaxTrackSize.y = Info->ptMaxSize.y; - - if (Window->Wnd->InternalPosInitialized) + if (UserHasWindowEdge(Style, ExStyle)) + Border += 2; + else if (ExStyle & WS_EX_STATICEDGE) + Border += 1; + if ((ExStyle & WS_EX_CLIENTEDGE) && WithClient) + Border += 2; + if (Style & WS_CAPTION || ExStyle & WS_EX_DLGMODALFRAME) + Border ++; + Size->cx = Size->cy = Border; + if ((Style & WS_THICKFRAME) && !(Style & WS_MINIMIZE)) { - Info->ptMaxPosition = Window->Wnd->InternalPos.MaxPos; + Size->cx += UserGetSystemMetrics(SM_CXFRAME) - UserGetSystemMetrics(SM_CXDLGFRAME); + Size->cy += UserGetSystemMetrics(SM_CYFRAME) - UserGetSystemMetrics(SM_CYDLGFRAME); } - else + Size->cx *= UserGetSystemMetrics(SM_CXBORDER); + Size->cy *= UserGetSystemMetrics(SM_CYBORDER); +} + +BOOL WINAPI +UserAdjustWindowRectEx(LPRECT lpRect, + DWORD dwStyle, + BOOL bMenu, + DWORD dwExStyle) +{ + SIZE BorderSize; + + if (bMenu) { - Info->ptMaxPosition.x = WorkArea.left - XInc; - Info->ptMaxPosition.y = WorkArea.top - YInc; + lpRect->top -= UserGetSystemMetrics(SM_CYMENU); } + if ((dwStyle & WS_CAPTION) == WS_CAPTION) + { + if (dwExStyle & WS_EX_TOOLWINDOW) + lpRect->top -= UserGetSystemMetrics(SM_CYSMCAPTION); + else + lpRect->top -= UserGetSystemMetrics(SM_CYCAPTION); + } + UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE); + RECTL_vInflateRect( + lpRect, + BorderSize.cx, + BorderSize.cy); + + return TRUE; } UINT FASTCALL @@ -435,13 +471,81 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos, POINT* MinTrack, POINT* MaxTrack) { MINMAXINFO MinMax; + PMONITOR monitor; + INT xinc, yinc; + LONG style = Window->Wnd->style; + LONG adjustedStyle; + LONG exstyle = Window->Wnd->ExStyle; + RECT rc; - ASSERT_REFS_CO(Window); + ASSERT_REFS_CO(Window); - WinPosFillMinMaxInfoStruct(Window, &MinMax); + /* Compute default values */ + + rc = Window->Wnd->rcWindow; + MinMax.ptReserved.x = rc.left; + MinMax.ptReserved.y = rc.top; + + if ((style & WS_CAPTION) == WS_CAPTION) + adjustedStyle = style & ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */ + else + adjustedStyle = style; + + if(Window->Wnd->spwndParent) + IntGetClientRect(Window->spwndParent, &rc); + UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->Wnd->IDMenu), exstyle); + + xinc = -rc.left; + yinc = -rc.top; + + MinMax.ptMaxSize.x = rc.right - rc.left; + MinMax.ptMaxSize.y = rc.bottom - rc.top; + if (style & (WS_DLGFRAME | WS_BORDER)) + { + MinMax.ptMinTrackSize.x = UserGetSystemMetrics(SM_CXMINTRACK); + MinMax.ptMinTrackSize.y = UserGetSystemMetrics(SM_CYMINTRACK); + } + else + { + MinMax.ptMinTrackSize.x = 2 * xinc; + MinMax.ptMinTrackSize.y = 2 * yinc; + } + MinMax.ptMaxTrackSize.x = UserGetSystemMetrics(SM_CXMAXTRACK); + MinMax.ptMaxTrackSize.y = UserGetSystemMetrics(SM_CYMAXTRACK); + MinMax.ptMaxPosition.x = -xinc; + MinMax.ptMaxPosition.y = -yinc; + + //if (!EMPTYPOINT(win->max_pos)) MinMax.ptMaxPosition = win->max_pos; co_IntSendMessage(Window->hSelf, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); + /* if the app didn't change the values, adapt them for the current monitor */ + if ((monitor = IntGetPrimaryMonitor())) + { + RECT rc_work; + + rc_work = monitor->rcMonitor; + + if (style & WS_MAXIMIZEBOX) + { + if ((style & WS_CAPTION) == WS_CAPTION || !(style & (WS_CHILD | WS_POPUP))) + rc_work = monitor->rcWork; + } + + if (MinMax.ptMaxSize.x == UserGetSystemMetrics(SM_CXSCREEN) + 2 * xinc && + MinMax.ptMaxSize.y == UserGetSystemMetrics(SM_CYSCREEN) + 2 * yinc) + { + MinMax.ptMaxSize.x = (rc_work.right - rc_work.left) + 2 * xinc; + MinMax.ptMaxSize.y = (rc_work.bottom - rc_work.top) + 2 * yinc; + } + if (MinMax.ptMaxPosition.x == -xinc && MinMax.ptMaxPosition.y == -yinc) + { + MinMax.ptMaxPosition.x = rc_work.left - xinc; + MinMax.ptMaxPosition.y = rc_work.top - yinc; + } + } + + MinMax.ptMaxTrackSize.x = max(MinMax.ptMaxTrackSize.x, MinMax.ptMinTrackSize.x); MinMax.ptMaxTrackSize.y = max(MinMax.ptMaxTrackSize.y, @@ -531,7 +635,7 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos, params.lppos = &winposCopy; winposCopy = *WinPos; - wvrFlags = co_IntSendMessage(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms); + wvrFlags = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms); /* If the application send back garbage, ignore it */ if (params.rgrc[0].left <= params.rgrc[0].right && @@ -590,7 +694,7 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window, if (!(WinPos->flags & SWP_NOSENDCHANGING)) { - co_IntPostOrSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); + co_IntSendMessageNoWait(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); } *WindowRect = Wnd->rcWindow; @@ -1320,7 +1424,7 @@ co_WinPosSetWindowPos( { if ((Window->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD) { - co_IntSendMessage(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0); + co_IntSendMessageNoWait(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0); } else { @@ -1330,7 +1434,16 @@ co_WinPosSetWindowPos( } if ((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE) - co_IntPostOrSendMessage(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM) &WinPos); + { + /* WM_WINDOWPOSCHANGED is sent even if SWP_NOSENDCHANGING is set + and always contains final window position. + */ + WinPos.x = NewWindowRect.left; + WinPos.y = NewWindowRect.top; + WinPos.cx = NewWindowRect.right - NewWindowRect.left; + WinPos.cy = NewWindowRect.bottom - NewWindowRect.top; + co_IntSendMessageNoWait(WinPos.hwnd, WM_WINDOWPOSCHANGED, 0, (LPARAM) &WinPos); + } return TRUE; } @@ -1343,7 +1456,7 @@ co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientR ASSERT_REFS_CO(Window); *ClientRect = *WindowRect; - Result = co_IntSendMessage(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect); + Result = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect); FixClientRect(ClientRect, WindowRect); @@ -1462,7 +1575,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) if (ShowFlag != WasVisible) { - co_IntSendMessage(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0); + co_IntSendMessageNoWait(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0); } /* We can't activate a child window */ @@ -1476,7 +1589,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) ? HWND_TOPMOST : HWND_TOP, NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, LOWORD(Swp)); - if (Cmd == SW_HIDE) + if ((Cmd == SW_HIDE) || (Cmd == SW_MINIMIZE)) { PWINDOW_OBJECT ThreadFocusWindow; @@ -1520,12 +1633,12 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd) wParam = SIZE_MINIMIZED; } - co_IntSendMessage(Window->hSelf, WM_SIZE, wParam, + co_IntSendMessageNoWait(Window->hSelf, WM_SIZE, wParam, MAKELONG(Wnd->rcClient.right - Wnd->rcClient.left, Wnd->rcClient.bottom - Wnd->rcClient.top)); - co_IntSendMessage(Window->hSelf, WM_MOVE, 0, + co_IntSendMessageNoWait(Window->hSelf, WM_MOVE, 0, MAKELONG(Wnd->rcClient.left, Wnd->rcClient.top)); IntEngWindowChanged(Window, WOC_RGN_CLIENT); @@ -1734,15 +1847,9 @@ NtUserGetMinMaxInfo( WinPosInitInternalPos(Window, &Size, &Wnd->rcWindow); - if(SendMessage) - { - co_WinPosGetMinMaxInfo(Window, &SafeMinMax.ptMaxSize, &SafeMinMax.ptMaxPosition, - &SafeMinMax.ptMinTrackSize, &SafeMinMax.ptMaxTrackSize); - } - else - { - WinPosFillMinMaxInfoStruct(Window, &SafeMinMax); - } + co_WinPosGetMinMaxInfo(Window, &SafeMinMax.ptMaxSize, &SafeMinMax.ptMaxPosition, + &SafeMinMax.ptMinTrackSize, &SafeMinMax.ptMaxTrackSize); + Status = MmCopyToCaller(MinMaxInfo, &SafeMinMax, sizeof(MINMAXINFO)); if(!NT_SUCCESS(Status)) { diff --git a/subsystems/win32/win32k/ntuser/winsta.c b/subsystems/win32/win32k/ntuser/winsta.c index a379a2f2655..2d26c8d39b7 100644 --- a/subsystems/win32/win32k/ntuser/winsta.c +++ b/subsystems/win32/win32k/ntuser/winsta.c @@ -33,7 +33,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/arc.c b/subsystems/win32/win32k/objects/arc.c index e1bbc89ea65..58393036608 100644 --- a/subsystems/win32/win32k/objects/arc.c +++ b/subsystems/win32/win32k/objects/arc.c @@ -1,4 +1,4 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/bezier.c b/subsystems/win32/win32k/objects/bezier.c index 0071015ebe2..3e20c292590 100644 --- a/subsystems/win32/win32k/objects/bezier.c +++ b/subsystems/win32/win32k/objects/bezier.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/bitblt.c b/subsystems/win32/win32k/objects/bitblt.c index a02d652ce1e..6261ab46697 100644 --- a/subsystems/win32/win32k/objects/bitblt.c +++ b/subsystems/win32/win32k/objects/bitblt.c @@ -18,7 +18,7 @@ */ /* $Id: bitmaps.c 28300 2007-08-12 15:20:09Z tkreuzer $ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/bitmaps.c b/subsystems/win32/win32k/objects/bitmaps.c index 658b53dbb17..f471a67e502 100644 --- a/subsystems/win32/win32k/objects/bitmaps.c +++ b/subsystems/win32/win32k/objects/bitmaps.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/brush.c b/subsystems/win32/win32k/objects/brush.c index f45f6fbcdd4..c8682f6a849 100644 --- a/subsystems/win32/win32k/objects/brush.c +++ b/subsystems/win32/win32k/objects/brush.c @@ -6,7 +6,7 @@ * PROGRAMER: */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/cliprgn.c b/subsystems/win32/win32k/objects/cliprgn.c index acfc99b9a3f..c5297c38ba2 100644 --- a/subsystems/win32/win32k/objects/cliprgn.c +++ b/subsystems/win32/win32k/objects/cliprgn.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/coord.c b/subsystems/win32/win32k/objects/coord.c index 0ae25bcc10d..7310dcb1adc 100644 --- a/subsystems/win32/win32k/objects/coord.c +++ b/subsystems/win32/win32k/objects/coord.c @@ -27,7 +27,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/dcattr.c b/subsystems/win32/win32k/objects/dcattr.c index 562d75473d6..9b445b1490c 100644 --- a/subsystems/win32/win32k/objects/dcattr.c +++ b/subsystems/win32/win32k/objects/dcattr.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/dclife.c b/subsystems/win32/win32k/objects/dclife.c index 1fe51886b2a..3791a6aaeb8 100644 --- a/subsystems/win32/win32k/objects/dclife.c +++ b/subsystems/win32/win32k/objects/dclife.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org) */ -#include +#include #include #define NDEBUG diff --git a/subsystems/win32/win32k/objects/dcobjs.c b/subsystems/win32/win32k/objects/dcobjs.c index e35fa717bdd..0bafaadd159 100644 --- a/subsystems/win32/win32k/objects/dcobjs.c +++ b/subsystems/win32/win32k/objects/dcobjs.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org) */ -#include +#include #define NDEBUG #include @@ -110,6 +110,9 @@ DC_vUpdateTextBrush(PDC pdc) { PDC_ATTR pdcattr = pdc->pdcattr; + if(pdcattr->ulDirty_ & DIRTY_TEXT) + EBRUSHOBJ_vUpdate(&pdc->eboText, pdc->eboText.pbrush, pdc); + /* Update the eboText's solid color */ EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboText, pdcattr->crForegroundClr); @@ -123,6 +126,9 @@ DC_vUpdateBackgroundBrush(PDC pdc) { PDC_ATTR pdcattr = pdc->pdcattr; + if(pdcattr->ulDirty_ & DIRTY_BACKGROUND) + EBRUSHOBJ_vUpdate(&pdc->eboBackground, pdc->eboBackground.pbrush, pdc); + /* Update the eboBackground's solid color */ EBRUSHOBJ_vSetSolidBrushColor(&pdc->eboBackground, pdcattr->crBackgroundClr); diff --git a/subsystems/win32/win32k/objects/dcstate.c b/subsystems/win32/win32k/objects/dcstate.c index 9e491a4f0b1..1b97ae7aca9 100644 --- a/subsystems/win32/win32k/objects/dcstate.c +++ b/subsystems/win32/win32k/objects/dcstate.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/dcutil.c b/subsystems/win32/win32k/objects/dcutil.c index a8c28ecb348..f856ea19bda 100644 --- a/subsystems/win32/win32k/objects/dcutil.c +++ b/subsystems/win32/win32k/objects/dcutil.c @@ -1,5 +1,5 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/device.c b/subsystems/win32/win32k/objects/device.c index b1158471282..b8d322f09ac 100644 --- a/subsystems/win32/win32k/objects/device.c +++ b/subsystems/win32/win32k/objects/device.c @@ -6,7 +6,7 @@ * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org) */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/dibobj.c b/subsystems/win32/win32k/objects/dibobj.c index cc2a16efb2f..2ec35e6ee4a 100644 --- a/subsystems/win32/win32k/objects/dibobj.c +++ b/subsystems/win32/win32k/objects/dibobj.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/drawing.c b/subsystems/win32/win32k/objects/drawing.c index 073ee1a97f7..0cc9a23200d 100755 --- a/subsystems/win32/win32k/objects/drawing.c +++ b/subsystems/win32/win32k/objects/drawing.c @@ -49,7 +49,7 @@ SUCH DAMAGE. Modified for ReactOS */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/fillshap.c b/subsystems/win32/win32k/objects/fillshap.c index 7da05400637..aa133f87f52 100644 --- a/subsystems/win32/win32k/objects/fillshap.c +++ b/subsystems/win32/win32k/objects/fillshap.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/font.c b/subsystems/win32/win32k/objects/font.c index 6127d835f42..a0837e1d24a 100644 --- a/subsystems/win32/win32k/objects/font.c +++ b/subsystems/win32/win32k/objects/font.c @@ -8,7 +8,7 @@ /** Includes ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/freetype.c b/subsystems/win32/win32k/objects/freetype.c index fea0c101ee9..478863d6c13 100644 --- a/subsystems/win32/win32k/objects/freetype.c +++ b/subsystems/win32/win32k/objects/freetype.c @@ -35,7 +35,7 @@ /** Includes ******************************************************************/ -#include +#include #include #include FT_FREETYPE_H diff --git a/subsystems/win32/win32k/objects/gdibatch.c b/subsystems/win32/win32k/objects/gdibatch.c index ac174e971fb..11d3628b67d 100644 --- a/subsystems/win32/win32k/objects/gdibatch.c +++ b/subsystems/win32/win32k/objects/gdibatch.c @@ -1,5 +1,5 @@ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/gdidbg.c b/subsystems/win32/win32k/objects/gdidbg.c index a9991ad3610..efa686fc06b 100644 --- a/subsystems/win32/win32k/objects/gdidbg.c +++ b/subsystems/win32/win32k/objects/gdidbg.c @@ -3,23 +3,48 @@ #define KeRosDumpStackFrames(Frames, Count) KdSystemDebugControl('DsoR', (PVOID)Frames, Count, NULL, 0, NULL, KernelMode) NTSYSAPI ULONG APIENTRY RtlWalkFrameChain(OUT PVOID *Callers, IN ULONG Count, IN ULONG Flags); -static int leak_reported = 0; -#define GDI_STACK_LEVELS 12 -static ULONG GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +#define GDI_STACK_LEVELS 20 +static ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +static ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +static ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +static ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; struct DbgOpenGDIHandle { ULONG idx; int count; }; -#define H 1024 -static struct DbgOpenGDIHandle h[H]; +#define MAX_BACKTRACES 1024 +static struct DbgOpenGDIHandle AllocatorTable[MAX_BACKTRACES]; + +static +BOOL +CompareBacktraces(ULONG idx1, ULONG idx2) +{ + ULONG iLevel; + + /* Loop all stack levels */ + for (iLevel = 0; iLevel < GDI_STACK_LEVELS; iLevel++) + { + if (GDIHandleAllocator[idx1][iLevel] + != GDIHandleAllocator[idx2][iLevel]) +// if (GDIHandleShareLocker[idx1][iLevel] +// != GDIHandleShareLocker[idx2][iLevel]) + { + return FALSE; + } + } + + return TRUE; +} + +#define IS_HANDLE_VALID(idx) \ + ((GdiHandleTable->Entries[idx].Type & GDI_ENTRY_BASETYPE_MASK) != 0) void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) { - int i, n = 0, j, k, J; + static int leak_reported = 0; + int i, j, idx, nTraces = 0; + KIRQL OldIrql; if (leak_reported) { @@ -30,68 +55,79 @@ void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable) leak_reported = 1; DPRINT1("reporting gdi handle abusers:\n"); - /* step through GDI handle table and find out who our culprit is... */ - for (i = RESERVE_ENTRIES_COUNT; i < GDI_HANDLE_COUNT; i++) + /* We've got serious business to do */ + KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); + + /* Step through GDI handle table and find out who our culprit is... */ + for (idx = RESERVE_ENTRIES_COUNT; idx < GDI_HANDLE_COUNT; idx++) { - for (j = 0; j < n; j++) + /* If the handle is free, continue */ + if (!IS_HANDLE_VALID(idx)) continue; + + /* Step through all previous backtraces */ + for (j = 0; j < nTraces; j++) { -next: - J = h[j].idx; - for (k = 0; k < GDI_STACK_LEVELS; k++) + /* Check if the backtrace matches */ + if (CompareBacktraces(idx, AllocatorTable[j].idx)) { - if (GDIHandleAllocator[i][k] - != GDIHandleAllocator[J][k]) - { - if (++j == n) - goto done; - else - goto next; - } + /* It matches, increment count and break out */ + AllocatorTable[j].count++; + break; } - goto done; } -done: - if (j < H) + + /* Did we find a new backtrace? */ + if (j == nTraces) { - if (j == n) - { - h[j].idx = i; - h[j].count = 1; - n = n + 1; - } - else - h[j].count++; + /* Break out, if we reached the maximum */ + if (nTraces == MAX_BACKTRACES) break; + + /* Initialize this entry */ + AllocatorTable[j].idx = idx; + AllocatorTable[j].count = 1; + nTraces++; } } + /* bubble sort time! weeeeee!! */ - for (i = 0; i < n-1; i++) + for (i = 0; i < nTraces-1; i++) { - if (h[i].count < h[i+1].count) + if (AllocatorTable[i].count < AllocatorTable[i+1].count) { - struct DbgOpenGDIHandle t; - t = h[i+1]; - h[i+1] = h[i]; + struct DbgOpenGDIHandle temp; + + temp = AllocatorTable[i+1]; + AllocatorTable[i+1] = AllocatorTable[i]; j = i; - while (j > 0 && h[j-1].count < t.count) + while (j > 0 && AllocatorTable[j-1].count < temp.count) j--; - h[j] = t; + AllocatorTable[j] = temp; } } - /* print the worst offenders... */ - DbgPrint("Worst GDI Handle leak offenders (out of %i unique locations):\n", n); - for (i = 0; i < n && h[i].count > 1; i++) + + /* Print the worst offenders... */ + DbgPrint("Worst GDI Handle leak offenders (out of %i unique locations):\n", nTraces); + for (i = 0; i < nTraces && AllocatorTable[i].count > 1; i++) { /* Print out the allocation count */ - DbgPrint(" %i allocs: ", h[i].count); + DbgPrint(" %i allocs, type = 0x%lx:\n", + AllocatorTable[i].count, + GdiHandleTable->Entries[AllocatorTable[i].idx].Type); /* Dump the frames */ - KeRosDumpStackFrames(GDIHandleAllocator[h[i].idx], GDI_STACK_LEVELS); + KeRosDumpStackFrames(GDIHandleAllocator[AllocatorTable[i].idx], GDI_STACK_LEVELS); + //KeRosDumpStackFrames(GDIHandleShareLocker[AllocatorTable[i].idx], GDI_STACK_LEVELS); /* Print new line for better readability */ DbgPrint("\n"); } - if (i < n && h[i].count == 1) + + if (i < nTraces) DbgPrint("(list terminated - the remaining entries have 1 allocation only)\n"); + + KeLowerIrql(OldIrql); + + ASSERT(FALSE); } ULONG @@ -101,11 +137,13 @@ CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture) memset(pFrames, 0x00, (nFramesToCapture + 1) * sizeof(PVOID)); - nFrameCount = RtlCaptureStackBackTrace(1, nFramesToCapture, pFrames, NULL); + nFrameCount = RtlWalkFrameChain(pFrames, nFramesToCapture, 0); if (nFrameCount < nFramesToCapture) { - nFrameCount += RtlWalkFrameChain(pFrames + nFrameCount, nFramesToCapture - nFrameCount, 1); + nFrameCount += RtlWalkFrameChain(pFrames + nFrameCount, + nFramesToCapture - nFrameCount, + 1); } return nFrameCount; diff --git a/subsystems/win32/win32k/objects/gdiobj.c b/subsystems/win32/win32k/objects/gdiobj.c index 5af1413e69a..0f73d9b57cf 100644 --- a/subsystems/win32/win32k/objects/gdiobj.c +++ b/subsystems/win32/win32k/objects/gdiobj.c @@ -10,7 +10,7 @@ //#define GDI_DEBUG -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/icm.c b/subsystems/win32/win32k/objects/icm.c index 7a32146c0cb..dd99ea3d89d 100644 --- a/subsystems/win32/win32k/objects/icm.c +++ b/subsystems/win32/win32k/objects/icm.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/line.c b/subsystems/win32/win32k/objects/line.c index bbf60f426c4..173b3f91b25 100644 --- a/subsystems/win32/win32k/objects/line.c +++ b/subsystems/win32/win32k/objects/line.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/metafile.c b/subsystems/win32/win32k/objects/metafile.c index 573dde4b9dd..dbc62840154 100644 --- a/subsystems/win32/win32k/objects/metafile.c +++ b/subsystems/win32/win32k/objects/metafile.c @@ -8,7 +8,7 @@ /* INCLUDES ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/palette.c b/subsystems/win32/win32k/objects/palette.c index 61a50ec7ea7..8fcbbe4077c 100644 --- a/subsystems/win32/win32k/objects/palette.c +++ b/subsystems/win32/win32k/objects/palette.c @@ -7,7 +7,7 @@ * Timo Kreuzer */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/path.c b/subsystems/win32/win32k/objects/path.c index 1dfca39b381..7d6c796bdce 100644 --- a/subsystems/win32/win32k/objects/path.c +++ b/subsystems/win32/win32k/objects/path.c @@ -32,7 +32,7 @@ * PROGRAMMER: */ -#include +#include #include "math.h" #define NDEBUG diff --git a/subsystems/win32/win32k/objects/pen.c b/subsystems/win32/win32k/objects/pen.c index 6f604658107..8d02e9bdb0a 100644 --- a/subsystems/win32/win32k/objects/pen.c +++ b/subsystems/win32/win32k/objects/pen.c @@ -20,7 +20,7 @@ * $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/polyfill.c b/subsystems/win32/win32k/objects/polyfill.c index f5fdc53ed3f..1f6196a53af 100644 --- a/subsystems/win32/win32k/objects/polyfill.c +++ b/subsystems/win32/win32k/objects/polyfill.c @@ -27,7 +27,7 @@ * 21/2/2003: Created */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/print.c b/subsystems/win32/win32k/objects/print.c index bc56a2f3845..bf21047292f 100644 --- a/subsystems/win32/win32k/objects/print.c +++ b/subsystems/win32/win32k/objects/print.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/rect.c b/subsystems/win32/win32k/objects/rect.c index d98e79ca2dd..e3012185ca7 100644 --- a/subsystems/win32/win32k/objects/rect.c +++ b/subsystems/win32/win32k/objects/rect.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include @@ -102,5 +102,14 @@ RECTL_vMakeWellOrdered(RECTL *prcl) } } +VOID +FASTCALL +RECTL_vInflateRect(RECTL *rect, INT dx, INT dy) +{ + rect->left -= dx; + rect->top -= dy; + rect->right += dx; + rect->bottom += dy; +} /* EOF */ diff --git a/subsystems/win32/win32k/objects/region.c b/subsystems/win32/win32k/objects/region.c index 3922016c338..165f86a1625 100644 --- a/subsystems/win32/win32k/objects/region.c +++ b/subsystems/win32/win32k/objects/region.c @@ -113,7 +113,7 @@ SOFTWARE. * the y-x-banding that's so nice to have... */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/stockobj.c b/subsystems/win32/win32k/objects/stockobj.c index 40708b6ea1b..5499a6fd956 100644 --- a/subsystems/win32/win32k/objects/stockobj.c +++ b/subsystems/win32/win32k/objects/stockobj.c @@ -22,7 +22,7 @@ * */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/text.c b/subsystems/win32/win32k/objects/text.c index 14376a131ae..07cf12dcf21 100644 --- a/subsystems/win32/win32k/objects/text.c +++ b/subsystems/win32/win32k/objects/text.c @@ -8,7 +8,7 @@ /** Includes ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/wingl.c b/subsystems/win32/win32k/objects/wingl.c index 150a762a151..72add55b52b 100644 --- a/subsystems/win32/win32k/objects/wingl.c +++ b/subsystems/win32/win32k/objects/wingl.c @@ -18,7 +18,7 @@ */ /* $Id$ */ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/objects/xformobj.c b/subsystems/win32/win32k/objects/xformobj.c index 74453d58168..9ba7311ef06 100644 --- a/subsystems/win32/win32k/objects/xformobj.c +++ b/subsystems/win32/win32k/objects/xformobj.c @@ -8,7 +8,7 @@ /** Includes ******************************************************************/ -#include +#include #define NDEBUG #include diff --git a/subsystems/win32/win32k/pch.h b/subsystems/win32/win32k/pch.h index 4bbbeb9c148..90075c80058 100644 --- a/subsystems/win32/win32k/pch.h +++ b/subsystems/win32/win32k/pch.h @@ -60,7 +60,7 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; #include /* Internal Win32K Header */ -#include "include/win32k.h" +#include "include/win32kp.h" /* Undocumented stuff */ typedef DRIVEROBJ *PDRIVEROBJ; diff --git a/subsystems/win32/win32k/stubs/stubs.c b/subsystems/win32/win32k/stubs/stubs.c index a1e610bbd6c..82a8555354a 100644 --- a/subsystems/win32/win32k/stubs/stubs.c +++ b/subsystems/win32/win32k/stubs/stubs.c @@ -2,7 +2,7 @@ * Stubs for unimplemented WIN32K.SYS exports */ -#include +#include #define UNIMPLEMENTED DbgPrint("(%s:%i) WIN32K: %s UNIMPLEMENTED\n", __FILE__, __LINE__, __FUNCTION__ ) diff --git a/subsystems/win32/win32k/stubs/umpdstubs.c b/subsystems/win32/win32k/stubs/umpdstubs.c index 3ceadbb6e8c..9ecafb906af 100644 --- a/subsystems/win32/win32k/stubs/umpdstubs.c +++ b/subsystems/win32/win32k/stubs/umpdstubs.c @@ -1,4 +1,4 @@ -#include +#include #define UNIMPLEMENTED DbgPrint("(%s:%i) WIN32K: %s UNIMPLEMENTED\n", __FILE__, __LINE__, __FUNCTION__ ) diff --git a/subsystems/win32/win32k/w32k.h b/subsystems/win32/win32k/win32k.h similarity index 100% rename from subsystems/win32/win32k/w32k.h rename to subsystems/win32/win32k/win32k.h